In [1]:
from PIL import Image
from numpy import *
from pylab import *
import scipy.misc
from scipy import ndimage
import numpy as np

In [24]:
import stereo
stereo = reload(stereo)

In [33]:
# Images downloaded from http://stereo.nypl.org/view/91909, and cropped to left and right images

im_l = array(Image.open('NY_left.png').convert('L'), 'f')
im_r = array(Image.open('NY_right.png').convert('L'), 'f')

In [51]:
start = 10
steps = 80
wid = 21
res1 = stereo.plane_sweep_ncc(im_l, im_r, start, steps, wid)

In [70]:
start = 3
steps = 50
wid = 7
res2 = stereo.plane_sweep_gauss(im_l, im_r, start, steps, wid)

In [71]:
figure(figsize=(16, 16))
gray()
subplot(3, 2, 1)
imshow(Image.open('NY_left.png'))
axis('off')
subplot(3, 2, 2)
imshow(Image.open('NY_right.png'))
axis('off')
subplot(3, 2, 3)
imshow(res1)
axis('off')
subplot(3, 2, 4)
imshow(res2)
axis('off')
show()



In [ ]: