getting RGB from image created with imagesc
이전 댓글 표시
Hi. I am creating am image of a matrix using imagesc.
i want to get the RGB values of every pixel in the image.
I tried using get(im,'CData'), but it gives back the matrix that created the image.
how can do it?
thanks, Ariel
채택된 답변
추가 답변 (1개)
Image Analyst
2016년 3월 15일
imagesc() does not create images - it displays them. So you already have the image. If you want it pseudocolored, look up colormap in the help - there are a variety of predefined colormaps to choose from: hot, winter, jet, parula, etc. Pick one that you like and use ind2rgb to create a pseudocolored RGB image from your gray scale image.
% Use hsv color map to create an RGB image from a gray scale image:
rgbImage = ind2gray(grayImage, hsv(256));
댓글 수: 2
ariel
2016년 3월 16일
Image Analyst
2016년 3월 16일
Yes. If you want some certain amount, specify it. Like if you want 1000 colors, say jet(1000).
카테고리
도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
