| Author |
Message |
kuteangelll
Joined: 01 Sep 2005 Posts: 2
|
01 Sep 2005 20:08 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.
|
|
| Back to top |
|
 |
nitthilan
Joined: 13 Oct 2004 Posts: 18 Helped: 5
|
02 Sep 2005 9:12 Re: Help needed Discrete cosine Transform |
|
|
|
|
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.
|
|
| Back to top |
|
 |
amraldo
Joined: 29 Aug 2004 Posts: 287 Helped: 25 Location: egypt, cairo
|
02 Sep 2005 10:42 Re: Help needed Discrete cosine Transform |
|
|
|
|
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.
|
|
| Back to top |
|
 |
Google AdSense

|
02 Sep 2005 10:42 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
me2please
Joined: 07 Aug 2004 Posts: 362 Helped: 64
|
|
| Back to top |
|
 |
nitthilan
Joined: 13 Oct 2004 Posts: 18 Helped: 5
|
05 Sep 2005 11:18 Re: Help needed Discrete cosine Transform |
|
|
|
|
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
|
|
| Back to top |
|
 |