主要内容

undistortPoints

对透镜畸变的点坐标进行修正

描述

未替代的点= undistortPoints (cameraParams返回点坐标校正的镜头失真。该函数采用数值非线性最小二乘优化。

例子

未替代的点reprojectionErrors) = undistortPoints (cameraParams另外,返回用于评估未变形点精度的误差。

例子

全部折叠

创建一个包含校准图像的imageDatastore对象。

图像= imageDatastore (fullfile (toolboxdir (“愿景”),“visiondata”...“校准”“莫诺”));imageFileNames = images.Files;

检测校准模式。

[imagePoints, boardSize] = detectCheckerboardPoints (imageFileNames);

生成各个角落的世界坐标。方形尺寸为毫米。

squareSize = 29;worldPoints = generateCheckerboardPoints (boardSize squareSize);

校准相机。

i = ReadImage(图像,10);图像zize = [size(i,1),size(i,2)];params = viemateCameraparameters(PervicePoints,WorldPoints,...'图片尺寸'、图象尺寸);

加载图像并检测棋盘点。

点=侦探校验erboards(i);

不朽

未替代的点= untostortpoints(积分,参数);

Undistort图像。

[j,neworigin] = undostortimage(我,params,“OutputView”'满的');

翻译不失真点

undistortion points = [undistortion points (:,1) - newOrigin(1),...undistortedPoints (: 2), newOrigin (2)];

显示结果

图;imshow(我);持有;情节(点(:1),点(:,2),“r * - - - - - -”);标题(“发现点”);持有

图中包含一个坐标轴。以“检测点”为标题的轴包含两个类型为image, line的对象。

图;imshow(j);持有;情节(undistortedPoints (: 1) undistortedPoints (:, 2),“g * - - - - - -”);标题(“不失真点”);持有

图中包含一个坐标轴。标题为undistortion Points的轴包含两个类型为image, line的对象。

输入参数

全部折叠

输入点,指定了一个- 2矩阵[x y]坐标的数目。

摄像机参数,指定为cameraParameters或者摄像机毒品对象。你可以退回cameraParameters对象使用estimateCameraParameters函数。的cameraParameters对象包含相机的内在、外在和镜头畸变参数。

输出参数

全部折叠

未变点,作为一个返回2矩阵。的未替代的点输出包含xy点坐标校正的镜头失真。当你输入点为,函数输出未替代的点作为.否则,它输出未替代的点作为单身。

数据类型:|

重投影错误,返回为1的向量。您可以使用这些误差来评估未变形点的精度。该函数通过对未失真点施加失真,然后取结果与相应输入点之间的距离来计算误差。的reprojectionErrors输出以像素为单位。

介绍在R2014B.