KJB
|
#include <edge_points_likelihood.h>
Public Types | |
enum | Likelihood_mode { FROM_MAP_AND_EDGES = 0, FROM_EDGE_POINTS } |
Public Member Functions | |
Independent_edge_points_likelihood (const kjb::Edge_set *data_edges, int num_angles, unsigned int num_rows, unsigned int num_cols, double angle_sigma, double dist_sigma, double max_dist, double bg_prob, double noise_prob, double silho_miss_prob, double inner_miss_prob, bool idelete_correspondence=true) | |
Independent_edge_points_likelihood (const Independent_edge_points_likelihood &src) | |
Copy constructor: Notice that this is not efficient. You probably will not need to copy this class very often, however you will experience that copying this class is still faster that creating it twice. More... | |
~Independent_edge_points_likelihood () | |
double | operator() (const Edge_set &model_edge_set) const |
Calculates the log likelihood of the image edge set (set in the constructor) given the model edges. More... | |
double | old_operator (Int_matrix &model_map, const std::vector< Model_edge > &model_edges, const std::vector< kjb::Int_vector > &external_edge_indexes, int external_edge_counter) const |
Calculates the log likelihood of the image edge set given the rendering of the model onto the image plane (model_map) and the set of the model edges. We assumed that each edge was rendered onto the image plane with a color equal to its id (ie its position in the line_segment_set) More... | |
double | new_operator (Int_matrix &model_map, const std::vector< Model_edge > &model_edges, const std::vector< kjb::Int_vector > &external_edge_indexes, int external_edge_counter) const |
double | operator() (Int_matrix &model_map, const std::vector< Model_edge > &model_edges, const std::vector< kjb::Int_vector > &external_edge_indexes, int external_edge_counter) const |
double | operator() (Int_matrix &model_map, const std::vector< Model_edge > &model_edges) const |
Correspondence * | get_correspondence () |
Returns the assignment matrix. More... | |
template<class T > | |
double | compute_likelihood (T &model, unsigned int mode=FROM_MAP_AND_EDGES) |
Template function to compute the likelihood for a generic model. The input model must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline. More... | |
template<class T , class U > | |
double | compute_likelihood (T &model, U &camera, unsigned int mode=FROM_MAP_AND_EDGES) |
Template function to compute the likelihood for a generic model under a given camera. The input model, with the camera, must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline. More... | |
template<class T , class U > | |
double | compute_likelihood (T &model, U &camera, Int_matrix &model_map, unsigned int mode=FROM_MAP_AND_EDGES) |
Template function to compute the likelihood for a generic model under a given camera. The input model, with the camera, must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline. Here we expect to receive the model_map as an input too. More... | |
template<class T , class U , class V > | |
double | compute_likelihood (T &model, U &camera, Int_matrix &model_map, V *auxiliary_structure, unsigned int mode=FROM_MAP_AND_EDGES) |
Template function to compute the likelihood for a generic model under a given camera. The input model, with the camera, must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline. Here we expect to receive the model_map as an input too. More... | |
template<class T , class U , class V > | |
double | compute_likelihood (T &model, U &camera, Int_matrix &model_map, V *auxiliary_structure, const std::vector< kjb::Int_vector > &external_edge_indexes, int external_edge_counter, int single_object=-1, unsigned int mode=FROM_MAP_AND_EDGES) |
void | draw_edge_set_using_mask (Image &img) |
double | find_log_max (double dist_sigma, double angle_sigma) |
double | get_num_points_ratio () |
double | get_total_components_ratio () |
const kjb::Edge_set * | get_data_edges () const |
bool | get_delete_correspondence () const |
void | set_delete_correspondence (bool idelete_correspondence) |
Independent_edge_points_likelihood::Independent_edge_points_likelihood | ( | const kjb::Edge_set * | idata_edges, |
int | num_angles, | ||
unsigned int | num_rows, | ||
unsigned int | num_cols, | ||
double | angle_sigma, | ||
double | dist_sigma, | ||
double | max_dist, | ||
double | bg_prob, | ||
double | inoise_prob, | ||
double | silho_miss_prob, | ||
double | inner_miss_prob, | ||
bool | idelete_correspondence = true |
||
) |
Constructs a class for computing the likelihood of a set of image detected edges and a different set of edges, arising from backprojecting a 3D model onto the image plane. Model edge points are matched to image edge points independently, as described in class Correspondence.
idata_edges | The set of edges to compare against, detected from an image |
num_angles | When matching edges, we penalize their difference in orientation. The penalty is discretized in num_angles bins |
num_rows | The number of rows of the image |
num_cols | The number of columns of the image |
angle_sigma | the sigma for the gaussian used to compute the penalty associated to the difference in orientation between model edge and detected edge |
dist_sigma | the sigma for the gaussian used to compute the penalty associated to the distance between the model point and the edge point, computed along the edge gradient |
max_dist | The max distance between an edge point and a model point. If their distance is bigger than max_distance, a model point cannot be assigned to an edge point |
bg_prob | The probability that a point in an image is background (ie not part of an edge). |
inoise_prob | The probability of detecting noise in a pixel of the image (ie the probability of detecting an edge point where there should not be any) |
silho_miss_prob | The probability of not having any image detected edge explaining a particular point of the model backprojected onto the image plane. The model edge is part of the silhouette of an object, so it should be pretty sharp, and the probability of such misdetection should be relatively low |
inner_miss_prob | Same as above, but the model edge is not part of the silhouette (inner edge), so it is likely to be a weak edge, and the probability of such misdetection should be higher than that of a silhouette edge |
Independent_edge_points_likelihood::Independent_edge_points_likelihood | ( | const Independent_edge_points_likelihood & | src | ) |
Copy constructor: Notice that this is not efficient. You probably will not need to copy this class very often, however you will experience that copying this class is still faster that creating it twice.
Copy constructor. Notice that this is not efficient. You probably will not need to copy this class very often, however you will experience that copying this class is still faster that creating it twice
src | The likelihood to copy into this one |
|
inline |
double kjb::Independent_edge_points_likelihood::compute_likelihood | ( | T & | model, |
unsigned int | mode = FROM_MAP_AND_EDGES |
||
) |
Template function to compute the likelihood for a generic model. The input model must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline.
Template function to compute the likelihood for a generic model. The input model must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline
model | The model to compute the likelihood for |
mode | Mode for likelihood computation. 0 means that the likelihood will be computed by generating a model map and a set of edges from the model and the camera, 1 means that we will generate a set of edge points. |
double kjb::Independent_edge_points_likelihood::compute_likelihood | ( | T & | model, |
U & | camera, | ||
unsigned int | mode = FROM_MAP_AND_EDGES |
||
) |
Template function to compute the likelihood for a generic model under a given camera. The input model, with the camera, must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline.
model | The model to compute the likelihood for |
camera | The camera to be used to render the model |
mode | Mode for likelihood computation. 0 means that the likelihood will be computed by generating a model map and a set of edges from the model and the camera, 1 means that we will generate a set of edge points. |
double kjb::Independent_edge_points_likelihood::compute_likelihood | ( | T & | model, |
U & | camera, | ||
Int_matrix & | model_map, | ||
unsigned int | mode = FROM_MAP_AND_EDGES |
||
) |
Template function to compute the likelihood for a generic model under a given camera. The input model, with the camera, must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline. Here we expect to receive the model_map as an input too.
double kjb::Independent_edge_points_likelihood::compute_likelihood | ( | T & | model, |
U & | camera, | ||
Int_matrix & | model_map, | ||
V * | auxiliary_structure, | ||
unsigned int | mode = FROM_MAP_AND_EDGES |
||
) |
Template function to compute the likelihood for a generic model under a given camera. The input model, with the camera, must be able to generate a model map and a set of model edges, or an edgeset (those are the two kind of features we can compute a likelihood for so far). Most of the time, you will likely write a specialization for this function, this is mostly a guideline. Here we expect to receive the model_map as an input too.
double kjb::Independent_edge_points_likelihood::compute_likelihood | ( | T & | model, |
U & | camera, | ||
Int_matrix & | model_map, | ||
V * | auxiliary_structure, | ||
const std::vector< kjb::Int_vector > & | external_edge_indexes, | ||
int | external_edge_counter, | ||
int | single_object = -1 , |
||
unsigned int | mode = FROM_MAP_AND_EDGES |
||
) |
void Independent_edge_points_likelihood::draw_edge_set_using_mask | ( | Image & | img | ) |
For debug purposes
double Independent_edge_points_likelihood::find_log_max | ( | double | dist_sigma, |
double | angle_sigma | ||
) |
Finds the maximum value of the likelihood
|
inline |
Returns the assignment matrix.
Returns the correspondence manager
|
inline |
|
inline |
|
inline |
|
inline |
double Independent_edge_points_likelihood::new_operator | ( | Int_matrix & | model_map, |
const std::vector< Model_edge > & | model_edges, | ||
const std::vector< kjb::Int_vector > & | external_edge_indexes, | ||
int | external_edge_counter | ||
) | const |
double Independent_edge_points_likelihood::old_operator | ( | Int_matrix & | model_map, |
const std::vector< Model_edge > & | model_edges, | ||
const std::vector< kjb::Int_vector > & | external_edge_indexes, | ||
int | external_edge_counter | ||
) | const |
Calculates the log likelihood of the image edge set given the rendering of the model onto the image plane (model_map) and the set of the model edges. We assumed that each edge was rendered onto the image plane with a color equal to its id (ie its position in the line_segment_set)
model_map | contains the rendering of the model as described above |
model_edges | the list of model edges as described above |
double Independent_edge_points_likelihood::operator() | ( | const Edge_set & | model_edge_set | ) | const |
Calculates the log likelihood of the image edge set (set in the constructor) given the model edges.
Calculates the log likelihood of the image edge set by comparing it to another edge set. Usually this data comes from rendering a model onto the image plane.
model_edge_set | The edge set to compare to |
double Independent_edge_points_likelihood::operator() | ( | Int_matrix & | model_map, |
const std::vector< Model_edge > & | model_edges, | ||
const std::vector< kjb::Int_vector > & | external_edge_indexes, | ||
int | external_edge_counter | ||
) | const |
double Independent_edge_points_likelihood::operator() | ( | Int_matrix & | model_map, |
const std::vector< Model_edge > & | model_edges | ||
) | const |
|
inline |