How do i scan pixel from an rgb image and then if red value is higher than 200 show red only and if its lower = all 3 colors = 0
古いコメントを表示
採用された回答
その他の回答 (1 件)
Image Analyst
2021 年 5 月 22 日
Try this:
% Find where red value is more than 200.
mask = rgbImage(:, :, 1) > 200;
% Mask the image using bsxfun() function to multiply the mask by each channel individually.
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, 'like', rgbImage));
6 件のコメント
Moe Makki
2021 年 5 月 23 日
Moe Makki
2021 年 5 月 23 日
Image Analyst
2021 年 5 月 23 日
@Moe Makki, Yes, but why would you want to do it that less efficient way? The best answer is the two line snippet I gave you.
Moe Makki
2021 年 5 月 24 日
Image Analyst
2021 年 5 月 24 日
編集済み: Image Analyst
2021 年 5 月 24 日
In the future, please "Tag" the post as homework if it's homework (I've done it for you now). That tells us not to post full working code, that, if you turn in as your own, may get you into trouble for plagiarism. We wouldn't want you to get into trouble.
Moe Makki
2021 年 5 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Blue についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



