平滑图中曲线,并计算图中每个同心圆的直径(毫米做单位)。
这是等倾干涉环细化后的图像。
我用的图像

我目前的代码
0%-----------------------第一部分(读取)---------------------------------
%读取图片
A1=imread('51um.jpg');
%真彩转灰度
A2=rgb2gray(A1);
figure,imshow(A2),title('result');
%-----------------------第二部分(增强)---------------------------------
%直方图均衡化
B1=adapthisteq(A2);
figure,imshow(B1),title('result');
%-----------------------第三部分(降噪)---------------------------------
%均值滤波
C1= filter2(fspecial('average',7),B1)/255;%-
C2 = medfilt2(C1);
%中值滤波部分
C3=medfilt2(C2,[7,7]); %--
%低通滤波
[f1,f2] = freqspace(size(C3),'meshgrid'); %生成频率序列矩阵
Hd = ones(size(C3));
r = sqrt(f1.^2 + f2.^2);
Hd(r>0.5) = 0; %构造滤波器
Y=fft2(double(C3));
Y=fftshift(Y);
Ya=Y.*Hd; %滤波
Ya=ifftshift(Ya);
C4=ifft2(Ya);
figure,imshow(C4),title('result');
%最大类间方差法分割图像
level=graythresh(C4);
E1=imbinarize(C4,level);
disp(strcat('graythresh 计算灰度阈值1:',num2str(uint8(level*255))));
figure,imshow(E1),title('result');
%闭运算
se2=strel('disk',7);
F1=imclose(E1,se2);
%细化
F2=zs(F1);
figure,imshow(F2),title('result');
F3=bwmorph(F2,'spur',Inf);
F4=bwmorph(F3,'bridge');
figure,imshow(F4),title('result');
