估计图像的DCT系数的直方图分布,由其8x8块提取
拥有图像im
使用形状:
imsize = img.shape
在估算每个8x8块的DCT系数之后,
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)] )
我想绘制相应的8x8块的DCT系数的直方图分布,还要绘制dct
图像的dct系数。
我尝试了后者,
seaborn.kdeplot(dct.flatten(), color="r")
但结果不是预期的。我想将其与压缩版本进行比较,以便拥有一些有意义的信息进行比较。如何正确绘制分布?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论