matlab标定和三维重建的几个问题(已解决)

本文介绍了在MATLAB中进行相机标定和三维重建时遇到的问题,包括棋盘格尺寸不匹配、方格大小指定、三维重建坐标修改、图像校正后出现问题等,并提供了相应的解决方案,如调整标定板尺寸、设置正确的方格大小、注意相机设置和图像采集的规则等。

应用matlab程序做标定和三维重建,为什么三维重建不行?

问题1:打印的棋盘格的第一行和最后一行宽度不足了,不是30*30mm的正方形方格了;

解决:把标定板的第一行和最后一行去掉。

问题2:在matlab标定的程序里面指定了方格的大小:

squareSize = 108; % millimeters(我猜应该是每个方格的长度,好像不是面积)

解决:修改为我打印的标定板的方格大小:squareSize = 30

squareSize确实是每个小方格的长度,见http://www.mathworks.cn/cn/help/vision/ug/find-camera-parameters-with-the-camera-calibrator.html


问题3:这一段三维重建的坐标需要修改。怎么改?这个值是什么的值?


% Reduce the number of colors in the image to 128.
[reducedColorImage, reducedColorMap] = rgb2ind(J1, 128);


% Plot the 3D points of each color.
hFig = figure; hold on;
set(hFig, 'Position', [1 1 840   630]);
hAxes = gca;

问题4:校正前的图像本来视差不大,结果校正后的图像反而出现问题。为什么?

寻求解决:

1、用原来matlab2013a版的校正程序试一下。

2、我拍摄的左右图看着极线差不多平行,如果跳过校正这步,直接三维重建看看输出怎样?

注意事项:

 Camera Setup

To properly calibrate your camera, follow these rules:

  • Keep the pattern in focus, but do not use auto-focus.相机不能设成自动调焦!焦距需要保持不变!!!

  • Do not change zoom settings between images, otherwise the focal length changes.拍摄图像不要放大缩小,否则焦距会变!!


Capture Images

For best results, use between 10 and 20 images. The calibrator requires at least three images. For greater calibration accuracy:

  • Take the images of the pattern at a distance roughly equal to the distance from your camera to the objects of interest. For example, if you plan to measure objects of interest at a distance of 2 meters, keep your pattern approximately 2 meters from the camera.把棋盘标定板放在需要量测的距离上。

  • Place the checkerboard at an angle less than 45 degrees relative to the camera plane.棋盘版与相机平面的角度小于45度。

  • Do not modify the images. For example, do not crop them.不要裁剪图像。

  • Do not use auto-focus or change the zoom between images.不要用自动调焦和放大缩小图像。

  • Capture the images of a checkerboard pattern at different orientations relative to the camera.拍摄棋盘版不同的朝向。

  • Capture enough different images of the pattern so that you have covered as much of the image frame as possible. Lens distortion increases radially from the center of the image and sometimes is not uniform across the image frame. To capture this lens distortion, the pattern must appear close to the edges.

问题5:错误使用 vision.StereoParameters/reconstructSceneImpl (line 228)

You must call rectifyStereoImages on the stereoParams input before calling reconstructScene.
因为用生成的相机参数stereoParams对图像校正有问题,我尝试采用matlab2013a的图像校正程序对左右图像进行了校正,把校正后的结果代入2014版的程序中,赋值为J1和J2,然后打算进行三维重建,这时候报错。也就是说,matlab2014a必须采用rectifyStereoImages函数对左右图像校正之后,才能进行三维重建。


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值