Skip to content

Instantly share code, notes, and snippets.

@amiltonwong
Created August 15, 2016 15:59
Show Gist options
  • Save amiltonwong/8eb510b1e1ea39f3871c5332a24224cf to your computer and use it in GitHub Desktop.
Save amiltonwong/8eb510b1e1ea39f3871c5332a24224cf to your computer and use it in GitHub Desktop.
I1 = imread('scene_left.png');
I2 = imread('scene_right.png');
figure
imshow(stereoAnaglyph(I1,I2));
title('Red-cyan composite view of the stereo images');
% disparityRange = [-6 10];
% disparityMap = disparity(rgb2gray(I1),rgb2gray(I2),'BlockSize',15,'DisparityRange',disparityRange);
disparityMap = disparity(rgb2gray(I1),rgb2gray(I2),'BlockSize',15);
figure
% imshow(disparityMap, disparityRange);
imshow(disparityMap,[0, max(max(disparityMap))]);
title('Disparity Map');
colormap jet
colorbar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment