[go: up one dir, main page]

CN110572652B - Static image processing method and device - Google Patents

Static image processing method and device Download PDF

Info

Publication number
CN110572652B
CN110572652B CN201910831832.0A CN201910831832A CN110572652B CN 110572652 B CN110572652 B CN 110572652B CN 201910831832 A CN201910831832 A CN 201910831832A CN 110572652 B CN110572652 B CN 110572652B
Authority
CN
China
Prior art keywords
type
matrix
image
frequency coefficient
preset
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910831832.0A
Other languages
Chinese (zh)
Other versions
CN110572652A (en
Inventor
陈小芬
张恩才
何耀
林旭
游乔贝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks Co Ltd
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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201910831832.0A priority Critical patent/CN110572652B/en
Publication of CN110572652A publication Critical patent/CN110572652A/en
Application granted granted Critical
Publication of CN110572652B publication Critical patent/CN110572652B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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
    • H04N19/174Methods 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 the region being a slice, e.g. a line of blocks or a group of blocks
    • 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/186Methods 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 a colour or a chrominance component
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses a static image processing method and device. Firstly, according to a preset region division rule, carrying out region division on a static image acquired in real time to obtain at least one image region which is not overlapped with each other; acquiring image data of each image area in at least one image area; transforming the data of each type of data matrix in the image data by adopting a discrete cosine transform function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix; and searching the mapping relation between the stored frequency coefficients and the quality factors, acquiring the target quality factors corresponding to the target frequency coefficients to acquire each type of quantization matrix, and acquiring the encoded image data corresponding to the static image according to a preset encoding algorithm and each type of quantization matrix. The method improves the compression ratio and the image processing efficiency of the still image lossy compression algorithm.

Description

Static image processing method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a static image.
Background
In recent years, as a VDI (Virtual Desktop 1 nfrastrecture) solution becomes more popular, the solution has been successively deployed to a wide area network environment for use, i.e., a Desktop virtualization technology is deployed to a wide area network. Because of the low bandwidth of the wide area network, images transmitted by the desktop virtualization technology need to be compressed, wherein the screen image of the virtual desktop based on the desktop virtualization technology is generally a static image, and the static image usually adopts lossy compression, which includes compression algorithms such as Joint Photographic Experts Group (JPEG), JPEG2000, WEBP, and the like.
The JPEG compression algorithm realizes the project optimization of JPEG-turbo, and the algorithm has higher processing efficiency on image data but lower compression rate.
The JPEG2000 compression algorithm can improve the compression rate by about 10-30% by increasing the image complexity on the basis of JPEG, and the processing efficiency is low due to the increase of the image complexity.
The WEBP compression algorithm also improves the compression rate by increasing the complexity of the image on the basis of JPEG, can improve the compression rate by about 30 percent, and has lower processing efficiency.
In conclusion, in the screen image processing process, the processing efficiency of the JPEG2000 compression algorithm and the WEBP compression algorithm is low, and the JPEG compression algorithm has high processing efficiency but low compression rate.
Disclosure of Invention
The embodiment of the application provides a static image processing method and device, which solve the problems in the prior art, and improve the compression ratio of a static image lossy compression algorithm, such as the compression ratio of a JPEG compression algorithm, under the condition of keeping the processing efficiency of the static image lossy compression unchanged.
In a first aspect, a method for processing a still image is provided, and the method may include:
according to a preset region division rule, performing region division on a static image acquired in real time to obtain at least one image region which is not overlapped;
acquiring image data of each image area in the at least one image area, wherein the image data comprises a data matrix of a brightness type, a data matrix of a hue type and a data matrix of a saturation type;
transforming data of each type of data matrix in the image data by adopting a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, wherein the target frequency coefficient is obtained by counting the frequency coefficient in each type of frequency coefficient matrix by adopting a preset statistical algorithm;
searching a mapping relation between the stored frequency coefficient and the quality factor, and acquiring a target quality factor corresponding to the target frequency coefficient;
acquiring a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type;
and acquiring the coded image data corresponding to the static image according to a preset coding algorithm and each type of quantization matrix in the at least one image area.
In an optional implementation, the stored mapping relationship between the frequency coefficients and the quality factors is a corresponding relationship between each quality factor and a set of frequency coefficient ranges, or a corresponding relationship between each quality factor and one frequency coefficient.
In an optional implementation, obtaining the quantization matrix of each type according to the target quality factor and the preset quantization matrix of each type includes:
multiplying the target quality factor corresponding to each type of frequency coefficient matrix with a preset quantization matrix of a corresponding type to obtain an intermediate quantization matrix of each type;
and operating the frequency coefficient matrix of each type and the intermediate quantization matrix of the corresponding type by adopting a preset quantization algorithm to obtain the quantization matrix of each type.
In an optional implementation, obtaining image data corresponding to the still image after encoding according to a preset encoding algorithm and each type of quantization matrix in the at least one image region includes:
taking values of each type of quantization matrix in the at least one image area according to a preset value taking sequence to obtain a one-dimensional array corresponding to the quantization matrix;
and coding the one-dimensional array corresponding to each type of quantization matrix in the at least one image area by adopting the preset coding algorithm to obtain the image data corresponding to the static image after coding.
In a second aspect, there is provided a still image processing apparatus, which may include: the device comprises an area dividing unit, an acquisition unit, a transformation unit and a search unit;
the area dividing unit is used for carrying out area division on the static images acquired in real time according to a preset area dividing rule to obtain at least one image area which is not overlapped with each other;
the acquiring unit is used for acquiring image data of each image area in the at least one image area, wherein the image data comprises a data matrix of a brightness type, a data matrix of a tone type and a data matrix of a saturation type;
the transformation unit is configured to transform data of each type of data matrix in the image data by using a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, where the target frequency coefficient is obtained by counting frequency coefficients in each type of frequency coefficient matrix by using a preset statistical algorithm;
the searching unit is used for searching the mapping relation between the stored frequency coefficient and the quality factor and acquiring a target quality factor corresponding to the target frequency coefficient;
the obtaining unit is further configured to obtain a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type;
the obtaining unit is further configured to obtain encoded image data corresponding to the static image according to a preset encoding algorithm and each type of quantization matrix in the at least one image region.
In an optional implementation, the stored mapping relationship between the frequency coefficients and the quality factors is a corresponding relationship between each quality factor and a set of frequency coefficient ranges, or a corresponding relationship between each quality factor and one frequency coefficient.
In an optional implementation, the obtaining unit is specifically configured to obtain an intermediate quantization matrix of each type by multiplying a target quality factor corresponding to the frequency coefficient matrix of each type by a preset quantization matrix of a corresponding type;
and operating the frequency coefficient matrix of each type and the intermediate quantization matrix of the corresponding type by adopting a preset quantization algorithm to obtain the quantization matrix of each type.
In an optional implementation, the obtaining unit is specifically configured to perform value taking on each type of quantization matrix in the at least one image region according to a preset value taking sequence, and obtain a one-dimensional array corresponding to the quantization matrix;
and coding the one-dimensional array corresponding to each type of quantization matrix in the at least one image area by adopting the preset coding algorithm to obtain the image data corresponding to the static image after coding.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, performs the method steps of any of the above first aspects.
The method comprises the steps of firstly, carrying out region division on a static image acquired in real time according to a preset region division rule to obtain at least one image region which is not overlapped with each other, and obtaining image data of each image region in the at least one image region, wherein the image data comprises a data matrix of a brightness type, a data matrix of a hue type and a data matrix of a saturation type; transforming data of each type of data matrix in the image data by adopting a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, wherein the target frequency coefficient is obtained by counting the frequency coefficients in each type of frequency coefficient matrix by adopting a preset statistical algorithm; searching a mapping relation between the stored frequency coefficient and the quality factor, and acquiring a target quality factor corresponding to the target frequency coefficient; acquiring a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type; and acquiring coded image data corresponding to the static image according to a preset coding algorithm and each type of quantization matrix in at least one image area. According to the method, under the condition that the display effect of the compressed static image is ensured, the corresponding target quality factors are selected according to different target frequency coefficients corresponding to each image area to improve the compression ratio of a static image lossy compression algorithm, such as the compression ratio of a JPEG compression algorithm.
Drawings
Fig. 1 is a schematic flowchart of a method for processing a still image according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a still image processing apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the present application.
The desktop virtualization technology is a technology supporting enterprise-level realization of unified hosting of remote dynamic access and a data center of a desktop system. The static image processing method provided by the embodiment of the invention can be applied to a server.
Fig. 1 is a flowchart illustrating a method for processing a still image according to an embodiment of the present invention. As shown in fig. 1, the method may include:
and 110, carrying out region division on the static image acquired in real time according to a preset region division rule to obtain at least one image region which is not overlapped with each other.
The preset region division rule is used for dividing the static image into at least one image region which is not overlapped with each other, the length and the width of each image region are the same, and the region size determined by the length and the width is an integral multiple of a minimum processing unit in a preset transformation function. The preset Transform function may include a Wavelet Transform (WT), a Discrete Cosine Transform (DCT), and other common Transform coding functions.
If the predetermined transformation function is a DCT function and the minimum processing unit of the DCT function is an 8 × 8 image area, the length and width in each image area are integer multiples of 8 of the length and width in the minimum processing unit of the DCT function.
For example, the width W of a still image acquired in real time is 16 θ, and the length H of the image is 16 μ, where θ and μ are both natural numbers.
The processor divides the static image into 16 × 16 image areas according to a preset area division rule, wherein the number of the areas N is (W × H)/162 image areas which are not overlapped with each other.
Note that the subsequent processing is performed based on the 8 × 8 minimum image regions, and for the 16 × 16 image regions, the subsequent processing is performed on the 4 8 × 8 minimum image regions, and then the processed results are combined to be the processing result of the 16 × 16 image regions.
Step 120, acquiring image data of each image area in at least one image area.
The processor may use a preset image processing algorithm or a preset data extraction algorithm, etc. to obtain initial image data of each image area, where the initial image data is RGB data, and includes a data matrix of red data, a data matrix of green data, and a data matrix of blue data. The data matrix is a multiple matrix of 8 × 8, each data in the matrix is corresponding color data in each pixel, and the value range of each data is generally between [0, 255 ]. If the size of the image area is 8 × 8, the obtained data matrix is 8 × 8 matrix; if the size of the image area is a multiple of 8x8, the resulting data matrix is a multiple matrix of 8x 8.
Since JPEG uses the YCbCr color system, when processing a full-color image, the processor needs to convert RGB data into YCbCr data, and the data conversion algorithm is as follows:
Y=0.299R+0.587G+0.114B;
Cb=-0.168736R-0.331264G+0.500002B+128;
Cr=0.500000R-0.418688G-0.081312B+128;
where Y represents brightness, Cb represents hue, and Cr represents saturation.
That is, the image data acquired by the processor may include a data matrix of a luminance type, a data matrix of a hue type, and a data matrix of a saturation type. The hue type and the saturation type are collectively referred to as a chroma type.
Step 130, transforming the data of each type of data matrix in the image data by using a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix.
When the predetermined transformation function is a DCT function, the DCT function can be expressed as:
Figure BDA0002190969570000071
wherein, when u, v is 0,
Figure BDA0002190969570000072
when u and v are others, c (u) c (v) 1. f (i, j) is data in each type of 8 × 8 data matrix, i and j represent the abscissa and ordinate of the data in the data matrix respectively; f (u, v) is data of the frequency coefficient matrix, and the data is obtained by F (i, j) transformation.
Because the image data comprises three types of data matrixes, DCT operation needs to be carried out for 3 times to obtain a brightness type frequency coefficient matrix corresponding to the brightness type data matrix, a hue type frequency coefficient matrix corresponding to the hue type data matrix and a saturation type frequency coefficient matrix corresponding to the saturation type data matrix. Wherein, the frequency coefficient matrix is a multiple matrix of 8x 8.
Further, the processor may use a preset statistical algorithm, which may include a mean algorithm, a mean square error algorithm, and the like, to perform statistics on frequency coefficients in the frequency coefficient matrix of the brightness type, the frequency coefficient matrix of the hue type, and the frequency coefficient matrix of the saturation type, respectively, to obtain a target frequency coefficient corresponding to each type of frequency coefficient matrix.
Step 140, searching the mapping relationship between the stored frequency coefficients and the quality factors, and obtaining the target quality factors corresponding to the target frequency coefficients.
The compression ratio can be greatly improved due to the over-large quality factor, but the image quality is poor; on the contrary, the smaller the quality factor (the minimum is 1), the better the image quality, but the lower the compression ratio, so before executing this step or before executing step 110, the processor may directly obtain the mapping relationship between the frequency coefficient and the quality factor input by the technician, or may perform cross validation on a plurality of non-overlapping test image regions and a plurality of training image regions obtained by a preset current static image by using a preset cross validation method, obtain the mapping relationship between different frequency coefficients and different quality factors, and store the mapping relationship.
The image area with complex texture in the mapping relation of the frequency coefficient and the quality factor has low corresponding quality factor, wherein the redundancy of image data in the image area with complex texture is more, the quality factor corresponding to the image area is low, and although the display quality distortion which can be caused is some, namely the display quality is reduced, the display quality is not obvious to human eyes; the image area with flat texture has high corresponding quality factor, or keeps the original high quality factor, thereby ensuring better display quality. That is, different quality factors can be obtained according to different frequency coefficients.
The stored mapping relationship between the frequency coefficient and the quality factor may be a corresponding relationship between a frequency coefficient range and a quality factor, or a corresponding relationship between a frequency coefficient and a quality factor. The quality factor is an integer between 1 and 100.
For example, the frequency coefficients may be represented by psnr values describing display quality: if the psnr value is greater than 45, the corresponding quality factor is 75; if the psnr value is less than 30, the corresponding quality factor is 85.
Or, if the psnr value is 45, the corresponding quality factor is 75; with a psnr value of 30, the corresponding quality factor is 85.
And 150, acquiring a quantization matrix of each type according to the target quality factor and the preset quantization matrix of each type.
In the quantization stage, the JPEG compression algorithm provides two standard 8 × 8 preset quantization matrices including a brightness type preset quantization matrix and a chroma type preset quantization matrix.
The processor multiplies the target quality factor corresponding to each type of frequency coefficient matrix with a preset quantization matrix of a corresponding type to obtain each type of processed quantization matrix;
and adopting a preset quantization algorithm to operate each type of frequency coefficient matrix and each type of processed quantization matrix to obtain each type of quantization matrix.
Specifically, the processor multiplies the target quality factor corresponding to each type of frequency coefficient matrix by a preset quantization matrix of a corresponding type to obtain a processed preset quantization matrix of a luminance type and a processed preset quantization matrix of a chrominance type.
And dividing the frequency coefficient in each type of frequency coefficient matrix by the quantization coefficient at the corresponding position in the preset quantization matrix after corresponding processing, and then obtaining each type of quantization matrix by adopting rounding operation.
The formula for the quantization algorithm can be expressed as:
Figure BDA0002190969570000091
fi, j is a frequency coefficient at a position (i, j) in the frequency coefficient matrix, Q is a processed preset quantization matrix, and round () function is a rounding function.
For example, if Fi, j has a frequency coefficient of-415.38, and the quantized coefficient in the corresponding processed preset quantization matrix is 16, the quantized coefficient at the position after quantization is round (-415.38/16) ═ round (-25.96125) ═ 26.
And 160, acquiring the coded image data corresponding to the static image according to a preset coding algorithm and each type of quantization matrix in at least one image area.
The processor may obtain image data corresponding to the still image after encoding according to a preset encoding algorithm and each type of quantization matrix in the at least one image region.
The processor performs value taking on each type of quantization matrix in at least one image area according to a preset value taking sequence, such as a zigzag value taking sequence (zigzag ordering), and obtains a one-dimensional array corresponding to the quantization matrix;
and coding the one-dimensional array corresponding to each type of quantization matrix in at least one image area by adopting a preset coding algorithm to obtain image data corresponding to the static image after coding.
The static image processing method provided by the embodiment of the invention comprises the steps of firstly carrying out region division on a static image acquired in real time according to a preset region division rule to obtain at least one non-overlapping image region, and obtaining image data of each image region in the at least one image region, wherein the image data comprises a brightness type data matrix, a hue type data matrix and a saturation type data matrix; transforming data of each type of data matrix in the image data by adopting a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, wherein the target frequency coefficient is obtained by counting the frequency coefficients in each type of frequency coefficient matrix by adopting a preset statistical algorithm; searching a mapping relation between the stored frequency coefficient and the quality factor, and acquiring a target quality factor corresponding to the target frequency coefficient; acquiring a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type; and acquiring coded image data corresponding to the static image according to a preset coding algorithm and each type of quantization matrix in at least one image area. According to the method, under the condition that the display effect of the compressed static image is ensured, the corresponding target quality factors are selected according to different target frequency coefficients corresponding to each image area to improve the compression ratio of a static image lossy compression algorithm, such as the compression ratio of a JPEG compression algorithm.
Corresponding to the above method, an embodiment of the present invention further provides a still image processing apparatus, as shown in fig. 2, the still image processing apparatus includes: an area dividing unit 210, an obtaining unit 220, a transforming unit 230 and a searching unit 240;
the region dividing unit 210 is configured to perform region division on the static image acquired in real time according to a preset region division rule to obtain at least one image region that does not overlap with each other;
an obtaining unit 220, configured to obtain image data of each of the at least one image area, where the image data includes a data matrix of a brightness type, a data matrix of a hue type, and a data matrix of a saturation type;
a transforming unit 230, configured to transform data of each type of data matrix in the image data by using a preset transformation function, so as to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, where the target frequency coefficient is obtained by counting frequency coefficients in each type of frequency coefficient matrix by using a preset statistical algorithm;
the searching unit 240 is configured to search a mapping relationship between the stored frequency coefficients and the quality factors, and obtain target quality factors corresponding to the target frequency coefficients;
the obtaining unit 220 is further configured to obtain a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type;
the obtaining unit 220 is further configured to obtain encoded image data corresponding to the static image according to a preset encoding algorithm and each type of quantization matrix in the at least one image region.
In an optional implementation, the stored mapping relationship between the frequency coefficients and the quality factors is a corresponding relationship between each quality factor and a set of frequency coefficient ranges, or a corresponding relationship between each quality factor and one frequency coefficient.
In an optional implementation, the obtaining unit 220 is specifically configured to multiply the target quality factor corresponding to each type of frequency coefficient matrix with a preset quantization matrix of a corresponding type to obtain an intermediate quantization matrix of each type;
and operating the frequency coefficient matrix of each type and the intermediate quantization matrix of the corresponding type by adopting a preset quantization algorithm to obtain the quantization matrix of each type.
In an optional implementation, the obtaining unit 220 is specifically configured to perform value taking on each type of quantization matrix in the at least one image region according to a preset value taking sequence, and obtain a one-dimensional array corresponding to the quantization matrix;
and coding the one-dimensional array corresponding to each type of quantization matrix in the at least one image area by adopting the preset coding algorithm to obtain the image data corresponding to the static image after coding.
The functions of the functional units of the processing apparatus for static images provided in the above embodiments of the present invention can be implemented by the above method steps, and therefore, detailed working processes and beneficial effects of the units in the processing apparatus for static images provided in the embodiments of the present invention are not repeated herein.
An embodiment of the present invention further provides an electronic device, as shown in fig. 3, including a processor 310, a communication interface 320, a memory 330, and a communication bus 340, where the processor 310, the communication interface 320, and the memory 330 complete mutual communication through the communication bus 340.
A memory 330 for storing a computer program;
the processor 310, when executing the program stored in the memory 330, implements the following steps:
according to a preset region division rule, performing region division on a static image acquired in real time to obtain at least one image region which is not overlapped;
acquiring image data of each image area in the at least one image area, wherein the image data comprises a data matrix of a brightness type, a data matrix of a hue type and a data matrix of a saturation type;
transforming data of each type of data matrix in the image data by adopting a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, wherein the target frequency coefficient is obtained by counting the frequency coefficient in each type of frequency coefficient matrix by adopting a preset statistical algorithm;
searching a mapping relation between the stored frequency coefficient and the quality factor, and acquiring a target quality factor corresponding to the target frequency coefficient;
acquiring a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type;
and acquiring the coded image data corresponding to the static image according to a preset coding algorithm and each type of quantization matrix in the at least one image area.
In an optional implementation, the stored mapping relationship between the frequency coefficients and the quality factors is a corresponding relationship between each quality factor and a set of frequency coefficient ranges, or a corresponding relationship between each quality factor and one frequency coefficient.
In an optional implementation, obtaining the quantization matrix of each type according to the target quality factor and the preset quantization matrix of each type includes:
multiplying the target quality factor corresponding to each type of frequency coefficient matrix with a preset quantization matrix of a corresponding type to obtain an intermediate quantization matrix of each type;
and operating the frequency coefficient matrix of each type and the intermediate quantization matrix of the corresponding type by adopting a preset quantization algorithm to obtain the quantization matrix of each type.
In an optional implementation, obtaining image data corresponding to the still image after encoding according to a preset encoding algorithm and each type of quantization matrix in the at least one image region includes:
taking values of each type of quantization matrix in the at least one image area according to a preset value taking sequence to obtain a one-dimensional array corresponding to the quantization matrix;
and coding the one-dimensional array corresponding to each type of quantization matrix in the at least one image area by adopting the preset coding algorithm to obtain the image data corresponding to the static image after coding.
The aforementioned communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Since the implementation manner and the beneficial effects of the problem solving of each device of the electronic device in the foregoing embodiment can be implemented by referring to each step in the embodiment shown in fig. 1, detailed working processes and beneficial effects of the electronic device provided by the embodiment of the present invention are not described herein again.
In still another embodiment of the present invention, there is further provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the method for processing a still image according to any one of the above embodiments.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the method for processing a still image as described in any of the above embodiments.
As will be appreciated by one of skill in the art, the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present application.
It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the embodiments of the present application and their equivalents, the embodiments of the present application are also intended to include such modifications and variations.

Claims (10)

1. A method for processing a still image, the method comprising:
according to a preset region division rule, performing region division on a static image acquired in real time to obtain at least one image region which is not overlapped;
acquiring image data of each image area in the at least one image area, wherein the image data comprises a data matrix of a brightness type, a data matrix of a hue type and a data matrix of a saturation type;
transforming data of each type of data matrix in the image data by adopting a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, wherein the target frequency coefficient is obtained by counting the frequency coefficient in each type of frequency coefficient matrix by adopting a preset statistical algorithm;
searching a mapping relation between the stored frequency coefficient and the quality factor, and acquiring a target quality factor corresponding to the target frequency coefficient;
acquiring a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type;
and acquiring the coded image data corresponding to the static image according to a preset coding algorithm and each type of quantization matrix in the at least one image area.
2. The method of claim 1, wherein the stored mapping of frequency coefficients to quality factors is a set of frequency coefficient ranges for each quality factor or a frequency coefficient for each quality factor.
3. The method of claim 1, wherein obtaining the quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type comprises:
multiplying the target quality factor corresponding to each type of frequency coefficient matrix with a preset quantization matrix of a corresponding type to obtain an intermediate quantization matrix of each type;
and operating the frequency coefficient matrix of each type and the intermediate quantization matrix of the corresponding type by adopting a preset quantization algorithm to obtain the quantization matrix of each type.
4. The method of claim 1, wherein obtaining the corresponding encoded image data of the still image according to a preset encoding algorithm and each type of quantization matrix in the at least one image region comprises:
taking values of each type of quantization matrix in the at least one image area according to a preset value taking sequence to obtain a one-dimensional array corresponding to the quantization matrix;
and coding the one-dimensional array corresponding to each type of quantization matrix in the at least one image area by adopting the preset coding algorithm to obtain the image data corresponding to the static image after coding.
5. An apparatus for processing a still image, the apparatus comprising: the device comprises an area dividing unit, an acquisition unit, a transformation unit and a search unit;
the area dividing unit is used for carrying out area division on the static images acquired in real time according to a preset area dividing rule to obtain at least one image area which is not overlapped with each other;
the acquiring unit is used for acquiring image data of each image area in the at least one image area, wherein the image data comprises a data matrix of a brightness type, a data matrix of a tone type and a data matrix of a saturation type;
the transformation unit is configured to transform data of each type of data matrix in the image data by using a preset transformation function to obtain each type of frequency coefficient matrix corresponding to each type of data matrix and a target frequency coefficient corresponding to each type of frequency coefficient matrix, where the target frequency coefficient is obtained by counting frequency coefficients in each type of frequency coefficient matrix by using a preset statistical algorithm;
the searching unit is used for searching the mapping relation between the stored frequency coefficient and the quality factor and acquiring a target quality factor corresponding to the target frequency coefficient;
the obtaining unit is further configured to obtain a quantization matrix of each type according to the target quality factor and a preset quantization matrix of each type;
the obtaining unit is further configured to obtain encoded image data corresponding to the static image according to a preset encoding algorithm and each type of quantization matrix in the at least one image region.
6. The apparatus of claim 5, wherein the stored mapping of frequency coefficients to quality factors is a set of frequency coefficient ranges for each quality factor or a frequency coefficient for each quality factor.
7. The apparatus according to claim 5, wherein the obtaining unit is specifically configured to multiply the target quality factor corresponding to each type of frequency coefficient matrix with a preset quantization matrix of a corresponding type to obtain an intermediate quantization matrix of each type;
and operating the frequency coefficient matrix of each type and the intermediate quantization matrix of the corresponding type by adopting a preset quantization algorithm to obtain the quantization matrix of each type.
8. The apparatus according to claim 5, wherein the obtaining unit is specifically configured to take values of each type of quantization matrix in the at least one image area according to a preset value taking sequence, and obtain a one-dimensional array corresponding to the quantization matrix;
and coding the one-dimensional array corresponding to each type of quantization matrix in the at least one image area by adopting the preset coding algorithm to obtain the image data corresponding to the static image after coding.
9. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-4 when executing a program stored on a memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN201910831832.0A 2019-09-04 2019-09-04 Static image processing method and device Active CN110572652B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910831832.0A CN110572652B (en) 2019-09-04 2019-09-04 Static image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910831832.0A CN110572652B (en) 2019-09-04 2019-09-04 Static image processing method and device

Publications (2)

Publication Number Publication Date
CN110572652A CN110572652A (en) 2019-12-13
CN110572652B true CN110572652B (en) 2021-07-16

Family

ID=68777787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910831832.0A Active CN110572652B (en) 2019-09-04 2019-09-04 Static image processing method and device

Country Status (1)

Country Link
CN (1) CN110572652B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116325752A (en) * 2020-09-29 2023-06-23 华为技术有限公司 An image compression method and device
CN113781359B (en) * 2021-09-27 2024-06-11 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104427349A (en) * 2013-08-20 2015-03-18 清华大学 Bayer image compression method
CN107645662A (en) * 2017-10-19 2018-01-30 电子科技大学 A kind of colour image compression method
CN109376762A (en) * 2018-09-13 2019-02-22 西安万像电子科技有限公司 Image processing method and device
CN109451314A (en) * 2018-04-23 2019-03-08 杭州电子科技大学 A kind of compression of images cognitive method based on graph model

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012119655A1 (en) * 2011-03-10 2012-09-13 Telefonaktiebolaget L M Ericsson (Publ) Decoding of transforms with curved basis functions

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104427349A (en) * 2013-08-20 2015-03-18 清华大学 Bayer image compression method
CN107645662A (en) * 2017-10-19 2018-01-30 电子科技大学 A kind of colour image compression method
CN109451314A (en) * 2018-04-23 2019-03-08 杭州电子科技大学 A kind of compression of images cognitive method based on graph model
CN109376762A (en) * 2018-09-13 2019-02-22 西安万像电子科技有限公司 Image processing method and device

Also Published As

Publication number Publication date
CN110572652A (en) 2019-12-13

Similar Documents

Publication Publication Date Title
JP4559622B2 (en) Color image compression based on two-dimensional discrete wavelet transform yielding perceptually lossless images
KR102531468B1 (en) Encoding and decoding of image data
US8780996B2 (en) System and method for encoding and decoding video data
US9179162B2 (en) Image transform zero coefficient selection and zero-skip transmission for arbitrary shape transform coding
CN110569961A (en) neural network training method and device and terminal equipment
WO2020046434A1 (en) Lossy image compression using palettization of locally mixed colors
WO2023028965A1 (en) Hardware codec accelerators for high-performance video encoding
CN110572652B (en) Static image processing method and device
CN113784175A (en) HDR video conversion method, device, equipment and computer storage medium
CN112492309A (en) Data compression system and data mapping method
CN111311513A (en) Method and apparatus for unifying color styles of images and computer storage medium
CN107333136A (en) Method for encoding images and device
Conde et al. Nilut: Conditional neural implicit 3d lookup tables for image enhancement
CN113781318A (en) Image color mapping method and device, terminal equipment and storage medium
EP3180910A1 (en) System and method for optimized chroma subsampling
CN115937029A (en) A Method of Underwater Image Enhancement
CN109102463B (en) Super-resolution image reconstruction method and device
US9619864B2 (en) Image processing apparatus and method for increasing sharpness of images
WO2019237753A1 (en) A surveillance camera system and a method for reducing power consumption thereof
CN106101711B (en) A kind of quick real-time video codec compression algorithm
CN114170082A (en) Video playing method, image processing method, model training method, device and electronic equipment
CN111091515B (en) Image restoration method and device, and computer-readable storage medium
CN108717687B (en) Image enhancement method based on conversion compression and terminal equipment
US10438328B1 (en) Chroma blurring reduction in video and images
CN112532981B (en) Method, apparatus, and computer-readable storage medium for image compression

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant