Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
DCT transformation and mask

Subject: DCT transformation and mask

From: amitesh kumar

Date: 15 Feb, 2011 08:33:03

Message: 1 of 2

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.....

Subject: DCT transformation and mask

From: djmaniar@gmail.com

Date: 21 Jul, 2012 05:04:28

Message: 2 of 2

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.....

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us