Compression 使用一幅图像的jpeg量化矩阵压缩另一幅图像

Compression 使用一幅图像的jpeg量化矩阵压缩另一幅图像,compression,jpeg,libjpeg,Compression,Jpeg,Libjpeg,我有两个图像,A和B,我需要估计B的量化表,并使用这个表压缩A。使用libjpeg或者更好的opencv,最好的方法是什么 我使用了libjpeg的实用程序“djpeg”来查找图像的量化表,但我不确定如何解释其输出并将其与libjpeg一起使用。此外,我需要找到这个矩阵并从我的程序内部进行压缩,这使得我认为“djpeg”在这种情况下不可用 以下是测试映像的“djpeg”输出,运行时使用: djpeg-v-vcat1.jpg>/dev/null Start of Image JFIF APP0 m

我有两个图像,A和B,我需要估计B的量化表,并使用这个表压缩A。使用libjpeg或者更好的opencv,最好的方法是什么

我使用了libjpeg的实用程序“djpeg”来查找图像的量化表,但我不确定如何解释其输出并将其与libjpeg一起使用。此外,我需要找到这个矩阵并从我的程序内部进行压缩,这使得我认为“djpeg”在这种情况下不可用

以下是测试映像的“djpeg”输出,运行时使用:

djpeg-v-vcat1.jpg>/dev/null

Start of Image
JFIF APP0 marker: version 1.01, density 96x96  1
Define Quantization Table 0  precision 0
           5    3    3    5    7   12   15   18
           4    4    4    6    8   17   18   17
           4    4    5    7   12   17   21   17
           4    5    7    9   15   26   24   19
           5    7   11   17   20   33   31   23
           7   11   17   19   24   31   34   28
          15   19   23   26   31   36   36   30
          22   28   29   29   34   30   31   30
Define Quantization Table 1  precision 0
           5    5    7   14   30   30   30   30
           5    6    8   20   30   30   30   30
           7    8   17   30   30   30   30   30
          14   20   30   30   30   30   30   30
          30   30   30   30   30   30   30   30
          30   30   30   30   30   30   30   30
          30   30   30   30   30   30   30   30
          30   30   30   30   30   30   30   30
Start Of Frame 0xc0: width=450, height=320, components=3
    Component 1: 2hx2v q=0
    Component 2: 1hx1v q=1
    Component 3: 1hx1v q=1
Define Huffman Table 0x00
          0   1   5   1   1   1   1   1
          1   0   0   0   0   0   0   0
Define Huffman Table 0x10
          0   2   1   3   3   2   4   3
          5   5   4   4   0   0   1 125
Define Huffman Table 0x01
          0   3   1   1   1   1   1   1
          1   1   1   0   0   0   0   0
Define Huffman Table 0x11
          0   2   1   2   4   4   3   4
          7   5   4   4   0   1   2 119
Start Of Scan: 3 components
    Component 1: dc=0 ac=0
    Component 2: dc=1 ac=1
    Component 3: dc=1 ac=1
  Ss=0, Se=63, Ah=0, Al=0
End Of Image
提前谢谢