Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab:一幅图像中两个棋盘上的外部函数_Matlab_Matlab Cvst - Fatal编程技术网

Matlab:一幅图像中两个棋盘上的外部函数

Matlab:一幅图像中两个棋盘上的外部函数,matlab,matlab-cvst,Matlab,Matlab Cvst,我正在为一个项目使用该功能,该项目旨在确定对象与连接有棋盘的摄影机之间的距离。这是为视频中的每一帧完成的。我的工作流程相当简单: 将不对称棋盘附加到每个对象 使用图像处理工具箱对约20幅图像校准摄像机 每帧 while checkerboardsFound < numCheckerboards % Undistort the image data = undistortImage(data, cameraParams); % Get the checkerboard points i

我正在为一个项目使用该功能,该项目旨在确定对象与连接有棋盘的摄影机之间的距离。这是为视频中的每一帧完成的。我的工作流程相当简单:

将不对称棋盘附加到每个对象

使用图像处理工具箱对约20幅图像校准摄像机

每帧

while checkerboardsFound < numCheckerboards
 % Undistort the image
 data = undistortImage(data, cameraParams);
 % Get the checkerboard points in the frame
 [imagePoints, boardSize] = detectCheckerboardPoints(data);
 worldPoints = generateCheckerboardPoints(boardSize, squareSize);
 % Get the rotation and translation
 [rot, trans] = extrinsics(imagePoints,worldPoints, cameraParams);

 % <Draw a black rectangle over the area where the checkerboard points are 
 % using the imagePoints matrix. This "hides" the checkerboard so we can
 % run the detectCheckerboardPoints(data) function again and find a different
 % one.>
 data = hideCheckerboard(data,...
        [imagePoints(1,:);...
        imagePoints(end,:)]);

 checkerboardsFound = checkerboardsFound + 1;
end;
while checkboards查找
我的问题是当我找到(比如)两个相距约5cm的特定棋盘,并查看由Exterinstics函数返回的各自平移向量的Z值时,我希望看到大约50个单位(5cm)的差异。然而,我看到了一个相当大的差异-例如,大约400个单位(40厘米)。我确信棋盘格的正方形尺寸定义正确(每个5毫米)。这些帧来自三星智能手机在视频模式下拍摄(放大)


请任何人帮助确定是什么导致Z值出现这种差异?以这种方式使用Exterinsics功能是否过于雄心勃勃?

您是否检查了校准的重投影错误?校准后,我已删除任何重投影错误超过1.5像素的图像。我的相机参数的固有估计误差如下:歪斜误差:0焦距误差:[4.3099 4.3121]主点误差:[1.4831 2.2602]径向畸变误差:[0.0026 0.0070]切向畸变误差:[0 0]我的外在误差的平均值为[0.1750 0.2632 0.5233]您是否检查了校准的重射误差?校准后,我已移除任何重射误差超过1.5像素的图像。我的相机参数的固有估计误差如下:歪斜误差:0焦距误差:[4.3099 4.3121]主点误差:[1.4831 2.2602]径向畸变误差:[0.0026 0.0070]切向畸变误差:[0 0]我的外在误差的平均值为[0.1750 0.2632 0.5233]