From: uny gg on 4 Jan 2010 21:03 Hello all, I have followed the eigenface logici into my images. In order to see the eigenfaces as images, I have used "imagesc". Here is the code I referred. http://www.cs.ait.ac.th/~mdailey/matlab/#refs My question is this. It is simple to display an eigenface as an image, using the built in imagesc function, which first scales the values in an array to the 0-255 range. >> pc_ev_1 = Vecs(:,1); % Get PC eigenvector 1 >> pc_ev_1 = reshape(pc_ev_1,w,h)'; % Reshape into 2D array >> imagesc(pc_ev_1); % Display as image scaled 0-255 I have used same code to see the EigenFace as an image. Even though all my image background is totally black, when I see the EigenFace as image, the background color is very various. Some eigenFace background is yellow, orange, black, blue... etc... I am not sure why the background color is so various. Is there any way to have plain black background????? Except background, EigenFace image looks okay. Do I miss somethihng? Could you please help me?
From: nanren888 on 4 Jan 2010 22:47 "uny gg" <illinois.ks(a)gmail.com> wrote in message <hhu6km$4cv$1(a)fred.mathworks.com>... > Hello all, > > I have followed the eigenface logici into my images. > In order to see the eigenfaces as images, I have used "imagesc". > > Here is the code I referred. > http://www.cs.ait.ac.th/~mdailey/matlab/#refs > > My question is this. > > It is simple to display an eigenface as an image, using the built in imagesc function, which first scales the values in an array to the 0-255 range. > >> pc_ev_1 = Vecs(:,1); % Get PC eigenvector 1 > >> pc_ev_1 = reshape(pc_ev_1,w,h)'; % Reshape into 2D array > >> imagesc(pc_ev_1); % Display as image scaled 0-255 > > > I have used same code to see the EigenFace as an image. > Even though all my image background is totally black, when I see the EigenFace as image, the background color is very various. Some eigenFace background is yellow, orange, black, blue... etc... I am not sure why the background color is so various. Is there any way to have plain black background????? > > Except background, EigenFace image looks okay. > Do I miss somethihng? > > Could you please help me? uny gg, Have you tried looking at the values you are getting for backgrounds, eg plot as mesh or such? I don't do images, but at a guess, if you are just taking the images as a vector of pixels, then the "background" is a concept of yours that does not really have meaning in the images, that is, each image has a different area that is considered "background": some "background" pixels locations have values in some images. So if the eigenvectors are just the maximum variance vectors, then they are at any orientation they like, giving random "background" values. I may be completely wrong. Basically you have issues with the colourmap ("colormap" in Matlab). You can scale values, eg shift down & rescale data or do equivalent things to the map. I suspect there is no "even quicker" answer. You need to work out which levels you don't want displayed & craft the scaling to show the rest. As I say I don't do images, but it is possible that there will now be values below "background" that may not be insignificant. Any help?
From: uny gg on 5 Jan 2010 11:41 Hello, nanren888 Thank you for your comments. It helps a lot!! ;) I found that the background value is very small almost zero. However, other part values is also very small... a little larger than background color. So the color bar range was from 0.01 to -0.025. So, red color have 0.01 value. blue color has 0.025 value. Thus, 0 background color has orange color. this is the reason... I have bright background color........ I may need to play with this more.. to have black background.. Anyhow, thanks a lot for your help.
|
Pages: 1 Prev: activating TeX text interpreter in uicontrol is not possible? Next: About Function Handle |