0
2.6kviews
Write an expression for a two dimensional DCT. Also find the DCT of the given image.

$$$$ \begin{bmatrix} \ 1 & 2 & 2 & 1 \\ \ \ 2 & 1 & 2 & 1 \\ \ \ 1 & 2 & 2 & 1 \\ \ \ 2 & 1 & 2 & 1 \\ \end{bmatrix} $$$$

1 Answer
0
23views

Expression for two dimensional DCT

The two dimensional DCT is represented as:

$f(u,v) = α(u)α(v)∑_P{x=0}^{N-1} ∑_{y=0}^{N-1} f(x,y)\cos⁡[ \dfrac {(2x+1)uπ}{2N}]\cos⁡[\dfrac{(2y+1)vπ}{2N}] \\ for \space \space u,v = 0,1,2,…N-1 \\ Where\space\space α(u)=\sqrt{1/N} \space\space for\space\space u=0 \\ α(u) = \sqrt{2/N}\space\space for \space\space 1\lt=u\lt=N-1 \\ α(v)=\sqrt{1/N}\space\space for \space\space v=0 \\ α(v) = \sqrt{2/N}\space\space for \space\space1\lt=v\lt=N-1 $

Now the two dimensional DCT can also be generated using the equation

$F=CfC’ \space\space\space\space (eq.1) $

Where f = Given image

$C(u,v) = \sqrt{1/N} \space\space\space\space u=0,0\lt=v\lt=N-1 \\ C(u,v) = \sqrt{2/N} \cos[\dfrac {π(2v+1)u}{2N}]\space\space\space\space 1\lt=u\lt=N-1, 0\lt=v\lt=N-1 $

DCT of the given image

The given image is

$\begin{bmatrix} 1&2&2&1\\ 2&1&2&1\\ 1&2&2&1\\ 2&1&2&1 \end{bmatrix}$

Using eq.1 i.e.$ F=CfC’$

Calculating C(u,v)

For $\space u=0, 0\lt=v\lt=N-1 \\ C(u,v)= \sqrt{1/N} \\ = \sqrt{¼} \\ = 0.5$

Therefore $C(0,0) = C(0,1) = C(0,2) = C(0,3) = 0.5 \\ For\space\space u=1, v=0\\ C(u,v) = \sqrt{2/N}\cos[\dfrac {π(2v+1)u}{2N}] \\ C(1,0) = \sqrt{2/4} \cos[\dfrac {π(0+1)1}8] = 0.653 \\ For \space\space u=1, v=1 \\ C(1,1) = \sqrt{2/4} \cos[\dfrac {π(2+1)1}8] = 0.2705 \\ For\space \space u=1, v=2 \\ C(1,2) = \sqrt{2/4}\cos[\dfrac {π(4+1)1}8] = -0.2705 \\ For \space\space u=1, v=3\\ C(1,3) = \sqrt{2/4}\cos[\dfrac {π(6+1)1}8] = -0.653 \\ For \space \space u=2, v=0\\ C(2,0) = \sqrt{2/4}\cos[\dfrac {π(0+1)2}8] = 0.5 \\ For \space\space u=2, v=1 \\ C(2,1) = \sqrt{2/4} \cos[\dfrac {π(2+1)2}8] = -0.5 \\ For\space\space u=2, v=2 \\ C(2,2) = \sqrt{2/4}\cos[\dfrac {π(4+1)2}8] = -0.5 \\ For \space\space u=2, v=3 \\ C(2,3) = \sqrt{2/4} \cos[\dfrac {π(6+1)2}8] = 0.5 \\ For\space\space u=3, v=0 \\ C(3,0) = \sqrt{2/4} \cos[\dfrac {π(0+1)3}8] = 0.2705 \\ For \space\space u=3, v=1 \\ C(3,1) = \sqrt{2/4}\cos[\dfrac {π(2+1)3}8] = -0.653 \\ For\space\space u=3, v=2 \\ C(3,2) = \sqrt{2/4} \cos[\dfrac {π(4+1)3}8] = 0.653 \\ For \space\space u=3, v=3\\ C(3,3) = \sqrt{2/4} \cos[\dfrac {π(6+1)3}8] = -0.2705 $

enter image description here enter image description here

Please log in to add an answer.