フィルターのクリア

Create calibration checkerboard using built-in function

4 ビュー (過去 30 日間)
James Heaton
James Heaton 2022 年 2 月 8 日
回答済み: Image Analyst 2022 年 2 月 8 日
Hi, I am attempting to perform LiDAR-Camera calibration and I am following the procedures to create a checkerboard here - https://www.mathworks.com/help/lidar/ug/lidar-camera-calibration-guidelines-and-procedure.html
In this page, it says that the checkerboard needs to have an even number of squares on one side, and have an odd number of squares on the other, and that we should use the built-in function checkerboard() to create this.
However, this function does not appear to be able to produce ceckerboard patterns with an odd number of squares on one side. Since the arguments to the function need to be an integer, and the arguments determine the number of tiles in the board, which contain 2 squares per tile. Therefore, it is impossible to create an odd-sided checkerboard since odd * even is always even. I am happy to use another program to create a checkerboard, I am just confused why on the guidelines it says to use this function when it is impossible to use this function to create the desired checkerboard.

回答 (2 件)

Jan
Jan 2022 年 2 月 8 日
編集済み: Jan 2022 年 2 月 8 日
nX = 5; % Number of columns
nY = 4; % Number of rows
C = zeros(nY, nX);
C(1:2:nY, 1:2:nX) = 1;
C(2:2:nY, 2:2:nX) = 1;
imagesc(C)
I do not find, where the documentation mentions the checkerboard() function. But if the doucmentation contains a not working instruction, send an enhancement request to MathWorks. This works over the contact form.

Image Analyst
Image Analyst 2022 年 2 月 8 日
You can just take half of the image checkerboard gives you. See how to create a 3by-5 board of squares:
% Create a checkerboard of 3 by 5 sets of 2x2 squares
grayImage = checkerboard(100, 3, 5);
subplot(2, 1, 1);
imshow(grayImage, []);
axis('on', 'image')
% Take half to get odd numbers of squares.
cb = grayImage(1:size(grayImage, 1)/2, 1:size(grayImage, 2)/2);
subplot(2, 1, 2);
imshow(cb, []);
axis('on', 'image')

カテゴリ

Help Center および File ExchangeLabeling, Segmentation, and Detection についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by