Image denoising method, electronic device and computer readable storage medium
By interpolating Bayer format images to generate guide maps and then using these guide maps for noise reduction, the problem of not being able to effectively utilize image gradient information in existing technologies is solved, thus improving the image quality of color imaging.
Patent Information
- Application Number
- CN202210989359.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-08-17
AI Technical Summary
Existing technologies cannot effectively utilize image gradient information and useful information from channels with lower noise in the Bayer format during color imaging, resulting in poor image quality after noise reduction.
By interpolating Bayer format image data, a guide map is generated, and the guide map is used to denoise the image while preserving the gradient information of the original image.
It improves the quality of the denoised image, prevents the loss of gradient information, and enhances the visual consistency and clarity of the image.
Smart Images

Figure CN115471412B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to an image noise reduction method, electronic device, and computer-readable storage medium. Background Technology
[0002] Images have a wide range of applications, spanning various fields, and their quality directly affects their effectiveness in these applications. However, images are inevitably subject to noise interference during acquisition, processing, and transmission. Therefore, filtering out noise from images is of paramount importance.
[0003] In existing technologies, interpolation and noise reduction are two important steps in color imaging. The traditional method is to interpolate the acquired Bayer format image to obtain the RGB format image, and then perform independent noise reduction on each channel of the RGB format image. However, the traditional method cannot utilize the useful information of the less noisy channels, nor does it utilize the gradient information of the Bayer format image, which is not conducive to improving the image quality after noise reduction. Summary of the Invention
[0004] This application proposes an image denoising method, an electronic device, and a computer-readable storage medium. It proposes to use a guide map for multi-channel denoising, making full use of the gradient information of the original image to denoise the image, thereby improving the quality of the denoised image.
[0005] To solve the above-mentioned technical problems, one technical solution adopted in this application is: to provide an image noise reduction method, the method comprising:
[0006] Interpolation processing is performed on the first image data in the first format to obtain the second image data in the second format; a guide map is generated based on the first image data and the second image data; the guide map is used to perform noise reduction processing on the first image data to obtain the noise-reduced image data.
[0007] The process of generating a guide map based on the first image data and the second image data includes:
[0008] Optimization parameters are obtained based on the first image data and the second image data; a guide map is obtained based on the optimization parameters and the second image data.
[0009] The second image data includes first color channel data, second color channel data, and third color channel data. The optimization variable parameters obtained based on the first and second image data include:
[0010] The first gradient matrix is calculated based on the first image data and the first gradient function; the second gradient matrix is calculated based on the first color channel data, the second color channel data, the third color channel data, and the first gradient function; the product between the inverse of the second gradient matrix and the first gradient matrix is obtained to obtain the optimization parameters.
[0011] The optimization parameters include a first optimization parameter, a second optimization parameter, and a third optimization parameter. A guide map is obtained based on the optimization variable parameters and the second image data, including:
[0012] Calculate the first product matrix of the first optimization parameter and the first color channel data, the second product matrix of the second optimization parameter and the second color channel data, and the third product matrix of the third optimization parameter and the third color channel data; calculate the sum of the first product matrix, the second product matrix, and the third product matrix to obtain the guide map.
[0013] The process of using a guide map to denoise the first image data to obtain denoised image data includes:
[0014] Obtain the second gradient function, the third gradient function, the first gradient intensity of the guide graph, and the second gradient intensity of the first image data; use the second gradient function, the third gradient function, the first gradient intensity, the second gradient intensity, and the guide graph to perform noise reduction processing on the first image data to obtain the noise-reduced image data.
[0015] The second gradient function includes a first direction matrix and a second direction matrix, and the third gradient function includes a third direction matrix and a fourth direction matrix. The first image data is denoised using the second gradient function, the third gradient function, the strength of the first gradient, the strength of the second gradient, and the guiding graph to obtain denoised image data, including:
[0016] Calculate the first square matrix of the first direction matrix, the second square matrix of the second direction matrix, the third square matrix of the third direction matrix, and the fourth square matrix of the fourth direction matrix, respectively. Calculate the product of the sum of the first and second square matrices and the first gradient intensity to obtain the fourth product matrix. Calculate the product of the sum of the third and fourth square matrices and the second gradient intensity to obtain the fifth product matrix. Calculate the first sum matrix of the identity matrix, the fourth product matrix, and the fifth product matrix, and calculate the inverse matrix of the first sum matrix. Calculate the product between the guide map and the first and second square matrices to obtain the sixth and seventh product matrices, respectively. Calculate the product between the first image data and the third and fourth square matrices, respectively, to obtain the eighth and ninth product matrices, respectively. Calculate the second sum matrix between the first image data, the sum of the sixth and seventh product matrices and the product of the first gradient intensity, and the sum of the eighth and ninth product matrices and the product of the second gradient intensity. Calculate the product between the inverse matrix of the first sum matrix and the second sum matrix to obtain the denoised image data.
[0017] The values of the first gradient intensity and the second gradient intensity range from 0 to 3.
[0018] The first format is Bayer format, the second format is RGB format, and the interpolation process includes bilinear interpolation.
[0019] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, which includes a processor and a memory connected to the processor, wherein the memory stores program data, and the processor executes the program data stored in the memory to execute the image noise reduction method that implements any of the above-mentioned methods.
[0020] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium that stores program instructions internally, and the program instructions are executed to implement the image noise reduction method of any of the above-mentioned methods.
[0021] The beneficial effects of this application are as follows: Unlike the prior art, the image denoising method of this application interpolates the first image data in the first format to obtain the second image data in the second format, then uses the first image data and the second image data to generate a guide map to guide denoising, and finally uses the guide map to perform denoising processing on the image. Since the guide map retains the gradient information of the original first image data, it can prevent the lack of gradient information in the denoised image, thereby improving the quality of the denoised image. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating the first embodiment of the inter-frame prediction method of this application;
[0023] Figure 2 yes Figure 1 A detailed flowchart of step S102;
[0024] Figure 3 yes Figure 2 A detailed flowchart of step S201;
[0025] Figure 4 yes Figure 2 A detailed flowchart of step S202;
[0026] Figure 5 yes Figure 1 A detailed flowchart of step S103;
[0027] Figure 6 yes Figure 5 A detailed flowchart of step S502;
[0028] Figure 7 This is a schematic diagram of the structure of an embodiment of the electronic device of this application;
[0029] Figure 8 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0031] In color imaging, interpolation and noise reduction are two crucial steps. Interpolation is the core algorithm for restoring the acquired image to a color image, while noise reduction is fundamental to ensuring high-quality images. Current technologies typically perform noise reduction on each channel of the color image independently, failing to utilize gradient information from the acquired image or useful information from channels with lower noise levels.
[0032] To fully utilize the gradient information and useful information from channels with lower noise in the acquired images, this application first proposes an image denoising method. Please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the inter-frame prediction method of this application. Figure 1 As shown, the method specifically includes steps S101 to S103:
[0033] Step S101: Interpolate the first image data in the first format to obtain the second image data in the second format.
[0034] During the interpolation operation in the process of color imaging, the electronic device first needs to acquire image data and then perform interpolation processing on the acquired first image data in the first format to obtain second image data in the second format.
[0035] In this embodiment, the first format is Bayer format and the second format is RGB format.
[0036] Bayer format images are widely used in digital imaging. When acquiring color images, it's typically necessary to capture multiple basic colors, such as RGB. The simplest method is to use filters: a red filter transmits red wavelengths, a green filter transmits green wavelengths, and a blue filter transmits blue wavelengths. However, capturing all three RGB colors requires three filters, which is costly and difficult to manufacture because each pixel must be perfectly aligned. The Bayer format solves this problem effectively. Each pixel in a Bayer format image uses only one color filter. However, the first image data in Bayer format only contains a portion of the image data. Therefore, during imaging, interpolation must be performed on the first image data in Bayer format to obtain the second image data in RGB format. In this embodiment, bilinear interpolation can be used. In other embodiments, other interpolation methods can be used, such as nearest-neighbor copying, which are not limited here.
[0037] Step S102: Generate a guide map based on the first image data and the second image data.
[0038] After acquiring the first image data in Bayer format and the second image data in interpolated RGB format, the electronic device can generate a guide map based on the first and second image data. The second image data in interpolated RGB format includes the first color channel data R, the second color channel data G, and the third color channel data B.
[0039] In order to include as much gradient information as possible from the original Bayer format first image data in the generated guide map, the optimization parameters can be obtained using the first energy formula (1) in this embodiment. Formula (1) is shown below:
[0040]
[0041] Wherein, R, G, and B are the first color channel data, the second color channel data, and the third color channel data of the second image data, respectively, fi The function can be represented as the difference between adjacent pixels, where i = 1, 2, 3, f1 is the first gradient function; w1, w2 and w3 are optimization parameters, bayer is the first image data, min(*) means finding the minimum value of *, and E(w) means the minimum squared difference.
[0042] After optimizing formula (1), the values of w1, w2, and w3 can be obtained. Then, by using the first color channel data, the second color channel data, and the third color channel data of the second image data and the optimization parameters, the guide map can be generated. In this embodiment, the guide map can be obtained using formula (2), which is shown below:
[0043] Guide=w1R+w2G+w3B (2)
[0044] Here, "Guide" refers to a directional map.
[0045] Step S103: Use the guide map to perform noise reduction processing on the first image data to obtain the noise-reduced image data.
[0046] After obtaining the guide map using the above formulas (1) and (2), the electronic device can use the guide map to perform noise reduction processing on the first image data, thereby obtaining the noise-reduced image data I. The noise-reduced image data, while filtering out noise, needs to be visually consistent with the original first image data, and the gradient information should be as consistent as possible with the guide map and the first image data. Based on this idea, a second energy formula (3) is designed in this embodiment, as shown below:
[0047]
[0048] Where I is the denoised image data, f2 is the second gradient function, f3 is the third gradient function, α and β are the first gradient intensity of the guide map and the second gradient intensity of the bayer image data, respectively, min(*) represents finding the minimum value of *, where bayer is the first image data and guide is the guide map.
[0049] By optimizing and differentiating the above formula (3), the denoised image data I can be obtained, where the denoised image data I is as shown in formula (4):
[0050]
[0051] L is shown in formula (5):
[0052]
[0053] Where I represents the denoised image data, α and β are the first gradient intensity of the guide map and the second gradient intensity of the bayer of the first image data, respectively, H is the identity matrix, and D... X1 D y1 These are the first direction matrix and the second direction matrix of the second gradient function, respectively; D X2 D y2 These are the third direction matrix and the fourth direction matrix of the third gradient function, respectively. Bayer represents the first image data, and Guide represents the guide map.
[0054] Unlike existing technologies, the image denoising method of this application interpolates the first image data in a first format to obtain the second image data in a second format. Then, it uses the first and second image data to generate a guide map to guide denoising. The guide map generated using the first image data fully preserves the gradient information of the original first image data. When the guide map is used to denoise the image, because the guide map preserves the gradient information of the original first image data, it can prevent the loss of gradient information in the denoised image, thereby improving the quality of the denoised image.
[0055] Optionally, the method for generating the guide map is as follows: Figure 2 As shown, please refer to Figure 2 , Figure 2 yes Figure 1 A detailed flowchart of step S102 is shown in this embodiment. This embodiment can be achieved through, as follows: Figure 2 The method shown implements step S102, and the specific implementation steps include steps S201 to S202:
[0056] Step S201: Obtain optimization parameters based on the first image data and the second image data.
[0057] In this embodiment, in order to preserve the gradient information of the original first image data as much as possible in the guide map, a first energy formula (1) is designed, as shown in formula (1). When formula (1) is optimized, that is, when E(w) is the minimum value 0, the optimization parameters w1, w2 and w3 can be calculated and obtained based on the first image data and the second image data.
[0058] In this application, the f function can be represented as the difference between adjacent pixels. In formula (1), f1 is the first gradient function, which is a gradient calculation method. To obtain the optimization parameters w1, w2, and w3 of the guide map, the first image data and the second image data in formula (1) must be calculated using the same gradient function. When calculating image data, the image is two-dimensional, but when calculating image data, it is usually converted into one-dimensional calculation. In this embodiment, x can be used to represent the two-dimensional coordinates of the first position of the image, and y can be used to represent the two-dimensional coordinates of the second position of the image. Formula (1) can then be expressed as formula (6), which is shown below:
[0059]
[0060] Where x represents the two-dimensional coordinates of the first pixel in the image, y represents the two-dimensional coordinates of the second pixel in the image, (R x -R y (G) represents the gradient information of the first color channel, obtained by subtracting the R-value at coordinate x and coordinate y from the R-value at coordinate y in the image data of the first color channel. x -G y (B) represents the gradient information of the second color channel. x -B y ) represents the gradient information of the third color channel, δ x,y This is represented as gradient information from the first image data.
[0061] If (R) is used x -R y ), (G x -G y (B) x -B y Let m1, m2, and m3 be represented respectively. Then, formula (6) can be expressed as formula (7), which is shown below:
[0062]
[0063] Optionally, please refer to Figure 3 , Figure 3 yes Figure 2 A detailed flowchart of step S201 is shown. The second image data includes first color channel data R, second color channel data G, and third color channel data B. For example... Figure 3 As shown, step S201 can be implemented in this embodiment by the following method, and the specific implementation steps include steps S301 to S303:
[0064] Step S301: Calculate the first gradient matrix based on the first image data and the first gradient function.
[0065] When the electronic device calculates the first gradient matrix based on the first image data and the first gradient function, it can optimize the above formula (7), which is E(w) = 0. Formula (8) can then be obtained, as shown below:
[0066]
[0067] In this embodiment, the electronic device can calculate the first gradient function of the first image data based on the first image data and the first gradient function f1. The first gradient matrix is shown on the right side of the equation (8). Wherein, δ x,y The gradient information of the first image data is represented by m. 1,x,y m 2,x,y and m 3,x,y They are equivalent to m1, m2 and m3 in formula (7), respectively, and represent the gradient information of the first color channel, the gradient information of the second color channel and the gradient information of the third color channel.
[0068] Step S302: Calculate the second gradient matrix based on the first color channel data, the second color channel data, the third color channel data, and the first gradient function.
[0069] The electronic device calculates the second gradient matrix based on the first color channel data, the second color channel data, the third color channel data, and the first gradient function. The second gradient matrix is shown on the leftmost side of the equal sign in formula (8).
[0070] Step S303: Obtain the product between the inverse of the second gradient matrix and the first gradient matrix to obtain the optimization parameters.
[0071] The electronic device can obtain the product between the inverse of the second gradient matrix and the first gradient matrix by inverting the second gradient matrix, thereby obtaining the optimization parameters w1, w2 and w3, as shown in the following formula (9):
[0072]
[0073] Step S202: Obtain a guide map based on optimized parameters and second image data.
[0074] After obtaining the optimized parameters through the above formula (9), the electronic device multiplies the optimized parameters with the color channel data corresponding to the second image data based on formula (2) and adds them together to obtain the guide map.
[0075] Optionally, please refer to Figure 4 , Figure 4 yes Figure 2 A detailed flowchart of step S202 is shown. The optimization parameters include a first optimization parameter, a second optimization parameter, and a third optimization parameter. For example... Figure 4As shown, step S202 can be implemented in this embodiment by the following method, and the specific implementation steps include steps S401 to S402:
[0076] Step S401: Calculate and obtain the first product matrix of the first optimization parameter and the first color channel data, the second product matrix of the second optimization parameter and the second color channel data, and the third product matrix of the third optimization parameter and the third color channel data.
[0077] In this embodiment, as shown in formula (2), the first product matrix w1R of the first optimization parameter w1 and the first color channel data R is calculated, the second product matrix w2G of the second optimization parameter w2 and the second color channel data G is calculated, and the third product matrix w3B of the third optimization parameter w3 and the third color channel data G is calculated.
[0078] Step S402: Calculate the sum of the first product matrix, the second product matrix, and the third product matrix to obtain the guide map.
[0079] After the electronic device calculates and obtains the first product matrix w1R, the second product matrix w2G and the third product matrix w3B, it calculates the sum of the three as shown in formula (2) to obtain the guide map.
[0080] Optionally, the method for obtaining denoised image data using a guide map is as follows: Figure 5 As shown, please refer to Figure 5 , Figure 5 yes Figure 1 A detailed flowchart of step S103 is shown in this embodiment. Figure 5 The method shown implements step S103, and the specific implementation steps include steps S501 to S502:
[0081] Step S501: Obtain the second gradient function, the third gradient function, the first gradient intensity of the guide graph, and the second gradient intensity of the first image data.
[0082] When electronic devices use guide maps to perform noise reduction on the first image data, as shown in formula (3), the second gradient function f2 and the third gradient function f3 in formula (3) must first be obtained. The gradient calculation methods of the first gradient function f1, the second gradient function f2 and the third gradient function f3 are different.
[0083] Furthermore, it is also necessary to obtain the first gradient intensity α of the guide map and the second gradient intensity β of the first image data in formula (3). Among them, the larger the values of the first gradient intensity α and the second gradient intensity β, the closer they are to the corresponding gradient.
[0084] In this embodiment, the values of the first gradient intensity and the second gradient intensity can be set to 0 to 3. In other embodiments, their value ranges can be adjusted according to specific needs.
[0085] Step S502: Use the second gradient function, the third gradient function, the intensity of the first gradient, the intensity of the second gradient, and the guide map to perform noise reduction on the first image data to obtain the noise-reduced image data.
[0086] As shown in formulas (3) and (4), in this embodiment, formula (4) is obtained by taking the derivative of formula (3). The first gradient intensity α of the guide map, the second gradient intensity β of the first image data, the second gradient function f2, the third gradient function f3 and the guide map are used to perform noise reduction processing on the first image data bayer to obtain the noise-reduced image data I.
[0087] Optionally, please refer to Figure 6 Please see Figure 6 , Figure 6 yes Figure 5 A detailed flowchart of step S502 is shown below. The second gradient function f2 includes the first direction matrix D. X1 and the second direction matrix D y1 The third gradient function f3 includes the third direction matrix D. X2 and the fourth direction matrix D y2 .like Figure 6 As shown, step S502 can be implemented in this embodiment by the following method, and the specific implementation steps include steps S601 to S607:
[0088] Step S601: Calculate the first square matrix of the first direction matrix, the second square matrix of the second direction matrix, the third square matrix of the third direction matrix, and the fourth square matrix of the fourth direction matrix, respectively.
[0089] As shown in formula (4), the electronic device first calculates the first direction matrix D. X1 First phalanx Second direction matrix D y1 The second square Third direction matrix D X2 third-party array Fourth direction matrix D y2 The fourth square
[0090] Step S602: Calculate the product of the sum of the first square matrix and the second square matrix and the intensity of the first gradient action to obtain the fourth product matrix.
[0091] The first square matrix is calculated as described above. With the second square The sum of these products is multiplied by the intensity α of the first gradient to obtain the fourth product matrix.
[0092] Step S603: Calculate the product of the sum of the third and fourth square matrices and the intensity of the second gradient action to obtain the fifth product matrix.
[0093] Electronic devices recalculate third-party array With the fourth square The sum of these products is multiplied by the intensity α of the first gradient to obtain the fifth product matrix.
[0094] Step S604: Calculate the first sum matrix of the identity matrix, the fourth product matrix, and the fifth product matrix, and calculate the inverse matrix of the first sum matrix.
[0095] Calculate the identity matrix H, the first sum of the fourth and fifth product matrices, and the inverse of the first sum matrix.
[0096] Step S605: Calculate the product between the guide map and the first square matrix and the second square matrix respectively to obtain the sixth product matrix and the seventh product matrix; and calculate the product between the first image data and the third square matrix and the fourth square matrix respectively to obtain the eighth product matrix and the ninth product matrix respectively.
[0097] As shown in formula (5), the electronic device then calculates the Guide and the first matrix respectively. Second Formation The product of these is used to obtain the sixth product matrix. Seventh product matrix Then calculate the first image data Bayer and the third matrix respectively. and the fourth square The eighth product matrix between Ninth product matrix
[0098] Step S606: Calculate the second sum matrix between the first image data, the product of the sum of the sixth and seventh product matrices and the first gradient intensity, and the product of the sum of the eighth and ninth product matrices and the second gradient intensity.
[0099] The electronic device calculates the first image data Bayer and the sixth product matrix based on formula (5). With the seventh product matrix The sum of these products multiplied by the intensity of the first gradient α, and the eighth product matrix. With the ninth product matrix The second sum matrix L is the product of the sum of the two gradients and the intensity β of the second gradient.
[0100] Step S607: Calculate the product between the inverse of the first sum matrix and the second sum matrix to obtain the denoised image data.
[0101] The electronic device finally calculates the inverse matrix of the first sum matrix. The product of the second and the matrix L is used to obtain the denoised image data.
[0102] Unlike existing technologies, the image denoising method of this application improves the method of generating guide maps by using the first image data (bayer) and the second image data to generate the guide map, so that the guide map retains the gradient information of the original first image data (bayer) as much as possible.
[0103] Secondly, when denoising the first image data, the denoising method of this application uses a guide map for guided denoising, which is different from the traditional technique of decomposing the first image data into a guide map for denoising. In the process of guided denoising, the Bayer gradient information of the first image data is preserved at the same time, which can prevent the loss of gradient information in the denoised image data, thereby improving the denoising method of the first image data and improving the quality of the denoised image data.
[0104] Optionally, this application further proposes an electronic device, please refer to [link to relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of an embodiment of the electronic device of this application. The electronic device 200 includes a processor 201 and a memory 202 connected to the processor 201.
[0105] Processor 201 can also be referred to as CPU (Central Processing Unit). Processor 201 may be an integrated circuit chip with signal processing capabilities. Processor 201 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor can be a microprocessor or any conventional processor.
[0106] The memory 202 is used to store program data required for the processor 201 to run.
[0107] The processor 201 is also used to execute the program data stored in the memory 202 to implement the above-mentioned image noise reduction method.
[0108] Optionally, this application further proposes a computer-readable storage medium. See also... Figure 8 , Figure 8 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application.
[0109] The computer-readable storage medium 300 of this application embodiment stores program instructions 310, which are executed to implement the above-described image noise reduction method.
[0110] Specifically, program instructions 310 can be formed into a program file and stored in the aforementioned storage medium in the form of a software product, so that an electronic device (which may be a personal computer, server, or network device, etc.) or processor can execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0111] In this embodiment, the computer-readable storage medium 300 may be, but is not limited to, a USB flash drive, SD card, PD optical drive, portable hard drive, large-capacity floppy drive, flash memory, multimedia memory card, server, etc.
[0112] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the electronic device to perform the steps in the above-described method embodiments.
[0113] Furthermore, if the aforementioned functions are implemented as software functions and sold or used as independent products, they can be stored in a mobile terminal-readable storage medium. That is, this application also provides a storage device storing program data, which can be executed to implement the methods of the above embodiments. This storage device can be, for example, a USB flash drive, an optical disc, or a server. In other words, this application can be embodied in the form of a software product, which includes several instructions to cause a smart terminal to execute all or part of the steps of the methods described in the various embodiments.
[0114] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0115] Any process or method description in the flowchart or otherwise herein can be understood as representing an apparatus, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order according to the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0116] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (which may be a personal computer, server, network device, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0117] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for denoising images, characterized in that, include: Interpolate the first image data in the first format to obtain the second image data in the second format; A guide map is generated based on the first image data and the second image data; The first image data is denoised using the guide map to obtain denoised image data; The step of generating a guide map based on the first image data and the second image data includes: obtaining optimization parameters based on the first image data and the second image data; and obtaining the guide map based on the optimization parameters and the second image data. The second image data includes first color channel data, second color channel data, and third color channel data. The step of obtaining optimization parameters based on the first image data and the second image data includes: calculating a first gradient matrix based on the first image data and a first gradient function; calculating a second gradient matrix based on the first color channel data, the second color channel data, the third color channel data, and the first gradient function; and obtaining the product between the inverse of the second gradient matrix and the first gradient matrix to obtain the optimization parameters.
2. The noise reduction method according to claim 1, characterized in that, The optimization parameters include a first optimization parameter, a second optimization parameter, and a third optimization parameter. The step of obtaining the guide map based on the optimization parameters and the second image data includes: Calculate and obtain the first product matrix of the first optimization parameter and the first color channel data, the second product matrix of the second optimization parameter and the second color channel data, and the third product matrix of the third optimization parameter and the third color channel data; Calculate the sum of the first product matrix, the second product matrix, and the third product matrix to obtain the guide graph.
3. The noise reduction method according to claim 1, characterized in that, The step of using the guide map to perform noise reduction processing on the first image data to obtain noise-reduced image data includes: Obtain the second gradient function, the third gradient function, the first gradient intensity of the guide map, and the second gradient intensity of the first image data; The first image data is denoised using the second gradient function, the third gradient function, the intensity of the first gradient, the intensity of the second gradient, and the guide map to obtain the denoised image data.
4. The noise reduction method according to claim 3, characterized in that, The second gradient function includes a first direction matrix and a second direction matrix, and the third gradient function includes a third direction matrix and a fourth direction matrix; The step of using the second gradient function, the third gradient function, the strength of the first gradient, the strength of the second gradient, and the guide map to perform noise reduction processing on the first image data to obtain the noise-reduced image data includes: Calculate the first square matrix of the first direction matrix, the second square matrix of the second direction matrix, the third square matrix of the third direction matrix, and the fourth square matrix of the fourth direction matrix, respectively. Calculate the product of the sum of the first square matrix and the second square matrix and the intensity of the first gradient action to obtain the fourth product matrix; Calculate the product of the sum of the third square matrix and the fourth square matrix and the intensity of the second gradient action to obtain the fifth product matrix; Calculate the first sum matrix of the identity matrix, the fourth product matrix, and the fifth product matrix, and calculate the inverse matrix of the first sum matrix; The products between the guide map and the first square matrix and the second square matrix are calculated respectively to obtain the sixth product matrix and the seventh product matrix; and the products between the first image data and the third square matrix and the fourth square matrix are calculated respectively to obtain the eighth product matrix and the ninth product matrix. Calculate the second sum matrix between the first image data, the product of the sum of the sixth and seventh product matrices and the first gradient intensity, and the product of the sum of the eighth and ninth product matrices and the second gradient intensity; Calculate the product between the inverse of the first sum matrix and the second sum matrix to obtain the denoised image data.
5. The noise reduction method according to claim 3, characterized in that, The values of the first gradient intensity and the second gradient intensity range from 0 to 3.
6. The noise reduction method according to claim 1, characterized in that, The first format is Bayer format, and the second format is RGB format.
7. An electronic device, characterized in that, The electronic device includes a processor and a memory connected to the processor, wherein the memory stores program data, and the processor executes the program data stored in the memory to perform a noise reduction method for an image according to any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, It internally stores program instructions that are executed to implement the image noise reduction method according to any one of claims 1-6.
Citation Information
Patent Citations
Denoising method oriented by green channel on low illumination Bayer image
CN103327220A