To remove unwanted parts in an image
3 views (last 30 days)
Show older comments
Aye Thein Maung
on 6 Jul 2022
Answered: Image Analyst
on 11 Jul 2022
I ran a code to remove to unwanted parts in an image but it does not fully remove the unwanted parts i want.

How do i remove the rest unwanted parts?
the code i ran -
%Filling holes
image_holes = imfill(image_bw,'holes');
%Removing unwated parts
P = sum(image_holes(:));
image_wanted=bwareaopen(image_holes,P/2);
%Image filtering
image_filter = uint8(double(image_original).*repmat(image_wanted,[1 1 3]));
imshowpair(image_original,image_filter,'montage');
3 Comments
Accepted Answer
Image Analyst
on 11 Jul 2022
mask = grayImage == 255;
grayImage = regionfill(grayImage, mask);
0 Comments
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!