estimateChessboardSharpness
import { estimateChessboardSharpness } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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.
estimateChessboardSharpness(image: Mat, patternSize: Size, corners: Mat, rise_distance: number, vertical: boolean, sharpness: Mat): Scalar;4 available overloads
estimateChessboardSharpness(image: Mat, patternSize: Size, corners: Mat): Scalar;estimateChessboardSharpness(image: Mat, patternSize: Size, corners: Mat, rise_distance: number): Scalar;estimateChessboardSharpness(image: Mat, patternSize: Size, corners: Mat, rise_distance: number, vertical: boolean): Scalar;estimateChessboardSharpness(image: Mat, patternSize: Size, corners: Mat, rise_distance: number, vertical: boolean, sharpness: Mat): Scalar;imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by #findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOutput destination, filled by the native operation. 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)
Scalar(average sharpness, average min brightness, average max brightness,0)
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.