Public Member Functions | Private Member Functions | Private Attributes
m23d_ortho_rigid_builder Class Reference

Reconstruct 3D point positions given multiple 2D orthographic projections. More...

#include <m23d_ortho_rigid_builder.h>

List of all members.

Public Member Functions

void reconstruct (const vnl_matrix< double > &P2D)
 Reconstruct structure of 3D points given multiple 2D views.
void reconstruct (const vcl_vector< vcl_vector< vgl_point_2d< double > > > &pt_vec_list)
 Reconstruct structure from set of 2d pts.
void refine ()
 Refine estimates of projection and structure.
const vnl_matrix< double > & shape_3d () const
 Return 3 x np matrix, each column containing one 3D point.
const vnl_matrix< double > & projections () const
 The 2ns x 3 projection matrix.
const vnl_matrix< double > & centred_views () const
 Centred version of the 2D views supplied to reconstruct().
void get_shape_3d_pts (vcl_vector< vgl_point_3d< double > > &pts) const
 Return 3d pts given 3*np matrix.
void recon_shapes (vcl_vector< vcl_vector< vgl_point_3d< double > > > &pt_vec_list) const
 Get back 3d pts rotated and shifted for each frame.
void flip_z_coords ()
 Flip z coords.

Private Member Functions

void make_pure_projections ()
 Modify projection matrices so they are scaled orthographic projections.
void find_correction_matrix (vnl_matrix< double > &Q, const vnl_matrix< double > &P)
 find matrix Q using constraints on matrix P which must contain orthonormal projects in each (2*3) submatrix for each frame.
void compute_one_row_of_constraints (vnl_vector< double > &c, const vnl_vector< double > &a, const vnl_vector< double > &b)
 find matrix Q using constraints on matrix P which must contain.
void find_correction_matrix_alt (vnl_matrix< double > &Q, const vnl_matrix< double > &P)
 find matrix Q using constraints on matrix P which must contain orthonormal projects in each (2*3) submatrix for each frame.
void mat_to_3d_pts (vcl_vector< vgl_point_3d< double > > &pts, const vnl_matrix< double > &M) const
 Return 3d pts given 3*np matrix.

Private Attributes

vnl_matrix< double > P3D_
 3 x np matrix, each column containing one 3D point.
vnl_matrix< double > P_
 The 2ns x 3 projection matrix.
vcl_vector< vgl_point_2d
< double > > 
cog_
 The CoG of each shape supplied to reconstruct().
vnl_matrix< double > P2Dc_
 Centred version of the 2D views supplied to reconstruct().

Detailed Description

Reconstruct 3D point positions given multiple 2D orthographic projections.

Implementation of the Tomasi & Kanade reconstruction algorithm. Generates projection matrix, P, and 3D point matrix P3D, such that P2D = P.P3D. Uncertainty in projection is constrained by setting the projection for the first shape to the identity (1 0 0; 0 1 0)

The ambiguity in the sign of the z ordinates is fixed by arranging that the first non-zero z ordinate should be negative.

Note that the 2D point sets will be normalised so that their CoG is at the origin. The resulting 3D shape will also have its CoG at the origin.

changes by dac (Jan 08)

Definition at line 32 of file m23d_ortho_rigid_builder.h.


Member Function Documentation

const vnl_matrix<double>& m23d_ortho_rigid_builder::centred_views ( ) const [inline]

Centred version of the 2D views supplied to reconstruct().

Each 2D shape has been translated so that its CoG is at the origin

Definition at line 106 of file m23d_ortho_rigid_builder.h.

void m23d_ortho_rigid_builder::compute_one_row_of_constraints ( vnl_vector< double > &  c,
const vnl_vector< double > &  a,
const vnl_vector< double > &  b 
) [private]

find matrix Q using constraints on matrix P which must contain.

find matrix Q using constraints on matrix P which must contain from two rows of a projection matrix (a+b) find six constraints used to compute (QQt) symmetric matrix.

From two rows of a projection matrix (a+b) find six constraints used to compute (QQt) symmetric matrix

Definition at line 391 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::find_correction_matrix ( vnl_matrix< double > &  Q,
const vnl_matrix< double > &  P 
) [private]

find matrix Q using constraints on matrix P which must contain orthonormal projects in each (2*3) submatrix for each frame.

Definition at line 284 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::find_correction_matrix_alt ( vnl_matrix< double > &  Q,
const vnl_matrix< double > &  P 
) [private]

find matrix Q using constraints on matrix P which must contain orthonormal projects in each (2*3) submatrix for each frame.

find matrix Q using constraints on matrix P which must contain orthonormal projects in each (2*3) submatrix for each frame old method.

old method

Definition at line 209 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::flip_z_coords ( )

Flip z coords.

may need to do this to fix z coord ambiguity

Definition at line 191 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::get_shape_3d_pts ( vcl_vector< vgl_point_3d< double > > &  pts) const

Return 3d pts given 3*np matrix.

Get back 3d pts rotated and shifted for each frame.

Definition at line 499 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::make_pure_projections ( ) [private]

Modify projection matrices so they are scaled orthographic projections.

$ P = s(I|0)*R $

Definition at line 407 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::mat_to_3d_pts ( vcl_vector< vgl_point_3d< double > > &  pt_vec,
const vnl_matrix< double > &  M 
) const [private]

Return 3d pts given 3*np matrix.

Return 3d rigid pts.

I.e., aligned with first frame

Definition at line 438 of file m23d_ortho_rigid_builder.cxx.

const vnl_matrix<double>& m23d_ortho_rigid_builder::projections ( ) const [inline]

The 2ns x 3 projection matrix.

Each 2x3 sub-matrix is a scaled orthographic projection matrix

Definition at line 102 of file m23d_ortho_rigid_builder.h.

void m23d_ortho_rigid_builder::recon_shapes ( vcl_vector< vcl_vector< vgl_point_3d< double > > > &  pt_vec_list) const

Get back 3d pts rotated and shifted for each frame.

Definition at line 460 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::reconstruct ( const vnl_matrix< double > &  P2D)

Reconstruct structure of 3D points given multiple 2D views.

Data assumed to be scaled orthographic projections The result is stored in the shape_3d() matrix. The estimated projection matrices are stored in the projections() matrix

Parameters:
P2D2ns x np matrix. Rows contain alternating x's and y's from 2D shapes

Data assumed to be scaled orthographic projections. The result is stored in the shape_3d() matrix. The estimated projection matrices are stored in the projections() matrix.

Parameters:
P2D2ns x np matrix. Rows contain alternating x's and y's from 2D shapes

Definition at line 55 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::reconstruct ( const vcl_vector< vcl_vector< vgl_point_2d< double > > > &  pt_vec_list)

Reconstruct structure from set of 2d pts.

Formulates measurement matrix P2D then calls reconstruct function above

Definition at line 22 of file m23d_ortho_rigid_builder.cxx.

void m23d_ortho_rigid_builder::refine ( )

Refine estimates of projection and structure.

Definition at line 425 of file m23d_ortho_rigid_builder.cxx.

const vnl_matrix<double>& m23d_ortho_rigid_builder::shape_3d ( ) const [inline]

Return 3 x np matrix, each column containing one 3D point.

Points are centred on the origin

Definition at line 98 of file m23d_ortho_rigid_builder.h.


Member Data Documentation

vcl_vector<vgl_point_2d<double> > m23d_ortho_rigid_builder::cog_ [private]

The CoG of each shape supplied to reconstruct().

This has been subtracted from each example to centre on the origin Centred data stored in P2Dc_

Definition at line 47 of file m23d_ortho_rigid_builder.h.

Centred version of the 2D views supplied to reconstruct().

Each 2D shape has been translated so that its CoG is at the origin

Definition at line 51 of file m23d_ortho_rigid_builder.h.

3 x np matrix, each column containing one 3D point.

Definition at line 38 of file m23d_ortho_rigid_builder.h.

The 2ns x 3 projection matrix.

Each 2x3 sub-matrix is a scaled orthographic projection matrix

Definition at line 42 of file m23d_ortho_rigid_builder.h.


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