Skip to content

Commit a024593

Browse files
D-Alexalalek
authored andcommitted
Merge pull request opencv#12147 from D-Alex:master
* add new chessboard detector The chessboar detector is based on the paper. Accurate Detection and Localization of Checkerboard Corners for Calibration Alexander Duda, Udo Frese British Machine Vision Conference, o.A., 2018. It utilizes point symmetry of checkerboard corners in combination with a localized Radon transform approximated by box filters to achieve high performance even on large images. Here, tests have shown that the ability to localize checkerboard corners is close to the theoretical limit of 1/100 of a pixel while being considerably less sensitive to image noise than standard methods. * chessboard: add reference to bibtex file * chessboard: add dependency to opencv_flann * fix: test chesscorners. It is valid to return an empty list In case no chessboard was detected it should be valid for the detector to return an empty list. For simplifcation, it should be allowed to return any number of corners if they are flagged as not found. * fix: opencv.bib remove empty lines * fix: doc findChessboardCorners replace cvSize with cv::Size * chessboard tests: factor out logic selecting detector * chessboard: add unit test for findChessboardCorners2 This is includes a new chessboard generator which supports subpix corners with high accuracy by wrapping an optimal chessboard using wrapPerspective. * fix: chessboard unit test - overwrite of default parameter flag of findCirclesGrid * chessboard: remove trailing whitespace * chessboard: fix debug drawing * chessboard: fix some issues during code review * chessboard: normalize asymmetric chessboard * chessboard: fix float double warning * remove trailing whitespace * chessboards: fix compiler warnings * chessboards: fix compiler warnings * checkerboard: some performance improvements * chessboard: remove NULL macros for language bindinges from internal headers * chessboard: shorten license terms * chessboard: remove unused internal method * chessboard: set helper functions to static * chessboard: fix normalizePoints1D using unshifted points * chessboard: remove wrongly copied text * chessboard: use CV_CheckTypeEQ macro * chessboard: comment all NaN checks * chessboard: use consistent color conversion * chessboard: use CheckChannelEQ macro * chessboard: assume gray color image for internal methods * chessboard: use std::swap * chessboard: use Mat.dataend * chessboard: fix compiler warnings * chessboard: replace some checks witch CV_CHECK macro * chessboard: fix comparison function for partial sort * chessboard: small cleanup * chessboard: use short license header * chessboard: rename findChessboard2 to findChessboardSB * chessboard: fix type in unit test
1 parent 87b5737 commit a024593

File tree

7 files changed

+4175
-18
lines changed

7 files changed

+4175
-18
lines changed

doc/opencv.bib

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,17 +1016,22 @@ @INPROCEEDINGS{Ke17
10161016
year = {2017},
10171017
organization = {IEEE}
10181018
}
1019-
10201019
@ARTICLE{gonzalez,
10211020
title={Digital Image Fundamentals, Digital Imaging Processing},
10221021
author={Gonzalez, Rafael C and others},
10231022
year={1987},
10241023
publisher={Addison Wesley Publishing Company}
10251024
}
1026-
10271025
@ARTICLE{gruzman,
10281026
title={Цифровая обработка изображений в информационных системах},
10291027
author={Грузман, И.С. and Киричук, В.С. and Косых, В.П. and Перетягин, Г.И. and Спектор, А.А.},
10301028
year={2000},
10311029
publisher={Изд-во НГТУ Новосибирск}
10321030
}
1031+
@INPROCEEDINGS{duda2018,
1032+
title = {Accurate Detection and Localization of Checkerboard Corners for Calibration},
1033+
year = {2018},
1034+
booktitle = {29th British Machine Vision Conference. British Machine Vision Conference (BMVC-29), September 3-6, Newcastle, United Kingdom},
1035+
publisher = {BMVA Press},
1036+
author = {Alexander Duda and Udo Frese},
1037+
}

modules/calib3d/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
set(the_description "Camera Calibration and 3D Reconstruction")
2-
ocv_define_module(calib3d opencv_imgproc opencv_features2d WRAP java python)
2+
ocv_define_module(calib3d opencv_imgproc opencv_features2d opencv_flann WRAP java python)
19.7 KB
Loading

modules/calib3d/include/opencv2/calib3d.hpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ CV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints,
793793
794794
@param image Source chessboard view. It must be an 8-bit grayscale or color image.
795795
@param patternSize Number of inner corners per a chessboard row and column
796-
( patternSize = cvSize(points_per_row,points_per_colum) = cvSize(columns,rows) ).
796+
( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) ).
797797
@param corners Output array of detected corners.
798798
@param flags Various operation flags that can be zero or a combination of the following values:
799799
- **CALIB_CB_ADAPTIVE_THRESH** Use adaptive thresholding to convert the image to black
@@ -841,6 +841,34 @@ square grouping and ordering algorithm fails.
841841
CV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize, OutputArray corners,
842842
int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE );
843843

844+
/** @brief Finds the positions of internal corners of the chessboard using a sector based approach.
845+
846+
@param image Source chessboard view. It must be an 8-bit grayscale or color image.
847+
@param patternSize Number of inner corners per a chessboard row and column
848+
( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) ).
849+
@param corners Output array of detected corners.
850+
@param flags operation flags for future improvements
851+
852+
The function is analog to findchessboardCorners but uses a localized radon
853+
transformation approximated by box filters being more robust to all sort of
854+
noise, faster on larger images and is able to directly return the sub-pixel
855+
position of the internal chessboard corners. The Method is based on the paper
856+
@cite duda2018 "Accurate Detection and Localization of Checkerboard Corners for
857+
Calibration" demonstrating that the returned sub-pixel positions are more
858+
accurate than the one returned by cornerSubPix allowing a precise camera
859+
calibration for demanding applications.
860+
861+
@note The function requires a white boarder with roughly the same width as one
862+
of the checkerboard fields around the whole board to improve the detection in
863+
various environments. In addition, because of the localized radon
864+
transformation it is beneficial to use round corners for the field corners
865+
which are located on the outside of the board. The following figure illustrates
866+
a sample checkerboard optimized for the detection. However, any other checkerboard
867+
can be used as well.
868+
![Checkerboard](pics/checkerboard_radon.png)
869+
*/
870+
CV_EXPORTS_W bool findChessboardCornersSB(InputArray image,Size patternSize, OutputArray corners,int flags=0);
871+
844872
//! finds subpixel-accurate positions of the chessboard corners
845873
CV_EXPORTS bool find4QuadCornerSubpix( InputArray img, InputOutputArray corners, Size region_size );
846874

0 commit comments

Comments
 (0)