Region Filling Algorithm | MATLAB Code without using bwfill | Digital Image Processing

Publié le: 08 juillet 2020
sur la chaîne: Knowledge Amplifier
3,413
35

clc
clear all
close all
warning off
%%
%Take the Original Image
a=[ 0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 1 0 0
0 1 0 0 1 0 0
0 0 1 0 1 0 0
0 0 1 0 1 0 0
0 1 0 0 0 1 0
0 1 0 0 0 1 0
0 1 1 1 1 0 0
0 0 0 0 0 0 0];
imshow(a);
%%
%Defining the structuring element
b=[0 1 0;1 1 1;0 1 0];
%%
%Take the complement of the original Image
acmp=~(a);
%%
%Deside the strat point of hole and make that 1
x=[0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0];
%%
y=(imdilate(x,b) & acmp);
%%
while(~isequal(x,y))
x=y;
y=(imdilate(x,b) & acmp);

end
y=y | a;
subplot(1,2,1)
imshow(a);
title('Original Image');
subplot(1,2,2)
imshow(y);
title('Image after performing region filling operation');


Sur cette page du site, vous pouvez voir la vidéo en ligne Region Filling Algorithm | MATLAB Code without using bwfill | Digital Image Processing durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Knowledge Amplifier 08 juillet 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,413 fois et il a aimé 35 téléspectateurs. Bon visionnage!