Package boofcv.alg.shapes.ellipse
Class BinaryEllipseDetector<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.shapes.ellipse.BinaryEllipseDetector<T>
- All Implemented Interfaces:
VerbosePrint
Detects ellipses inside gray scale images. The first step is to detect them in a binary image and then
refine the fit using the gray scale image. Optionally the refinement step can be turned off or postponed
until the user invokes it directly. False positives are pruned using the edge intensity check. This check removes
ellipses with edges that are low intensity sicne they are most likely generated from noise.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionBinaryEllipseDetector
(BinaryEllipseDetectorPixel ellipseDetector, @Nullable SnapToEllipseEdge<T> ellipseRefiner, EdgeIntensityEllipse<T> intensityCheck, Class<T> inputType) Configures the detector -
Method Summary
Modifier and TypeMethodDescriptiongetFound()
Returns all the found ellipses in the input image.getFoundEllipses
(@Nullable List<EllipseRotated_F64> storage) boolean
void
Detects ellipses inside the binary image and refines the edges for all detections inside the gray imageboolean
refine
(EllipseRotated_F64 ellipse) If auto refine is turned off an ellipse can be refined after the fact using this function, provided that the refinement algorithm was passed in to the constructorvoid
setAutoRefine
(boolean autoRefine) void
setLensDistortion
(@Nullable PixelTransform<Point2D_F32> distToUndist, @Nullable PixelTransform<Point2D_F32> undistToDist) Specifies transforms which can be used to change coordinates from distorted to undistorted.void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> config)
-
Constructor Details
-
BinaryEllipseDetector
public BinaryEllipseDetector(BinaryEllipseDetectorPixel ellipseDetector, @Nullable @Nullable SnapToEllipseEdge<T> ellipseRefiner, EdgeIntensityEllipse<T> intensityCheck, Class<T> inputType) Configures the detector- Parameters:
ellipseDetector
- Detector which uses pixel precise edgesellipseRefiner
- Sub pixel edge refinement. If null the refinement step is skippedintensityCheck
- Computes the intensity of the edge to remove false positivesinputType
- Input image type
-
-
Method Details
-
setLensDistortion
public void setLensDistortion(@Nullable @Nullable PixelTransform<Point2D_F32> distToUndist, @Nullable @Nullable PixelTransform<Point2D_F32> undistToDist) Specifies transforms which can be used to change coordinates from distorted to undistorted. The undistorted image is never explicitly created.
WARNING: The undistorted image must have the same bounds as the distorted input image. This is because several of the bounds checks use the image shape. This are simplified greatly by this assumption.
- Parameters:
distToUndist
- Transform from distorted to undistorted image.undistToDist
- Transform from undistorted to distorted image.
-
process
Detects ellipses inside the binary image and refines the edges for all detections inside the gray image- Parameters:
gray
- Grayscale imagebinary
- Binary image of grayscale. 1 = ellipse and 0 = ignored background
-
refine
If auto refine is turned off an ellipse can be refined after the fact using this function, provided that the refinement algorithm was passed in to the constructor- Parameters:
ellipse
- The ellipse to be refined- Returns:
- true if refine was successful or false if not
-
getEllipseDetector
-
isAutoRefine
public boolean isAutoRefine() -
setAutoRefine
public void setAutoRefine(boolean autoRefine) -
getInputType
-
getAllContours
-
getFound
Returns all the found ellipses in the input image.
WARNING: Returned data is recycled on the next call to process- Returns:
- List of found ellipses.
-
getFoundEllipses
public List<EllipseRotated_F64> getFoundEllipses(@Nullable @Nullable List<EllipseRotated_F64> storage) -
setVerbose
- Specified by:
setVerbose
in interfaceVerbosePrint
-