Content deleted Content added
←Created page with '{{FeatureDetectionCompVisNavbox}} Chessboards arise frequently in computer vision theory and practice because their highly structured geome...' |
wlnk |
||
(25 intermediate revisions by 19 users not shown) | |||
Line 1:
{{FeatureDetectionCompVisNavbox}}
==Chessboard camera calibration==
A classical problem in computer vision is [[
:<math>
Line 11:
</math>
where <math>\mathbb{P}^n</math> is the [[
In this setting, [[
===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
{{multiple image
|title=Example: calibration rig
|align=center
Line 29:
===Multiplane calibration===
Multiplane calibration is a variant of [[
{{multiple image
|title=Example: multiplane calibration
|align=center
|text_align=center
|total_width=900
|width1=1128|height1=678|image1=Multiple chessboard views.png|caption1=Multiple views of a chessboard for [[
|width2= 507|height2=384|image2=Reconstructed boards camera.png|caption2=Reconstructed orientations <br /> (camera-centric coordinates)
|width3= 529|height3=471|image3=Reconstructed boards world.png|caption3=Reconstructed orientations <br /> (world-centric coordinates)
Line 43:
==Chessboard feature extraction==
The second context in which chessboards arise in computer vision is to demonstrate several canonical [[
===Corners===
Corners are a natural local image feature exploited in many computer vision systems. Loosely speaking, one can define a ''corner'' as the intersection of two edges. A variety of [[
A chessboard contains natural corners at the boundaries between board squares, so one would expect corner detection algorithms to successfully detect them in practice. Indeed, the following figure demonstrates Harris corner detection applied to a perspective-transformed [[:Image:Perspective chessboard.png|
{{multiple image
|title=Example: corner detection
|align=center
Line 57:
|total_width=600
|width1=767|height1=548|image1=Perspective chessboard.png|caption1=Perspective-transformed chessboard image
|width2=767|height2=548|image2=Harris corners detected on chessboard.png|caption2=Output of [[
}}
===Lines===
Lines are another natural local [[
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|
{{multiple image
|title=Example: line detection
|align=center
|text_align=center
|total_width=
|width1=767|height1=548|image1=Perspective chessboard.png|caption1=Perspective-transformed chessboard image
|width2=767|height2=548|image2=Perspective chessboard edges.png|caption2=[[
|width3=767|height3=548|image3=Perspective chessboard hough transform.png|caption3=[[
|width4=767|height4=548|image4=Perspective chessboard detected lines.png|caption4=Lines parameterized by [[
}}
The following [[
<
% Load image
I = imread('Perspective_chessboard.png');
% Compute edge image
BW = edge(I, 'canny');
% Compute Hough transform
Line 114 ⟶ 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 129 ⟶ 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 140 ⟶ 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>
==
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.
==See also==▼
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.
*[[Computer_vision| Computer vision]]▼
*[[Projective_geometry| Projective geometry]]▼
*[[Pinhole_camera| Pinhole camera]]▼
*[[Photogrammetry| Photogrammetry]]▼
*[[Camera_resectioning| Camera calibration]]▼
*[[Feature_detection_(computer_vision)| Feature detection]]▼
*[[Feature_extraction| Feature extraction]]▼
*[[Canny_edge_detector| Canny edge detection]]▼
*[[Corner_detection| Corner detection]]▼
*[[Structure_tensor| Structure tensor matrix]]▼
*[[Hough_transform| Hough transform]]▼
[[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.]]
==External links==▼
▲==See also==
The following links are pointers to popular [[MATLAB| MATLAB]] and [[OpenCV| OpenCV]] implementations of chessboard-related computer vision algorithms.▼
* [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▼
* [http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html Multiplane Camera Calibration From Multiple Chessboard Views] - MATLAB example of applying multiview auto-calibration to a series of chessboard images▼
* [http://www.mathworks.com/help/vision/ref/detectcheckerboardpoints.html MATLAB chessboard detection] - MATLAB function from the [http://www.mathworks.com/products/computer-vision/ Computer Vision System Toolbox] for detecting chessboards in images▼
* [http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.html OpenCV chessboard detection] - OpenCV function for detecting chessboards in images▼
* [http://www.mathworks.com/help/images/ref/corner.html MATLAB Harris corner detection] - MATLAB function for performing Harris corner detection▼
* [http://docs.opencv.org/doc/tutorials/features2d/trackingmotion/harris_detector/harris_detector.html OpenCV Harris corner detection] - OpenCV function for performing Harris corner detection▼
* [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▼
==Further reading==
Line 180 ⟶ 150:
# M. Rufli, D. Scaramuzza, and R. Siegwart. "Automatic detection of checkerboards on blurred and distorted images." IEEE/RSJ International Conference on Intelligent Robots and Systems. (2008).
# 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.
# S. Bennett and [[Joan Lasenby|J. Lasenby]]. "ChESS - quick and robust detection of chess-board features." Computer Vision and Image Understanding. vol. 118, pp.
# 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.
# S. Arca, E. Casiraghi, and G. Lombardi. "Corner localization in chessboards for camera calibration." IADAT. (2005).
# X. Hu, P. Du, and Y. Zhou. "Automatic corner detection of chess board for medical endoscopy camera calibration." Proceedings of the 10th International Conference on Virtual Reality Continuum and Its Applications in Industry. ACM. (2011).
Line 191 ⟶ 161:
<references/>
▲==External links==
[[:Category:Feature detection (computer vision)]]▼
▲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
▲* [http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html Multiplane Camera Calibration From Multiple Chessboard Views] - MATLAB example of applying multiview auto-calibration to a series of chessboard images
▲* [http://www.mathworks.com/help/vision/ref/detectcheckerboardpoints.html MATLAB chessboard detection] - MATLAB function from the [http://www.mathworks.com/products/computer-vision/ Computer Vision System Toolbox] for detecting chessboards in images
▲* [http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.html OpenCV chessboard detection] - OpenCV function for detecting chessboards in images
▲* [http://www.mathworks.com/help/images/ref/corner.html MATLAB Harris corner detection] - MATLAB function for performing Harris corner detection
▲* [http://docs.opencv.org/doc/tutorials/features2d/trackingmotion/harris_detector/harris_detector.html OpenCV Harris corner detection] - OpenCV function for performing Harris corner detection
▲* [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
|