Matlab实现的多种基于阈值的图像分割方法,含有大津法,最大熵,聚类等方法- - matlab图像处理 - 谷速源码
下载频道> 资源分类> matlab源码> 图像处理> Matlab实现的多种基于阈值的图像分割方法,含有大津法,最大熵,聚类等方法-

标题:Matlab实现的多种基于阈值的图像分割方法,含有大津法,最大熵,聚类等方法-
分享到:

所属分类: 图像处理 资源类型:程序源码 文件大小: 11.69 KB 上传时间: 2019-06-16 15:23:32 下载次数: 469 资源积分:1分 提 供 者: zhangsan456 imagethreshold
内容:
用Matlab实现的多种基于阈值的图像分割方法,含有大津法,最大熵,聚类等方法-
function [K] = otsu(im) 
 
% OTSU thresholds gray-scale image using Otsu's method. 
% input is image IM, and output is the threshold value.
% Programmed By Yingzi (Eliza) Du on 03/08/2004
 
im = uint8(im); %Change it back to uint8 
h = imhist(im)';%Get the histogram of the image
h = h/sum(h); %normalize the histogram
im = double(im);
mn = min(min(im))+1;
mx = max(max(im))+1;
j = 0:255;
ut=sum(h.*j);
dett=sum(h.*((j-ut).^2));
w0 = 0;
mxvalue = 0;
for i=mn:mx-1
   j=0:i-1;
   w0 = w0 + h(i);
   w1 = 1 - w0;
   u0 = sum(h(j+1).*j)/w0;
   u1=(ut-w0.*u0)/w1;
   detb=w0.*w1.*((u0-u1).^2);
   n = detb/dett;
   if (n > mxvalue)
      mxvalue = n;
      K=i-1;
  end;
end;

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

关键词: 大津法 最大熵 聚类 图像分割

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved