||
clear all;
RGB=imread('autumn.tif');
figure(1);imshow(RGB);title('原始图像');
I=rgb2gray(RGB);
D=dct2(I);
figure(2);imshow(log(abs(D)),[]);colormap(jet(64));colorbar;
title('离散余弦变换结果');
tmp=D;
tmp(abs(D)<10)=0;
K=idct2(tmp);
figure(3);imshow(K,[0 255]);title('反变换图像1');
tmp=D;
tmp(abs(D)<50)=0;
K=idct2(tmp);
figure(4);imshow(K,[0 255]);title('反变换图像2');
tmp=D;
tmp(abs(D)<100)=0;
K=idct2(tmp);
figure(5);imshow(K,[0 255]);title('反变换图像3');
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-26 15:38
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社