opencv::calib3d

Function estimate_chessboard_sharpness_def

Source
pub fn estimate_chessboard_sharpness_def(
    image: &impl ToInputArray,
    pattern_size: Size,
    corners: &impl ToInputArray,
) -> Result<Scalar>
Expand description

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

§Parameters

  • image: Gray image used to find chessboard corners
  • patternSize: Size of a found chessboard pattern
  • corners: Corners found by find_chessboard_corners_sb
  • rise_distance: Rise distance 0.8 means 10% … 90% of the final signal strength
  • vertical: By default edge responses for horizontal lines are calculated
  • sharpness: Optional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries:

  • 0 = x coordinate of the underlying edge in the image
  • 1 = y coordinate of the underlying edge in the image
  • 2 = width of the transition area (sharpness)
  • 3 = signal strength in the black cell (min brightness)
  • 4 = signal strength in the white cell (max brightness)

§Returns

Scalar(average sharpness, average min brightness, average max brightness,0)

§Note

This alternative version of estimate_chessboard_sharpness function uses the following default values for its arguments:

  • rise_distance: 0.8F
  • vertical: false
  • sharpness: noArray()