Image denoising method, device, electronic device and readable storage medium

By combining spatial and temporal denoising techniques and using target weights to process the brightness and chrominance components of image frames and reference frames, the problem of poor image denoising effects in traditional methods is solved, achieving more efficient image denoising and quality. promote.

CN113240608BActive Publication Date: 2024-09-06GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110580782.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-26
Publication Date
2024-09-06
Estimated Expiration
2041-05-26

AI Technical Summary

Technical Problem

Traditional image denoising methods have poor effect on image denoising and cannot effectively improve image quality.

Method used

An image denoising method is adopted. By obtaining the pixel brightness and chroma components of the image frame to be processed and the reference frame, combined with spatial domain and temporal domain denoising technology, the brightness component is jointly denoised using preset target weights. Consider Saturation, brightness and difference of pixels to improve denoising effect.

Benefits of technology

Significantly improves the denoising effect of the image and enhances the image quality, especially through the temporal denoising processing of the brightness component after spatial domain denoising and the original brightness component of the reference frame, combined with the processing of the chroma component, to form a clearer and smoother target image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113240608B
    Figure CN113240608B
Patent Text Reader

Abstract

This application relates to an image denoising method, apparatus, electronic device, and computer-readable storage medium. The electronic device acquires the original luminance component and original chrominance component of each pixel in an image frame to be processed, and acquires the original luminance component of each pixel in a reference frame. Spatial domain denoising is performed on the original luminance component of each pixel in the image frame to be processed to obtain a spatially denoised luminance component. Temporal domain denoising is performed on the original luminance component and the spatially denoised luminance component of the reference frame using a preset target weight to obtain a jointly denoised luminance component; the target weight is related to the pixel's saturation, luminance, and difference. A target image is determined based on the original chrominance component and the jointly denoised luminance component. When performing temporal domain denoising on the luminance component, the electronic device determines the target weight of the pixel from multiple dimensions such as pixel saturation, luminance, and difference, resulting in a better denoising effect for the image frame to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the continuous development of image processing related technologies, people's requirements for image quality are getting higher and higher. Among the many factors that affect image quality, noise is an extremely important factor. Image noise refers to unnecessary or redundant interference information in image data. Since the existence of noise seriously affects the quality of the image, it is very important to remove noise during image processing.

[0003] Traditional denoising methods include time domain denoising, spatial domain denoising, frequency domain denoising and other methods. Among them, time domain denoising is a denoising method that combines the previous and next frame images for processing. Spatial domain denoising is a denoising method that processes a single frame image. Frequency domain denoising is a method that converts an image from the spatial domain to the frequency domain for denoising.

[0004] However, the denoising effect of images using traditional denoising methods is poor. Summary of the invention

[0005] The embodiments of the present application provide an image denoising method and device, an electronic device, and a readable storage medium, which can improve the denoising effect of an image.

[0006] An image denoising method, the method comprising:

[0007] Acquire the original brightness component of each pixel and the original chrominance component of each pixel in the image frame to be processed, and acquire the original brightness component of each pixel in the reference frame; the reference frame includes a preset number of image frames before the image frame to be processed;

[0008] Performing spatial domain denoising on the original brightness component of each pixel in the image frame to be processed to obtain a brightness component after spatial domain denoising;

[0009] Using a preset target weight, performing temporal denoising processing on the original brightness component of the reference frame and the brightness component after spatial denoising, to obtain a brightness component after joint denoising processing; the target weight is related to the saturation, brightness and difference of the pixel;

[0010] A target image is determined according to the original chrominance component and the luminance component after the joint denoising process.

[0011] An image denoising device, comprising:

[0012] An acquisition module, used to acquire an original brightness component of each pixel and an original chrominance component of each pixel in the image frame to be processed, and to acquire an original brightness component of each pixel in a reference frame; the reference frame includes a preset number of image frames before the image frame to be processed;

[0013] A spatial denoising module, used for performing spatial denoising on the original brightness component of each pixel in the image frame to be processed to obtain a brightness component after spatial denoising;

[0014] A temporal denoising module, configured to perform temporal denoising on the original brightness component of the reference frame and the brightness component after spatial denoising by using a preset target weight, so as to obtain a brightness component after joint denoising; the target weight is related to the saturation, brightness and difference of the pixel;

[0015] The target image determination module is used to determine the target image according to the original chrominance component and the luminance component after the joint denoising process.

[0016] An electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the image denoising method described above.

[0017] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the image denoising method described above.

[0018] The above-mentioned image denoising method, device, electronic device and computer-readable storage medium first perform spatial denoising on the original brightness component of each pixel in the image frame to be processed, and then perform temporal denoising on the brightness component after spatial denoising and the original brightness component of the reference frame through the target weight of each pixel, so as to obtain the brightness component after the joint denoising in the temporal and spatial domains. In addition, since the human eye is generally more sensitive to the brightness component, when the electronic device performs temporal denoising on the original brightness component, it determines the target weight of the pixel from multiple dimensions such as the saturation, brightness and difference of the pixel, so that the image frame to be processed obtains a better denoising effect. Finally, the target image is determined based on the original chrominance component of the image frame to be processed and the brightness component after the joint denoising in the temporal and spatial domains. Ultimately, the denoising effect of the generated target image is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A diagram showing an application environment of an image denoising method in an embodiment;

[0021] Figure 2 is a flow chart of an image denoising method in one embodiment;

[0022] Figure 3 is a flowchart of an image denoising method in another embodiment;

[0023] Figure 4 is a flowchart of a method for determining a target weight according to a first luminance component, a first chrominance component, and an original luminance component of a reference frame in one embodiment;

[0024] Figure 5 A schematic diagram of calculating target weight in one embodiment;

[0025] Figure 6 for Figure 4 A flowchart of a method for calculating a saturation weight of an image frame to be processed according to a first brightness component and a first chrominance component;

[0026] Figure 7 for Figure 4 A flowchart of a method for calculating a brightness weight of an image frame to be processed according to a first brightness component;

[0027] Figure 8 for Figure 4 A flowchart of a method for calculating a difference weight of an image frame to be processed according to a luminance component after spatial denoising and an original luminance component of a reference frame;

[0028] Fig. 9 is a schematic diagram of a pyramid difference operation in one embodiment;

[0029] Fig.10 is a schematic diagram of an image denoising process in a specific embodiment;

[0030] Fig.11 is a schematic diagram of dividing an image frame to be processed into a plurality of image blocks to be processed in one embodiment;

[0031] Fig.12 is a structural block diagram of an image denoising device in one embodiment;

[0032] Fig.13 is a structural block diagram of an image denoising device in another embodiment;

[0033] Fig.14 for Fig.13 The structural block diagram of the target weight determination module;

[0034] Fig.15 is a structural block diagram of an image denoising device in yet another embodiment;

[0035] Fig.16 FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0037] Figure 1 FIG. 1 is an application scenario diagram of an image denoising method in an embodiment. Figure 1 As shown, the application environment includes an electronic device 120, which obtains the original brightness component of each pixel in the image frame to be processed and the original chrominance component of each pixel, and obtains the original brightness component of each pixel in the reference frame; the reference frame includes a preset number of image frames before the image frame to be processed; the original brightness component of each pixel in the image frame to be processed is subjected to spatial denoising to obtain the brightness component after spatial denoising; the original brightness component of the reference frame and the brightness component after spatial denoising are subjected to temporal denoising using a preset target weight to obtain the brightness component after joint denoising; the target weight is related to the saturation, brightness and difference of the pixel; the target image is determined according to the original chrominance component and the brightness component after joint denoising. Here, the electronic device 120 can be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a wearable device (smart bracelet, smart watch, smart glasses, smart gloves, smart socks, smart belt, etc.), a smart home, etc.

[0038] Figure 2 FIG. 1 is a flowchart of an image denoising method in one embodiment. The image denoising method in this embodiment is executed on Figure 1 The electronic device 120 in the embodiment is used as an example for description. The image denoising method includes:

[0039] Step 220, obtaining the original brightness component of each pixel and the original chrominance component of each pixel in the image frame to be processed, and obtaining the original brightness component of each pixel in the reference frame; the reference frame includes a preset number of image frames before the image frame to be processed.

[0040] The electronic device can perform format conversion on each image frame to be processed, and convert the image frame to be processed into a YUV format, wherein "Y" represents brightness (Luminance or Luma), that is, grayscale value; and "U" and "V" represent chrominance (Chrominance or Chroma). Thus, the original chrominance component of the image frame to be processed and the original brightness component of the image frame to be processed can be obtained. The original chrominance component of the image frame to be processed includes the chrominance value of each pixel of the image frame to be processed; the brightness component of the image frame to be processed includes the brightness value of each pixel of the image frame to be processed.

[0041] Similarly, the electronic device can perform format conversion on the reference frame, converting the reference frame into a YUV format, thereby obtaining the original brightness component of each pixel in the reference frame.

[0042] Step 240 , performing spatial domain denoising processing on the original brightness component of each pixel in the image frame to be processed to obtain a brightness component after spatial domain denoising.

[0043] With respect to the above original brightness component, the electronic device may perform spatial denoising processing on the original brightness component of the image frame to be processed to obtain a brightness component of a spatial denoising frame corresponding to the image frame to be processed.

[0044] The electronic device can use a spatial domain filter to filter the original brightness component of the image frame to be processed, so that the original brightness component of the image frame to be processed is smoother. The above-mentioned spatial domain filter can be a Gaussian filter, a median filter, or a mean filter, which is not limited here.

[0045] Step 260, using preset target weights, perform temporal denoising on the original brightness component of the reference frame and the brightness component after spatial denoising to obtain a brightness component after joint denoising; the target weights are related to the saturation, brightness and difference of the pixels.

[0046] The electronic device can calculate the target weight of each pixel in the image frame to be processed, and the target weight can be related to the saturation, brightness and difference of the pixel. The difference can be the difference in pixel values ​​of the pixels at the same position between the image frame to be processed and the reference frame, which can be used to characterize the degree of difference between the image frame to be processed and the reference frame.

[0047] When calculating the above target weight value, the electronic device may respectively calculate the fusion weights related to the saturation, brightness and difference of each pixel, and then obtain the target weight of each pixel based on the various fusion weights.

[0048] When calculating each fusion weight, the electronic device may first calculate image parameters such as saturation, brightness, and difference of each pixel, and then determine each fusion weight based on the above image parameters. Furthermore, for each pixel, the electronic device may perform weighted summation, multiplication, and other processing on each fusion weight to obtain a target weight for the pixel.

[0049] Optionally, the electronic device determines the target weight of each pixel based on the first brightness component, the first chrominance component and the original brightness component of the reference frame; wherein the first brightness component includes the original brightness component of the image frame to be processed or the brightness component of the spatial denoising frame. That is, the electronic device can use the original brightness component of the image frame to be processed to calculate the target weight, or use the brightness component of the spatial denoising frame to calculate the target weight. The first chrominance component includes the original chrominance component of the image frame to be processed or the chrominance component after spatial denoising. That is, the electronic device can use the original chrominance component of the image frame to be processed to calculate the target weight, or use the chrominance component of the spatial denoising frame to calculate the target weight.

[0050] By introducing the first brightness component, the first chrominance component and the original brightness component of the reference frame to calculate the target weight, the electronic device can make the target weight combine more image features of the image frame to be processed and the reference frame, making the target weight more accurate.

[0051] When the electronic device performs time domain denoising on the original brightness component of the reference frame and the brightness component after spatial denoising, the above-mentioned target weight can be used to perform weighted fusion of the original brightness component of the reference frame and the brightness component of the spatial denoising frame. When the electronic device performs weighted fusion on each brightness component, it can use a preset weighted calculation formula to obtain the fused brightness component; for example, the above-mentioned weighted calculation formula can be a weighted summation formula, and the electronic device can multiply the brightness component of the spatial denoised frame by the target weight and then add it to the original brightness component of the reference frame, or multiply the original brightness component of the reference frame by the target weight and then add it to the brightness component of the spatial denoised frame, without limitation here.

[0052] Optionally, the electronic device can be configured according to the formula: Get the brightness component TnrfrmY of the pixel (i, j) in the reference frame after joint denoising i,j ; Among them, SnrfrmY i,j Represents the brightness component of pixel (i, j) in the spatial denoising frame; ReffrmY i,jRepresents the brightness component of pixel (i, j) in the reference frame; jnt_wgt i,j Represents the target weight of pixel (i,j).

[0053] Step 280, determining a target image according to the original chrominance component and the luminance component after the joint denoising process.

[0054] On the basis of the above steps, the electronic device performs spatial denoising and temporal denoising on the original brightness component of the image frame to be processed in sequence, and obtains the brightness component after the joint denoising process. Furthermore, the electronic device can determine the target image based on the brightness component after the above joint denoising process and the original chrominance component of the image frame to be processed. The target image can also be referred to as the denoised output frame of the image frame to be processed. The electronic device can directly merge the brightness component after the above joint denoising process with the original chrominance component of the image frame to be processed to obtain the target image, and can also filter or fuse the brightness component after the above joint denoising process and the original chrominance component of the image frame to be processed, and then combine the brightness component after the joint denoising process with the original chrominance component to obtain the target image; the method for obtaining the above target image is not limited here.

[0055] In an embodiment of the present application, the electronic device obtains the original brightness component of each pixel in the image frame to be processed and the original chrominance component of each pixel, and obtains the original brightness component of each pixel in the reference frame; the reference frame includes a preset number of image frames before the image frame to be processed. The original brightness component of each pixel in the image frame to be processed is subjected to spatial denoising to obtain the brightness component after spatial denoising. Using a preset target weight, the original brightness component of the reference frame and the brightness component after spatial denoising are subjected to time domain denoising to obtain the brightness component after joint denoising; wherein the target weight is related to the saturation, brightness and difference of the pixel. According to the original chrominance component and the brightness component after joint denoising, the target image is determined.

[0056] First, the original brightness component of each pixel in the image frame to be processed is subjected to spatial denoising, and then, the brightness component after spatial denoising and the original brightness component of the reference frame are subjected to temporal denoising through the target weight of each pixel, so that the brightness component after temporal and spatial joint denoising (hereinafter referred to as joint denoising) can be obtained. In addition, since the human eye is generally sensitive to the brightness component, when the electronic device performs temporal denoising on the original brightness component, it determines the target weight of the pixel from multiple dimensions such as the saturation, brightness and difference of the pixel, so that the image frame to be processed obtains a better denoising effect. Finally, the target image is determined based on the original chrominance component of the image frame to be processed and the brightness component after temporal and spatial joint denoising. Finally, the denoising effect of the generated target image is greatly improved.

[0057] In one embodiment, step 280, determining a target image according to the original chrominance component and the luminance component after joint denoising, includes:

[0058] Perform spatial domain denoising on the original chroma component to obtain the chroma component after spatial domain denoising;

[0059] The target image is determined according to the chrominance component after spatial denoising and the luminance component after joint denoising.

[0060] Specifically, the method of performing spatial domain denoising on the original chrominance component of the image frame to be processed is as follows: the image frame to be processed is divided into image blocks to be processed according to different image sizes, and the gradient of the image blocks to be processed is calculated. If the gradient of the image block to be processed is greater than the preset gradient threshold, the original chrominance component of the pixel in the image block to be processed is used as the chrominance component after spatial domain denoising corresponding to the pixel. If the gradient of the image block to be processed is less than or equal to the preset gradient threshold, the image block to be processed is matched with the target image block of the image block to be processed. The target image block is an image block in the image frame to be processed that is located within a preset range around the image block to be processed. The original chrominance component of the successfully matched target image block is merged with the original chrominance component of the image block to be processed to obtain the chrominance component after spatial domain denoising corresponding to each pixel in the image block to be processed. This is similar to the method of performing spatial domain denoising on the original brightness component described below. It should be noted that when the electronic device performs spatial domain denoising on the original chrominance component and the original brightness component, the denoising parameters used may be the same or different. For example, when an electronic device uses the above-mentioned non-local mean spatial filtering method to perform spatial denoising on the original chrominance component, the parameters such as the gradient threshold, matching threshold, and image block size used may be different from the parameters used to process the original luminance component.

[0061] Therefore, when determining the target image based on the original chroma components and the luminance components after joint denoising, first, the original chroma components are subjected to spatial denoising to obtain the chroma components after spatial denoising. Then, the target image is determined based on the chroma components after spatial denoising and the luminance components after joint denoising. That is, although the human eye is less sensitive to chroma components, spatial denoising is performed on the original chroma components to obtain the chroma components after spatial denoising, thereby improving the denoising effect of the target image from the dimension of the chroma components.

[0062] In the embodiment of the present application, the original chroma component is subjected to spatial denoising to obtain the chroma component after spatial denoising, and the target image is determined according to the chroma component after spatial denoising and the brightness component after joint denoising. Thus, the image frame to be processed is subjected to denoising from two perspectives, the chroma component and the brightness component, which improves the denoising effect of the target image obtained.

[0063] In one embodiment, Figure 3 As shown, an image denoising method is provided, which also includes:

[0064] Step 250, determining the target weight according to the first luminance component, the first chrominance component and the original luminance component of the reference frame; wherein the first luminance component includes the original luminance component of the image frame to be processed or the luminance component after spatial denoising, and the first chrominance component includes the original chrominance component of the image frame to be processed or the chrominance component after spatial denoising.

[0065] Specifically, in the above step 260, it is necessary to use a preset target weight to perform time domain denoising on the original brightness component of the reference frame and the brightness component after spatial denoising to obtain the brightness component after joint denoising. The target weight here can be represented by jnt_wgt. That is, based on the preset target weight, when the original brightness component of the reference frame and the brightness component after spatial denoising are respectively calculated for time domain denoising, the weight of the original brightness component of the reference frame and the weight of the brightness component after spatial denoising are calculated. Then, the weight of the original brightness component of the reference frame is multiplied by the original brightness component of the reference frame, and the weight of the brightness component after spatial denoising is multiplied by the brightness component after spatial denoising, and then the sum of the two is calculated to obtain the brightness component after joint denoising.

[0066] The target weight preset here is obtained based on the first brightness component, the first chrominance component and the original brightness component reffrmY of the reference frame. Among them, the first brightness component includes the original brightness component CurfrmY of the image frame to be processed or the brightness component snrfrmY after spatial denoising, and the first chrominance component includes the original chrominance component CurfrmC of the image frame to be processed or the chrominance component snrfrmC after spatial denoising. That is, when calculating the target weight, select one from CurfrmY and snrfrmY, select one from CurfrmC and snrfrmC, and then combine reffrmY to calculate the target weight. In this application, the combination obtained by selecting one from CurfrmY and snrfrmY, selecting one from CurfrmC and snrfrmC, and then combining reffrmY is not limited.

[0067] In the embodiment of the present application, the target weight is determined according to the first brightness component, the first chrominance component and the original brightness component of the reference frame, and the target weight is calculated from the five elements of the original brightness component of the image frame to be processed, the brightness component after spatial denoising, the original chrominance component of the image frame to be processed, the chrominance component after spatial denoising and the original brightness component of the reference frame. Then, the calculated target weight will take into account the characteristics of the above five elements, so that the subsequent use of the target weight to perform time domain denoising on the original brightness component of the reference frame and the brightness component after spatial denoising will obtain a more accurate processing result.

[0068] In one embodiment, Figure 4 As shown, an image denoising method is provided, which also includes:

[0069] Step 420: Calculate the saturation weight of the image frame to be processed according to the first brightness component and the first chrominance component.

[0070] Combination Figure 5 As shown, it is a schematic diagram of calculating the target weight in one embodiment. Among them, the first brightness component includes the original brightness component CurfrmY of the image frame to be processed or the brightness component snrfrmY after spatial denoising, and the first chrominance component includes the original chrominance component CurfrmC of the image frame to be processed or the chrominance component snrfrmC after spatial denoising. That is, when calculating the saturation weight of the image frame to be processed, one of CurfrmY and snrfrmY is selected, and one of CurfrmC and snrfrmC is selected to calculate the saturation weight of the processed image. In this application, the combination obtained by selecting one of CurfrmY and snrfrmY and selecting one of CurfrmC and snrfrmC is not limited.

[0071] Specifically, when calculating the saturation weight of the image frame to be processed according to the first brightness component and the first chromaticity component, the saturation map of the image frame to be processed can be calculated based on the first brightness component and the first chromaticity component of each pixel in the image frame to be processed. Then, each saturation in the saturation map is input into the corresponding function to calculate the saturation weight sat_wgt.

[0072] Step 440: Calculate the brightness weight of the image frame to be processed according to the first brightness component.

[0073] The first brightness component includes the original brightness component CurfrmY of the image frame to be processed or the brightness component snrfrmY after spatial denoising. Therefore, when calculating the brightness weight of the image frame to be processed, one of CurfrmY and snrfrmY can be selected.

[0074] Specifically, when calculating the brightness weight of the image frame to be processed according to the first brightness component, a brightness map of the image frame to be processed can be calculated based on the first brightness component of each pixel in the image frame to be processed. Then, each brightness in the brightness map is input into the corresponding function to calculate the brightness weight lum_wgt.

[0075] Step 460 , calculating the difference weight of the image frame to be processed according to the luminance component after spatial denoising and the original luminance component of the reference frame.

[0076] For each pixel in the image frame to be processed, obtain the brightness component snrfrmY of each pixel after spatial denoising. For each pixel in the reference frame, obtain the original brightness component reffrmY of each pixel. The reference frame includes a preset number of image frames before the image frame to be processed. Here, the preset number can be one or more, and this application does not limit this.

[0077] Specifically, when calculating the difference weight of the image frame to be processed according to the luminance component snrfrmY after spatial denoising and the original luminance component reffrmY of the reference frame, a difference map of the image frame to be processed can be calculated first. Then, each difference in the difference map is input into the corresponding function to calculate the difference weight bdr_wgt.

[0078] Step 480, determining a target weight according to the saturation weight, the brightness weight and the difference weight.

[0079] Finally, the calculated saturation weight sat_wgt, brightness weight lum_wgt and difference weight bdr_wgt are subjected to preset calculation to generate the target weight. Here, the preset budget may be a weighted average, or other types of calculation methods, which are not limited in this application.

[0080] In an embodiment of the present application, when determining the target weight according to the first brightness component, the first chrominance component and the original brightness component of the reference frame, specifically: first, the saturation weight of the image frame to be processed is calculated according to the first brightness component and the first chrominance component. Secondly, the brightness weight of the image frame to be processed is calculated according to the first brightness component. Thirdly, the difference weight of the image frame to be processed is calculated according to the brightness component after spatial denoising and the original brightness component of the reference frame. Finally, the target weight is determined according to the saturation weight, the brightness weight and the difference weight.

[0081] The target weight is calculated from the three dimensions of saturation weight, brightness weight and difference weight. Then, the calculated target weight can take into account the characteristics of multiple dimensions, so that the target weight can be used to perform time domain denoising on the original brightness component of the reference frame and the brightness component after spatial denoising, and the processing result is more accurate.

[0082] In one embodiment, Figure 6 As shown, step 420, calculating the saturation weight of the image frame to be processed according to the first brightness component and the first chrominance component, includes:

[0083] Step 420a, determining the saturation of the pixel according to the first brightness component and the first chrominance component;

[0084] Step 420b, determining the saturation weight of the pixel according to the saturation of the pixel and a preset first weight mapping relationship; wherein the first weight mapping relationship includes a mapping relationship between different pixel saturations and saturation weights.

[0085] Specifically, when calculating the saturation weight of the image frame to be processed, select one of CurfrmY and snrfrmY, and select one of CurfrmC and snrfrmC to calculate the saturation weight of the processed image. Then, when calculating the saturation weight of the image frame to be processed according to the first brightness component and the first chromaticity component, the saturation map of the image frame to be processed can be calculated based on the first brightness component and the first chromaticity component of each pixel in the image frame to be processed. The saturation map includes the saturation of each pixel.

[0086] Then, the saturation weight of the pixel is determined according to the saturation of the pixel and the preset first weight mapping relationship. The first weight mapping relationship includes a mapping relationship between different pixel saturations and saturation weights, and the first weight mapping relationship is preset. Here, the mapping relationship between different pixel saturations and saturation weights is: the greater the pixel saturation, the smaller the saturation weight corresponding to the pixel; otherwise, the greater the saturation.

[0087] In the embodiment of the present application, first, the saturation of the pixel is determined according to the first brightness component and the first chrominance component. Then, the saturation weight of the pixel is determined according to the saturation of the pixel and the mapping relationship between different pixel saturations and saturation weights. Based on the preset mapping relationship between different pixel saturations and saturation weights, the saturation weight of the pixel can be accurately obtained.

[0088] In one embodiment, step 420a, determining the saturation of the pixel according to the first brightness component and the first chrominance component, includes:

[0089] For each pixel of the image frame to be processed, color gamut mapping is performed on the first brightness component of the pixel and the first chrominance component of the pixel to generate a saturation map of the image frame to be processed; wherein the saturation map includes the saturation of each pixel;

[0090] Determines the saturation of a pixel from the saturation map.

[0091] Specifically, when determining the saturation of a pixel according to the first brightness component and the first chromaticity component, for each pixel of the image frame to be processed, color gamut mapping is performed on the first brightness component of the pixel and the first chromaticity component of the pixel to generate a saturation mapping diagram of the image frame to be processed. Here, color gamut mapping refers to the conversion of the color space. The color gamut mapping is performed on the first brightness component of the pixel and the first chromaticity component of the pixel, and specifically, the image frame to be processed is converted from the YUV color space to the HSI color space.

[0092] The HSI color space is based on the human visual system and can be divided into three components, where "H" represents hue, "S" represents saturation (Saturation or Chroma), and "I" represents intensity (Intensity or Brightness). Generally speaking, the human eye is more sensitive to brightness.

[0093] Among them, the YUV color space can also be divided into three components, among which "Y" represents brightness (Luminance or Luma), that is, the grayscale value; and "U" and "V" represent chrominance (Chrominance or Chroma), which is used to describe the color and saturation of the image and is used to specify the color of the pixel. An important reason for using the YUV color space is that the brightness signal Y and the chrominance signals U and V are separated in the YUV color space. And in general, the human eye is less sensitive to chrominance than to brightness.

[0094] Therefore, the image frame to be processed is converted from the YUV color space to the HSI color space, and based on the S component of each pixel in the HSI color space, a saturation map of the image frame to be processed can be generated. The saturation map includes the saturation of each pixel, so the saturation of the pixel can be determined from the saturation map.

[0095] In the embodiment of the present application, for each pixel of the image frame to be processed, the first brightness component of the pixel and the first chrominance component of the pixel are subjected to color gamut mapping to generate a saturation map of the image frame to be processed, and the saturation of the pixel can be determined from the saturation map. Specifically, by converting the image frame to be processed from the YUV color space to the HSI color space, the saturation map of the pixel can be directly obtained, which paves the way for the subsequent calculation of the saturation weight of the pixel.

[0096] In one embodiment, step 420b, determining the saturation weight of the pixel according to the saturation of the pixel and a preset first weight mapping relationship, includes:

[0097] Inputting the saturation of the pixel into a first piecewise weight function to generate a saturation weight of the pixel; the first piecewise weight function includes function expressions corresponding to a plurality of different saturation intervals; or,

[0098] The saturation of the pixel is input into a first continuous weight function to generate a saturation weight of the pixel; the first continuous weight function includes a plurality of function expressions corresponding to different saturations.

[0099] Specifically, after the saturation of the pixel is calculated based on the saturation map in step 420a, the saturation weight of the pixel is determined according to the saturation of the pixel and the preset first weight mapping relationship. The first weight mapping relationship here is embodied as a first piecewise weight function, and the saturation of the pixel can be directly input into the first piecewise weight function to generate the saturation weight of the pixel.

[0100] Among them, the first segmented weight function includes function expressions corresponding to multiple different saturation intervals, for example, including the following two functions: Among them, when the first segmented weight function is used to calculate the saturation weight of a pixel, map refers to the saturation corresponding to different pixels in the saturation map, and thr_0, thr_1, thr_2, thr_3...thr_k, thr_k+1 are the saturation thresholds set in sequence. Wgt refers to the saturation weight corresponding to different pixels, and d_0, d_1, d_2, d_3,...d_k+1, d_k+2 are the saturation weights set in sequence. Among them, the first function is:

[0101] If map>thr_0, wgt=d_0;

[0102] If map>thr_1 and map<=thr_0, wgt=d_1;

[0103] If map>thr_2 and map<=thr_1, wgt=d_2;

[0104] If map>thr_3 and map<=thr_2, wgt=d_3;

[0105] …

[0106] If map>thr_k+1 and map<=thr_k, wgt=d_k+1;

[0107] If map <thr_k+1,wgt=d_k+2;

[0108] Among them, the second function is:

[0109] If map>thr_0, wgt=d_0;

[0110] If map>thr_1 and map<=thr_0, wgt=d_1+(map-thr_1)*(d_1-d_0) / (thr_0-thr_1);

[0111] If map>thr_2 and map<=thr_1, wgt=d_2+(map-thr_2)*(d_2-d_1) / (thr_1-thr_2);

[0112] If map>thr_3 and map<=thr_2, wgt=d_3+(map-thr_3)*(d_3-d_2) / (thr_2-thr_3);

[0113] …

[0114] If map>thr_k+1 and map<=thr_k, wgt=d_k+1+(map-thr_k+1)*(d_k+1-d_k) / (thr_k-thr_k+1);

[0115] If map <thr_k+1,wgt=d_k+2+(map-thr_k+2)*(d_k+2-d_k+1) / (thr_k+1);

[0116] In another case, the first weight mapping relationship here is embodied as a first continuous weight function, and the saturation of the pixel can be directly input into the first continuous weight function to generate the saturation weight of the pixel. The first continuous weight function includes a plurality of function expressions corresponding to different saturations. For example, it includes the following function, which is a function involving thr and map:

[0117] Wgt = f(thr, map);

[0118] Among them, thr is the saturation threshold, and map refers to the saturation corresponding to different pixels in the saturation map.

[0119] In the embodiment of the present application, the saturation of the pixel is input into the first piecewise weight function to generate the saturation weight of the pixel; the first piecewise weight function includes a plurality of function expressions corresponding to different saturation intervals; or, the saturation of the pixel is input into the first continuous weight function to generate the saturation weight of the pixel; the first continuous weight function includes a plurality of function expressions corresponding to different saturations. The saturation of the pixel is input into a plurality of different functions to calculate the saturation weight of the pixel, thereby realizing the calculation of the saturation weight from a plurality of dimensions and improving the robustness of the process of calculating the saturation weight.

[0120] In one embodiment, Figure 7 As shown, step 440, based on the original brightness component or the brightness component after spatial denoising, calculates the brightness weight of the image frame to be processed, including:

[0121] Step 440a, determining the brightness of the pixel according to the first brightness component;

[0122] Step 440b, determining the brightness weight of the pixel according to the brightness of the pixel and a preset second weight mapping relationship; wherein the second weight mapping relationship includes a mapping relationship between different pixel brightnesses and brightness weights.

[0123] Specifically, when calculating the brightness weight of the image frame to be processed, one of CurfrmY and snrfrmY is selected to calculate the brightness weight of the processed image. Then, when calculating the brightness weight of the image frame to be processed according to the first brightness component, the brightness map of the image frame to be processed can be calculated based on the first brightness component of each pixel in the image frame to be processed. The brightness map includes the brightness of each pixel.

[0124] Then, the brightness weight of the pixel is determined according to the brightness of the pixel and the preset second weight mapping relationship. The second weight mapping relationship includes a mapping relationship between different pixel brightness and brightness weight, and the second weight mapping relationship is preset. Here, the mapping relationship between different pixel brightness and brightness weight is: the greater the pixel brightness, the smaller the brightness weight corresponding to the pixel; otherwise, the greater the brightness.

[0125] In the embodiment of the present application, first, the brightness of the pixel is determined according to the first brightness component. Then, the brightness weight of the pixel is determined according to the brightness of the pixel and the mapping relationship between different pixel brightnesses and brightness weights. Based on the preset mapping relationship between different pixel brightnesses and brightness weights, the brightness weight of the pixel can be accurately obtained.

[0126] In one embodiment, step 440a, determining the brightness of the pixel according to the first brightness component, includes:

[0127] For each pixel of the image frame to be processed, a first brightness component of the pixel is mapped in a preset manner to generate a brightness mapping diagram of the image frame to be processed; wherein the brightness mapping diagram includes the brightness of each pixel;

[0128] Determines the brightness of a pixel from the brightness map.

[0129] Specifically, when determining the brightness of a pixel according to the first brightness component, for each pixel of the image frame to be processed, a preset mapping is performed on the first brightness component of the pixel to generate a brightness mapping map of the image frame to be processed. Here, the preset mapping can be to directly use the first brightness component of the pixel as the brightness of the pixel at the same position in the brightness mapping map, or to perform a preset operation on the first brightness component of the pixel to generate the brightness of the pixel at the same position in the brightness mapping map of the image frame to be processed. The brightness mapping map includes the brightness of each pixel. That is, the brightness of each pixel can be determined from the brightness mapping map.

[0130] In the embodiment of the present application, for each pixel of the image frame to be processed, the first brightness component of the pixel is preset mapped to generate a brightness mapping map of the image frame to be processed, and the brightness of the pixel is determined from the brightness mapping map. Specifically, the first brightness component of each pixel in the image frame to be processed is preset mapped, and the brightness mapping map of the pixel can be directly obtained, which paves the way for the subsequent calculation of the brightness weight of the pixel.

[0131] In one embodiment, step 440b, determining the brightness weight of the pixel according to the brightness of the pixel and a preset second weight mapping relationship, includes:

[0132] Inputting the brightness of the pixel into a second piecewise weight function to generate a brightness weight of the pixel; the second piecewise weight function includes function expressions corresponding to a plurality of different brightness intervals; or,

[0133] The brightness of the pixel is input into a second continuous weight function to generate a brightness weight of the pixel; the second continuous weight function includes a plurality of function expressions corresponding to different brightnesses.

[0134] Specifically, after the brightness of the pixel is calculated based on the brightness map in step 440a, the brightness weight of the pixel is determined according to the brightness of the pixel and the preset second weight mapping relationship. The second weight mapping relationship here is embodied as a second piecewise weight function, and the brightness of the pixel can be directly input into the second piecewise weight function to generate the brightness weight of the pixel.

[0135] Among them, the second piecewise weight function includes function expressions corresponding to multiple different brightness intervals, for example, including the following two functions: Among them, when the second piecewise weight function is used to calculate the brightness weight of a pixel, map refers to the brightness corresponding to different pixels in the brightness map, and thr_0, thr_1, thr_2, thr_3...thr_k, thr_k+1 are brightness thresholds set in sequence. Wgt refers to the brightness weight corresponding to different pixels, and d_0, d_1, d_2, d_3,...d_k+1, d_k+2 are brightness weights set in sequence. Among them, the first function is:

[0136] If map>thr_0, wgt=d_0;

[0137] If map>thr_1 and map<=thr_0, wgt=d_1;

[0138] If map>thr_2 and map<=thr_1, wgt=d_2;

[0139] If map>thr_3 and map<=thr_2, wgt=d_3;

[0140] …

[0141] If map>thr_k+1 and map<=thr_k, wgt=d_k+1;

[0142] If map <thr_k+1,wgt=d_k+2;

[0143] Among them, the second function is:

[0144] If map>thr_0, wgt=d_0;

[0145] If map>thr_1 and map<=thr_0, wgt=d_1+(map-thr_1)*(d_1-d_0) / (thr_0-thr_1);

[0146] If map>thr_2 and map<=thr_1, wgt=d_2+(map-thr_2)*(d_2-d_1) / (thr_1-thr_2);

[0147] If map>thr_3 and map<=thr_2, wgt=d_3+(map-thr_3)*(d_3-d_2) / (thr_2-thr_3);

[0148] …

[0149] If map>thr_k+1 and map<=thr_k, wgt=d_k+1+(map-thr_k+1)*(d_k+1-d_k) / (thr_k-thr_k+1);

[0150] If map <thr_k+1,wgt=d_k+2+(map-thr_k+2)*(d_k+2-d_k+1) / (thr_k+1);

[0151] In another case, the second weight mapping relationship here is embodied as a second continuous weight function, and the brightness of the pixel can be directly input into the second continuous weight function to generate the brightness weight of the pixel. The second continuous weight function includes a plurality of function expressions corresponding to different brightness. For example, it includes the following function, which is a function involving thr and map:

[0152] Wgt = f(thr, map);

[0153] Among them, thr is the brightness threshold, and map refers to the brightness corresponding to different pixels in the brightness map.

[0154] In the embodiment of the present application, the brightness of the pixel is input into the second piecewise weight function to generate the brightness weight of the pixel; the second piecewise weight function includes a plurality of function expressions corresponding to different brightness intervals; or, the brightness of the pixel is input into the second continuous weight function to generate the brightness weight of the pixel; the second continuous weight function includes a plurality of function expressions corresponding to different brightnesses. Inputting the brightness of the pixel into a variety of different functions to calculate the brightness weight of the pixel realizes the calculation of the brightness weight from a variety of dimensions, thereby improving the robustness of the brightness weight calculation process.

[0155] In one embodiment, Figure 8 As shown, step 460, calculating the difference weight of the image frame to be processed according to the luminance component after spatial denoising and the original luminance component of the reference frame, includes:

[0156] Step 460a, for each pixel of the image frame to be processed, generate a pixel difference according to the brightness component after spatial denoising and the original brightness component of the reference frame;

[0157] Step 460b, determining the pixel difference weight according to the pixel difference and a preset third weight mapping relationship; wherein the third weight mapping relationship includes mapping relationships between different pixel differences and difference weights.

[0158] Specifically, when calculating the difference weight of the image frame to be processed based on the luminance component after spatial denoising and the original luminance component of the reference frame, a difference map of the image frame to be processed can be calculated based on the luminance component after spatial denoising of each pixel in the image frame to be processed and the original luminance component of the reference frame. The difference map includes the difference of each pixel.

[0159] Then, according to the pixel difference and the preset third weight mapping relationship, the pixel difference weight is determined. The third weight mapping relationship includes a mapping relationship between different pixel differences and difference weights, and the third weight mapping relationship is preset. Here, the mapping relationship between different pixel differences and difference weights is: the greater the pixel difference, the smaller the difference weight corresponding to the pixel; otherwise, the greater.

[0160] In the embodiment of the present application, first, the difference of the pixel is determined based on the brightness component after spatial denoising and the original brightness component of the reference frame. Then, the difference weight of the pixel is determined based on the difference of the pixel, the mapping relationship between different pixel differences and difference weights. Based on the preset mapping relationship between different pixel differences and difference weights, the difference weight of the pixel can be accurately obtained.

[0161] In one embodiment, for each pixel of the image frame to be processed, the difference of the pixel is generated according to the brightness component after spatial denoising and the original brightness component of the reference frame, including:

[0162] For each pixel of the image frame to be processed, a difference operation is performed on the brightness component after spatial denoising and the original brightness component of the reference frame to generate a difference map of the image frame to be processed; wherein the difference map includes the difference of each pixel;

[0163] The disparity of the pixel is determined from the disparity map.

[0164] Specifically, when determining the difference of a pixel based on the luminance component after spatial denoising and the original luminance component of the reference frame, for each pixel of the image frame to be processed, a differential operation is performed on the luminance component of the pixel after spatial denoising and the original luminance component of the reference frame to generate a difference map of the image frame to be processed. Here, the differential operation can be a pyramid differential operation or a differential filtering operation. The difference map includes the differences of each pixel. That is, the difference of each pixel can be determined from the difference map.

[0165] Here, the original brightness components reffrmY of multiple reference frames and the brightness components snrfrmY of the image frame to be processed after spatial denoising can be selected for differential operation to generate a difference map of the image frame to be processed. That is, for the original brightness components reffrmY of multiple reference frames, multiple intermediate bdr_maps are generated respectively, and these intermediate bdr_maps are fused to obtain the final bdr_map out The way to fuse these intermediate bdr_maps may be to find the maximum value of the difference between each pixel point, or to find the weighted average value of the difference between each pixel point.

[0166] Among them, the formula for finding the maximum difference of each pixel is as follows:

[0167]

[0168] The formula for calculating the weighted average of the differences of each pixel is as follows:

[0169]

[0170] Among them, i and j are the position coordinates of the pixel on the current bdr_map.

[0171] In the embodiment of the present application, for each pixel of the image frame to be processed, a differential operation is performed on the brightness component of the pixel after spatial denoising and the original brightness component of the reference frame to generate a difference map of the image frame to be processed, and the difference of the pixel is determined from the difference map. Specifically, by performing a differential operation on the brightness component of each pixel in the image frame to be processed after spatial denoising and the original brightness component of the reference frame, a difference map of the pixel can be directly obtained, which paves the way for the subsequent calculation of the difference weight of the pixel.

[0172] In one embodiment, for each pixel of the image frame to be processed, a difference operation is performed on the brightness component after spatial denoising and the original brightness component of the reference frame to generate a difference map of the image frame to be processed, including:

[0173] For each pixel of the image frame to be processed, a pyramid difference operation or a difference filtering operation is performed on the luminance component after spatial denoising and the original luminance component of the reference frame to generate a difference map of the image frame to be processed.

[0174] Among them, when using the pyramid difference operation to generate the difference map of the image frame to be processed, the image frame to be processed is divided into image blocks to be processed according to different image sizes, and the reference frame is divided into reference image blocks according to different image sizes. For each same image size, the brightness component after spatial denoising corresponding to the image block to be processed divided under the same image size is obtained, and the original brightness component of the reference image block divided under the same image size is obtained. According to the brightness component after spatial denoising corresponding to the image block to be processed and the original brightness component of the reference image block, the difference map between the image frame to be processed and the reference frame under the same image size is calculated. Based on the difference maps under all image sizes, the difference map of the image frame to be processed is obtained.

[0175] like Fig. 9 As shown, first, the image frame to be processed and the reference frame need to be divided into k levels according to different image sizes to obtain image blocks of each level. The image sizes of image blocks of different levels are different, but the image sizes of image blocks of the same level are the same. Among them, the pixel value of the image block can be the average of the original pixel value. Among them, the image frame to be processed is divided into image blocks to be processed according to different image sizes, and the reference frame is divided into reference image blocks according to different image sizes. Level k includes level 0, level 1...level k, and from level 0, level 1 down to level k, the size of the image block gradually decreases.

[0176] First, for the image blocks to be processed of the same image size on the image frame to be processed, the luminance components of the image blocks to be processed of the same image size after spatial denoising are obtained. Specifically, Fig. 9 snrfrmY_level 0, snrfrmY_level 1, ..., snrfrmY_level k in the first column are the luminance components after spatial denoising of the image blocks to be processed of the same image size.

[0177] Secondly, for the reference image block of the same image size on the reference frame, the original brightness component of the reference image block of the same image size is obtained. Specifically, Fig. 9 reffrmY_level 0, reffrmY_level 1, ..., reffrmY_level k in the second column are the original brightness components of the reference image blocks of the same image size.

[0178] Again, for each image size, the difference map corresponding to the image size is calculated based on the luminance component of the image block to be processed with the same image size after spatial denoising and the original luminance component of the reference image block with the same image size. For example, for the first row corresponding to level 0, the difference bdr_map_level 0 corresponding to level 0 is calculated based on snrfrmY_level 0 and reffrmY_level 0 at this level, and specifically, the absolute value of the difference between snrfrmY_level 0 and reffrmY_level 0 is calculated. Then, based on the difference of each image block, a difference map is obtained, as shown in the third column bdr_map_level 1, bdr_map_level 2...bdr_map_level k. For the second row corresponding to level 1, the difference bdr_map_level 1 corresponding to level 1 is calculated according to snrfrmY_level 1 and reffrmY_level 1 at this level. Specifically, the absolute value of the difference between snrfrmY_level 1 and reffrmY_level 1 is calculated, and then the difference map corresponding to level 1 is obtained based on the difference of each image block. The above processing is performed on the image block to be processed and the reference image block at each level to obtain the difference map bdr_map corresponding to all image sizes.

[0179] Finally, the difference maps corresponding to all image sizes are fused to obtain the difference map of the image frame to be processed. The fusion method can be operations such as finding the maximum value or the average value, which is not limited in this application. Based on the difference map of the image frame to be processed, the difference of each pixel is obtained.

[0180] When using differential filtering to generate a difference map of the image frame to be processed, the brightness component after spatial denoising is differentially calculated from the original brightness component of each reference frame to obtain multiple difference images. For each pixel, the maximum pixel value is extracted from each difference image to obtain a maximum difference image, and the local maximum image block in the maximum difference image is obtained according to a preset image size. The local maximum image block is filtered and expanded to obtain a difference map of the image frame to be processed.

[0181] In an embodiment of the present application, when a pyramid difference operation is used to generate a difference map of an image frame to be processed, the image frame to be processed is divided into image blocks to be processed according to different image sizes, and the reference frame is divided into reference image blocks according to different image sizes. For each same image size, the luminance component after spatial denoising corresponding to the image blocks to be processed divided under the same image size is obtained, and the original luminance component of the reference image blocks divided under the same image size is obtained. According to the luminance component after spatial denoising corresponding to the image blocks to be processed and the original luminance component of the reference image blocks, the difference map between the image frame to be processed and the reference frame under the same image size is calculated. Based on the difference maps under all image sizes, the difference map of the image frame to be processed is obtained. By using a pyramid difference operation to extract differences from image blocks of different image sizes, it is obvious that the results obtained are more comprehensive and more accurate. The use of a differential filtering operation can make the difference map bdr_map smoother and thicker.

[0182] In one embodiment, a differential filtering operation is performed on the luminance component after spatial denoising and the original luminance component of the reference frame to generate a difference map of the image frame to be processed, including:

[0183] The brightness component after spatial denoising is calculated separately from the original brightness component of each reference frame to obtain multiple differential images;

[0184] For each pixel, the maximum pixel value is extracted from each differential image to obtain a maximum differential image;

[0185] According to the preset image size, obtaining the local maximum image block in the maximum difference image;

[0186] The local maximum image block is filtered and expanded to obtain a difference map of the image frame to be processed.

[0187] Specifically, the electronic device can select the original brightness component RefFrmY of multiple reference frames and the brightness component SnrFrmY of the image to be processed after spatial denoising to perform differential operation to obtain a differential image corresponding to each reference frame. The multiple differential images obtained by the electronic device are differential images difFrm with equal resolution.

[0188] Furthermore, the electronic device may superimpose a plurality of differential images difFrm, and then extract the maximum pixel value of each pixel to obtain a maximum differential image difMaxFrm.

[0189] The preset size may be 4×4 or other values, which is not limited in this application. The electronic device may calculate the block maximum value according to the preset size and obtain the local maximum image block difMaxFrm4×4 in the maximum differential image.

[0190] The electronic device may filter the local maximum image block difMaxFrm4×4 using a smoothing filter, for example, the dimension of the smoothing filter may be 5×5, to obtain a filtered differential frame, and then perform morphological dilation processing on the differential frame to obtain a difference map bdr_map.

[0191] In the embodiment of the present application, the purpose of using the differential filtering operation is to make the difference map bdr_map smoother and more robust. The method used can be to first perform smoothing filtering on the bdr_map, and then perform expansion processing on the filtering result to obtain the bdr_map after the final differential filtering operation processing.

[0192] In one embodiment, determining the pixel difference weight according to the pixel difference and a preset third weight mapping relationship includes:

[0193] Inputting the difference of the pixel into a third segment weight function to generate a difference weight of the pixel; the third segment weight function includes function expressions corresponding to a plurality of different difference intervals; or,

[0194] The difference of the pixel is input into a third continuous weight function to generate a difference weight of the pixel; the third continuous weight function includes a plurality of function expressions corresponding to different differences.

[0195] Specifically, in step 460a, for each pixel of the image frame to be processed, after generating the difference of the pixel according to the brightness component after spatial denoising and the original brightness component of the reference frame, the difference weight of the pixel is determined according to the difference of the pixel and the preset third weight mapping relationship. The third weight mapping relationship here is embodied as a third piecewise weight function, and the brightness of the pixel can be directly input into the third piecewise weight function to generate the difference weight of the pixel.

[0196] Among them, the third segmented weight function includes function expressions corresponding to multiple different difference intervals, for example, including the following two functions: Among them, when the third segmented weight function is used to calculate the difference weight of a pixel, map refers to the difference corresponding to different pixels in the difference map, and thr_0, thr_1, thr_2, thr_3...thr_k, thr_k+1 are the difference thresholds set in sequence. Wgt refers to the difference weight corresponding to different pixels, and d_0, d_1, d_2, d_3,...d_k+1, d_k+2 are the difference weights set in sequence. Among them, the first function is:

[0197] If map>thr_0, wgt=d_0;

[0198] If map>thr_1 and map<=thr_0, wgt=d_1;

[0199] If map>thr_2 and map<=thr_1, wgt=d_2;

[0200] If map>thr_3 and map<=thr_2, wgt=d_3;

[0201] …

[0202] If map>thr_k+1 and map<=thr_k, wgt=d_k+1;

[0203] If map <thr_k+1,wgt=d_k+2;

[0204] Among them, the second function is:

[0205] If map>thr_0, wgt=d_0;

[0206] If map>thr_1 and map<=thr_0, wgt=d_1+(map-thr_1)*(d_1-d_0) / (thr_0-thr_1);

[0207] If map>thr_2 and map<=thr_1, wgt=d_2+(map-thr_2)*(d_2-d_1) / (thr_1-thr_2);

[0208] If map>thr_3 and map<=thr_2, wgt=d_3+(map-thr_3)*(d_3-d_2) / (thr_2-thr_3);

[0209] …

[0210] If map>thr_k+1 and map<=thr_k, wgt=d_k+1+(map-thr_k+1)*(d_k+1-d_k) / (thr_k-thr_k+1);

[0211] If map <thr_k+1,wgt=d_k+2+(map-thr_k+2)*(d_k+2-d_k+1) / (thr_k+1);

[0212] In another case, the third weight mapping relationship here is embodied as a third continuous weight function, and the difference of the pixel can be directly input into the third continuous weight function to generate the difference weight of the pixel. The third continuous weight function includes a plurality of function expressions corresponding to different differences. For example, it includes the following function:

[0213] Wgt = f(thr, map);

[0214] Among them, thr is the difference threshold, and map refers to the difference corresponding to different pixels in the difference map.

[0215] In the embodiment of the present application, the difference of the pixel is input into the third piecewise weight function to generate the difference weight of the pixel; the third piecewise weight function includes a plurality of function expressions corresponding to different difference intervals; or, the difference of the pixel is input into the third continuous weight function to generate the difference weight of the pixel; the third continuous weight function includes a plurality of function expressions corresponding to different differences. The difference of the pixel is input into a plurality of different functions to calculate the difference weight of the pixel, so that the difference weight can be calculated from a plurality of dimensions, and the robustness of the process of calculating the difference weight is improved.

[0216] In one embodiment, before determining the target image according to the original chrominance component and the luminance component after the joint denoising process, the method further includes:

[0217] The brightness component after joint denoising is fused with the original brightness component to obtain the target brightness component;

[0218] According to the original chrominance component and the luminance component after joint denoising, the target image is determined, including:

[0219] The target image is determined according to the original chrominance component and the target luminance component.

[0220] like Fig.10 As shown, it is a schematic diagram of the image denoising process in one embodiment. Among them, CurFrm represents the image frame to be processed, CurFrmY represents the original brightness component of the image frame to be processed, and CurFrmC represents the original chrominance component of the image frame to be processed. SNR is a spatial denoising processing module, and TNR is a temporal denoising processing module. The electronic device inputs CurFrmY and CurFrmC into the SNR module respectively to obtain the brightness component SnrFrmY after the spatial denoising and joint denoising processing and the chrominance component SnrFrmC after the spatial denoising processing.

[0221] For SnrFrmY, the electronic device obtains the original brightness component RefFrmY corresponding to the reference frame, such as the brightness component of the previous image frame to be processed after time domain denoising output by TNR; then RefFrmY, SnrFrmY, CurFrmY and CurFrmC are input into the TNR module together, and SnrFrmY is subjected to time domain denoising by the TNR module to obtain the brightness component TnrFrmY after spatial and time domain denoising.

[0222] Furthermore, the electronic device records TnrFrmY in the reference frame list for time domain denoising of the next image, and inputs TnrFrmY and CurFrmY into the MERGE module. The above-mentioned MERGE module is used to fuse TnrFrmY and CurFrmY based on the fusion weight value of the pixel to obtain the target brightness component OutFrmY. The electronic device directly uses SnrFrmC as the target chrominance component OutFrmC, and obtains the OutFrm of the target image by merging OutFrmY with OutFrmC. The electronic device can also directly merge CurFrmC with OutFrmY to obtain the OutFrm of the target image, which is not limited in this application.

[0223] In an embodiment of the present application, when the time domain denoising process may cause loss of image texture, the electronic device calculates the fusion weight value of each pixel, and fuses the brightness component after time domain denoising with the original brightness component of the image frame to be processed based on the fusion weight value, so that the texture characteristics of the image frame to be processed can be retained in the output brightness component, thereby improving the denoising effect of the image frame to be processed.

[0224] In one embodiment, the luminance component after the joint denoising process is fused with the original luminance component to obtain the target luminance component, including:

[0225] The edge operator is used to calculate the gradient of the original brightness component;

[0226] Get the maximum gradient from the gradient of the original brightness component;

[0227] According to the gradient of the original brightness component and the maximum gradient, the fusion weight of the brightness component after the joint denoising process and the original brightness component is calculated;

[0228] The luminance component after joint denoising and the original luminance component are fused based on the fusion weight to obtain the target luminance component.

[0229] Among them, the edge operator is an operator used for edge detection, including the Sobel operator. Among them, the Sobel operator is a discrete differentiation operator mainly used for edge detection. The Sobel operator combines Gaussian smoothing and differential derivation to calculate the approximate gradient of the image grayscale function. Using the Sobel operator at any point in the image will generate a corresponding gradient vector or normal vector.

[0230] Specifically, in the MERGE module, the luminance component TnrfrmY after the joint denoising process is fused with the original luminance component CurFrmY to obtain the target luminance component OutFrmY. First, the gradient of the original luminance component CurFrmY is calculated using the edge operator. Here, for all the original luminance components CurFrmY of the image frame to be processed, the horizontal sobel operator and the vertical sobel operator can be used to detect and generate the gradient grad_val.

[0231] Secondly, get the maximum gradient from the gradient grad_val of the original brightness component and name the maximum gradient k.

[0232] Secondly, according to the gradient grad_val of the original brightness component and the maximum gradient k, the fusion weight of the brightness component TnrfrmY after the joint denoising process and the original brightness component CurFrmY is calculated.

[0233] Finally, based on the fusion weight, the luminance component TnrfrmY after the joint denoising process and the original luminance component CurFrmY are fused to obtain the target luminance component OutFrmY. Specifically, the fusion can be performed based on the following formula:

[0234] OutFrmY=(TnrfrmY*(k-grad_val)+CurfrmY*grad_val) / k

[0235] Among them, the coefficient multiplied by TnrfrmY in this formula is the fusion weight of TnrfrmY, and the coefficient multiplied by CnrfrmY is the fusion weight of CurFrmY.

[0236] In an embodiment of the present application, an edge operator is used to calculate the gradient of the original brightness component, and the maximum gradient is obtained from the gradient of the original brightness component. According to the gradient of the original brightness component and the maximum gradient, the fusion weight of the brightness component after the joint denoising process and the original brightness component is calculated. Based on the fusion weight, the brightness component after the joint denoising process and the original brightness component are fused to obtain the target brightness component. Among them, the gradient can reflect the texture characteristics of the image. Therefore, by calculating the gradient to obtain the fusion weight of the brightness component TnrfrmY after the joint denoising process and the original brightness component CurFrmY, and then based on the fusion weight, the brightness component after the joint denoising process and the original brightness component are fused, the texture characteristics of the image frame to be processed can be retained, and the denoising effect of the image frame to be processed can be improved.

[0237] In one embodiment, determining a target image according to an original chrominance component and a target luminance component includes:

[0238] Performing spatial domain denoising on the original chroma component to obtain the chroma component after spatial domain denoising;

[0239] The target image is determined according to the chrominance component and the target brightness component after spatial domain denoising.

[0240] Specifically, the manner of performing spatial denoising on the original chrominance components of the image frame to be processed is similar to the manner of performing spatial denoising on the original luminance components described above, and will not be elaborated on here. It should be noted that when the electronic device performs spatial denoising on the original chrominance components and the original luminance components, the denoising parameters used may be the same or different. For example, when the electronic device uses the above-mentioned non-local mean spatial filtering method to perform spatial denoising on the original chrominance components, the parameters used, such as the gradient threshold, matching threshold, and image block size, may be different from the parameters used to process the original luminance components.

[0241] Combination Fig.10 As shown, the original chroma component is subjected to spatial denoising to obtain the chroma component after spatial denoising, that is, CurFrmC is subjected to spatial denoising to obtain SnrFrmC. According to the original chroma component after spatial denoising and the target brightness component, the target image is determined, that is, SnrFrmC is merged with the target brightness component OutFrmY to obtain OutFrm of the target image.

[0242] In the embodiment of the present application, the original chroma component is subjected to spatial denoising to obtain the chroma component after spatial denoising, and the target image is determined according to the chroma component after spatial denoising and the brightness component after joint denoising. Thus, the image frame to be processed is subjected to denoising from two perspectives, the chroma component and the brightness component, which improves the denoising effect of the target image obtained.

[0243] In one embodiment, performing spatial denoising processing on the original brightness component of each pixel in the image frame to be processed to obtain the brightness component of each pixel after spatial denoising includes:

[0244] Dividing the image frame to be processed into image blocks to be processed according to different image sizes, and calculating the gradient of the image blocks to be processed;

[0245] If the gradient of the image block to be processed is greater than a preset gradient threshold, the original brightness component of the pixel in the image block to be processed is used as the brightness component after spatial domain denoising corresponding to the pixel;

[0246] If the gradient of the image block to be processed is less than or equal to the preset gradient threshold, the image block to be processed is matched with a target image block of the image block to be processed; the target image block is an image block in the image frame to be processed that is located within a preset range around the image block to be processed;

[0247] The original brightness component of the successfully matched target image block is fused with the original brightness component of the image block to be processed to obtain the brightness component after spatial domain denoising corresponding to each pixel in the image block to be processed.

[0248] Optionally, the electronic device may use a non-local mean spatial domain filtering method to perform spatial domain denoising on the original brightness component of the image frame to be processed. The non-local mean spatial domain filtering method is specifically as follows:

[0249] For the original brightness component of the image frame to be processed, the electronic device can use a preset image size to traverse the original brightness component of the image frame to be processed to determine whether each image block to be processed needs to be subjected to spatial denoising. The preset image size of the above-mentioned image block to be processed can be set according to the noise form of the image frame to be processed. The noise ranges from fine low-frequency noise to patchy high-frequency noise, and the size of the above-mentioned image block to be processed can be larger and larger. When the electronic device traverses the original brightness component of the image frame to be processed, the traversal compensation can be less than n, and the traversal compensation can be adjusted with the noise form. For example, when the noise ranges from fine low-frequency noise to patchy high-frequency noise, the compensation can be smaller and smaller; in addition, the above-mentioned traversal step size can also be adjusted with the noise size. The larger the noise, the smaller the step size.

[0250] Taking an image size of n×n as an example, the electronic device can divide the image frame to be processed into Fig.11 The pixel gradients corresponding to the image blocks to be processed are calculated respectively, wherein the pixel gradients are used to measure the degree of change of the pixel values ​​in the image blocks to be processed. Fig.11 Cur is used to represent it) is greater than a preset gradient threshold, the electronic device can determine not to perform spatial denoising on the image block to be processed; if the pixel gradient corresponding to the image block to be processed is less than or equal to the preset gradient threshold, the electronic device can determine that spatial denoising is required on the image block to be processed. The preset gradient threshold can be set according to the noise level of the image frame to be processed; the greater the noise, the greater the corresponding gradient threshold.

[0251] Further, for the current image block that needs to be processed in the spatial domain, the electronic device may determine multiple image blocks to be processed around the current image block to be processed as target image blocks (in Fig.11 Ref is used to represent it), and then a preset matching method (such as SAD matching method) is used to match the target image block with the current image block to be processed. If the SAD is less than a preset matching threshold, it is considered that the target image block matches the current image block to be processed. The above matching threshold can be set according to the noise level of the image frame to be processed; the greater the noise, the greater the corresponding matching threshold.

[0252] If the target image block matches the current image block to be processed successfully, all matched target image blocks are weightedly fused with the current image block to be processed to obtain the spatial domain denoising block corresponding to the current image block to be processed; after each image block to be processed that needs to be denoised is processed in the above manner, the brightness component of the spatial domain denoising frame of the image frame to be processed can be obtained.

[0253] In an embodiment of the present application, the electronic device can use a non-local mean spatial filtering method to perform spatial denoising on the original brightness component of the image frame to be processed. A gradient is extracted from the image block to be processed. If the gradient of the image block to be processed is less than or equal to a preset gradient threshold, the image block to be processed is matched with the target image block of the image block to be processed. Based on the matching result, the brightness component after spatial denoising corresponding to the pixel in the image block to be processed is calculated. Obviously, based on the gradient and subsequent image block matching, the brightness component after spatial denoising is more comprehensive and more accurate.

[0254] In one embodiment, Fig.12 As shown, an image denoising device 1200 is provided, the device comprising:

[0255] The acquisition module 1220 is used to acquire the original brightness component of each pixel and the original chrominance component of each pixel in the image frame to be processed, and acquire the original brightness component of each pixel in the reference frame; the reference frame includes a preset number of image frames before the image frame to be processed;

[0256] A spatial denoising module 1240 is used to perform spatial denoising on the original brightness component of each pixel in the image frame to be processed to obtain a brightness component after spatial denoising;

[0257] The temporal denoising module 1260 is used to perform temporal denoising on the original brightness component of the reference frame and the brightness component after spatial denoising by using a preset target weight to obtain a brightness component after joint denoising; the target weight is related to the saturation, brightness and difference of the pixel;

[0258] The target image determination module 1280 is used to determine the target image according to the original chrominance component and the luminance component after the joint denoising process.

[0259] In one embodiment, the target image determination module 1280 is further used to perform spatial denoising on the original chrominance components to obtain the chrominance components after spatial denoising; and determine the target image based on the chrominance components after spatial denoising and the luminance components after joint denoising.

[0260] In one embodiment, Fig.13 As shown, an image denoising device is provided, the device also includes:

[0261] The target weight determination module 1250 is used to determine the target weight based on the first brightness component, the first chrominance component and the original brightness component of the reference frame; wherein the first brightness component includes the original brightness component of the image frame to be processed or the brightness component after spatial denoising, and the first chrominance component includes the original chrominance component of the image frame to be processed or the chrominance component after spatial denoising.

[0262] In one embodiment, Fig.14 As shown, the target weight determination module 1250 includes:

[0263] A saturation weight calculation module 1252, used to calculate the saturation weight of the image frame to be processed according to the first brightness component and the first chrominance component;

[0264] A brightness weight calculation module 1254, used to calculate the brightness weight of the image frame to be processed according to the first brightness component;

[0265] The difference weight calculation module 1256 is used to calculate the difference weight of the image frame to be processed according to the brightness component after spatial denoising and the original brightness component of the reference frame;

[0266] The target weight calculation module 1258 is used to determine the target weight according to the saturation weight, the brightness weight and the difference weight.

[0267] In one embodiment, the saturation weight calculation module 1252 is also used to determine the saturation of the pixel based on the first brightness component and the first chromaticity component; determine the saturation weight of the pixel based on the saturation of the pixel and a preset first weight mapping relationship; wherein the first weight mapping relationship includes a mapping relationship between different pixel saturations and saturation weights.

[0268] In one embodiment, the saturation weight calculation module 1252 is also used to perform color gamut mapping on the first brightness component and the first chrominance component of each pixel of the image frame to be processed, so as to generate a saturation mapping map of the image frame to be processed; wherein the saturation mapping map includes the saturation of each pixel; and the saturation of the pixel is determined from the saturation mapping map.

[0269] In one embodiment, the saturation weight calculation module 1252 is further used to input the saturation of the pixel into a first piecewise weight function to generate a saturation weight of the pixel; the first piecewise weight function includes function expressions corresponding to multiple different saturation intervals; or,

[0270] The saturation of the pixel is input into a first continuous weight function to generate a saturation weight of the pixel; the first continuous weight function includes a plurality of function expressions corresponding to different saturations.

[0271] In one embodiment, the brightness weight calculation module 1254 is also used to determine the brightness of the pixel based on the first brightness component; determine the brightness weight of the pixel based on the brightness of the pixel and a preset second weight mapping relationship; wherein the second weight mapping relationship includes a mapping relationship between different pixel brightnesses and brightness weights.

[0272] In one embodiment, the brightness weight calculation module 1254 is also used to perform a preset mapping on the first brightness component of each pixel of the image frame to be processed, so as to generate a brightness mapping map of the image frame to be processed; wherein the brightness mapping map includes the brightness of each pixel; and the brightness of the pixel is determined from the brightness mapping map.

[0273] In one embodiment, the brightness weight calculation module 1254 is further used to input the brightness of the pixel into a second piecewise weight function to generate the brightness weight of the pixel; the second piecewise weight function includes function expressions corresponding to multiple different brightness intervals; or,

[0274] The brightness of the pixel is input into a second continuous weight function to generate a brightness weight of the pixel; the second continuous weight function includes a plurality of function expressions corresponding to different brightnesses.

[0275] In one embodiment, the difference weight calculation module 1256 is also used to generate the pixel difference for each pixel of the image frame to be processed according to the brightness component after spatial denoising and the original brightness component of the reference frame; determine the pixel difference weight according to the pixel difference and a preset third weight mapping relationship; wherein the third weight mapping relationship includes a mapping relationship between different pixel differences and difference weights.

[0276] In one embodiment, the difference weight calculation module 1256 is also used to perform a differential operation on the brightness component after spatial denoising and the original brightness component of the reference frame for each pixel of the image frame to be processed, so as to generate a difference map of the image frame to be processed; wherein the difference map includes the difference of each pixel; and the difference of the pixel is determined from the difference map.

[0277] In one embodiment, the difference weight calculation module 1256 is also used to perform a pyramid difference operation or a difference filtering operation on the brightness component after spatial denoising and the original brightness component of the reference frame for each pixel of the image frame to be processed, so as to generate a difference map of the image frame to be processed.

[0278] In one embodiment, the difference weight calculation module 1256 includes a pyramid difference operation unit, which is used to: divide the image frame to be processed into image blocks to be processed according to different image sizes, and divide the reference frame into reference image blocks according to the different image sizes; for each same image size, obtain the brightness component after spatial denoising corresponding to the image block to be processed divided under the same image size, and obtain the original brightness component of the reference image block divided under the same image size; calculate the difference map between the image frame to be processed and the reference frame under the same image size according to the brightness component after spatial denoising corresponding to the image block to be processed and the original brightness component of the reference image block; based on the difference map under all image sizes, obtain the difference map of the image frame to be processed.

[0279] In one embodiment, the difference weight calculation module 1256 includes a differential filtering operation unit, which is used to perform differential calculations on the brightness component after spatial denoising and the original brightness component of each reference frame to obtain multiple differential images; for each pixel, the maximum pixel value is extracted in each differential image to obtain a maximum differential image; according to a preset image size, a local maximum image block in the maximum differential image is obtained; the local maximum image block is filtered and expanded to obtain a difference map of the image frame to be processed.

[0280] In one embodiment, the difference weight calculation module 1256 is further used to input the difference of the pixel into a third segment weight function to generate the difference weight of the pixel; the third segment weight function includes a plurality of function expressions corresponding to different difference intervals; or,

[0281] The difference of the pixel is input into a third continuous weight function to generate a difference weight of the pixel; the third continuous weight function includes a plurality of function expressions corresponding to different differences.

[0282] In one embodiment, Fig.15 As shown, an image denoising device 1200 is provided, and the device also includes:

[0283] A fusion module 1270 is used to fuse the brightness component after the joint denoising process with the original brightness component to obtain a target brightness component;

[0284] The target image determination module 1280 is further configured to determine the target image according to the original chrominance component and the target brightness component.

[0285] In one embodiment, the fusion module 1270 is also used to calculate the gradient of the original brightness component using an edge operator; obtain the maximum gradient from the gradient of the original brightness component; calculate the fusion weight for fusing the brightness component after the joint denoising process and the original brightness component based on the gradient of the original brightness component and the maximum gradient; and fuse the brightness component after the joint denoising process and the original brightness component based on the fusion weight to obtain the target brightness component.

[0286] In one embodiment, the target image determination module 1280 is further used to perform spatial denoising on the original chrominance components to obtain spatially denoised chrominance components; and determine the target image based on the spatially denoised chrominance components and the target luminance components.

[0287] In one embodiment, the spatial domain denoising module is further used to divide the image frame to be processed into image blocks to be processed according to different image sizes, and calculate the gradient of the image blocks to be processed;

[0288] If the gradient of the image block to be processed is greater than a preset gradient threshold, the original brightness component of the pixel in the image block to be processed is used as the brightness component after spatial domain denoising corresponding to the pixel;

[0289] If the gradient of the image block to be processed is less than or equal to the preset gradient threshold, the image block to be processed is matched with a target image block of the image block to be processed; the target image block is an image block in the image frame to be processed that is located within a preset range around the image block to be processed;

[0290] The original brightness component of the successfully matched target image block is fused with the original brightness component of the image block to be processed to obtain the brightness component after spatial domain denoising corresponding to each pixel in the image block to be processed.

[0291] It should be understood that, although the various steps in the flowchart in the figure are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0292] The division of the modules in the image denoising device is only for illustration. In other embodiments, the image denoising device may be divided into different modules as needed to complete all or part of the functions of the image denoising device.

[0293] For the specific definition of the image denoising device, please refer to the definition of the image denoising method above, which will not be repeated here. Each module in the image denoising device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0294] In one embodiment, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of an image denoising method provided in the above embodiments.

[0295] Fig.16 FIG. 1 is a schematic diagram of the internal structure of an electronic device in one embodiment. Fig.16 As shown, the electronic device includes a processor and a memory connected via a system bus. The processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image denoising method provided in each of the above embodiments. The internal memory provides a cache operating environment for the operating system computer program in the non-volatile storage medium. The electronic device can be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, etc.

[0296] The implementation of each module in the image denoising device provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on an electronic device or an electronic device. The program module constituted by the computer program may be stored in the memory of the electronic device or the electronic device. When the computer program is executed by the processor, the steps of the method described in the embodiment of the present application are implemented.

[0297] The embodiment of the present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the image denoising method.

[0298] A computer program product comprising instructions, when executed on a computer, causes the computer to perform an image denoising method.

[0299] Any reference to memory, storage, database or other media used in the embodiments of the present application may include non-volatile and / or volatile memory. Suitable non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM).

[0300] The above-mentioned image denoising examples only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image denoising method, characterized in that: The method comprises: Acquire the original brightness component of each pixel and the original chrominance component of each pixel in the image frame to be processed, and acquire the original brightness component of each pixel in the reference frame; the reference frame includes a preset number of image frames before the image frame to be processed; Performing spatial domain denoising on the original brightness component of each pixel in the image frame to be processed to obtain a brightness component after spatial domain denoising; Using a preset target weight, the original brightness component of the reference frame and the brightness component after spatial denoising are subjected to temporal denoising to obtain a brightness component after joint denoising; the target weight is related to the saturation, brightness and difference of the pixel; wherein the difference is the difference in pixel value between the pixel at the same position of the image frame to be processed and the reference frame; Determine a target image according to the original chrominance component and the luminance component after the joint denoising process; Wherein, the method further comprises: Calculating the saturation weight of the image frame to be processed according to the first brightness component and the first chrominance component; wherein the first brightness component includes the original brightness component of the image frame to be processed or the brightness component after spatial denoising, and the first chrominance component includes the original chrominance component of the image frame to be processed or the chrominance component after spatial denoising; Calculating a brightness weight of the image frame to be processed according to the first brightness component; Calculating the difference weight of the image frame to be processed according to the brightness component after spatial denoising and the original brightness component of the reference frame; Determining the target weight according to the saturation weight, the brightness weight and the difference weight; The step of calculating the saturation weight of the image frame to be processed according to the first brightness component and the first chrominance component includes: Determining a saturation of the pixel according to the first luminance component and the first chrominance component; The saturation weight of the pixel is determined according to the saturation of the pixel and a preset first weight mapping relationship; wherein the first weight mapping relationship includes mapping relationships between different pixel saturations and saturation weights.

2. The image denoising method according to claim 1, characterized in that: The step of determining a target image according to the original chrominance component and the luminance component after the joint denoising process comprises: Performing spatial domain denoising on the original chrominance component to obtain a spatially denoised chrominance component; A target image is determined according to the chrominance component after the spatial denoising and the luminance component after the joint denoising.

3. The image denoising method according to claim 1, characterized in that: The determining the saturation of the pixel according to the first brightness component and the first chrominance component comprises: For each pixel of the image frame to be processed, color gamut mapping is performed on the first brightness component of the pixel and the first chrominance component of the pixel to generate a saturation map of the image frame to be processed; wherein the saturation map includes the saturation of each pixel; The saturation of the pixel is determined from the saturation map.

4. The image denoising method according to claim 1, characterized in that: The determining the saturation weight of the pixel according to the saturation of the pixel and a preset first weight mapping relationship includes: Inputting the saturation of the pixel into a first piecewise weight function to generate a saturation weight of the pixel; the first piecewise weight function includes function expressions corresponding to a plurality of different saturation intervals; or, The saturation of the pixel is input into a first continuous weight function to generate a saturation weight of the pixel; the first continuous weight function includes a plurality of function expressions corresponding to different saturations.

5. The image denoising method according to claim 1, characterized in that: The step of calculating the brightness weight of the image frame to be processed according to the brightness component or the brightness component after spatial denoising includes: determining a brightness of the pixel according to the first brightness component; The brightness weight of the pixel is determined according to the brightness of the pixel and a preset second weight mapping relationship; wherein the second weight mapping relationship includes mapping relationships between different pixel brightnesses and brightness weights.

6. The image denoising method according to claim 5, characterized in that: The determining the brightness of the pixel according to the first brightness component comprises: For each pixel of the image frame to be processed, a first brightness component of the pixel is mapped in a preset manner to generate a brightness mapping diagram of the image frame to be processed; wherein the brightness mapping diagram includes the brightness of each pixel; The brightness of the pixel is determined from the brightness map.

7. The image denoising method according to claim 5, characterized in that: The step of determining the brightness weight of the pixel according to the brightness of the pixel and a preset second weight mapping relationship includes: Inputting the brightness of the pixel into a second piecewise weight function to generate a brightness weight of the pixel; the second piecewise weight function includes function expressions corresponding to a plurality of different brightness intervals; or, The brightness of the pixel is input into a second continuous weight function to generate a brightness weight of the pixel; the second continuous weight function includes a plurality of function expressions corresponding to different brightnesses.

8. The image denoising method according to claim 1, characterized in that: The calculating the difference weight of the image frame to be processed according to the brightness component after spatial denoising and the original brightness component of the reference frame includes: For each pixel of the image frame to be processed, generating a difference degree of the pixel according to the brightness component after the spatial domain denoising and the original brightness component of the reference frame; The difference weight of the pixel is determined according to the difference of the pixel and a preset third weight mapping relationship; wherein the third weight mapping relationship includes mapping relationships between different pixel differences and difference weights.

9. The image denoising method according to claim 8, characterized in that: The step of generating, for each pixel of the image frame to be processed, a difference of the pixel according to the brightness component after spatial denoising and the original brightness component of the reference frame, comprises: For each pixel of the image frame to be processed, performing a differential operation on the luminance component after spatial denoising and the original luminance component of the reference frame to generate a difference map of the image frame to be processed; wherein the difference map includes the difference of each pixel; The disparity of the pixel is determined from the disparity map.

10. The image denoising method according to claim 9, characterized in that: The step of performing a differential operation on the luminance component after spatial denoising and the original luminance component of the reference frame for each pixel of the image frame to be processed to generate a difference map of the image frame to be processed includes: For each pixel of the image frame to be processed, a pyramid difference operation or a difference filtering operation is performed on the brightness component after the spatial denoising and the original brightness component of the reference frame to generate a difference map of the image frame to be processed.

11. The image denoising method according to claim 10, characterized in that: The step of performing a pyramid difference operation on the luminance component after spatial denoising and the original luminance component of the reference frame to generate a difference map of the image frame to be processed includes: Dividing the to-be-processed image frame into to-be-processed image blocks according to different image sizes, and dividing the reference frame into reference image blocks according to the different image sizes; For each same image size, obtaining the luminance component after spatial denoising corresponding to the to-be-processed image block divided under the same image size, and obtaining the original luminance component of the reference image block divided under the same image size; Calculating a difference map between the image frame to be processed and the reference frame at the same image size according to the luminance component after spatial domain denoising corresponding to the image block to be processed and the original luminance component of the reference image block; Based on the difference maps at all image sizes, a difference map of the image frame to be processed is obtained.

12. The image denoising method according to claim 10, characterized in that: The step of performing a differential filtering operation on the luminance component after spatial denoising and the original luminance component of the reference frame to generate a difference map of the image frame to be processed includes: Performing difference calculation on the luminance component after spatial domain denoising and the original luminance component of each reference frame to obtain a plurality of difference images; For each pixel, extracting the maximum pixel value in each of the differential images to obtain a maximum differential image; According to a preset image size, obtaining a local maximum image block in the maximum difference image; The local maximum image block is filtered and expanded to obtain a difference map of the image frame to be processed.

13. The image denoising method according to claim 8, characterized in that: The determining the difference weight of the pixel according to the difference of the pixel and a preset third weight mapping relationship includes: Inputting the difference of the pixel into a third segment weight function to generate the difference weight of the pixel; the third segment weight function includes function expressions corresponding to a plurality of different difference intervals; or, The difference of the pixel is input into a third continuous weight function to generate a difference weight of the pixel; the third continuous weight function includes a plurality of function expressions corresponding to different differences.

14. The image denoising method according to any one of claims 1 to 13, characterized in that: Before determining the target image according to the original chrominance component and the luminance component after the joint denoising process, the method further includes: Fusing the brightness component after the joint denoising process with the original brightness component to obtain a target brightness component; The step of determining a target image according to the original chrominance component and the luminance component after the joint denoising process comprises: A target image is determined according to the original chrominance component and the target luminance component.

15. The image denoising method according to claim 14, characterized in that: The step of fusing the brightness component after the joint denoising process with the original brightness component to obtain a target brightness component includes: Using an edge operator to calculate the gradient of the original brightness component; Obtaining the maximum gradient from the gradients of the original brightness components; Calculating a fusion weight for fusing the brightness component after the joint denoising process and the original brightness component according to the gradient of the original brightness component and the maximum gradient; The brightness component after the joint denoising process and the original brightness component are fused based on the fusion weight to obtain the target brightness component.

16. The image denoising method according to claim 14, characterized in that: The step of determining a target image according to the original chrominance component and the target luminance component comprises: Performing spatial domain denoising on the original chrominance component to obtain a spatially denoised chrominance component; A target image is determined according to the chrominance component after spatial domain denoising and the target brightness component.

17. The image denoising method according to any one of claims 1 to 13, characterized in that: The performing spatial domain denoising on the original brightness component of each pixel in the image frame to be processed to obtain the brightness component of each pixel after spatial domain denoising includes: Dividing the image frame to be processed into image blocks to be processed according to different image sizes, and calculating the gradients of the image blocks to be processed; If the gradient of the image block to be processed is greater than a preset gradient threshold, the original brightness component of the pixel in the image block to be processed is used as the brightness component after spatial domain denoising corresponding to the pixel; If the gradient of the image block to be processed is less than or equal to the preset gradient threshold, the image block to be processed is matched with a target image block of the image block to be processed; the target image block is an image block in the image frame to be processed that is located within a preset range around the image block to be processed; The original brightness component of the successfully matched target image block is fused with the original brightness component of the image block to be processed to obtain the brightness component after spatial domain denoising corresponding to each pixel in the image block to be processed.

18. An image denoising device, characterized in that: The device comprises: An acquisition module, used to acquire an original brightness component of each pixel and an original chrominance component of each pixel in the image frame to be processed, and to acquire a brightness component of each pixel in a reference frame; the reference frame includes a preset number of image frames before the image frame to be processed; A spatial denoising module, used for performing spatial denoising on the original brightness component of each pixel in the image frame to be processed to obtain a brightness component after spatial denoising; A temporal denoising module, configured to perform temporal denoising on the original brightness component of the reference frame and the brightness component after spatial denoising by using a preset target weight, so as to obtain a brightness component after joint denoising; the target weight is related to the saturation, brightness and difference of the pixel; wherein the difference is the difference in pixel value between the pixel at the same position of the image frame to be processed and the reference frame; A target image determination module, used to determine a target image according to the original chrominance component and the luminance component after the joint denoising process; Wherein, the image denoising device further comprises: A saturation weight calculation module, used to calculate the saturation weight of the image frame to be processed according to a first brightness component and a first chrominance component; wherein the first brightness component includes the original brightness component of the image frame to be processed or the brightness component after spatial denoising, and the first chrominance component includes the original chrominance component of the image frame to be processed or the chrominance component after spatial denoising; A brightness weight calculation module, used for calculating the brightness weight of the image frame to be processed according to the first brightness component; A difference weight calculation module, used to calculate the difference weight of the image frame to be processed according to the brightness component after spatial denoising and the original brightness component of the reference frame; A target weight calculation module, used to determine the target weight according to the saturation weight, the brightness weight and the difference weight; Wherein, the saturation weight calculation module is specifically used for: Determining a saturation of the pixel according to the first luminance component and the first chrominance component; The saturation weight of the pixel is determined according to the saturation of the pixel and a preset first weight mapping relationship; wherein the first weight mapping relationship includes mapping relationships between different pixel saturations and saturation weights.

19. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the image denoising method according to any one of claims 1 to 17.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image denoising method according to any one of claims 1 to 17 are implemented.