Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 提取图像DCT矩阵并插入png_Python_Image_Image Processing_Compression_Dct - Fatal编程技术网

Python 提取图像DCT矩阵并插入png

Python 提取图像DCT矩阵并插入png,python,image,image-processing,compression,dct,Python,Image,Image Processing,Compression,Dct,在阅读了一篇关于渐进式图像加载的文章后,我看到了clicktorelease.com上的一个示例,它从图像中提取dct矩阵,然后将其注入到插入浏览器画布的png图像中 我尝试按照以下步骤在python中生成相同的dct矩阵,但没有得到任何图像 使用cv2读取图像 拆分为16x16块 对每个块应用DCT 做Z字形扫描 我被卡住了。 一些想法:调整大小。在Z字形扫描之前进行量化。重新组装积木 我在jupyter笔记本中有以下代码(它不工作):

在阅读了一篇关于渐进式图像加载的文章后,我看到了clicktorelease.com上的一个示例,它从图像中提取dct矩阵,然后将其注入到插入浏览器画布的png图像中

我尝试按照以下步骤在python中生成相同的dct矩阵,但没有得到任何图像

  • 使用cv2读取图像
  • 拆分为16x16块
  • 对每个块应用DCT
  • 做Z字形扫描
  • 我被卡住了。 一些想法:调整大小。在Z字形扫描之前进行量化。重新组装积木

    我在jupyter笔记本中有以下代码(它不工作):