There is a problem with the filter selection

1 vue (au cours des 30 derniers jours)
文辉 沈
文辉 沈 le 12 Mai 2022
Modifié(e) : 文辉 沈 le 12 Mai 2022
close all;
clear;
clc;
I1 = imread('test2.jpg');
figure;imshow(I1);
adimage = imadjust(I1,stretchlim(I1));
I2 = im2gray(adimage);
ml=mean2(I2);
G = fspecial('gaussian',[9,9],1);
GS = imfilter(I2,G);
I3=I2-GS+ml;
figure;imshow(I3);
sh = graythresh(I3);
bw = im2bw(I3,sh);
bw=~bw;
figure;imshow(bw);
BW_dilate = imdilate(bw,strel('disk',1));
BW_connect = bwmorph(BW_dilate,'bridge',inf);
figure;imshow(BW_connect);
My goal is to extract cracks, and in the process, the choice of filter causes differences in the results.
The article I referenced mentions the following formula:
Therefore, I follow his process (because I also use the data set)
I provide a picture ,text2.jpg
I3=I2-GS+ml;
figure;imshow(I3);
I found that when I use only Gaussian filter(That is, delete the above two lines of code), he works better than the nonlinear filter mentioned in the article, it makes me wonder,can anyone help me...
Since this article has been published in a journal, I have no reason to suspect that the formula he gave is wrong.
Is there something wrong with the picture I'm using?
I will upload a few more pictures for testing

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by