交叉熵图像分割matlab,灰度图像的二维交叉熵阈值分割法

[1]SAHOO P K,SOLTANIS,WONG A K C,et al.A survey of thresholding techniques[J].Computer Vision,Graphics and Image Processing,1988,41:233260.

[2]JIANG Haijun,LIU Wen,LIU Zhaohu.Segmentation algorithm for infrared dim small targets based on double window[J].Acta Photonica Sinica,2007,36(11):21682171.

蒋海军,刘文,刘朝晖.基于回形窗的弱小多目标图像分割方法[J].光子学报,2007,36(11):21682171.

[3]NI Chao,LI Qi,XIA Liangzheng.General hybridized PSO with chaos for fast infrared image segmentation method [J].Acta Photonica Sinica,2007,36(10):19541959.

倪超,李奇,夏良正.基于广义混沌混合PSO的快速红外图像分割算法[J].光子学报,2007,36(10):19541959.

[4]OTSU N,A thresholding selection method from graylevel histograms [J].IEEE Trans System Man Cybernetic,1979,9:6266.

[5]KITTLER J,ILLINGWORTH J.On threshold selection using clustering criteria[J].IEEE Trans.System Man Cybernetic,1985,15(5):652655.

[6]KURITA T,OTSU N,Abdelmalek N.Maximum likelihood thresholding based on population mixture models [J].Pattern Recognition,1992,25(11):12311240.

[7]LI C H,LEE C K.Minimum cross entropy thresholding[J].Pattern Recognition,1993,26(4):617625.

[8]FAN JiuLun.Notes on Poisson distributionbased minimum error thresholding[J].Pattern Recognition Letters,1998,19:425431.

[9]LIU Jianzhuang,LI Wenqing.The automatic thresholding of graylevel pictures via twodimensional Otsu methed[J].Acta Automatica Sinica,1993,19(1):101105.

刘健庄,粟文青.灰度图像的二维Otsu自动阈值分割法[J].自动化学报,1993,19(1):101105.

[10]GONG J,LI L Y,CHEN W N.Fast recursive algorithm for twodimensional thresholding[J].Pattern Recognition,1998,31(3):295300.

[11]TANG Yinggan,LIU Dong,GUAN Xinping.Fast image segmentation based on particle swarm optimization and twodimension Otsu method[J].Control and Decision,2007,22(2):202205.

唐英干,刘冬,关新平.基于粒子群和二维Otsu方法的快速图像分割[J].控制与决策,2007,22(2):202-205.

[12]FAN Jiulun,ZHAO Feng.Two –dimensional Otsu′s curve thresholding segmentation method for graylevel image[J].Acta Electronica Sinica,2007,35(4):751-755.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
图像的二维最大熵阈值分割是一种基于图像信息熵原理的图像分割,可以很好地处理图像中灰度分布不均匀的情况。MATLAB 中提供了一些函数可以方便地实现这种方。 以下是一个基本的二维最大熵阈值分割MATLAB 代码示例: ```matlab % 读取图像 img = imread('test.jpg'); % 计算图像的直方图 [counts, bins] = imhist(img); % 归一化直方图 counts = counts / sum(counts); % 初始化最大熵和最优阈值 max_entropy = 0; opt_threshold = 0; % 遍历阈值,计算每个阈值下的熵 for threshold = 1:255 % 计算两个类的概率和熵 p1 = sum(counts(1:threshold)); p2 = sum(counts(threshold+1:end)); if p1 == 0 || p2 == 0 continue; end entropy1 = -sum(counts(1:threshold) .* log2(counts(1:threshold))); entropy2 = -sum(counts(threshold+1:end) .* log2(counts(threshold+1:end))); % 计算总熵 total_entropy = entropy1 * p1 + entropy2 * p2; % 更新最大熵和最优阈值 if total_entropy > max_entropy max_entropy = total_entropy; opt_threshold = threshold; end end % 使用最优阈值进行图像分割 img_seg = imbinarize(img, opt_threshold/255); % 显示原始图像和分割结果 subplot(1, 2, 1); imshow(img); title('Original Image'); subplot(1, 2, 2); imshow(img_seg); title('Segmented Image'); ``` 在这个示例中,我们首先读取了一张测试图像,并使用 `imhist` 函数计算了它的直方图。然后,我们归一化了直方图,并初始化了最大熵和最优阈值。接着,我们遍历了所有可能的阈值,并计算了每个阈值下的熵。最后,我们选择了总熵最大的阈值作为最优阈值,并使用 `imbinarize` 函数进行图像分割。最后,我们将原始图像和分割结果显示在了同一张图像中。 需要注意的是,这个示例中的阈值是在灰度范围内从 1 到 255 遍历的,因此它只适用于灰度图像。如果你想对 RGB 彩色图像进行分割,需要先将其转换为灰度图像。此外,这个示例中的实现并不是最优的,你可能需要根据具体情况进行一些优化。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值