Save pixel color value for indexed image (without image Processing Toolobx)
Mostrar comentarios más antiguos
With reference to Steve Eddins blog post on pixel colors: http://blogs.mathworks.com/steve/2006/02/10/all-about-pixel-colors-part-3/
Suppose I create his same image: A = magic(5);
Then I display it with imagesc and colormap HSV: imagesc(A); colormap(hsv);
Is there any way now (without using Image processing Toolbox) to save to a matrix the R,G,B triplets corresponding to the colors of each pixel as produced using HSV?
Thanks, Matteo
1 comentario
Matteo Niccoli
el 8 de Feb. de 2012
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 8 de Feb. de 2012
Something like:
A = magic(5);
imagesc(A);
map = hsv;
colormap(map);
Av = A(:);
[~, bin] = histc(Av,linspace(min(Av),max(Av),min(numel(Av),size(map,1))));
mapp = permute(map,[1 3 2]);
rgb = reshape(mapp(bin,:,:),size(A,1),size(A,2),3);
maybe?
3 comentarios
Matteo Niccoli
el 9 de Feb. de 2012
Sean de Wolski
el 9 de Feb. de 2012
You missed a closing ')' on that line - just like the error message says.
Just copy and paste it.
Matteo Niccoli
el 12 de Mzo. de 2012
Categorías
Más información sobre White en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!