Class ICP<P extends net.imglib2.RealLocalizable>
java.lang.Object
net.preibisch.mvrecon.process.pointcloud.icp.ICP<P>
- Type Parameters:
P- - something extening point
Implementation of the ICP, takes anything RealLocalizable and internally uses LinkedInterestPoint to compute the ICP
- Author:
- Stephan Preibisch
-
Constructor Summary
ConstructorsConstructorDescriptionICP(List<P> target, List<P> reference, boolean useRANSAC, double minInlierRatio, double maxEpsilonRANSAC, int maxIterationsRANSAC) Also instantiates a newICPinstance, but uses theSimplePointMatchIdentificationto define corresponding points.ICP(List<P> target, List<P> reference, double distanceThreshold, boolean useRANSAC, double minInlierRatio, double maxEpsilonRANSAC, int maxIterationsRANSAC) Also instantiates a newICPinstance, but uses theSimplePointMatchIdentificationto define corresponding points.ICP(List<P> target, List<P> reference, PointMatchIdentification<P> pointMatchIdentifier, boolean useRANSAC, double minInlierRatio, double maxEpsilonRANSAC, int maxIterationsRANSAC) Instantiates a newICPobject with theListof target and reference points as well as thePointMatchIdentificationinterface that defines how corresponding points are identified. -
Method Summary
Modifier and TypeMethodDescriptionvoidestimateIntialModel(List<PointMatchGeneric<LinkedInterestPoint<P>>> matches, mpicbg.models.Model<?> model) Estimates an initialModelbased on some givenPointMatches.Returns theArrayListof ambigousPointMatches indentified in the last ICP iteration, or null if no iteration has been computed yet.doubleReturns the average error of the last ICP iteration, or -1 if no iteration has been computed yet.doubleReturns the maximum error of aPointMatchof the last ICP iteration, or -1 if no iteration has been computed yet.intReturns the number of ambigousPointMatches indentified in the last ICP iteration, or -1 if no iteration has been computed yet.intReturns the number ofPointMatches of the last ICP iteration, or -1 if no iteration has been computed yet.protected static <P extends mpicbg.models.Point & net.imglib2.RealLocalizable>
ArrayList<Integer> getOccurences(mpicbg.models.Point pointTarget, mpicbg.models.Point pointReference, List<PointMatchGeneric<P>> list) Returns the currentPointMatchIdentificationthat is used to identfy corresponding pointsstatic doublemaxDistance(Collection<? extends mpicbg.models.PointMatch> matches) static doublemeanDistance(Collection<? extends mpicbg.models.PointMatch> matches) static <P extends mpicbg.models.Point & net.imglib2.RealLocalizable>
ArrayList<mpicbg.models.PointMatch> removeAmbigousMatches(List<PointMatchGeneric<P>> matches) Detects ambigous (and duplicate)PointMatches, i.e. if aPointcorresponds with more than one otherPointvoidrunICPIteration(mpicbg.models.Model<?> lastModel, mpicbg.models.Model<?> newModel) Performs one iteration of theICP.voidsetPointMatchIdentification(PointMatchIdentification<P> pointMatchIdentifier) Sets thePointMatchIdentificationthat defines howPointMatches between reference and target are identified.static <P extends mpicbg.models.Point>
List<PointMatchGeneric<P>> unwrapPointMatches(List<? extends PointMatchGeneric<? extends LinkedInterestPoint<P>>> pointMatches)
-
Constructor Details
-
ICP
public ICP(List<P> target, List<P> reference, PointMatchIdentification<P> pointMatchIdentifier, boolean useRANSAC, double minInlierRatio, double maxEpsilonRANSAC, int maxIterationsRANSAC) Instantiates a newICPobject with theListof target and reference points as well as thePointMatchIdentificationinterface that defines how corresponding points are identified.- Parameters:
target- - theListof target pointsreference- - theListof reference pointspointMatchIdentifier- - thePointMatchIdentificationwhich defines how correspondences are establisheduseRANSAC- - use RANSAC during every iterationminInlierRatio- - minInlierRatio for RANSACmaxEpsilonRANSAC- - max error for RANSAC if usedmaxIterationsRANSAC- - max iterations for RANSAC if used
-
ICP
public ICP(List<P> target, List<P> reference, double distanceThreshold, boolean useRANSAC, double minInlierRatio, double maxEpsilonRANSAC, int maxIterationsRANSAC) Also instantiates a newICPinstance, but uses theSimplePointMatchIdentificationto define corresponding points.- Parameters:
target- - theListof target pointsreference- - theListof reference pointsdistanceThreshold- - the maximal distance ofSimplePointMatchIdentification, so that the nearest neighbor of a point is still counted as a corresponding pointuseRANSAC- - use RANSAC during every iterationminInlierRatio- - minInlierRatio for RANSACmaxEpsilonRANSAC- - max error for RANSAC if usedmaxIterationsRANSAC- - max iterations for RANSAC if used
-
ICP
public ICP(List<P> target, List<P> reference, boolean useRANSAC, double minInlierRatio, double maxEpsilonRANSAC, int maxIterationsRANSAC) Also instantiates a newICPinstance, but uses theSimplePointMatchIdentificationto define corresponding points.
-
-
Method Details
-
runICPIteration
public void runICPIteration(mpicbg.models.Model<?> lastModel, mpicbg.models.Model<?> newModel) throws mpicbg.models.NotEnoughDataPointsException, mpicbg.models.IllDefinedDataPointsException, NoSuitablePointsException Performs one iteration of theICP. It takes the lastModelas input to find the corresponding points for the newModel. The result is the new Model, the number of corresponding points, the average, and the maximal error. Note that lastModel and newModel can be the same instance and it will be overwritten.- Parameters:
lastModel- - The lastModelthat maps the target.local coordinates to the reference.world coordinates, used to find the corresponding pointsnewModel- - TheModelthat maps the target.local coordinates to the reference.world coordinates, will be fitted to the new points- Throws:
mpicbg.models.NotEnoughDataPointsException- - if there are not enough pointsmpicbg.models.IllDefinedDataPointsException- - if the points are ill-definedNoSuitablePointsException- - if points are somehow wrong
-
estimateIntialModel
public void estimateIntialModel(List<PointMatchGeneric<LinkedInterestPoint<P>>> matches, mpicbg.models.Model<?> model) throws mpicbg.models.NotEnoughDataPointsException, mpicbg.models.IllDefinedDataPointsException Estimates an initialModelbased on some givenPointMatches. Note that thePointMatches have to be stored as PointMatch(target,reference).- Parameters:
matches- - TheListof apriori knownPointMatchesmodel- - TheModelto use- Throws:
mpicbg.models.NotEnoughDataPointsException- - if there are not enough pointsmpicbg.models.IllDefinedDataPointsException- - if the points are ill-defined
-
unwrapPointMatches
public static <P extends mpicbg.models.Point> List<PointMatchGeneric<P>> unwrapPointMatches(List<? extends PointMatchGeneric<? extends LinkedInterestPoint<P>>> pointMatches) - Type Parameters:
P- - something that extens point- Parameters:
pointMatches- - the matches- Returns:
- -
ListofPointMatches
-
setPointMatchIdentification
Sets thePointMatchIdentificationthat defines howPointMatches between reference and target are identified. The simplest way to do it is theSimplePointMatchIdentificationclass which takes the nearest neighbor with a minimal distance threshold.- Parameters:
pointMatchIdentifier- - the newPointMatchIdentification
-
getPointMatchIdentification
Returns the currentPointMatchIdentificationthat is used to identfy corresponding points- Returns:
- PointMatchIdentification> P <
-
getPointMatches
- Returns:
- -
ListofPointMatches
-
getAverageError
public double getAverageError()Returns the average error of the last ICP iteration, or -1 if no iteration has been computed yet.- Returns:
- double - average error
-
getMaximalError
public double getMaximalError()Returns the maximum error of aPointMatchof the last ICP iteration, or -1 if no iteration has been computed yet.- Returns:
- double - maximal error
-
getNumPointMatches
public int getNumPointMatches()Returns the number ofPointMatches of the last ICP iteration, or -1 if no iteration has been computed yet.- Returns:
- int - number of
PointMatches
-
getNumAmbigousMatches
public int getNumAmbigousMatches()Returns the number of ambigousPointMatches indentified in the last ICP iteration, or -1 if no iteration has been computed yet.- Returns:
- int - number of ambigous
PointMatches
-
getAmbigousMatches
Returns theArrayListof ambigousPointMatches indentified in the last ICP iteration, or null if no iteration has been computed yet.- Returns:
- int -
ArrayListofPointMatches
-
getWrappedTargetPoints
-
getWrappedReferencePoints
-
removeAmbigousMatches
public static <P extends mpicbg.models.Point & net.imglib2.RealLocalizable> ArrayList<mpicbg.models.PointMatch> removeAmbigousMatches(List<PointMatchGeneric<P>> matches) Detects ambigous (and duplicate)PointMatches, i.e. if aPointcorresponds with more than one otherPoint -
getOccurences
protected static <P extends mpicbg.models.Point & net.imglib2.RealLocalizable> ArrayList<Integer> getOccurences(mpicbg.models.Point pointTarget, mpicbg.models.Point pointReference, List<PointMatchGeneric<P>> list) -
meanDistance
-
maxDistance
-