Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

fhs_searcher Class Reference

#include <fhs_searcher.h>

List of all members.


Detailed Description

Use F&H's DP style algorithm to search for global solutions to model match.

Model consists of a set of features, together with a tree of neighbour relationships of the form pos(j) = pos(i) + (N(mx,var_x),N(my,var_y)) where N(m,var) is a gaussian with mean m and variance var.

The aim is to find a set of points {p(i)} which minimise sum_i F_i(p(i)) + sum_k shape_cost(arc(k)) where k indexes the set of arcs defining neighbour relationships, and shape_cost(arc) = dx*dx/arc.var_x + dy*dy.var_y (dx=p(arc_j).x()-p(arc_i).x()-arc.mx) This is achieved using a combination of a quadratic distance function applied to each feature response image F(i), and a dynamic programming approach to combining the data.

Algorithm based on papers by Felzenszwalb and Huttenlocher on Pictoral Structure Matching.

Definition at line 27 of file fhs_searcher.h.

Public Member Functions

 fhs_searcher ()
 Default constructor.
void set_tree (const vcl_vector< fhs_arc > &arcs, unsigned root_node)
 Set tree defining relationships between features.
unsigned root_node () const
 Index of root node (set by last call to set_tree().
unsigned n_points () const
 Number of points represented.
void search (const vcl_vector< vimt_image_2d_of< float > > &feature_response)
 Perform global search.
void points_from_root (const vgl_point_2d< double > &root_pt, vcl_vector< vgl_point_2d< double > > &pts) const
 Compute optimal position of all points given position of root.
double best_points (vcl_vector< vgl_point_2d< double > > &pts) const
 Compute optimal position of all points.
const vimt_image_2d_of< float > & root_cost_image () const
 Return final total cost image for root.

Private Member Functions

void combine_responses (unsigned im_index, const vimt_image_2d_of< float > &feature_response)
 Combine responses for image im_index, given supplied feature_response for that node.

Private Attributes

vcl_vector< fhs_arcarc_
 Arcs defining neighbour relationships between features.
vcl_vector< unsigned > arc_to_j_
 arc_to_j_[j] gives index of arc ending at given j.
vcl_vector< vcl_vector< unsigned > > children_
 children_[i] gives list of child nodes of node i in tree.
vcl_vector< vimt_image_2d_of<
float > > 
sum_im_
 Workspace for accumulated sum of responses.
vcl_vector< vimt_image_2d_of<
float > > 
dist_im_
 Workspace for sum of responses, transformed by distance function.
vcl_vector< vimt_image_2d_of<
int > > 
pos_im_
 pos_[i](x,y,0),pos_[i](x,y,1) is position of best response for (x,y).


Constructor & Destructor Documentation

fhs_searcher::fhs_searcher  ) 
 

Default constructor.

Definition at line 16 of file fhs_searcher.cxx.


Member Function Documentation

double fhs_searcher::best_points vcl_vector< vgl_point_2d< double > > &  pts  )  const
 

Compute optimal position of all points.

Assumes search() has been called first Returns cost at optimal position

Definition at line 237 of file fhs_searcher.cxx.

void fhs_searcher::combine_responses unsigned  im_index,
const vimt_image_2d_of< float > &  feature_response
[private]
 

Combine responses for image im_index, given supplied feature_response for that node.

Definition at line 46 of file fhs_searcher.cxx.

unsigned fhs_searcher::n_points  )  const [inline]
 

Number of points represented.

Definition at line 67 of file fhs_searcher.h.

void fhs_searcher::points_from_root const vgl_point_2d< double > &  root_pt,
vcl_vector< vgl_point_2d< double > > &  pts
const
 

Compute optimal position of all points given position of root.

Assumes search() has been called first

Definition at line 190 of file fhs_searcher.cxx.

const vimt_image_2d_of< float > & fhs_searcher::root_cost_image  )  const
 

Return final total cost image for root.

Definition at line 248 of file fhs_searcher.cxx.

unsigned fhs_searcher::root_node  )  const
 

Index of root node (set by last call to set_tree().

Definition at line 39 of file fhs_searcher.cxx.

void fhs_searcher::search const vcl_vector< vimt_image_2d_of< float > > &  feature_response  ) 
 

Perform global search.

Images of feature response supplied. The transformation (world2im()) for each image can be used to indicate regions which don't necessarily overlap. However, effective displacements are assumed to be in pixel sized steps.

After calling search(), results can be obtained using points() and best_points() etc

Definition at line 145 of file fhs_searcher.cxx.

void fhs_searcher::set_tree const vcl_vector< fhs_arc > &  arcs,
unsigned  root_node
 

Set tree defining relationships between features.

Input arcs define neighbour relationships in any order. root_node defines which feature to be used as the root

Definition at line 23 of file fhs_searcher.cxx.


Member Data Documentation

vcl_vector<fhs_arc> fhs_searcher::arc_ [private]
 

Arcs defining neighbour relationships between features.

Ordered so that parents precede children

Definition at line 32 of file fhs_searcher.h.

vcl_vector<unsigned> fhs_searcher::arc_to_j_ [private]
 

arc_to_j_[j] gives index of arc ending at given j.

Definition at line 35 of file fhs_searcher.h.

vcl_vector<vcl_vector<unsigned> > fhs_searcher::children_ [private]
 

children_[i] gives list of child nodes of node i in tree.

Definition at line 38 of file fhs_searcher.h.

vcl_vector<vimt_image_2d_of<float> > fhs_searcher::dist_im_ [private]
 

Workspace for sum of responses, transformed by distance function.

Definition at line 44 of file fhs_searcher.h.

vcl_vector<vimt_image_2d_of<int> > fhs_searcher::pos_im_ [private]
 

pos_[i](x,y,0),pos_[i](x,y,1) is position of best response for (x,y).

Result is in image co-ordinates.

Definition at line 48 of file fhs_searcher.h.

vcl_vector<vimt_image_2d_of<float> > fhs_searcher::sum_im_ [private]
 

Workspace for accumulated sum of responses.

Definition at line 41 of file fhs_searcher.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:44:46 2008 for contrib/mul/fhs by  doxygen 1.4.4