depth estimation of stereographic photographs

1 view (last 30 days)
I have written following code for depth estimation. I have plotted surf plot, in which Z-axis shows the information regarding depth values. I do not know how to extract the depth value from it. Any help would be really helpful for me.
Code:
load stereoParameters
InL = imread('LF1.jpeg');
imshow(InL)
title('Left Picture')
figure
InR = imread('RF1.jpeg');
imshow(InR)
title('Right Picture')
figure
%% Image Details
A = size(InL) %[rows, columns, numberOfColorChannels]
B = size(InR)
E = numel( InL ) %total number of pixel of img1
F = numel( InR )
%% Rectification
imshowpair(InL, InR) % Display the images before rectification
title('Unrectified Images')
figure
%%
[OutL, OutR] = rectifyStereoImages(InL, InR, stereoParams); % Rectify images
C = [OutL, OutR];
D = size(C);
G = numel( C );
I = imshowpair(OutL, OutR) % Display the images after rectification.
title('Rectified Images')
imsave %save this picture as 'my.bmp'
%% Meshgrid
rgb_img = imread('my.bmp');
%Intensity Image
I = .2989*rgb_img(:,:,1)...
+.5870*rgb_img(:,:,2)...
+.1140*rgb_img(:,:,3);
[X,Y]= meshgrid(1:size(I,1),1:size(I,2));
figure;
F = surf(X,Y,I','EdgeColor','none');
xlabel('X axis');
ylabel('Y axis');
zlabel('Z axis');
colorbar()

Answers (1)

Prabhan Purwar
Prabhan Purwar on 30 Jul 2021
Hi,
Kindly have a look at the following examples for depth estimation using sterographic images:
Thanks

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!