mpicbg.models
Class AffineModel1D

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

public class AffineModel1D
extends AbstractAffineModel1D<AffineModel1D>
implements InvertibleBoundable

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected  double i00
           
protected  double i01
           
protected  boolean isInvertible
           
protected  double m00
           
protected  double m01
           
protected static int MIN_NUM_MATCHES
           
 
Fields inherited from class mpicbg.models.AbstractModel
cost, rnd
 
Constructor Summary
AffineModel1D()
           
 
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(AffineModel1D model)
           
 AffineModel1D copy()
          Clone the model.
 AffineModel1D createInverse()
          TODO Not yet tested
<P extends PointMatch>
void
fit(Collection<P> matches)
          Closed form weighted least squares solution as described by \citet{SchaeferAl06}.
 void fit(double[][] p, double[][] q, double[] w)
          Closed form weighted least squares solution as described by \citet{SchaeferAl06}.
 void fit(float[][] p, float[][] q, float[] w)
          Closed form weighted least squares solution as described by \citet{SchaeferAl06}.
 double[] getMatrix(double[] m)
           
 int getMinNumMatches()
           
protected  void invert()
           
 void preConcatenate(AffineModel1D model)
           
 void set(AffineModel1D m)
          Set the model to m
 void set(double m00, double m01)
          Initialize the model such that the respective affine transform is:
 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.
 String toString()
           
 
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, wait, wait, wait
 
Methods inherited from interface mpicbg.models.Boundable
estimateBounds
 
Methods inherited from interface mpicbg.models.InverseBoundable
estimateInverseBounds
 

Field Detail

MIN_NUM_MATCHES

protected static final int MIN_NUM_MATCHES
See Also:
Constant Field Values

m00

protected double m00

m01

protected double m01

i00

protected double i00

i01

protected double i01

isInvertible

protected boolean isInvertible
Constructor Detail

AffineModel1D

public AffineModel1D()
Method Detail

getMatrix

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

getMinNumMatches

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

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)
                            throws NoninvertibleModelException
Description copied from interface: InverseCoordinateTransform
Apply the inverse of the model to a point location

Specified by:
applyInverse in interface InverseCoordinateTransform
Returns:
transformed point
Throws:
NoninvertibleModelException

applyInverseInPlace

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

Specified by:
applyInverseInPlace in interface InverseCoordinateTransform
Throws:
NoninvertibleModelException

fit

public final void fit(double[][] p,
                      double[][] q,
                      double[] w)
               throws NotEnoughDataPointsException,
                      IllDefinedDataPointsException
Closed form weighted least squares solution as described by \citet{SchaeferAl06}.

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

fit

public final void fit(float[][] p,
                      float[][] q,
                      float[] w)
               throws NotEnoughDataPointsException,
                      IllDefinedDataPointsException
Closed form weighted least squares solution as described by \citet{SchaeferAl06}.

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

fit

public final <P extends PointMatch> void fit(Collection<P> matches)
               throws NotEnoughDataPointsException,
                      IllDefinedDataPointsException
Closed form weighted least squares solution as described by \citet{SchaeferAl06}. TODO

Specified by:
fit in interface Model<AffineModel1D>
Parameters:
matches - set of point correpondences
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

set

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

Specified by:
set in interface Model<AffineModel1D>

copy

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

Specified by:
copy in interface Model<AffineModel1D>

invert

protected void invert()

preConcatenate

public final void preConcatenate(AffineModel1D model)
Specified by:
preConcatenate in interface Affine1D<AffineModel1D>

concatenate

public final void concatenate(AffineModel1D model)
Specified by:
concatenate in interface Affine1D<AffineModel1D>

set

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

Parameters:
m00 -
m01 -

toString

public final String toString()
Overrides:
toString in class Object

createInverse

public AffineModel1D createInverse()
TODO Not yet tested

Specified by:
createInverse in interface Affine1D<AffineModel1D>
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<AffineModel1D>

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


Copyright © 2007-2016 Fiji. All Rights Reserved.