boofcv.alg.fiducial.calib.chess
Class ChessboardPolygonHelper<T extends ImageGray>
- java.lang.Object
-
- boofcv.alg.fiducial.calib.chess.ChessboardPolygonHelper<T>
-
- All Implemented Interfaces:
- PolygonHelper
public class ChessboardPolygonHelper<T extends ImageGray> extends java.lang.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
Constructors Constructor and Description ChessboardPolygonHelper(BinaryPolygonDetector<T> detectorSquare, RefineBinaryPolygon<T> refineLine, RefineBinaryPolygon<T> refineCorner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadjustBeforeOptimize(Polygon2D_F64 polygon)This function is invoked just before a polygon's edge is optimized.booleanfilterContour(java.util.List<Point2D_I32> contour, boolean touchesBorder, boolean distorted)User defined filter to accept/reject or modify the contour of a shape.booleanfilterPixelPolygon(java.util.List<Point2D_I32> externalUndist, java.util.List<Point2D_I32> externalDist, GrowQueue_I32 splits, boolean touchesBorder)If not touching the border then the number of corners must be 4.voidsetImageShape(int width, int height)Specifies width and height of the image being processed
-
-
-
Constructor Detail
-
ChessboardPolygonHelper
public ChessboardPolygonHelper(BinaryPolygonDetector<T> detectorSquare, RefineBinaryPolygon<T> refineLine, RefineBinaryPolygon<T> refineCorner)
-
-
Method Detail
-
setImageShape
public void setImageShape(int width, int height)Description copied from interface:PolygonHelperSpecifies width and height of the image being processed- Specified by:
setImageShapein interfacePolygonHelper- Parameters:
width- Image width in pixelsheight- Image height in pixels
-
adjustBeforeOptimize
public void adjustBeforeOptimize(Polygon2D_F64 polygon)
Description copied from interface:PolygonHelperThis function is invoked just before a polygon's edge is optimized. It's pixel precise at this point.- Specified by:
adjustBeforeOptimizein interfacePolygonHelper
-
filterContour
public boolean filterContour(java.util.List<Point2D_I32> contour, boolean touchesBorder, boolean distorted)
Description copied from interface:PolygonHelperUser 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:
filterContourin 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(java.util.List<Point2D_I32> externalUndist, java.util.List<Point2D_I32> externalDist, GrowQueue_I32 splits, 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:
filterPixelPolygonin interfacePolygonHelper- Parameters:
externalUndist- External contour around a shape in undistorted pixel coordinates. Can be modifiedexternalDist- External contour around a shape in distorted pixel coordinates. Modifications ignored.splits- Indexes in the contour where the polygon has a vertextouchesBorder- 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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG