仿真程序
clear all; close all; clc
P=32;Q=32;lp=0.5;
A=double(imread('lena.bmp'));
inImg = double(A)./max(A(:));
%% 测试图像截取
Img=imresize(inImg,P,Q,'bilinear');
Img = Img./max(Img(:));
H = hadamard(P*Q);
H32 = H;
Ib = 0; Ir = zeros(P,Q);
Iccd_p = zeros(P,Q);Iccd_n = Iccd_p;
for i = 1:(P)*(Q)
pBas = reshape(H32(i,:),P,Q);
Ib=sum(sum(Img.*pBas)) +0.*rand(1);
Iccd_n = Ib.*pBas;
% Ir = Ir +pBas;
Iccd_p = Iccd_n +Iccd_p;
imagesc(Iccd_p);colormap('gray');
pause(0.01);
end