分享更有价值
被信任是一种快乐

matlab怎么实现图像的自适应多阈值快速分割

文章页正文上

今天小编给大家分享一下matlab怎么实现图像的自适应多阈值快速分割免费云主机、域名的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。为快速准确地将图像中目标和背景分离开来,将新型群体智能模型中的花朵授粉算法、最大类间阈值相结合,提出了一种图像分割新方法.该方法将图像阈值看成花朵授粉算法群算法中的花粉,利用信息熵和最大熵原理设计花朵授粉算法的适应度函数,逐代逼近最佳阈值.并利用Matlab实现了图像分割算法,对分割的结果进行分析.实验结果表明,该方法在阈值分割图像时,花朵授粉算法能够快速准确地将图像目标分离出来,分离出来的目标更加适合后序的分析和处理.% ——————————————————————–%% Flower pollenation algorithm (FPA), or flower algorithm %% Programmed by Xin-She Yang @ May 2012 %% ——————————————————————–%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Notes: This demo program contains the very basic components of %% the flower pollination algorithm (FPA), or flower algorithm (FA), %% for single objective optimization. It usually works well for %% unconstrained functions only. For functions/problems with %% limits/bounds and constraints, constraint-handling techniques %% should be implemented to deal with constrained problems properly. %% %% Citation details: %%1)Xin-She Yang, Flower pollination algorithm for global optimization,%% Unconventional Computation and Natural Computation, %% Lecture Notes in Computer Science, Vol. 7445, pp. 240-249 (2012). %%2)X. S. Yang, M. Karamanoglu, X. S. He, Multi-objective flower %% algorithm for optimization, Procedia in Computer Science, %% vol. 18, pp. 861-868 (2013). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%clcclear allclose alln=30; % Population size, typically 10 to 25p=0.8; % probabibility switch% Iteration parametersN_iter=3000; % Total number of iterationsfitnessMSE = ones(1,N_iter);% % Dimension of the search variables Example 1d=2;Lb = -1*ones(1,d);Ub = 1*ones(1,d);% % Dimension of the search variables Example 2% d=3;% Lb = [-2 -1 -1];% Ub = [2 1 1];%% % Dimension of the search variables Example 3% d=3;% Lb = [-1 -1 -1];% Ub = [1 1 1];%%% % % Dimension of the search variables Example 4% d=9;% Lb = -1.5*ones(1,d);% Ub = 1.5*ones(1,d);% Initialize the population/solutionsfor i=1:n, Sol(i,:)=Lb+(Ub-Lb).*rand(1,d); % To simulate the filters use fitnessX() functions in the next line Fitness(i)=fitness(Sol(i,:));end% Find the current best[fmin,I]=min(Fitness);best=Sol(I,:);S=Sol;% Start the iterations — Flower Algorithmfor t=1:N_iter, % Loop over all bats/solutions for i=1:n, % Pollens are carried by insects and thus can move in % large scale, large distance. % This L should replace by Levy flights % Formula: x_i^{t+1}=x_i^t+ L (x_i^t-gbest) if rand>p, %% L=rand; L=Levy(d); dS=L.*(Sol(i,:)-best); S(i,:)=Sol(i,:)+dS; % Check if the simple limits/bounds are OK S(i,:)=simplebounds(S(i,:),Lb,Ub); % If not, then local pollenation of neighbor flowers else epsilon=rand; % Find random flowers in the neighbourhood JK=randperm(n); % As they are random, the first two entries also random % If the flower are the same or similar species, then % they can be pollenated, otherwise, no action. % Formula: x_i^{t+1}+epsilon*(x_j^t-x_k^t) S(i,:)=S(i,:)+epsilon*(Sol(JK(1),:)-Sol(JK(2),:)); % Check if the simple limits/bounds are OK S(i,:)=simplebounds(S(i,:),Lb,Ub); end % Evaluate new solutions % To simulate the filters use fitnessX() functions in the next % line Fnew=fitness(S(i,:)); % If fitness improves (better solutions found), update then if (Fnew
Sol(i,:)=S(i,:); Fitness(i)=Fnew; end % Update the current global best if Fnew
best=S(i,:) ; fmin=Fnew ; end end % Display results every 100 iterations if round(t/100)==t/100, best fmin end fitnessMSE(t) = fmin;end%figure, plot(1:N_iter,fitnessMSE);% Output/displaydisp([‘Total number of eval(N_iter*n)]);disp([‘Best solution=’,num2str(best),’ fmin=’,num2str(fmin)]);figure(1)plot( fitnessMSE)xlabel(‘Iteration’);ylabel(‘Best score obtained so far’);以上就是“matlab怎么实现图像的自适应多阈值快速分割”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注云技术行业资讯频道。

相关推荐: 怎么用Python模拟死锁

这篇“怎么用Python模拟死锁”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“怎么用Python模拟死锁”文章吧。一个例子是在银行账户上:假如要…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

登录

找回密码

注册