Use more chessboards to get one cameraParameter? (cameraCalibration, estimateCameraParameters)
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);
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.
0 个评论
回答(1 个)
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
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
2025-4-17
Why not simply as below?
load help
params = estimateCameraParameters(imagePoints, worldPointsAll(1:70,:), 'ImageSize', imgSize)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Camera Calibration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!