mpicbg.models
Class InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>

java.lang.Object
  extended by mpicbg.models.AbstractModel<M>
      extended by mpicbg.models.InterpolatedModel<A,B,M>
          extended by mpicbg.models.InvertibleInterpolatedModel<A,B,InterpolatedAffineModel2D<A,B>>
              extended by mpicbg.models.InterpolatedAffineModel2D<A,B>
All Implemented Interfaces:
Serializable, Affine2D<InterpolatedAffineModel2D<A,B>>, Boundable, CoordinateTransform, InverseBoundable, InverseCoordinateTransform, InvertibleBoundable, InvertibleCoordinateTransform, Model<InterpolatedAffineModel2D<A,B>>

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

2D affine specialization of InterpolatedModel. Implements interpolation directly by linear matrix interpolation. No multiple inheritance in Java, so it cannot be an AffineModel2D by itself.

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected  AffineModel2D affine
           
protected  double[] afs
           
protected  double[] bfs
           
 
Fields inherited from class mpicbg.models.InterpolatedModel
a, b, l1, lambda
 
Fields inherited from class mpicbg.models.AbstractModel
cost, rnd
 
Constructor Summary
InterpolatedAffineModel2D(A model, B regularizer, double lambda)
           
 
Method Summary
 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>
void
fit(Collection<P> matches)
          Fit the Model to a set of data points minimizing the global transfer error.
protected  void interpolate()
           
 void preConcatenate(AffineModel2D affine2d)
           
 void preConcatenate(InterpolatedAffineModel2D<A,B> affine2d)
           
 void set(AffineTransform a)
          Initialize the model with the parameters of an AffineTransform.
 void set(double m00, double m10, double m01, double m11, double m02, double m12)
          Initialize the model such that the respective affine transform is:
 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.
 
Methods inherited from class mpicbg.models.InterpolatedModel
getA, getB, getLambda, getMinNumMatches, setLambda
 
Methods inherited from class mpicbg.models.AbstractModel
betterThan, filter, filter, filter, filterRansac, filterRansac, filterRansac, filterRansac, fit, fit, getCost, icp, localSmoothnessFilter, ransac, ransac, setCost, test, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

affine

protected final AffineModel2D affine

afs

protected final double[] afs

bfs

protected final double[] bfs
Constructor Detail

InterpolatedAffineModel2D

public InterpolatedAffineModel2D(A model,
                                 B regularizer,
                                 double lambda)
Method Detail

interpolate

protected void interpolate()

fit

public <P extends PointMatch> void fit(Collection<P> matches)
         throws NotEnoughDataPointsException,
                IllDefinedDataPointsException
Description copied from interface: Model
Fit the 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 #filter(Class, Collection, Collection) to remove outliers from your data points The estimated model transfers match.p1.local to match.p2.world.

Specified by:
fit in interface Model<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
Overrides:
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>>>
Parameters:
matches - set of point correpondences
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

set

public void set(InterpolatedAffineModel2D<A,B> m)
Description copied from interface: Model
Set the model to m

Specified by:
set in interface Model<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
Overrides:
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>>>

copy

public InterpolatedAffineModel2D<A,B> copy()
Description copied from interface: Model
Clone the model.

Specified by:
copy in interface Model<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
Overrides:
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>>>

apply

public double[] apply(double[] location)
Description copied from interface: CoordinateTransform
Apply the CoordinateTransform to a location.

Specified by:
apply in interface CoordinateTransform
Overrides:
apply 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>>>
Returns:
transformed location

applyInPlace

public void applyInPlace(double[] location)
Description copied from interface: CoordinateTransform
Apply the CoordinateTransform to a location.

Specified by:
applyInPlace in interface CoordinateTransform
Overrides:
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>>>

applyInverse

public double[] applyInverse(double[] point)
                      throws NoninvertibleModelException
Description copied from interface: InverseCoordinateTransform
Apply the inverse of the model to a point location

Specified by:
applyInverse in interface InverseCoordinateTransform
Overrides:
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>>>
Returns:
transformed point
Throws:
NoninvertibleModelException

applyInverseInPlace

public void applyInverseInPlace(double[] point)
                         throws NoninvertibleModelException
Description copied from interface: InverseCoordinateTransform
apply the inverse of the model to a point location

Specified by:
applyInverseInPlace in interface InverseCoordinateTransform
Overrides:
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>>>
Throws:
NoninvertibleModelException

createInverse

public InterpolatedAffineModel2D<A,B> createInverse()
Specified by:
createInverse in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
Specified by:
createInverse in interface InvertibleCoordinateTransform
Overrides:
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>>>

createAffineModel2D

public AffineModel2D createAffineModel2D()

createAffine

public AffineTransform createAffine()
Description copied from interface: Affine2D
Create an AffineTransform representing the current parameters the model.

Specified by:
createAffine in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
Returns:
AffineTransform

createInverseAffine

public AffineTransform createInverseAffine()
Description copied from interface: Affine2D
Create an AffineTransform representing the inverse of the current parameters of the model.

Specified by:
createInverseAffine in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>
Returns:
AffineTransform

preConcatenate

public void preConcatenate(InterpolatedAffineModel2D<A,B> affine2d)
Specified by:
preConcatenate in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>

concatenate

public void concatenate(AffineModel2D affine2d)

preConcatenate

public void preConcatenate(AffineModel2D affine2d)

concatenate

public void concatenate(InterpolatedAffineModel2D<A,B> affine2d)
Specified by:
concatenate in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>

toArray

public void toArray(double[] data)
Description copied from interface: Affine2D
Write the 6 parameters of the affine into a double array. The order is m00, m10, m01, m11, m02, m12

Specified by:
toArray in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>

toMatrix

public void toMatrix(double[][] data)
Description copied from interface: Affine2D
Write the 6 parameters of the affine into a 3x2 double array. The order is [0][0] -> m00; [0][1] -> m01; [0][2] -> m02; [1][0] -> m10; [1][1] -> m11; [1][2] -> m12;

Specified by:
toMatrix in interface Affine2D<InterpolatedAffineModel2D<A extends Model<A> & Affine2D<A>,B extends Model<B> & Affine2D<B>>>

set

public final void set(double m00,
                      double m10,
                      double m01,
                      double m11,
                      double m02,
                      double m12)
Initialize the model such that the respective affine transform is:
 m00 m01 m02
 m10 m11 m12
 0   0   1
 

Parameters:
m00 -
m10 -
m01 -
m11 -
m02 -
m12 -

set

public final void set(AffineTransform a)
Initialize the model with the parameters of an AffineTransform.

Parameters:
a -

estimateBounds

public void estimateBounds(double[] min,
                           double[] max)
Description copied from interface: Boundable
Estimate the bounds of an n-dimensional interval [min,max] with min and max being n-dimensional vectors.

Specified by:
estimateBounds in interface Boundable

estimateInverseBounds

public void estimateInverseBounds(double[] min,
                                  double[] max)
                           throws NoninvertibleModelException
Description copied from interface: InverseBoundable
Estimate the bounds of an n-dimensional interval [min,max] with min and max being n-dimensional vectors.

Specified by:
estimateInverseBounds in interface InverseBoundable
Throws:
NoninvertibleModelException


Copyright © 2007-2016 Fiji. All Rights Reserved.