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 commentaires

KSSV
KSSV le 6 Juil 2022
What do you mean by removing here?
Aye Thein Maung
Aye Thein Maung le 6 Juil 2022
By removing i meant filtering out all other parts except the main image itself
Akira Agata
Akira Agata le 11 Juil 2022
How about using inpaintCoherent function?

Connectez-vous pour commenter.

 Réponse acceptée

Image Analyst
Image Analyst le 11 Juil 2022
I probably would have suggested regionfill
mask = grayImage == 255;
grayImage = regionfill(grayImage, mask);
but I like @Akira Agata's suggestion of inpaintCoherent better.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by