DCT变换的学习

           第一篇日志2013年2月28日,The last day of Feb,2013.

         自己决定把图像压缩作为自己的研究方向,最近一周刚起步,看了几篇关于DCT变换的文章,之所以从DCT开始,是觉得它小波变换和热门的压缩感知要容易入手。而且对刚刚开始matlab使用的人来说,也比较容易操作。小波变换类型太多,滤波器的设置,以及一维、二维、离散、连续、正交、双正交等,还不太知道各种类型的适用范围及条件。压缩感知需要了解的东西更多,首先是信号的稀疏表示,很多文章都说,一个可以稀疏表示的信号,才能使用少量的观测恢复,对这一观点,我有很大疑惑,任何一幅静态图像都可以使用DCT变换或者小波进行稀疏表示,岂不是,任何图像都适用于压缩感知??第二个没想明白的问题就是,范数下的运算,为什么要求范数的最小值?慢慢明白的,读书百遍,其意自现。

      下面是自己理解并编写的DCT程序。

      clear;
clear all;
clear clc;
load wbarb;
subplot(2,2,1);
image(X);
title('源图像')
A=X-127;
B=mat2cell(A,8*ones(1,32),8*ones(1,32));
T=dctmtx(8);
mask=[1,1,1,1,0,0,0,0;
          1,1,1,0,0,0,0,0;
          1,1,0,0,0,0,0,0;
          1,0,0,0,0,0,0,0;
          0,0,0,0,0,0,0,0;
          0,0,0,0,0,0,0,0;
          0,0,0,0,0,0,0,0;
          0,0,0,0,0,0,0,0 ];
for i=1:32
  for j=1:32
     
       D{i,j}=T*B{i,j}*T';
    
     E{i,j}=mask*D{i,j};
     F{i,j}=T'*E{i,j}*T;
  end
end
     G=cell2mat(F);
     subplot(2,2,2);
     image(G);
     title('压缩后图像')

    colormap(gray);

      效果出来并不理想??呵呵,达不到matlab自带DCT的压缩效果。

     找到一个小错误,减去127后并没有再加上,所以用G=cell2mat(F)+127代替上面的G=cell2mat(F)语句,结果同样不让人满意; 
  

    

     

CT image compression (a) Implement the simplified DCT compression process above for n = 2, 4, and 8 and apply it to the attached image. Show the reconstructed images for these three different cases. [3 images] Compute the PSNR values of the three reconstructed images and discuss what the PSNR value means here. (b) Use the same process in (a) with image transformed to YIQ color model and show the reconstructed image in RGB space. [3 images] Compute the PSNR values of the three reconstructed images and discuss what the PSNR value means here. Dithering 2. Dithering (30%) Convert the image cat2_gray.png to binary (black and white) image with different methods of dithering, show the results, and make some comparison with the results. (a) Apply noise (random) dithering on the provided image and show the result. [1 image] (b) Apply average dithering on the provided image and show the result. [1 image] (c) Apply error diffusion dithering (Floyd-Steinberg algorithm) on the provided image and show the result. [1 image] Image Interpolation Implement the image interpolation function to upsample an image to four times the original width and height. Implement the following two different interpolation methods and show the 4× upsampled images. (a) Apply nearest-neighbor interpolation on the low resolution image, cat3_LR.png, and compute the PSNR with the original high resolution image, cat3_HR.png. [1 image] (b) Apply bilinear interpolation on the low resolution image and compute the PSNR with the high resolution image. [1 image] (c) Apply bicubic interpolation on the low resolution image and compute the PSNR with the high resolution image. [1 image]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值