how to fill crack in Image

2 vues (au cours des 30 derniers jours)
nkumar
nkumar le 18 Mar 2013
I want to dill the crack in the image using filtering concept tried by following code,but could not fill it,kindly help
clc
clear all
close all
gauss = fspecial ('gaussian' , [ 5 5 ] ) ; % Ga u s s i a n Blur F i l t e r
I=double(imread('crack1.png'))./255 ;a=I;
I1= imfilter(I,gauss ) ;
s=strel('square',3);
h=imsubtract(imclose(a,s),a);
IMG=double(imresize(h,[256 256]));
imshow(h),figure,imshow(a)
level = graythresh(IMG);
BW = im2bw(IMG,level);
imshow(BW)
figure,imshow(BW)
SE = [strel('line' , 3 , 0)
strel('line',3,45)
strel('line',3,90)
strel('line',3,135)] ;
ERED = BW-imerode ( BW ,s ) ;
figure,imshow(ERED)
BW2 = bwareaopen(ERED,100);
figure,imshow(BW2)

Réponses (0)

Catégories

En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by