Image processing method, device, electronic device and storage medium
By performing multi-level wavelet decomposition and misalignment processing on the target image, combined with weighting processing, the problem of sawtoothing of the image after wavelet reconstruction is solved, and the integrity of high-frequency information and image quality are improved.
Patent Information
- Application Number
- CN202111364541.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2041-11-17
AI Technical Summary
The image is prone to sawtoothing after wavelet reconstruction, mainly due to the loss of high-frequency information.
The second wavelet coefficient is obtained by performing wavelet decomposition at N decomposition levels on the target area of the target image and misaligning the target area according to each decomposition level. During the reconstruction process, wavelet reconstruction is carried out layer by layer, and the first wavelet coefficient and the second wavelet coefficient are weighted to compensate for the loss of high-frequency information.
It effectively solves the problem of sawtoothing in the image after wavelet decomposition. Through misalignment decomposition and weighting processing, the integrity of high-frequency information is ensured, thereby improving the reconstruction quality of the image.
Smart Images

Figure CN114049279B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer software, and specifically relates to an image processing method, device, electronic device and storage medium. Background Art
[0002] At present, wavelet decomposition has been widely used in image processing due to its good space-frequency decomposition. For example, in various image quality enhancement algorithms such as noise reduction and super-resolution, wavelet decomposition can play an important role in improving effects and performance. Among them, Haar wavelet is widely used in various processes of image processing due to its extremely simple operation.
[0003] However, the Haar wavelet also has its own limitations. Since the length of each layer of the Haar wavelet decomposition filter is only 2, it is limited by the receptive field of the transformation. When the transformed wavelet coefficients are processed, high-frequency information is often lost due to accuracy problems or special processing. Therefore, after wavelet reconstruction, jagged edges will appear due to information loss. Figure 1 It is a schematic diagram of edge jaggedness in wavelet decomposition in the related art, wherein the left side is the original noisy image and the right side is the image after denoising by Haar wavelet decomposition.
[0004] The main way to avoid the above-mentioned aliasing problem is to use relatively complex wavelet transforms with longer filter lengths, such as DB3, DB4, and BIOR, or to be relatively conservative in the wavelet coefficient processing to avoid the problem of high-frequency information loss. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide an image processing method, device, electronic device and storage medium, which can solve the problem of aliasing in images after wavelet reconstruction.
[0006] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
[0007] Performing wavelet decomposition of N decomposition levels on the image of the target area of the target image to obtain first wavelet coefficients corresponding to each decomposition level, performing dislocation processing on the target area according to each decomposition level, and performing wavelet decomposition on the image of the area obtained after the dislocation processing to obtain second wavelet coefficients corresponding to each decomposition level;
[0008] Performing a first process on the first wavelet coefficients and the second wavelet coefficients corresponding to the N decomposition levels respectively to obtain the first wavelet coefficients and the second wavelet coefficients after the first process;
[0009] Based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing, wavelet reconstruction is performed layer by layer starting from the Nth decomposition level to obtain a processed image.
[0010] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising:
[0011] A dislocation decomposition module is used to perform wavelet decomposition of N decomposition levels on the image of the target area of the target image, respectively obtain the first wavelet coefficient corresponding to each decomposition level, and perform dislocation processing on the target area according to each decomposition level, and perform wavelet decomposition on the image of the area obtained after the dislocation processing, respectively obtain the second wavelet coefficient corresponding to each decomposition level;
[0012] A first processing module, configured to perform a first processing on the first wavelet coefficients and the second wavelet coefficients corresponding to the N decomposition levels, respectively, to obtain the first wavelet coefficients and the second wavelet coefficients after the first processing;
[0013] The wavelet reconstruction module is used to perform wavelet reconstruction layer by layer starting from the Nth decomposition level based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing to obtain a processed image.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0017] In an embodiment of the present application, the target area is subjected to a dislocation process according to each decomposition level, and the image of the area obtained after the dislocation process is subjected to wavelet decomposition. Dislocation decomposition is performed at different positions according to the number of wavelet decomposition layers. The pixel values at the position corresponding to the LL frequency band of the first wavelet coefficient in the first reconstructed image and the pixel values at the position corresponding to the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted. During the decomposition, the second wavelet coefficient is made to include high-frequency information through dislocation. During the reconstruction process, the second wavelet coefficient obtained by the dislocation decomposition is continuously superimposed to make up for the loss of high-frequency information, thereby solving the problem of edge jaggedness in the wavelet decomposition. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of edge jaggedness appearing in wavelet decomposition in the related art;
[0019] Figure 2 It is a flowchart of wavelet decomposition and reconstruction in related technologies;
[0020] Figure 3 is a flowchart of an image processing method provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of LL frequency band spatial domain superposition in the reconstruction process provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of an area taken by a layer of wavelet decomposition provided in an embodiment of the present application;
[0023] Figure 6 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0024] Figure 7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0025] Figure 8 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0028] Figure 2 It is a flowchart of wavelet decomposition and reconstruction in related technologies. Figure 2 Taking a layer of wavelet decomposition as an example, the cause of aliasing is shown, where the image part is Figure 1 The jagged part is enlarged, and the numerical value on the image represents the specific numerical value of the corresponding pixel. The image is decomposed by wavelet to obtain the decomposed wavelet coefficients, and the decomposed wavelet coefficients are denoised to obtain the denoised wavelet coefficients. In the figure, the LL band is the low frequency band, the LH band is the horizontal high frequency band, the HL band is the vertical high frequency band, and the HH band is the diagonal high frequency band. The LH band and the HL band in the denoised wavelet coefficients have obvious contraction in intensity, causing the gradient between some pixels to disappear. Finally, the pixel values in the 2x2 area in the image are closer, which introduces the jagged problem in the reconstructed image.
[0029] The image processing method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0030] Figure 3 is a flow chart of the image processing method provided in the embodiment of the present application, such as Figure 3 As shown, the method includes: step 100, step 101 and step 102.
[0031] Step 100, perform wavelet decomposition of N decomposition levels on the image of the target area of the target image to obtain the first wavelet coefficient corresponding to each decomposition level, and perform dislocation processing on the target area according to each decomposition level, and perform wavelet decomposition on the image of the area obtained after the dislocation processing to obtain the second wavelet coefficient corresponding to each decomposition level.
[0032] The target region is a target-sized region block in the target image. For example, the target image is divided into multiple regions of 8×8 pixels, and the multiple regions are processed as the target region, so as to finally process the target image. The wavelet decomposition may be Haar wavelet decomposition.
[0033] The target image is the image to be processed. For example, if noise reduction is required, Figure 2 In the manner shown, wavelet decomposition, noise reduction and reconstruction are performed, and the processed image obtained will have edge jagged edges. In this embodiment, in order to eliminate the jagged edges, the target area is subjected to N decomposition levels of staggered decomposition during the wavelet decomposition stage.
[0034] Where N is a positive integer. The following takes N as 3 as an example:
[0035] The target area of the target image is subjected to three decomposition levels of wavelet decomposition, namely, one-level wavelet decomposition, two-level wavelet decomposition and three-level wavelet decomposition, to obtain the first wavelet coefficient corresponding to the first decomposition level, the first wavelet coefficient corresponding to the second decomposition level and the first wavelet coefficient corresponding to the third decomposition level respectively.
[0036] In addition, the target area is dislocated three times according to the three decomposition levels. After the dislocation processing, the target area is moved by at least one pixel, and the area obtained after the dislocation processing is subjected to wavelet decomposition. The three wavelet decompositions of the image of the dislocated area correspond to the wavelet decomposition levels of the target area, which are one-layer wavelet decomposition, two-layer wavelet decomposition and three-layer wavelet decomposition, respectively, and the second wavelet coefficients corresponding to the first decomposition level, the second wavelet coefficients corresponding to the second decomposition level and the second wavelet coefficients corresponding to the third decomposition level are obtained respectively.
[0037] It should be noted that the present application performs different dislocation processing according to the number of wavelet decomposition layers, that is, at different decomposition levels, the pixel distances of the dislocation movement are different, so that the high-frequency information obtained by the dislocation decomposition can be continuously superimposed during the reconstruction process to avoid the loss of high-frequency information.
[0038] Step 101: Perform a first process on the first wavelet coefficients and the second wavelet coefficients corresponding to the N decomposition levels respectively to obtain the first wavelet coefficients and the second wavelet coefficients after the first process.
[0039] The first processing may be a noise reduction processing, or may be other processing other than noise reduction that causes aliasing in the image, which is not specifically limited here.
[0040] The N first wavelet coefficients corresponding to the N decomposition levels are first processed to obtain N first processed first wavelet coefficients, and the N second wavelet coefficients corresponding to the N decomposition levels are first processed to obtain N first processed second wavelet coefficients.
[0041] In a specific implementation process, in order to save computing resources, a partial decomposition level may be selected for the first processing, which is not specifically limited here.
[0042] Step 102: Based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing, wavelet reconstruction is performed layer by layer starting from the Nth decomposition level to obtain a processed image.
[0043] Optionally, starting from the Nth decomposition level, weighted processing is performed on the pixel values at the position corresponding to the LL frequency band of the first wavelet coefficient in the first reconstructed image corresponding to the target decomposition level among the N decomposition levels and the pixel values at the position corresponding to the LL frequency band of the second wavelet coefficient in the second reconstructed image corresponding to the target decomposition level, and the pixel values at the same position are averaged.
[0044] The reconstruction of each layer is performed on the basis of the previous layer. For example, the LL frequency band of the wavelet coefficients of the image reconstructed and weighted by the previous layer is used to update the LL frequency band of the first wavelet coefficient corresponding to the current decomposition level, and then the current decomposition level is reconstructed based on the LL frequency band of the updated first wavelet coefficient.
[0045] The image processing method provided by the embodiment of the present application performs dislocation processing on the target area according to each decomposition level, performs wavelet decomposition on the image of the area obtained after the dislocation processing, performs dislocation decomposition at different positions according to the number of wavelet decomposition layers, performs weighted processing on the pixel values at the position corresponding to the LL frequency band of the first wavelet coefficient in the first reconstructed image and the pixel values at the position corresponding to the LL frequency band of the second wavelet coefficient in the second reconstructed image, and includes high-frequency information in the second wavelet coefficient by dislocation during decomposition. The second wavelet coefficient obtained by the dislocation decomposition is continuously superimposed during the reconstruction process to compensate for the loss of high-frequency information, thereby solving the problem of edge jaggedness in wavelet decomposition.
[0046] Optionally, the performing wavelet reconstruction layer by layer starting from the Nth decomposition level based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing to obtain a processed image includes:
[0047] Reconstructing the first wavelet coefficient corresponding to the i-th decomposition level after the first processing to obtain a first reconstructed image corresponding to the i-th decomposition level, wherein the i-th decomposition level is one of the N decomposition levels, the value of i decreases from N to 1 in sequence, and i is a positive integer;
[0048] Reconstructing the second wavelet coefficients corresponding to the i-th decomposition level after the first processing to obtain a second reconstructed image corresponding to the i-th decomposition level;
[0049] The LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted to obtain a first image, and the LL frequency band of the wavelet coefficient of the first image is used to update the LL frequency band of the first wavelet coefficient corresponding to the i-1th decomposition level.
[0050] Figure 4 A schematic diagram of the LL frequency band spatial domain superposition of the reconstruction process provided in the embodiment of the present application, such as Figure 4 As shown, the pixel values at the corresponding position of the LL frequency band of the original image, the pixel values at the corresponding position of the LL frequency band on the right of the misplaced image, the pixel values at the corresponding position of the LL frequency band at the bottom of the misplaced image, and the pixel values at the corresponding position of the LL frequency band at the bottom right of the misplaced image are weighted to obtain a processed image.
[0051] The following takes N as 3 as an example:
[0052] Reconstruct the first wavelet coefficient corresponding to the third decomposition level after the first processing in step 101 to obtain a first reconstructed image corresponding to the third decomposition level; reconstruct the second wavelet coefficient corresponding to the third decomposition level after the first processing to obtain a second reconstructed image corresponding to the third decomposition level; perform weighted processing on the LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image to obtain a first image, and use the LL frequency band of the wavelet coefficient of the first image to update the LL frequency band of the first wavelet coefficient corresponding to the second decomposition level.
[0053] The first wavelet coefficient corresponding to the updated second decomposition level is reconstructed to obtain a first reconstructed image corresponding to the second decomposition level; the second wavelet coefficient corresponding to the second decomposition level after the first processing is reconstructed to obtain a second reconstructed image corresponding to the second decomposition level; the LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted to obtain a first image, and the LL frequency band of the wavelet coefficient of the first image is used to update the LL frequency band of the first wavelet coefficient corresponding to the first decomposition level.
[0054] The first wavelet coefficient corresponding to the updated first decomposition level is reconstructed to obtain a first reconstructed image corresponding to the first decomposition level; the second wavelet coefficient corresponding to the first decomposition level after the first processing is reconstructed to obtain a second reconstructed image corresponding to the first decomposition level; the LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted to obtain a processed image.
[0055] The image processing method provided in the embodiment of the present application reconstructs each of the N decomposition levels layer by layer, and updates the LL frequency band of the first wavelet coefficient corresponding to the next decomposition level based on the first image obtained by weighted processing of the previous level. During the reconstruction process, the second wavelet coefficients obtained by the staggered decomposition are continuously superimposed to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0056] Optionally, performing dislocation processing on the target area according to each decomposition level, and performing wavelet decomposition on the image of the area obtained after the dislocation processing to obtain second wavelet coefficients corresponding to each decomposition level, respectively, includes:
[0057] determining a target number of misaligned pixels in a target region according to a target decomposition level in the N decomposition levels;
[0058] Moving the target area by the target number of pixels to determine the displaced area;
[0059] Perform wavelet decomposition on the image of the dislocated area to obtain the second wavelet coefficient corresponding to the target decomposition level;
[0060] Perform wavelet decomposition of a decomposition level next to the target decomposition level in the N decomposition levels until a second wavelet coefficient corresponding to each of the decomposition levels is obtained.
[0061] Optionally, the target area is subjected to layer-by-layer misalignment decomposition, the target decomposition level is one of N decomposition levels, and the target number of misaligned pixels in the target area corresponding to the target decomposition level is determined according to the target decomposition level.
[0062] The target area is moved by a target number of pixels to determine the area after the misalignment, for example, one pixel is moved rightward, downward or to the lower right to determine the area after the misalignment. The size of the area after the misalignment is the same as that of the target area. The image of the target area may overlap with the image of the area after the misalignment.
[0063] The image of the dislocated area is subjected to wavelet decomposition to obtain the second wavelet coefficient corresponding to the target decomposition level.
[0064] The wavelet decomposition of the next decomposition level among the N decomposition levels is performed until the second wavelet coefficient corresponding to each decomposition level is obtained.
[0065] The image processing method provided in the embodiment of the present application determines the target number of misaligned pixels in the target area according to the target decomposition level in N decomposition levels, determines the misaligned area, and performs layer-by-layer misalignment and wavelet decomposition of the corresponding level on the target area until the second wavelet coefficient corresponding to each of the decomposition levels is obtained. In this way, the second wavelet coefficients obtained by the misaligned decomposition can be continuously superimposed during the reconstruction process to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0066] Optionally, the dislocated area includes at least one of a dislocated first area, a dislocated second area, and a dislocated third area, and moving the target area by the target number of pixels to determine the dislocated area includes at least one of the following:
[0067] The target area is moved rightward by the target number of pixels to determine a first area after the displacement;
[0068] The target area is moved downward by the target number of pixels to determine a second area after the displacement;
[0069] The target area is moved rightward and downward by the target number of pixels to determine a third area after the displacement.
[0070] Figure 5 A schematic diagram of the region taken by a layer of wavelet decomposition provided in an embodiment of the present application, such as Figure 5 As shown, taking one layer of wavelet decomposition (at this time, the target decomposition level n=1) as an example, the dislocation processing of the target area includes:
[0071] Move the target area to the right by one pixel to obtain the first area after displacement. The first area corresponds to Figure 5 The dislocation diagram in the right; move the target area down by one pixel to obtain the second area after dislocation. The second area corresponds to Figure 4 In the dislocation diagram, the target area is moved rightward and downward by one pixel to obtain the third area after the dislocation. The third area corresponds to Figure 4 The misalignment diagram in the lower right.
[0072] In the image processing method provided in the embodiment of the present application, the dislocated area includes at least one of the dislocated first area, the dislocated second area and the dislocated third area, and then the second wavelet coefficients obtained by the dislocated decomposition are continuously superimposed during the reconstruction process to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0073] Optionally, determining a target number of misaligned pixels in the target area according to a target decomposition level in the N decomposition levels includes:
[0074] The target number of misaligned pixels in the target area is determined based on the target decomposition level in the N decomposition levels and the following formula:
[0075] p=2 n-1
[0076] Among them, p is the target number of misaligned pixels in the target area, and n is the target decomposition level.
[0077] For example, the target area of the target image is subjected to wavelet decomposition at three decomposition levels, namely, one-layer wavelet decomposition, two-layer wavelet decomposition and three-layer wavelet decomposition.
[0078] In the case of one-layer wavelet decomposition, the target decomposition level is 1, that is, n takes a value of 1. At this time, the target number of misaligned pixels in the corresponding target area is 1, that is, they are displaced by 1 pixel to the right, downward, and lower right respectively; in the case of two-layer wavelet decomposition, the target decomposition level is 2, that is, n takes a value of 2. At this time, the target number of misaligned pixels in the corresponding target area is 2, that is, they are displaced by 2 pixels to the right, downward, and lower right respectively; in the case of three-layer wavelet decomposition, the target decomposition level is 3, that is, n takes a value of 3. At this time, the target number of misaligned pixels in the corresponding target area is 4, that is, they are displaced by 4 pixels to the right, downward, and lower right respectively.
[0079] The image processing method provided in the embodiment of the present application determines the number of misaligned pixels according to the target decomposition level, and then continuously superimposes the second wavelet coefficients obtained by the misaligned decomposition during the reconstruction process to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0080] It should be noted that the image processing method provided in the embodiment of the present application can be executed by an image processing device or a control module in the image processing device for executing the image processing method. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.
[0081] Figure 6 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application, such as Figure 6 As shown, the device includes: a dislocation decomposition module 610, a first processing module 620 and a wavelet reconstruction module 630.
[0082] The dislocation decomposition module 610 is used to perform wavelet decomposition of N decomposition levels on the image of the target area of the target image, respectively obtain the first wavelet coefficient corresponding to each decomposition level, and perform dislocation processing on the target area according to each decomposition level, and perform wavelet decomposition on the image of the area obtained after the dislocation processing, respectively obtain the second wavelet coefficient corresponding to each decomposition level;
[0083] A first processing module 620 is used to perform a first processing on the first wavelet coefficients and the second wavelet coefficients corresponding to the N decomposition levels respectively to obtain the first wavelet coefficients and the second wavelet coefficients after the first processing;
[0084] The wavelet reconstruction module 630 is used to perform wavelet reconstruction layer by layer starting from the Nth decomposition level based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing to obtain a processed image.
[0085] Optionally, the wavelet reconstruction module 630 is specifically used for:
[0086] Reconstructing the first wavelet coefficient corresponding to the i-th decomposition level after the first processing to obtain a first reconstructed image corresponding to the i-th decomposition level, wherein the i-th decomposition level is one of the N decomposition levels, the value of i decreases from N to 1 in sequence, and i is a positive integer;
[0087] Reconstructing the second wavelet coefficients corresponding to the i-th decomposition level after the first processing to obtain a second reconstructed image corresponding to the i-th decomposition level;
[0088] The LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted to obtain a first image, and the LL frequency band of the wavelet coefficient of the first image is used to update the LL frequency band of the first wavelet coefficient corresponding to the i-1th decomposition level.
[0089] Optionally, the dislocation decomposition module 610 is specifically used for:
[0090] determining a target number of misaligned pixels in a target region according to a target decomposition level in the N decomposition levels;
[0091] Moving the target area by the target number of pixels to determine the displaced area;
[0092] Perform wavelet decomposition on the image of the dislocated area to obtain the second wavelet coefficient corresponding to the target decomposition level;
[0093] Perform wavelet decomposition of a decomposition level next to the target decomposition level in the N decomposition levels until a second wavelet coefficient corresponding to each of the decomposition levels is obtained.
[0094] Optionally, the dislocated area includes at least one of a dislocated first area, a dislocated second area, and a dislocated third area, and moving the target area by the target number of pixels to determine the dislocated area includes at least one of the following:
[0095] The target area is moved rightward by the target number of pixels to determine a first area after the displacement;
[0096] The target area is moved downward by the target number of pixels to determine a second area after the displacement;
[0097] The target area is moved rightward and downward by the target number of pixels to determine a third area after the displacement.
[0098] Optionally, determining a target number of misaligned pixels in the target area according to a target decomposition level in the N decomposition levels includes:
[0099] The target number of misaligned pixels in the target area is determined based on the target decomposition level in the N decomposition levels and the following formula:
[0100] p=2 n-1
[0101] Among them, p is the target number of misaligned pixels in the target area, and n is the target decomposition level.
[0102] The image processing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0103] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0104] The image processing device provided in the embodiment of the present application can achieve Figures 3 to 5 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0105] Alternatively, if Figure 7As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0106] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0107] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0108] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810 and other components.
[0109] Those skilled in the art will appreciate that the electronic device 800 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0110] The processor 810 is used to
[0111] Performing wavelet decomposition of N decomposition levels on the image of the target area of the target image to obtain first wavelet coefficients corresponding to each decomposition level, performing dislocation processing on the target area according to each decomposition level, and performing wavelet decomposition on the image of the area obtained after the dislocation processing to obtain second wavelet coefficients corresponding to each decomposition level;
[0112] Performing a first process on the first wavelet coefficients and the second wavelet coefficients corresponding to the N decomposition levels respectively to obtain the first wavelet coefficients and the second wavelet coefficients after the first process;
[0113] Based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing, wavelet reconstruction is performed layer by layer starting from the Nth decomposition level to obtain a processed image.
[0114] In an embodiment of the present application, the target area is subjected to dislocation processing according to each decomposition level, and the image of the area obtained after the dislocation processing is subjected to wavelet decomposition. Dislocation decomposition is performed at different positions according to the number of wavelet decomposition layers. The pixel values at the position corresponding to the low-frequency band LL band of the first wavelet coefficient in the first reconstructed image and the pixel values at the position corresponding to the LL band of the second wavelet coefficient in the second reconstructed image are weighted. In the reconstruction process, the second wavelet coefficient obtained by the dislocation decomposition is continuously superimposed to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0115] Optionally, the processor 110 is further configured to:
[0116] Reconstructing the first wavelet coefficient corresponding to the i-th decomposition level after the first processing to obtain a first reconstructed image corresponding to the i-th decomposition level, wherein the i-th decomposition level is one of the N decomposition levels, the value of i decreases from N to 1 in sequence, and i is a positive integer;
[0117] Reconstructing the second wavelet coefficients corresponding to the i-th decomposition level after the first processing to obtain a second reconstructed image corresponding to the i-th decomposition level;
[0118] The LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted to obtain a first image, and the LL frequency band of the wavelet coefficient of the first image is used to update the LL frequency band of the first wavelet coefficient corresponding to the i-1th decomposition level.
[0119] In the embodiment of the present application, each of the N decomposition levels is reconstructed layer by layer, and based on the first image obtained by weighted processing of the previous layer, the LL frequency band of the first wavelet coefficient corresponding to the next decomposition level is updated. During the reconstruction process, the second wavelet coefficients obtained by the staggered decomposition are continuously superimposed to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0120] Optionally, the processor 110 is further configured to:
[0121] determining a target number of misaligned pixels in a target region according to a target decomposition level in the N decomposition levels;
[0122] Moving the target area by the target number of pixels to determine the displaced area;
[0123] Perform wavelet decomposition on the image of the dislocated area to obtain the second wavelet coefficient corresponding to the target decomposition level;
[0124] Perform wavelet decomposition of a decomposition level next to the target decomposition level in the N decomposition levels until a second wavelet coefficient corresponding to each of the decomposition levels is obtained.
[0125] In an embodiment of the present application, the target number of misaligned pixels in the target area is determined according to the target decomposition level in the N decomposition levels, the misaligned area is determined, and the target area is misaligned layer by layer and decomposed by wavelet of the corresponding level until the second wavelet coefficient corresponding to each of the decomposition levels is obtained. In this way, the second wavelet coefficients obtained by the misaligned decomposition can be continuously superimposed during the reconstruction process to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0126] Optionally, the dislocated area includes at least one of a dislocated first area, a dislocated second area, and a dislocated third area, and the processor 110 is further configured to:
[0127] The target area is moved rightward by the target number of pixels to determine a first area after the displacement;
[0128] The target area is moved downward by the target number of pixels to determine a second area after the displacement;
[0129] The target area is moved rightward and downward by the target number of pixels to determine a third area after the displacement.
[0130] In an embodiment of the present application, the dislocated area includes at least one of the dislocated first area, the dislocated second area and the dislocated third area, and then the second wavelet coefficients obtained by the dislocated decomposition are continuously superimposed during the reconstruction process to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0131] Optionally, the processor 110 is further configured to:
[0132] The target number of misaligned pixels in the target area is determined based on the target decomposition level in the N decomposition levels and the following formula:
[0133] p=2 n-1
[0134] Among them, p is the target number of misaligned pixels in the target area, and n is the target decomposition level.
[0135] In the embodiment of the present application, the number of dislocated pixels is determined according to the target decomposition level, and the second wavelet coefficients obtained by the dislocated decomposition are continuously superimposed during the reconstruction process to compensate for the loss of high-frequency information and solve the problem of edge jaggedness in wavelet decomposition.
[0136] It should be understood that in the embodiment of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 806 may include a display panel 8061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 807 includes a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch controller. Other input devices 8072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 809 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 810 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 810.
[0137] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0138] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0139] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0140] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0141] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes 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 sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0142] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0143] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An image processing method, characterized in that: include: Performing wavelet decomposition of N decomposition levels on the image of the target area of the target image to obtain first wavelet coefficients corresponding to each decomposition level, performing dislocation processing on the target area according to each decomposition level, and performing wavelet decomposition on the image of the area obtained after the dislocation processing to obtain second wavelet coefficients corresponding to each decomposition level; Performing a first process on the first wavelet coefficients and the second wavelet coefficients corresponding to the N decomposition levels respectively to obtain the first wavelet coefficients and the second wavelet coefficients after the first process; Based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing, performing wavelet reconstruction layer by layer starting from the Nth decomposition level to obtain a processed image; The step of performing wavelet reconstruction layer by layer starting from the Nth decomposition level based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing to obtain a processed image includes: Reconstructing the first wavelet coefficient corresponding to the i-th decomposition level after the first processing to obtain a first reconstructed image corresponding to the i-th decomposition level, wherein the i-th decomposition level is one of the N decomposition levels, the value of i decreases from N to 1 in sequence, and i is a positive integer; Reconstructing the second wavelet coefficients corresponding to the i-th decomposition level after the first processing to obtain a second reconstructed image corresponding to the i-th decomposition level; The LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted to obtain a first image, and the LL frequency band of the wavelet coefficient of the first image is used to update the LL frequency band of the first wavelet coefficient corresponding to the i-1th decomposition level.
2. The image processing method according to claim 1, characterized in that: The step of performing dislocation processing on the target area according to each decomposition level, and performing wavelet decomposition on the image of the area obtained after the dislocation processing to obtain second wavelet coefficients corresponding to each decomposition level respectively includes: determining a target number of misaligned pixels in a target region according to a target decomposition level in the N decomposition levels; Moving the target area by the target number of pixels to determine the displaced area; Perform wavelet decomposition on the image of the dislocated area to obtain the second wavelet coefficient corresponding to the target decomposition level; Perform wavelet decomposition of a decomposition level next to the target decomposition level in the N decomposition levels until a second wavelet coefficient corresponding to each of the decomposition levels is obtained.
3. The image processing method according to claim 2, characterized in that: The dislocated area includes at least one of a dislocated first area, a dislocated second area, and a dislocated third area, and the step of moving the target area by the target number of pixels to determine the dislocated area includes at least one of the following: The target area is moved rightward by the target number of pixels to determine a first area after the displacement; The target area is moved downward by the target number of pixels to determine a second area after the displacement; The target area is moved rightward and downward by the target number of pixels to determine a third area after the displacement.
4. The image processing method according to claim 2, characterized in that: The step of determining a target number of misaligned pixels in a target area according to a target decomposition level in the N decomposition levels includes: The target number of misaligned pixels in the target area is determined based on the target decomposition level in the N decomposition levels and the following formula: p=2 n-1 Among them, p is the target number of misaligned pixels in the target area, and n is the target decomposition level.
5. An image processing device, characterized in that: include: A dislocation decomposition module is used to perform wavelet decomposition of N decomposition levels on the image of the target area of the target image, respectively obtain the first wavelet coefficient corresponding to each decomposition level, and perform dislocation processing on the target area according to each decomposition level, and perform wavelet decomposition on the image of the area obtained after the dislocation processing, respectively obtain the second wavelet coefficient corresponding to each decomposition level; A first processing module, configured to perform a first processing on the first wavelet coefficients and the second wavelet coefficients corresponding to the N decomposition levels, respectively, to obtain the first wavelet coefficients and the second wavelet coefficients after the first processing; A wavelet reconstruction module, configured to perform wavelet reconstruction layer by layer starting from the Nth decomposition level based on the first wavelet coefficients and the second wavelet coefficients that have undergone the first processing, to obtain a processed image; Wherein, the wavelet reconstruction module is specifically used for: Reconstructing the first wavelet coefficient corresponding to the i-th decomposition level after the first processing to obtain a first reconstructed image corresponding to the i-th decomposition level, wherein the i-th decomposition level is one of the N decomposition levels, the value of i decreases from N to 1 in sequence, and i is a positive integer; Reconstructing the second wavelet coefficients corresponding to the i-th decomposition level after the first processing to obtain a second reconstructed image corresponding to the i-th decomposition level; The LL frequency band of the first wavelet coefficient in the first reconstructed image and the LL frequency band of the second wavelet coefficient in the second reconstructed image are weighted to obtain a first image, and the LL frequency band of the wavelet coefficient of the first image is used to update the LL frequency band of the first wavelet coefficient corresponding to the i-1th decomposition level.
6. The image processing device according to claim 5, characterized in that: The step of performing dislocation processing on the target area according to each decomposition level, and performing wavelet decomposition on the image of the area obtained after the dislocation processing to obtain second wavelet coefficients corresponding to each decomposition level respectively includes: determining a target number of misaligned pixels in a target region according to a target decomposition level in the N decomposition levels; Moving the target area by the target number of pixels to determine the displaced area; Perform wavelet decomposition on the image of the dislocated area to obtain the second wavelet coefficient corresponding to the target decomposition level; Perform wavelet decomposition of a decomposition level next to the target decomposition level in the N decomposition levels until a second wavelet coefficient corresponding to each of the decomposition levels is obtained.
7. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image processing method according to any one of claims 1 to 4.
8. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image processing method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
A novel image denoising method with hybrid dual tree complex wavelet transform
AU2021101814A4
Image denoising method and device
CN104050648A