张正友标定方法标定精度评估

2023-11-04 07:48

本文主要是介绍张正友标定方法标定精度评估,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

摘抄自matlab帮助文件

Evaluating the Accuracy of Single Camera Calibration- MATLAB & Simulink

Overview

Camera calibration is the process of estimating parameters of the camera using images of a special calibration pattern. The parameters include camera intrinsics, distortion coefficients, and camera extrinsics. Once you calibrate a camera, there are several ways to evaluate the accuracy of the estimated parameters:

  • Plot the relative locations of the camera and the calibration pattern

  • Calculate the reprojection errors

  • Calculate the parameter estimation errors

Calibrate the Camera

Estimate camera parameters using a set of images of a checkerboard calibration pattern.

% Create a set of calibration images.
images = imageDatastore(fullfile(toolboxdir('vision'), 'visiondata', ...'calibration', 'fishEye'));
imageFileNames = images.Files;% Detect calibration pattern.
[imagePoints, boardSize] = detectCheckerboardPoints(imageFileNames);% Generate world coordinates of the corners of the squares.
squareSize = 29; % millimeters
worldPoints = generateCheckerboardPoints(boardSize, squareSize);% Calibrate the camera.
[params, ~, estimationErrors] = estimateCameraParameters(imagePoints, worldPoints);

Extrinsics

You can quickly discover obvious errors in your calibration by plotting relative locations of the camera and the calibration pattern. Use the showExtrinsics function to either plot the locations of the calibration pattern in the camera's coordinate system, or the locations of the camera in the pattern's coordinate system. Look for obvious problems, such as the pattern being behind the camera, or the camera being behind the pattern. Also check if a pattern is too far or too close to the camera.

figure;
showExtrinsics(params, 'CameraCentric');
figure;
showExtrinsics(params, 'PatternCentric');

Reprojection Errors

Reprojection errors provide a qualitative measure of accuracy. A reprojection error is the distance between a pattern keypoint detected in a calibration image, and a corresponding world point projected into the same image. TheshowReprojectionErrors function provides a useful visualization of the average reprojection error in each calibration image. If the overall mean reprojection error is too high, consider excluding the images with the highest error and recalibrating.

figure;
showReprojectionErrors(params);

Estimation Errors

Estimation errors represent the uncertainty of each estimated parameter. The estimateCameraParameters function optionally returns estimationErrors output, containing the standard error corresponding to each estimated camera parameter. The returned standard error  (in the same units as the corresponding parameter) can be used to calculate confidence intervals. For example +/-  corresponds to the 95% confidence interval. In other words, the probability that the actual value of a given parameter is within  of its estimate is 95%.

displayErrors(estimationErrors, params);
			Standard Errors of Estimated Camera Parameters----------------------------------------------Intrinsics
----------
Focal length (pixels):   [  714.1881 +/- 3.3220      710.3793 +/- 4.0580  ]
Principal point (pixels):[  563.6511 +/- 5.3966      355.7271 +/- 3.3039  ]
Radial distortion:       [   -0.3535 +/- 0.0091        0.1728 +/- 0.0488  ]Extrinsics
----------
Rotation vectors:[   -0.6096 +/- 0.0054       -0.1789 +/- 0.0073       -0.3835 +/- 0.0024  ][   -0.7283 +/- 0.0050       -0.0996 +/- 0.0072        0.1964 +/- 0.0027  ][   -0.6722 +/- 0.0051       -0.1444 +/- 0.0074       -0.1329 +/- 0.0026  ][   -0.5836 +/- 0.0056       -0.2901 +/- 0.0074       -0.5622 +/- 0.0025  ][   -0.3157 +/- 0.0065       -0.1441 +/- 0.0075       -0.1067 +/- 0.0011  ][   -0.7581 +/- 0.0052        0.1947 +/- 0.0072        0.4324 +/- 0.0030  ][   -0.7515 +/- 0.0051        0.0767 +/- 0.0072        0.2070 +/- 0.0029  ][   -0.6223 +/- 0.0053        0.0231 +/- 0.0073        0.3663 +/- 0.0024  ][    0.3443 +/- 0.0063       -0.2226 +/- 0.0073       -0.0437 +/- 0.0014  ]Translation vectors (mm):[ -146.0550 +/- 6.0391      -26.8706 +/- 3.7321      797.9021 +/- 3.9002  ][ -209.4397 +/- 6.9636      -59.4589 +/- 4.3581      921.8201 +/- 4.6295  ][ -129.3864 +/- 7.0906      -44.1054 +/- 4.3754      937.6825 +/- 4.4914  ][ -151.0086 +/- 6.6904      -27.3276 +/- 4.1343      884.2782 +/- 4.3926  ][ -174.9537 +/- 6.7056      -24.3522 +/- 4.1609      886.4963 +/- 4.6686  ][ -134.3140 +/- 7.8887     -103.5007 +/- 4.8928     1042.4549 +/- 4.8185  ][ -173.9888 +/- 7.6890      -73.1717 +/- 4.7816     1017.2382 +/- 4.8126  ][ -202.9489 +/- 7.4327      -87.9116 +/- 4.6485      983.6961 +/- 4.9072  ][ -319.8898 +/- 6.3213     -119.8920 +/- 4.0925      829.4588 +/- 4.9590  ]

Interpreting Principal Point Estimation Error

The principal point is the optical center of the camera, the point where the optical axis intersects the image plane. You can easily visualize and interpret the standard error of the estimated principal point. Plot an ellipse around the estimated principal point , whose radii are equal to 1.96 times the corresponding estimation errors. The ellipse represents the uncertainty region, which contains the actual principal point with 95% probability.

principalPoint = params.PrincipalPoint;
principalPointError = estimationErrors.IntrinsicsErrors.PrincipalPointError;fig = figure;
ax = axes('Parent', fig);
imshow(imageFileNames{1}, 'InitialMagnification', 60, 'Parent', ax);
hold(ax, 'on');% Plot the principal point.
plot(principalPoint(1), principalPoint(2), 'g+', 'Parent', ax);% Plot the ellipse representing the 95% confidence region.
halfRectSize = 1.96 * principalPointError;
rectangle('Position', [principalPoint-halfRectSize, 2 * halfRectSize], ...'Curvature', [1,1], 'EdgeColor', 'green', 'Parent', ax);legend('Estimated principal point');
title('Principal Point Uncertainty');
hold(ax, 'off');

Interpreting Translation Vectors Estimation Errors

You can also visualize the standard errors of the translation vectors. Each translation vector represents the translation from the pattern's coordinate system into the camera's coordinate system. Equivalently, each translation vector represents the location of the pattern's origin in the camera's coordinate system. You can plot the estimation errors of the translation vectors as ellipsoids representing uncertainty volumes for each pattern's location at 95% confidence level.

% Get translation vectors and corresponding errors.
vectors = params.TranslationVectors;
errors = 1.96 * estimationErrors.ExtrinsicsErrors.TranslationVectorsError;% Set up the figure.
fig = figure;
ax = axes('Parent', fig, 'CameraViewAngle', 5, 'CameraUpVector', [0, -1, 0], ...'CameraPosition', [-1500, -1000, -6000]);
hold on% Plot camera location.
plotCamera('Size', 40, 'AxesVisible', true);% Plot an ellipsoid showing 95% confidence volume of uncertainty of
% location of each checkerboard origin.
labelOffset = 10;
for i = 1:params.NumPatternsellipsoid(vectors(i,1), vectors(i,2), vectors(i,3), ...errors(i,1), errors(i,2), errors(i,3), 5)text(vectors(i,1) + labelOffset, vectors(i,2) + labelOffset, ...vectors(i,3) + labelOffset, num2str(i), ...'fontsize', 12, 'Color', 'r');
end
colormap('hot');
hold off% Set view properties.
xlim([-400, 200]);
zlim([-100, 1100]);xlabel('X (mm)');
ylabel('Y (mm)');
zlabel('Z (mm)');grid on
axis 'equal'
cameratoolbar('Show');
cameratoolbar('SetMode', 'orbit');
cameratoolbar('SetCoordSys', 'Y');
title('Translation Vectors Uncertainty');

How to Improve Calibration Accuracy

Whether or not a particular reprojection or estimation error is acceptable depends on the precision requirements of your particular application. However, if you have determined that your calibration accuracy is unacceptable, there are several ways to improve it:

  • Modify calibration settings. Try using 3 radial distortion coefficients, estimating tangential distortion, or the skew.

  • Take more calibration images. The pattern in the images must be in different 3D orientations, and it should be positioned such that you have keypoints in all parts of the field of view. In particular, it is very important to have keypoints close to the edges and the corners of the image in order to get a better estimate of the distortion coefficients.

  • Exclude images that have high reprojection errors and re-calibrate.

Summary

This example showed how to interpret camera calibration errors.

这篇关于张正友标定方法标定精度评估的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/344299

相关文章

问题:第一次世界大战的起止时间是 #其他#学习方法#微信

问题:第一次世界大战的起止时间是 A.1913 ~1918 年 B.1913 ~1918 年 C.1914 ~1918 年 D.1914 ~1919 年 参考答案如图所示

[word] word设置上标快捷键 #学习方法#其他#媒体

word设置上标快捷键 办公中,少不了使用word,这个是大家必备的软件,今天给大家分享word设置上标快捷键,希望在办公中能帮到您! 1、添加上标 在录入一些公式,或者是化学产品时,需要添加上标内容,按下快捷键Ctrl+shift++就能将需要的内容设置为上标符号。 word设置上标快捷键的方法就是以上内容了,需要的小伙伴都可以试一试呢!

大学湖北中医药大学法医学试题及答案,分享几个实用搜题和学习工具 #微信#学习方法#职场发展

今天分享拥有拍照搜题、文字搜题、语音搜题、多重搜题等搜题模式,可以快速查找问题解析,加深对题目答案的理解。 1.快练题 这是一个网站 找题的网站海量题库,在线搜题,快速刷题~为您提供百万优质题库,直接搜索题库名称,支持多种刷题模式:顺序练习、语音听题、本地搜题、顺序阅读、模拟考试、组卷考试、赶快下载吧! 2.彩虹搜题 这是个老公众号了 支持手写输入,截图搜题,详细步骤,解题必备

电脑不小心删除的文件怎么恢复?4个必备恢复方法!

“刚刚在对电脑里的某些垃圾文件进行清理时,我一不小心误删了比较重要的数据。这些误删的数据还有机会恢复吗?希望大家帮帮我,非常感谢!” 在这个数字化飞速发展的时代,电脑早已成为我们日常生活和工作中不可或缺的一部分。然而,就像生活中的小插曲一样,有时我们可能会在不经意间犯下一些小错误,比如不小心删除了重要的文件。 当那份文件消失在眼前,仿佛被时间吞噬,我们不禁会心生焦虑。但别担心,就像每个问题

邮件群发推送的方法技巧?有哪些注意事项?

邮件群发推送的策略如何实现?邮件推送怎么评估效果? 电子邮件营销是现代企业进行推广和沟通的重要工具。有效的邮件群发推送不仅能提高客户参与度,还能促进销售增长。AokSend将探讨一些关键的邮件群发推送方法和技巧,以帮助企业优化其邮件营销策略。 邮件群发推送:目标受众 了解他们的需求、兴趣和行为习惯有助于你设计出更具吸引力和相关性的邮件内容。通过收集和分析数据,创建详细的客户画像,可以更精

上采样(upsample)的方法

上采样(upsample)的方法   在神经网络中,扩大特征图的方法,即upsample/上采样的方法   1)unpooling:恢复max的位置,其余部分补零   2)deconvolution(反卷积):先对input补零,再conv   3)插值方法,双线性插值等;   4)扩张卷积,dilated conv;

青龙面板部署通用教程,含服务器、路由器、X86等部署方法

1. 拉取镜像/更新镜像 docker pull whyour/qinglong:latest 2. 删除镜像 docker rmi whyour/qinglong:latest 3. 启动容器 普通服务器 docker run -dit \-v $PWD/ql/config:/ql/config \-v $PWD/ql/log:/ql/log \-v $PWD/ql/db:

# bash: chkconfig: command not found 解决方法

bash: chkconfig: command not found 解决方法 一、chkconfig 错误描述: 这个错误表明在 Bash 环境下,尝试执行 chkconfig 命令,但是系统找不到这个命令。chkconfig 命令是一个用于管理 Linux 系统中服务的启动和停止的工具,通常它是 initscripts 包的一部分,但在最新的 Linux 发行版中可能已经被 syste

Python几种建表方法运行时间的比较

建立一个表[0,1,2,3.......10n],下面几种方法都能实现,但是运行时间却截然不同哦 import time#方法一def test1(n):list=[]for i in range(n*10):list=list+[i]return list#方法二def test2(n):list=[]for i in range(n*10):list.append(i)#方法三d

XMG 重写- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event方法

//重写这个方法,来完成一些指定的事件。比如说按钮被遮到下面了,但是我想让点击到这块区域的时候让按钮去相应点击 - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {     // 当前坐标系上的点转换到按钮上的点     CGPoint btnP = [self convertPoint:point toVi