depth estimation of stereographic photographs

5 views (last 30 days)
Subhash Variya
Subhash Variya on 27 Jun 2021
Answered: Prabhan Purwar on 30 Jul 2021
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.
load stereoParameters
InL = imread('LF1.jpeg');
title('Left Picture')
InR = imread('RF1.jpeg');
title('Right Picture')
%% 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')
[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)...
[X,Y]= meshgrid(1:size(I,1),1:size(I,2));
F = surf(X,Y,I','EdgeColor','none');
xlabel('X axis');
ylabel('Y axis');
zlabel('Z axis');

Answers (1)

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

Community Treasure Hunt

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

Start Hunting!

Translated by