There is a problem with the filter selection
1 次查看(过去 30 天)
显示 更早的评论
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/995705/image.png)
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
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!