The calibrator app says the patterns are "too similar" even if they are not

67 visualizzazioni (ultimi 30 giorni)
I am trying to calibrate some images with a checkerbard calibration and the (single) Camera Calibrator app, but the app claims the patterns are "too similar" even if they are not. I know that they aren't too smilar because I have a specular setting with another camera that works. Moreover, if you apply some sort of transformation to the images (sometimes flipping them upside down, sometimes mirroring them) the app works fine and calibrate.
The images can be downloaded from this repo. cam1 works fine. cam2 doesn't work. cam2Rotated works fine.
Does anyone have an idea of what is wrong with these images?
Thanks for your help!
  2 Commenti
Stefano
Stefano il 12 Dic 2025 alle 22:25
No, it is basically the same issue. Last time I 'solved' it by rotating the image by 180 degrees. I found out that this solution doesn't always work, so I would really like to understand what's wrong with this.

Accedi per commentare.

Risposta accettata

Stefano
Stefano il 16 Dic 2025 alle 19:23
Modificato: Stefano il 16 Dic 2025 alle 19:29
After a bit of debugging, I find out that the error "Unable to estimate camera parameters. The 3-D orientations of the calibration pattern might be too similar across images. Remove any similar images and recalibrate the cameras again." was not due to having 'too similar' patterns, but rather to the position at which the principal point converges after calibration.
In the function 'estimateCameraParameters' there is a sanity check done through 'validateEstimatedResult' that checks if the principal point is positive in the camera reference frame. By removing 'validateEstimatedResult' you will be able to get an output from 'estimateCameraParameters'. Same check is done other times in the cameraIntrinsicsImpl.m file, which you invoke when calling params.Intrinsics.
What I did to solve the problem and get the intrinsics is to modify the following matlab functions:
  • cameraIntrinsicsImpl.m
  • estimateCameraParameters.m
  • validatePrincipalPoint.m
and remove all the points where there's a check on the positivness of the principal point. I do not attach the modified files for now becuase I am not sure it is ok to share modified matlab functions online. After removing all the checks everything work, also the app.
Said that, if you are experinecing a similar issue (i.e. this 'too similar patterns' error when patterns are clearly different) keep in mind that it may be due to something else. I believe this other question is related to the same problem (negative principal point cordinates which causes an error when we try to create a camera object).
For more details I advise reading all the comment thred!

Più risposte (1)

Matt J
Matt J il 12 Dic 2025 alle 23:54
Modificato: Matt J il 12 Dic 2025 alle 23:57
Your cam2 images are of poor quality. Corner detection done in isolation fails pretty badly for some of them (see below). Did you visually inspect all 44 images to verify corner detection success by the app? Regardless, I think you need to improve the image collection quality, to make things easier on the calibrator app. I'm sure the designers have done what they can to make calibration robust to poor conditions, but it is both unnecessary and unwise to try to dependent on that.
load data
figure(1); procIt(I1)
boardSize = 1×2
6 9
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Nraw = 40
Nfiltered = 40
figure(2); procIt(I2)
boardSize = 1×2
8 11
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Nraw = 70
Nfiltered = 61
function procIt(I)
[imagePoints,boardSize] = detectCheckerboardPoints(I);
boardSize
Nraw=height(imagePoints)
cut = any(~isfinite(imagePoints),2);
imagePoints(cut,:)=[];
Nfiltered=height(imagePoints)
J = insertText(I,imagePoints,1:size(imagePoints,1));
J = insertMarker(J,imagePoints,'o','MarkerColor','red','Size',5);
imshow(J);
title(sprintf('Detected a %d x %d Checkerboard',boardSize));
end
  12 Commenti
Matt J
Matt J il 16 Dic 2025 alle 18:06
I wouldn't trust any of this. Did you look at any of the estimated parameters besides the principal point? What about the extrinsics? Do they make sense?
Stefano
Stefano il 16 Dic 2025 alle 18:59
Yes, the extrinsics makes sense. The cameras are roughly in the correct position and orientation as they are in the lab.
Btw, I have just modified the functions to avoid the positivness check of the principal point and now all works, included the calibration from the app; now I regards the question as solved.

Accedi per commentare.

Prodotti


Release

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by