Class PositionComparisonImpl<T,V>
- java.lang.Object
-
- science.aist.imaging.core.objectprocessing.compare.impl.PositionComparisonImpl<T,V>
-
- All Implemented Interfaces:
ObjectComparison<T,V>
public class PositionComparisonImpl<T,V> extends Object implements ObjectComparison<T,V>
Simple comparison class, which allows to compare objects by their current coordinate data. Ignores information regarding other image data.If the objects are not the same size, will never reach a similarity of 100%. Uses the size of the bigger object to calculate overlap percentage.
IMPORTANT: When comparing multiple images, the "closest"-image parameter has to be set with a new object. If it stays null, then returning the closest found object is not possible.
- Since:
- 1.0
- Author:
- Christoph Praschl, Andreas Pointner
-
-
Constructor Summary
Constructors Constructor Description PositionComparisonImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
compare(RecognizedObject<T,V> object1, RecognizedObject<T,V> object2)
Compares form of the two objects.double
findClosest(RecognizedObject<T,V> compareMe, List<RecognizedObject<T,V>> recognizedObjects, RecognizedObject<T,V> closest)
Compares one object with a list of other objects.
-
-
-
Method Detail
-
compare
public double compare(RecognizedObject<T,V> object1, RecognizedObject<T,V> object2)
Description copied from interface:ObjectComparison
Compares form of the two objects. Returns how close said objects are using a percent value (e.g. 1.0 = objects are exactly the same).- Specified by:
compare
in interfaceObjectComparison<T,V>
- Parameters:
object1
- object to compareobject2
- object to compare- Returns:
- percent value how close the objects are to each other
-
findClosest
public double findClosest(RecognizedObject<T,V> compareMe, List<RecognizedObject<T,V>> recognizedObjects, RecognizedObject<T,V> closest)
Description copied from interface:ObjectComparison
Compares one object with a list of other objects. Finds the object, which is closest to the first one and puts it into the "closest" variable. Additionally, returns the percent value of how close the closest found is with the given object.- Specified by:
findClosest
in interfaceObjectComparison<T,V>
- Parameters:
compareMe
- object to compare with the other objectsrecognizedObjects
- list of objects that will be compared to the first objectclosest
- closest found object will be put into this variable- Returns:
- percent value how close the closest object is with the given object
-
-