使用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
热门推荐
老鸭炖什么食材最佳?这几种吃过吗?
冠心病防治指南:保护您的心脏健康
尿隐血是什么意思
雪糕、冰棍抽检报告:一半检出“便便”污染,反复冻融风险高
盘点三国时期三次著名战役,具体情况是怎样的?
2025年中国房地产市场展望:政策宽松与市场回暖
瑜伽腹式呼吸的好处和功效
香港7家特色店铺:从书店到茶馆的文化之旅
浙江宣传:谐音梗可别念"邪"了
三角形的特性是什么?这些特性在几何学中有何重要性?
如何帮助宠物狗减肥(掌握正确的饮食习惯和运动方式)
属兔女孩名字能否带“晚”字?详解其寓意与搭配建议
K-Pop,没了K
美论坛:韩国“世宗大王号”能比得上中国055驱逐舰吗?
MRI检查遇到幽闭恐惧症的患者该怎么办?
什么是国债逆回购?一文读懂操作流程与注意事项
正式获批!广东将新增1所知名大学,选址定了
梦见坐飞机的深层含义与心理解析
白萝卜的五大健康功效与科学食用指南
高性能碳纤维复合材料在航空航天领域的应用发展与未来趋势
张志磊被卡巴耶尔KO究竟输在哪?知情人:战略失误,很难翻身了
竹笋的生长环境及生长地方条件
从法律视角解析中国高铁事故的真实原因
什么是性选择理论?
静安咖啡之味和南京西路现代生活态度
如何提升社会文化环境对个人发展的影响力
人身保险法中的保险利益
女性佩戴玉镯的时尚选择:大手腕的美丽配饰建议
利用免疫系统对抗癌细胞,新型免疫疗法带来抗癌新希望!
解析CAD软件在建筑设计中的具体应用