public class ProjectiveStructureByFactorization
extends java.lang.Object
[ λ[1,1]*x[1,1] , λ[1,2]*x[1,2] , ... , λ[1,M]*x[1,M] ] = [ P[1] ] * [X[1], X[2], ... , X[N] [ λ[2,1]*x[1,1] , λ[2,2]*x[1,2] , ... , λ[2,M]*x[2,M] ] = [ P[2] ] [ ... ] = [ ... ] [ λ[N,1]*x[1,1] , λ[N,2]*x[1,2] , ... , λ[N,M]*x[N,M] ] = [ P[M] ]where λ is the depth, x is homogenous pixel coordinate, P is 3x4 projective, X is 3D feature location in world coordinate system. Procedure:
initialize(int, int) and specify the system's sizeprocess()getFeature3D(int, georegression.struct.point.Point4D_F64) and getCameraMatrix(int, org.ejml.data.DMatrixRMaj)Internally depth and pixel values are scaled so that they are close to unity then undo for output. This ensures better approximation of errors and has other desirable numerical properties.
[1] Page 444 in R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003
| Constructor and Description |
|---|
ProjectiveStructureByFactorization() |
| Modifier and Type | Method and Description |
|---|---|
void |
assignValuesToA(org.ejml.data.DMatrixRMaj A)
A[:,0] = depth*[x,y,1]'
|
void |
getCameraMatrix(int view,
org.ejml.data.DMatrixRMaj cameraMatrix)
Used to get found camera matrix for a view
|
void |
getFeature3D(int feature,
georegression.struct.point.Point4D_F64 out)
Returns location of 3D feature for a view
|
int |
getMaxIterations() |
double |
getMinimumChangeTol() |
void |
initialize(int numFeatures,
int numViews)
Initializes internal data structures.
|
void |
normalizeDepths(org.ejml.data.DMatrixRMaj depths)
Rescale A so that its rows and columns have a value of approximately 1.
|
boolean |
process()
Performs iteration to find camera matrices and feature locations in world frame
|
void |
setAllDepths(double value)
Sets all depths to an initial value
|
void |
setDepths(int view,
double[] featureDepths)
Sets depths for a particular value to the values in the passed in array
|
void |
setDepthsFrom3D(int view,
java.util.List<georegression.struct.point.Point3D_F64> locations)
Assigns depth to the z value of all the features in the list.
|
void |
setMaxIterations(int maxIterations) |
void |
setMinimumChangeTol(double minimumChangeTol) |
void |
setPixels(int view,
java.util.List<georegression.struct.point.Point2D_F64> pixelsInView)
Sets pixel observations for a paricular view
|
public void initialize(int numFeatures,
int numViews)
numFeatures - Number of featuresnumViews - Number of viewspublic void setPixels(int view,
java.util.List<georegression.struct.point.Point2D_F64> pixelsInView)
view - the viewpixelsInView - list of 2D pixel observationspublic void setAllDepths(double value)
value - public void setDepths(int view,
double[] featureDepths)
view - featureDepths - public void setDepthsFrom3D(int view,
java.util.List<georegression.struct.point.Point3D_F64> locations)
view - which view is features are inlocations - Location of features in the view's reference framepublic boolean process()
public void getCameraMatrix(int view,
org.ejml.data.DMatrixRMaj cameraMatrix)
view - Which viewcameraMatrix - storage for 3x4 projective camera matrixpublic void getFeature3D(int feature,
georegression.struct.point.Point4D_F64 out)
feature - Index of feature to retrieveout - (Output) Storage for 3D feature. homogenous coordinatespublic void assignValuesToA(org.ejml.data.DMatrixRMaj A)
public void normalizeDepths(org.ejml.data.DMatrixRMaj depths)
Rescale A so that its rows and columns have a value of approximately 1. This is done to try to get everything set to unity for desirable numerical properties
(α β λ) x = (αP)(βX)public int getMaxIterations()
public void setMaxIterations(int maxIterations)
public double getMinimumChangeTol()
public void setMinimumChangeTol(double minimumChangeTol)