Save pixel color value for indexed image (without image Processing Toolobx)
Afficher commentaires plus anciens
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 commentaire
Matteo Niccoli
le 8 Fév 2012
Réponse acceptée
Plus de réponses (1)
Sean de Wolski
le 8 Fév 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 commentaires
Matteo Niccoli
le 9 Fév 2012
Sean de Wolski
le 9 Fév 2012
You missed a closing ')' on that line - just like the error message says.
Just copy and paste it.
Matteo Niccoli
le 12 Mar 2012
Catégories
En savoir plus sur White dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!