mpicbg.models
Class HomographyModel2D

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

public class HomographyModel2D
extends AbstractModel<HomographyModel2D>
implements InvertibleBoundable

2d-homography AbstractModel to be applied to points in 2d-space. This code is partially based on the following book: BibTeX:

 @book{BurgerB05,
         author    = {Wilhelm Burger and Mark James Burge},
   title     = {Digital image processing: An algorithmic introduction using Java},
   year      = {2008},
   isbn      = {978-1-84628-379-6},
   pages     = {560},
   publisher = {Springer},
   url       = {http://imagingbook.com/},
 }
 
and the lecture notes: CSE 252B: Computer Vision II Lecturer: Serge Belongie Scribe: Dave Berlin, Jefferson Ng LECTURE 2 Homogeneous Linear Least Squares Problems, Two View Geometry

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
protected  double i00
           
protected  double i01
           
protected  double i02
           
protected  double i10
           
protected  double i11
           
protected  double i12
           
protected  double i20
           
protected  double i21
           
protected  double i22
           
protected  double m00
           
protected  double m01
           
protected  double m02
           
protected  double m10
           
protected  double m11
           
protected  double m12
           
protected  double m20
           
protected  double m21
           
protected  double m22
           
protected static int MIN_NUM_MATCHES
           
 
Fields inherited from class mpicbg.models.AbstractModel
cost, rnd
 
Constructor Summary
HomographyModel2D()
           
 
Method Summary
 double[] apply(double[] point)
          Apply the CoordinateTransform to a location.
 void applyInPlace(double[] point)
          Apply the CoordinateTransform to a location.
 double[] applyInverse(double[] point)
          Apply the inverse of the model to a point location
 void applyInverseInPlace(double[] point)
          apply the inverse of the model to a point location
 HomographyModel2D copy()
          Clone the model.
 HomographyModel2D createInverse()
          TODO Not yet tested
 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.
 int getMinNumMatches()
           
 void set(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
           
 void set(HomographyModel2D m)
          Set the model to m
 String toString()
           
 
Methods inherited from class mpicbg.models.AbstractModel
betterThan, filter, filter, filter, filterRansac, filterRansac, filterRansac, filterRansac, fit, fit, 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

m00

protected double m00

m01

protected double m01

m02

protected double m02

m10

protected double m10

m11

protected double m11

m12

protected double m12

m20

protected double m20

m21

protected double m21

m22

protected double m22

i00

protected double i00

i01

protected double i01

i02

protected double i02

i10

protected double i10

i11

protected double i11

i12

protected double i12

i20

protected double i20

i21

protected double i21

i22

protected double i22
Constructor Detail

HomographyModel2D

public HomographyModel2D()
Method Detail

getMinNumMatches

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

set

public void set(double m00,
                double m01,
                double m02,
                double m10,
                double m11,
                double m12,
                double m20,
                double m21,
                double m22)

apply

public final double[] apply(double[] point)
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[] point)
Description copied from interface: CoordinateTransform
Apply the CoordinateTransform to a location.

Specified by:
applyInPlace in interface CoordinateTransform

applyInverse

public final double[] applyInverse(double[] point)
                            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[] point)
                               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

set

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

Specified by:
set in interface Model<HomographyModel2D>

copy

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

Specified by:
copy in interface Model<HomographyModel2D>

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<HomographyModel2D>
Parameters:
matches - set of point correpondences
Throws:
NotEnoughDataPointsException
IllDefinedDataPointsException

toString

public String toString()
Overrides:
toString in class Object

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)
                           throws NoninvertibleModelException
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
Throws:
NoninvertibleModelException

createInverse

public final HomographyModel2D createInverse()
TODO Not yet tested

Specified by:
createInverse in interface InvertibleCoordinateTransform


Copyright © 2007-2016 Fiji. All Rights Reserved.