Skip to content

Instantly share code, notes, and snippets.

@amiltonwong
Created July 9, 2016 12:04
Show Gist options
  • Save amiltonwong/3748276c3d49415a45bc39af9dde9135 to your computer and use it in GitHub Desktop.
Save amiltonwong/3748276c3d49415a45bc39af9dde9135 to your computer and use it in GitHub Desktop.
left = imread('input/pair2-L.png');
right = imread('input/pair2-R.png');
left_gray = double(rgb2gray(left))./255.0;
right_gray = double(rgb2gray(right))./255.0;
% define image patch location (topleft [row col]) and size
patch_loc = [120 170];
patch_size = [100 100];
% extract left strip and display it
strip_left = left_gray(patch_loc(1):patch_loc(1)+patch_size(1)-1,:);
figure(1);
imshow(strip);
% extract right strip and display it
strip_right = right_gray(patch_loc(1):patch_loc(1)+patch_size(1)-1,:);
figure(2);
imshow(strip);
b = 100;
disparity = match_strips(strip_left, strip_right, b);
disp(disparity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment