How to remove G from RGB image
20 ビュー (過去 30 日間)
古いコメントを表示
How would you remove G from an RGB image?
2 件のコメント
Image Analyst
2013 年 10 月 5 日
What does this mean? Do you want to set the entire green channel to zero, like Walter did? Do you want to set green looking objects in the image to black? Do you want to go from a 3D color array with 3 color channels to a 3D array with only two color channels? Do you want to extract (segment) the green objects in the image and place them in a new, separate image? Please explain what you want to do so we can remove the uncertainty in your question.
採用された回答
Feynman
2013 年 10 月 5 日
2 件のコメント
dk
2013 年 10 月 5 日
when you remove all green by setting the green layer to 0, the image will look purple-ish as red + blue is roughly purple.
Image Analyst
2013 年 10 月 5 日
This is what Walter correctly guessed that you meant. His code does that - did you try it yet? Please try it and then mark his answer "Accepted".
You can't display anything except a one color channel image or a three color channel image. If you want anything else (2 colors, 4, 5, 6, etc. hyperspectral image), then you're going to have to figure out some way to get it into a 3 channel true color image. So I doubt he meant to remove the second color channel and almost certainly meant to just set it to 0, which is what Walter's code does.
その他の回答 (1 件)
Walter Roberson
2013 年 10 月 5 日
YourImage = imread('TheImage.jpg');
YourImage(:,:,2) = 0;
image(YourImage);
imwrite(YourImage, 'TheNewImage.jpg');
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!