使用Camera Calibrator APP对单目相机进行标定
创作时间:
作者:
@小白创作中心
使用Camera Calibrator APP对单目相机进行标定
引用
CSDN
1.
https://blog.csdn.net/qq_43120181/article/details/134869299
实验准备
- 准备标定板图像作为标定物,此处使用calib.io网站(Camera Calibration Pattern Generator – calib.io)生成的checkerboard图像,规格为7*9,棋盘格尺寸为20
- 准备相机,此处使用PC自带相机
- 准备标定图像,此处使用IPad显示标定板图像,使用相机拍摄不同方向的标定板照片共20张
标定过程
- 在matlab中选择Camera Calibrator APP
- 导入图像并设置棋盘格的宽度为20
- 由于光线及拍摄原因,部分图像中棋盘格的数量识别出错,可用的图像共计13张
- 点击calibrate按钮进行标定
实验结果
Extrinsic Parameters Visualization
camera-centric view
pattern-centric view
Reprojection Errors
相机内参估计值Camera Intrinsics
相机外参估计值Camera Extrinsics
Rotation Matrices:
val(:,:,1) =
0.9987 -0.0122 0.0496
0.0083 0.9969 0.0782
-0.0504 -0.0777 0.9957
val(:,:,2) =
0.9519 0.0484 0.3026
-0.0464 0.9988 -0.0139
-0.3029 -0.0008 0.9530
val(:,:,3) =
0.9352 -0.3501 0.0530
0.3504 0.9366 0.0054
-0.0515 0.0135 0.9986
val(:,:,4) =
0.9032 0.1725 -0.3930
-0.1000 0.9750 0.1982
0.4174 -0.1398 0.8979
val(:,:,5) =
0.9070 0.0598 -0.4170
-0.0180 0.9945 0.1036
0.4209 -0.0865 0.9030
val(:,:,6) =
0.9915 -0.0094 0.1299
0.0032 0.9989 0.0478
-0.1301 -0.0470 0.9904
val(:,:,7) =
0.9824 0.1535 0.1061
-0.1614 0.9844 0.0702
-0.0937 -0.0861 0.9919
val(:,:,8) =
0.9742 -0.2075 0.0890
0.2055 0.9782 0.0302
-0.0933 -0.0111 0.9956
val(:,:,9) =
0.9899 0.0799 0.1174
-0.0874 0.9944 0.0599
-0.1119 -0.0695 0.9913
val(:,:,10) =
0.9143 -0.2046 0.3496
0.2421 0.9679 -0.0669
-0.3247 0.1458 0.9345
val(:,:,11) =
0.8366 -0.3250 0.4410
0.4657 0.8459 -0.2601
-0.2885 0.4229 0.8590
val(:,:,12) =
0.9434 -0.3305 -0.0265
0.3316 0.9413 0.0631
0.0041 -0.0683 0.9977
val(:,:,13) =
0.9609 0.2743 -0.0373
-0.2434 0.9014 0.3582
0.1319 -0.3351 0.9329
Rotation Vectors
Translation Vectors:
计算参数估计误差
内参估计误差
外参估计误差
旋转向量估计误差
平移向量估计误差
- MATLAB代码
% Define images to process
imageFileNames = {'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_55_29_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_58_42_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_56_11_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_58_35_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_58_39_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_55_57_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_55_59_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_56_02_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_56_06_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_58_44_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_58_47_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_55_37_Pro.jpg',...
'D:\Documents\NewWork\Codes\MATLAB\calibrationExp\Images\WIN_20231207_10_55_49_Pro.jpg',...
};
% Detect checkerboards in images
[imagePoints, boardSize, imagesUsed] = detectCheckerboardPoints(imageFileNames);
imageFileNames = imageFileNames(imagesUsed);
% Generate world coordinates of the corners of the squares
squareSize = 20; % in units of 'mm'
worldPoints = generateCheckerboardPoints(boardSize, squareSize);
% Calibrate the camera
[cameraParams, imagesUsed, estimationErrors] = estimateCameraParameters(imagePoints, worldPoints, ...
'EstimateSkew', false, 'EstimateTangentialDistortion', false, ...
'NumRadialDistortionCoefficients', 2, 'WorldUnits', 'mm', ...
'InitialIntrinsicMatrix', [], 'InitialRadialDistortion', []);
% View reprojection errors
h1=figure; showReprojectionErrors(cameraParams, 'PatternCentric');
% Visualize pattern locations
h2=figure; showExtrinsics(cameraParams, 'CameraCentric');
% Display parameter estimation errors
displayErrors(estimationErrors, cameraParams);
% For example, you can use the calibration data to remove effects of lens distortion.
originalImage = imread(imageFileNames{1});
undistortedImage = undistortImage(originalImage, cameraParams);
提高校准精度的方法
修改标定设置。尝试使用 3 个径向畸变系数,估计切向畸变或偏斜。
拍摄更多标定图像。图像中的图案必须处于不同的 3D 方向,并且其位置应确保在视野的所有部分都有关键点。特别是让关键点靠近图像的边缘和角落非常重要,以便更好地估计失真系数。
排除重投影错误高的图像并重新标定。
参考内容
- http:// ww2.mathworks.cn/help/vision/examples/evaluating-the-accuracy-of-single-camera-calibration.html
热门推荐
李奇微:如何扭转朝鲜战争局面
福字不能倒着贴?这些春联千万别贴错了!
福字应该正着贴还是倒着贴?传统习俗有讲究
家中的福字不能超过几个,客厅怎么挂福
适合上班族的十大懒人宠物:从金鱼到蜗牛
环纹蚓螈:首个发现具有哺乳行为的两栖动物
一杯红糖姜水,温暖整个冬天:从驱寒到调理全方位保健
超声引导精准治疗,基层医院成功开展网球肘微创手术
“老登”究竟是何方神圣?一篇文章带你了解这个词的前世今生!
医院服务流程如何优化?专家详解十大提效方案
CR450动车组揭秘:中国高铁速度再突破
中国高铁刷新速度纪录,400公里时速引领全球铁路新高度
揭秘高铁与动车速度设计的秘密
中国金枪鱼产业跃居全球第三,年出口额超8亿美元
冬季常备药品指南:10类药物应对常见疾病
抗美援朝中的沃克中将车祸揭秘
忽视踝关节扭伤致慢性疼痛,专家提醒:这4步处理很关键
隋朝小沙弥一句话,道破“金刚怒目”和“菩萨低眉”真谛
宁静淡泊,高雅绝俗:解读王维《竹里馆》的艺术境界
从分封到集权:西汉东汉政治经济文化比较
汉景帝削藩引七国之乱,三个月平叛奠定中央集权
刘邦留吕后:为稳固江山的权谋抉择
香蕉树叶子修剪,让你的香蕉更完美
CFA加持,如何选优秀投资顾问?
结直肠癌早期诊断迎来新希望:代谢物检测或替代结肠镜
金融大咖揭秘:如何成为顶级投资顾问
志愿军助力朝鲜人民重建家园
Elasticsearch模糊搜索技巧大揭秘
Elasticsearch模糊查询性能优化:超越Oracle的搜索能力
换油周期翻倍,大修延20%:高品质机油性价比揭秘