Package boofcv.alg.shapes.ellipse
Class BinaryEllipseDetectorPixel
java.lang.Object
boofcv.alg.shapes.ellipse.BinaryEllipseDetectorPixel
- All Implemented Interfaces:
VerbosePrint
Detects ellipses inside a binary image by finding their contour and fitting an ellipse to the contour. Fitting
is done using pixel precise contour points. See SnapToEllipseEdge
for a way to use sub-pixel points
and improve the fit's accuracy. Optionally, lens distortion can be removed from the contour points prior
to processing.
algebraic
formulation. Points which are not approximately ellipsoidal are removed.
Approximately ellipsoidal is defined by the distance of the farthest contour point away from the ellipse. For
computational efficiency reasons a maximum of 20 points are sampled. If there are more than 20 points in
the contour then they are evenly sampled across the contour. Only external contours are considered.
Parameters:
- maxDistanceFromEllipse
- maximum distance from the ellipse in pixels
- minimumContour
- minimum number of pixels in the contour
- maximumContour
- maximum number of pixels in the contour
- internalContour
- If true it will process internal contours
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Point2D_F32
protected @Nullable PixelTransform<Point2D_F32>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
In a binary image the contour on the right and bottom is off by one pixel.getFound()
boolean
boolean
void
loadContour
(int id, DogArray<Point2D_I32> storage) void
Finds all valid ellipses in the binary imagevoid
setInternalContour
(boolean internalContour) void
setLensDistortion
(@Nullable PixelTransform<Point2D_F32> distToUndist) Specifies transforms which can be used to change coordinates from distorted to undistorted.void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration)
-
Field Details
-
distToUndist
-
distortedPoint
-
-
Constructor Details
-
BinaryEllipseDetectorPixel
-
BinaryEllipseDetectorPixel
public BinaryEllipseDetectorPixel()
-
-
Method Details
-
setLensDistortion
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.
-
process
Finds all valid ellipses in the binary image- Parameters:
binary
- binary image
-
adjustElipseForBinaryBias
In a binary image the contour on the right and bottom is off by one pixel. This is because the block region extends the entire pixel not just the lower extent which is where it is indexed from. -
getContours
-
loadContour
-
getContourFinder
-
isVerbose
public boolean isVerbose() -
isInternalContour
public boolean isInternalContour() -
setInternalContour
public void setInternalContour(boolean internalContour) -
getFound
-
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration) - Specified by:
setVerbose
in interfaceVerbosePrint
-