mpicbg.models
Class TranslationModel1D

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

public class TranslationModel1D
extends AbstractAffineModel1D<TranslationModel1D>

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

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected static int MIN_NUM_MATCHES
           
protected  double t
           
 
Fields inherited from class mpicbg.models.AbstractModel
cost, rnd
 
Constructor Summary
TranslationModel1D()
           
 
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(TranslationModel1D m)
           
 TranslationModel1D copy()
          Clone the model.
 TranslationModel1D createInverse()
          TODO Not yet tested
<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).
 double[] getMatrix(double[] m)
           
 int getMinNumMatches()
           
 double getTranslation()
           
 void preConcatenate(TranslationModel1D m)
           
 void set(double t)
          Initialize the model with an offset
 void set(TranslationModel1D m)
          Set the model to m
 void toArray(double[] data)
          Write the 2 parameters of the affine into a double array.
 void toMatrix(double[][] data)
          Write the 2 parameters of the affine into a 2x1 double array.
 
Methods inherited from class mpicbg.models.AbstractAffineModel1D
estimateBounds, estimateInverseBounds
 
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, toString, wait, wait, wait
 

Field Detail

MIN_NUM_MATCHES

protected static final int MIN_NUM_MATCHES
See Also:
Constant Field Values

t

protected double t
Constructor Detail

TranslationModel1D

public TranslationModel1D()
Method Detail

getTranslation

public final double getTranslation()

getMinNumMatches

public final int getMinNumMatches()

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<TranslationModel1D>
Overrides:
fit in class AbstractModel<TranslationModel1D>
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<TranslationModel1D>
Overrides:
fit in class AbstractModel<TranslationModel1D>
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 TranslationModel1D copy()
Description copied from interface: Model
Clone the model.


set

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


preConcatenate

public final void preConcatenate(TranslationModel1D m)

concatenate

public final void concatenate(TranslationModel1D m)

set

public final void set(double t)
Initialize the model with an offset

Parameters:
t -

createInverse

public TranslationModel1D createInverse()
TODO Not yet tested


toArray

public void toArray(double[] data)
Description copied from interface: Affine1D
Write the 2 parameters of the affine into a double array. The order is m00, m01


toMatrix

public void toMatrix(double[][] data)
Description copied from interface: Affine1D
Write the 2 parameters of the affine into a 2x1 double array. The order is [0][0] -> m00; [0][1] -> m01;


getMatrix

public double[] getMatrix(double[] m)
Specified by:
getMatrix in class AbstractAffineModel1D<TranslationModel1D>


Copyright © 2007-2016 Fiji. All Rights Reserved.