How to remove red from the image
古いコメントを表示
Hello,
I want to remove the red spots in the image not from the background. Please see the attached image. Please help!

1 件のコメント
DGM
2024 年 3 月 21 日
What exactly do you mean "remove the red spots in the image not from the background"?
Specifically, what do you mean "remove"? What should the red areas be replaced by?
By "in the image not from the background" do you mean to remove only disconnected red regions?
If you created this image, then you should be working with the mask that was used to create the red parts of the image to begin with. We shouldn't be wasting our time with a damaged JPG screenshot of random size. JPG should never be part of the image processing routine, and neither should screenshots.
採用された回答
その他の回答 (1 件)
Pratyush
2024 年 3 月 21 日
0 投票
Hi Divya,
To remove red spots from an image in MATLAB without affecting a red background, follow these steps:
- Load your image with "imread" and display it using "imshow".
- Convert the image from RGB to HSV color space using "rgb2hsv" for easier color segmentation.
- Define thresholds for hue, saturation, and value to isolate red areas. This step requires experimentation to differentiate spots from the background. Create a binary mask based on these thresholds.
- Use morphological operations like "bwareaopen" to remove noise and small objects from the mask. Further refine the mask as needed to accurately capture the red spots.
- Use the refined mask to alter or remove the red spots from the original image. This could involve setting the spots to a different color or blending them with their surroundings.
Adjust the parameters (e.g., thresholds, size for "bwareaopen") based on your specific image to accurately target and remove the red spots without affecting the red background.
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
