包括SDOCT图像的生成和降噪处理,提供了分层的算法
部分代码:
(1)图像重构
clear all;
load('C:\Users\18868\Documents\Tencent Files\2357918505\FileRecv\Lab1_SDOCT_LinearSpectrum\SDOCT_Raw_Spectrum_Linear.mat');Min = 1.9; Max =4.3; Span = Max - Min;IStr = zeros(pixel/2,line,Frame_NUM); % OCT Intensity signala1=SpecC5FrameLinear(:,:,1);
a2=SpecC5FrameLinear(:,:,2);
a3=SpecC5FrameLinear(:,:,3);
a4=SpecC5FrameLinear(:,:,4);
a5=SpecC5FrameLinear(:,:,5);
b=a1+a2+a3+a4+a5;%综合使用五帧图像的信息
f=ifft(b/5);
g=f([1:480],[1:720]);%截取合适区域
imshow(abs(g),'border','tight','initialmagnification','fit');
set (gcf,'Position',[0,0,720,480]); %初步重建的图像
>> whosName Size Bytes Class AttributesFrame_NUM 1x1 8 double IStr 1024x720x5 29491200 double Max 1x1 8 double Min 1x1 8 double Span 1x1 8 double SpecC5FrameLinear 2048x720x5 58982400 double
(2)降噪处理
I=imread('C:\Users\18868\Desktop\初步重建图像.jpg');
I2=rgb2gray(I);
g=imadjust(I2,[],[],0.4);%gamma变换
% imshow(g);
f=fft2(g);f=fftshift(f);f=abs(f);f=log(1+f);
[f1,f2]=freqspace(size(g),'meshgrid');%Butterworth低通滤波器
D=200/size(g,1);
r=f1.^2+f2.^2;
Hd=ones(size(g));
for i=1:size(g,1)for j=1:size(g,2)t=r(i,j)/(D*D);Hd(i,j)=exp(-t);end
end
Y=fft2(double(g));
Y=fftshift(Y);
Ya=Y.*Hd;
Ya=ifftshift(Ya);
Ia=real(ifft2(Ya));
figure;
D=imshow(uint8(Ia),'border','tight','initialmagnification','fit');
set (gcf,'Position',[0,0,720,480]);
% % imwrite(I3,'C:\Users\18868\Desktop\1.5.jpg')
% % a=50:4:250; %规定化函数
% % I4=histeq(I2,a);
% % imshow(I4)
% I5=edge(I3,'sobel',0.086);
% imshow(I5);
(3) 降噪算法-BM3D参考
http://demo.ipol.im/demo/l_bm3d/result?key=96AD1448CC4126F5B2AB06F2A355C60C
(4) 分层算法
主要更改的是图像的写入部分的程序,比较简单,故不记录
以下为例程链接:http://pangyuteng.github.io/caseral/