1-d dct transform not 2-d
sibosutd opened this issue · 1 comments
sibosutd commented
Hi Gaith,
I noticed in your jpeg repo that dct transformation code is not right,
dct_matrix = fftpack.dct(block, norm='ortho')
since the fftpack.dct() function is only 1D DCT instead of 2D DCT as in JPEG compression.
It should be implemented as follows,
def dct2(image):
return fftpack.dct(fftpack.dct(image.T, norm='ortho').T, norm='ortho')
dct_matrix = dct2(block)
And similar for inverse dct transform..