public class ProjectiveStructureFromHomographies
extends java.lang.Object
Given a set of homographies mapping pixels in view i to view 0 this will estimate the projective camera matrix of each view. x' = P*X, where P is the camera matrix that is to be estimated, x' is pixel, and X is 3D feature location in view 0's reference frame. Output is 3D structure and camera matrices.
A camera matrix is a 3x4 projective matrix with the following structure [M,t]. If a homography defines the transform between pixels in one view to another view then M is equal to that homography. The camera matrix is now defined up to the unknown t. To solve for t the points in this projective frame also need to be derived. This is done by solving a linear system:
[ p.x*m'[2] - m'[0] , -1 , 0 , p.x ]
[ p.y*m'[2] - m'[1] , 0 , -1 , p.y ] * [X ; t ]
where m'[i] is row 'i' in M transposed. (p.x,p.y) is pixel observation, X and t are the unknowns. Each
observation x = P*X generates 2 equations. See [1] for derivation. Vector product of both sides is involved.
Normalization is automatically applied to inputs and undo for output. Normalization matrix is computed using
LowLevelMultiViewOps.computeNormalizationLL(List, NormalizationPoint2D)
[1] 18.5.1 Page 448 in R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003
| Constructor and Description |
|---|
ProjectiveStructureFromHomographies() |
| Modifier and Type | Method and Description |
|---|---|
void |
getCameraMatrix(int viewIdx,
org.ejml.data.DMatrixRMaj P) |
void |
getFeature3D(int featureIdx,
georegression.struct.point.Point3D_F64 X) |
double |
getInfinityThreshold() |
boolean |
proccess(java.util.List<org.ejml.data.DMatrixRMaj> homographies_view0_to_viewI,
java.util.List<java.util.List<PointIndex2D_F64>> observations,
int totalFeatures)
Solves for camera matrices and scene structure.
|
void |
setInfinityThreshold(double infinityThreshold) |
public boolean proccess(java.util.List<org.ejml.data.DMatrixRMaj> homographies_view0_to_viewI,
java.util.List<java.util.List<PointIndex2D_F64>> observations,
int totalFeatures)
Solves for camera matrices and scene structure.
Homographies from view i to 0:homographies_view0_to_viewI - (Input) Homographies matching pixels from view i to view 0.observations - (Input) Observed features in each view, except view 0. Indexes of points must be from 0 to totalFeatures-1totalFeatures - (Input) total number of features being solved for. Uses to sanity check inputpublic void getCameraMatrix(int viewIdx,
org.ejml.data.DMatrixRMaj P)
public void getFeature3D(int featureIdx,
georegression.struct.point.Point3D_F64 X)
public double getInfinityThreshold()
public void setInfinityThreshold(double infinityThreshold)