mpicbg.models
Class IdentityModel

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

public class IdentityModel
extends AbstractModel<IdentityModel>
implements Affine1D<IdentityModel>, Affine2D<IdentityModel>, Affine3D<IdentityModel>, InvertibleBoundable

nd-identity AbstractModel.

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected static int MIN_NUM_MATCHES
           
 
Fields inherited from class mpicbg.models.AbstractModel
cost, rnd
 
Constructor Summary
IdentityModel()
           
 
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(IdentityModel m)
           
 IdentityModel copy()
          Clone the model.
 AffineTransform createAffine()
          Create an AffineTransform representing the current parameters the model.
 IdentityModel createInverse()
          TODO Not yet tested
 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.
 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(IdentityModel m)
           
 void set(IdentityModel 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.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
Constructor Detail

IdentityModel

public IdentityModel()
Method Detail

getMinNumMatches

public int getMinNumMatches()
Specified by:
getMinNumMatches in interface Model<IdentityModel>

apply

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

Specified by:
apply in interface CoordinateTransform
Returns:
transformed location

applyInPlace

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

Specified by:
applyInPlace in interface CoordinateTransform

applyInverse

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

Specified by:
applyInverse in interface InverseCoordinateTransform
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

Specified by:
applyInverseInPlace in interface InverseCoordinateTransform

fit

public final void fit(double[][] p,
                      double[][] q,
                      double[] w)
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<IdentityModel>
Overrides:
fit in class AbstractModel<IdentityModel>
Parameters:
p - source points
q - target points
w - weights

fit

public final void fit(float[][] p,
                      float[][] q,
                      float[] w)
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<IdentityModel>
Overrides:
fit in class AbstractModel<IdentityModel>
Parameters:
p - source points
q - target points
w - weights

fit

public final <P extends PointMatch> void fit(Collection<P> matches)
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<IdentityModel>
Parameters:
matches - set of point correpondences

copy

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

Specified by:
copy in interface Model<IdentityModel>

set

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

Specified by:
set in interface Model<IdentityModel>

preConcatenate

public final void preConcatenate(IdentityModel m)
Specified by:
preConcatenate in interface Affine1D<IdentityModel>
Specified by:
preConcatenate in interface Affine2D<IdentityModel>
Specified by:
preConcatenate in interface Affine3D<IdentityModel>

concatenate

public final void concatenate(IdentityModel m)
Specified by:
concatenate in interface Affine1D<IdentityModel>
Specified by:
concatenate in interface Affine2D<IdentityModel>
Specified by:
concatenate in interface Affine3D<IdentityModel>

createInverse

public IdentityModel createInverse()
TODO Not yet tested

Specified by:
createInverse in interface Affine1D<IdentityModel>
Specified by:
createInverse in interface Affine2D<IdentityModel>
Specified by:
createInverse in interface Affine3D<IdentityModel>
Specified by:
createInverse in interface InvertibleCoordinateTransform

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

Specified by:
toArray in interface Affine1D<IdentityModel>
Specified by:
toArray in interface Affine2D<IdentityModel>
Specified by:
toArray in interface Affine3D<IdentityModel>

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;

Specified by:
toMatrix in interface Affine1D<IdentityModel>
Specified by:
toMatrix in interface Affine2D<IdentityModel>
Specified by:
toMatrix in interface Affine3D<IdentityModel>

createAffine

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

Specified by:
createAffine in interface Affine2D<IdentityModel>
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<IdentityModel>
Returns:
AffineTransform

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)
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


Copyright © 2007-2016 Fiji. All Rights Reserved.