Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MI.m
Package: cx9.rar [view]
Upload User: xueli1969
Upload Date: 2022-07-27
Package Size: 19k
Code Size: 1k
Category:
Communication Document
Development Platform:
Matlab
- %Caculate MI of a and b in the region of the size(a)
- function mi = MI(a,b)
- %
- [M,N] = size(a);
- hab = zeros(256,256);
- ha = zeros(1,256);
- hb = zeros(1,256);
- if max(max(a))~=min(min(a))
- a = (a-min(min(a)))/(max(max(a))-min(min(a)));
- else
- a = zeros(M,N);
- end
- if max(max(b))-min(min(b))
- b = (b-min(min(b)))/(max(max(b))-min(min(b)));
- else
- b = zeros(M,N);
- end
- a = double(int16(a*255))+1;
- b = double(int16(b*255))+1;
- % a = int16(a)+1;
- % b = int16(b)+1;
- 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
- 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;