Video noise reduction method, device, electronic device and computer-readable storage medium

By obtaining the fusion factor and adaptive noise reduction factor of the video frame for motion estimation and image fusion, the problem of high computational complexity of video noise reduction in the existing technology is solved, and real-time video noise reduction and texture detail preservation are achieved on mobile terminals. .

CN118365554BActive Publication Date: 2024-08-23SHENZHEN SUPER PIXEL INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410789407.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-08-23
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

While existing video noise reduction methods improve video image quality, they have high computational complexity, cannot be processed in real time on mobile terminals, and affect the retention of texture details.

Method used

By obtaining the fusion factor of the current frame and the previous frame image, combined with the adaptive noise reduction factor for motion estimation and image fusion, a target denoised image is generated. Only 2 frames of images are required for denoising processing, reducing the amount of calculation and retaining the original image. texture.

Benefits of technology

While reducing the amount of calculation, it also improves the video noise reduction effect, achieving real-time processing and texture detail retention on mobile terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365554B
    Figure CN118365554B
Patent Text Reader

Abstract

The embodiment of the present application discloses a video denoising method, device, electronic device and computer-readable storage medium, wherein the method comprises: obtaining a current frame image and a previous frame image of a target video; the previous frame image comprises an image output in the previous cycle and a previous frame image that has not been subjected to denoising processing; obtaining a fusion factor corresponding to the current frame image and the previous frame image of the target video, the fusion factor being related to a first adaptive denoising factor and a second adaptive denoising factor; performing motion estimation on the current frame image and the previous frame image that have not been subjected to denoising processing of the target video to obtain an optical flow result, the optical flow result being used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image; fusing the current frame image and the image to be fused to generate a target denoised image corresponding to the target video in the current cycle. The present application can reduce the amount of denoising calculation and improve the denoising effect of the video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing technology, and in particular to a video noise reduction method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of image display devices, people have higher and higher requirements for high-quality and high-definition video image information. However, in reality, video images are often interfered by noise during the digitization and transmission process, which affects the quality and clarity of the video images. Therefore, how to effectively suppress noise in video images is crucial.

[0003] At present, the main methods of video noise reduction include: taking the current frame of the video and several previous and next frames, respectively performing motion estimation on the current frame and each previous and next frame, generating an image after the previous and next frames are aligned, then calculating the fusion weight of each frame, and finally generating a video frame after noise reduction through multi-frame fusion. This implementation method requires a large number of video frames to achieve a good noise reduction effect, and increasing the number of video frames greatly increases the computational complexity, making it impossible for mobile terminals to process in real time, and it is even more impossible to retain more texture details while reducing noise, which affects the effect of video noise reduction. Summary of the invention

[0004] The embodiments of the present application provide a video noise reduction method, device, electronic device and computer-readable storage medium, which can improve the noise reduction effect of the video while reducing the amount of noise reduction calculation.

[0005] In a first aspect, an embodiment of the present application provides a video noise reduction method, which may include the following steps:

[0006] Obtaining the current frame image and the previous frame image of the target video; wherein the previous frame image includes the image output in the previous cycle and the previous frame image that has not been subjected to noise reduction processing;

[0007] Acquire a fusion factor corresponding to a current frame image and a previous frame image of the target video, wherein the fusion factor is related to a first adaptive noise reduction factor and a second adaptive noise reduction factor, the first adaptive noise reduction factor is used to indicate a position offset between the current frame image and the previous frame image; the second adaptive noise reduction factor is used to indicate a noise level of the current frame image;

[0008] Performing motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result, wherein the optical flow result is used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image;

[0009] The current frame image and the image to be fused are fused to generate a target denoised image corresponding to the target video in the current cycle.

[0010] When implementing the embodiment of the present application, when denoising a frame image of a target video, the image output in the previous cycle and the fusion factor related to the first adaptive noise reduction factor and the second adaptive noise reduction factor are fully considered to generate a target denoised image corresponding to the target video of the current cycle. This can reduce the amount of noise reduction calculation while retaining the original texture of the image and improve the noise reduction effect of the video.

[0011] In a possible implementation, the method further includes:

[0012] Processing the optical flow result to obtain a position offset between the current frame image and the previous frame image;

[0013] The first adaptive noise reduction factor is obtained according to the position offset.

[0014] In this way, the first adaptive noise reduction factor can be obtained in combination with the position offset.

[0015] In a possible implementation, the optical flow result includes an optical flow in an x ​​direction and an optical flow in a y direction, where the x direction is orthogonal to the y direction; and processing the optical flow result to obtain a position offset between the current frame image and the previous frame image includes:

[0016] Taking an average value and an absolute value of the optical flow in the x direction and the optical flow in the y direction respectively to obtain a first optical flow value and a second optical flow value;

[0017] A maximum value between the first optical flow value and the second optical flow value is obtained, and the maximum value is determined as the position offset.

[0018] In a possible implementation manner, acquiring the first adaptive noise reduction factor according to the position offset includes:

[0019] When determining the first adaptive noise reduction factor, it is calculated according to the following formula:

[0020]

[0021] Wherein, Y1 represents the first adaptive noise reduction factor, and D represents the position offset.

[0022] In a possible implementation, the method further includes:

[0023] Acquire a first pixel value difference between the current frame image and the previous frame image, where the first pixel value difference is a pixel difference value between a first pixel point and a corresponding pixel point;

[0024] Acquire a noise level of the first pixel point based on the first pixel value difference;

[0025] The second adaptive noise reduction factor is obtained according to the noise level of the first pixel.

[0026] In this way, the second adaptive noise reduction factor can be obtained in combination with the noise level of the pixel point.

[0027] In a possible implementation manner, obtaining the second adaptive noise reduction factor according to the noise level of the first pixel includes:

[0028] When determining the second adaptive noise reduction factor, it is calculated according to the following formula:

[0029]

[0030] Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

[0031] In a second aspect, the present application provides a video noise reduction method, which may include the following steps: in response to a user operation, displaying a video frame on a display screen of an electronic device, the video frame including a target noise reduction image after noise reduction, the target noise reduction image after noise reduction is obtained by performing video noise reduction on a target video captured by a camera of the electronic device according to the video noise reduction method provided in any one of the first aspects above.

[0032] In a possible implementation, the user operation is an operation of turning on a video noise reduction mode, where the video noise reduction mode is used to indicate that noise reduction is performed on a video frame acquired by the electronic device; or, the user operation is an operation of starting video shooting.

[0033] In a third aspect, the present application provides a video noise reduction device, which includes an image acquisition unit, a fusion factor acquisition unit, an image processing unit, and a fusion unit. The video noise reduction device is configured to execute the video noise reduction method described in any one of the first aspect or the second aspect.

[0034] In a fourth aspect, the present application also provides a video noise reduction device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, it executes the video noise reduction method described in any one of the first aspect or the second aspect.

[0035] In a fifth aspect, the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the video noise reduction method described in any one of the first aspect or the second aspect is implemented.

[0036] In a sixth aspect, the present application further provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the video noise reduction method as described in any one of the first aspect or the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.

[0038] Figure 1 is a schematic diagram of an application scenario of the video noise reduction method provided in an embodiment of the present application;

[0039] Figure 2 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0040] Figure 3 It is a flow chart of a video noise reduction method provided in an embodiment of the present application;

[0041] Figure 4 is a structural schematic diagram of a video noise reduction device provided in an embodiment of the present application;

[0042] Figure 5 It is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0044] Figure 1 It is a schematic diagram of an application scenario of the video noise reduction method provided in an embodiment of the present application.

[0045] like Figure 1 As shown, the video noise reduction method of the embodiment of the present application can be applied to electronic devices. When recording an object through a camera of an electronic device, due to limitations of hardware and environment, the acquired video may have noise problems such as noise points, patches, ghosting, etc. that affect the visual effect. At this time, the original video without noise reduction collected by the camera in the electronic device can be subjected to noise reduction processing to obtain a video after noise reduction.

[0046] Among them, the above-mentioned electronic device can be mobile or fixed. For example, the electronic device can be a mobile phone with video noise reduction function, a camera, a camcorder, a vehicle, a tablet personal computer (TPC), a media player, a smart TV, a laptop computer (LC), a personal digital assistant (PDA), a personal computer (PC), a smart watch, augmented reality (AR) / virtual reality (VR), a wearable device (WD), a game console, etc. The embodiment of the present application does not limit the specific type of the electronic device.

[0047] Among them, the implementation process of noise reduction processing may include: obtaining a current frame image and a previous frame image of a target video; wherein the previous frame image includes an image output in a previous cycle and a previous frame image that has not been subjected to noise reduction processing; obtaining a fusion factor corresponding to the current frame image and the previous frame image of the target video, wherein the fusion factor is related to a first adaptive noise reduction factor and a second adaptive noise reduction factor, the first adaptive noise reduction factor is used to indicate a position offset between the current frame image and the previous frame image; the second adaptive noise reduction factor is used to indicate a noise level of the current frame image; performing motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result, the optical flow result is used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image; fusing the current frame image and the image to be fused to generate a target noise reduction image corresponding to the target video in the current cycle.

[0048] In a possible implementation, the video frames after the fusion and noise reduction of the multiple frames may be subjected to subsequent image processing before being output, wherein the subsequent image processing may include performing image processing such as white balance, color correction, tone mapping, etc. on the video frames after the fusion and noise reduction of the multiple frames.

[0049] In a possible implementation, outputting the noise-reduced image (or video) includes displaying it on a screen of the electronic device and / or saving it to a photo album of the electronic device.

[0050] Reference Figure 2 An example electronic device 100 for implementing the video noise reduction method and apparatus according to an embodiment of the present application is described below. Figure 1As shown, the electronic device 100 includes one or more processors 102, one or more storage devices 104, an input device 106, and an output device 108. The electronic device 100 may also include a data acquisition device 110 and / or an image acquisition device 112, and these components are interconnected via a bus system 114 and / or other forms of connection mechanisms (not shown). It should be noted that Figure 2 The components and structures of the electronic device 100 shown are merely exemplary and non-limiting. The electronic device may also have other components and structures as required.

[0051] The processor 102 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 100 to perform desired functions.

[0052] The storage device 104 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM, hard disk, flash memory), etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 102 may run the program instructions to implement the client functions (implemented by the processor) in the embodiments of the present application described below and / or other desired functions. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.

[0053] The input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.

[0054] The output device 108 may output various information (eg, images and / or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.

[0055] In the case where the electronic device 100 is used to implement the video noise reduction method and device according to the embodiment of the present application, the electronic device 100 may include a data acquisition device 110. The data acquisition device 110 may acquire a video stream, then acquire a video frame in the video stream, and store the acquired image in the storage device 104 for use by other components. For example, the data acquisition device 110 may include one or more of a wired or wireless network interface, a universal serial bus (USB) interface, an optical disk drive, and the like.

[0056] In the case where the electronic device 100 is used to implement the image processing method and device according to the embodiment of the present application, the electronic device 100 may include an image acquisition device 112. The image acquisition device 112 may acquire images and store the acquired images in the storage device 104 for use by other components. The image acquisition device 112 may be a camera. It should be understood that the image acquisition device 112 is only an example, and the electronic device 100 may not include the image acquisition device 112. In this case, other devices with image acquisition capabilities may be used to acquire images to be processed, and the acquired images may be sent to the electronic device 100.

[0057] Exemplarily, an example electronic device for implementing the video noise reduction method and apparatus according to an embodiment of the present application may be implemented on a device such as a personal computer or a remote server.

[0058] Combine the following Figure 3 The video noise reduction method provided in the embodiment of the present application is described in detail.

[0059] Figure 3 The flowchart of the video noise reduction method provided by the embodiment of the present application is shown. The method can be performed by the electronic device 100, and may include but is not limited to the following steps:

[0060] Step S301, obtaining a current frame image and a previous frame image of a video; wherein the previous frame image includes an image output in a previous cycle and a previous frame image that has not been subjected to noise reduction processing.

[0061] In one embodiment, the current frame image and the previous frame image are cached in time sequence.

[0062] Step S302: Obtain a fusion factor corresponding to a current frame image and a previous frame image of a target video, wherein the fusion factor is related to a first adaptive noise reduction factor and a second adaptive noise reduction factor, wherein the first adaptive noise reduction factor is used to indicate a position offset between the current frame image and the previous frame image; and the second adaptive noise reduction factor is used to indicate a noise level of the current frame image.

[0063] In one embodiment, the implementation process of obtaining the first adaptive noise reduction factor may include: processing the optical flow result to obtain the position offset between the current frame image and the previous frame image; and obtaining the first adaptive noise reduction factor according to the position offset. Specifically, the position offset can adaptively adjust the intensity of noise reduction, for example, when the video is in transition, the intensity of noise reduction is reduced; for another example, when the video is not in transition, the intensity of noise reduction is increased. In this way, the problem of unclearness caused by noise reduction during transition can be avoided.

[0064] In one embodiment, the optical flow result includes an optical flow in the x direction and an optical flow in the y direction, and the x direction is orthogonal to the y direction; the optical flow result is processed to obtain the position offset between the current frame image and the previous frame image (i.e., the two frames before and after), including: taking the average value and the absolute value of the optical flow in the x direction and the optical flow in the y direction, respectively, to obtain a first optical flow value and a second optical flow value; for example, the optical flow in the x direction can be represented by flow(x), and the optical flow in the y direction can be represented by flow(y). Obtain the maximum value of the first optical flow value and the second optical flow value, and determine the maximum value as the position offset. In practical applications, the position offset can be obtained by the following formula:

[0065] Formula (1)

[0066] Among them, D represents the position offset, max() represents the maximum value function, abs() represents the absolute value function, and mean() represents the average value function.

[0067] Furthermore, the first adaptive noise reduction factor can be obtained by the following formula:

[0068] Formula (2)

[0069] Wherein, Y1 represents the first adaptive noise reduction factor, and D represents the position offset.

[0070] In one embodiment, the implementation process of obtaining the optical flow result may include: reducing the width and height of the image to one-fourth of the original image size, then building a pyramid, gridding each layer of the pyramid into 8x8 blocks, performing a reverse search on each grid to solve the motion vector, then densifying the sparse optical flow, and finally performing variational optimization, outputting the optical flow result of this layer as the initial value of the optical flow of the next layer, and looping until the last layer of the pyramid is processed, and finally enlarging the optical flow result to the size of the original image, and outputting the final optical flow result.

[0071] In one embodiment, the implementation process of obtaining the second adaptive noise reduction factor may include: obtaining a first pixel value difference between the current frame image and the previous frame image, where the first pixel value difference is a pixel difference value between the first pixel point and the corresponding pixel point;

[0072] Acquire a noise level of the first pixel point based on the first pixel value difference;

[0073] The second adaptive noise reduction factor is obtained according to the noise level of the first pixel.

[0074] Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

[0075] Specifically, in an embodiment of the present application, the noise level is estimated by comparing the pixel differences between adjacent frames. This method uses the spatiotemporal correlation in the video sequence to improve the accuracy of noise estimation. The motion vector from each pixel of the current frame to the pixel of the previous frame has been obtained through the above motion estimation. It is only necessary to traverse each pixel of the current frame, subtract the coordinates of the corresponding point of the previous frame plus the pixel value of the motion vector, and then sum them up, and finally take the average, which is the noise level of the current frame. For real-time processing, the input image can be a small image with a size of 1 / 16 of the width and height of the original image. Assume that the pixel value range of the image is 0 to 255, and the pixel value of the current frame is p ij , the pixel value of the previous frame is q i+u,j+v , where i represents the number of rows, j represents the number of columns, u and v are the motion vectors calculated in step 1, and the image has a total of m rows and n columns. The sum of the corresponding pixel differences between the two frames of images is shown in formula 3:

[0076] Formula (3)

[0077] Then take the average value, as shown in Formula 4:

[0078]

[0079] The result of noise estimation will eventually affect the strength of noise reduction. Therefore, when determining the second adaptive noise reduction factor, it is calculated according to the following formula:

[0080]

[0081] Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

[0082] Step S303: perform motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result. The optical flow result is used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image.

[0083] Step S304: Fusing the current frame image and the image to be fused to generate a target denoised image corresponding to the target video in the current cycle.

[0084] The video denoising method provided by the present invention only needs to fuse two frames of images, one is the current frame, and the other is the previous frame that has been denoised, that is, the image calculated in the previous cycle. Assume that the pixel values ​​of the image are normalized from 0.0 to 1.0, and the pixel value of the current frame is p ij , the pixel value of the previous denoised frame is q i+u,j+v, where i represents the number of rows, j represents the number of columns, u and v are the motion vectors calculated in step 1. The image has a total of m rows and n columns. The pixel difference diff is first calculated according to formula (6), and then the beta value (i.e., the fusion factor) to be added or subtracted from the pixel value of the current frame is calculated according to formula (6). Where gamma is a constant of 18.0, pow is an exponential function, the first adaptive denoising factor and the second adaptive denoising factor are the adaptive denoising intensity values ​​calculated in the above steps, and finally the final output pixel value output is calculated according to formula (8).

[0085] - Formula (6)

[0086] Formula (7)

[0087] in, represents the first adaptive noise reduction factor, Represents the second adaptive noise reduction factor, gamma is a constant 18.0, and pow is an exponential function.

[0088] Formula (8)

[0089] When implementing the embodiment of the present application, when denoising a frame image of a target video, the image output in the previous cycle and the fusion factor related to the first adaptive noise reduction factor and the second adaptive noise reduction factor are fully considered to generate a target denoised image corresponding to the target video of the current cycle. This can reduce the amount of noise reduction calculation while retaining the original texture of the image and improve the noise reduction effect of the video.

[0090] In a possible implementation, the video noise reduction function that can be achieved by the video noise reduction method provided in the first aspect can be directly integrated into the system, and when the user shoots a video, the video noise reduction function is used by default.

[0091] In another possible implementation, when shooting a video, the user can choose whether to use the video noise reduction method provided in the present application to reduce the noise of the video, so as to give the user more autonomy to choose. For example, the user can turn on or off a switch in the system settings or in the camera application that indicates the video noise reduction function that can be achieved by the video noise reduction method provided in the first aspect. In one possible implementation, in response to the user's instruction to shoot, a video frame is displayed on the display screen of the mobile phone, wherein the video frame is obtained based on the noise-reduced video frame, and the noise-reduced video frame is obtained by merging and noise-reducing the front and back two frames of the video frame captured by the camera of the mobile phone.

[0092] The displayed video frame may refer to a standard full-color image obtained by performing subsequent image processing on the video frames after multi-frame fusion and noise reduction, wherein the subsequent image processing may include but is not limited to: performing image processing such as white balance, color correction, tone mapping, etc. on the video frames after multi-frame fusion and noise reduction.

[0093] In general, the noise reduction method proposed in this application, when there are multiple video frames, first determines whether the video frame image is the first frame image. If not, the current frame image and the previous frame that has not been processed for noise reduction are used for motion estimation, and then the noise level of the current frame is determined. After that, the current frame is merged with the image output in the previous cycle (the image that has been processed for noise reduction) to generate the output frame in the current cycle, and the cycle is repeated until the last frame image of the video frame has also undergone the same noise reduction process as above. In this way, the original texture of the image can be retained while reducing the amount of noise reduction calculation, thereby improving the noise reduction effect of the video.

[0094] Based on the video noise reduction methods described in the above embodiments, the embodiments of the present application further provide a video noise reduction device 40, including one or more functional units for executing the video noise reduction methods described in the above embodiments. These functional units can be implemented by software, or by hardware, such as a processor, or by an appropriate combination of software, hardware and / or firmware. For example, some functions are implemented by an application processor executing a computer program, and some functions are implemented by a wireless communication module (such as a Bluetooth, Wi-Fi module, etc.), an MCU, an ISP, etc.

[0095] In one embodiment, Figure 4 As shown, the video noise reduction device 40 may at least include:

[0096] The image acquisition unit 400 is used to acquire the current frame image and the previous frame image of the target video; wherein the previous frame image includes the image output in the previous cycle and the previous frame image that has not been subjected to noise reduction processing;

[0097] The fusion factor acquisition unit 402 is used to acquire the fusion factor corresponding to the current frame image and the previous frame image of the target video, wherein the fusion factor is related to the first adaptive noise reduction factor and the second adaptive noise reduction factor, the first adaptive noise reduction factor is used to indicate the position offset between the current frame image and the previous frame image; the second adaptive noise reduction factor is used to indicate the noise level of the current frame image;

[0098] The image processing unit 404 is used to perform motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result, and the optical flow result is used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image;

[0099] The fusion unit 406 is used to fuse the current frame image and the image to be fused to generate a target denoised image corresponding to the target video in the current cycle.

[0100] In a possible implementation, the video noise reduction device 40 further includes:

[0101] The first adaptive noise reduction factor acquisition unit 408 is used to:

[0102] Processing the optical flow result to obtain a position offset between the current frame image and the previous frame image;

[0103] The first adaptive noise reduction factor is obtained according to the position offset.

[0104] In a possible implementation, the optical flow result includes an optical flow in an x ​​direction and an optical flow in a y direction, and the x direction is orthogonal to the y direction; the first adaptive noise reduction factor acquisition unit 408 is specifically configured to:

[0105] Taking an average value and an absolute value of the optical flow in the x direction and the optical flow in the y direction respectively to obtain a first optical flow value and a second optical flow value;

[0106] A maximum value between the first optical flow value and the second optical flow value is obtained, and the maximum value is determined as the position offset.

[0107] In a possible implementation, the first adaptive noise reduction factor acquisition unit 408 is specifically configured to:

[0108] When determining the first adaptive noise reduction factor, it is calculated according to the following formula:

[0109]

[0110] Wherein, Y1 represents the first adaptive noise reduction factor, and D represents the position offset.

[0111] In a possible implementation, the video noise reduction device 40 further includes:

[0112] The second adaptive noise reduction factor acquisition unit 4010 is used to:

[0113] Acquire a first pixel value difference between the current frame image and the previous frame image, where the first pixel value difference is a pixel difference value between a first pixel point and a corresponding pixel point;

[0114] Acquire a noise level of the first pixel point based on the first pixel value difference;

[0115] The second adaptive noise reduction factor is obtained according to the noise level of the first pixel.

[0116] In a possible implementation, the second adaptive noise reduction factor acquisition unit 4010 is specifically configured to:

[0117] When determining the second adaptive noise reduction factor, it is calculated according to the following formula:

[0118]

[0119] Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

[0120] In order to better implement the above solution of the embodiment of the present application, the present application also provides an electronic device 50, which is described in detail below with reference to the accompanying drawings:

[0121] like Figure 5 The structural schematic diagram of the electronic device provided by the embodiment of the present application is shown, and the electronic device 500 may include a processor 501, a memory 504 and a communication module 505. The processor 501, the memory 504 and the communication module 505 may be interconnected through a bus 506. The memory 504 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 504 may optionally be at least one storage system located away from the aforementioned processor 501. The memory 504 is used to store application code, and may include an operating system, a network communication module, a user interface module and a data processing program. The communication module 505 is used to interact with external devices for information; the processor 501 is configured to call the program code to execute the video noise reduction method proposed in the present application.

[0122] It should be understood that the video noise reduction device shown in the embodiment of the present application can be a server, for example, it can be a server in the cloud, or it can be a chip configured in the server in the cloud; or, the video noise reduction device shown in the embodiment of the present application can be an electronic device, or it can be a chip configured in the electronic device.

[0123] The embodiment of the present application also provides a computer storage medium, in which instructions are stored, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps of the method described in any of the above embodiments. If the components of the above-mentioned device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer product is stored in a computer-readable storage medium.

[0124] The computer-readable storage medium may be an internal storage unit of the device described in the above embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the computer-readable storage medium may include both an internal storage unit and an external storage device of the device. The computer-readable storage medium is used to store the computer program and other programs and data required by the device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0125] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0126] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0127] It should be noted that the terms "executable program", "computer program" and "program" used in the embodiments of the present application should be broadly interpreted as including but not limited to: instructions, instruction sets, codes, code segments, subroutines, software modules, applications, software packages, threads, processes, functions, firmware, middleware, etc. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0128] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0129] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store executable programs, such as a USB flash drive, a mobile hard disk, a read-only memory random access memory, a disk or an optical disk.

[0130] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A video noise reduction method, characterized in that: include: Obtaining the current frame image and the previous frame image of the target video; wherein the previous frame image includes the image output in the previous cycle and the previous frame image that has not been subjected to noise reduction processing; Acquire a fusion factor corresponding to a current frame image and a previous frame image of the target video, wherein the fusion factor is related to a first adaptive noise reduction factor and a second adaptive noise reduction factor, the first adaptive noise reduction factor is used to indicate a position offset between the current frame image and the previous frame image; the second adaptive noise reduction factor is used to indicate a noise level of the current frame image; Performing motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result, wherein the optical flow result is used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image; Fusing the current frame image and the image to be fused to generate a target denoised image corresponding to the target video in the current cycle; The method further comprises: Processing the optical flow result to obtain a position offset between the current frame image and the previous frame image; Acquire the first adaptive noise reduction factor according to the position offset; The optical flow result includes an optical flow in an x-direction and an optical flow in a y-direction, wherein the x-direction is orthogonal to the y-direction; and the processing of the optical flow result to obtain a position offset between the current frame image and the previous frame image includes: Taking an average value and an absolute value of the optical flow in the x direction and the optical flow in the y direction respectively to obtain a first optical flow value and a second optical flow value; Obtaining a maximum value between the first optical flow value and the second optical flow value, and determining the maximum value as the position offset; The acquiring the first adaptive noise reduction factor according to the position offset includes: When determining the first adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y1 represents the first adaptive noise reduction factor, and D represents the position offset; The method further comprises: Acquire a first pixel value difference between the current frame image and the previous frame image, where the first pixel value difference is a pixel difference value between a first pixel point and a corresponding pixel point; Acquire a noise level of the first pixel point based on the first pixel value difference; Obtaining the second adaptive noise reduction factor according to the noise level of the first pixel point includes: When determining the second adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

2. A video noise reduction method, characterized in that: include: In response to a user operation, a video frame is displayed on a display screen of an electronic device, wherein the video frame includes a target noise-reduced image after noise reduction, wherein the target noise-reduced image after noise reduction is obtained by performing noise reduction on a current frame and a previous frame of a target video acquired by the electronic device, and performing noise reduction on the current frame and the previous frame of the target video includes: Obtaining the current frame image and the previous frame image of the target video; wherein the previous frame image includes the image output in the previous cycle and the previous frame image that has not been subjected to noise reduction processing; Acquire a fusion factor corresponding to a current frame image and a previous frame image of the target video, wherein the fusion factor is related to a first adaptive noise reduction factor and a second adaptive noise reduction factor, the first adaptive noise reduction factor is used to indicate a position offset between the current frame image and the previous frame image; the second adaptive noise reduction factor is used to indicate a noise level of the current frame image; Performing motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result, wherein the optical flow result is used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image; Fusing the current frame image and the image to be fused to generate a target denoised image corresponding to the target video in the current cycle; The method further comprises: Processing the optical flow result to obtain a position offset between the current frame image and the previous frame image; Acquire the first adaptive noise reduction factor according to the position offset; The optical flow result includes an optical flow in an x-direction and an optical flow in a y-direction, wherein the x-direction is orthogonal to the y-direction; and the processing of the optical flow result to obtain a position offset between the current frame image and the previous frame image includes: Taking an average value and an absolute value of the optical flow in the x direction and the optical flow in the y direction respectively to obtain a first optical flow value and a second optical flow value; Obtaining a maximum value between the first optical flow value and the second optical flow value, and determining the maximum value as the position offset; The acquiring the first adaptive noise reduction factor according to the position offset includes: When determining the first adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y1 represents the first adaptive noise reduction factor, and D represents the position offset; The method further comprises: Acquire a first pixel value difference between the current frame image and the previous frame image, where the first pixel value difference is a pixel difference value between a first pixel point and a corresponding pixel point; Acquire a noise level of the first pixel point based on the first pixel value difference; Obtaining the second adaptive noise reduction factor according to the noise level of the first pixel point includes: When determining the second adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

3. The method according to claim 2, characterized in that The user operation is an operation of turning on a video noise reduction mode, where the video noise reduction mode is used to indicate that noise reduction is to be performed on a video frame acquired by the electronic device; or, the user operation is an operation of starting video shooting.

4. A video noise reduction device, characterized in that: include: An image acquisition unit is used to acquire a current frame image and a previous frame image of a target video; wherein the previous frame image includes an image output in a previous cycle and a previous frame image that has not been subjected to noise reduction processing; A fusion factor acquisition unit is used to acquire a fusion factor corresponding to a current frame image and a previous frame image of the target video, wherein the fusion factor is related to a first adaptive noise reduction factor and a second adaptive noise reduction factor, the first adaptive noise reduction factor is used to indicate a position offset between the current frame image and the previous frame image; the second adaptive noise reduction factor is used to indicate a noise level of the current frame image; An image processing unit is used to perform motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result, and the optical flow result is used for the image output in the previous cycle to obtain an image to be aligned with the current frame image to be fused; A fusion unit, used to fuse the current frame image and the image to be fused to generate a target denoised image corresponding to the target video in the current cycle; The first adaptive noise reduction factor acquisition unit is used to: Processing the optical flow result to obtain a position offset between the current frame image and the previous frame image, and obtaining the first adaptive noise reduction factor according to the position offset; The optical flow result includes an optical flow in an x-direction and an optical flow in a y-direction, wherein the x-direction is orthogonal to the y-direction; and the processing of the optical flow result to obtain a position offset between the current frame image and the previous frame image includes: Taking an average value and an absolute value of the optical flow in the x direction and the optical flow in the y direction respectively to obtain a first optical flow value and a second optical flow value; Obtaining a maximum value between the first optical flow value and the second optical flow value, and determining the maximum value as the position offset; The acquiring the first adaptive noise reduction factor according to the position offset includes: When determining the first adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y1 represents the first adaptive noise reduction factor, and D represents the position offset; The second adaptive noise reduction factor acquisition unit is used to: Acquire a first pixel value difference between the current frame image and the previous frame image, where the first pixel value difference is a pixel difference value between a first pixel point and a corresponding pixel point; Acquire a noise level of the first pixel point based on the first pixel value difference; Obtaining the second adaptive noise reduction factor according to the noise level of the first pixel point includes: When determining the second adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

5. A video noise reduction device, characterized in that: include: The video noise reduction processing module is used to display a video frame on a display screen of an electronic device in response to a user operation, wherein the video frame includes a target noise reduction image after noise reduction, wherein the target noise reduction image after noise reduction is obtained by performing noise reduction on a current frame and a previous frame image of a target video acquired by the electronic device, and performing noise reduction on the current frame and the previous frame image of the target video includes: An image acquisition unit is used to acquire a current frame image and a previous frame image of a target video; wherein the previous frame image includes an image output in a previous cycle and a previous frame image that has not been subjected to noise reduction processing; A fusion factor acquisition unit is used to acquire a fusion factor corresponding to a current frame image and a previous frame image of the target video, wherein the fusion factor is related to a first adaptive noise reduction factor and a second adaptive noise reduction factor, the first adaptive noise reduction factor is used to indicate a position offset between the current frame image and the previous frame image; the second adaptive noise reduction factor is used to indicate a noise level of the current frame image; An image processing unit is used to perform motion estimation on the current frame image of the target video and the previous frame image that has not been subjected to noise reduction processing to obtain an optical flow result, and the optical flow result is used for the image output in the previous cycle to obtain an image to be fused that is aligned with the current frame image; A fusion unit, used to fuse the current frame image and the image to be fused to generate a target denoised image corresponding to the target video in the current cycle; The first adaptive noise reduction factor acquisition unit is used to: Processing the optical flow result to obtain a position offset between the current frame image and the previous frame image, and obtaining the first adaptive noise reduction factor according to the position offset; The optical flow result includes an optical flow in an x-direction and an optical flow in a y-direction, wherein the x-direction is orthogonal to the y-direction; and the processing of the optical flow result to obtain a position offset between the current frame image and the previous frame image includes: Taking an average value and an absolute value of the optical flow in the x direction and the optical flow in the y direction respectively to obtain a first optical flow value and a second optical flow value; Obtaining a maximum value between the first optical flow value and the second optical flow value, and determining the maximum value as the position offset; The acquiring the first adaptive noise reduction factor according to the position offset includes: When determining the first adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y1 represents the first adaptive noise reduction factor, and D represents the position offset; The second adaptive noise reduction factor acquisition unit is used to: Acquire a first pixel value difference between the current frame image and the previous frame image, where the first pixel value difference is a pixel difference value between a first pixel point and a corresponding pixel point; Acquire a noise level of the first pixel point based on the first pixel value difference; Obtaining the second adaptive noise reduction factor according to the noise level of the first pixel point includes: When determining the second adaptive noise reduction factor, it is calculated according to the following formula: Wherein, Y2 represents the second adaptive noise reduction factor, and diff represents the average value of pixel difference values.

6. A video noise reduction device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the video noise reduction method according to any one of claims 1 to 3 is performed.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the video noise reduction method according to any one of claims 1 to 3 is implemented.