Use more chessboards to get one cameraParameter? (cameraCalibration, estimateCa​meraParame​ters)

6 次查看(过去 30 天)
Hello,
I am currently trying to estimateCameraParameters using only one photo.
In my photo, I have six chessboards that I iteratively detect and I am left with ImagePoints of size 70x2x6 (six chessboards, with 70 coordinates of the points). Now, I need to feed those into estimateCameraParameters, but this function expects more photos from different angles, otherwise it says:
load help.mat
params = estimateCameraParameters(imagePointsAll, worldPointsAll, 'ImageSize', imgSize);
Error using estimateCameraParameters>validateEstimatedResult (line 430)
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.

Error in estimateCameraParameters (line 21)
validateEstimatedResult(cameraParams);
As you can see, I am trying to fit imagePointsAll – which is 420x2x3 matrix with image points (tripled, as I am trying to trick MATLAB into thinking it's three photos), worldPointsAll – which is a 420x2 matrix with hand-made coordinates which I know because I know the real-life locations (apparently I know them too well, because I am getting this error).
This works kinda okay when I tricked MATLAB with copies of the same image, but now it doesn't work.
Overall, I am trying to tackle a situation where I want to calibrate camera from one photo with 6 chessboards. I thought would help me gather more information about lens distorsion and overall make the estimation more accurate. However, so far, I was able to usually work with one chessboard at a time. If I work with more, I also get more cameraParameters (more projection matrices), which I do not want (I want one projection matrix, not six). Is there a way to use all 6 chessboards to get ONE camera parameters from all 6 chessboards? I've tried many approaches and workarounds, and I feel desperate now.
Thank you for your tips.

回答(1 个)

Matt J
Matt J 2025-4-17
编辑:Matt J 2025-4-17
Each slice of imagePointsAll should contain points from one and only one perspective of the chequerboard. Different slices should contain alternative perspectives of the chequerboard, but differing more substanitally than just a translation.
  3 个评论
Matt J
Matt J 2025-4-17
编辑:Matt J 2025-4-17
You don't need me to tell you if it works. Go ahead and test whether you can recover the parameters of a simulated camera with the scheme you propose.
But as I said, I believe the calibration algorithms expect each imagePoints(:,:,i) to be taken from a single perspective of the checkerboad.
Matt J
Matt J 2025-4-17
Why not simply as below?
load help
params = estimateCameraParameters(imagePoints, worldPointsAll(1:70,:), 'ImageSize', imgSize)
params =
cameraParameters with properties: Camera Intrinsics Intrinsics: [1x1 cameraIntrinsics] Camera Extrinsics PatternExtrinsics: [6x1 rigidtform3d] Accuracy of Estimation MeanReprojectionError: 0.3343 ReprojectionErrors: [70x2x6 double] ReprojectedPoints: [70x2x6 double] Calibration Settings NumPatterns: 6 DetectedKeypoints: [70x6 logical] WorldPoints: [70x2 double] WorldUnits: 'mm' EstimateSkew: 0 NumRadialDistortionCoefficients: 2 EstimateTangentialDistortion: 0

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Camera Calibration 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by