✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
涉及图像处理与优化领域,尤其涉及一种基于模糊熵的差分进化算法对乳腺图像进行分割的方法.首先,结合图像的模糊熵,设置图像分割的参数和评价函数,以最大模糊熵作为评估的函数.其次,采用差分进化算法将图像模糊熵的参数作为初始化种群个体,经过变异,交叉和选择三个进化过程对图像模糊熵进行优化,根据最大模糊熵准则,确定分割图像的最优阈值.
⛄ 部分代码
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is a demo file
% I is the input image
% NThresholds: The number of thresholds required. It lies between
% 1 and (the difference between the maximum and minimum
% graylevel present in the image)
% This code is for thresholding of gray-scale images of 8-bit depth.
% Color images can also be inputted to this code. But it will be converted
% to gray-scale image by the code before starting the thresholding algorithm
close all
I = imread('55067.jpg');
NThresholds = 3;
if size(I,3)==3
I=rgb2gray(I);
end
for i=1:size(I,3)
cI(:,:,i) = thresholdImage(I(:,:,i),NThresholds);
end
figure,subplot(1,2,1),imshow(I),title('Original Image');
subplot(1,2,2),imshow(cI),title(strcat('Thresholded Image (',num2str(NThresholds),' Thresholds)'));
⛄ 运行结果
⛄ 参考文献
[1]柳培忠, 范宇凌, 唐加能,等. 基于模糊熵的差分进化算法对乳腺图像进行分割的方法:, CN109146864A[P]. 2019.
[2]杨兆龙, 刘秉瀚. 基于改进差分进化算法的多阈值图像分割[J]. 计算机系统应用, 2016(12):5.