​基于互信息熵的图像配准方法matlab源码程序 - matlab图像处理 - 谷速源码
下载频道> 资源分类> matlab源码> 图像处理> ​基于互信息熵的图像配准方法matlab源码程序

标题:​基于互信息熵的图像配准方法matlab源码程序
分享到:

所属分类: 图像处理 资源类型:程序源码 文件大小: 71.82 KB 上传时间: 2019-06-16 21:55:51 下载次数: 67 资源积分:1分 提 供 者: zhangsan456 code
内容:
基于互信息熵的图像配准方法,其中包括图像配准的程序,还有程序运行的界面,对于初学图像配准或者利用MATLAB做GUI界面的同学有所帮助
%Caculate MI of a and b in the region of the size(a)
 
function [mi] = EMI(a,b)
%
[M,N] = size(a);
% change a, b to range 1:n
if min(a(:))<1
    a = a-min(a(:))+1;
end
if min(b(:))<1
    b = b-min(b(:))+1;
end
    
 
% ncolora = max(a(:))-min(a(:))+1;
% ncolorb = max(b(:))-min(b(:))+1;
ncolora = max(a(:));
ncolorb = max(b(:));
 
hab = zeros(ncolora,ncolorb);
ha = zeros(1,ncolora);
hb = zeros(1,ncolorb);
 
%count begins
[M,N]=size(a);
for i=1:M
    for j=1:N
       indexx =  a(i,j);
       indexy =  b(i,j);
 
       hab(indexx,indexy) = hab(indexx,indexy)+1;
       ha(indexx) = ha(indexx)+1;
       hb(indexy) = hb(indexy)+1;
 
   end
end
 
%cal ha,hb,hab
hsum = sum(sum(hab));
index = find(hab~=0);
p = hab/hsum;
Hab = sum(sum(-p(index).*log(p(index))));
 
hsum = sum(sum(ha));
index = find(ha~=0);
p = ha/hsum;
Ha = sum(sum(-p(index).*log(p(index))));
 
hsum = sum(sum(hb));
index = find(hb~=0);
p = hb/hsum;
Hb = sum(sum(-p(index).*log(p(index))));
 
mi = Ha+Hb-Hab;
% cal EMI
% feature efficiency coefficient
n =2/5;
if Hab ~= 0
    e = (mi^n) / ( Hab^(1-n));
else% not usual happen, just for test
    e = -1;%(mi^n) / ( Hab^(1-n)+1e-10);
end
mi = e;
% % 

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

关键词: 互信息熵 图像配准方法

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