imagePoints matrix and boardSize is different for two images for same checkerboard.

3 ビュー (過去 30 日間)
I have two images picb3 and picb6. My code is like this
I1 = imread('C:\Users\Naseeb\Desktop\new st vs\left cam\picb3.png');
load('C:\Users\Naseeb\Desktop\cameraParams.mat');
im = undistortImage(I1, cameraParams);
[imagePoints, boardSize] = detectCheckerboardPoints(im);
squareSize = 21; % in millimeters
worldPoints = generateCheckerboardPoints(boardSize, squareSize);
[rotationMatrix, translationVector] = extrinsics(imagePoints, worldPoints, cameraParams)
When I used image picb3, matlab shows boardSize of [8,9] and imagePoints are of matrix [56x2] but when I used image picb6, matlab shows boardsize of [7,10] and imagePoints are of matrix [54x2]. Both images are taken from same camera (left camera or camera 1) and checkerboard is also same. Translation vector also shows in unconventional way as I'm attaching snapshot of that. I'm attaching my cameraParams, images and checkerboard pdf and translation vector. Can someone please explain why this happening and if it lead to any error? Thanks.

採用された回答

Dima Lisin
Dima Lisin 2016 年 2 月 12 日
編集済み: Dima Lisin 2016 年 2 月 12 日
Hi Naseeb,
The problem here is that detectCheckerboardPoints does not detect the checkerboard correctly 100% of the time. The correct size for this particular checkerboard is [7 10], and the points you got for picb3 are wrong. You can check visually whether the checkerboard was detected correctly as follows:
im = imread('picb3.png');
[imagePoints, boardSize] = detectCheckerboardPoints(im);
imshow(im);
hold on
plot(imagePoints(:, 1), imagePoints(:, 2), 'r*-');
Here's the result for for picb3. As you can see, the board was not detected correctly.
  2 件のコメント
Naseeb Gill
Naseeb Gill 2016 年 2 月 12 日
Thanks Dima,
I have many images in which checkerboard not detected correctly. I want to know what are the factors responsible fro this and what I should consider to avoid this?
Dima Lisin
Dima Lisin 2016 年 2 月 13 日
In this particular case I would suggest using a larger checkerboard.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCamera Calibration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by