Matlab camera calibration scene recovery error

I am trying to use the Computer Vision System Toolbox to calibrate a pair of cameras below to be able to generate a three-dimensional vehicle cloud in the range of 1 to 5 m. The size of the output image was approximately 1 MB per image for the calibration images of the chessboard, and the square size of the chessboard was 25 mm. The cameras used were a pair of SJ4000 HD1080P cameras. The cameras were arranged as parallel to each other as possible, without an angle on the vertical axis. The calibration of the control point was carried out using bright light and a board. The average error per pixel using the stereo camera calibrator code was 3.31 with 31/32 successful pairings. The approximate distance to the chessboard was 30 cm, and the distance between the cameras was 20 cm. enter image description here The problem that I encounter when fixing is during the 3D reconstruction of the scene. Below is the result. I am not sure if there is a parameter missing from the camera setup, or if something is missing / should be added to the script. Below is the code that was used for stereo anaglyph and scene reconstruction, which was adapted using the Matlab stereo camera calibration guide.

% 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), 'InitialMagnification', 50);
title('Before Rectification');

% Display the images after rectification.
figure;
imshow(stereoAnaglyph(J1, J2), 'InitialMagnification', 50);
title('After Rectification');
% 
% Compute Disparity for 3-D Reconstruction 
% The distance in pixels between corresponding points in the rectified images is called disparity. 
% The disparity is used for 3-D reconstruction, because it is proportional to the distance between the cameras and the 3-D world point.
disparityMap = disparity(rgb2gray(J1), rgb2gray(J2));
figure;
imshow(disparityMap, [0, 64], 'InitialMagnification', 50);
colormap('jet');
colorbar;
title('Disparity Map');

%Reconstruct the 3-D Scene
%Reconstruct the 3-D world coordinates of points corresponding to each pixel     from the disparity map.

point3D = reconstructScene(disparityMap, stereoParams);

% Convert from millimeters to meters.
point3D = point3D / 1000;

% Visualize the 3-D Scene
% Plot points between 3 and 7 meters away from the camera.
z = point3D(:, :, 3);
zdisp = z;
point3Ddisp = point3D;
point3Ddisp(:,:,3) = zdisp;
showPointCloud(point3Ddisp, J1, 'VerticalAxis', 'Y',...
    'VerticalAxisDir', 'Down' );
xlabel('X');
ylabel('Y');
zlabel('Z');

I included images of Scene Reconstruction, Map of Mismatch, Average error per pixel and after correction. The version of Matlab that I am using is the R2014b Student Edition, purchased from the Matlab website.

Scene reconstruction

Average error per pixel

After correction

Non-compliance map

+4
source share
2 answers

. , @ezfn, , . , . , . , .

, 'DisparityRange' disparity. imtool . , . , , [0 64] .

+1
  • , , ( 3 ), , . , ( 1 ).
  • : ? , - , Matlab , .
+2

All Articles