Image denoising method, device, equipment and storage medium

By performing denoising processing of different intensities based on the class variance value of image pixel points, and correcting it with reference pixel points in the M*M pixel matrix, the problems of image denoising in the prior art lead to blurred details and high resource occupation are solved. , realizes efficient image noise removal effect.

CN113469890BActive Publication Date: 2024-11-19BYD SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010243045.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-31
Publication Date
2024-11-19
Estimated Expiration
2040-03-31

AI Technical Summary

Technical Problem

While improving image quality, existing image denoising methods may lead to blurred details, and the algorithm is complex and resource occupies a lot, resulting in long imaging waiting time.

Method used

By recalculating the pixel values ​​of each pixel point in the image, denoising the noise of different intensities is performed according to the variance value of the pixel point, and the reference pixel points in the M*M pixel matrix are used for correction and denoising, reducing the complexity of the algorithm , reduce resource usage and shorten the denoising time.

Benefits of technology

While removing noise, retain image details, improve image quality, reduce the complexity of denoising algorithms, reduce calculation and storage resource usage, and shorten the denoising time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113469890B_ABST
    Figure CN113469890B_ABST
Patent Text Reader

Abstract

The present invention proposes an image denoising method, device, equipment and storage medium, wherein the method comprises: S1, obtaining the original pixel value of each pixel of the original Bayer image; S2, taking any pixel as the target pixel, determining the pixel matrix with the target pixel as the central pixel, and calculating the corrected pixel value of the corrected target pixel according to the original pixel value of the reference pixel in the matrix; S3, obtaining the class variance value of the target pixel according to the corrected pixel value; S4, obtaining the target pixel value of the target pixel according to the class variance value of the target pixel; S5, repeating steps S2 to S4, obtaining the target pixel value of at least a part of the pixels in the original Bayer image to reconstruct the original Bayer image. The method ensures the details of the image as much as possible while removing the image noise, improves the quality of the generated image, reduces the complexity of the denoising algorithm, and shortens the time spent on image denoising.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image denoising method, device, equipment and storage medium. Background Art

[0002] As the popularity of imaging devices (such as complementary metal oxide semiconductor (CMOS) image sensors) increases, people are paying more and more attention to the quality of images generated by imaging devices. Among them, since the noise level of the image directly affects the quality of various aspects of the image, such as clarity and color, setting a reasonable denoising method for the image is an important step to improve image quality.

[0003] In the related art, the generated original image is usually denoised by using methods such as median filtering, wavelet filtering and non-local mean filtering (NLM). However, in order to improve the denoising effect, the above denoising methods may cause blurring of the parts with more details in the image, and due to the high complexity of the algorithm and the large amount of resources occupied, when using devices such as CMOS image sensors to generate images, the waiting time for imaging is long. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0005] To this end, the first object of the present invention is to provide an image denoising method. The method denoises the image by recalculating the pixel value of each pixel in the image, wherein the pixel is denoised with different intensities according to the size of the class variance value of the pixel, while removing the image noise, the details of the image are preserved as much as possible, the quality of the generated image is further improved, and the complexity of the denoising algorithm is reduced, the computing resources and storage resources occupied by the denoising process are reduced, and the time consumed for image denoising is shortened.

[0006] The second object of the present invention is to provide an image denoising device.

[0007] A third objective of the present invention is to provide an electronic device.

[0008] A fourth object of the present invention is to provide a computer-readable storage medium.

[0009] To achieve the above object, a first embodiment of the present invention provides a method for denoising an image, comprising the following steps:

[0010] S1, obtaining the original pixel value of each pixel point of the original Bayer image;

[0011] S2, taking any pixel point as a target pixel point, determining an M*M pixel matrix with the target pixel point as a central pixel point, and correcting the original pixel value of the target pixel point according to the original pixel value of a reference pixel point of the same color as the target pixel point in the M*M pixel matrix to obtain a corrected pixel value of the target pixel point after correction, wherein M is a positive odd number greater than 1;

[0012] S3, obtaining the class variance value of the target pixel point according to the corrected pixel value;

[0013] S4, obtaining a target pixel value of the target pixel point according to the class variance value of the target pixel point;

[0014] S5. Repeat steps S2 to S4 to obtain target pixel values ​​of at least a portion of the pixels in the original Bayer image, and reconstruct the original Bayer image according to the target pixel values ​​of at least a portion of the pixels.

[0015] In addition, the image denoising method for a sensor according to the above embodiment of the present invention may also have the following additional technical features:

[0016] In one embodiment of the present invention, correcting the original pixel value of the target pixel point includes:

[0017] In the M*M pixel matrix, corresponding first to fourth reference values ​​are obtained according to the original pixel values ​​of the reference pixel points in the row, column and diagonal where the target pixel point is located, respectively, wherein there are two diagonal lines where the target pixel point is located; the first to fourth reference values ​​are compared to determine the minimum reference value, and the corrected pixel value of the target pixel point is calculated according to the original pixel value of the reference pixel point used to obtain the minimum reference value.

[0018] In one embodiment of the present invention, obtaining the first to fourth reference values ​​according to the original pixel values ​​of the reference pixels in the row, column, and diagonal where the target pixel is located, respectively, includes: calculating the first to fourth reference values ​​according to the following formula: , where DIFF represents a reference value, and n represents the number of reference pixels in the row, column, or diagonal where the target pixel is located. represents the original pixel value of the target pixel point, and P1~Pn represent the original pixel values ​​of the reference pixel points on the row, column or diagonal where the target pixel point is located.

[0019] In one embodiment of the present invention, a corrected pixel value of a target pixel is calculated based on the original pixel values ​​of the reference pixel points used to obtain the minimum reference value, including: adding the original pixel values ​​of the reference pixel points used to obtain the minimum reference value, and dividing by the number of the reference pixel points used to obtain the minimum reference value to obtain the corrected pixel value of the target pixel point.

[0020] In one embodiment of the present invention, the class variance value of the target pixel is obtained by the following formula: ,in is the class variance value of the target pixel, is the original pixel value of any reference pixel point obtained, is the corrected pixel value of the target pixel, is the number of reference pixels.

[0021] In one embodiment of the present invention, a target pixel value of a target pixel point is obtained based on the class variance value of the target pixel point, including: comparing the class variance value of the target pixel point with a denoising intensity interval formed by a preset first empirical threshold and a second empirical threshold; and determining the target pixel value of the target pixel point based on the comparison result.

[0022] In one embodiment of the present invention, before comparing the class variance value of the target pixel point with the denoising intensity interval formed by a preset first empirical threshold and a second empirical threshold, it also includes: calculating a first denoising value based on the original pixel values ​​of all reference pixels in the M*M pixel matrix, and calculating a second denoising value based on the corrected pixel value of the target pixel point.

[0023] In one embodiment of the present invention, the target pixel value of the target pixel is determined according to the comparison result, including: when the class variance value of the target pixel is less than or equal to the first empirical threshold, the first denoising value is determined as the target pixel value of the target pixel; when the class variance value of the target pixel is greater than or equal to the second empirical threshold, the second denoising value is determined as the target pixel value of the target pixel; when the class variance value of the target pixel is greater than the first empirical threshold and less than the second empirical threshold, the target pixel value of the target pixel is obtained by the following formula: in, is the target pixel value of the target pixel, is the first denoising value, is the second denoising value, is the first empirical threshold, is the second empirical threshold.

[0024] The image denoising method of the sensor of the embodiment of the present invention first obtains the original pixel value of each pixel of the original Bayer image, then takes any pixel as the target pixel, determines the pixel matrix with the target pixel as the central pixel, and calculates the corrected pixel value of the corrected target pixel according to the original pixel value of the reference pixel in the matrix, then obtains the class variance value of the target pixel according to the corrected pixel value, and obtains the target pixel value of the target pixel according to the class variance value of the target pixel, and then repeats the above steps to obtain the target pixel value of at least a part of the pixels in the original Bayer image to reconstruct the original Bayer image. The method denoises the image by recalculating the pixel value of each pixel in the image, wherein the pixel is denoised with different intensities according to the size of the class variance value of the pixel, while removing the image noise, the details of the image are guaranteed as much as possible, and the quality of the generated image is further improved, and the complexity of the denoising algorithm is reduced, the computing resources and storage resources occupied by the denoising process are reduced, and the time consumed for image denoising is shortened.

[0025] To achieve the above object, a second embodiment of the present invention provides an image denoising device, comprising:

[0026] A first acquisition module is used to acquire the original pixel value of each pixel point of the original Bayer image;

[0027] A correction module, used to take any pixel as a target pixel, determine an M*M pixel matrix with the target pixel as a central pixel, and correct the original pixel value of the target pixel according to the original pixel value of a reference pixel with the same color as the target pixel in the M*M pixel matrix to obtain a corrected pixel value of the target pixel after correction, wherein M is a positive odd number greater than 1;

[0028] A second acquisition module, used for acquiring a class variance value of the target pixel point according to the corrected pixel value;

[0029] A third acquisition module, used for acquiring a target pixel value of the target pixel point according to the class variance value of the target pixel point;

[0030] A reconstruction module is used to control the correction module, the second acquisition module and the third acquisition module to repeatedly perform corresponding functions to obtain the target pixel values ​​of at least a part of the pixel points in the original Bayer image, and reconstruct the original Bayer image according to the target pixel values ​​of at least a part of the pixel points.

[0031] The image denoising device of the sensor of the embodiment of the present invention denoises the image by recalculating the pixel value of each pixel in the image, wherein the pixel is denoised with different intensities according to the size of the class variance value of the pixel, thereby removing the image noise while ensuring the details of the image as much as possible, further improving the quality of the generated image, reducing the complexity of the denoising algorithm, reducing the computing resources and storage resources occupied by the denoising process, and shortening the time consumed for image denoising.

[0032] In order to achieve the above-mentioned purpose, an embodiment of the third aspect of the present invention proposes an electronic device, including a processor and a memory, wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the image denoising method as described in the above-mentioned embodiment.

[0033] In order to achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image denoising method as described in the above embodiments.

[0034] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0036] Figure 1 A schematic diagram of a flow chart of an image denoising method provided by an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of an original image in a Bell format in the prior art;

[0038] Figure 3 A schematic diagram of a pixel matrix provided by an embodiment of the present invention;

[0039] Figure 4 A schematic flow chart of a specific target pixel correction method provided by an embodiment of the present invention;

[0040] Figure 5 A schematic diagram of a denoising intensity interval distribution provided by an embodiment of the present invention;

[0041] Figure 6 A schematic diagram of the structure of an image denoising device provided by an embodiment of the present invention; and

[0042] Figure 7A schematic diagram of the structure of an electronic device proposed in an embodiment of the present invention. DETAILED DESCRIPTION

[0043] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0044] The following describes an image denoising method, apparatus, device and storage medium according to embodiments of the present invention with reference to the accompanying drawings.

[0045] Figure 1 A schematic diagram of a process flow of an image denoising method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method comprises the following steps:

[0046] S1, obtaining the original pixel value of each pixel point of the original Bayer image.

[0047] Specifically, before denoising the original image to be denoised, first obtain the original image in Bell format, where Figure 2 As shown, the Bell format image is an image in which pixels are arranged in the BG / GR manner as shown in the figure, where each square represents a pixel, and each pixel contains only one color component, B is the blue component of the three primary colors, G is the green component of the three primary colors, and R is the red component of the three primary colors.

[0048] In specific implementation, according to different image denoising application scenarios, the original Bell image and the original pixel value of each pixel in the image can be obtained in a corresponding manner. For example, when denoising an image generated by a COMS image sensor, the parameter configuration of the COMS image sensor can be pre-set so that the sensor outputs the original image in Bell format and indicates the original pixel value of each pixel in the image after collecting the actual image information.

[0049] S2, taking any pixel point as the target pixel point, determining an M*M pixel matrix with the target pixel point as the center pixel point, and correcting the original pixel value of the target pixel point according to the original pixel value of the reference pixel point with the same color as the target pixel point in the M*M pixel matrix to obtain the corrected pixel value of the corrected target pixel point, wherein M is a positive odd number greater than 1.

[0050] The image denoising method of the present invention first denoises each pixel in the original Bayer image. When each pixel is denoised, the original Bayer image is denoised.

[0051] Specifically, firstly, any pixel point in the original Bayer image is selected as the target pixel point to be denoised, and then the target pixel point is used as the central pixel point located at the center of the matrix, and an M*M pixel matrix is ​​determined in the original Bayer image, that is, the pixel matrix contains M rows and M columns, M is a positive odd number greater than 1, and the target pixel point is located at the center of the matrix. In order to facilitate the description of the denoising method of the image in the embodiment of the present invention, as an example, the following can be selected: Figure 3 The pixel matrix shown in FIG. 1 is a pixel matrix in which the arrangement of each pixel point is shown in FIG. Figure 3 It can be seen that the pixel matrix is ​​5*5 in size, and the color of the central pixel is blue, represented by B22.

[0052] Then, all pixels with the same color as the target pixel are selected from the pixel matrix as reference pixels for denoising the target pixel. Since the original pixel value of each pixel has been obtained when the original Bayer image is obtained, the original pixel value corresponding to the reference pixel can be determined when each reference pixel is determined.

[0053] Furthermore, since each reference pixel is a pixel of the same color as the surrounding pixel of the target pixel, the pixel value of the target pixel can be corrected according to the pixel value of each reference pixel to reduce the error of the acquired pixel value of the target pixel and improve the denoising effect of the image.

[0054] In specific implementation, the pixel value of the target pixel point can be corrected in different ways according to the requirement of denoising intensity. As one possible implementation method, the pixel value of the target pixel point can be corrected in different ways. Figure 4 The correction method shown is used for correction. Figure 4 A flowchart of a specific target pixel correction method provided by an embodiment of the present invention is shown below in conjunction with Figure 3 The pixel matrix shown illustrates this method, such as Figure 4 As shown, the method comprises the following steps:

[0055] Step 201, in an M*M pixel matrix, obtain corresponding first to fourth reference values ​​according to the original pixel values ​​of reference pixels on the row, column and diagonal where the target pixel is located, respectively, wherein there are two diagonals where the target pixel is located.

[0056] Specifically, in the pixel matrix of the Bayer image, the location of the reference pixel with the same color as the central pixel can only be located on the row, column and diagonal line where the central pixel is located in the pixel matrix. Figure 3For the pixel matrix shown in the figure, after traversing the pixel matrix, it is determined that the reference pixels with the same color as the target pixel B22 include: reference pixels B12 and B32 on the column where the target pixel B22 is located, reference pixels B21 and B23 on the row where the target pixel B22 is located, reference pixels B11 and B33 on the left diagonal where the target pixel B22 is located, and reference pixels B13 and B31 on the right diagonal where the target pixel B22 is located. Therefore, the original pixel value of the target pixel can be corrected according to the original pixel values ​​of the reference pixels on the row, column, and two diagonal lines where the target pixel is located.

[0057] Specifically, the original pixel values ​​of the reference pixels in the row, column, and diagonal of the target pixel are respectively calculated with the original pixel value of the target pixel to obtain the corresponding first to fourth reference values. As a possible implementation, the first to fourth reference values ​​can be calculated according to the following formula:

[0058]

[0059] Wherein, DIFF represents the reference value corresponding to the row, column or diagonal line where the target pixel is located, and n represents the number of reference pixels in the row, column or diagonal line where the target pixel is located. represents the original pixel value of the target pixel, and P1~Pn represent the original pixel values ​​of each reference pixel on the row, column or diagonal where the target pixel is located.

[0060] Continue to refer to Figure 3 The example shown is explained in detail. The first reference value corresponding to the row where the target pixel B22 is located can be calculated by the following formula: DIFF_H=|2*B22-B21-B23|, where DIFF_H is the first reference value. This formula means multiplying the number of reference pixels 2 on the row where the target pixel is located by the original pixel value of the target pixel, and then subtracting the original pixel values ​​of the B21 reference pixel and the B21 reference pixel in the row to obtain the first reference value corresponding to the row where the target pixel B22 is located. Similarly, the second reference value corresponding to the column where the target pixel B22 is located can be calculated by the following formula: DIFF_V=|2*B22-B12-B32|, where DIFF_V is the second reference value. The third reference value corresponding to the right diagonal where the target pixel B22 is located can be calculated by the following formula: DIFF_X=|2*B22-B13-B31|, where DIFF_X is the third reference value. The fourth reference value corresponding to the left diagonal line where the target pixel point B22 is located can be calculated by the following formula: DIFF_Y=|2*B22-B11-B33|, where DIFF_Y is the fourth reference value.

[0061] Step 202 , comparing the first to fourth reference values, determining a minimum reference value, and calculating a corrected pixel value of a target pixel point based on an original pixel value of a reference pixel point used to obtain the minimum reference value.

[0062] Specifically, the first to fourth reference values ​​are respectively subtracted, and the reference value with the smallest value among the first to fourth reference values ​​is taken as the minimum reference value, and then the corrected pixel value of the target pixel is calculated based on the original pixel values ​​of the multiple reference pixel points used to obtain the minimum reference value. As a possible implementation method, the original pixel values ​​of the multiple reference pixel points used to obtain the minimum reference value can be added and then divided by the number of reference pixel points used to obtain the minimum reference value to obtain the corrected pixel value of the target pixel point.

[0063] Continuing with the above example, if DIFF_H is the minimum reference value, the reference pixels used to obtain the minimum reference value are B21 and B23, and the corrected pixel value of the target pixel B22'=(B21+B23) / 2. Similarly, if DIFF_V is the minimum reference value, the corrected pixel value of the target pixel B22'=(B12+B32) / 2. If DIFF_X is the minimum reference value, the corrected pixel value of the target pixel B22'=(B13+B31) / 2. If DIFF_Y is the minimum reference value, the corrected pixel value of the target pixel B22'=(B11+B33) / 2.

[0064] Therefore, the method generates corresponding first to fourth reference values ​​according to the original pixel values ​​of the reference pixels in the row, column and diagonal where the target pixel is located, and then compares the sizes of the first to fourth reference values ​​to determine the minimum reference value, and determines the corrected pixel value of the target pixel according to the multiple reference pixels used to obtain the minimum reference value, thereby correcting the target pixel, which is beneficial to reducing the error of the pixel value of the target pixel and improving the denoising effect of the image.

[0065] S3, obtaining the class variance value of the target pixel point according to the corrected pixel value.

[0066] Specifically, after obtaining the corrected pixel value of the target pixel, the class variance value of the central pixel can be calculated by combining the original pixel values ​​of multiple reference pixels. As a possible implementation method, the class variance value of the central pixel can be calculated by the following formula:

[0067]

[0068] in, is the class variance value of the target pixel, is the original pixel value of any reference pixel point obtained, is the corrected pixel value of the target pixel point obtained in the above step, is the number of reference pixels.

[0069] For example, Figure 3 The pixel matrix shown is used for calculation to obtain the class variance value STD of the target pixel point = (|B11-B22'|+|B12-B22'|+|B13-B22'|+|B21-B22'|+|B23-B22'|+|B31-B22'|+|B32-B22'|+|B33-B22'|) / 8.

[0070] Therefore, the class variance value of the target pixel is calculated according to the above formula, and the class variance value of the target pixel can reflect the amount of detail at the target pixel. If the class variance value of the target pixel is larger, it indicates that there are more image details at this location. If the class variance value of the target pixel is smaller, it indicates that there are fewer image details at this location. This facilitates the subsequent denoising process of corresponding intensity according to the size of the class variance value of the target pixel.

[0071] It should be noted that in order to facilitate subsequent denoising of different intensities on the target pixel, in one embodiment of the present invention, the first denoising value and the second denoising value of the target pixel can also be calculated based on the corrected pixel value of the target pixel and the original pixel values ​​of multiple reference pixels.

[0072] The first denoising value is the strongest denoising value that can be achieved by the target pixel, and the second denoising value is the weakest denoising value that can be achieved by the target pixel. In specific implementation, the sum of the original pixel values ​​of all reference pixels in the obtained M*M pixel matrix can be divided by the number of all reference pixels to calculate the first denoising value, and the corrected pixel value of the target pixel is used as the second denoising value.

[0073] Continue to refer to Figure 3 In the example shown, the first denoising value of the target pixel point of the M*M pixel matrix is ​​B_DE_S=(B11+B12+B13+B21+B23+B31+B32+B33) / 8, and the second denoising value is equal to B_DE_W=B22'.

[0074] S4. Obtain a target pixel value of the target pixel according to the class variance value of the target pixel.

[0075] Among them, when the target pixel value of the target pixel is obtained according to the class variance value of the target pixel point to denoise the target pixel point, since the class variance value of the target pixel point can reflect the amount of detail at the target pixel point, in one embodiment of the present invention, denoising processing of corresponding intensity can be performed according to the size of the class variance value of the target pixel point. When the class variance value of the target pixel point is large, weaker denoising processing is performed to avoid affecting the details in the image. When the class variance value of the target pixel point is large, stronger denoising processing is performed to remove as much noise as possible.

[0076] In specific implementation, as a possible implementation manner, the class variance value of the target pixel point may be first compared with the denoising intensity interval formed by the preset first empirical threshold and the second empirical threshold.

[0077] Among them, the first empirical threshold and the second empirical threshold are thresholds representing the degree of detail at the pixel point obtained in advance through a large number of experiments. When it is less than the first empirical threshold, it indicates that the amount of detail at this location is small. When it is greater than the second empirical threshold, it indicates that the amount of detail at this location is large. Therefore, three denoising intensity intervals can be formed in advance through the first empirical threshold and the second empirical threshold. After determining the class variance value of the target pixel point, the class variance value of the target pixel point is compared with the preset three denoising intensity intervals to determine the denoising intensity interval in which the class variance value of the target pixel point is located, and then the amount of detail at the target pixel point is determined.

[0078] Then, according to the comparison result, the target pixel value of the corresponding target pixel point is determined, so as to perform denoising processing to different degrees on the target pixel point.

[0079] Specifically, Figure 5 As shown, when the class variance value of the target pixel point is less than or equal to the first empirical threshold, the target pixel value of the target pixel point is equal to the first denoising value, when the class variance value of the target pixel point is greater than or equal to the second empirical threshold, the target pixel value of the target pixel point is equal to the second denoising value, when the class variance value of the target pixel point is in the denoising intensity interval greater than the first empirical threshold and less than the second empirical threshold, the target pixel value of the target pixel point is obtained by the following formula:

[0080]

[0081] in, is the target pixel value of the target pixel, is the first denoising value, is the second denoising value, is the first empirical threshold, is the second empirical threshold.

[0082] Therefore, the central pixel is subjected to denoising processing of different intensities according to the class variance value of the target pixel, thereby removing image noise while maintaining the image details as much as possible, further improving the quality of the generated image.

[0083] S5. Repeat steps S2 to S4 to obtain target pixel values ​​of at least a portion of the pixels in the original Bayer image, and reconstruct the original Bayer image according to the target pixel values ​​of at least a portion of the pixels.

[0084] Specifically, after denoising the target pixel, any other pixel can be selected from each pixel of the original Bayer image as a new target pixel, and the target pixel of the target pixel can be obtained according to the method in steps S2 to S4 to denoise the target pixel. In this way, the target pixel value of at least a part of the pixels in the original Bayer image can be obtained.

[0085] It can be understood that in the original Bell image, there may be a pixel point that cannot be used as the center pixel point to form a pixel matrix, such as a pixel point at the corner of the original Bell image, or a pixel point located in the first row. Therefore, the above method may only be able to obtain the target pixel values ​​of a portion of the pixels in the original Bell image, and this portion of pixels is the pixel point that can be used as the center pixel point to form the above M*M pixel matrix. Furthermore, for the pixel points that cannot form the center pixel point of the above M*M pixel matrix, they can be processed in different ways, so that the original Bell image can be reconstructed based on the target pixel value of at least a portion of the pixels, thereby achieving denoising of the entire original Bell image.

[0086] As an example, the pixels that cannot serve as the central pixels to form the M*M pixel matrix are controlled to be displayed according to the original pixel values, and the original Bayer image is reconstructed in combination with the target pixel values ​​of a part of the pixels that have been acquired, that is, a part of the pixels after denoising are controlled to display the corresponding target pixel values, and the pixels that cannot form the pixel matrix are controlled to be displayed according to the original pixel values, thereby forming a denoised Bayer image.

[0087] As another example, the surrounding pixels that cannot form a pixel matrix are supplemented by mirror copying so that they can form a pixel matrix as a central pixel. For example, for the pixels in the first row, the pixels in the second and third rows can be mirrored and copied onto the first row, so that the pixels in the original first row become the third row, thereby forming the above 5*5 pixel matrix. Then, the target pixel value of the pixel is calculated according to the method in the above steps S2 to S4, and then, combined with the target pixel values ​​of a part of the pixels that have been obtained, the denoised Bayer image is reconstructed through the target pixel values ​​of all the pixels in the original Bayer image.

[0088] Therefore, the image denoising method of the embodiment of the present invention performs denoising on the entire acquired original Bayer image, and performs denoising of different intensities on the local details of the image during the denoising process. In addition, since the method only needs to calculate a small number of data values ​​such as the correction value and class variance value of the central pixel point, it is easy to implement, occupies less computing resources and storage resources, and is conducive to application to image sensors with strong real-time requirements.

[0089] In summary, the denoising method of an image in an embodiment of the present invention first obtains the original pixel value of each pixel of the original Bayer image, then takes any pixel as the target pixel, determines a pixel matrix with the target pixel as the central pixel, and calculates the corrected pixel value of the corrected target pixel according to the original pixel value of the reference pixel in the matrix, then obtains the class variance value of the target pixel according to the corrected pixel value, and obtains the target pixel value of the target pixel according to the class variance value of the target pixel, and then repeats the above steps to obtain the target pixel value of at least a part of the pixels in the original Bayer image to reconstruct the original Bayer image. The method denoises the image by recalculating the pixel value of each pixel in the image, wherein the pixel is denoised with different intensities according to the size of the class variance value of the pixel, while removing the image noise, the details of the image are guaranteed as much as possible, and the quality of the generated image is further improved, and the complexity of the denoising algorithm is reduced, the computing resources and storage resources occupied by the denoising process are reduced, and the time consumed for image denoising is shortened.

[0090] In order to implement the above embodiment, the embodiment of the present invention further provides an image denoising device. Figure 6 A schematic diagram of the structure of an image denoising device provided by an embodiment of the present invention.

[0091] like Figure 6 As shown, the image denoising device includes: a first acquisition module 100 , a correction module 200 , a second acquisition module 300 , a third acquisition module 400 and a reconstruction module 500 .

[0092] The acquisition module 100 is used to acquire the original pixel value of each pixel point of the original Bayer image.

[0093] The correction module 200 is used to take any pixel point as the target pixel point, determine an M*M pixel matrix with the target pixel point as the center pixel point, and correct the original pixel value of the target pixel point according to the original pixel value of the reference pixel point with the same color as the target pixel point in the M*M pixel matrix to obtain the corrected pixel value of the corrected target pixel point, wherein M is a positive odd number greater than 1.

[0094] The second acquisition module 300 is used to acquire the class variance value of the target pixel point according to the corrected pixel value.

[0095] The third acquisition module 400 is used to acquire the target pixel value of the target pixel point according to the class variance value of the target pixel point.

[0096] The reconstruction module 500 is used to control the correction module 200, the second acquisition module 300 and the third acquisition module 400 to repeatedly execute corresponding functions to obtain the target pixel values ​​of at least a part of the pixels in the original Bayer image, and reconstruct the original Bayer image according to the target pixel values ​​of at least a part of the pixels.

[0097] In a possible implementation method of an embodiment of the present invention, the correction module 200 is specifically used to obtain corresponding first to fourth reference values ​​according to the original pixel values ​​of the reference pixel points in the row, column and diagonal where the target pixel point is located, respectively, where there are two diagonal lines where the target pixel point is located, and then, compare the sizes of the first to fourth reference values, determine the minimum reference value, and calculate the corrected pixel value of the target pixel point based on the original pixel value of the reference pixel point used to obtain the minimum reference value.

[0098] Specifically, as an example, the correction module 200 is specifically used to calculate the first to fourth reference values ​​according to the following formula:

[0099]

[0100] Where DIFF represents the reference value, n represents the number of reference pixels in the row, column or diagonal where the target pixel is located, represents the original pixel value of the target pixel, and P1~Pn represent the original pixel values ​​of the reference pixels on the row, column or diagonal where the target pixel is located.

[0101] Furthermore, the correction module 200 is further configured to add the original pixel values ​​of a plurality of reference pixels used to obtain the minimum reference value, and then divide the sum by the number of reference pixels used to obtain the minimum reference value, so as to obtain the corrected pixel value of the target pixel.

[0102] In a possible implementation manner of the embodiment of the present invention, the second acquisition module 300 is further configured to acquire the class variance value of the target pixel point by using the following formula:

[0103]

[0104] in, is the class variance value of the target pixel, is the original pixel value of any reference pixel point obtained, is the corrected pixel value of the target pixel, is the number of reference pixels.

[0105] In a possible implementation of the embodiment of the present invention, the second acquisition 300 is also used to calculate the first denoising value according to the original pixel values ​​of all reference pixels in the M*M pixel matrix, and to calculate the second denoising value according to the corrected pixel value of the target pixel.

[0106] Furthermore, in a possible implementation of an embodiment of the present invention, the third acquisition module 400 is specifically used to compare the class variance value of the target pixel point with the denoising intensity interval formed by a preset first empirical threshold and a second empirical threshold, and then determine the target pixel value of the target pixel point based on the comparison result.

[0107] As an example, when the class variance value of the target pixel point is less than or equal to the first empirical threshold, the first denoising value is determined as the target pixel value of the target pixel point; when the class variance value of the target pixel point is greater than or equal to the second empirical threshold, the second denoising value is determined as the target pixel value of the target pixel point; when the class variance value of the target pixel point is in the target denoising intensity interval greater than the first empirical threshold and less than the second empirical threshold, the target pixel value of the target pixel point is obtained by the following formula:

[0108]

[0109] in, is the target pixel value of the target pixel, is the first denoising value, is the second denoising value, is the first empirical threshold, is the second empirical threshold.

[0110] It should be noted that the above explanation of the embodiment of the image denoising method is also applicable to the image denoising device of this embodiment, which will not be described in detail here.

[0111] In summary, the image denoising device of the embodiment of the present invention denoises the image by recalculating the pixel value of each pixel in the image, wherein the pixel points are denoised with different intensities according to the size of the class variance value of the pixel points, thereby removing the image noise while ensuring the details of the image as much as possible, further improving the quality of the generated image, and reducing the complexity of the denoising algorithm, reducing the computing resources and storage resources occupied by the denoising process, and shortening the time consumed for image denoising.

[0112] In order to implement the above embodiment, the present invention also provides an electronic device.

[0113] Figure 7 This is a schematic diagram of the structure of an electronic device proposed in one embodiment of the present application. Figure 7 As shown, the electronic device 120 includes: a processor 121 and a memory 122; the memory 122 is used to store executable program codes; the processor 121 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 122, so as to implement the image denoising method as described in the above embodiment.

[0114] In order to implement the above embodiments, the present invention further proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the image denoising method as described in the above embodiments is implemented.

[0115] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0116] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0117] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0118] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0119] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0120] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0121] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0122] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for denoising an image, characterized in that: include: S1, obtaining the original pixel value of each pixel point of the original Bayer image; S2, taking any pixel point as a target pixel point, determining an M*M pixel matrix with the target pixel point as a central pixel point, and correcting the original pixel value of the target pixel point according to the original pixel value of a reference pixel point of the same color as the target pixel point in the M*M pixel matrix to obtain a corrected pixel value of the target pixel point after correction, wherein M is a positive odd number greater than 1; S3, obtaining the class variance value of the target pixel point according to the corrected pixel value; S4, obtaining a target pixel value of the target pixel point according to the class variance value of the target pixel point; S5. Repeat steps S2 to S4 to obtain target pixel values ​​of at least a portion of the pixels in the original Bayer image, and reconstruct the original Bayer image according to the target pixel values ​​of at least a portion of the pixels.

2. The image denoising method according to claim 1, wherein: The correcting the original pixel value of the target pixel point according to the original pixel value of the reference pixel point having the same color as the target pixel point in the M*M pixel matrix includes: In the M*M pixel matrix, obtaining corresponding first to fourth reference values ​​according to the original pixel values ​​of the reference pixel points on the row, column and diagonal where the target pixel point is located, respectively, wherein there are two diagonal lines where the target pixel point is located; The first to fourth reference values ​​are compared to determine a minimum reference value, and the corrected pixel value of the target pixel is calculated based on the original pixel value of the reference pixel used to obtain the minimum reference value.

3. The image denoising method according to claim 2, wherein: The obtaining first to fourth reference values ​​according to the original pixel values ​​of the reference pixel points in the row, column and diagonal where the target pixel point is located respectively includes: The first to fourth reference values ​​are calculated according to the following formula: Wherein, DIFF represents a reference value, n represents the number of reference pixels in the row, column or diagonal where the target pixel is located, represents the original pixel value of the target pixel point, and P1~Pn represent the original pixel value of the reference pixel point on the row, column or diagonal where the target pixel point is located.

4. The image denoising method according to claim 2, wherein: The calculating the corrected pixel value of the target pixel point according to the original pixel value of the reference pixel point used to obtain the minimum reference value includes: The original pixel values ​​of the reference pixels used to obtain the minimum reference value are added and then divided by the number of the reference pixels used to obtain the minimum reference value to obtain the corrected pixel value of the target pixel.

5. The image denoising method according to claim 1, wherein: The class variance value of the target pixel is obtained by the following formula: in, is the class variance value of the target pixel, is the original pixel value of any reference pixel point obtained, is the corrected pixel value of the target pixel, is the number of reference pixels.

6. The image denoising method according to claim 5, characterized in that: The step of obtaining a target pixel value of the target pixel point according to the class variance value of the target pixel point comprises: Compare the class variance value of the target pixel with a denoising intensity interval consisting of a preset first empirical threshold and a second empirical threshold; According to the comparison result, the target pixel value of the target pixel is determined.

7. The image denoising method according to claim 6, wherein: Before comparing the class variance value of the target pixel point with the denoising intensity interval formed by the preset first empirical threshold and the second empirical threshold, the method further includes: A first denoised value is calculated according to the original pixel values ​​of all reference pixels in the M*M pixel matrix, and a second denoised value is calculated according to the corrected pixel value of the target pixel.

8. The image denoising method according to claim 7, wherein determining the target pixel value of the target pixel point according to the comparison result comprises: When the class variance value of the target pixel point is less than or equal to a first empirical threshold, determining the first denoising value as a target pixel value of the target pixel point; When the class variance value of the target pixel point is greater than or equal to a second empirical threshold, determining the second denoising value as the target pixel value of the target pixel point; When the class variance value of the target pixel point is greater than the first empirical threshold and less than the second empirical threshold, the target pixel value of the target pixel point is obtained by the following formula: in, is the target pixel value of the target pixel, is the first denoising value, is the second denoising value, is the first empirical threshold, is the second empirical threshold.

9. An image denoising device, characterized in that: include: A first acquisition module is used to acquire the original pixel value of each pixel point of the original Bayer image; A correction module, used to take any pixel as a target pixel, determine an M*M pixel matrix with the target pixel as a central pixel, and correct the original pixel value of the target pixel according to the original pixel value of a reference pixel with the same color as the target pixel in the M*M pixel matrix to obtain a corrected pixel value of the target pixel after correction, wherein M is a positive odd number greater than 1; A second acquisition module, used for acquiring a class variance value of the target pixel point according to the corrected pixel value; A third acquisition module, used for acquiring a target pixel value of the target pixel point according to the class variance value of the target pixel point; A reconstruction module is used to control the correction module, the second acquisition module and the third acquisition module to repeatedly perform corresponding functions to obtain the target pixel values ​​of at least a part of the pixel points in the original Bayer image, and reconstruct the original Bayer image according to the target pixel values ​​of at least a part of the pixel points.

10. An electronic device, characterized in that: Including memory and processor; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the image denoising method as described in any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the image denoising method as described in any one of claims 1 to 8 is implemented.