public class BinaryEllipseDetectorPixel
extends java.lang.Object
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:
| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryEllipseDetectorPixel.Found |
| Modifier and Type | Field and Description |
|---|---|
protected boofcv.struct.distort.PixelTransform2_F32 |
distToUndist |
| Constructor and Description |
|---|
BinaryEllipseDetectorPixel() |
| Modifier and Type | Method and Description |
|---|---|
boofcv.alg.filter.binary.LinearContourLabelChang2004 |
getContourFinder() |
java.util.List<BinaryEllipseDetectorPixel.Found> |
getFound() |
double |
getMaxDistanceFromEllipse() |
int |
getMaximumContour() |
double |
getMaxMajorToMinorRatio() |
int |
getMinimumContour() |
boolean |
isInternalContour() |
boolean |
isVerbose() |
void |
process(boofcv.struct.image.GrayU8 binary)
Finds all valid ellipses in the binary image
|
void |
setInternalContour(boolean internalContour) |
void |
setLensDistortion(boofcv.struct.distort.PixelTransform2_F32 distToUndist)
Specifies transforms which can be used to change coordinates from distorted to undistorted.
|
void |
setMaxDistanceFromEllipse(double maxDistanceFromEllipse) |
void |
setMaximumContour(int maximumContour) |
void |
setMaxMajorToMinorRatio(double maxMajorToMinorRatio) |
void |
setMinimumContour(int minimumContour) |
void |
setVerbose(boolean verbose) |
protected boolean |
touchesBorder(java.util.List<georegression.struct.point.Point2D_I32> contour) |
public void setLensDistortion(boofcv.struct.distort.PixelTransform2_F32 distToUndist)
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.
distToUndist - Transform from distorted to undistorted image.public void process(boofcv.struct.image.GrayU8 binary)
binary - binary imageprotected final boolean touchesBorder(java.util.List<georegression.struct.point.Point2D_I32> contour)
public boofcv.alg.filter.binary.LinearContourLabelChang2004 getContourFinder()
public boolean isVerbose()
public boolean isInternalContour()
public void setInternalContour(boolean internalContour)
public void setVerbose(boolean verbose)
public double getMaxDistanceFromEllipse()
public void setMaxDistanceFromEllipse(double maxDistanceFromEllipse)
public int getMinimumContour()
public void setMinimumContour(int minimumContour)
public int getMaximumContour()
public void setMaximumContour(int maximumContour)
public double getMaxMajorToMinorRatio()
public void setMaxMajorToMinorRatio(double maxMajorToMinorRatio)
public java.util.List<BinaryEllipseDetectorPixel.Found> getFound()