Matlab上的立体视觉(整流误差)

时间:2015-08-21 20:41:39

标签: matlab computer-vision matlab-cvst stereo-3d

我正在研究立体视觉任务并尝试运行此算法:

/usr/bin/python /var/www/photoburst.py

修改

运行此导致输出:

numImagePairs = 11;
imageFiles1 = cell(1,numImagePairs);
imageFiles2 = cell(1,numImagePairs);
imagemDir = fullfile('C:','Users','carlo','Documents','Iniciacao','Matlab','Principal');

for i = 1:numImagePairs
imageFiles1{i} = fullfile(imagemDir, sprintf('left%02d.jpg',i));
imageFiles2{i} = fullfile(imagemDir, sprintf('right%02d.jpg',i));
end

%Detect the checkerboard
[imagePoints,boardSize,pairsUsed] = detectCheckerboardPoints(imageFiles1,imageFiles2);

%Generate world coordinates of the checkerboard points
squareSize=29; %millimeters
worldPoints= generateCheckerboardPoints(boardSize, squareSize);

%Compute the stereo camera parameters
stereoParams= estimateCameraParameters(imagePoints,worldPoints);


%Evaluate calibration accuracy
figure;
showReprojectionErrors(stereoParams);

%Read in the stereo pair of images
I1 = imread('left.jpg');
I2 = imread('right.jpg');

%Rectify the images
[J1,J2]=rectifyStereoImages(I1,I2,stereoParams);

%Display the images before rectification
figure;
imshow(stereoAnaglyph(I1,I2));
title('Before rectification');

%Display the images after rectification
figure;
imshow(stereoAnaglyph(J1,J2));
title('After rectification');


%Generate the disparity map
disparityMap = disparity(J1,J2);
figure;
imshow(disparityMap, [0,64]);
colormap('jet');
colorbar;
title('Disparity Map');

在这种情况下,所有图像的所有角落都被检测到,这意味着校准显然运行正常并且两个摄像机之间的距离为11厘米。

0 个答案:

没有答案