Package boofcv.alg.shapes.edge
Class EdgeIntensityPolygon<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.shapes.edge.EdgeIntensityPolygon<T>
Looks at the difference in pixel values along the edge of a polygon and decides if its a false positive or not.
The average difference along the polygons edge is the score. Note that the abs is only taken after the sum
is finished, so objects which are entirely dark/light along the edge will have an advantage.
-
Constructor Summary
ConstructorDescriptionEdgeIntensityPolygon
(double cornerOffset, double tangentDistance, int numSamples, Class<T> imageType) Constructor which configures scoring. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkIntensity
(boolean insideDark, double threshold) Checks the edge intensity against a threshold.boolean
computeEdge
(Polygon2D_F64 polygon, boolean ccw) Checks to see if its a valid polygon or a false positive by looking at edge intensitydouble
double
double
double
void
setCornerOffset
(double cornerOffset) void
Sets the image which is going to be processed.void
setTangentDistance
(double tangentDistance) void
setTransform
(@Nullable PixelTransform<Point2D_F32> undistToDist) Used to specify a transform that is applied to pixel coordinates to bring them back into original input image coordinates.
-
Constructor Details
-
EdgeIntensityPolygon
public EdgeIntensityPolygon(double cornerOffset, double tangentDistance, int numSamples, Class<T> imageType) Constructor which configures scoring.- Parameters:
cornerOffset
- Number of pixels away from corner it will start samplingtangentDistance
- How far from the line it will sample tangentiallynumSamples
- Number of points it will sample along an edgeimageType
- Type of image it will process
-
-
Method Details
-
setTransform
Used to specify a transform that is applied to pixel coordinates to bring them back into original input image coordinates. For example if the input image has lens distortion but the edge were found in undistorted coordinates this code needs to know how to go from undistorted back into distorted image coordinates in order to read the pixel's value.- Parameters:
undistToDist
- Pixel transformation from undistorted pixels into the actual distorted input image..
-
setImage
Sets the image which is going to be processed. -
computeEdge
Checks to see if its a valid polygon or a false positive by looking at edge intensity- Parameters:
polygon
- The polygon being testedccw
- True if the polygon is counter clockwise- Returns:
- true if it could compute the edge intensity, otherwise false
-
checkIntensity
public boolean checkIntensity(boolean insideDark, double threshold) Checks the edge intensity against a threshold. dark: outside-inside ≥ threshold light: inside-outside ≥ threshold- Parameters:
insideDark
- is the inside of the polygon supposed to be dark or light?threshold
- threshold for average difference- Returns:
- true if the edge intensity is significant enough
-
getCornerOffset
public double getCornerOffset() -
setCornerOffset
public void setCornerOffset(double cornerOffset) -
getTangentDistance
public double getTangentDistance() -
setTangentDistance
public void setTangentDistance(double tangentDistance) -
getAverageInside
public double getAverageInside() -
getAverageOutside
public double getAverageOutside()
-