detectCheckerboardPoints function is not able to detect the corner points of the board
18 views (last 30 days)
Show older comments
I am using MATLAB R2020b to calibrate a camera for an experiment. I have 2 images my checkerboard at a required angle. i cannot perform the calibration, because detectCheckerboardPoints function is not able to detect the corner points of the board. I used the same board in a different angle, in former setup of the experiment and the function worked fine.
this is the code i use:
figure (1)
f = 'calib2 34stage_hor_4l_roll-29pitch_-260 rail_gain20_64Hz_end_board_2603_mm.tiff';
[imagePoints,boardSize,imagesUsed] = detectCheckerboardPoints(f);
I = imread(f);
imshow(I);
hold on
M = prod(boardSize-1);
plot(imagePoints(:,1),imagePoints(:,2),'.r','MarkerSize',8);
hold on
for i = 1:length(imagePoints(:,1))
t = text(imagePoints(i,1),imagePoints(i,2),num2str(i),'FontSize',8);
t.Color = [1 0 0];
end
title ('checkerboard light on calibration points')
This is the error message:
Index in position 2 exceeds array bounds.
Error in transformation2 (line 12)
plot(imagePoints(:,1),imagePoints(:,2),'.r','MarkerSize',8);
I am attaching the image for refference (I am using tiff format, but it cannot be uploae here so JPG is attache). I would appreciate guidance on how to solve this matter
Noam
0 Comments
Accepted Answer
Shraddha Jain
on 3 Mar 2021
Hi Noam,
I understand that you are facing issues while using the detectCheckerboardPoints function. I was able to reproduce the same with the image that you have attached above. You are witnessing this error because the detectCheckerboardPoints function was not able to detect any corners in the given image (since imagePoints array is empty). Note that lighting and image contrast affect the performance of this function. A possible workaround is to modify the MinCornerMetric parameter while using the detectCheckerboardPoints as,
[imagePoints,boardSize,imagesUsed] = detectCheckerboardPoints(f,'MinCornerMetric',0.29);
I checked that with the value of MinCornerMetric set to 0.29, total 40 checker board points were detected.
The key to detecting more number of corner points is to reduce the noise or distortion in the input image to the detectCheckerboardPoints function. I recommend applying some pre-processing to the input image such as imbinarize so that the brightness and contrast of the image improves for corner points detection.
Hope this helps!
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!