Last active
August 29, 2015 14:06
-
-
Save davidbrough1/65fbce77bef5501fb85e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
The code takes the url of an image and converts it into a numpy array. | |
''' | |
import matplotlib.pylab as plt | |
import numpy as np | |
import cStringIO | |
import Image | |
import urllib | |
file = cStringIO.StringIO(urllib.urlopen(url_sim_data).read()) | |
url_sim_data = 'https://farm4.staticflickr.com/<the_rest_of_the_url>.jpg' | |
img = Image.open(file) | |
data = np.asarray(img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment