salut a vous tous!!!
comment faire lorsque l'on a une suite de pixel "type float" pour les mettre sous forme de matrice afin de pouvoir crée l'image?
j'ai crée un code permettant de transformer rgbtohsv et je n'ai besoin que de h.
mon code fonctionne mais je ne sais pas comment convertir mes float sous forme de matrice!!!
Code "python" : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import numpy import Image import colorsys as c image3=Image.open("/root/c.bmp") ri,gi,bi=image3.split() r=numpy.asarray(ri) g=numpy.asarray(gi) b=numpy.asarray(bi) for i in range(0,r.shape[0]): for j in range(0,r.shape[1]): #print i,j r0=r[i,j] g0=g[i,j] b0=b[i,j] #print r0,g0,b0 h,s,v=c.rgb_to_hsv(float(r0),float(g0),float(b0)) #print h #trash=raw_input("jhj")
Partager