Help needed Discrete cosine Transform

Status
Not open for further replies.

kuteangelll

Newbie level 2
Joined
Sep 1, 2005
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
dct coefficient

Hi ,
Can any body tell me , if we have an image , how do we get the DCT coefficinets from the image , i am a begginer to DSP and i want to do DCT on an image using MATLAB, please help me how should i start , i know how Discrete cosine transform works but i dont know what to do if i have a picture ,then what is the next step to extract the block values and get the DCT coefficients, plzzz any kind sould help me.
 

Discrete Cosine transform is used for compression of images (in Jpeg).
there are functions in Matlab which find 1D, 2D dct of input. Since yours is an image u need to use 2D DCT ( dct2()) .
The 2D DCT can be taken on the entire image to get the DCT coefficients of the entire image but since error even in a single coefficient would affect the entire image and since there would be loss in flexibility as the size of images varies usually they divide the image as blocks of size 8x8. It is also said that this gives the maximum compression compared to other block size (although still some people argue that 4x4 would perform better).
So you need to split the input image matrix as 8x8 blocks and take 2D DCT of each block. Then based on some thereshold (usually the function of image quality) you remove the DCT coefficients. Based on the image content at each block the no. of significant DCT coefficients would vary.
hope this was helpful.

Regards,
KJN.
 

If the dimensions of the picture is not multiples of 8*8 u have to do padding. DCT works on 8*8 blocks only.

Regards,
Amr.
 

Hi,
Actually DCT is another transform like Fourier transform.In images since it gives good compression it is used. DCT can have any dimension but as I said earlier 8x8 seems to give the maximum for most images (better energy compaction) compared to all dimensions and so it has been used in many standards like JPEG(baseline) and video stds like MPEG2 MotionJPEG etc. However the new standard H.264 uses 4x4 integer transform which is an approximation of DCT and is a integer implementation.

Regards,
KJN
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…