主要内容

undistortFisheyePoints

修正鱼眼镜头变形的点坐标

描述

例子

undistortedPoints= undistortFisheyePoints (intrinsic返回点坐标校正鱼眼镜头失真。

undistortedPoints= undistortFisheyePoints (___scaleFactor使用。返回修正的点坐标scaleFactor和前面的输入。

___camIntrinsics) = undistortFisheyePoints (___还返回一个cameraIntrinsics对象,它对应于产生未扭曲点的虚拟透视相机。

___reprojectionErrors) = undistortFisheyePoints (___同样的回报reprojectionErrors用于评价未变形点的精度。该函数通过对点施加失真,并取结果与相应输入点之间的距离来计算重投影误差。

例子

全部折叠

校正图像中检测到的棋盘点进行校正和平移,然后显示结果。

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

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

从图像中检测校准模式。

[imagePoints, boardSize] = detectCheckerboardPoints (imageFileNames);

为棋盘方块的角落生成世界坐标。

squareSize = 29;%毫米worldPoints = generateCheckerboardPoints (boardSize squareSize);

根据图像和世界点估计鱼眼参数。从第一个图像得到图像大小。

I = readimage(图片,10);imageSize = [size(I,1) size(I,2)];params = estimateFisheyeParameters (imagePoints worldPoints图象尺寸);

在第一个图像中,检测棋盘点。

点= detectCheckerboardPoints(我);

不失真的点和图像。

[undistortedPoints, intrinsics1] = undistortFisheyePoints(点,params.Intrinsics);[J, intrinsics2] = undistortion fishheyeimage (I,params。intrinsic。“OutputView”“全部”);

翻译未变形的点。

newOrigin = intrinsics2。PrincipalPoint - intrinsics1.PrincipalPoint;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)坐标。

鱼眼固有相机参数,指定为fisheyeIntrinsics对象。

指定为标量或标量的点的比例因子(sx sy)向量。指定要缩放的向量xy单独轴。增加比例以放大相机视图的透视图。

输出参数

全部折叠

未扭曲的点,返回为2的矩阵[x y]坐标的数目。如果,然后undistortedPoints.否则,undistortedPoints

数据类型:|

没有变形的虚拟相机的本质,作为一个cameraIntrinsics对象。这些内在特性适用于具有产生未失真图像的透视视角的相机。

重投影错误,返回为1的向量。该函数通过对未失真点施加失真,并取结果与相应输入点之间的距离来计算重投影误差。误差以像素表示。

介绍了R2017b