KJB

#include <edge_points_likelihood.h>
Classes  
class  Matched_point 
class  Point 
Public Member Functions  
Correspondence (const kjb::Edge_set *data_edges, unsigned int num_rows, unsigned int num_cols, unsigned int num_angles, double angle_sigma, double dist_sigma, double max_dist)  
Creates a new correspondence between edge points and model points. For efficiency reasons, given a set of detected edge points in an image, we pre compute the penalties for each possible assignment of each edge point to any possible model point. We do it in the following way: For each edge point, follow the direction of the edge gradient computed at that point (do it until you don't get too far from the edge point). Each of the points in this direction is a potential match if a model point happens to be projected in that position. For each potential match we compute the distance penalty and the orientation penalty. We do it for all possible orientation of the model edge (the angle space is discretized into n bins). The distance penalty is also a function of the difference in orientation: we compute the distance between the model point and the generative approximation of the edge point, such that this latter lies both in the direction perpendicular to the edge gradient and in the direction of the model gradient). For more details please see Figure 5 and 6 in: http://vision.cs.arizona.edu/~schlecht/research/furniture/papers/schlecht2009b.pdf All of the above is done by the constructor. More...  
Correspondence (const Correspondence &c)  
Copy constructor. More...  
Correspondence &  operator= (const Correspondence &c) 
Assignment operator. More...  
const std::vector< std::vector < const Correspondence::Point * > > &  generate_for_model_from_map_and_edges (const Int_matrix &model_map, const std::vector< Model_edge > &model_edges, const std::vector< kjb::Int_vector > &edge_indexes, int edge_counter, int &num_sil_miss, int &num_inn_miss) 
Generates a correspondence set between the detected edge point and the given model points. model_map contains the model rendered onto the image plane. Each model edge is expected to be rendered with a color value equal to its id (that is the position of the edge in the input line_segment_set) More...  
void  generate_for_model_from_map_and_edges (const Int_matrix &model_map, const std::vector< Model_edge > &model_edges, const std::vector< kjb::Int_vector > &edge_indexes, std::vector< Correspondence::Matched_point > &matched_points, std::vector< std::vector< const Correspondence::Matched_point * > > &edge_pts_matched_corr, int edge_counter, int &num_sil_miss, int &num_inn_miss, int &num_flagged_miss, int &matched_counter, double inn_prob, double sil_prob) 
const std::vector< std::vector < const Correspondence::Point * > > &  generate_for_model (const kjb::Edge_set &model_edge_set) 
double  get_max_dist () const 
Returns the max distance allowed between a model point and edge point for them to be considered matched. More...  
const std::vector< std::vector < std::list< Point > > > &  get_model_corr () const 
Gets the correspondences associated to model points. More...  
Contains pointers to data edge point per cell.
Correspondence::Correspondence  (  const kjb::Edge_set *  data_edges, 
unsigned int  num_rows,  
unsigned int  num_cols,  
unsigned int  num_angles,  
double  angle_sigma,  
double  dist_sigma,  
double  max_dist  
) 
Creates a new correspondence between edge points and model points. For efficiency reasons, given a set of detected edge points in an image, we pre compute the penalties for each possible assignment of each edge point to any possible model point. We do it in the following way: For each edge point, follow the direction of the edge gradient computed at that point (do it until you don't get too far from the edge point). Each of the points in this direction is a potential match if a model point happens to be projected in that position. For each potential match we compute the distance penalty and the orientation penalty. We do it for all possible orientation of the model edge (the angle space is discretized into n bins). The distance penalty is also a function of the difference in orientation: we compute the distance between the model point and the generative approximation of the edge point, such that this latter lies both in the direction perpendicular to the edge gradient and in the direction of the model gradient). For more details please see Figure 5 and 6 in: http://vision.cs.arizona.edu/~schlecht/research/furniture/papers/schlecht2009b.pdf All of the above is done by the constructor.
Once this is done, given a set of model points we can compute the correspondence easily. This is done by function generate_for_model_from_map_and_edges
Correspondence::Correspondence  (  const Correspondence &  c  ) 
Copy constructor.
Copy constructor
c  the correspondence to copy into this one 
const std::vector< std::vector< const Correspondence::Point * > > & Correspondence::generate_for_model  (  const kjb::Edge_set &  model_edge_set  ) 
The returned structure is indexed by edge point, then correspondence point containing the model point info.
const std::vector< std::vector< const Correspondence::Point * > > & Correspondence::generate_for_model_from_map_and_edges  (  const Int_matrix &  model_map, 
const std::vector< Model_edge > &  model_edges,  
const std::vector< kjb::Int_vector > &  edge_indexes,  
int  edge_counter,  
int &  num_sil_miss,  
int &  num_inn_miss  
) 
Generates a correspondence set between the detected edge point and the given model points. model_map contains the model rendered onto the image plane. Each model edge is expected to be rendered with a color value equal to its id (that is the position of the edge in the input line_segment_set)
This finds the correspondence between a set of model edges and a set of image edges. The returned vector is indexed by edge point. For each edge point we have a list of all the model points that could be matched to it, sorted according to the distance between edge point and model point.
model_map  the model rendered onto the image plane. It is assumed that each edge was rendered with a color equal to its id 
void Correspondence::generate_for_model_from_map_and_edges  (  const Int_matrix &  model_map, 
const std::vector< Model_edge > &  model_edges,  
const std::vector< kjb::Int_vector > &  edge_indexes,  
std::vector< Correspondence::Matched_point > &  matched_points,  
std::vector< std::vector< const Correspondence::Matched_point * > > &  edge_pts_matched_corr,  
int  edge_counter,  
int &  num_sil_miss,  
int &  num_inn_miss,  
int &  num_sil_flagged,  
int &  matched_counter,  
double  inn_prob,  
double  sil_prob  
) 
This finds the correspondence between a set of model edges and a set of image edges. The returned vector is indexed by edge point. For each edge point we have a list of all the model points that could be matched to it, sorted according to the distance between edge point and model point.
model_map  the model rendered onto the image plane. It is assumed that each edge was rendered with a color equal to its id 

inline 
Returns the max distance allowed between a model point and edge point for them to be considered matched.

inline 
Gets the correspondences associated to model points.
Correspondence & Correspondence::operator=  (  const Correspondence &  c  ) 
Assignment operator.
Assignment operator
c  the correspondence to assign to this one 