Package boofcv.alg.fiducial.calib.chess
Class ChessboardPolygonHelper<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.fiducial.calib.chess.ChessboardPolygonHelper<T>
- All Implemented Interfaces:
PolygonHelper
public class ChessboardPolygonHelper<T extends ImageGray<T>>
extends Object
implements PolygonHelper
Helper which expands polygons prior to optimization. This is done to counter act the erosion step which shrunk
the polygon
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureBeforePolyline
(PointsToPolyline contourToPolyline, boolean touchesBorder) Provide an oportunity to configure the polyline fit based on what's currently knownboolean
filterContour
(List<Point2D_I32> contour, boolean touchesBorder, boolean distorted) User defined filter to accept/reject or modify the contour of a shape.boolean
filterPixelPolygon
(Polygon2D_F64 undistorted, Polygon2D_F64 distorted, DogArray_B touches, boolean touchesBorder) If not touching the border then the number of corners must be 4.void
setImageShape
(int width, int height) Specifies width and height of the image being processed
-
Constructor Details
-
ChessboardPolygonHelper
public ChessboardPolygonHelper()
-
-
Method Details
-
setImageShape
public void setImageShape(int width, int height) Description copied from interface:PolygonHelper
Specifies width and height of the image being processed- Specified by:
setImageShape
in interfacePolygonHelper
- Parameters:
width
- Image width in pixelsheight
- Image height in pixels
-
filterContour
Description copied from interface:PolygonHelper
User defined filter to accept/reject or modify the contour of a shape. Called at most twice. First with distorted pixels and after distortion has been removed.- Specified by:
filterContour
in interfacePolygonHelper
- Parameters:
contour
- External contour around a shape. Can be modifiedtouchesBorder
- true if the contour touches the image border or false if it doesntdistorted
- True if pixels are distorted or false for undistorted pixel coordinates- Returns:
- true to keep the contour for further processing or false to reject it
-
filterPixelPolygon
public boolean filterPixelPolygon(Polygon2D_F64 undistorted, Polygon2D_F64 distorted, DogArray_B touches, boolean touchesBorder) If not touching the border then the number of corners must be 4. If touching the border there must be at least 3 corners not touching the border. 7 corners at most. If there were 8 then all sides of a square would be touching the border. No more than 3 corners since that's the most number of non-border corners a square can have.- Specified by:
filterPixelPolygon
in interfacePolygonHelper
- Parameters:
undistorted
- Polygon in undistorted image pixels.distorted
- Polygon in distorted/original image pixels.touches
- Array of booleans indicating which corners touch the image border. Only valid if part of it touchestouchesBorder
- true if the contour touches the image border or false if it doesnt- Returns:
- true to keep the contour for further processing or false to reject it
-
configureBeforePolyline
Description copied from interface:PolygonHelper
Provide an oportunity to configure the polyline fit based on what's currently known- Specified by:
configureBeforePolyline
in interfacePolygonHelper
-