WO2020215433A1 - Image compression method and apparatus - Google Patents

Image compression method and apparatus Download PDF

Info

Publication number
WO2020215433A1
WO2020215433A1 PCT/CN2019/088690 CN2019088690W WO2020215433A1 WO 2020215433 A1 WO2020215433 A1 WO 2020215433A1 CN 2019088690 W CN2019088690 W CN 2019088690W WO 2020215433 A1 WO2020215433 A1 WO 2020215433A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
image block
quantization parameter
training
compressed
Prior art date
Application number
PCT/CN2019/088690
Other languages
French (fr)
Chinese (zh)
Other versions
WO2020215433A9 (en
Inventor
陈云娜
Original Assignee
深圳市华星光电技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市华星光电技术有限公司 filed Critical 深圳市华星光电技术有限公司
Publication of WO2020215433A1 publication Critical patent/WO2020215433A1/en
Publication of WO2020215433A9 publication Critical patent/WO2020215433A9/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements

Definitions

  • This application relates to an image processing technology, in particular to an image compression method and device.
  • Block discrete cosine transform is widely used in image compression coding such as JPEG, H.264/AVC and H.265/HEVC.
  • This image is compressed and encoded and often quantized after transformation.
  • this coding technique usually produces blocking effects.
  • QP quantization parameter
  • Sparse representation can be used to reduce blockiness, but the traditional training model of sparse representation is only applicable to one quantization parameter. When the quantization parameter is other values, the processed image cannot get the best effect.
  • the purpose of the present application is to provide an image compression method and device to solve the block effect caused by image compression and improve the compression distortion caused by the incompatibility of multiple quantization coefficients in the prior art using a mapping matrix.
  • an image compression method including:
  • each image block According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block;
  • the step of reconstructing each image block to obtain the final reconstructed image block includes:
  • the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block;
  • the method further includes:
  • the mapping matrix corresponding to the maximum predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  • the quantified parameter fitting curve is obtained through the following steps:
  • the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
  • the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training.
  • a second compressed test image finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
  • a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
  • the method further includes:
  • Another aspect of the present application provides an image compression method, the method including:
  • each image block According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block;
  • the step of reconstructing each image block to obtain the final reconstructed image block includes:
  • the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block;
  • a linear interpolation method is used to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block.
  • the method further includes:
  • the mapping matrix corresponding to the smallest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  • the method further includes:
  • the mapping matrix corresponding to the maximum predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  • the quantified parameter fitting curve is obtained through the following steps:
  • the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
  • the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training.
  • a second compressed test image finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
  • a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
  • the method further includes:
  • an image compression device which includes:
  • One or more processors are One or more processors;
  • One or more program modules are stored in the memory and can be executed by the one or more processors to implement an image compression method, the method includes:
  • each image block According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block;
  • the step of reconstructing each image block to obtain the final reconstructed image block includes:
  • the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block;
  • a linear interpolation method is used to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block.
  • the method further includes:
  • the mapping matrix corresponding to the smallest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  • the method further includes:
  • the mapping matrix corresponding to the largest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  • the quantified parameter fitting curve is obtained through the following steps:
  • the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
  • the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training.
  • a second compressed test image finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
  • a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
  • the method further includes:
  • This application uses a block method to reconstruct image blocks separately.
  • the two closest mapping matrices are obtained according to the size of the quantization parameter in the image block, and the two mapping matrices are used to reconstruct the image block
  • Two reconstructed image blocks are obtained, and the two reconstructed image blocks are merged by linear interpolation to obtain the final reconstructed image block, and all the final reconstructed image blocks are combined to obtain the final reconstructed image.
  • the present application solves the block effect caused by image compression, and improves the compression distortion caused by the incompatibility of multiple quantization coefficients when a mapping matrix is used in the prior art.
  • Fig. 1 shows a flowchart of an image compression method according to the present application.
  • Fig. 2 shows a schematic diagram of an image divided into a plurality of image blocks according to the present application.
  • Fig. 3 shows a flow chart of deriving a quantitative parameter fitting curve according to the present application.
  • Figure 4 shows a schematic diagram of the quantified parameter fitting curve according to the present application.
  • Fig. 5 shows a flowchart of reconstructing each image block to obtain a final reconstructed image block according to the present application.
  • Fig. 6 shows a schematic diagram of an image compression device according to the present application.
  • the image compression method of this application includes the following steps:
  • Step S10 divide an image into multiple image blocks, wherein the multiple image blocks use different quantization parameters in the compression process
  • Step S20 reconstruct each image block according to the quantization parameter (QP) corresponding to each image block to obtain a final reconstructed image block;
  • Step S30 combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image.
  • the image compression method of the present application divides an image into multiple image blocks, and each image block is processed by discrete cosine transform (DCT), and each image block uses different quantization parameters.
  • DCT discrete cosine transform
  • the 16*24 size image is divided into 6 8*8 image blocks, and each image block is compressed using a different quantization parameter (step S10).
  • Each image block is reconstructed according to its corresponding quantization parameter to obtain a final reconstructed image block (step S20), that is, each image block corresponds to a final reconstructed image block after reconstruction.
  • step S30 all the final reconstructed image blocks are combined to obtain the compressed image of the image (step S30), that is, according to the positions of the corresponding image blocks, all the final reconstructed image blocks are stitched and combined to obtain the compressed image. Describe compressed images.
  • the quantization parameter fitting curve needs to be referred to in the reconstruction process of each image block.
  • the following describes how to obtain the quantization parameter fitting curve with reference to FIG. 3.
  • the compressed image and the corresponding high-definition image under different quantization parameters QPtr_n are used for training respectively (step S42) to obtain the corresponding mapping matrix Mtr_n under different quantization parameters QPtr_n (step S44).
  • the high-definition training images are compressed with different training quantization parameters QPtr_n to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters QPtr_n are used as outputs, and the high-definition training images are input to the mapping model.
  • the compressed images under different quantization parameters QPte_n are tested using the corresponding mapping matrices Mtr_n obtained by different QPtr_n training (step S46) to obtain the best QPtr_n values that the compressed images under the corresponding quantization parameters QPte_n should take.
  • the mapping matrix Mtr_n (step S48). Specifically, the high-definition test image is compressed with different test quantization parameters QPte_n to obtain the first compressed test image, and the mapping model is used to convert the high-definition test image with the corresponding mapping matrix Mtr_n under different training quantization parameters QPtr_n.
  • mapping into a second compressed test image and find the best training used by the second compressed test image and its corresponding mapping matrix Mtr_n that have the smallest difference from the first compressed test image under the test quantization parameter QPte_n Use the quantization parameter QPtr_n.
  • the fitting relationship curve between the mapping matrix Mtr_n under the best QPtr_n and the test image QPte_n is obtained (step S50), and t mapping matrices Mtr_1 to Mtr_t are stored (step S52). Specifically, the fitting curve of the test quantization parameter QPte_n and the best training quantization parameter QPtr_n is obtained, and the mapping matrix Mtr_n corresponding to the best training quantization parameter QPtr_n is stored.
  • the fitting curve of the test quantization parameter QPte_n and the best training quantization parameter QPtr_n obtained according to the above steps is f(QPte_n) shown in FIG. 4.
  • five mapping matrices corresponding to QPtr_1, QPtr_2, QPtr_3, QPtr_4, and QPtr_5 are stored.
  • step 20 includes the following steps:
  • Step S202 Determine the position of the quantization parameter of the image block on the quantization parameter fitting curve.
  • the position of its landing point in the quantization parameter fitting curve f(QPte_n) may be smaller than the smallest predetermined quantization parameter, or between two predetermined quantization parameters Time, or greater than the maximum predetermined quantization parameter.
  • Step S204 if the drop point is smaller than the smallest predetermined quantization parameter, use the mapping matrix corresponding to the smallest predetermined quantization parameter to reconstruct the image block to obtain the final reconstructed image block.
  • mapping matrix Mtr_1 is used to reconstruct the image block, and the final reconstructed image block is directly obtained.
  • Step S206 if the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, use the first mapping matrix corresponding to the first predetermined quantization parameter to reconstruct the image block to obtain the first reconstructed image block, And using the second mapping matrix corresponding to the second predetermined quantization parameter to reconstruct the image block to obtain the second reconstructed image block; and using the linear interpolation method to fuse the first reconstructed image block and the second reconstructed image block to obtain Finally reconstruct the image block.
  • the first mapping matrix Mtr_1 is used to reconstruct the image block at this time to obtain The first reconstructed image block YQP1 uses the second mapping matrix Mtr_2 to reconstruct the image block to obtain the second reconstructed image block YQP2. Then use linear interpolation to get the final reconstructed image block, the calculation method is as follows:
  • Step S208 if the drop point is greater than the maximum predetermined quantization parameter, use the mapping matrix corresponding to the maximum predetermined quantization parameter to reconstruct the image block to obtain the final reconstructed image block.
  • mapping matrix Mtr_5 is used to reconstruct the image block, and the final reconstructed image block is directly obtained.
  • This application uses a block method to reconstruct image blocks separately.
  • the two closest mapping matrices are obtained according to the size of the quantization parameter in the image block, and the two mapping matrices are used to reconstruct the image block
  • Two reconstructed image blocks are obtained, and the two reconstructed image blocks are merged by linear interpolation to obtain the final reconstructed image block, and all the final reconstructed image blocks are combined to obtain the final reconstructed image.
  • the present application solves the block effect caused by image compression, and improves the compression distortion caused by the incompatibility of multiple quantization coefficients when the prior art adopts a mapping matrix.
  • the present application provides an image processing apparatus 500, which includes one or more processors 501 and a memory 502, the memory 502 is connected to the one or more processors 501, and one or more program modules store It is stored in the memory 502 and can be executed by the one or more processors 501 to implement all or part of the steps in the various methods of the foregoing embodiments. It should be noted that those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing relevant hardware through a program.
  • the program can be stored in a computer-readable storage medium.
  • the medium may include: read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

The present application uses a block method to respectively reconstruct image blocks and, during the process of reconstructing each image block, on the basis of the magnitude of quantisation parameters in the image block, obtains the two closest mapping matrices and uses the two mapping matrices for reconstructing image blocks to obtain two reconstructed image blocks, the two reconstructed image blocks being fused by means of a linear interpolation method to obtain a final reconstructed image block, and all of the final reconstructed image blocks being combined to obtain a final reconstructed image. The present application solves the block effect caused by image compression and improves the compression distortion caused by the incompatibility of multiple quantisation coefficients in mapping matrices used in the prior art.

Description

图像压缩方法及装置Image compression method and device 技术领域Technical field
本申请涉及一种图像处理技术,特别涉及一种图像压缩方法及装置。This application relates to an image processing technology, in particular to an image compression method and device.
背景技术Background technique
块离散余弦变换(block discrete cosine transform,BDCT)被广泛应用于例如JPEG、H.264/AVC及H.265/HEVC等图像压缩编码中。此图像压缩编码并常在变换后进行量化。然而,由于每图像块单独进行变换以及粗糙的量化,此编码技术通常会产生块效应。为了保证图像质量,一帧图像中每个图像块会采取不同的量化参数(quantization parameter,QP)。稀疏表示(sparse representation)可用来降低块效应,但是传统的稀疏表示方式的训练模型只适用于一种量化参数,当量化参数为其他值时,处理后图像不能得到最佳的效果。Block discrete cosine transform (BDCT) is widely used in image compression coding such as JPEG, H.264/AVC and H.265/HEVC. This image is compressed and encoded and often quantized after transformation. However, due to the individual transformation and coarse quantization of each image block, this coding technique usually produces blocking effects. In order to ensure image quality, each image block in a frame of image will adopt a different quantization parameter (QP). Sparse representation can be used to reduce blockiness, but the traditional training model of sparse representation is only applicable to one quantization parameter. When the quantization parameter is other values, the processed image cannot get the best effect.
技术问题technical problem
本申请的目的在于提供一种图像压缩方法及装置,以解决图像压缩引起的块效应,改善现有技术采用一种映射矩阵,不能兼容多种量化系数而导致的压缩失真的情况。The purpose of the present application is to provide an image compression method and device to solve the block effect caused by image compression and improve the compression distortion caused by the incompatibility of multiple quantization coefficients in the prior art using a mapping matrix.
技术解决方案Technical solutions
为达成上述目的,本申请一方面提供一种图像压缩方法,所述方法包括:In order to achieve the foregoing objective, one aspect of the present application provides an image compression method, the method including:
利用一或多个处理器及存储可由所述一或多个处理器执行的程 序的存储器,将一张图像分成多个图像块,其中所述多个图像块在压缩过程中采用不同的量化参数;Using one or more processors and a memory storing programs executable by the one or more processors to divide an image into multiple image blocks, wherein the multiple image blocks use different quantization parameters during the compression process ;
依据每个图像块对应的量化参数,对每个图像块进行重建以得出最终重建图像块;以及According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block; and
将每个图像块对应的最终重建图像块进行组合,以得出所述图像的压缩图像,Combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image,
其中对每个图像块进行重建以得出所述最终重建图像块的步骤包括:The step of reconstructing each image block to obtain the final reconstructed image block includes:
判断所述图像块的量化参数于量化参数拟合曲线中的落点的位置;Judging the position of the quantization parameter of the image block in the quantization parameter fitting curve;
若所述落点位于第一预定量化参数和第二预定量化参数之间,采用与所述第一预定量化参数对应的第一映射矩阵来重建所述图像块,以得出第一重建图像块,以及采用与所述第二预定量化参数对应的第二映射矩阵来重建所述图像块,以得出第二重建图像块;以及If the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block; and
采用线性插值方式,融合所述第一重建图像块和所述第二重建图像块,以得出所述最终重建图像块,Using a linear interpolation method to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block,
其中于判断所述落点的位置的步骤之后,所述方法更包括:After the step of determining the location of the landing point, the method further includes:
若所述落点小于最小的预定量化参数,采用与所述最小的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块;以及If the falling point is smaller than the smallest predetermined quantization parameter, reconstruct the image block by using the mapping matrix corresponding to the smallest predetermined quantization parameter to obtain the final reconstructed image block; and
若所述落点大于最大的预定量化参数,采用与所述最大的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像 块。If the drop point is greater than the maximum predetermined quantization parameter, the mapping matrix corresponding to the maximum predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
本申请实施例中,所述量化参数拟合曲线是通过以下步骤得出:In the embodiment of the present application, the quantified parameter fitting curve is obtained through the following steps:
于训练阶段中,以不同训练用量化参数对高清训练图像进行压缩以得出压缩训练图像,分别以对应不同训练用量化参数的所述压缩训练图像为输出,将高清训练图像输入到映射模型中来训练所述映射模型,以分别得到不同训练用量化参数下对应的映射矩阵;In the training phase, the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
于测试阶段中,以不同测试用量化参数对高清测试图像进行压缩以得出第一压缩测试图像,利用所述映射模型以不同训练用量化参数下对应的映射矩阵将所述高清测试图像映射成第二压缩测试图像,找出与所述测试用量化参数下的所述第一压缩测试图像差异最小的所述第二压缩测试图像及其对应的映射矩阵所采用的最佳训练用量化参数;以及In the test phase, the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training. A second compressed test image, finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
于预处理阶段中,得出所述测试用量化参数与所述最佳训练用量化参数的拟合曲线,并存储对应所述最佳训练用量化参数的映射矩阵。In the preprocessing stage, a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
本申请实施例中,于将所述图像分成所述多个图像块的步骤之后,所述方法更包括:In the embodiment of the present application, after the step of dividing the image into the multiple image blocks, the method further includes:
对所述多个图像块进行块离散余弦变换。Perform block discrete cosine transform on the plurality of image blocks.
本申请另一方面提供一种图像压缩方法,所述方法包括:Another aspect of the present application provides an image compression method, the method including:
利用一或多个处理器及存储可由所述一或多个处理器执行的程序的存储器,将一张图像分成多个图像块,其中所述多个图像块在压缩过程中采用不同的量化参数;Using one or more processors and a memory storing programs executable by the one or more processors to divide an image into multiple image blocks, wherein the multiple image blocks use different quantization parameters during the compression process ;
依据每个图像块对应的量化参数,对每个图像块进行重建以得出 最终重建图像块;以及According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block; and
将每个图像块对应的最终重建图像块进行组合,以得出所述图像的压缩图像,Combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image,
其中对每个图像块进行重建以得出所述最终重建图像块的步骤包括:The step of reconstructing each image block to obtain the final reconstructed image block includes:
判断所述图像块的量化参数于量化参数拟合曲线中的落点的位置;Judging the position of the quantization parameter of the image block in the quantization parameter fitting curve;
若所述落点位于第一预定量化参数和第二预定量化参数之间,采用与所述第一预定量化参数对应的第一映射矩阵来重建所述图像块,以得出第一重建图像块,以及采用与所述第二预定量化参数对应的第二映射矩阵来重建所述图像块,以得出第二重建图像块;以及If the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block; and
采用线性插值方式,融合所述第一重建图像块和所述第二重建图像块,以得出所述最终重建图像块。A linear interpolation method is used to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block.
本申请实施例中,于判断所述落点的位置的步骤之后,所述方法更包括:In the embodiment of the present application, after the step of determining the location of the landing point, the method further includes:
若所述落点小于最小的预定量化参数,采用与所述最小的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the falling point is smaller than the smallest predetermined quantization parameter, the mapping matrix corresponding to the smallest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
本申请实施例中,于判断所述落点的位置的步骤之后,所述方法更包括:In the embodiment of the present application, after the step of determining the location of the landing point, the method further includes:
若所述落点大于最大的预定量化参数,采用与所述最大的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像 块。If the drop point is greater than the maximum predetermined quantization parameter, the mapping matrix corresponding to the maximum predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
本申请实施例中,所述量化参数拟合曲线是通过以下步骤得出:In the embodiment of the present application, the quantified parameter fitting curve is obtained through the following steps:
于训练阶段中,以不同训练用量化参数对高清训练图像进行压缩以得出压缩训练图像,分别以对应不同训练用量化参数的所述压缩训练图像为输出,将高清训练图像输入到映射模型中来训练所述映射模型,以分别得到不同训练用量化参数下对应的映射矩阵;In the training phase, the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
于测试阶段中,以不同测试用量化参数对高清测试图像进行压缩以得出第一压缩测试图像,利用所述映射模型以不同训练用量化参数下对应的映射矩阵将所述高清测试图像映射成第二压缩测试图像,找出与所述测试用量化参数下的所述第一压缩测试图像差异最小的所述第二压缩测试图像及其对应的映射矩阵所采用的最佳训练用量化参数;以及In the test phase, the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training. A second compressed test image, finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
于预处理阶段中,得出所述测试用量化参数与所述最佳训练用量化参数的拟合曲线,并存储对应所述最佳训练用量化参数的映射矩阵。In the preprocessing stage, a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
本申请实施例中,于将所述图像分成所述多个图像块的步骤之后,所述方法更包括:In the embodiment of the present application, after the step of dividing the image into the multiple image blocks, the method further includes:
对所述多个图像块进行块离散余弦变换。Perform block discrete cosine transform on the plurality of image blocks.
本申请再一方面提供一种图像压缩装置,所述装置包括:Another aspect of the present application provides an image compression device, which includes:
一或多个处理器;One or more processors;
存储器;以及Memory; and
一或多个程序模块,存储于所述存储器中且可由所述一或多个处理器执行以实现图像压缩方法,所述方法包括:One or more program modules are stored in the memory and can be executed by the one or more processors to implement an image compression method, the method includes:
将一张图像分成多个图像块,其中所述多个图像块在压缩过程中采用不同的量化参数;Dividing an image into multiple image blocks, wherein the multiple image blocks adopt different quantization parameters in the compression process;
依据每个图像块对应的量化参数,对每个图像块进行重建以得出最终重建图像块;以及According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block; and
将每个图像块对应的最终重建图像块进行组合,以得出所述图像的压缩图像,Combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image,
其中对每个图像块进行重建以得出所述最终重建图像块的步骤包括:The step of reconstructing each image block to obtain the final reconstructed image block includes:
判断所述图像块的量化参数于量化参数拟合曲线中的落点的位置;Judging the position of the quantization parameter of the image block in the quantization parameter fitting curve;
若所述落点位于第一预定量化参数和第二预定量化参数之间,采用与所述第一预定量化参数对应的第一映射矩阵来重建所述图像块,以得出第一重建图像块,以及采用与所述第二预定量化参数对应的第二映射矩阵来重建所述图像块,以得出第二重建图像块;以及If the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block; and
采用线性插值方式,融合所述第一重建图像块和所述第二重建图像块,以得出所述最终重建图像块。A linear interpolation method is used to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block.
本申请实施例中,于判断所述落点的位置的步骤之后,所述方法更包括:In the embodiment of the present application, after the step of determining the location of the landing point, the method further includes:
若所述落点小于最小的预定量化参数,采用与所述最小的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the falling point is smaller than the smallest predetermined quantization parameter, the mapping matrix corresponding to the smallest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
本申请实施例中,于判断所述落点的位置的步骤之后,所述方法 更包括:In the embodiment of the present application, after the step of determining the location of the landing point, the method further includes:
若所述落点大于最大的预定量化参数,采用与所述最大的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the drop point is greater than the largest predetermined quantization parameter, the mapping matrix corresponding to the largest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
本申请实施例中,所述量化参数拟合曲线是通过以下步骤得出:In the embodiment of the present application, the quantified parameter fitting curve is obtained through the following steps:
于训练阶段中,以不同训练用量化参数对高清训练图像进行压缩以得出压缩训练图像,分别以对应不同训练用量化参数的所述压缩训练图像为输出,将高清训练图像输入到映射模型中来训练所述映射模型,以分别得到不同训练用量化参数下对应的映射矩阵;In the training phase, the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
于测试阶段中,以不同测试用量化参数对高清测试图像进行压缩以得出第一压缩测试图像,利用所述映射模型以不同训练用量化参数下对应的映射矩阵将所述高清测试图像映射成第二压缩测试图像,找出与所述测试用量化参数下的所述第一压缩测试图像差异最小的所述第二压缩测试图像及其对应的映射矩阵所采用的最佳训练用量化参数;以及In the test phase, the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training. A second compressed test image, finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
于预处理阶段中,得出所述测试用量化参数与所述最佳训练用量化参数的拟合曲线,并存储对应所述最佳训练用量化参数的映射矩阵。In the preprocessing stage, a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
本申请实施例中,于将所述图像分成所述多个图像块的步骤之后,所述方法更包括:In the embodiment of the present application, after the step of dividing the image into the multiple image blocks, the method further includes:
对所述多个图像块进行块离散余弦变换。Perform block discrete cosine transform on the plurality of image blocks.
有益效果Beneficial effect
本申请采用分块方式分别重建图像块,在每个图像块的重建过程 中,根据图像块内量化参数的大小求取最邻近的两个映射矩阵,利用这两个映射矩阵对图像块进行重建得出两个重建图像块,这两个重建图像块再通过线性插值的方式进行融合得出最终重建图像块,将所有的最终重建图像块进行组合得到最终重建图像。本申请解决图像压缩引起的块效应,改善现有技术采用一种映射矩阵,不能兼容多种量化系数而导致的压缩失真的情况。This application uses a block method to reconstruct image blocks separately. In the reconstruction process of each image block, the two closest mapping matrices are obtained according to the size of the quantization parameter in the image block, and the two mapping matrices are used to reconstruct the image block Two reconstructed image blocks are obtained, and the two reconstructed image blocks are merged by linear interpolation to obtain the final reconstructed image block, and all the final reconstructed image blocks are combined to obtain the final reconstructed image. The present application solves the block effect caused by image compression, and improves the compression distortion caused by the incompatibility of multiple quantization coefficients when a mapping matrix is used in the prior art.
附图说明Description of the drawings
图1显示根据本申请的一种图像压缩方法的流程图。Fig. 1 shows a flowchart of an image compression method according to the present application.
图2显示根据本申请的分成多个图像块的图像的示意图。Fig. 2 shows a schematic diagram of an image divided into a plurality of image blocks according to the present application.
图3显示根据本申请的得出量化参数拟合曲线的流程图。Fig. 3 shows a flow chart of deriving a quantitative parameter fitting curve according to the present application.
图4显示根据本申请的量化参数拟合曲线的示意图。Figure 4 shows a schematic diagram of the quantified parameter fitting curve according to the present application.
图5显示根据本申请的对每个图像块进行重建以得出最终重建图像块的流程图。Fig. 5 shows a flowchart of reconstructing each image block to obtain a final reconstructed image block according to the present application.
图6显示根据本申请的一种图像压缩装置的示意图。Fig. 6 shows a schematic diagram of an image compression device according to the present application.
本发明的实施方式Embodiments of the invention
为使本申请的目的、技术方案及效果更加清楚、明确,以下参照附图并举实施例对本申请进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,本申请说明书所使用的词语“实施例”意指用作实例、示例或例证,并不用于限定本申请。In order to make the purpose, technical solutions and effects of this application clearer and clearer, the following further describes this application in detail with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application, and the word "embodiment" used in the specification of the application means serving as an example, example or illustration, and is not intended to limit the application.
请参阅图1,本申请的图像压缩方法包括以下步骤:Please refer to Figure 1. The image compression method of this application includes the following steps:
步骤S10—将一张图像分成多个图像块,其中所述多个图像块在压缩过程中采用不同的量化参数;Step S10—divide an image into multiple image blocks, wherein the multiple image blocks use different quantization parameters in the compression process;
步骤S20—依据每个图像块对应的量化参数(quantization parameter,QP),对每个图像块进行重建以得出最终重建图像块;以及Step S20—reconstruct each image block according to the quantization parameter (QP) corresponding to each image block to obtain a final reconstructed image block; and
步骤S30—将每个图像块对应的最终重建图像块进行组合,以得出所述图像的压缩图像。Step S30—combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image.
本申请的图像压缩方法将图像分成多个图像块,每个图像块采用离散余弦变换(discrete cosine transform,DCT)进行处理,每个图像块选用不同的量化参数。如图2所示,16*24大小的图像,分成6个8*8的图像块,每个图像块采用不同的量化参数进行压缩(步骤S10)。每个图像块依据其对应的量化参数进行重建而得出最终重建图像块(步骤S20),亦即每个图像块在重建后皆对应一个最终重建图像块。最后,将所有的最终重建图像块组合起来以得出所述图像的压缩图像(步骤S30),也就是,按照对应的图像块的位置,对所有最终重建图像块进行拼接组合,以得出所述压缩图像。The image compression method of the present application divides an image into multiple image blocks, and each image block is processed by discrete cosine transform (DCT), and each image block uses different quantization parameters. As shown in Fig. 2, the 16*24 size image is divided into 6 8*8 image blocks, and each image block is compressed using a different quantization parameter (step S10). Each image block is reconstructed according to its corresponding quantization parameter to obtain a final reconstructed image block (step S20), that is, each image block corresponds to a final reconstructed image block after reconstruction. Finally, all the final reconstructed image blocks are combined to obtain the compressed image of the image (step S30), that is, according to the positions of the corresponding image blocks, all the final reconstructed image blocks are stitched and combined to obtain the compressed image. Describe compressed images.
本申请中,每个图像块的重建过程中需参考量化参数拟合曲线,以下参照图3,说明如何得出量化参数拟合曲线。In this application, the quantization parameter fitting curve needs to be referred to in the reconstruction process of each image block. The following describes how to obtain the quantization parameter fitting curve with reference to FIG. 3.
于训练阶段中,采取不同量化参数QPtr_n下的压缩图像与对应高清图像分别进行训练(步骤S42),以分别得到不同量化参数QPtr_n下对应映射矩阵Mtr_n(步骤S44)。具体来说,以不同训练用量化参数QPtr_n对高清训练图像进行压缩以得出压缩训练图像,分别以对应不同训练用量化参数QPtr_n的所述压缩训练图像为输出,将高清训练图像输入到映射模型中来训练所述映射模型,以分别得到不同训 练用量化参数QPtr_n下对应的映射矩阵Mtr_n。In the training phase, the compressed image and the corresponding high-definition image under different quantization parameters QPtr_n are used for training respectively (step S42) to obtain the corresponding mapping matrix Mtr_n under different quantization parameters QPtr_n (step S44). Specifically, the high-definition training images are compressed with different training quantization parameters QPtr_n to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters QPtr_n are used as outputs, and the high-definition training images are input to the mapping model. To train the mapping model to obtain the corresponding mapping matrix Mtr_n under different training quantization parameters QPtr_n.
于测试阶段中,对不同量化参数QPte_n下的压缩图像采用不同QPtr_n训练得到的对应映射矩阵Mtr_n分别进行测试(步骤S46),以分别得到对应量化参数QPte_n下的压缩图像应采取的最佳QPtr_n下的映射矩阵Mtr_n(步骤S48)。具体来说,以不同测试用量化参数QPte_n对高清测试图像进行压缩以得出第一压缩测试图像,利用所述映射模型以不同训练用量化参数QPtr_n下对应的映射矩阵Mtr_n将所述高清测试图像映射成第二压缩测试图像,找出与所述测试用量化参数QPte_n下的所述第一压缩测试图像差异最小的所述第二压缩测试图像及其对应的映射矩阵Mtr_n所采用的最佳训练用量化参数QPtr_n。In the test phase, the compressed images under different quantization parameters QPte_n are tested using the corresponding mapping matrices Mtr_n obtained by different QPtr_n training (step S46) to obtain the best QPtr_n values that the compressed images under the corresponding quantization parameters QPte_n should take. The mapping matrix Mtr_n (step S48). Specifically, the high-definition test image is compressed with different test quantization parameters QPte_n to obtain the first compressed test image, and the mapping model is used to convert the high-definition test image with the corresponding mapping matrix Mtr_n under different training quantization parameters QPtr_n. Mapping into a second compressed test image, and find the best training used by the second compressed test image and its corresponding mapping matrix Mtr_n that have the smallest difference from the first compressed test image under the test quantization parameter QPte_n Use the quantization parameter QPtr_n.
于预处理阶段中,得到最佳QPtr_n下的映射矩阵Mtr_n与测试图像QPte_n的拟合关系曲线(步骤S50),存储t个映射矩阵Mtr_1~Mtr_t(步骤S52)。具体来说,得出所述测试用量化参数QPte_n与所述最佳训练用量化参数QPtr_n的拟合曲线,并存储对应所述最佳训练用量化参数QPtr_n的映射矩阵Mtr_n。In the preprocessing stage, the fitting relationship curve between the mapping matrix Mtr_n under the best QPtr_n and the test image QPte_n is obtained (step S50), and t mapping matrices Mtr_1 to Mtr_t are stored (step S52). Specifically, the fitting curve of the test quantization parameter QPte_n and the best training quantization parameter QPtr_n is obtained, and the mapping matrix Mtr_n corresponding to the best training quantization parameter QPtr_n is stored.
依照上述步骤所得出的测试用量化参数QPte_n与最佳训练用量化参数QPtr_n的拟合曲线为图4所示的f(QPte_n)。在这个例子中,对应QPtr_1、QPtr_2、QPtr_3、QPtr_4及QPtr_5的5个映射矩阵被存储。The fitting curve of the test quantization parameter QPte_n and the best training quantization parameter QPtr_n obtained according to the above steps is f(QPte_n) shown in FIG. 4. In this example, five mapping matrices corresponding to QPtr_1, QPtr_2, QPtr_3, QPtr_4, and QPtr_5 are stored.
请参阅图5,上述对每个图像块进行重建以得出最终重建图像块的步骤(即步骤20)包括如下步骤:Referring to FIG. 5, the above step of reconstructing each image block to obtain a final reconstructed image block (ie, step 20) includes the following steps:
步骤S202—判断图像块的量化参数于量化参数拟合曲线中的落点的位置。Step S202 — Determine the position of the quantization parameter of the image block on the quantization parameter fitting curve.
如图4所示,假定图像块选用的量化参数为k,则其在量化参数拟合曲线f(QPte_n)中的落点的位置可能小于最小的预定量化参数,或介于两预定量化参数之间,或大于最大的预定量化参数。As shown in Figure 4, assuming that the quantization parameter selected for the image block is k, the position of its landing point in the quantization parameter fitting curve f(QPte_n) may be smaller than the smallest predetermined quantization parameter, or between two predetermined quantization parameters Time, or greater than the maximum predetermined quantization parameter.
步骤S204—若落点小于最小的预定量化参数,采用与最小的预定量化参数对应的映射矩阵来重建图像块,以得出最终重建图像块。Step S204 — if the drop point is smaller than the smallest predetermined quantization parameter, use the mapping matrix corresponding to the smallest predetermined quantization parameter to reconstruct the image block to obtain the final reconstructed image block.
在此步骤中,若k<QPte_1,即量化参数k小于最小的预定量化参数QPte_1,则采用映射矩阵Mtr_1来重建图像块,直接得出最终重建图像块。In this step, if k<QPte_1, that is, the quantization parameter k is less than the minimum predetermined quantization parameter QPte_1, the mapping matrix Mtr_1 is used to reconstruct the image block, and the final reconstructed image block is directly obtained.
步骤S206—若落点位于第一预定量化参数和第二预定量化参数之间,采用与第一预定量化参数对应的第一映射矩阵来重建所述图像块,以得出第一重建图像块,以及采用与第二预定量化参数对应的第二映射矩阵来重建图像块,以得出第二重建图像块;以及采用线性插值方式,融合第一重建图像块和第二重建图像块,以得出最终重建图像块。Step S206 — if the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, use the first mapping matrix corresponding to the first predetermined quantization parameter to reconstruct the image block to obtain the first reconstructed image block, And using the second mapping matrix corresponding to the second predetermined quantization parameter to reconstruct the image block to obtain the second reconstructed image block; and using the linear interpolation method to fuse the first reconstructed image block and the second reconstructed image block to obtain Finally reconstruct the image block.
在此步骤中,若QPte_1<k<QPte_2,亦即量化参数k位于第一预定量化参数QPte_1和第二预定量化参数QPte_2之间,则此时采用第一映射矩阵Mtr_1来重建图像块,得出第一重建图像块YQP1,采用第二映射矩阵Mtr_2来重建图像块,得出第二重建图像块YQP2。而后采用线性插值方式得出最终重建图像块,计算方式如下:In this step, if QPte_1<k<QPte_2, that is, the quantization parameter k is located between the first predetermined quantization parameter QPte_1 and the second predetermined quantization parameter QPte_2, then the first mapping matrix Mtr_1 is used to reconstruct the image block at this time to obtain The first reconstructed image block YQP1 uses the second mapping matrix Mtr_2 to reconstruct the image block to obtain the second reconstructed image block YQP2. Then use linear interpolation to get the final reconstructed image block, the calculation method is as follows:
Figure PCTCN2019088690-appb-000001
Figure PCTCN2019088690-appb-000001
步骤S208—若落点大于最大的预定量化参数,采用与最大的预定量化参数对应的映射矩阵来重建图像块,以得出最终重建图像块。Step S208 — if the drop point is greater than the maximum predetermined quantization parameter, use the mapping matrix corresponding to the maximum predetermined quantization parameter to reconstruct the image block to obtain the final reconstructed image block.
在此步骤中,若k>QPte_5,即量化参数k大于最大的预定量化参数QPte_5,则采用映射矩阵Mtr_5来重建图像块,直接得出最终重建图像块。In this step, if k>QPte_5, that is, the quantization parameter k is greater than the maximum predetermined quantization parameter QPte_5, the mapping matrix Mtr_5 is used to reconstruct the image block, and the final reconstructed image block is directly obtained.
本申请采用分块方式分别重建图像块,在每个图像块的重建过程中,根据图像块内量化参数的大小求取最邻近的两个映射矩阵,利用这两个映射矩阵对图像块进行重建得出两个重建图像块,这两个重建图像块再通过线性插值的方式进行融合得出最终重建图像块,将所有的最终重建图像块进行组合得到最终重建图像。本申请解决图像压缩引起的块效应,改善现有技术采用一种映射矩阵,不能兼容多种量化系数而导致的压缩失真的情况。This application uses a block method to reconstruct image blocks separately. In the reconstruction process of each image block, the two closest mapping matrices are obtained according to the size of the quantization parameter in the image block, and the two mapping matrices are used to reconstruct the image block Two reconstructed image blocks are obtained, and the two reconstructed image blocks are merged by linear interpolation to obtain the final reconstructed image block, and all the final reconstructed image blocks are combined to obtain the final reconstructed image. The present application solves the block effect caused by image compression, and improves the compression distortion caused by the incompatibility of multiple quantization coefficients when the prior art adopts a mapping matrix.
如图6所示,本申请提供一种图像处理装置500,其包括一或多个处理器501和存储器502,存储器502与所述一或多个处理器501连接,一或多个程序模块存储于存储器502中且可由所述一或多个处理器501执行以实现上述实施例的各种方法中的全部或部分步骤。需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。As shown in FIG. 6, the present application provides an image processing apparatus 500, which includes one or more processors 501 and a memory 502, the memory 502 is connected to the one or more processors 501, and one or more program modules store It is stored in the memory 502 and can be executed by the one or more processors 501 to implement all or part of the steps in the various methods of the foregoing embodiments. It should be noted that those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The medium may include: read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
综上所述,虽然本申请已以优选实施例揭露如上,但上述优选实 施例并非用以限制本申请,本领域的普通技术人员,在不脱离本申请的范围内,均可作各种更动与润饰,因此本申请的保护范围以权利要求界定的范围为准。In summary, although this application has been disclosed as above in preferred embodiments, the above preferred embodiments are not intended to limit the application. Those of ordinary skill in the art can make various modifications without departing from the scope of this application. Therefore, the protection scope of this application is subject to the scope defined by the claims.

Claims (13)

  1. 一种图像压缩方法,其特征在于,所述方法包括:An image compression method, characterized in that the method includes:
    利用一或多个处理器及存储可由所述一或多个处理器执行的程序的存储器,将一张图像分成多个图像块,其中所述多个图像块在压缩过程中采用不同的量化参数;Using one or more processors and a memory storing programs executable by the one or more processors to divide an image into multiple image blocks, wherein the multiple image blocks use different quantization parameters during the compression process ;
    依据每个图像块对应的量化参数,对每个图像块进行重建以得出最终重建图像块;以及According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block; and
    将每个图像块对应的最终重建图像块进行组合,以得出所述图像的压缩图像,Combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image,
    其中对每个图像块进行重建以得出所述最终重建图像块的步骤包括:The step of reconstructing each image block to obtain the final reconstructed image block includes:
    判断所述图像块的量化参数于量化参数拟合曲线中的落点的位置;Judging the position of the quantization parameter of the image block in the quantization parameter fitting curve;
    若所述落点位于第一预定量化参数和第二预定量化参数之间,采用与所述第一预定量化参数对应的第一映射矩阵来重建所述图像块,以得出第一重建图像块,以及采用与所述第二预定量化参数对应的第二映射矩阵来重建所述图像块,以得出第二重建图像块;以及If the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block; and
    采用线性插值方式,融合所述第一重建图像块和所述第二重建图像块,以得出所述最终重建图像块,Using a linear interpolation method to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block,
    其中于判断所述落点的位置的步骤之后,所述方法更包括:After the step of determining the location of the landing point, the method further includes:
    若所述落点小于最小的预定量化参数,采用与所述最小的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像 块;以及If the falling point is smaller than the smallest predetermined quantization parameter, reconstruct the image block by using the mapping matrix corresponding to the smallest predetermined quantization parameter to obtain the final reconstructed image block; and
    若所述落点大于最大的预定量化参数,采用与所述最大的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the drop point is greater than the largest predetermined quantization parameter, the mapping matrix corresponding to the largest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  2. 根据权利要求1所述的图像压缩方法,其特征在于,所述量化参数拟合曲线是通过以下步骤得出:The image compression method according to claim 1, wherein the quantization parameter fitting curve is obtained through the following steps:
    于训练阶段中,以不同训练用量化参数对高清训练图像进行压缩以得出压缩训练图像,分别以对应不同训练用量化参数的所述压缩训练图像为输出,将高清训练图像输入到映射模型中来训练所述映射模型,以分别得到不同训练用量化参数下对应的映射矩阵;In the training phase, the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
    于测试阶段中,以不同测试用量化参数对高清测试图像进行压缩以得出第一压缩测试图像,利用所述映射模型以不同训练用量化参数下对应的映射矩阵将所述高清测试图像映射成第二压缩测试图像,找出与所述测试用量化参数下的所述第一压缩测试图像差异最小的所述第二压缩测试图像及其对应的映射矩阵所采用的最佳训练用量化参数;以及In the test phase, the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training. A second compressed test image, finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
    于预处理阶段中,得出所述测试用量化参数与所述最佳训练用量化参数的拟合曲线,并存储对应所述最佳训练用量化参数的映射矩阵。In the preprocessing stage, a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
  3. 根据权利要求1所述的图像压缩方法,其特征在于,于将所述图像分成所述多个图像块的步骤之后,所述方法更包括:The image compression method according to claim 1, wherein after the step of dividing the image into the plurality of image blocks, the method further comprises:
    对所述多个图像块进行块离散余弦变换。Perform block discrete cosine transform on the plurality of image blocks.
  4. 一种图像压缩方法,其特征在于,所述方法包括:An image compression method, characterized in that the method includes:
    利用一或多个处理器及存储可由所述一或多个处理器执行的程序的存储器,将一张图像分成多个图像块,其中所述多个图像块在压缩过程中采用不同的量化参数;Using one or more processors and a memory storing programs executable by the one or more processors to divide an image into multiple image blocks, wherein the multiple image blocks use different quantization parameters during the compression process ;
    依据每个图像块对应的量化参数,对每个图像块进行重建以得出最终重建图像块;以及According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block; and
    将每个图像块对应的最终重建图像块进行组合,以得出所述图像的压缩图像,Combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image,
    其中对每个图像块进行重建以得出所述最终重建图像块的步骤包括:The step of reconstructing each image block to obtain the final reconstructed image block includes:
    判断所述图像块的量化参数于量化参数拟合曲线中的落点的位置;Judging the position of the quantization parameter of the image block in the quantization parameter fitting curve;
    若所述落点位于第一预定量化参数和第二预定量化参数之间,采用与所述第一预定量化参数对应的第一映射矩阵来重建所述图像块,以得出第一重建图像块,以及采用与所述第二预定量化参数对应的第二映射矩阵来重建所述图像块,以得出第二重建图像块;以及If the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain the first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block; and
    采用线性插值方式,融合所述第一重建图像块和所述第二重建图像块,以得出所述最终重建图像块。A linear interpolation method is used to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block.
  5. 根据权利要求4所述的图像压缩方法,其特征在于,于判断所述落点的位置的步骤之后,所述方法更包括:4. The image compression method according to claim 4, wherein after the step of determining the location of the drop point, the method further comprises:
    若所述落点小于最小的预定量化参数,采用与所述最小的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the falling point is smaller than the smallest predetermined quantization parameter, the mapping matrix corresponding to the smallest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  6. 根据权利要求4所述的图像压缩方法,其特征在于,于判断所述落点的位置的步骤之后,所述方法更包括:4. The image compression method according to claim 4, wherein after the step of determining the location of the drop point, the method further comprises:
    若所述落点大于最大的预定量化参数,采用与所述最大的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the drop point is greater than the largest predetermined quantization parameter, the mapping matrix corresponding to the largest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  7. 根据权利要求4所述的图像压缩方法,其特征在于,所述量化参数拟合曲线是通过以下步骤得出:The image compression method according to claim 4, wherein the quantization parameter fitting curve is obtained through the following steps:
    于训练阶段中,以不同训练用量化参数对高清训练图像进行压缩以得出压缩训练图像,分别以对应不同训练用量化参数的所述压缩训练图像为输出,将高清训练图像输入到映射模型中来训练所述映射模型,以分别得到不同训练用量化参数下对应的映射矩阵;In the training phase, the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
    于测试阶段中,以不同测试用量化参数对高清测试图像进行压缩以得出第一压缩测试图像,利用所述映射模型以不同训练用量化参数下对应的映射矩阵将所述高清测试图像映射成第二压缩测试图像,找出与所述测试用量化参数下的所述第一压缩测试图像差异最小的所述第二压缩测试图像及其对应的映射矩阵所采用的最佳训练用量化参数;以及In the test phase, the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training. A second compressed test image, finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
    于预处理阶段中,得出所述测试用量化参数与所述最佳训练用量化参数的拟合曲线,并存储对应所述最佳训练用量化参数的映射矩阵。In the preprocessing stage, a fitting curve between the quantized parameter for testing and the quantized parameter for optimal training is obtained, and a mapping matrix corresponding to the quantized parameter for optimal training is stored.
  8. 根据权利要求4所述的图像压缩方法,其特征在于,于将所述图像分成所述多个图像块的步骤之后,所述方法更包括:4. The image compression method according to claim 4, wherein after the step of dividing the image into the plurality of image blocks, the method further comprises:
    对所述多个图像块进行块离散余弦变换。Perform block discrete cosine transform on the plurality of image blocks.
  9. 一种图像压缩装置,其特征在于,所述装置包括:An image compression device, characterized in that the device includes:
    一或多个处理器;One or more processors;
    存储器;以及Memory; and
    一或多个程序模块,存储于所述存储器中且可由所述一或多个处理器执行以实现图像压缩方法,所述方法包括:One or more program modules are stored in the memory and can be executed by the one or more processors to implement an image compression method, the method includes:
    将一张图像分成多个图像块,其中所述多个图像块在压缩过程中采用不同的量化参数;Dividing an image into multiple image blocks, wherein the multiple image blocks adopt different quantization parameters in the compression process;
    依据每个图像块对应的量化参数,对每个图像块进行重建以得出最终重建图像块;以及According to the quantization parameter corresponding to each image block, reconstruct each image block to obtain the final reconstructed image block; and
    将每个图像块对应的最终重建图像块进行组合,以得出所述图像的压缩图像,Combine the final reconstructed image blocks corresponding to each image block to obtain a compressed image of the image,
    其中对每个图像块进行重建以得出所述最终重建图像块的步骤包括:The step of reconstructing each image block to obtain the final reconstructed image block includes:
    判断所述图像块的量化参数于量化参数拟合曲线中的落点的位置;Judging the position of the quantization parameter of the image block in the quantization parameter fitting curve;
    若所述落点位于第一预定量化参数和第二预定量化参数之间,采用与所述第一预定量化参数对应的第一映射矩阵来重建所述图像块,以得出第一重建图像块,以及采用与所述第二预定量化参数对应的第二映射矩阵来重建所述图像块,以得出第二重建图像块;以及If the landing point is between the first predetermined quantization parameter and the second predetermined quantization parameter, the first mapping matrix corresponding to the first predetermined quantization parameter is used to reconstruct the image block to obtain a first reconstructed image block , And reconstructing the image block by using a second mapping matrix corresponding to the second predetermined quantization parameter to obtain a second reconstructed image block; and
    采用线性插值方式,融合所述第一重建图像块和所述第二重建图像块,以得出所述最终重建图像块。A linear interpolation method is used to fuse the first reconstructed image block and the second reconstructed image block to obtain the final reconstructed image block.
  10. 根据权利要求9所述的图像压缩装置,其特征在于,于判断 所述落点的位置的步骤之后,所述方法更包括:The image compression device according to claim 9, wherein after the step of determining the location of the drop point, the method further comprises:
    若所述落点小于最小的预定量化参数,采用与所述最小的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the falling point is smaller than the smallest predetermined quantization parameter, the mapping matrix corresponding to the smallest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  11. 根据权利要求9所述的图像压缩装置,其特征在于,于判断所述落点的位置的步骤之后,所述方法更包括:9. The image compression device of claim 9, wherein after the step of determining the location of the drop point, the method further comprises:
    若所述落点大于最大的预定量化参数,采用与所述最大的预定量化参数对应的映射矩阵来重建所述图像块,以得出所述最终重建图像块。If the drop point is greater than the largest predetermined quantization parameter, the mapping matrix corresponding to the largest predetermined quantization parameter is used to reconstruct the image block to obtain the final reconstructed image block.
  12. 根据权利要求9所述的图像压缩装置,其特征在于,所述量化参数拟合曲线是通过以下步骤得出:9. The image compression device according to claim 9, wherein the quantization parameter fitting curve is obtained through the following steps:
    于训练阶段中,以不同训练用量化参数对高清训练图像进行压缩以得出压缩训练图像,分别以对应不同训练用量化参数的所述压缩训练图像为输出,将高清训练图像输入到映射模型中来训练所述映射模型,以分别得到不同训练用量化参数下对应的映射矩阵;In the training phase, the high-definition training images are compressed with different training quantization parameters to obtain compressed training images, and the compressed training images corresponding to different training quantization parameters are respectively used as output, and the high-definition training images are input into the mapping model To train the mapping model to obtain corresponding mapping matrices under different training quantization parameters;
    于测试阶段中,以不同测试用量化参数对高清测试图像进行压缩以得出第一压缩测试图像,利用所述映射模型以不同训练用量化参数下对应的映射矩阵将所述高清测试图像映射成第二压缩测试图像,找出与所述测试用量化参数下的所述第一压缩测试图像差异最小的所述第二压缩测试图像及其对应的映射矩阵所采用的最佳训练用量化参数;以及In the test phase, the high-definition test image is compressed with different quantization parameters for testing to obtain a first compressed test image, and the mapping model is used to map the high-definition test image into a corresponding mapping matrix under different quantization parameters for training. A second compressed test image, finding the best training quantization parameter used by the second compressed test image and its corresponding mapping matrix that have the smallest difference from the first compressed test image under the test quantization parameter; as well as
    于预处理阶段中,得出所述测试用量化参数与所述最佳训练用量 化参数的拟合曲线,并存储对应所述最佳训练用量化参数的映射矩阵。In the preprocessing stage, a fitting curve between the quantization parameter for testing and the optimal training quantization parameter is obtained, and a mapping matrix corresponding to the quantization parameter for optimal training is stored.
  13. 根据权利要求9所述的图像压缩装置,其特征在于,于将所述图像分成所述多个图像块的步骤之后,所述方法更包括:9. The image compression device according to claim 9, wherein after the step of dividing the image into the plurality of image blocks, the method further comprises:
    对所述多个图像块进行块离散余弦变换。Perform block discrete cosine transform on the plurality of image blocks.
PCT/CN2019/088690 2019-04-26 2019-05-28 Image compression method and apparatus WO2020215433A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910341714.1 2019-04-26
CN201910341714.1A CN110113609B (en) 2019-04-26 2019-04-26 Image compression method and device

Publications (2)

Publication Number Publication Date
WO2020215433A1 true WO2020215433A1 (en) 2020-10-29
WO2020215433A9 WO2020215433A9 (en) 2021-01-28

Family

ID=67486878

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/088690 WO2020215433A1 (en) 2019-04-26 2019-05-28 Image compression method and apparatus

Country Status (2)

Country Link
CN (1) CN110113609B (en)
WO (1) WO2020215433A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114201118B (en) * 2022-02-15 2022-05-17 北京中科开迪软件有限公司 Storage method and system based on optical disk library

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130049604A (en) * 2011-11-04 2013-05-14 연세대학교 산학협력단 Mode Switching Method in Entropy Coding
US20140376622A1 (en) * 2011-09-30 2014-12-25 Blackberry Limited Methods and devices for data compression using a non-uniform reconstruction space
CN106559668A (en) * 2015-09-25 2017-04-05 电子科技大学 A kind of low code rate image compression method based on intelligent quantization technology
CN106803958A (en) * 2017-01-12 2017-06-06 同济大学 A kind of numerical model analysis video transmission method based on superposition modulated coding
CN108780499A (en) * 2016-03-09 2018-11-09 索尼公司 The system and method for video processing based on quantization parameter

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140376622A1 (en) * 2011-09-30 2014-12-25 Blackberry Limited Methods and devices for data compression using a non-uniform reconstruction space
KR20130049604A (en) * 2011-11-04 2013-05-14 연세대학교 산학협력단 Mode Switching Method in Entropy Coding
CN106559668A (en) * 2015-09-25 2017-04-05 电子科技大学 A kind of low code rate image compression method based on intelligent quantization technology
CN108780499A (en) * 2016-03-09 2018-11-09 索尼公司 The system and method for video processing based on quantization parameter
CN106803958A (en) * 2017-01-12 2017-06-06 同济大学 A kind of numerical model analysis video transmission method based on superposition modulated coding

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
AMER, HOSSAM: "Low-Delay Hevc Adaptive Quantization Parameter Selection through Temporal Propagation Length Estimation", 2018 25TH IEEE INTERNATIONAL CONFERENCE ON IMAGE PROCESSING (ICIP),, 10 October 2018 (2018-10-10), pages 211 - 215, XP033454593, DOI: 10.1109/ICIP.2018.8451018 *

Also Published As

Publication number Publication date
CN110113609A (en) 2019-08-09
CN110113609B (en) 2020-09-08
WO2020215433A9 (en) 2021-01-28

Similar Documents

Publication Publication Date Title
JP2019525679A5 (en)
WO2018214671A1 (en) Image distortion correction method and device and electronic device
US9014471B2 (en) Method of classifying a chroma downsampling error
CN109120937B (en) Video encoding method, decoding method, device and electronic equipment
US20180124404A1 (en) Region-based image decompression
US20130170764A1 (en) Downsizing an encoded image
US20210409783A1 (en) Loop filter implementation method and apparatus, and computer storage medium
US11366979B2 (en) Using selected components of frequency domain image data in artificial intelligence tasks
CN110971901A (en) Convolutional neural network processing method and device
WO2021098030A1 (en) Method and apparatus for video encoding
US11961267B2 (en) Color conversion between color spaces using reduced dimension embeddings
WO2020215433A1 (en) Image compression method and apparatus
CN107547773B (en) Image processing method, device and equipment
JP2015019364A (en) Image compression apparatus and method
Akbari et al. Downsampling based image coding using dual dictionary learning and sparse representations
WO2017129147A1 (en) Image coding and decoding methods and devices, and image coding/decoding system
CN107645664B (en) Color image compression method based on reaction-diffusion equation set
Chang et al. A lightweight super-resolution for compressed image
Tang et al. 72‐2: A Proposal for Image‐Compression Algorithm for Display Test Images
DE102006049232B4 (en) Method and apparatus for avoiding errors when rounding values after performing an inverse discrete cosine transformation
WO2023178662A1 (en) Image and video coding using multi-sensor collaboration and frequency adaptive processing
Al-Hilo et al. Study of fractal color image compression using YUV components
US10440363B2 (en) Encoder performing quantization based on deadzone, and video processing system comprising the same
Al Falahi et al. Comparitive Analysis and Findings on Dct & Lbg Compression Techniques
CN112927146A (en) Compressed image restoration method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19926463

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19926463

Country of ref document: EP

Kind code of ref document: A1