Estimating the histogram distribution for DCT coefficients of an image, extracted by their 8x8 blocks

Viewed 45

Having an image im With shape:

imsize = img.shape

After estimating the DCT coefficients for each 8x8 block

dct = np.zeros(imsize)
for i in [:imsize[0]:8]:
    for j in [:imsize[1]:8]:
        dct[i:(i+8),j:(j+8)] = dct2( im[i:(i+8),j:(j+8)] )

I would like to plot the histogram distribution of DCT coefficients both for the corresponding 8x8 blocks but also for the dct image.

I tried for the latter with the

seaborn.kdeplot(dct.flatten(), color="r")

but I the result is not the expected. I want to compare this with a compressed version in order to have some meaningful information to compare. How can I plot the distribution correctly?

0 Answers
Related