Shapiro & Brady's point correspondence algorithm. More...
#include <mbl_correspond_points.h>
Public Member Functions | |
mbl_correspond_points () | |
Dflt ctor. | |
void | correspond (const vcl_vector< vgl_point_2d< double > > &points1, const vcl_vector< vgl_point_2d< double > > &points2, vcl_vector< unsigned > &matches, double sigma) |
Find best correspondence between points1 and points2. | |
void | proximity_by_tanh (const vcl_vector< vgl_point_2d< double > > &points, vnl_matrix< double > &H, double sigma) |
Construct proximity matrix using cosh kernel. | |
const vnl_vector< double > & | evals1 () const |
Eigenvalues of proximity matrix 1 in last call to correspond. | |
const vnl_vector< double > & | evals2 () const |
Eigenvalues of proximity matrix 2 in last call to correspond. | |
Private Member Functions | |
unsigned | closest_row (const vnl_matrix< double > &H1, const vnl_matrix< double > &H2, unsigned i) |
Return index of row in H2 most similar to row i of H1. | |
void | fix_eigenvectors (vnl_matrix< double > &P) |
Ensure each column vector points in the same way. | |
Private Attributes | |
vnl_vector< double > | evals1_ |
Eigenvalues of proximity matrix 1. | |
vnl_vector< double > | evals2_ |
Eigenvalues of proximity matrix 2. |
Shapiro & Brady's point correspondence algorithm.
Includes improvements by Carcassoni and Hancock (a robust kernel in the distance metric).
Note that current version can't cope with different numbers of points. Need to re-order eigenvectors by absolute magnitude of eigenvalues. I'll do this soon - Tim.
Definition at line 20 of file mbl_correspond_points.h.
mbl_correspond_points::mbl_correspond_points | ( | ) |
Dflt ctor.
Definition at line 18 of file mbl_correspond_points.cxx.
unsigned mbl_correspond_points::closest_row | ( | const vnl_matrix< double > & | H1, |
const vnl_matrix< double > & | H2, | ||
unsigned | i | ||
) | [private] |
Return index of row in H2 most similar to row i of H1.
Definition at line 23 of file mbl_correspond_points.cxx.
void mbl_correspond_points::correspond | ( | const vcl_vector< vgl_point_2d< double > > & | points1, |
const vcl_vector< vgl_point_2d< double > > & | points2, | ||
vcl_vector< unsigned > & | matches, | ||
double | sigma | ||
) |
Find best correspondence between points1 and points2.
On exit, matches[i] gives index of points2 which corresponds to points1[i]. Note that there may be a many to one correspondence produced.
sigma | Scaling factor defining kernel width |
On exit, matches[i] gives index of points2 which corresponds to points1[i].
sigma | Scaling factor defining kernel width |
Definition at line 64 of file mbl_correspond_points.cxx.
const vnl_vector<double>& mbl_correspond_points::evals1 | ( | ) | const [inline] |
Eigenvalues of proximity matrix 1 in last call to correspond.
Definition at line 59 of file mbl_correspond_points.h.
const vnl_vector<double>& mbl_correspond_points::evals2 | ( | ) | const [inline] |
Eigenvalues of proximity matrix 2 in last call to correspond.
Definition at line 62 of file mbl_correspond_points.h.
void mbl_correspond_points::fix_eigenvectors | ( | vnl_matrix< double > & | P | ) | [private] |
Ensure each column vector points in the same way.
Unit eigenvectors can point in one of two directions. Ensure p.1>=0 to obtain consistancy.
Definition at line 51 of file mbl_correspond_points.cxx.
void mbl_correspond_points::proximity_by_tanh | ( | const vcl_vector< vgl_point_2d< double > > & | points, |
vnl_matrix< double > & | H, | ||
double | sigma | ||
) |
Construct proximity matrix using cosh kernel.
Construct distance matrix using cosh kernel.
On exit, D(i,j) = tanh(pi*d_ij/sigma) * 2/(pi*d_ij) where d_ij is the distance between points i and j
Definition at line 102 of file mbl_correspond_points.cxx.
vnl_vector<double> mbl_correspond_points::evals1_ [private] |
Eigenvalues of proximity matrix 1.
Definition at line 24 of file mbl_correspond_points.h.
vnl_vector<double> mbl_correspond_points::evals2_ [private] |
Eigenvalues of proximity matrix 2.
Definition at line 26 of file mbl_correspond_points.h.