|
On Tuesday, February 15, 2011 2:03:03 PM UTC+5:30, amitesh kumar wrote:
> hello
> i am trying to apply DCT transformation on image of size 512*512.
> for applying DCT i use following code
>
>
> I = im2double(norm);
> T = dctmtx(8);
> dct = @(block_struct) T * block_struct.data * T';
> D = blockproc(I,[8 8],dct);
>
>
> and for Inverse DCT i am using the following one
>
> 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];
> B2 = blockproc( D,[8 8],@(block_struct) mask .* block_struct.data);
> invdct = @(block_struct) T' * block_struct.data * T;
> I2 = blockproc(B2,[8 8],invdct);
>
> here in IDCT , what is actual importance of 'mask'. here matrix shown for mask is 8*8 as i am converting the image also in 8*8 block. if i like maintain the block of 32*32, than what is the procedure for writing 'mask' matrix. so my confusion is regarding importance of masking here and how to write mask matrix for 32*32. if anybody having any idea , plz help me .
> thanx in adv.....
Main purpose of mask matrix is to reduce image size........
More the number of zeros in that matrix means more compression! But at the same time quality of image will degrade......So according to your requirment you can set number of zeros and ones.....
|