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 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 interface PolygonHelper
      Parameters:
      width - Image width in pixels
      height - Image height in pixels
    • filterContour

      public boolean filterContour(List<Point2D_I32> contour, boolean touchesBorder, boolean distorted)
      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 interface PolygonHelper
      Parameters:
      contour - External contour around a shape. Can be modified
      touchesBorder - true if the contour touches the image border or false if it doesnt
      distorted - 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 interface PolygonHelper
      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 touches
      touchesBorder - 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

      public void configureBeforePolyline(PointsToPolyline contourToPolyline, boolean touchesBorder)
      Description copied from interface: PolygonHelper
      Provide an oportunity to configure the polyline fit based on what's currently known
      Specified by:
      configureBeforePolyline in interface PolygonHelper