voting_table Class Reference

Array being used in geometric hashing. More...

#include <voting_table.hh>

Inheritance diagram for voting_table:

Inheritance graph
[legend]
Collaboration diagram for voting_table:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 voting_table (const calibration_ptr &_calib, const mimas::mm_xml_reference< XalanElement > &geometricVotingNode, int _samplingRate, int _fringe, short int minGradient, geometric_map_ptr _hash_map, bool _verbose)
 Configure table.
std::vector< std::pair< mi_pose,
double > > 
recognise (const mimas::mm_image< bool > &scene_features, const std::vector< boost::numeric::ublas::vector< int > > &points, const mi_pose &poseInv, geometric_voting_statistics *statistic) const
 Generate match for a point-pair.
double get_z_resolution (void) const
 Z-Resolution.
geometric_map_ptr get_hash_map (void) const
 Get pointer to object for generating hash-functions.

Protected Member Functions

mi_pose pose2d (const mi_pose &pose, int x, int y) const
 Convert 4-DOF transformation to two-dimensional transformation.
int pose_depth (const mi_pose &pose) const
 Extract stack-level from 4-DOF transformation.
mi_pose pose3d (const mi_pose &pose, int x, int y, int z) const
 Convert two-dimensional transformation to transformation with 4-DOF.
bool verification (const mimas::mm_image< bool > &scene_features, const mi_pose &objectPose, geometric_voting_statistics *statistic) const
 Verify a hypothesis.

Protected Attributes

calibration_ptr calib
 Calibration data.
int sampling_rate
 Sampling-rate.
int fringe
 Fringe.
double min_hits
 Minimum fraction of matching features for a hypothesis.
double max_misses
 Maximum fraction of unmatched features for a hypothesis.
int skip
 Number of images being skipped from shared focus stack.
double z_resolution
 Z-Resolution of focus stack.
std::vector< std::vector<
boost::numeric::ublas::vector<
int > > > 
points_stack
 Feature lists.
int max_num_features
 Maximum number of features.
boost::multi_array< std::map<
int, int >, 2 > 
hash_table
 Table with votes.
std::vector< mi_posecandidates
 Candidate list.
geometric_map_ptr hash_map
 Hash functions.
bool verbose
mimas::mm_image_qtoutput<
mimas::mm_rgba< unsigned
char > > 
display
 Display for debugging purposes.

Detailed Description

Array being used in geometric hashing.

An object of this class holds the table for recognizing one object with four degrees of freedom.

See also:
geometric_voting
Author:
Jan Wedekind (j.wedekind@shu.ac.uk)


Constructor & Destructor Documentation

voting_table::voting_table const calibration_ptr &  _calib,
const mimas::mm_xml_reference< XalanElement > &  geometricVotingNode,
int  _samplingRate,
int  _fringe,
short int  minGradient,
geometric_map_ptr  _hash_map,
bool  _verbose
 

Configure table.

Creates the table with votes for a single type of micro-object.

Parameters:
geometricVotingNode XML-node referencing a node with X-path database/object-type/recognition/geometric-voting.
_calib Calibration data.
geometricVotingNode Root-node of part of XML-document for initialisation.
_samplingRate Sampling rate for sub-sampling the images.
_fringe Size of fringe to be discarded from image.
minGradient Threshold to select gradient-points.
_hash_map Object for computing hash-functions.
_verbose Set to true, if you want to get verbose information from the vision-algorithms.


Member Function Documentation

geometric_map_ptr voting_table::get_hash_map void   )  const [inline]
 

Get pointer to object for generating hash-functions.

See also:
geometric_map

double voting_table::get_z_resolution void   )  const [inline]
 

Z-Resolution.

Get distance between the focussed planes of two consecutive images of the focus stack.

Returns:
z-resolution of focus stack.

mi_pose voting_table::pose2d const mi_pose pose,
int  x,
int  y
const [protected]
 

Convert 4-DOF transformation to two-dimensional transformation.

This does the inverse of the pose3d method.

Parameters:
pose 3-dimensional transformation.
x x-offset (pixels) to be added to coordinates.
y y-offset (pixels) to be added to coordinates.
See also:
pose3d

mi_pose voting_table::pose3d const mi_pose pose,
int  x,
int  y,
int  z
const [protected]
 

Convert two-dimensional transformation to transformation with 4-DOF.

The transformation-matrix and -vector are made 3-dimensional. The 4th degree of freedom (z-translation) is added.

Parameters:
pose 2-dimensional transformation.
x x-offset (pixels) to be subtracted from coordinates.
y y-offset (pixels) to be subtracted from coordinates.
z Additional unit-less translation in z-direction.
See also:
Units

pose2d

int voting_table::pose_depth const mi_pose pose  )  const [protected]
 

Extract stack-level from 4-DOF transformation.

The following condition always should hold:

      pose_depth( pose3d( anyPose, z ) ) == z

std::vector< std::pair< mi_pose, double > > voting_table::recognise const mimas::mm_image< bool > &  scene_features,
const std::vector< boost::numeric::ublas::vector< int > > &  points,
const mi_pose poseInv,
geometric_voting_statistics *  statistic
const
 

Generate match for a point-pair.

This method finds the best match for a single point-pair. The number of votes for all possible poses is accumulated and the best is returned.

Parameters:
scene_features Image of features.
points List of the 2-D features.
poseInv randomly generated pose for using as hash-function.
maxHitsReached This is used for generating verbose output only.
minHitsCounter This is used for generating verbose output only.
minMissesReached This is used for generating verbose output only.
maxMissesCounter This is used for generating verbose output only.
Returns:
Vector containing poses and fit-values of the matches with sufficient hits.
See also:
min_hits

bool voting_table::verification const mimas::mm_image< bool > &  scene_features,
const mi_pose objectPose,
geometric_voting_statistics *  statistic
const [protected]
 

Verify a hypothesis.

After a hypothesis was formed, it is verified by projecting the object's features on the image and checking, wether most of them are there.

Parameters:
scene_features Image of scene-features.
objectPose 4-DOF pose of object.
minMissesReached This is used for generating verbose output only.
maxMissesCounter This is used for generating verbose output only.


Member Data Documentation

std::vector< mi_pose > voting_table::candidates [protected]
 

Candidate list.

Each candidate is a different possible pose of the object (relative to a randomly selected point of pairs).

geometric_map_ptr voting_table::hash_map [protected]
 

Hash functions.

Functionality for generating transformations from features.

boost::multi_array< std::map< int, int >, 2 > voting_table::hash_table [protected]
 

Table with votes.

The table is two-dimensional and each element is a map, assigning mapping candidate-indices on number of votes.

See also:
candidates

double voting_table::max_misses [protected]
 

Maximum fraction of unmatched features for a hypothesis.

The maximum allowed number of features not being found in the scene. This number is used in the verification step.

See also:
verification

int voting_table::max_num_features [protected]
 

Maximum number of features.

Number of features of the stack-image, with has the most.

double voting_table::min_hits [protected]
 

Minimum fraction of matching features for a hypothesis.

A match with a lower number of hits has to be discarded immediately.

std::vector< std::vector< boost::numeric::ublas::vector< int > > > voting_table::points_stack [protected]
 

Feature lists.

The features of each image of the micro-object's focus-stack is stored as an element of this list.

int voting_table::skip [protected]
 

Number of images being skipped from shared focus stack.

An additional offset has to be taken into account, if only a part of the original focus stack is being used.

double voting_table::z_resolution [protected]
 

Z-Resolution of focus stack.

Distance between the focussed planes of two consecutive images of the focus stack.


The documentation for this class was generated from the following file:
doxygen-1.4.5 documentation for micron-vision - Tue Jan 17 15:29:15 2006