图像信息熵matlab代码
来源:互联网 发布:mmd虎视眈眈镜头数据 编辑:程序博客网 时间:2024/06/05 10:12
function [entr,ind] = entrCompute(InImg,groupNum)% Output the entropy of InImg % ========= INPUT ============% InImg size: cell(numImg * 1); each cell: m * n% groupNum the number of images in each group % ========= OUTPUT ===========% entr entropies of all images% ind the sort of all entropiesentr = cell(numel(InImg)/groupNum,1); %每groupNum个一组记录entropyfor id = 1 : numel(entr) for jd = 1 : groupNum entr{id}(jd) = Imentropy(InImg{(id - 1) * groupNum + jd}); end end%对信息熵进行排序trash = cell(numel(entr),1);ind = cell(numel(entr),1); for id = 1 : numel(entr) [trash{id} ind{id}] = sort(entr{id},'descend');endend
function entr = Imentropy(im) I = roundn(im,-1) ; %取小数点后n位 [C,R] = size(I); %求图像的规格 Img_size = C * R; %图像像素点的总个数 P_N = unique(I); L = length(P_N); H_img = 0; nk = zeros(L,1); for i = 1 : C for j = 1 : R for k = 1 : L temp = P_N(k,1); if I(i,j) == temp nk(k,1) = nk(k,1) + 1; end end end end for k = 1 : L Ps(k) = nk(k)/Img_size; %计算每一个灰度级像素点所占的概率 if Ps(k)~=0; %去掉概率为0的像素点 H_img = -Ps(k)*log2(Ps(k))+H_img; %求熵值的公式 end end entr = H_img; end
0 0
- 图像信息熵matlab代码
- Matlab显示图像三维信息
- 图像信息熵计算的OpenCV代码
- 部分matlab处理图像代码
- 图像细化matlab代码实现
- 部分matlab处理图像代码
- matlab代码-图像上画框
- matlab图像预处理代码综合
- 图像的Mallat算法分解(Matlab代码)
- matlab进行图像融合代码示例
- 【转】图像复原的matlab代码
- 基于PCNN的图像增强matlab代码
- 图像的结构张量MATLAB代码
- 用一行matlab代码实现图像翻转
- Matlab 图像压缩编码—代码内容
- 图像分割指标及Matlab代码实现
- Matlab代码实现图像的傅里叶变换
- 图像信息熵
- hdu4979 A simple math problem.Dancing Links,打表
- AC自动机 病毒侵袭 hdu2896
- 正则表达式
- linux文件操作总结
- 家纺网数据表分析
- 图像信息熵matlab代码
- Codeforces 258B. Little Elephant and Elections【数位DP,DFS】
- 前端交互效果注意
- HDU 1541 Stars (线段树)
- 【XML】DOM4J解析xml(CURD)
- C++构造函数语意学--编译器在哪些情况合成default constructot
- Apche日志系列(2):错误日志
- android handler机制
- mmap函数介绍与使用