binary image to RGB image
4 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I would like to know how to convert binary image to RGB. Let say, I want WHITE become RED and BLACK become GREEN. Anyone can help me please...really need any suggestion.
Thank you
0 件のコメント
採用された回答
Walter Roberson
2011 年 8 月 5 日
RGBIMG = cat(3, IMG, ~IMG, zeros(size(IMG)));
3 件のコメント
Srivatsan N
2020 年 7 月 20 日
I am getting error when I try to display that image using imshow function.Can anyone help me out with this?.
Image Analyst
2020 年 7 月 20 日
Sure, just tell us what the error is
mask = false(480, 640);
mask(100:200, 150:450) = true;
subplot(2, 1, 1);
imshow(mask);
rgbImage = cat(3, mask, ~mask, zeros(size(mask)));
subplot(2, 1, 2);
imshow(rgbImage);

その他の回答 (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!