How to separate the color components of the color image

I want to Separate the color components of the color image (kids.tif) and print as red, green and blue components individually.

답변 (1개)

Dishant Arora
Dishant Arora 2014년 2월 17일
[I map]=imread('kids.tif');
RGB = ind2rgb(I, map);
R = RGB(:,:,1);
G = RGB(:,:,2);
B = RGB(:,:,3);

댓글 수: 2

I did not get any result from these code.
Are you saying that you ran the code and MATLAB did not create any variables at all? You did not get results in the variables I, map, RGB, R, G, B? Try it this way:
workspace
clear all;
[I map]=imread('kids.tif');
RGB = ind2rgb(I, map);
R = RGB(:,:,1);
G = RGB(:,:,2);
B = RGB(:,:,3);
Now, look at the workspace panel. Are any variables at all listed there? There should be.
Next, define what you mean as print. Do you mean to print numerical values, like 1, 43, 79, etc. Or do you mean that you want the image itself printed as an image?

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

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

질문:

2014년 2월 17일

댓글:

2014년 2월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by