mpicbg.models
Class TranslationModel2D

java.lang.Object
  extended by mpicbg.models.AbstractModel<M>
      extended by mpicbg.models.AbstractAffineModel2D<TranslationModel2D>
          extended by mpicbg.models.TranslationModel2D
All Implemented Interfaces:
Serializable, Affine2D<TranslationModel2D>, Boundable, CoordinateTransform, InverseBoundable, InverseCoordinateTransform, InvertibleBoundable, InvertibleCoordinateTransform, Model<TranslationModel2D>

public class TranslationModel2D
extends AbstractAffineModel2D<TranslationModel2D>

2d-translation AbstractModel to be applied to points in 2d-space.

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected static int MIN_NUM_MATCHES
           
protected  double tx
           
protected  double ty
           
 
Fields inherited from class mpicbg.models.AbstractModel
cost, rnd
 
Constructor Summary
TranslationModel2D()
           
 
Method Summary
 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>
void
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()
           
 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.
 
Methods inherited from class mpicbg.models.AbstractAffineModel2D
estimateBounds, estimateInverseBounds, toString
 
Methods inherited from class mpicbg.models.AbstractModel
betterThan, filter, filter, filter, filterRansac, filterRansac, filterRansac, filterRansac, getCost, icp, localSmoothnessFilter, ransac, ransac, setCost, test, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_NUM_MATCHES

protected static final int MIN_NUM_MATCHES
See Also:
Constant Field Values

tx

protected double tx

ty

protected double ty
Constructor Detail

TranslationModel2D

public TranslationModel2D()
Method Detail

getMinNumMatches

public final int getMinNumMatches()

createAffine

public final AffineTransform createAffine()
Description copied from class: AbstractAffineModel2D
Create an AffineTransform representing the current parameters the model.

Specified by:
createAffine in interface Affine2D<TranslationModel2D>
Specified by:
createAffine in class AbstractAffineModel2D<TranslationModel2D>
Returns:
AffineTransform

createInverseAffine

public final AffineTransform createInverseAffine()
Description copied from class: AbstractAffineModel2D
Create an AffineTransform representing the inverse of the current parameters of the model.

Specified by:
createInverseAffine in interface Affine2D<TranslationModel2D>
Specified by:
createInverseAffine in class AbstractAffineModel2D<TranslationModel2D>
Returns:
AffineTransform

apply

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

Returns:
transformed location

applyInPlace

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


applyInverse

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

Returns:
transformed point

applyInverseInPlace

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


fit

public final void fit(double[][] p,
                      double[][] q,
                      double[] w)
               throws NotEnoughDataPointsException
Description copied from class: AbstractModel
Default fit implementation using Model.fit(Collection). This foils the intention that AbstractModel.fit(double[][], double[][], double[]) would be potentially more efficient. You should better implement it directly.

Specified by:
fit in interface Model<TranslationModel2D>
Overrides:
fit in class AbstractModel<TranslationModel2D>
Parameters:
p - source points
q - target points
w - weights
Throws:
NotEnoughDataPointsException

fit

public final void fit(float[][] p,
                      float[][] q,
                      float[] w)
               throws NotEnoughDataPointsException
Description copied from class: AbstractModel
Default fit implementation using Model.fit(Collection). This foils the intention that AbstractModel.fit(float[][], float[][], float[]) would be potentially more efficient. You should better implement it directly.

Specified by:
fit in interface Model<TranslationModel2D>
Overrides:
fit in class AbstractModel<TranslationModel2D>
Parameters:
p - source points
q - target points
w - weights
Throws:
NotEnoughDataPointsException

fit

public final <P extends PointMatch> void fit(Collection<P> matches)
               throws NotEnoughDataPointsException
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.

Parameters:
matches - set of point correpondences
Throws:
NotEnoughDataPointsException

copy

public TranslationModel2D copy()
Description copied from interface: Model
Clone the model.


set

public final void set(TranslationModel2D m)
Description copied from interface: Model
Set the model to m


preConcatenate

public final void preConcatenate(TranslationModel2D m)
Specified by:
preConcatenate in interface Affine2D<TranslationModel2D>
Specified by:
preConcatenate in class AbstractAffineModel2D<TranslationModel2D>

concatenate

public final void concatenate(TranslationModel2D m)
Specified by:
concatenate in interface Affine2D<TranslationModel2D>
Specified by:
concatenate in class AbstractAffineModel2D<TranslationModel2D>

set

public final 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

Parameters:
tx -
ty -

createInverse

public TranslationModel2D createInverse()
TODO Not yet tested

Specified by:
createInverse in interface Affine2D<TranslationModel2D>
Specified by:
createInverse in interface InvertibleCoordinateTransform
Specified by:
createInverse in class AbstractAffineModel2D<TranslationModel2D>

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


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;



Copyright © 2007-2016 Fiji. All Rights Reserved.