public class HomographyModel2D extends AbstractModel<HomographyModel2D> implements InvertibleBoundable
AbstractModel
to be applied to points in 2d-space.
This code is partially based on the following book:
BibTeX:
@book{BurgerB05, author = {Wilhelm Burger and Mark James Burge}, title = {Digital image processing: An algorithmic introduction using Java}, year = {2008}, isbn = {978-1-84628-379-6}, pages = {560}, publisher = {Springer}, url = {http://imagingbook.com/}, }and the lecture notes: CSE 252B: Computer Vision II Lecturer: Serge Belongie Scribe: Dave Berlin, Jefferson Ng LECTURE 2 Homogeneous Linear Least Squares Problems, Two View Geometry
Modifier and Type | Field and Description |
---|---|
protected double |
i00 |
protected double |
i01 |
protected double |
i02 |
protected double |
i10 |
protected double |
i11 |
protected double |
i12 |
protected double |
i20 |
protected double |
i21 |
protected double |
i22 |
protected double |
m00 |
protected double |
m01 |
protected double |
m02 |
protected double |
m10 |
protected double |
m11 |
protected double |
m12 |
protected double |
m20 |
protected double |
m21 |
protected double |
m22 |
protected static int |
MIN_NUM_MATCHES |
cost, rnd
Constructor and Description |
---|
HomographyModel2D() |
Modifier and Type | Method and Description |
---|---|
double[] |
apply(double[] point)
Apply the
CoordinateTransform to a location. |
void |
applyInPlace(double[] point)
Apply the
CoordinateTransform to a location. |
double[] |
applyInverse(double[] point)
Apply the inverse of the model to a point location
|
void |
applyInverseInPlace(double[] point)
apply the inverse of the model to a point location
|
HomographyModel2D |
copy()
Clone the model.
|
HomographyModel2D |
createInverse()
TODO Not yet tested
|
void |
estimateBounds(double[] min,
double[] max)
Estimate the bounds of an n-dimensional interval [min,max] with min and
max being n-dimensional vectors.
|
void |
estimateInverseBounds(double[] min,
double[] max)
Estimate the bounds of an n-dimensional interval [min,max] with min and
max being n-dimensional vectors.
|
<P extends PointMatch> |
fit(Collection<P> matches)
Fit the
Model to a set of data points minimizing the global
transfer error. |
int |
getMinNumMatches() |
void |
set(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
void |
set(HomographyModel2D m)
Set the model to m
|
String |
toString() |
betterThan, filter, filter, filter, filterRansac, filterRansac, filterRansac, filterRansac, fit, fit, getCost, icp, localSmoothnessFilter, ransac, ransac, setCost, test, test
protected static final int MIN_NUM_MATCHES
protected double m00
protected double m01
protected double m02
protected double m10
protected double m11
protected double m12
protected double m20
protected double m21
protected double m22
protected double i00
protected double i01
protected double i02
protected double i10
protected double i11
protected double i12
protected double i20
protected double i21
protected double i22
public final int getMinNumMatches()
getMinNumMatches
in interface Model<HomographyModel2D>
PointMatches
required
to solve the model.public void set(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
public final double[] apply(double[] point)
CoordinateTransform
CoordinateTransform
to a location.apply
in interface CoordinateTransform
public final void applyInPlace(double[] point)
CoordinateTransform
CoordinateTransform
to a location.applyInPlace
in interface CoordinateTransform
public final double[] applyInverse(double[] point) throws NoninvertibleModelException
InverseCoordinateTransform
applyInverse
in interface InverseCoordinateTransform
NoninvertibleModelException
public final void applyInverseInPlace(double[] point) throws NoninvertibleModelException
InverseCoordinateTransform
applyInverseInPlace
in interface InverseCoordinateTransform
NoninvertibleModelException
public final void set(HomographyModel2D m)
Model
set
in interface Model<HomographyModel2D>
public HomographyModel2D copy()
Model
copy
in interface Model<HomographyModel2D>
public final <P extends PointMatch> void fit(Collection<P> matches) throws NotEnoughDataPointsException, IllDefinedDataPointsException
Model
Model
to a set of data points minimizing the global
transfer error. This is assumed to be implemented as a weighted least
squares minimization. Use ransac
and/ or Model.filter(java.util.Collection<P>, java.util.Collection<P>, double, int)
to remove outliers from your data points.
The estimated model transfers match.p1.local to match.p2.world.
fit
in interface Model<HomographyModel2D>
matches
- set of point correpondencesNotEnoughDataPointsException
- if matches does not contain
enough data pointsIllDefinedDataPointsException
- if the set of data points is
inappropriate to solve the Modelpublic void estimateBounds(double[] min, double[] max)
Boundable
estimateBounds
in interface Boundable
public void estimateInverseBounds(double[] min, double[] max) throws NoninvertibleModelException
InverseBoundable
estimateInverseBounds
in interface InverseBoundable
NoninvertibleModelException
public final HomographyModel2D createInverse()
createInverse
in interface InvertibleCoordinateTransform
Copyright © 2015–2021 Fiji. All rights reserved.