Content deleted Content added
no "conclusion" section in a Wikipedia article |
wlnk |
||
(16 intermediate revisions by 14 users not shown) | |||
Line 1:
{{FeatureDetectionCompVisNavbox}}
==Chessboard camera calibration==
A classical problem in computer vision is [[3D reconstruction from multiple images|three-dimensional (3D) reconstruction]], where one seeks to infer 3D structure about a scene from two-dimensional (2D) images of it.<ref name=forsyth2002>D. Forsyth and J. Ponce. ''Computer Vision: A Modern Approach''. Prentice Hall. (2002).
:<math>
Line 15 ⟶ 13:
where <math>\mathbb{P}^n</math> is the [[projective space]] of dimension <math>n</math>.
In this setting, [[Camera resectioning|camera calibration]] is the process of estimating the parameters of the <math>3 \times 4</math> matrix <math>M = K \begin{bmatrix} R & t \end{bmatrix}</math> of the perspective model. Camera calibration is an important step in the computer vision pipeline because many subsequent algorithms require knowledge of camera parameters as input.<ref name=szeliski2010>R. Szeliski. ''Computer Vision: Algorithms and Applications''. Springer Science and Business Media. (2010).
===Direct linear transformation===
Direct linear transformation (DLT) calibration uses correspondences between world points and camera image points to estimate camera parameters. In particular, DLT calibration exploits the fact that the perspective pinhole camera model defines a set of similarity relations that can be solved via the [[direct linear transformation]] algorithm.<ref name=faugeras1993>O. Faugeras. ''Three-dimensional Computer Vision''. MIT Press. (1993).
{{multiple image
Line 61 ⟶ 59:
|width2=767|height2=548|image2=Harris corners detected on chessboard.png|caption2=Output of [[Corner detection#The Harris .26 Stephens .2F Plessey .2F Shi.E2.80.93Tomasi corner detection algorithm|Harris corner detector]]
}}
===Lines===
Lines are another natural local [[Feature (computer vision)|image feature]] exploited in many computer vision systems. Geometrically, the set of all lines in a 2D image can be parametrized by [[Polar coordinate system|polar coordinates]] <math>(\rho,\theta)</math> describing the distance and angle, respectively, of their [[Normal (geometry)|normal vectors]] with respect to the origin. The discrete [[Hough transform]] exploits this idea by transforming a spatial image into a matrix in <math>(\rho,\theta)</math>-space whose <math>(i,j)</math>-th entry counts the number of image edge points that lie on the line parametrized by <math>(\rho_i,\theta_j)</math>.<ref name=shapiro2001>L. Shapiro and G. Stockman. ''Computer Vision''. Prentice-Hall, Inc. (2001).
The grid structure of a chessboard naturally defines two sets of parallel lines in an image of it. Therefore, one expects that line detection algorithms should successfully detect these lines in practice. Indeed, the following figure demonstrates Hough transform-based line detection applied to a perspective-transformed [[:Image:Perspective chessboard.png|chessboard image]]. Clearly, the Hough transform is able to accurately detect the lines induced by the board squares.
Line 103 ⟶ 79:
The following [[MATLAB]] code generates the above images using the [http://www.mathworks.com/products/image/ Image Processing Toolbox]:
<
% Load image
I = imread('Perspective_chessboard.png');
% Compute edge image
BW = edge(I, 'canny');
% Compute Hough transform
Line 116 ⟶ 92:
numpeaks = 19;
thresh = ceil(0.1 * max(H(:)));
P = houghpeaks(H, numpeaks, 'threshold', thresh);
% Extract image lines
lines = houghlines(BW, theta, rho, P, 'FillGap', 50, 'MinLength', 60);
% --------------------------------------------------------------------------
% Display results
% --------------------------------------------------------------------------
% Original image
figure; imshow(I);
Line 131 ⟶ 107:
% Hough transform
figure; image(theta, rho, imadjust(mat2gray(H)), 'CDataMapping', 'scaled');
hold on; colormap(gray(256));
plot(theta(P(:, 2)), rho(P(:, 1)), 'o', 'color', 'r');
% Detected lines
figure; imshow(I); hold on; n = size(I, 2);
for k = 1:length(lines)
% Overlay kth line
Line 142 ⟶ 118:
y = [lines(k).point1(2) lines(k).point2(2)];
line = @(z) ((y(2) - y(1)) / (x(2) - x(1))) * (z - x(1)) + y(1);
plot([1 n], line([1 n]), 'Color', 'r');
end
</syntaxhighlight>
==Limitations==
The main limitation of using chessboard patterns for geometric camera calibration is that due to their highly repetitive structure, they need to be completely visible in the camera image. This assumption may be violated e.g. when specular reflections due to inhomogenous lighting cause chessboard detection to fail in some of the corners. The measurement of camera distortions close to the image corners is also altered by the need of a completely visible chessboard target.
To solve this issue, chessboard targets can be combined with some position encoding. One popular way is to place ArUco markers<ref name=gerrido2014>S. Garrido-Jurado et al. "Automatic generation and detection of highly reliable fiducial markers under occlusion." Pattern Recognition, vol. 47(6), pp. 2280-2292. https://dl.acm.org/doi/abs/10.1016/J.PATCOG.2014.01.005. (2014).</ref> inside the lightchessboard squares. The main advantage of such ChArUco targets<ref name=opencv>OpenCV. https://docs.opencv.org/3.4/df/d4a/tutorial_charuco_detection.html.</ref> is that all light chessboard squares are uniquely coded and identifiable. This also allows to do single image multiplane calibration by placing multiple targets with different ArUco in one scene.
An alternative way for adding position encoding to chessboard patterns is the PuzzleBoard pattern:<ref name=stelldinger2024>P. Stelldinger, et al. "PuzzleBoard: A New Camera Calibration Pattern with Position Encoding." German Conference on Pattern Recognition. (2024). https://users.informatik.haw-hamburg.de/~stelldinger/pub/PuzzleBoard/. (2024).</ref> Each chessboard edge is given one bit of information such that local parts of the pattern show a unique bit pattern. In comparison to ChArUco patterns, the position encoding can be read at much lower resolutions.
[[File:PuzzleBoard8x11.jpg|thumb|center|500px|alt=An example of a PuzzleBoard pattern with 8x11 chessboard corners.|An example of a PuzzleBoard pattern with 8x11 chessboard corners. Each 3x3 tile pattern is unique.]]
==See also==
Line 166 ⟶ 151:
# Z. Weixing, et al. "A fast and accurate algorithm for chessboard corner detection." 2nd International Congress on Image and Signal Processing. (2009).
# A. De la Escalera and J. Armingol. "Automatic chessboard detection for intrinsic and extrinsic camera parameter calibration." Sensors. vol. 10(3), pp. 2027–2044 (2010).
# S. Bennett and [[Joan Lasenby|J. Lasenby]]. "ChESS - quick and robust detection of chess-board features." Computer Vision and Image Understanding. vol. 118, pp. 197–210 (2014).
# J. Ha. "Automatic detection of chessboard and its applications." Opt. Eng. vol. 48(6) (2009).
# F. Zhao, et al. "An automated x-corner detection algorithm (axda)." Journal of Software. vol. 6(5), pp. 791–797 (2011).
Line 178 ⟶ 163:
==External links==
The following links are pointers to popular
* [http://www.vision.caltech.edu/bouguetj/calib_doc/ Camera Calibration Toolbox for MATLAB] - MATLAB toolbox implementing many common camera calibration methods
* [http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html Camera Calibration and 3D Reconstruction] - OpenCV implementation of many common camera calibration methods
Line 188 ⟶ 173:
* [http://www.mathworks.com/help/images/hough-transform.html MATLAB Hough transform] - MATLAB function for computing the Hough transform
* [http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.html OpenCV Hough transform] - OpenCV function for computing the Hough transform
* [https://github.com/dkogan/mrgingham/ mrgingham] - tool for detection of chessboards
[[Category:Feature detection (computer vision)]]
|