CN112887726B - Image processing method and apparatus, storage medium, and electronic device - Google Patents

Image processing method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
CN112887726B
CN112887726B CN202110283100.XA CN202110283100A CN112887726B CN 112887726 B CN112887726 B CN 112887726B CN 202110283100 A CN202110283100 A CN 202110283100A CN 112887726 B CN112887726 B CN 112887726B
Authority
CN
China
Prior art keywords
windowed
macro blocks
overlapped
data
macro
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
CN202110283100.XA
Other languages
Chinese (zh)
Other versions
CN112887726A (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.)
Xian Wanxiang Electronics Technology Co Ltd
Original Assignee
Xian Wanxiang Electronics Technology 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 Xian Wanxiang Electronics Technology Co Ltd filed Critical Xian Wanxiang Electronics Technology Co Ltd
Priority to CN202110283100.XA priority Critical patent/CN112887726B/en
Publication of CN112887726A publication Critical patent/CN112887726A/en
Application granted granted Critical
Publication of CN112887726B publication Critical patent/CN112887726B/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/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/176Methods 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 block, e.g. a macroblock
    • 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)
  • Image Processing (AREA)

Abstract

The invention discloses an image processing method and device, a storage medium and electronic equipment. Wherein, the method comprises the following steps: overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; respectively carrying out convergence processing on the multiple macro blocks through a weighting function to obtain multiple windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block; obtaining a plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing, and obtaining decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing; and acquiring non-zero data in the decompressed overlapped windowing macro blocks, and replacing the data at the same position in the plurality of decompressed windowing macro blocks corresponding to the non-zero data with the non-zero data. The invention solves the technical problem of poor image decompression and restoration quality caused by frequency spectrum leakage when Discrete Cosine Transform (DCT) is carried out due to discontinuity among macro blocks.

Description

Image processing method and apparatus, storage medium, and electronic device
Technical Field
The present invention relates to the field of image processing, and in particular, to an image processing method and apparatus, a storage medium, and an electronic device.
Background
In the process of image data transmission, most image compression algorithms in the related art divide an image frame into macro blocks and then perform compression processing. However, when the image is processed by blocks, the discontinuity between macro blocks causes spectrum leakage when Discrete Cosine Transform (DCT) is performed, thereby affecting the result of frequency domain analysis and processing, and finally affecting the quality of reconstructed pictures, that is, the quality of decompressed pictures after compression is poor.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an image processing method and device, a storage medium and electronic equipment, which at least solve the technical problem of poor image decompression and restoration quality caused by frequency spectrum leakage when Discrete Cosine Transform (DCT) is carried out due to discontinuity among macro blocks.
According to an aspect of an embodiment of the present invention, there is provided an image processing method including: overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; wherein the overlapped macroblock comprises data information of the overlapped part of the plurality of macroblocks; respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block; obtaining a plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing, and decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing; and acquiring nonzero data in the decompressed overlapped windowing macro block, and replacing data at the same position in a plurality of decompressed windowing macro blocks corresponding to the nonzero data with the nonzero data.
According to another aspect of the embodiments of the present invention, there is also provided an image processing apparatus including: the overlapping unit is used for overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; wherein the overlapped macroblock comprises data information of the overlapped part of the plurality of macroblocks; a weighting unit, configured to perform convergence processing on the multiple macroblocks through a weighting function to obtain multiple windowed macroblocks, and perform convergence processing on the overlapped macroblocks through the weighting function to obtain at least one overlapped windowed macroblock; the acquisition unit is used for acquiring a plurality of decompressed windowed macro blocks obtained after the weight reduction processing is carried out on the plurality of windowed macro blocks and acquiring decompressed overlapped windowed macro blocks obtained after the weight reduction processing is carried out on the overlapped windowed macro blocks; and the replacing unit is used for acquiring nonzero data in the decompressed overlapped windowing macro block and replacing data at the same position in a plurality of decompressed windowing macro blocks corresponding to the nonzero data with the nonzero data.
According to a further aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned image processing method when running.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the image processing method described above by the computer program.
In the embodiment of the invention, a plurality of macro blocks in an image to be compressed are overlapped to obtain at least one overlapped macro block; wherein the overlapped macroblock comprises data information of the overlapped part of the plurality of macroblocks; respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block; obtaining a plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing, and decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing; the non-zero data in the decompressed overlapped windowed macro blocks are obtained, the data at the same position in the decompressed windowed macro blocks corresponding to the non-zero data is replaced by the non-zero data, the macro blocks in the image are overlapped, and the data at the same position in the decompressed windowed macro blocks corresponding to the non-zero data is replaced by the non-zero data, so that the aim of improving the picture reconstruction quality after image compression is fulfilled, the technical effect of effectively avoiding the phenomenon of poor reconstructed image quality caused by inaccurate frequency domain parameters is realized, and the technical problem of poor image decompression and reduction quality caused by frequency spectrum leakage when discrete cosine change DCT (discrete cosine transform) is carried out due to discontinuity among the macro blocks is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention and do not constitute a limitation of the invention. In the drawings:
FIG. 1 is a schematic diagram of an application environment of an alternative image processing method according to an embodiment of the invention;
FIG. 2 is a flow diagram of an alternative image processing method according to an embodiment of the invention;
FIG. 3 is a flow diagram of another alternative image processing method according to an embodiment of the invention;
FIG. 4 is a diagram of image macroblocks for an alternative image processing method according to an embodiment of the present invention;
FIG. 5 is a diagram of image macroblocks for an alternative image processing method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a Hanning window shape for an alternative image processing method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an alternative image processing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, there is provided an image processing method, which may be applied, but not limited, to the environment shown in fig. 1 as an optional implementation manner.
The application environment comprises: a terminal device 104 for man-machine interaction with a user, a network 112 and a server 114. The user 102 and the terminal device 104 can perform human-computer interaction, and an image processing application client runs in the terminal device 104. The terminal device 104 includes a display 110, a processor 108, and a memory 106. The display 110 is used to present an image to be compressed and a plurality of macroblocks in the image to be compressed. The processor 108 is configured to perform overlapping processing on a plurality of macroblocks in an image to be compressed, so as to obtain at least one overlapped macroblock. The memory 106 is used for storing an image to be compressed and a plurality of macroblocks in the image to be compressed. In addition, the server 114 includes a database 116 for storing decompressed windowed macroblocks and decompressed and overlapped windowed macroblocks, and a processing engine 118. The processing engine 118 is configured to obtain non-zero data in the decompressed overlap-windowed macroblock, and replace data at the same position in a plurality of decompressed window macroblocks corresponding to the non-zero data with the non-zero data.
Optionally, in this embodiment, the terminal device 104 may be a terminal device configured with a target client, and may include but is not limited to at least one of the following: mobile phones (such as Android Mobile phones, iOS Mobile phones, etc.), notebook computers, tablet computers, palm computers, MID (Mobile Internet Devices), PAD, desktop computers, smart televisions, etc. The target client may be a video client, an instant messaging client, a browser client, an educational client, and the like. The network 112 may include, but is not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication. The server 114 may be a single server, a server cluster composed of a plurality of servers, or a cloud server. The above is merely an example, and this is not limited in this embodiment.
Optionally, as an optional implementation, as shown in fig. 2, the image processing method includes:
s202, overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; wherein, the overlapped macroblock comprises the data information of the overlapped part of the macroblocks;
s204, respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block;
s206, obtaining a plurality of decompressed windowed macro blocks obtained after the weighted down processing is carried out on the plurality of windowed macro blocks, and obtaining decompressed overlapped windowed macro blocks obtained after the weighted down processing is carried out on the overlapped windowed macro blocks;
and S208, acquiring nonzero data in the decompressed overlapped windowing macro block, and replacing data at the same position in a plurality of decompressed windowing macro blocks corresponding to the nonzero data with the nonzero data.
In step S202, in actual application, the format of the picture to be compressed may be multiple forms of data such as JPG or tif. The picture may include a plurality of discontinuous macroblock data, and the macroblock data may include pixels or color values of the image, and the like, which is not limited herein.
In step S204, the weighting function may be a window function for processing the image, such as a hanning window function, a blackman window function, and a jeans window function, which are not limited herein. By the windowing function, the macro block data of the image can be normalized, and frequency spectrum leakage is avoided.
In step S206, during actual application, the edge data of the decompressed windowed macroblock and decompressed and overlapped windowed macroblock is generally zero after windowing, and therefore, the reconstruction quality of the image is affected. But the decompression overlap window macro block contains the intermediate data in the original macro block in the image to be compressed, which can make up for the data loss generated in the data coding window process.
In step S208, during actual application, non-edge data, i.e., non-zero data, in the decompressed windowed macroblock is used to fill the non-zero data in the corresponding position of the original macroblock, so as to restore zero data in the middle of the image macroblock, thereby improving the quality of image compression and restoration.
In the embodiment of the invention, a plurality of macro blocks in an image to be compressed are overlapped to obtain at least one overlapped macro block; wherein the overlapped macroblock comprises data information of the overlapped part of the plurality of macroblocks; respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block; obtaining a plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing, and decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing; the non-zero data in the decompressed overlapped windowed macro blocks are obtained, the data at the same position in the decompressed windowed macro blocks corresponding to the non-zero data is replaced by the non-zero data, the macro blocks in the image are overlapped, and the data at the same position in the decompressed windowed macro blocks corresponding to the non-zero data is replaced by the non-zero data, so that the aim of improving the picture reconstruction quality after image compression is fulfilled, the technical effect of effectively avoiding the phenomenon of poor reconstructed image quality caused by inaccurate frequency domain parameters is realized, and the technical problem of poor image decompression and reduction quality caused by frequency spectrum leakage when discrete cosine change DCT (discrete cosine transform) is carried out due to discontinuity among the macro blocks is solved.
In one embodiment, step S202 includes: and overlapping the first macro block and the second macro block in the image to be compressed, and combining the data in the overlapping part of the first macro block and the data in the overlapping part of the second macro block to obtain an overlapping macro block.
In one embodiment, step S202 further includes: when the image to be compressed further includes a plurality of third macroblocks respectively adjacent to the first macroblock and the second macroblock, the third macroblocks are respectively overlapped with the first macroblock and the second macroblock to obtain a plurality of overlapped macroblocks.
In one embodiment, step S208 includes: acquiring non-zero data in the decompressed overlapped windowed macro block as supplementary data; determining the corresponding target positions of the supplementary data in the plurality of decompressed windowed macro blocks; and replacing the data at the target position in the plurality of decompressed windowed macroblocks with the supplemental data.
In one embodiment, step S206 is preceded by: and carrying out inverse quantization decoding on the plurality of windowed macro blocks and at least one overlapped windowed macro block which are subjected to Discrete Cosine Transform (DCT) quantization coding through Inverse Discrete Cosine Transform (IDCT). In the embodiment of the present invention, that is, the DCT quantization-coded multiple windowed macroblocks and the DCT quantization-coded at least one overlapped windowed macroblock are inversely quantized and decoded by an Inverse Discrete Cosine Transform (IDCT).
In an embodiment, the weighting function comprises at least one of: hanning window function, blackman window function, and gaussian window function.
It should be noted that for simplicity of description, the above-mentioned method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art will appreciate that the embodiments described in this specification are presently preferred and that no acts or modules are required by the invention.
Based on the foregoing embodiments, in an application embodiment, as shown in fig. 3, the image processing method includes: step S302, overlapping a plurality of macroblocks of an image to be processed to obtain overlapped macroblocks, step S304, weighting the macroblocks by a window function, step S306, performing DCT coding on each weighted macroblock, step S308, performing IDCT inverse quantization decoding, step S310, recovering the overlapped macroblocks, and step S312, de-overlapping the overlapped macroblocks to obtain weighted macroblock data. In step S314, the weighted macroblock data is reduced by the weighting function, and in step S316, the original image macroblock is restored.
In the embodiment of the invention, a plurality of macro blocks in an image to be compressed are overlapped to obtain at least one overlapped macro block; wherein the overlapped macroblock comprises data information of the overlapped part of the plurality of macroblocks; respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block; obtaining a plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing, and decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing; the non-zero data in the decompressed overlapped windowed macro blocks are obtained, the data at the same position in the decompressed windowed macro blocks corresponding to the non-zero data is replaced by the non-zero data, the macro blocks in the image are overlapped, and the data at the same position in the decompressed windowed macro blocks corresponding to the non-zero data is replaced by the non-zero data, so that the aim of improving the picture reconstruction quality after image compression is fulfilled, the technical effect of effectively avoiding the phenomenon of poor reconstructed image quality caused by inaccurate frequency domain parameters is realized, and the technical problem of poor image decompression and reduction quality caused by frequency spectrum leakage when discrete cosine change DCT (discrete cosine transform) is carried out due to discontinuity among the macro blocks is solved.
In an application embodiment, as shown in fig. 4, the image to be processed in fig. 4 includes an X macro block 402 and a Y macro block 404, for the 8 × 8 macro blocks of the 2 adjacent JPEG, firstly, the DCT transformation is performed on X11 to X18, X21 to X28.. Times X81 to X88, respectively, at this time, X11 to X18, X21 to X28.. Times X81 to X88 do not converge generally, and the principle of the discrete cosine transformation is that the signal is infinite in the time domain, so the spectrum leakage phenomenon may be caused by the truncation, at this time, a converged window coefficient may be multiplied by the signals X11 to X18, X21 to X28.. Times X81 to X88, and the window coefficient may adopt a hanning window, a brakmann window, and the like which are commonly used. Thus, the phenomenon of spectrum leakage can be avoided. However, when the data at the edge part is 0 during the windowing, some signals cannot be observed in a frequency domain, and overlapping can be added, so that the data before DCT is overlapped by 50%, and the influence caused by the windowing can be solved. Windowed overlap can be used to account for spectral leakage due to chunking.
The overlapping process comprises the following steps: two adjacent macroblocks of the X macroblock 402 and the Y macroblock 404 are added with a new macroblock between the X macroblock 402 and the Y macroblock 404, as shown in fig. 5, a Z overlapped macroblock 502 is added.
Then, when the DCT is performed on the rows and columns of the X macro block 402, the Y macro block 404 and the Z overlapped macro block 502, the data is respectively multiplied by a window function, so that the frequency spectrum leakage can be avoided when the image is analyzed in a frequency domain, and the recovery of the image is an inverse transformation process.
Alternatively, the window function may select a hanning window, which is formulated as follows:
Figure BDA0002979350560000091
wherein M is the total number of sampling points of the image to be processed, and n is a specific single sampling point.
Fig. 6 shows an image of the hanning window function, which has a hanning window shape of 1024 points in fig. 6, and in the hanning window image, data values corresponding to the vicinity of an edge data point 0 and 1024 points are zero. In fig. 6, the horizontal axis represents the sampling points and the vertical axis represents the normalized intensity of the different sampling points.
According to the invention, before DCT is carried out on the image macro block, overlapping windowing processing is carried out on the image data, and then windowing and overlap removing processing are carried out on the data after IDCT is finished, so that the phenomenon of poor quality of a reconstructed image caused by inaccurate frequency domain parameters can be effectively avoided.
According to another aspect of the embodiments of the present invention, there is also provided an image processing apparatus for implementing the above-described image processing method. As shown in fig. 7, the apparatus includes:
an overlapping unit 702, configured to perform overlapping processing on multiple macroblocks in an image to be compressed to obtain at least one overlapping macroblock; wherein the overlapping macroblocks include data information of overlapping portions of the plurality of macroblocks;
a weighting unit 704, configured to perform convergence processing on the multiple macroblocks through a weighting function to obtain multiple windowed macroblocks, and perform convergence processing on the overlapped macroblocks through the weighting function to obtain at least one overlapped windowed macroblock;
an obtaining unit 706, configured to obtain multiple decompressed windowed macroblocks obtained after performing weight reduction on the multiple windowed macroblocks, and obtain decompressed overlapped windowed macroblocks obtained after performing weight reduction on the overlapped windowed macroblocks;
a replacing unit 708, configured to obtain non-zero data in the decompressed windowed macroblock, and replace data at the same position in multiple decompressed windowed macroblocks corresponding to the non-zero data with the non-zero data.
In the embodiment of the invention, the format of the picture to be compressed can be data in various forms such as JPG or tif. The picture may include a plurality of discontinuous macroblock data, and the macroblock data may include pixels or color values of an image, and the like, which is not limited herein.
In the embodiment of the present invention, the weighting function may be a window function for processing an image, such as a hanning window function, a blackman window function, a gaussian window function, and the like, which is not limited herein. By the windowing function, the macro block data of the image can be normalized, and frequency spectrum leakage is avoided.
In the embodiment of the present invention, the edge data of the decompressed windowed macroblock and decompressed and overlapped windowed macroblocks is generally zero after windowing, and therefore, the reconstruction quality of the image is affected. But the decompression overlap window macro block contains the intermediate data in the original macro block in the image to be compressed, which can make up for the data loss generated in the data coding window process.
In the embodiment of the present invention, non-edge data, that is, non-zero data, in the decompressed windowed macroblock is used to fill the non-zero data in the corresponding position of the original macroblock, so that zero data in the middle part of the image macroblock can be restored, and the quality of image compression and restoration is improved.
In one embodiment, the overlay unit 702 includes: and the merging module is used for overlapping the first macro block and the second macro block in the image to be compressed, and merging the data in the overlapping part of the first macro block and the data in the overlapping part of the second macro block to obtain the overlapping macro block.
In an embodiment, the overlapping unit 702 further includes an overlapping sub-module, configured to overlap, when the image to be compressed further includes a plurality of third macro blocks respectively adjacent to the first macro block and the second macro block, the third macro blocks respectively adjacent to the first macro block and the second macro block, so as to obtain a plurality of overlapping macro blocks.
In the embodiment of the invention, a plurality of macro blocks in an image to be compressed are overlapped to obtain at least one overlapped macro block; wherein the overlapped macroblock comprises data information of the overlapped part of the plurality of macroblocks; respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block; obtaining a plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing, and decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing; the non-zero data in the decompressed overlapped windowed macro blocks are obtained, the data at the same positions in the decompressed overlapped windowed macro blocks corresponding to the non-zero data are replaced by the non-zero data, the macro blocks in the image are overlapped, and the data at the same positions in the decompressed windowed macro blocks corresponding to the non-zero data are replaced by the non-zero data, so that the aim of improving the picture reconstruction quality after image compression is fulfilled, the technical effect of effectively avoiding the phenomenon of poor reconstructed image quality caused by inaccurate frequency domain parameters is realized, and the technical problem of poor image decompression quality caused by frequency spectrum leakage when discrete cosine change DCT (discrete cosine transform) is carried out due to discontinuity between the macro blocks is solved.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the above image processing method, where the electronic device may be a terminal device or a server shown in fig. 1. The present embodiment takes the electronic device as a terminal device as an example for explanation. As shown in fig. 8, the electronic device comprises a memory 802 and a processor 804, the memory 802 having a computer program stored therein, the processor 804 being arranged to perform the steps of any of the above-described method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; wherein the overlapped macroblock comprises data information of the overlapped part of the plurality of macroblocks;
s2, respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block;
s3, obtaining a plurality of decompressed windowed macro blocks obtained after the weighted down processing is carried out on the plurality of windowed macro blocks, and obtaining decompressed overlapped windowed macro blocks obtained after the weighted down processing is carried out on the overlapped windowed macro blocks;
and S4, acquiring nonzero data in the decompressed overlapped windowing macro block, and replacing data at the same position in a plurality of decompressed windowing macro blocks corresponding to the nonzero data with the nonzero data.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 8 is a diagram illustrating a structure of the electronic device. For example, the electronics may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
The memory 802 may be used to store software programs and modules, such as program instructions/modules corresponding to the image processing method and apparatus in the embodiments of the present invention, and the processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, so as to implement the image processing method described above. The memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 802 can further include memory located remotely from the processor 804, which can be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 802 may be, but not limited to, information such as original macroblock data and overlapped macroblock data for an image. As an example, as shown in fig. 8, the memory 802 may include, but is not limited to, an overlapping unit 702, a weighting unit 704, an obtaining unit 706, and a replacing unit 708 in the image processing apparatus. In addition, the image processing apparatus may further include, but is not limited to, other module units in the image processing apparatus, which are not described in detail in this example.
Optionally, the transmission device 806 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 806 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 806 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In addition, the electronic device further includes: a display 808, configured to display non-zero data information in the decompressed overlap-windowed macroblock; and a connection bus 810 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. The nodes may form a Peer-To-Peer (P2P) network, and any type of computing device, such as a server, a terminal, and other electronic devices, may become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the image processing method provided in the above-mentioned various alternative implementations. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; wherein, the overlapped macroblock comprises the data information of the overlapped part of the macroblocks;
s2, respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block;
s3, obtaining a plurality of decompressed windowed macro blocks obtained after the weighted down processing is carried out on the plurality of windowed macro blocks, and obtaining decompressed overlapped windowed macro blocks obtained after the weighted down processing is carried out on the overlapped windowed macro blocks;
and S4, acquiring nonzero data in the decompressed overlapped windowing macro block, and replacing data at the same position in a plurality of decompressed windowing macro blocks corresponding to the nonzero data with the nonzero data.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the various methods in the foregoing embodiments may be implemented by a program instructing hardware related to the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described in detail in a certain embodiment.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be implemented in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (9)

1. An image processing method, comprising:
overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; wherein the overlapping macroblocks include data information of overlapping portions of the plurality of macroblocks;
respectively carrying out convergence processing on the macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block;
obtaining a plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing, and obtaining decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing;
acquiring nonzero data in the decompressed overlapped windowing macro blocks, and replacing data at the same position in a plurality of decompressed windowing macro blocks corresponding to the nonzero data with the nonzero data;
before the obtaining of the multiple decompressed windowed macro blocks obtained after the weighted down processing is performed on the multiple windowed macro blocks and the obtaining of the decompressed overlapped windowed macro blocks obtained after the weighted down processing is performed on the overlapped windowed macro blocks, the method further includes:
and carrying out inverse quantization decoding on the plurality of windowed macro blocks and at least one overlapped windowed macro block which are subjected to Discrete Cosine Transform (DCT) quantization coding through Inverse Discrete Cosine Transform (IDCT).
2. The method according to claim 1, wherein overlapping a plurality of macroblocks in the image to be compressed to obtain at least one overlapped macroblock comprises:
and overlapping the first macro block and the second macro block in the image to be compressed, and combining the data in the overlapping part of the first macro block and the data in the overlapping part of the second macro block to obtain the overlapping macro block.
3. The method of claim 2, further comprising:
and overlapping the third macro block with the first macro block and the second macro block respectively to obtain a plurality of overlapped macro blocks under the condition that the image to be compressed also comprises a plurality of third macro blocks respectively adjacent to the first macro block and the second macro block.
4. The method of claim 1, wherein the obtaining non-zero data in the decompressed windowed macroblock and replacing data at a same location in a plurality of decompressed windowed macroblocks corresponding to the non-zero data with the non-zero data comprises:
acquiring non-zero data in the decompressed overlapped windowed macro block as supplementary data;
determining the corresponding target positions of the supplementary data in the plurality of decompressed windowed macro blocks;
replacing data on the target location in the plurality of decompressed windowed macroblocks with the augmentation data.
5. The method of claim 1, wherein the weighting function comprises at least one of:
hanning window function, blackman window function, and gaussian window function.
6. An image processing apparatus characterized by comprising:
the overlapping unit is used for overlapping a plurality of macro blocks in an image to be compressed to obtain at least one overlapped macro block; wherein the overlapping macroblocks include data information of overlapping portions of the plurality of macroblocks;
the weighting unit is used for respectively carrying out convergence processing on the plurality of macro blocks through a weighting function to obtain a plurality of windowed macro blocks, and carrying out convergence processing on the overlapped macro blocks through the weighting function to obtain at least one overlapped windowed macro block;
the acquisition unit is used for acquiring a plurality of decompressed windowed macro blocks obtained after the weighted down processing is carried out on the plurality of windowed macro blocks and acquiring decompressed overlapped windowed macro blocks obtained after the weighted down processing is carried out on the overlapped windowed macro blocks;
the replacing unit is used for acquiring nonzero data in the decompressed overlapped windowing macro blocks and replacing data at the same position in a plurality of decompressed windowing macro blocks corresponding to the nonzero data with the nonzero data;
the device is also used for carrying out inverse quantization decoding on the plurality of windowed macro blocks and at least one overlapped windowed macro block which are subjected to Discrete Cosine Transform (DCT) quantization coding through Inverse Discrete Cosine Transform (IDCT) before the plurality of decompressed windowed macro blocks obtained after the plurality of windowed macro blocks are subjected to weight reduction processing and the decompressed overlapped windowed macro blocks obtained after the overlapped windowed macro blocks are subjected to weight reduction processing are obtained.
7. The apparatus of claim 6, wherein the overlapping the plurality of macroblocks in the image to be compressed to obtain at least one overlapped macroblock comprises:
and overlapping the first macro block and the second macro block in the image to be compressed, and combining the data in the overlapping part of the first macro block and the data in the overlapping part of the second macro block to obtain an overlapping macro block.
8. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any one of claims 1 to 5.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 5 by means of the computer program.
CN202110283100.XA 2021-03-16 2021-03-16 Image processing method and apparatus, storage medium, and electronic device Active CN112887726B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110283100.XA CN112887726B (en) 2021-03-16 2021-03-16 Image processing method and apparatus, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110283100.XA CN112887726B (en) 2021-03-16 2021-03-16 Image processing method and apparatus, storage medium, and electronic device

Publications (2)

Publication Number Publication Date
CN112887726A CN112887726A (en) 2021-06-01
CN112887726B true CN112887726B (en) 2022-11-25

Family

ID=76041019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110283100.XA Active CN112887726B (en) 2021-03-16 2021-03-16 Image processing method and apparatus, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN112887726B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000299864A (en) * 1999-04-12 2000-10-24 Canon Inc Method for processing dynamic image
US6430316B1 (en) * 1995-06-06 2002-08-06 Sony Corporation Motion vector compensation using overlapping weighted windows
EP1694074A1 (en) * 2005-02-18 2006-08-23 Thomson Licensing Process for scalable coding of images
CN101127903A (en) * 2007-09-29 2008-02-20 华南理工大学 DCT-based resolution flexible image coding and decoding method
US7965773B1 (en) * 2005-06-30 2011-06-21 Advanced Micro Devices, Inc. Macroblock cache
CN103826136A (en) * 2014-02-19 2014-05-28 华为软件技术有限公司 Rapid inverse discrete cosine transform method and terminal
CN111327934A (en) * 2020-02-28 2020-06-23 海信集团有限公司 Communication terminal, control equipment and video multi-equipment synchronous playing method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101516028B (en) * 2008-02-18 2011-05-11 昊迪移通(北京)技术有限公司 Efficient video coding technique aiming at video call application in mobile network
CN108063946B (en) * 2017-11-16 2021-09-24 腾讯科技(成都)有限公司 Image encoding method and apparatus, storage medium, and electronic apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6430316B1 (en) * 1995-06-06 2002-08-06 Sony Corporation Motion vector compensation using overlapping weighted windows
JP2000299864A (en) * 1999-04-12 2000-10-24 Canon Inc Method for processing dynamic image
EP1694074A1 (en) * 2005-02-18 2006-08-23 Thomson Licensing Process for scalable coding of images
US7965773B1 (en) * 2005-06-30 2011-06-21 Advanced Micro Devices, Inc. Macroblock cache
CN101127903A (en) * 2007-09-29 2008-02-20 华南理工大学 DCT-based resolution flexible image coding and decoding method
CN103826136A (en) * 2014-02-19 2014-05-28 华为软件技术有限公司 Rapid inverse discrete cosine transform method and terminal
CN111327934A (en) * 2020-02-28 2020-06-23 海信集团有限公司 Communication terminal, control equipment and video multi-equipment synchronous playing method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Anisse Khald ; Amina Radgui ; Mohammed Rziza.Spherical approach: Objects Tracking in Catadioptric System Using The GGD Distribution.《2019 International Conference on Intelligent Systems and Advanced Computing Sciences (ISACS)》.2020, *
基于DCT域的图像后处理技术;许海峰;《中国优秀博硕士学位论文全文数据库(博士) 信息科技辑》;20080615;全文 *
重叠块运动补偿在小波视频编码中的应用;徐俊等;《计算机工程与设计》;20061028(第20期);全文 *

Also Published As

Publication number Publication date
CN112887726A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN111681167B (en) Image quality adjusting method and device, storage medium and electronic equipment
CN108063946B (en) Image encoding method and apparatus, storage medium, and electronic apparatus
CN110519607B (en) Video decoding method and device, and video encoding method and device
CN110636294A (en) Video decoding method and device, and video encoding method and device
EP2950531A1 (en) Moving image reproduction method and moving image reproduction system
CN111918065A (en) Information compression/decompression method and device
CN110599554A (en) Method and device for identifying face skin color, storage medium and electronic device
CN113426112A (en) Game picture display method and device, storage medium and electronic equipment
CN110662071B (en) Video decoding method and device, storage medium and electronic device
CN104602018B (en) The acquisition methods and device of the movable information of video data, coding method and device
CN110677676B (en) Video encoding method and apparatus, video decoding method and apparatus, and storage medium
CN112887726B (en) Image processing method and apparatus, storage medium, and electronic device
Yang et al. Subjective quality evaluation of compressed digital compound images
CN110677690B (en) Video processing method and device and storage medium
CN112637609B (en) Image real-time transmission method, sending end and receiving end
CN115442617A (en) Video processing method and device based on video coding
CN112565819B (en) Video data processing method and device, electronic equipment and storage medium
CN108933945B (en) GIF picture compression method, device and storage medium
CN116567247A (en) Video encoding method, real-time communication method, device, equipment and storage medium
CN114157868A (en) Video frame coding mode screening method and device and electronic equipment
CN110677691B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110536134B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110572653B (en) Video encoding and decoding methods and devices, storage medium and electronic device
CN114205642B (en) Video image processing method and device
CN110572654B (en) Video encoding and decoding methods and devices, storage medium and electronic device

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