How to remove unwanted object from an image?

4 次查看(过去 30 天)
In my attached image, I want to remove all the black dots on the right side of the image. I want to keep the object on the left side (long filament object.) How could I do without changing the threshold value? Changing threshold values I am actually loosing some pixel from the long object. Please help, I am new in Image analysis.
Thank you

采纳的回答

Image Analyst
Image Analyst 2022-1-30
Assuming you have a binary image
mask = bwareafilt(~mask, 1); % Take largest blob only.
  6 个评论
Animesh Biswas
Animesh Biswas 2022-3-22
Yes all the images are same. The object and and the boudary have same color (black in this case). According to you, I can mask only the boarder to make it white right? Could you please help how to mask diffeent parts of the image with different colors? Thanks
Image Analyst
Image Analyst 2022-3-22
To whiten:
backgroundMask = imread('mask.png') > 128;
grayImage(backgroundMask) = 255; % Whiten

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by