cq.m
来自「这是一个关于信息隐藏的源代码,是用vc++开发」· M 代码 · 共 28 行
M
28 行
%CQ.m
function S=CQ(I,J)
% CQ(I,J) retruns the correlation quality between the images I and J.
% The CQ value is useful to quantitize the distortions on an image.
if (size(I)~=size(J))
error('Las imagenes deben tener el mismo tama駉')
end
if (~isrgb(I) & ~isrgb(J))
[m n] = size(I);
A=double(I);
B=double(J);
sumaI=0;
sumaProd=0;
for u=1:m
for v=1:n
sumaProd = sumaProd + A(u,v)*B(u,v);
sumaI=sumaI+A(u,v);
end
end
if (sumaI==0)
sumaI=0.0000000001;
end
S=sumaProd/sumaI;
else
error('Las imagenes no pueden ser en color')
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?