필터 지우기
필터 지우기

Need help in analyzing image planes

조회 수: 1 (최근 30일)
MKN
MKN 2015년 3월 11일
댓글: MKN 2015년 3월 11일
% CODE 1
% Read RGB image
x = imread('Lena.jpg');
rPlane = x(:,:,1);
imshow(rPlane) % Displays Red Plane in Lena.jpg image
%%%%%
% CODE 2
y = imread('Lena.jpg');
y(:,:,2) = 0;
y(:,:,3) = 0;
imshow(y);
% I need to know about this displayed
% image 'y' with 'G' and 'B' planes all zeros

채택된 답변

Image Analyst
Image Analyst 2015년 3월 11일
They both look "right" - what's the problem? They are different in that code 1 extracts the red channel as a monochrome image and it will display as grayscale (unless you applied a colormap), whereas code 2 leaves the image as RGB. Code 2 just zeros out the green and blue so the image will show the red channel as a red hue. What do you want to do? Neither is right or wrong it just depends on what you want to do with the different color channels.
  댓글 수: 1
MKN
MKN 2015년 3월 11일
I wanted to know why the 'red' color appears in CODE2. I have better clarity now. Thanks IA.

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

추가 답변 (0개)

카테고리

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