Am I understanding this correctly?

조회 수: 1 (최근 30일)
Andrew Killian 2021년 9월 13일
편집: John D'Errico 2021년 9월 13일
If I start with a color picture and do the below. It separates the original color image into the three red, blue and green matrices with each matrix being a grayscale matrix. When I imshow the red one, if the pixel value is high on it (white) and low for the other two on the exact same pixel then that pixel in the original color image is red right?
r = color(:, :, 1);
g = color(:, :, 2);
b = color(:, :, 3);

댓글을 달려면 로그인하십시오.

답변 (2개)

Matt J 2021년 9월 13일
If by "low" you mean zero and by "high" you mean 255, then yes.
댓글 수: 0이전 댓글 -2개 표시이전 댓글 -2개 숨기기

댓글을 달려면 로그인하십시오.

John D'Errico 2021년 9월 13일
편집: John D'Errico 2021년 9월 13일
Yes. Colors that you would describe as red all have high values in the red channel, and small values in the green and blue channels. But those values need not all be strictly [255 0 0]. (Or [1 0 0], depending on the scaling you use.)
For example, using a [0,1] normalization...
img(:,:,1) = 1 - .2*rand(100,100);
img(:,:,2) = .2*rand(100,100);
img(:,:,3) = .2*rand(100,100);
imshow(img)
You might reasonably call that entire image red, just various shades thereof. And the limits of what you might call red are probably subtly different for you than for me. The boundary of the set you would describe as red is indeed in that corner of the RGB color space though.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by