In [1]:
import matplotlib.image as mpimg
import urllib2 as urllib
import io
fd = urllib.urlopen("http://mindey.com/wamh.jpg")
image_file = io.BytesIO(fd.read())
img=mpimg.imread(image_file, format='jpg')
In [2]:
imgplot = plt.imshow(img)
In [3]:
lum_img = img[:,:,0][::-1]
imgplot = plt.imshow(lum_img)
In [4]:
# Let's send it to R
ima = img[:,:,0].astype(numpy.float32)
%Rpush ima
In [5]:
# Let's use R to plot it :)
%R image(t(ima))
In [5]: