Class OpenCVSizebasedPositionEvaluator
- java.lang.Object
-
- science.aist.imaging.opencv.imageprocessing.positioning.OpenCVSizebasedPositionEvaluator
-
- All Implemented Interfaces:
PositionEvaluator<org.opencv.core.Mat,org.opencv.core.Point>
,SizebasedPositionEvaluator<org.opencv.core.Mat,org.opencv.core.Point>
public class OpenCVSizebasedPositionEvaluator extends Object implements SizebasedPositionEvaluator<org.opencv.core.Mat,org.opencv.core.Point>
PositionEvaluator Implementation (based on a AbstractColorbasedObjectDetector<Mat, Point>) which provides functionality to evaluate e.g. the position of an object in the image
- Since:
- 1.0
- Author:
- Christoph Praschl
-
-
Constructor Summary
Constructors Constructor Description OpenCVSizebasedPositionEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calibrate(ImageWrapper<org.opencv.core.Mat> imageForCalibration)
Method for calibrating the PositionEvaluator.TranslationOffsetInMM
getOffset(ImageWrapper<org.opencv.core.Mat> ref, ImageWrapper<org.opencv.core.Mat> current)
Method for evaluating the offset of an object between two images (Note: Before using method calibrate() and setObjectDimensionInMM() !)Point2Wrapper<org.opencv.core.Point>
getPosition(ImageWrapper<org.opencv.core.Mat> image)
Method for evaluating e.g.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface science.aist.imaging.api.positioning.SizebasedPositionEvaluator
getObjectWidthInMM, setObjectWidthInMM
-
-
-
-
Method Detail
-
calibrate
public void calibrate(ImageWrapper<org.opencv.core.Mat> imageForCalibration)
Method for calibrating the PositionEvaluator. Needs an image containing the object and a white background.- Specified by:
calibrate
in interfacePositionEvaluator<org.opencv.core.Mat,org.opencv.core.Point>
- Parameters:
imageForCalibration
- Image for calibration containing the object on a white background.
-
getPosition
public Point2Wrapper<org.opencv.core.Point> getPosition(ImageWrapper<org.opencv.core.Mat> image)
Method for evaluating e.g. the position of an object in the image (Note: Before using method calibrate())- Specified by:
getPosition
in interfacePositionEvaluator<org.opencv.core.Mat,org.opencv.core.Point>
- Parameters:
image
- Image where Object should be found.- Returns:
- Position of the Object in the image (Position -1/-1 -> no position found)
-
getOffset
public TranslationOffsetInMM getOffset(ImageWrapper<org.opencv.core.Mat> ref, ImageWrapper<org.opencv.core.Mat> current)
Method for evaluating the offset of an object between two images (Note: Before using method calibrate() and setObjectDimensionInMM() !)- Specified by:
getOffset
in interfacePositionEvaluator<org.opencv.core.Mat,org.opencv.core.Point>
- Parameters:
ref
- The reference image containing the objectcurrent
- The current image containing the object- Returns:
- The offset between the object´s position in ref and the object´s position in current
-
-