How to separate the color components of the color image
2 次查看(过去 30 天)
显示 更早的评论
I want to Separate the color components of the color image (kids.tif) and print as red, green and blue components individually.
0 个评论
回答(1 个)
Dishant Arora
2014-2-17
[I map]=imread('kids.tif');
RGB = ind2rgb(I, map);
R = RGB(:,:,1);
G = RGB(:,:,2);
B = RGB(:,:,3);
2 个评论
Image Analyst
2014-2-17
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?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!