public class TranslationModel2D extends AbstractAffineModel2D<TranslationModel2D>
AbstractModel
to be applied to points in 2d-space.Modifier and Type | Field and Description |
---|---|
protected static int |
MIN_NUM_MATCHES |
protected double |
tx |
protected double |
ty |
cost, rnd
Constructor and Description |
---|
TranslationModel2D() |
Modifier and Type | Method and Description |
---|---|
double[] |
apply(double[] l)
Apply the
CoordinateTransform to a location. |
void |
applyInPlace(double[] l)
Apply the
CoordinateTransform to a location. |
double[] |
applyInverse(double[] l)
Apply the inverse of the model to a point location
|
void |
applyInverseInPlace(double[] l)
apply the inverse of the model to a point location
|
void |
concatenate(TranslationModel2D m) |
TranslationModel2D |
copy()
Clone the model.
|
AffineTransform |
createAffine()
Create an
AffineTransform representing the current parameters
the model. |
TranslationModel2D |
createInverse()
TODO Not yet tested
|
AffineTransform |
createInverseAffine()
Create an
AffineTransform representing the inverse of the
current parameters of the model. |
<P extends PointMatch> |
fit(Collection<P> matches)
Fit the
Model to a set of data points minimizing the global
transfer error. |
void |
fit(double[][] p,
double[][] q,
double[] w)
Default fit implementation using
Model.fit(Collection) . |
void |
fit(float[][] p,
float[][] q,
float[] w)
Default fit implementation using
Model.fit(Collection) . |
int |
getMinNumMatches() |
double[] |
getTranslation() |
void |
preConcatenate(TranslationModel2D m) |
void |
set(double tx,
double ty)
Initialize the model such that the respective affine transform is:
1 0 tx
0 1 ty
0 0 1
|
void |
set(TranslationModel2D m)
Set the model to m
|
void |
toArray(double[] data)
Write the 6 parameters of the affine into a double array.
|
void |
toMatrix(double[][] data)
Write the 6 parameters of the affine into a 3x2 double array.
|
estimateBounds, estimateInverseBounds, toString
betterThan, filter, filter, filter, filterRansac, filterRansac, filterRansac, filterRansac, getCost, icp, localSmoothnessFilter, ransac, ransac, setCost, test, test
protected static final int MIN_NUM_MATCHES
protected double tx
protected double ty
public final double[] getTranslation()
public final int getMinNumMatches()
PointMatches
required
to solve the model.public final AffineTransform createAffine()
AbstractAffineModel2D
AffineTransform
representing the current parameters
the model.createAffine
in interface Affine2D<TranslationModel2D>
createAffine
in class AbstractAffineModel2D<TranslationModel2D>
AffineTransform
public final AffineTransform createInverseAffine()
AbstractAffineModel2D
AffineTransform
representing the inverse of the
current parameters of the model.createInverseAffine
in interface Affine2D<TranslationModel2D>
createInverseAffine
in class AbstractAffineModel2D<TranslationModel2D>
AffineTransform
public final double[] apply(double[] l)
CoordinateTransform
CoordinateTransform
to a location.public final void applyInPlace(double[] l)
CoordinateTransform
CoordinateTransform
to a location.public final double[] applyInverse(double[] l)
InverseCoordinateTransform
public final void applyInverseInPlace(double[] l)
InverseCoordinateTransform
public final void fit(double[][] p, double[][] q, double[] w) throws NotEnoughDataPointsException
AbstractModel
Model.fit(Collection)
. This foils
the intention that AbstractModel.fit(double[][], double[][], double[])
would be
potentially more efficient. You should better implement it directly.fit
in interface Model<TranslationModel2D>
fit
in class AbstractModel<TranslationModel2D>
p
- source pointsq
- target pointsw
- weightsNotEnoughDataPointsException
- if not enough data points
were availablepublic final void fit(float[][] p, float[][] q, float[] w) throws NotEnoughDataPointsException
AbstractModel
Model.fit(Collection)
. This foils
the intention that AbstractModel.fit(float[][], float[][], float[])
would be
potentially more efficient. You should better implement it directly.fit
in interface Model<TranslationModel2D>
fit
in class AbstractModel<TranslationModel2D>
p
- source pointsq
- target pointsw
- weightsNotEnoughDataPointsException
- if not enough data points
were availablepublic final <P extends PointMatch> void fit(Collection<P> matches) throws NotEnoughDataPointsException
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.
matches
- set of point correpondencesNotEnoughDataPointsException
- if matches does not contain
enough data pointspublic TranslationModel2D copy()
Model
public final void set(TranslationModel2D m)
Model
public final void preConcatenate(TranslationModel2D m)
preConcatenate
in interface Affine2D<TranslationModel2D>
preConcatenate
in class AbstractAffineModel2D<TranslationModel2D>
public final void concatenate(TranslationModel2D m)
concatenate
in interface Affine2D<TranslationModel2D>
concatenate
in class AbstractAffineModel2D<TranslationModel2D>
public final void set(double tx, double ty)
tx
- ty
- public TranslationModel2D createInverse()
createInverse
in interface Affine2D<TranslationModel2D>
createInverse
in interface InvertibleCoordinateTransform
createInverse
in class AbstractAffineModel2D<TranslationModel2D>
public void toArray(double[] data)
Affine2D
public void toMatrix(double[][] data)
Affine2D
[0][0] -> m00; [0][1] -> m01; [0][2] -> m02;
[1][0] -> m10; [1][1] -> m11; [1][2] -> m12;
Copyright © 2015–2021 Fiji. All rights reserved.