Camera Intrinsics for camera 2 not returned by estimateCameraParameters.
16 views (last 30 days)
Show older comments
Hi, can anyone explain the following?
After running the below commands:
[imagePoints,pairsUsed] = detectCircleGridPoints(CameraOneImages.Files,CameraTwoImages.Files,[9 11],PatternType="asymmetric",circleColor="white");
centerDistance = 2.2;
worldPoints = generateCircleGridPoints([9 11], centerDistance);
imageSize=[1701 1651];
params = estimateCameraParameters(imagePoints,worldPoints, 'ImageSize',imageSize);
When I check for the intrinsic matrix for camera 2, I found that "Camera Intrinsic" for camera 2 is not returned by the function estimateCameraParameters. What could be the cause for not reporting the "Camera Intrinsic" for camera 2? Everything appears to be okay since the function detectCircleGridPoints detects the centers of all the white dots in all the images and did not report any warnings and errors.
2 Comments
Matt J
on 27 Oct 2022
We cannot run your code unless you provide imagePoints,pairsUsed in a .mat file.
Answers (2)
Giridharan Kumaravelu
on 31 Oct 2022
It looks like the estimateCameraParameters function did not have sufficient number of quality points to converge to a better solution. Because of that it did not go far away from its initial estimates for the camera parameters (which can be negative too).
Looking at the plots generated by @Matt J, it appears that the calibration images lack variety in poses and also there were only 6 images.
@hlseck Please increase the number of calibration images and also calibrate with sufficient variety as described in this doc page: https://www.mathworks.com/help/vision/ug/prepare-camera-and-capture-images.html#mw_abbcc91e-07ab-4e40-a3b6-bb4a263e8379.
0 Comments
Matt J
on 27 Oct 2022
Edited: Matt J
on 27 Oct 2022
Hmmm. It seems like it might be a version-related problem. When I run your code in R2022a, I get intrinsics for both cameras:
>> params.CameraParameters1.Intrinsics
ans =
cameraIntrinsics with properties:
FocalLength: [5.8522e+05 3.4051e+05]
PrincipalPoint: [3.0379e+03 1.4885e+03]
ImageSize: [1701 1651]
RadialDistortion: [-2.0671 -2.6121e+05]
TangentialDistortion: [0 0]
Skew: 0
IntrinsicMatrix: [3×3 double]
>> params.CameraParameters2.Intrinsics
ans =
cameraIntrinsics with properties:
FocalLength: [5.6750e+05 3.0497e+05]
PrincipalPoint: [786.3843 1.0454e+03]
ImageSize: [1701 1651]
RadialDistortion: [-72.1295 1.0642]
TangentialDistortion: [0 0]
Skew: 0
IntrinsicMatrix: [3×3 double]
However, running it here in the forum (which is R2022b), generates significantly different intrinsics for camera1 and errors for camera2:
load('imagePoints_pairsUsed.mat')
centerDistance = 2.2;
worldPoints = generateCircleGridPoints([9 11], centerDistance);
imageSize=[1701 1651];
params = estimateCameraParameters(imagePoints,worldPoints, 'ImageSize',imageSize);
params.CameraParameters1.Intrinsics
params.CameraParameters2.Intrinsics
3 Comments
Matt J
on 27 Oct 2022
Edited: Matt J
on 27 Oct 2022
0.3 doesn't seem too bad ...
No, I don't believe there is a way to constrain the parameter estimates. However, you might try varying the position of the calibration pattern a bit more among your 6 images. Currently, they all seem to give points in approximately the same positions.
See Also
Categories
Find more on MATLAB Support Package for USB Webcams in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!