public final class InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>> extends InvertibleInterpolatedModel<A,B,InterpolatedAffineModel2D<A,B>> implements Affine2D<InterpolatedAffineModel2D<A,B>>, InvertibleBoundable
InterpolatedModel
. Implements
interpolation directly by linear matrix interpolation.
No multiple inheritance in Java, so it cannot be an AffineModel2D
by itself.Modifier and Type | Field and Description |
---|---|
protected AffineModel2D |
affine |
protected double[] |
afs |
protected double[] |
bfs |
a, b, l1, lambda
cost, rnd
Constructor and Description |
---|
InterpolatedAffineModel2D(A model,
B regularizer,
double lambda) |
Modifier and Type | Method and Description |
---|---|
double[] |
apply(double[] location)
Apply the
CoordinateTransform to a location. |
void |
applyInPlace(double[] location)
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
|
void |
concatenate(AffineModel2D affine2d) |
void |
concatenate(InterpolatedAffineModel2D<A,B> affine2d) |
InterpolatedAffineModel2D<A,B> |
copy()
Clone the model.
|
AffineTransform |
createAffine()
Create an
AffineTransform representing the current parameters
the model. |
AffineModel2D |
createAffineModel2D() |
InterpolatedAffineModel2D<A,B> |
createInverse() |
AffineTransform |
createInverseAffine()
Create an
AffineTransform representing the inverse of the
current parameters of the model. |
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. |
void |
interpolate() |
void |
preConcatenate(AffineModel2D affine2d) |
void |
preConcatenate(InterpolatedAffineModel2D<A,B> affine2d) |
void |
set(AffineTransform a)
Deprecated.
|
void |
set(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Deprecated.
|
void |
set(InterpolatedAffineModel2D<A,B> 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.
|
getA, getB, getLambda, getMinNumMatches, setLambda
betterThan, filter, filter, filter, filterRansac, filterRansac, filterRansac, filterRansac, fit, fit, getCost, icp, localSmoothnessFilter, ransac, ransac, setCost, test, test
protected final AffineModel2D affine
protected final double[] afs
protected final double[] bfs
public void interpolate()
public <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<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
fit
in class InterpolatedModel<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>,InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
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 set(InterpolatedAffineModel2D<A,B> m)
Model
set
in interface Model<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
set
in class InterpolatedModel<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>,InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
public InterpolatedAffineModel2D<A,B> copy()
Model
copy
in interface Model<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
copy
in class InvertibleInterpolatedModel<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>,InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
public double[] apply(double[] location)
CoordinateTransform
CoordinateTransform
to a location.public void applyInPlace(double[] location)
CoordinateTransform
CoordinateTransform
to a location.applyInPlace
in interface CoordinateTransform
applyInPlace
in class InterpolatedModel<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>,InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
public double[] applyInverse(double[] point) throws NoninvertibleModelException
InverseCoordinateTransform
applyInverse
in interface InverseCoordinateTransform
applyInverse
in class InvertibleInterpolatedModel<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>,InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
NoninvertibleModelException
public void applyInverseInPlace(double[] point) throws NoninvertibleModelException
InverseCoordinateTransform
applyInverseInPlace
in interface InverseCoordinateTransform
applyInverseInPlace
in class InvertibleInterpolatedModel<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>,InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
NoninvertibleModelException
public InterpolatedAffineModel2D<A,B> createInverse()
createInverse
in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
createInverse
in interface InvertibleCoordinateTransform
createInverse
in class InvertibleInterpolatedModel<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>,InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
public AffineModel2D createAffineModel2D()
public AffineTransform createAffine()
Affine2D
AffineTransform
representing the current parameters
the model.createAffine
in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
AffineTransform
public AffineTransform createInverseAffine()
Affine2D
AffineTransform
representing the inverse of the
current parameters of the model.createInverseAffine
in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
AffineTransform
public void preConcatenate(InterpolatedAffineModel2D<A,B> affine2d)
public void concatenate(AffineModel2D affine2d)
public void preConcatenate(AffineModel2D affine2d)
public void concatenate(InterpolatedAffineModel2D<A,B> affine2d)
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;
@Deprecated public final void set(double m00, double m10, double m01, double m11, double m02, double m12)
m00 m01 m02 m10 m11 m12 0 0 1
m00
- m10
- m01
- m11
- m02
- m12
- @Deprecated public final void set(AffineTransform a)
AffineTransform
.a
- public 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
Copyright © 2015–2021 Fiji. All rights reserved.