局部高斯分布拟合能量模型利用局部图像灰度均值和方差信息构造能量泛函,能量泛函由局部图像轮廓内外的高斯分布拟合项和正则项构成,拟合项驱使演化曲线向目标轮廓演化,正则项保持演化曲线的光滑度和避免重新初始化水平集函数。局部高斯分布拟合能量模型的水平集能量泛函由驱使演化曲线向目标轮廓演化的局部高斯分布拟合项和保证曲线的光滑性及避免重新初始化水平集函数的正则项构成,该模型同时利用图像灰度的局部均值和方差信息,能够分割相对复杂的图像。
本例为MATLAB环境下基于局部高斯分布拟合能量的图像分割方法,算法运行环境为MATLAB R2018,压缩包=数据+代码+参考文献,部分代码如下:
clc;clear all;close all;
Img=imread('1.bmp');
Img = double(Img(:,:,1));
NumIter = 300; %iterations
timestep=0.1; %time step
mu=0.1/timestep;% level set regularization term, please refer to "Chunming Li and et al. Level Set Evolution Without Re-initialization: A New Variational Formulation, CVPR 2005"
sigma = 3;%size of kernel
epsilon = 1;
c0 = 2; % the constant value
lambda1=1.0;%outer weight, please refer to "Chunming Li and et al, Minimization of Region-Scalable Fitting Energy for Image Segmentation, IEEE Trans. Image Processing, vol. 17 (10), pp. 1940-1949, 2008"
lambda2=1.0;%inner weight
%if lambda1>lambda2; tend to inflate
%if lambda1<lambda2; tend to deflate
nu = 0.001*255*255;%length term
alf = 30;%data term weight
figure,imagesc(uint8(Img),[0 255]),colormap(gray),axis off;axis equal
[Height Wide] = size(Img);
[xx yy] = meshgrid(1:Wide,1:Height);
phi = (sqrt(((xx - 65).^2 + (yy - 40).^2 )) - 20);
phi = sign(phi).*c0;
Ksigma=fspecial('gaussian',round(2*sigma)*2 + 1,sigma); % kernel
ONE=ones(size(Img));
KONE = imfilter(ONE,Ksigma,'replicate');
KI = imfilter(Img,Ksigma,'replicate');
KI2 = imfilter(Img.^2,Ksigma,'replicate');
figure,imagesc(uint8(Img),[0 255]),colormap(gray),axis off;axis equal,
hold on,[c,h] = contour(phi,[0 0],'r','linewidth',1); hold off
pause(0.5)
tic
for iter = 1:NumIter
phi =elcd(Img,phi,epsilon,Ksigma,KONE,KI,KI2,mu,nu,lambda1,lambda2,timestep,alf);
if(mod(iter,25) == 0)
figure(2),
imagesc(uint8(Img),[0 255]),colormap(gray),axis off;axis equal,title(num2str(iter))
hold on,[c,h] = contour(phi,[0 0],'r','linewidth',1); hold off
pause(0.02);
end
end
toc
部分出图如下:
工学博士,担任《Mechanical System and Signal Processing》审稿专家,担任
《中国电机工程学报》优秀审稿专家,《控制与决策》,《系统工程与电子技术》,《电力系统保护与控制》,《宇航学报》等EI期刊审稿专家。
擅长领域:现代信号处理,机器学习,深度学习,数字孪生,时间序列分析,设备缺陷检测、设备异常检测、设备智能故障诊断与健康管理PHM等。