findChessboardCornersSB
import { findChessboardCornersSB } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Finds the positions of internal corners of the chessboard using a sector based approach.
Note: The function requires a white boarder with roughly the same width as one of the checkerboard fields around the whole board to improve the detection in various environments. In addition, because of the localized radon transformation it is beneficial to use round corners for the field corners which are located on the outside of the board. The following figure illustrates a sample checkerboard optimized for the detection. However, any other checkerboard can be used as well.
Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern)
to create the corresponding checkerboard pattern:
\image html pics/checkerboard_radon.png width=60%
findChessboardCornersSB(image: Mat, patternSize: Size, corners: Mat, flags: number): boolean;2 available overloads
findChessboardCornersSB(image: Mat, patternSize: Size, corners: Mat): boolean;findChessboardCornersSB(image: Mat, patternSize: Size, corners: Mat, flags: number): boolean;imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput destination, filled by the native operation. Output array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
CALIB_CB_NORMALIZE_IMAGENormalize the image gamma with equalizeHist before detection.CALIB_CB_EXHAUSTIVERun an exhaustive search to improve detection rate.CALIB_CB_ACCURACYUp sample input image to improve sub-pixel accuracy due to aliasing effects.CALIB_CB_LARGERThe detected pattern is allowed to be larger than patternSize (see description).CALIB_CB_MARKERThe detected pattern must have a marker (see description). This should be used if an accurate camera calibration is required.
The boolean result.
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.