mpicbg.models
Class SimilarityModel3D

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

public class SimilarityModel3D
extends AbstractAffineModel3D<SimilarityModel3D>
implements InvertibleBoundable

3d-rigid transformation models to be applied to points in 3d-space. This function uses the method by Horn, using quaternions: Closed-form solution of absolute orientation using unit quaternions, Horn, B. K. P., Journal of the Optical Society of America A, Vol. 4, page 629, April 1987

Version:
0.1b
Author:
John Bogovic, Johannes Schindelin (quaternion logic and implementation)
See Also:
Serialized Form

Field Summary
protected  double i00
           
protected  double i01
           
protected  double i02
           
protected  double i03
           
protected  double i10
           
protected  double i11
           
protected  double i12
           
protected  double i13
           
protected  double i20
           
protected  double i21
           
protected  double i22
           
protected  double i23
           
protected  boolean isInvertible
           
protected  double m00
           
protected  double m01
           
protected  double m02
           
protected  double m03
           
protected  double m10
           
protected  double m11
           
protected  double m12
           
protected  double m13
           
protected  double m20
           
protected  double m21
           
protected  double m22
           
protected  double m23
           
protected static int MIN_NUM_MATCHES
           
protected  double[][] N
           
 
Fields inherited from class mpicbg.models.AbstractModel
cost, rnd
 
Constructor Summary
SimilarityModel3D()
           
 
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
 boolean canDoNumDimension(int numDimensions)
           
 void concatenate(SimilarityModel3D model)
           
 SimilarityModel3D copy()
          Clone the model.
 SimilarityModel3D createInverse()
           
<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()
           
protected  void invert()
           
 void preConcatenate(SimilarityModel3D model)
           
 void set(SimilarityModel3D m)
          Set the model to m
 void toArray(double[] data)
          Write the 12 parameters of the affine into a double array.
 void toMatrix(double[][] data)
          Write the 12 parameters of the affine into a 4x3 double array.
 String toString()
           
 
Methods inherited from class mpicbg.models.AbstractAffineModel3D
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

m02

protected double m02

m03

protected double m03

m10

protected double m10

m11

protected double m11

m12

protected double m12

m13

protected double m13

m20

protected double m20

m21

protected double m21

m22

protected double m22

m23

protected double m23

i00

protected double i00

i01

protected double i01

i02

protected double i02

i03

protected double i03

i10

protected double i10

i11

protected double i11

i12

protected double i12

i13

protected double i13

i20

protected double i20

i21

protected double i21

i22

protected double i22

i23

protected double i23

N

protected final double[][] N

isInvertible

protected boolean isInvertible
Constructor Detail

SimilarityModel3D

public SimilarityModel3D()
Method Detail

canDoNumDimension

public boolean canDoNumDimension(int numDimensions)

fit

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

fit

public final void fit(double[][] p,
                      double[][] q,
                      double[] w)
               throws NotEnoughDataPointsException,
                      IllDefinedDataPointsException
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<SimilarityModel3D>
Overrides:
fit in class AbstractModel<SimilarityModel3D>
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
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<SimilarityModel3D>
Parameters:
matches - set of point correpondences
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

set

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

Specified by:
set in interface Model<SimilarityModel3D>

copy

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

Specified by:
copy in interface Model<SimilarityModel3D>

getMinNumMatches

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

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

toString

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

invert

protected void invert()

applyInverse

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

preConcatenate

public void preConcatenate(SimilarityModel3D model)
Specified by:
preConcatenate in interface Affine3D<SimilarityModel3D>

concatenate

public void concatenate(SimilarityModel3D model)
Specified by:
concatenate in interface Affine3D<SimilarityModel3D>

toArray

public void toArray(double[] data)
Description copied from interface: Affine3D
Write the 12 parameters of the affine into a double array. The order is m00, m10, m20, m01, m11, m21, m02, m12, m22, m03, m13, m23

Specified by:
toArray in interface Affine3D<SimilarityModel3D>

toMatrix

public void toMatrix(double[][] data)
Description copied from interface: Affine3D
Write the 12 parameters of the affine into a 4x3 double array. The order is [0][0] -> m00; [0][1] -> m01; [0][2] -> m02; [0][3] -> m03 [1][0] -> m10; [1][1] -> m11; [1][2] -> m12; [1][3] -> m13 [2][0] -> m20; [2][1] -> m21; [2][2] -> m22; [2][3] -> m23

Specified by:
toMatrix in interface Affine3D<SimilarityModel3D>

createInverse

public SimilarityModel3D createInverse()
Specified by:
createInverse in interface Affine3D<SimilarityModel3D>
Specified by:
createInverse in interface InvertibleCoordinateTransform

getMatrix

public double[] getMatrix(double[] m)
Specified by:
getMatrix in class AbstractAffineModel3D<SimilarityModel3D>


Copyright © 2007-2016 Fiji. All Rights Reserved.