OpenCV calibration object detection
News
11.10.2005
  | Recently, our code was integrated in new OpenCV release (OpenCV 5). And we are now testing another algorithm
of calibration object detection, integrated in our new C++ calibration toolbox (see link below).
|
Downloads
v0.6b | sources zip | 20.04.2005 | Integrated reliability additions and modifications made by Philip Gruebele. Should become more robust. Many thanks to Philip! |
v0.5 | sources zip | 17.11.2004 | Migrated to OpenCV 4a |
| | | Attention! cvConvertImage function in HighGUI096.dll has a strange bug (as I regard it), resulting in failure of CvImage to load itself in grayscale mode.
Due to this I include my own (corrected) HighGUI096d.lib and HighGUI096d.dll into GUITest project. |
v0.41 | sources zip | 31.08.2004 | Bug fix from Carl Witty |
v0.4 | sources zip | 21.06.2004 | First release |
See also
Introduction
An enhanced algorithm for corner detection for OpenCV is proposed.
It works only for non-symmetric calibration objects (number of squares along one of the sides should be
even, other should be odd) and:
- is able to determine the origin point among calibration pattern corners without ambiguity;
- is more robust (I hope) to cluttered background and checkerboard-like objects in sight;
Requirements
The code was written for OpenCV v 3.1b and was tested mostly on win32 (Win2K, WinXP)
platform. It also was compiled and tested (though much less) on Mandrake Linux 9.0.
It should also work on any other system supporting OpenCV 3.1.
How to use
The distribution package consists of three parts:
- the corner detection code itself (in the calibinit/ folder)
- two example applications (in the apps/ folder)
- an automatic self-test application (apps/autotest)
- a simpistic test GUI application (apps/guitest)
- the test data used by the self-test application (in the testdata folder)
The package includes doxygen-generated documentation. To use the corner detection
algorithm in your application you can add the files from the calibinit/ folder to
your project (or build them as a separate lib, if you like it better). The
dmFindChessBoardCornerGuesses function has basically the same interface, as the
cvFindChessBoardCornerGuesses and can be used instead of standard OpenCV function.
The only difference is
in_bAdaptiveThresh parameter which tells whether
to use local adaptive thresholding or not.
For the sources to compile successfully, the include path should contain:
OpenCV/cv/include
OpenCV/cv/src
and library path should contain
OpenCV/lib
The testing applications will also require
OpenCV/otherlibs/highgui
to be added to the include path.
Modifications description
The OpenCV calibration pattern detection algorithm consists of these steps:
- Image binarization by thresholding to segment black and white squares
- Find corners of the black squares:
- Find contours of the boundaries of the black regions
- Select contours of suitable shape
- Approximate these contours with 4-vertex polygons
- Among these select the quadrangles resembling calibration pattern squares
- Extract corners of the selected quads, having at least one corner in vicinity
- Group and the corners of the selected quadrangles in lines according to calibration object size
Practically all the steps have their weaknesses:
- Image binarization threshold is chosen according to global image statistics, which is not alwasy successful at segmenting black squares of the checkerboard.
- The selection of quad contours of the black squares is not enough - it is able both to first and second type of errors
- The condition of corners selection is too weak - false detection occurs too often
Actually, the steps 1, 3 and 4 were rewritten. What was achieved - the algorithm is now:
- more robust to global illumination effects (in segmenting black squares from white);
- able to determine the origin point among calibration pattern corners without ambiguity;
- more robust to cluttered background and checkerboard-like objects in sight;
Limitations
-
Works only with with objects that have odd x even (or even x odd) number of squares (i.e 5x6, 7x8, 10x7, etc).
-
All the squares must be clearly visible (unoccluded).
-
The white space (marked with red on the picture below) between the outer squares and the object boundary
should be at least 1 square wide, like this:
-
Also, not all the problems of the original algorithm were treated -
the main problem that remains (as it appears to me) is contour detection and the polygonal approximation -
it sometimes fails to recognize well-segmented squares as quadrangles.
Another thing is that I actually tested only on my images, so maybe my modifications won't help other
people to do their calibration. If so - send me your image sequences, I'll try to tune up
my method to work with them also.
Examples
Several image sets with 5x6 object are included into the distribution package.
Load them into GUITest application and see what happens.
example set 1
example set 2
example set 3
Contacts
Please mail all comments, suggestions, problems and contributions to
Vezhnevets Vladimir
<
vvp @ graphics.cs.msu.ru>
(remove spaces from the address before sending).
|