In [1]:
from scipy import misc
from matplotlib import pyplot as plt
%matplotlib inline

In [ ]:


In [54]:
def rgb2gray(rgb):
	"""
	Convertir imagenes en escala de grises
	"""
	r, g, b = rgb[:,:,0], rgb[:,:,1], rgb[:,:,2]
	gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
	return gray
	
#vitral 05,07,09,24 # La 24 esta corrupta
# revue_des_peintres 05(img), 06(txt)
num = '05'
ruta_jpg = 'test/jpg/revue_des_peintres/rdp-int_000000%s.jpg' % num
print ruta_jpg
pagina = misc.imread(ruta_jpg, flatten=True).flatten()
#pagina = rgb2gray(pagina)
#pagina = (pagina - pagina.mean())/pagina.std()


test/jpg/revue_des_peintres/rdp-int_00000005.jpg

In [55]:
h = plt.hist(pagina.flatten(), bins=30, normed=True)


Otro intento


In [30]:
#07 10, 11, 12
plt.rcParams['figure.figsize'] = 10, 20
ruta_jpg = 'test/jpg/zuniga/zun-int_000000%d.jpg' % 10
pagina = misc.imread(ruta_jpg, flatten=False)
plt.imshow(pagina)


Out[30]:
<matplotlib.image.AxesImage at 0x13fbb0a50>

In [ ]: