图像稀疏表示

图像稀疏表示的源代码:
function basis_fun_dct
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%observe the base functions of each transform
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
N=64;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% one dimension
x=1:N;
C=zeros(N/15,N);
figure(1)
for u=1:N/15
C(u,:)=cos((2x-1)(u-1)pi/(2N)); % computer bases

hold on
plot(C(u,:))

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% two dimension – whole
x=1:N;
C=zeros(N,N); % image size N*N

for u=1:N % calculate row
C(u,:)=cos((2x-1)(u-1)pi/(2N)); % computer bases 1-d
end
C=C’;
for u=1:N % calculate colum
C(u,:)=C(u,:).cos((2

©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页