Save pixel color value for indexed image (without image Processing Toolobx)
이전 댓글 표시
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개)
Sean de Wolski
2012년 2월 8일
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
Matteo Niccoli
2012년 2월 9일
Sean de Wolski
2012년 2월 9일
You missed a closing ')' on that line - just like the error message says.
Just copy and paste it.
Matteo Niccoli
2012년 3월 12일
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!