필터 지우기
필터 지우기

How do I understand the different commands in the code?

조회 수: 1 (최근 30일)
Vinay Chawla
Vinay Chawla 2020년 12월 29일
편집: Vinay Chawla 2020년 12월 29일
Hello,
I am very new to MATLAB and image processing and I am researching extracting dimensions (Length and Width) from images of cracks of pavements. I believe image segmentation is required to determine the length and width. I am working on a code that I found online and it uses image enhamcement before segmentation. I was wondering if someone can assist me understanding the code and the parameters which are being used in the code (see below). The image enhancement uses a low-pass filter, applies the filter for noise removal and deblurring. I tried to use the code for the data I have but it does not seem to work. I was wondering if the filter and other parameters used were specific to the data. Do I change the filter size? Do I use a different filter? How is the for loop applied working and what is it doing?
I would appreciate any and every help I can get.
Thank you,
% Image enhancment
% First) 9*9 low pass filter
[f1,f2]=freqspace(size(I),'meshgrid');
D=100/size(I,1);
LPF = ones(9);
r=f1.^2+f2.^2;
for i=1:9
for j=1:9
t=r(i,j)/(D*D);
LPF(i,j)=exp(-t);
end
end
% Second) applying filter
Y=fft2(double(I)); Y=fftshift(Y);
Y=convn(Y,LPF); Y=ifftshift(Y);
I_en=ifft2(Y);
% Third)
I_en=imresize(I_en,size(I));
I_en=uint8(I_en);
I_en=imsubtract(I,I_en);
I_en=imadd(I_en,uint8(mean2(I)*ones(size(I))));

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by