KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
kjb::Independent_edge_points_likelihood Class Reference

#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
 
Correspondenceget_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_setget_data_edges () const
 
bool get_delete_correspondence () const
 
void set_delete_correspondence (bool idelete_correspondence)
 

Member Enumeration Documentation

Enumerator
FROM_MAP_AND_EDGES 
FROM_EDGE_POINTS 

Constructor & Destructor Documentation

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.

Parameters
idata_edgesThe set of edges to compare against, detected from an image
num_anglesWhen matching edges, we penalize their difference in orientation. The penalty is discretized in num_angles bins
num_rowsThe number of rows of the image
num_colsThe number of columns of the image
angle_sigmathe sigma for the gaussian used to compute the penalty associated to the difference in orientation between model edge and detected edge
dist_sigmathe 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_distThe 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_probThe probability that a point in an image is background (ie not part of an edge).
inoise_probThe 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_probThe 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_probSame 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

Parameters
srcThe likelihood to copy into this one
kjb::Independent_edge_points_likelihood::~Independent_edge_points_likelihood ( )
inline

Member Function Documentation

template<class T >
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

Parameters
modelThe model to compute the likelihood for
modeMode 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.
template<class T , class U >
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.

Parameters
modelThe model to compute the likelihood for
cameraThe camera to be used to render the model
modeMode 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.
template<class T , class U >
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.

template<class T , class U , class V >
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.

template<class T , class U , class V >
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

Correspondence* kjb::Independent_edge_points_likelihood::get_correspondence ( )
inline

Returns the assignment matrix.

Returns the correspondence manager

const kjb::Edge_set* kjb::Independent_edge_points_likelihood::get_data_edges ( ) const
inline
bool kjb::Independent_edge_points_likelihood::get_delete_correspondence ( ) const
inline
double kjb::Independent_edge_points_likelihood::get_num_points_ratio ( )
inline
double kjb::Independent_edge_points_likelihood::get_total_components_ratio ( )
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)

Parameters
model_mapcontains the rendering of the model as described above
model_edgesthe 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.

Parameters
model_edge_setThe 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
void kjb::Independent_edge_points_likelihood::set_delete_correspondence ( bool  idelete_correspondence)
inline

The documentation for this class was generated from the following files: