image - Python - rgb2gray not working on my photo -


it's bit complicated, i'll try explain.

i have photo on computer, photo of face. want read image matrix x, operations won't go detail it's rather complex, in end should x=as

here code

import numpy np import skimage.io io skimage import color import sklearn.decomposition dc x=color.rgb2gray(io.imread('/home/oria/desktop/1.ppm')) ica=dc.fastica()   s=ica.fit(np.matrix.transpose(x)) a=ica.mixing_  b=np.linalg.pinv(a) s=np.dot(b,x)  y=np.dot(a,s) 

the expected end result, y approximately equal x. not case, , think reason why isn't case x in graylevel image (this io.imshow(x))

enter image description here

while y not (io.imshow(y)):

enter image description here

you can see same person, same picture, good,but colors distorted. thought maybe if transfer y graylevel, x=y.

but whenever io.imshow(color.rgb2gray(y)), nothing changes. , check myself further, y-color.rgb2gray(y) indeed 0 matrix. it's if rgb2gray didn't anything.

why isn't working?


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -