Image enhancement compression method, transmission method and corresponding device
Through technologies such as boot filtering and entropy coding, the image is dynamically adjusted and detailed enhancement is solved, which solves the storage space and bandwidth occupation problems caused by the large amount of image data, and realizes efficient image compression and transmission, which is suitable for high-demand fields such as telemetry systems.
Patent Information
- Application Number
- CN202411702199.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-25
AI Technical Summary
In scenarios where the amount of image data is large, it is difficult for the prior art to reduce the use of storage space and bandwidth while ensuring image quality. Especially in telemetry systems, the transmission bandwidth is limited, which affects the performance of the system.
The image is decomposed into a base layer and a detail layer through guide filtering, histogram equalization and edge filtering denoising processing are performed, and then linear fusion is performed to form the image to be predicted. Then, the image is divided into macroblocks, gradient intra prediction and transformation quantization are performed, and finally entropy encoding is performed to obtain the compressed image.
This method can not only ensure image quality, but also reduce the amount of image data, improve the utilization rate of transmission bandwidth, and realize real-time transmission of infrared telemetry, and is suitable for special areas with high requirements for image quality.
Smart Images

Figure CN119520828A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image enhancement compression method, a transmission method and a corresponding device. Background Art
[0002] With the tremendous innovation of information technology, data storage and transmission have become increasingly important in human life. Data compression technology has emerged as the times require. It can not only reduce the space required for data storage but also relieve the pressure on transmission bandwidth. Data compression can be divided into lossy compression and lossless compression. Lossy compression technology can achieve a higher compression ratio, but it will lose some image information. It can be used in fields that do not require high image quality. However, in special fields such as medical images and aerospace images, the image compression algorithm is required to be lossless. In telemetry systems, the transmission bandwidth of telemetry generally does not exceed 10Mbps. When the amount of image data is large, it will occupy a large amount of bandwidth resources, affecting the telemetry system's inability to meet transmission performance.
[0003] Therefore, for scenes with large amounts of image data, high storage space occupancy, and the need to ensure image quality at the same time, a method for image compression transmission is needed that can ensure image quality while reducing the required storage space and bandwidth. Summary of the invention
[0004] The present invention provides an image enhancement compression method, a transmission method and a corresponding device, which can solve the problem of high storage space occupation in the related art. The technical solution is as follows:
[0005] In one aspect, a method for image enhancement compression is provided, the method comprising:
[0006] Perform guided filtering on the target image and decompose it into a base layer and a detail layer;
[0007] Performing histogram equalization processing on the base layer, and performing edge filtering denoising and detail enhancement processing on the detail layer;
[0008] Linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0009] Dividing the image to be predicted into macroblocks of a preset size;
[0010] Loading the macroblock, and performing gradient intra-frame prediction and transform quantization according to a scanning order and a prediction mode;
[0011] The transformed quantized coefficients are entropy encoded to obtain a compressed image.
[0012] Preferably, loading the macroblock and performing gradient intra-frame prediction and transform quantization according to the scanning order and the prediction mode comprises:
[0013] Performing gradient information judgment on each macroblock in the image to be predicted;
[0014] If the gradient information is greater than a preset change threshold, dividing the macroblock into a plurality of prediction units;
[0015] If the gradient information is less than or equal to a preset change threshold, the macroblock is used as a prediction unit;
[0016] Calculating the predicted pixel value of each prediction unit in the image to be predicted;
[0017] For each prediction unit, subtract the predicted pixel value from the original pixel value of the prediction unit to obtain a residual value, and perform discrete cosine transform on the residual value;
[0018] A gradient amplitude is determined for a prediction unit that has undergone discrete cosine transformation, a corresponding quantization parameter value is searched based on the gradient amplitude, and a transformation quantization calculation is performed using a multiplication coefficient and a shift based on the quantization parameter value.
[0019] Preferably, performing gradient amplitude judgment on the prediction unit after discrete cosine transformation, searching for a corresponding quantization parameter value according to the gradient amplitude, and performing transformation quantization calculation using a multiplication coefficient and a shift according to the quantization parameter value comprises:
[0020] Sum the residual values in each macroblock to obtain the gradient amplitude corresponding to the macroblock;
[0021] Determining whether the image to be predicted is complex according to the gradient amplitude;
[0022] If the judgment result is simple, the macroblock is used as a compression calculation unit;
[0023] If the judgment result is complex, the macroblock is divided into a plurality of compression calculation units;
[0024] Determine an energy value e of a frequency domain coefficient of a discrete cosine transform of a residual value of the compression calculation unit, and select a quantization parameter value QP according to the energy value e;
[0025] Encode the quantized residual value.
[0026] Preferably, after encoding the quantized residual value, the method further includes:
[0027] The residual value of the compression calculation unit is subjected to inverse discrete cosine transformation and inverse quantization, and is added to the predicted pixel value of the prediction unit to obtain a reconstructed pixel value for predicting the next frame of the image to be predicted.
[0028] On the other hand, a method for image enhancement compression transmission is provided, the method comprising:
[0029] Get image stream data;
[0030] Performing guided filtering on each frame of the image in the image data stream to decompose the image into a base layer and a detail layer;
[0031] Performing histogram equalization processing on the base layer, and performing edge filtering denoising and detail enhancement processing on the detail layer;
[0032] Linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0033] Alternately storing each frame of the image to be predicted in the image data stream into various memories;
[0034] Acquire the to-be-predicted images from various memories according to the storage order of the to-be-predicted images;
[0035] Dividing the acquired image to be predicted into macroblocks of a preset size;
[0036] Loading the macroblock, and performing gradient intra-frame prediction and transform quantization according to a scanning order and a prediction mode;
[0037] Performing entropy coding on the transformed quantized coefficients to obtain a compressed image;
[0038] Output the encoded code stream composed of the compressed images.
[0039] On the other hand, an image enhancement compression device is provided, comprising:
[0040] An image filtering module, configured to perform guided filtering on a target image, decomposed into a base layer and a detail layer;
[0041] An image processing module, configured to perform histogram equalization processing on the base layer, and perform edge filtering denoising and detail enhancement processing on the detail layer;
[0042] An image fusion module, configured to linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0043] An image segmentation module, configured to segment the image to be predicted into macroblocks of a preset size;
[0044] An intra-frame prediction module, configured to load the macroblock and perform gradient intra-frame prediction and transform quantization according to a scan order and a prediction mode;
[0045] The image compression module is configured to perform entropy coding on the transformed quantized coefficients to obtain a compressed image.
[0046] On the other hand, an image enhancement compression transmission device is provided, comprising:
[0047] A data acquisition unit, configured to acquire image stream data;
[0048] An image filtering unit, configured to perform guided filtering on each frame of the image in the image data stream, decomposing the image into a base layer and a detail layer;
[0049] An image processing unit, configured to perform histogram equalization processing on the base layer, and perform edge filtering denoising and detail enhancement processing on the detail layer;
[0050] An image fusion unit, configured to linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0051] An image storage unit, configured to alternately store each frame of the image to be predicted in the image data stream into various memories;
[0052] An image reading unit, configured to obtain the to-be-predicted images from various memories according to the storage order of the to-be-predicted images;
[0053] An image segmentation unit, configured to segment the acquired image to be predicted into macroblocks of a preset size;
[0054] an intra-frame prediction unit, configured to load the macroblock and perform gradient intra-frame prediction and transform quantization according to a scan order and a prediction mode;
[0055] An image compression unit is configured to perform entropy coding on the transformed quantized coefficients to obtain a compressed image;
[0056] The image sending unit is configured to output a coded code stream composed of the compressed images.
[0057] On the other hand, a computer device is provided, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of the method described above.
[0058] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0059] On the other hand, a computer program product is provided, comprising a computer program, wherein the computer program implements the steps of the above method when executed by a processor.
[0060] The technical solution provided by the present invention can at least bring the following beneficial effects:
[0061] The present invention dynamically adjusts and enhances the details of images through guided filtering, histogram equalization, local smoothing filtering and the like, and uses intra-frame coding to compress images, which can not only ensure image quality, but also reduce the data volume of dynamic infrared images, improve the utilization rate of transmission bandwidth, and realize real-time transmission of infrared telemetry. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0063] Figure 1 is a flow chart of an image enhancement compression method provided by an embodiment of the present invention;
[0064] Figure 2 is a schematic diagram of a prediction mode according to an embodiment of the present invention;
[0065] Figure 3 This is a flow chart of an image enhancement compression transmission method provided by an embodiment of the present invention;
[0066] Figure 4 is a schematic diagram of a prediction mode according to an embodiment of the present invention;
[0067] Figure 5 is a structural diagram of an image enhancement and compression device provided by an embodiment of the present invention;
[0068] Figure 6 It is a structural diagram of an image enhancement compression transmission device provided by an embodiment of the present invention;
[0069] Figure 7 It is a hardware architecture diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0071] As described above, the embodiment of the present invention uses guided filtering to decompose the image into a base layer and a detail layer, performs histogram projection on the base layer to adjust the dynamic range, performs edge-preserving filtering denoising and detail enhancement on the detail layer, and then performs linear fusion on the base layer and the detail layer. Use DMA (Data Memory Access, direct memory access) ping-pong operation to cache multiple frames of images into storage space.
[0072] Data is read according to the DMA address, loaded in macroblocks, and gradient intra-frame prediction and transform quantization are performed. Finally, entropy coding is performed and the coded bit stream is output.
[0073] The specific implementation of the above concept is described below.
[0074] Please refer to Figure 1 , an embodiment of the present invention provides an image enhancement compression method, the method comprising:
[0075] Step 110, performing guided filtering on the target image and decomposing it into a base layer and a detail layer;
[0076] Step 120, performing histogram equalization processing on the base layer, and performing edge filtering denoising and detail enhancement processing on the detail layer;
[0077] Step 130, linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0078] Step 140, dividing the image to be predicted into macroblocks of a preset size;
[0079] Step 150, loading the macroblock, and performing gradient intra-frame prediction and transform quantization according to the scanning order and prediction mode;
[0080] Step 160: Perform entropy coding on the transformed quantized coefficients to obtain a compressed image.
[0081] In the embodiment of the present invention, guided filtering histogram equalization and local smoothing filtering are used to dynamically adjust and enhance the details of the image to ensure image quality. Intra-frame coding is used for image compression, which effectively reduces the amount of image data. The compression performance and transmission efficiency are improved, the telemetry bandwidth occupancy is reduced, and the utilization rate of the telemetry bandwidth is improved. The real-time transmission of telemetry images is achieved, which is suitable for application scenarios that require real-time transmission of images.
[0082] Described below Figure 1 How the various steps are performed.
[0083] First, for step 110, the image is decomposed into a base layer and a detail layer using guided filtering, where the detail layer is the difference between the input target image and the base layer, and contains all the contrast details of the target image. Taking a 14-bit infrared radiation image as an example, after guided filtering, the high and low 8 bits are decomposed, where the low 8 bits are the base layer and the high 8 bits are the detail layer.
[0084] Then, for step 120, the base layer is subjected to histogram equalization, the dynamic range is adjusted by histogram projection, and the detail layer is subjected to edge-preserving filtering denoising and detail enhancement.
[0085] Next, for step 130, the base layer after histogram equalization and the detail layer after edge filtering are linearly fused. Still taking the 14-bit infrared radiation image as an example, the image to be predicted after linear fusion is an 8-bit image.
[0086] Next, for step 150, loading the macroblock and performing gradient intra-frame prediction and transform quantization according to the scanning order and prediction mode includes:
[0087] S151, performing gradient information determination on each macroblock in the image to be predicted;
[0088] S152, if the gradient information is greater than a preset change threshold, dividing the macroblock into a plurality of prediction units;
[0089] S153, if the gradient information is less than or equal to a preset change threshold, taking the macroblock as a prediction unit;
[0090] S154, calculating the predicted pixel value of each prediction unit in the image to be predicted;
[0091] S155: for each prediction unit, subtract the predicted pixel value from the original pixel value of the prediction unit to obtain a residual value, and perform discrete cosine transform on the residual value;
[0092] S156, performing gradient amplitude judgment on the prediction unit after discrete cosine transformation, searching for a corresponding quantization parameter value according to the gradient amplitude, and performing transformation quantization calculation using a multiplication coefficient and a shift according to the quantization parameter value.
[0093] Further, in the embodiment of the present invention, step S156 performs gradient amplitude judgment on the prediction unit after discrete cosine transformation, searches for the corresponding quantization parameter value according to the gradient amplitude, and performs transformation quantization calculation using multiplication coefficient and shift according to the quantization parameter value, including:
[0094] Sum the residual values in each macroblock to obtain the gradient amplitude corresponding to the macroblock;
[0095] Determining whether the image to be predicted is complex according to the gradient amplitude;
[0096] If the judgment result is simple, the macroblock is used as a compression calculation unit;
[0097] If the judgment result is complex, the macroblock is divided into a plurality of compression calculation units;
[0098] Determine an energy value e of a frequency domain coefficient of a discrete cosine transform of a residual value of the compression calculation unit, and select a quantization parameter value QP according to the energy value e;
[0099] Encode the quantized residual value.
[0100] In the embodiment of the present invention, after encoding the quantized residual value, the method further includes:
[0101] The residual value of the compression calculation unit is subjected to inverse discrete cosine transformation and inverse quantization, and is added to the predicted pixel value of the prediction unit to obtain a reconstructed pixel value for predicting the next frame of the image to be predicted.
[0102] In the embodiment of the present invention, the image to be predicted is divided into 16x16 macroblocks, and the macroblocks can be further divided into 16 4x4 data blocks. Data is loaded in 16x16 macroblocks, and gradient intra-frame prediction and transform quantization are performed. According to the scanning order and prediction mode, the predicted pixel value of the current block is calculated, and the original pixel value is subtracted from the predicted value to obtain the residual value. DCT (Discrete Cosine Transform) is performed on the residual value, and a lookup table is established according to the quantization parameter QP value, and multiplication and shift are used to implement quantization calculation.
[0103] In intra-frame prediction, the key to determining the best prediction mode is to find the direction with the smallest pixel change in the image macroblock. Since the pixel values at the edge of the object are relatively close, the direction of the best prediction mode can be inferred by analyzing the texture flow direction of the object in the image. Since the gradient direction of the image represents the direction with the largest pixel change, and this direction is perpendicular to the texture direction, the problem of determining the best prediction mode in the image can be transformed into the problem of solving the image gradient. In short, by analyzing the gradient direction of the image, the direction with the smallest pixel change can be effectively identified, and then the optimal intra-frame prediction mode can be determined.
[0104] 1. Gradient calculation
[0105] X direction
[0106]
[0107] Y direction
[0108]
[0109] Among them, P is the pixel matrix of the image, G X is the gradient in the X direction, D X is the Sobel operator in the X direction, G Y is the gradient in the Y direction, D Y is the Sobel operator in the X direction.
[0110] The quadrant in which the gradient direction is located is determined according to the positive and negative values of the gradient values in the horizontal and vertical directions. The ratio of the vertical gradient Gy to the horizontal gradient Gx is compared with the tangent value of the prediction mode angle distribution of the 4*4 data block (the gradient direction is perpendicular to the optimal direction), the range of the gradient direction is estimated, and the possible candidate prediction modes are reduced.
[0111] The data size is 4*4, and there are 9 prediction modes for 4*4, such as Figure 2 shown.
[0112] The number of prediction modes is reduced according to the characteristic that the gradient direction is perpendicular to the optimal prediction mode, and the optimal mode is determined among the candidate prediction modes.
[0113] Therefore, in the embodiment of the present invention, the gradient information of the 16*16 macroblock is first judged. If it is greater than the set change threshold, a gradient 4*4 prediction is performed; if it is less than the change threshold, a gradient 16*16 prediction is performed.
[0114] If the optimal prediction mode cannot be determined based on the gradient information during 4*4 prediction, the traversal mode is performed to select the optimal prediction mode, and the predicted pixel value is calculated according to the optimal mode. The predicted pixel value is subtracted from the original pixel value to obtain the residual value.
[0115] 2. Transform Quantization
[0116] The expression of DCT transform is:
[0117] Y=(AXA T )·C
[0118] in:
[0119] Among them, Y is the coefficient after DCT transformation, A is the DCT transformation matrix, C is the adjustment coefficient matrix of DCT transformation, X is the residual value coefficient, and a and b are parameters of the two-dimensional butterfly algorithm.
[0120]
[0121]
[0122] The quantization process reduces the coding length as much as possible while ensuring the image display effect. The general principle of quantization is to divide the frequency domain coefficient by a parameter and then round it off to get an integer value.
[0123] Quantitative calculation formula:
[0124]
[0125] F is the quantized value, QP quantization parameter value, that is, the quantization step size, and round means rounding to an integer.
[0126] According to the energy value e of the frequency domain coefficient after DCT transformation, the quantization parameter value QP is dynamically adjusted and selected, and then the quantization parameter is selected.
[0127] e=∑∑α ij *|f| 2
[0128]
[0129] Among them, a i j is the weight function, and f is the frequency domain coefficient of the image after DCT transformation.
[0130] Optimize the quantitative process:
[0131] If the energy value e of the 4*4 data block is greater than 200, it is determined to be a complex block, and 5 is added to the basic QP value.
[0132] If the energy value e of the 4*4 data block is greater than 150, it is determined to be a relatively complex block, and 3 is added to the basic QP value.
[0133] If the energy value e of the 4*4 data block is greater than 50, it is judged as a normal block, and 1 is added to the basic QP value.
[0134] If the energy value e of the 4*4 data block is less than 50, it is judged as a simple block, and 1 is subtracted from the basic QP value.
[0135] The gradient amplitude is the sum of the residual values. In the embodiment of the present invention, whether the picture change is complex is determined according to the gradient amplitude.
[0136] The image is divided into 16*16 macroblocks, and the gradient amplitude is judged first. If it is judged to be simple, the 16*16 macroblock is used for compression calculation (the optimization mode selection is not used at this time). If it is judged to be complex, the 4*4 macroblock is used for calculation.
[0137] Perform gradient prediction on the 4*4 macroblock, select the optimal prediction mode according to the gradient direction, predict according to the optimal mode, obtain the predicted pixel, and subtract the predicted pixel value from the current pixel value to obtain the residual value.
[0138] The residual value is transformed by DCT, and a quantization parameter QP value is selected according to the energy value e of the frequency domain coefficient of the residual value DCT transform, and the quantized residual value is encoded.
[0139] The residual value is subjected to inverse DCT transformation and inverse quantization, and is added to the predicted value to obtain the reconstructed pixel value used as the image predicted for the next frame.
[0140] Please refer to Figure 3 The embodiment of the present invention provides an image enhancement compression transmission method, the method comprising:
[0141] Step 210, obtaining image stream data;
[0142] Step 220, performing guided filtering on each frame of the image in the image data stream, and decomposing the image into a base layer and a detail layer;
[0143] Step 230, performing histogram equalization processing on the base layer, and performing edge filtering denoising and detail enhancement processing on the detail layer;
[0144] Step 240, linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0145] Step 250, alternately storing each frame of the image to be predicted in the image data stream into various memories;
[0146] Step 260, acquiring the to-be-predicted images from various memories according to the storage order of the to-be-predicted images;
[0147] Step 270, dividing the acquired image to be predicted into macroblocks of a preset size;
[0148] Step 280, loading the macroblock, and performing gradient intra-frame prediction and transform quantization according to the scanning order and prediction mode;
[0149] Step 290, performing entropy coding on the transformed quantized coefficients to obtain a compressed image;
[0150] Step 300: output the encoded bitstream composed of the compressed images.
[0151] In the embodiment of the present invention, for video coding, intra-frame prediction is to predict the pixels of the current block through spatial adjacent pixels. In traditional coding, intra-frame prediction technologies include angle mode, DC mode, Planar mode, and the like.
[0152] With respect to step 250, a DMA ping-pong operation is used to cache multiple frames of images to be predicted to corresponding storage spaces; in some embodiments of the present application, a method of alternately storing the images to be predicted in the image data stream to respective memories may include:
[0153] Distribute the images to be predicted in the image data stream to various memories in sequence, or,
[0154] The consecutive K frames of images to be predicted are distributed alternately to the respective memories, and the K frames of images to be predicted corresponding to each memory are queued to perform subsequent operations, 2≤K.
[0155] In the embodiment of the present invention, let N be the number of images to be predicted in the image data stream, N>2, for the first distribution method (distributing the images to be predicted in the image data stream to each memory in sequence), firstly distribute a frame of images to be predicted to each memory in the order of the image data stream, when the first frame of images to be predicted is read and the subsequent operation process is executed, the memory corresponding to the first frame of images to be predicted is released, and a new frame of images to be predicted is distributed to the first memory, and this process is repeated to distribute the images to be predicted in the N frames of image data stream to each vector decomposition register in sequence.
[0156] In the embodiment of the present invention, for the second distribution method (alternatingly distributing the continuous K frames of images to be predicted to each memory, and the K frames of images to be predicted corresponding to each memory are queued to perform subsequent operations), the continuous K frames of images to be predicted are first distributed to the first memory, and the next continuous K frames of images to be predicted are distributed to the second memory. If there are more than 3 memories, the K frames of images to be predicted are continuously distributed to the subsequent memories according to the above rules, and are queued in time order, that is, after the first frame of images to be predicted is read, the remaining K-1 frames of images to be predicted are queued and wait until the continuous K frames of images to be predicted are read. At this time, the first memory is released, and the next K frames of images to be predicted are read from the second memory, and the new continuous K frames of images to be predicted are distributed to the first memory accordingly. If there are more than 3 memories, the next K frames of images to be predicted are read from the third memory. At this time, the second memory is released, and the new continuous K frames of images to be predicted are distributed to the second memory accordingly. This process is repeated to distribute the continuous K frames of images to be predicted to each memory. Wherein, K can be 2.
[0157] like Figure 4 , RAM1 and RAM2 form a ping-pong operation. At the beginning, RAM1 and RAM2 each cache a frame of the image to be predicted. After RAM1 is read empty, RAM2 is read while writing to RAM1; when RAM1 is read, RAM2 is written.
[0158] For step 300, the compressed coded code stream is sent according to the protocol, so that the receiving end can perform entropy decoding, inverse quantization, IDCT transformation, residual reconstruction, frame reconstruction, filtering and synchronization timing according to the protocol to restore the transmitted image.
[0159] The image enhancement compression method and the image enhancement compression transmission method of the embodiments of the present invention improve the compression performance and transmission efficiency while ensuring the image quality through guided filtering, dynamic adjustment of histogram, edge filtering detail enhancement, intra-frame prediction, transform quantization, entropy coding and other operations, reduce the occupancy of telemetry bandwidth, and ensure the real-time and stability during the transmission process.
[0160] Please refer to Figure 5 , an image enhancement compression device provided by an embodiment of the present invention comprises:
[0161] An image filtering module, configured to perform guided filtering on a target image, decomposed into a base layer and a detail layer;
[0162] An image processing module, configured to perform histogram equalization processing on the base layer, and perform edge filtering denoising and detail enhancement processing on the detail layer;
[0163] An image fusion module, configured to linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0164] An image segmentation module, configured to segment the image to be predicted into macroblocks of a preset size;
[0165] An intra-frame prediction module, configured to load the macroblock and perform gradient intra-frame prediction and transform quantization according to a scan order and a prediction mode;
[0166] The image compression module is configured to perform entropy coding on the transformed quantized coefficients to obtain a compressed image.
[0167] Please refer to Figure 6 , an image enhancement compression transmission device provided by an embodiment of the present invention comprises:
[0168] A data acquisition unit, configured to acquire image stream data;
[0169] An image filtering unit, configured to perform guided filtering on each frame of the image in the image data stream, decomposing the image into a base layer and a detail layer;
[0170] An image processing unit, configured to perform histogram equalization processing on the base layer, and perform edge filtering denoising and detail enhancement processing on the detail layer;
[0171] An image fusion unit, configured to linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted;
[0172] An image storage unit, configured to alternately store each frame of the image to be predicted in the image data stream into various memories;
[0173] An image reading unit, configured to obtain the to-be-predicted images from various memories according to the storage order of the to-be-predicted images;
[0174] An image segmentation unit, configured to segment the acquired image to be predicted into macroblocks of a preset size;
[0175] an intra-frame prediction unit, configured to load the macroblock and perform gradient intra-frame prediction and transform quantization according to a scan order and a prediction mode;
[0176] An image compression unit is configured to perform entropy coding on the transformed quantized coefficients to obtain a compressed image;
[0177] The image sending unit is configured to output a coded code stream composed of the compressed images.
[0178] It should be noted that the image enhancement compression device and the image enhancement compression transmission device provided in the above embodiments are only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the image enhancement compression transmission device and the image enhancement compression transmission method embodiment provided in the above embodiments belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0179] The embodiment of the present application also provides a computer device, please refer to Figure 7 The computer device includes a processor and a memory, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the image enhancement compression method or image enhancement compression transmission method provided by the above-mentioned method embodiments.
[0180] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the image enhancement compression method or image enhancement compression transmission method provided in the above-mentioned method embodiments.
[0181] An embodiment of the present application also provides a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the image enhancement compression method or image enhancement compression transmission method described in any of the above embodiments.
[0182] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0183] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0184] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0185] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image enhancement compression method, characterized in that: The method comprises: Perform guided filtering on the target image and decompose it into a base layer and a detail layer; Performing histogram equalization processing on the base layer, and performing edge filtering denoising and detail enhancement processing on the detail layer; Linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted; Dividing the image to be predicted into macroblocks of a preset size; Loading the macroblock, and performing gradient intra-frame prediction and transform quantization according to a scanning order and a prediction mode; The transformed quantized coefficients are entropy encoded to obtain a compressed image.
2. The method according to claim 1, characterized in that Loading the macroblock and performing gradient intra-frame prediction and transform quantization according to the scanning order and prediction mode includes: Performing gradient information judgment on each macroblock in the image to be predicted; If the gradient information is greater than a preset change threshold, dividing the macroblock into a plurality of prediction units; If the gradient information is less than or equal to a preset change threshold, the macroblock is used as a prediction unit; Calculating the predicted pixel value of each prediction unit in the image to be predicted; For each prediction unit, subtract the predicted pixel value from the original pixel value of the prediction unit to obtain a residual value, and perform discrete cosine transform on the residual value; A gradient amplitude is determined for a prediction unit that has undergone discrete cosine transformation, a corresponding quantization parameter value is searched based on the gradient amplitude, and a transformation quantization calculation is performed using a multiplication coefficient and a shift based on the quantization parameter value.
3. The method according to claim 2, characterized in that Performing gradient amplitude judgment on the prediction unit after discrete cosine transformation, searching for the corresponding quantization parameter value according to the gradient amplitude, and performing transformation quantization calculation using multiplication coefficient and shift according to the quantization parameter value includes: Sum the residual values in each macroblock to obtain the gradient amplitude corresponding to the macroblock; Determining whether the image to be predicted is complex according to the gradient amplitude; If the judgment result is simple, the macroblock is used as a compression calculation unit; If the judgment result is complex, the macroblock is divided into a plurality of compression calculation units; Determine an energy value e of a frequency domain coefficient of a discrete cosine transform of a residual value of the compression calculation unit, and select a quantization parameter value QP according to the energy value e; Encode the quantized residual value.
4. The method according to claim 3, characterized in that After encoding the quantized residual value, it also includes: The residual value of the compression calculation unit is subjected to inverse discrete cosine transformation and inverse quantization, and is added to the predicted pixel value of the prediction unit to obtain a reconstructed pixel value for predicting the next frame of the image to be predicted.
5. An image enhancement compression transmission method, characterized in that: The method comprises: Get image stream data; Performing guided filtering on each frame of the image in the image data stream to decompose the image into a base layer and a detail layer; Performing histogram equalization processing on the base layer, and performing edge filtering denoising and detail enhancement processing on the detail layer; Linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted; Alternately storing each frame of the image to be predicted in the image data stream into various memories; Acquire the to-be-predicted images from various memories according to the storage order of the to-be-predicted images; Dividing the acquired image to be predicted into macroblocks of a preset size; Loading the macroblock, and performing gradient intra-frame prediction and transform quantization according to a scanning order and a prediction mode; Performing entropy coding on the transformed quantized coefficients to obtain a compressed image; Output the encoded code stream composed of the compressed images.
6. An image enhancement compression device, characterized in that: include: An image filtering module, configured to perform guided filtering on a target image, decomposed into a base layer and a detail layer; An image processing module, configured to perform histogram equalization processing on the base layer, and perform edge filtering denoising and detail enhancement processing on the detail layer; An image fusion module, configured to linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted; An image segmentation module, configured to segment the image to be predicted into macroblocks of a preset size; An intra-frame prediction module, configured to load the macroblock and perform gradient intra-frame prediction and transform quantization according to a scan order and a prediction mode; The image compression module is configured to perform entropy coding on the transformed quantized coefficients to obtain a compressed image.
7. An image enhancement compression transmission device, characterized in that: include: A data acquisition unit, configured to acquire image stream data; An image filtering unit, configured to perform guided filtering on each frame of the image in the image data stream, decomposing the image into a base layer and a detail layer; An image processing unit, configured to perform histogram equalization processing on the base layer, and perform edge filtering denoising and detail enhancement processing on the detail layer; An image fusion unit, configured to linearly fuse the processed base layer and the processed detail layer to obtain an image to be predicted; An image storage unit, configured to alternately store each frame of the image to be predicted in the image data stream into various memories; An image reading unit, configured to obtain the to-be-predicted images from various memories according to the storage order of the to-be-predicted images; An image segmentation unit, configured to segment the acquired image to be predicted into macroblocks of a preset size; an intra-frame prediction unit, configured to load the macroblock and perform gradient intra-frame prediction and transform quantization according to a scan order and a prediction mode; An image compression unit is configured to perform entropy coding on the transformed quantized coefficients to obtain a compressed image; The image sending unit is configured to output a coded code stream composed of the compressed images.
8. A computer device, characterized in that: The computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of any one of the methods described in claims 1-5.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.
10. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 5.