An image processing method and apparatus
By acquiring long-exposure and short-exposure images, using filtering algorithms to generate light field distribution maps and remove cross-textures, the problem of poor image quality caused by the camera's inability to know the light source frequency is solved, and high-quality images are generated.
Patent Information
- Application Number
- CN202210448483.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-04-26
AI Technical Summary
The prior art cannot effectively remove cross-line phenomena in images, especially in high dynamic range images, because the camera cannot know the frequency of the ambient light source, resulting in poor image quality.
By acquiring long-exposure images and short-exposure images, a filtering algorithm is used to generate a light field distribution map, and a transverse stripe removal image is generated based on these images, and the target image is finally generated to remove transverse stripe phenomenon.
Effectively remove cross-line phenomena in the image, improve image quality, maintain the clarity of moving objects, reduce motion blur, improve the overall image effect, and do not need to know the frequency of the ambient light source.
Smart Images

Figure CN114845006B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus. Background Art
[0002] Compared with ordinary images, high dynamic range (HDR) images can provide more dynamic range and image details, and can provide a better visual experience for users, thus being widely used. To obtain a high dynamic range image, multiple exposures can be used to collect low dynamic range (LDR) images with different exposure durations, that is, the exposure durations of these low dynamic range images are different, and multiple low dynamic range images are synthesized into a high dynamic range image.
[0003] Among these low dynamic range images, there are images with relatively short exposure durations, that is, the shutter time of the camera needs to be set shorter to collect images with relatively short exposure durations. However, due to the influence of the light source frequency in the environment, images with shorter shutter times are prone to horizontal stripe phenomena of frequency flicker, that is, one or more irregular, similar bright and dark alternating strip-shaped flicker phenomena appear in the image.
[0004] To remove the horizontal stripes in the image, it is necessary to control the shutter time of the camera to match the light source frequency of the environment, so as to avoid the horizontal stripe phenomenon. However, in the above method, it is necessary to know the light source frequency of the environment, and the camera usually cannot obtain the light source frequency, resulting in the inability to remove the horizontal stripes in the image and the poor image quality. Summary of the Invention
[0005] This application provides an image processing method, and the method includes:
[0006] Obtain a long exposure image of the current frame and a short exposure image of the current frame; wherein, the exposure duration corresponding to the long exposure image is greater than the exposure duration corresponding to the short exposure image;
[0007] Filter the long exposure image and the short exposure image by using a first filtering algorithm to obtain a first light field distribution map corresponding to the long exposure image and a second light field distribution map corresponding to the short exposure image;
[0008] Generate a first horizontal stripe removal image based on the first light field distribution map, the second light field distribution map, and the short exposure image, and the first horizontal stripe removal image is an image from which horizontal stripes have been removed;
[0009] Generate a target image based on the first horizontal stripe removal image.
[0010] In a possible implementation, after obtaining the long-exposure image of the current frame and the short-exposure image of the current frame, the method further includes: filtering the long-exposure image and the short-exposure image by using a second filtering algorithm to obtain a third light field distribution map corresponding to the long-exposure image and a fourth light field distribution map corresponding to the short-exposure image; generating a second stripe-removed image based on the third light field distribution map, the fourth light field distribution map, and the short-exposure image, where the second stripe-removed image is an image with stripes removed; In a possible implementation, the generating the target image based on the first stripe-removed image includes: generating the target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image, and the short-exposure image of the previous frame corresponding to the current frame.
[0011] In a possible implementation, the first filtering algorithm includes a one-dimensional filtering algorithm. The filtering the long-exposure image by using the first filtering algorithm to obtain the first light field distribution map corresponding to the long-exposure image includes: for each pixel point in the long-exposure image, determining a pixel difference between the pixel point and the previous pixel point based on a first filtering direction; mapping the pixel difference to a first weight value based on a preset mapping curve, and determining a second weight value based on the first weight value; determining a target pixel value of the pixel point based on the pixel value of the pixel point, the first weight value, the pixel value of the previous pixel point, and the second weight value; generating a first intermediate image based on the target pixel values of each pixel point in the long-exposure image;
[0012] For each pixel point in the first intermediate image, determining a pixel difference between the pixel point and the previous pixel point based on a second filtering direction; mapping the pixel difference to a third weight value based on a preset mapping curve, and determining a fourth weight value based on the third weight value; determining a target pixel value of the pixel point based on the pixel value of the pixel point, the third weight value, the pixel value of the previous pixel point, and the fourth weight value; generating a second intermediate image based on the target pixel values of each pixel point in the first intermediate image;
[0013] Generating the first light field distribution map corresponding to the long-exposure image based on the second intermediate image.
[0014] In a possible implementation, the second filtering algorithm includes a two-dimensional filtering algorithm. The filtering the long-exposure image by using the second filtering algorithm to obtain the third light field distribution map corresponding to the long-exposure image includes: for each pixel point in the long-exposure image, determining adjacent pixel points corresponding to the pixel point, where the adjacent pixel points are pixel points within a preset filtering radius centered on the pixel point;
[0015] Determine the target pixel value of this pixel point based on the pixel values of the adjacent pixel points and the filtering operator of the adjacent pixel points; wherein, the filtering operator of the adjacent pixel points is determined based on the positional relationship between the adjacent pixel points and this pixel point, the first preset parameter, and the second preset parameter;
[0016] Generate the third light field distribution map based on the target pixel value of each pixel point in the long exposure image.
[0017] In a possible implementation manner, the generating the target image based on the first stripe removal image, the second stripe removal image, the short exposure image, and the short exposure image corresponding to the previous frame of the current frame includes: determining a residual image between the short exposure image and the short exposure image of the previous frame; using the residual image to determine motion region information corresponding to the first stripe removal image; fusing the first stripe removal image and the second stripe removal image based on the motion region information to obtain the target image.
[0018] In a possible implementation manner, the using the residual image to determine motion region information corresponding to the first stripe removal image includes: determining a luminance motion region and a chrominance motion region based on the residual image, and determining a first target motion region based on the union of the luminance motion region and the chrominance motion region; wherein, the luminance motion region is a column in the luminance channel of the residual image whose column mean is greater than a first threshold; the chrominance motion region is a column in the chrominance channel of the residual image whose column mean is greater than a second threshold; converting the luminance channel of the residual image into a binary image based on a third threshold, and determining a second target motion region based on the binary image; wherein, based on the number of non-zero pixel points in each row of the binary image, the second target motion region is a row whose number of non-zero pixel points is greater than a fourth threshold; determining the motion region information based on the intersection of the first target motion region and the second target motion region, and the motion region information includes a motion region and a non-motion region.
[0019] In a possible implementation, the motion area information includes a motion area and a non-motion area. Fusing the first stripe-removed image and the second stripe-removed image based on the motion area information to obtain the target image includes: dividing the target image into a first sub-region, a second sub-region, and a third sub-region based on the motion area information; wherein, the first sub-region is a non-transition region corresponding to the motion area, the second sub-region is a non-transition region corresponding to the non-motion area, and the third sub-region is a transition region between the motion area and the non-motion area; determining a sub-image of the first sub-region based on the second stripe-removed image, determining a sub-image of the second sub-region based on the first stripe-removed image, and determining a sub-image of the third sub-region based on the first stripe-removed image and the second stripe-removed image; generating the target image based on the sub-image of the first sub-region, the sub-image of the second sub-region, and the sub-image of the third sub-region.
[0020] This application provides an image processing device, which includes:
[0021] An acquisition module, configured to acquire a long-exposure image of the current frame and a short-exposure image of the current frame; wherein, the exposure duration corresponding to the long-exposure image is greater than the exposure duration corresponding to the short-exposure image;
[0022] A processing module, configured to filter the long-exposure image using a first filtering algorithm to obtain a first light field distribution map corresponding to the long-exposure image, and filter the short-exposure image using the first filtering algorithm to obtain a second light field distribution map corresponding to the short-exposure image;
[0023] A generation module, configured to generate a first stripe-removed image based on the first light field distribution map, the second light field distribution map, and the short-exposure image, where the first stripe-removed image is an image with stripes removed;
[0024] The generation module is further configured to generate a target image based on the first stripe-removed image.
[0025] In a possible implementation, the processing module is further configured to filter the long-exposure image by using a second filtering algorithm to obtain a third light field distribution map corresponding to the long-exposure image, and filter the short-exposure image by using the second filtering algorithm to obtain a fourth light field distribution map corresponding to the short-exposure image; the generating module is further configured to generate a second stripe-removed image based on the third light field distribution map, the fourth light field distribution map, and the short-exposure image, where the second stripe-removed image is an image with stripes removed; when the generating module generates the target image based on the first stripe-removed image, it is specifically configured to: generate the target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image, and the short-exposure image of the previous frame corresponding to the current frame.
[0026] In a possible implementation, the first filtering algorithm includes a one-dimensional filtering algorithm. When the processing module filters the long-exposure image by using the first filtering algorithm to obtain the first light field distribution map corresponding to the long-exposure image, it is specifically configured to: for each pixel point in the long-exposure image, determine the pixel difference between the pixel point and the previous pixel point based on the first filtering direction; map the pixel difference to a first weight value based on a preset mapping curve, and determine a second weight value based on the first weight value; determine the target pixel value of the pixel point based on the pixel value of the pixel point, the first weight value, the pixel value of the previous pixel point, and the second weight value; generate a first intermediate image based on the target pixel values of each pixel point in the long-exposure image; for each pixel point in the first intermediate image, determine the pixel difference between the pixel point and the previous pixel point based on the second filtering direction; map the pixel difference to a third weight value based on a preset mapping curve, and determine a fourth weight value based on the third weight value; determine the target pixel value of the pixel point based on the pixel value of the pixel point, the third weight value, the pixel value of the previous pixel point, and the fourth weight value; generate a second intermediate image based on the target pixel values of each pixel point in the first intermediate image; generate the first light field distribution map corresponding to the long-exposure image based on the second intermediate image.
[0027] In a possible implementation, the second filtering algorithm includes a two-dimensional filtering algorithm. When the processing module filters the long-exposure image using the second filtering algorithm to obtain the corresponding third light field distribution map of the long-exposure image, it is specifically used for: for each pixel point in the long-exposure image, determining the adjacent pixel points corresponding to the pixel point, where the adjacent pixel points are the pixel points within a preset filtering radius centered on the pixel point; determining the target pixel value of the pixel point based on the pixel values of the adjacent pixel points and the filtering operator of the adjacent pixel points; wherein, the filtering operator of the adjacent pixel points is determined based on the positional relationship between the adjacent pixel points and the pixel point, a first preset parameter, and a second preset parameter; generating the third light field distribution map based on the target pixel values of each pixel point in the long-exposure image.
[0028] In a possible implementation, when the generating module generates the target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image, and the short-exposure image corresponding to the previous frame of the current frame, it is specifically used for: determining the residual image between the short-exposure image and the short-exposure image of the previous frame; using the residual image to determine the motion area information corresponding to the first stripe-removed image; fusing the first stripe-removed image and the second stripe-removed image based on the motion area information to obtain the target image.
[0029] In a possible implementation, when the generating module uses the residual image to determine the motion area information corresponding to the first stripe-removed image, it is specifically used for: determining the luminance motion area and the chrominance motion area based on the residual image, and determining the first target motion area based on the union of the luminance motion area and the chrominance motion area; wherein, the luminance motion area is the column whose column mean in the luminance channel of the residual image is greater than the first threshold; the chrominance motion area is the column whose column mean in the chrominance channel of the residual image is greater than the second threshold; converting the luminance channel of the residual image into a binary image based on a third threshold, and determining the second target motion area based on the binary image; wherein, based on the number of non-zero pixel points in each row of the binary image, the second target motion area is the row whose number of non-zero pixel points is greater than the fourth threshold; determining the motion area information based on the intersection of the first target motion area and the second target motion area, and the motion area information includes the motion area and the non-motion area.
[0030] In a possible implementation manner, when the generating module fuses the first stripe-removed image and the second stripe-removed image based on the motion area information to obtain the target image, it is specifically configured to: divide the target image into a first sub-region, a second sub-region, and a third sub-region based on the motion area information; wherein, the first sub-region is a non-transition region corresponding to the motion area, the second sub-region is a non-transition region corresponding to the non-motion area, and the third sub-region is a transition region between the motion area and the non-motion area; determine the sub-image of the first sub-region based on the second stripe-removed image, determine the sub-image of the second sub-region based on the first stripe-removed image, and determine the sub-image of the third sub-region based on the first stripe-removed image and the second stripe-removed image; generate the target image based on the sub-image of the first sub-region, the sub-image of the second sub-region, and the sub-image of the third sub-region.
[0031] As can be seen from the above technical solutions, in the embodiments of the present application, a filtering algorithm can be used to filter the long-exposure image and the short-exposure image to obtain a first light field distribution map and a second light field distribution map, generate a stripe-removed image based on the first light field distribution map and the second light field distribution map, and generate a target image based on the stripe-removed image. Since the stripe-removed image is an image with stripes removed, when generating the target image based on the stripe-removed image, the target image is an image with stripes removed, so that the stripes in the image can be removed, such as the stripes caused by stroboscopic in the image, and the image quality can be improved. The clarity of the moving object can be maintained, the motion blur can be reduced, and the overall image effect can be enhanced. Moreover, it is not necessary to know the light source frequency of the environment, and it is not necessary to control the shutter time to match the light source frequency of the environment, so that the influence of the light source frequency can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for describing the embodiments of the present application or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0033] Figure 1 is a schematic flowchart of an image processing method in an implementation manner of the present application;
[0034] Figure 2 is a schematic flowchart of an image processing method in an implementation manner of the present application;
[0035] Figure 3 is a schematic diagram of the positional relationship between adjacent pixel points in an implementation manner of the present application;
[0036] Figure 4 It is a schematic structural diagram of an image processing device in an embodiment of the present application;
[0037] Figure 5 It is a hardware structure diagram of an image processing device in an embodiment of the present application. Specific embodiments
[0038] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments and do not limit the present application. The singular forms "a", "the", and "said" used in the present application and the claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more of the associated listed items.
[0039] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "when" or "while" or "in response to determining".
[0040] In order to obtain a clear image of a high-speed moving object, it is usually necessary to use a short shutter time to capture the image, or, in a high dynamic range scene, in order to obtain a high dynamic range image, it is usually necessary to use a short shutter time to capture the image. Due to the influence of the light source frequency in the environment, the image with a short shutter time is prone to the phenomenon of horizontal stripes with frequency flicker, that is, one or more irregular, similar bright and dark striped flickering phenomena appear in the image. In order to remove the horizontal stripes in the image, it is necessary to control the shutter time to match the light source frequency of the environment, so as to avoid the phenomenon of horizontal stripes. However, the above method requires knowing the light source frequency, and the camera usually cannot obtain the light source frequency, resulting in the inability to remove the horizontal stripes in the image and the poor image quality.
[0041] In view of the above problems, an image horizontal stripe removal method is proposed in the embodiments of the present application, which can avoid the influence of the light source frequency, remove the horizontal stripes caused by stroboscopic in the image, and can maintain the clarity of the moving object, reduce motion blur, improve the overall image effect, and improve the image quality.
[0042] The following will describe the technical solutions of the embodiments of the present application in conjunction with specific embodiments.
[0043] In an embodiment of the present application, an image processing method is proposed. This method can be applied to an image processing device, which can be a front-end device, such as a camera, an IPC (IP CAMERA, network camera), an analog camera, a camera, etc. For example, after the front-end device captures an image, the technical solution of the embodiment of the present application is used to implement the image processing method. The image processing device can also be a back-end device, such as a server, a storage device, an NVR, etc. For example, after the front-end device captures an image, the image is sent to the back-end device, and the back-end device uses the technical solution of the embodiment of the present application to implement the image processing method.
[0044] See Figure 1 As shown, it is a schematic flowchart of the image processing method, and the method may include:
[0045] Step 101, obtain a long-exposure image of the current frame and a short-exposure image of the current frame; wherein, the exposure duration corresponding to the long-exposure image may be greater than the exposure duration corresponding to the short-exposure image.
[0046] Exemplarily, for a camera, a long-exposure image of the current frame and a short-exposure image of the current frame can be captured according to different exposure durations of the image sensor. There is no limitation on this image capture process as long as the long-exposure image and the short-exposure image can be obtained. The long-exposure image and the short-exposure image are images of the same target scene. The exposure duration corresponding to the long-exposure image needs to be greater than the exposure duration corresponding to the short-exposure image. For example, the exposure start time of the long-exposure image is the same as that of the short-exposure image, but the exposure end time of the long-exposure image is later than that of the short-exposure image.
[0047] Step 102, filter the long-exposure image using a filtering algorithm to obtain a first light field distribution map corresponding to the long-exposure image (for convenience of distinction, the light field distribution map corresponding to the long-exposure image is denoted as the first light field distribution map), and filter the short-exposure image using the filtering algorithm to obtain a second light field distribution map corresponding to the short-exposure image (the light field distribution map corresponding to the short-exposure image is denoted as the second light field distribution map).
[0048] Exemplarily, the filtering algorithm can be any type of filtering algorithm, and this embodiment does not limit this filtering algorithm. For example, the filtering algorithm can be a one-dimensional filtering algorithm. The one-dimensional filtering algorithm uses a one-dimensional filtering kernel to perform one-dimensional vector filtering on each row (or column) of pixels in the image. The implementation process of the one-dimensional filtering algorithm can be referred to in subsequent embodiments and will not be elaborated here. Another example is that the filtering algorithm can be a two-dimensional filtering algorithm. The two-dimensional filtering algorithm uses a two-dimensional filtering kernel to perform two-dimensional matrix filtering on the entire image. The implementation process of the two-dimensional filtering algorithm can be referred to in subsequent embodiments and will not be elaborated here. Of course, the filtering algorithm can also be other types of filtering algorithms.
[0049] Regarding the filtering methods for long-exposure images and short-exposure images, this embodiment does not make any restrictions, as long as the long-exposure images and short-exposure images can be filtered based on the filtering algorithm, which will not be elaborated here.
[0050] Exemplarily, the long-exposure images pointed out in this embodiment are long-exposure images in the target format. The target format can be the YUV format or other formats. For the convenience of description, the YUV format will be used as an example hereinafter. Based on this, if the long-exposure images collected by the camera are not long-exposure images in the YUV format, such as long-exposure images in the RGB format, then the long-exposure images in the RGB format need to be converted into long-exposure images in the YUV format, and the conversion method is not limited. If the long-exposure images collected by the camera are long-exposure images in the YUV format, then no image conversion is required. After obtaining the long-exposure images in the YUV format, the filtering algorithm can be used to filter the long-exposure images in the YUV format to obtain the first light field distribution map.
[0051] Exemplarily, if the short-exposure images collected by the camera are not short-exposure images in the YUV format, such as short-exposure images in the RGB format, then the short-exposure images in the RGB format also need to be converted into short-exposure images in the YUV format. If the short-exposure images collected by the camera are short-exposure images in the YUV format, then no image conversion is required. After obtaining the short-exposure images in the YUV format, the filtering algorithm can be used to filter the short-exposure images in the YUV format to obtain the second light field distribution map.
[0052] Step 103: Generate a first horizontal stripe removal image based on the first light field distribution map, the second light field distribution map, and the short-exposure image. The first horizontal stripe removal image can be an image with horizontal stripes removed.
[0053] In a possible implementation, for each pixel in the first horizontal stripe-removed image, the pixel value corresponding to the pixel in the first horizontal stripe-removed image may be determined based on the pixel value corresponding to the pixel in the first light field distribution map, the pixel value corresponding to the pixel in the second light field distribution map, and the pixel value corresponding to the pixel in the short exposure image. Based on the pixel value of each pixel in the first horizontal stripe-removed image, the first horizontal stripe-removed image may be generated by combining the pixel values of these pixels.
[0054] For example, for each pixel in the first horizontal stripe-removed image, taking pixel (i, j) as an example, the following formula (1) can be used to determine the pixel value corresponding to pixel (i, j) in the first horizontal stripe-removed image:
[0055]
[0056] In formula (1), p rough (i, j) represents the pixel value corresponding to the pixel point (i, j) in the first horizontal stripe removal image, E L (i, j) represents the pixel value corresponding to the pixel point (i, j) in the first light field distribution map, E S (i, j) represents the pixel value corresponding to the pixel point (i, j) in the second light field distribution map, p S (i, j) represents the pixel value corresponding to the pixel point (i, j) in the short exposure image. In summary, the pixel value corresponding to the pixel point (i, j) in the first horizontal stripe removed image can be obtained, and the pixel values of all pixels constitute the first horizontal stripe removed image.
[0057] Of course, formula (1) is only an example for determining the first horizontal stripe-removed image and is not limited thereto.
[0058] Exemplarily, since the first light field distribution map includes a Y channel, a U channel and a V channel, the second light field distribution map includes a Y channel, a U channel and a V channel, and the short exposure image includes a Y channel, a U channel and a V channel, therefore, referring to the above formula (1), the Y channel of the first horizontal stripe removed image can be obtained based on the Y channel of the first light field distribution map, the Y channel of the second light field distribution map and the Y channel of the short exposure image, the U channel of the first horizontal stripe removed image can be obtained based on the U channel of the first light field distribution map, the U channel of the second light field distribution map and the U channel of the short exposure image, and the V channel of the first horizontal stripe removed image can be obtained based on the V channel of the first light field distribution map, the V channel of the second light field distribution map and the V channel of the short exposure image.
[0059] At this point, the Y channel of the first horizontal line removed image, the U channel of the first horizontal line removed image, and the V channel of the first horizontal line removed image may be combined to obtain the first horizontal line removed image.
[0060] In the above process, since the second light field distribution map is a filter of the short-exposure image, that is, both the second light field distribution map and the short-exposure image have horizontal stripes, and since the first light field distribution map is a filter of the long-exposure image, that is, the first light field distribution map has no horizontal stripes, therefore, when processing the short-exposure image based on the first light field distribution map and the second light field distribution map, the horizontal stripes of the short-exposure image can be removed to obtain the first horizontal stripe removal image, that is, the first horizontal stripe removal image is an image with horizontal stripes removed.
[0061] Step 104: Generate a target image based on the first horizontal stripe removal image.
[0062] For example, the first horizontal stripe removal image can be used as the target image, and the target image is an image with horizontal stripes removed. Obviously, through the above processing, a target image with horizontal stripes removed corresponding to the short-exposure image can be obtained, that is, this target image is used to replace the short-exposure image, that is, the target image can be output.
[0063] As can be seen from the above technical solutions, in the embodiments of the present application, a filtering algorithm can be used to filter the long-exposure image and the short-exposure image to obtain the first light field distribution map and the second light field distribution map, generate a horizontal stripe removal image based on the first light field distribution map and the second light field distribution map, and generate a target image based on the horizontal stripe removal image. Since the horizontal stripe removal image is an image with horizontal stripes removed, therefore, when generating the target image based on the horizontal stripe removal image, the target image is an image with horizontal stripes removed, so as to be able to remove the horizontal stripes in the image, such as the horizontal stripes caused by stroboscopic in the image, and improve the image quality. It can maintain the clarity of moving objects, reduce motion blur, and enhance the overall image effect. Moreover, it is not necessary to know the light source frequency of the environment, and it is not necessary to control the shutter time to match the light source frequency of the environment, so as to avoid the influence of the light source frequency.
[0064] See Figure 2 As shown, it is a schematic flowchart of the image processing method, and the method may include:
[0065] Step 201: Obtain the long-exposure image of the current frame, the short-exposure image of the current frame, and the short-exposure image of the previous frame corresponding to the current frame. Among them, the exposure duration corresponding to the long-exposure image of the current frame can be greater than the exposure duration corresponding to the short-exposure image of the current frame, and the exposure duration corresponding to the short-exposure image of the current frame can be equal to the exposure duration corresponding to the short-exposure image of the previous frame corresponding to the current frame. Among them, the current frame and the previous frame corresponding to the current frame are two adjacent frames, that is, the previous frame corresponding to the current frame is a frame before the current frame.
[0066] Exemplarily, for a camera, long-exposure images of the current frame and short-exposure images of the current frame can be acquired according to different exposure durations of the image sensor, and the image acquisition process is not limited thereto. Moreover, the short-exposure image of the current frame corresponding to the previous frame has been obtained in the previous acquisition cycle.
[0067] The long-exposure images pointed out in this embodiment are long-exposure images in a target format, such as long-exposure images in YUV format. The short-exposure images (the short-exposure image of the current frame and the short-exposure image of the previous frame) pointed out in this embodiment are short-exposure images in a target format, such as short-exposure images in YUV format.
[0068] Step 202: Filter the long-exposure image using a first filtering algorithm to obtain a first light field distribution map corresponding to the long-exposure image (the light field distribution map corresponding to the long-exposure image can be denoted as the first light field distribution map), and filter the short-exposure image using the first filtering algorithm to obtain a second light field distribution map corresponding to the short-exposure image (the light field distribution map corresponding to the short-exposure image can be denoted as the second light field distribution map).
[0069] Exemplarily, the first filtering algorithm can be any type of filtering algorithm, and the first filtering algorithm is not limited thereto. For example, the first filtering algorithm can be a one-dimensional filtering algorithm, and the one-dimensional filtering algorithm is to perform one-dimensional vector filtering processing on each row (or column) of pixels of the image using a one-dimensional filtering kernel.
[0070] For example, a one-dimensional filtering algorithm can be used to perform one-dimensional filtering on the long-exposure image to obtain a first light field distribution map corresponding to the long-exposure image. The implementation process of the one-dimensional filtering is not limited in this embodiment. The implementation process of the one-dimensional filtering will be described below in combination with the following steps. Of course, only an example of the one-dimensional filtering is shown here, and this embodiment is not limited to this implementation manner of the one-dimensional filtering.
[0071] Step 2021: For each pixel point in the long-exposure image, based on the first filtering direction, determine the pixel difference between this pixel point and the previous pixel point, and denote this pixel difference as d1. Wherein, the pixel difference can be the difference between the pixel value of this pixel point and the pixel value of the previous pixel point of this pixel point.
[0072] Wherein, the first filtering direction can be a filtering direction from left to right. In this case, the previous pixel point of this pixel point can refer to the pixel point located on the left side of this pixel point.
[0073] Alternatively, the first filtering direction can be a filtering direction from right to left. In this case, the previous pixel point of this pixel point can refer to the pixel point located on the right side of this pixel point.
[0074] Step 2022: Map the pixel difference d1 to a first weight value based on a preset mapping curve, and denote this first weight value as d2. The first weight value d2 can be a weight value between 0 and 1.
[0075] Exemplarily, a preset mapping curve can be preconfigured. This preset mapping curve can be configured according to experience, and there is no limitation on this preset mapping curve. Among them, this preset mapping curve is used to map the values between 0 and 255 to the values between 0 and 1. That is to say, the abscissa of the preset mapping curve can be 0 to 255, and the ordinate of the preset mapping curve can be 0 to 1. When the value of the abscissa is larger, the value of the ordinate corresponding to this abscissa is larger. For example, for x1 and x2 on the abscissa, x1 corresponds to y1 on the ordinate, and x2 corresponds to y2 on the ordinate. If x2 is greater than x1, then y2 is greater than y1.
[0076] After obtaining the pixel difference d1, the value range of the pixel difference d1 is 0 to 255. By querying the preset mapping curve with the pixel difference d1, the first weight value d2 can be obtained, and the first weight value d2 is between 0 and 1.
[0077] Exemplarily, after obtaining the first weight value d2, the second weight value can also be determined based on the first weight value d2. For example, if the sum of the first weight value and the second weight value is a fixed value (such as 1), then the second weight value is the difference between the fixed value and the first weight value. For example, the second weight value can be 1 - d2.
[0078] Step 2023: Determine the target pixel value of this pixel point based on the pixel value of this pixel point, the first weight value, the pixel value of the previous pixel point of this pixel point, and the second weight value.
[0079] For example, taking the pixel point (i, j) as an example, the following formula (2) can be used to determine the target pixel value corresponding to the pixel point (i, j). Of course, formula (2) is only an example, and there is no limitation on this.
[0080] p'(i,j) = p(i,j)*d2 + p(i - 1,j)*(1 - d2) Formula (2)
[0081] In formula (2), p'(i,j) represents the target pixel value corresponding to the pixel point (i, j), p(i,j) represents the pixel value corresponding to the pixel point (i, j) in the long-exposure image, and p(i - 1,j) represents the pixel value corresponding to the previous pixel point of the pixel point (i, j) in the long-exposure image, that is, the target pixel value corresponding to the pixel point is obtained.
[0082] Step 2024: Generate a first intermediate image based on the target pixel value of each pixel point in the long-exposure image.
[0083] For example, for each pixel in the long-exposure image, after obtaining the target pixel value of each pixel, the target pixel values of all pixels can be combined to obtain a first intermediate image.
[0084] Step 2025: For each pixel in the first intermediate image, based on the second filtering direction, determine the pixel difference between this pixel and the previous pixel; for example, this pixel difference can be the difference between the pixel value of this pixel and the pixel value of the previous pixel of this pixel.
[0085] Exemplarily, the second filtering direction and the first filtering direction can be two mutually reverse directions. For example, when the first filtering direction is the filtering direction from left to right, the second filtering direction is the filtering direction from right to left, that is, the previous pixel of this pixel can refer to the pixel located on the right side of this pixel. When the first filtering direction is the filtering direction from right to left, then the second filtering direction is the filtering direction from left to right, that is, the previous pixel of this pixel can refer to the pixel located on the left side of this pixel.
[0086] Step 2026: Map the pixel difference to a third weight value based on a preset mapping curve, and determine a fourth weight value based on the third weight value. For example, the pixel difference determined based on the second filtering direction can be denoted as d3, the pixel difference d3 can be mapped to a third weight value d4 based on the preset mapping curve, the third weight value d4 can be a weight value between 0 and 1, and the fourth weight value is determined to be 1 - d4.
[0087] Exemplarily, step 2026 can be similar to step 2022, and will not be repeated here.
[0088] Step 2027: Based on the pixel value of this pixel (i.e., the pixel value of this pixel in the first intermediate image), the third weight value, the pixel value of the previous pixel (i.e., the pixel value of the previous pixel of this pixel in the first intermediate image), and the fourth weight value, determine the target pixel value of this pixel.
[0089] Exemplarily, step 2027 can be similar to step 2023, and will not be repeated here.
[0090] Step 2028: Generate a second intermediate image based on the target pixel values of each pixel in the first intermediate image. For example, combine the target pixel values of each pixel to obtain a second intermediate image.
[0091] Step 2029: Generate a first light field distribution map corresponding to the long-exposure image based on the second intermediate image.
[0092] For example, the second intermediate image can be directly used as the first light field distribution map, or the second intermediate image can be used as a long exposure image. Return to step 2021, and repeat steps 2021 - 2028. The number of repetitions can be once or multiple times. The finally obtained intermediate image is used as the first light field distribution map.
[0093] Exemplarily, the long exposure image includes a Y channel, a U channel, and a V channel. The above steps can be used to process the Y channel of the long exposure image to obtain the Y channel of the first light field distribution map, process the U channel of the long exposure image to obtain the U channel of the first light field distribution map, and process the V channel of the long exposure image to obtain the V channel of the first light field distribution map. Then, the Y channel, U channel, and V channel of the first light field distribution map are combined together to obtain the first light field distribution map corresponding to the long exposure image.
[0094] Exemplarily, a one-dimensional filtering algorithm can be used to perform one-dimensional filtering on the short exposure image to obtain the second light field distribution map corresponding to the short exposure image. For example, for each pixel point in the short exposure image, based on the first filtering direction, the pixel difference between the pixel point and the previous pixel point is determined, the pixel difference is mapped to a first weight value based on a preset mapping curve, and a second weight value is determined based on the first weight value. Based on the pixel value of the pixel point, the first weight value, the pixel value of the previous pixel point of the pixel point, and the second weight value, the target pixel value of the pixel point is determined. A first intermediate image is generated based on the target pixel values of each pixel point in the short exposure image. For each pixel point in the first intermediate image, based on the second filtering direction, the pixel difference between the pixel point and the previous pixel point is determined, the pixel difference is mapped to a third weight value based on a preset mapping curve, and a fourth weight value is determined based on the third weight value. Based on the pixel value of the pixel point, the third weight value, the pixel value of the previous pixel point, and the fourth weight value, the target pixel value of the pixel point is determined. A second intermediate image is generated based on the target pixel values of each pixel point in the first intermediate image, and the second light field distribution map corresponding to the short exposure image is generated based on the second intermediate image.
[0095] Among them, the generation method of the second light field distribution map is similar to that of the first light field distribution map. Just replace the long exposure image with the short exposure image, and this process will not be repeated here.
[0096] Step 203: Generate a first stripe removal image based on the first light field distribution map, the second light field distribution map, and the short exposure image. The first stripe removal image can be an image with stripes removed.
[0097] In a possible implementation, for each pixel in the first horizontal stripe removal image, the pixel value corresponding to the pixel in the first light field distribution map, the pixel value corresponding to the pixel in the second light field distribution map, and the pixel value corresponding to the pixel in the short exposure image can be used to determine the pixel value corresponding to the pixel in the first horizontal stripe removal image. Based on the pixel values of each pixel in the first horizontal stripe removal image, the first horizontal stripe removal image can be generated, that is, by combining the pixel values of these pixels.
[0098] For example, for each pixel in the first horizontal stripe removal image, taking the pixel (i, j) as an example, the following formula (3) can be used to determine the pixel value corresponding to the pixel (i, j) in the first horizontal stripe removal image:
[0099]
[0100] In formula (3), p1(i, j) represents the pixel value corresponding to the pixel (i, j) in the first horizontal stripe removal image, E L,1 (i, j) represents the pixel value corresponding to the pixel (i, j) in the first light field distribution map, E S,1 (i, j) represents the pixel value corresponding to the pixel (i, j) in the second light field distribution map, p S (i, j) represents the pixel value corresponding to the pixel (i, j) in the short exposure image. In summary, the pixel value corresponding to the pixel (i, j) in the first horizontal stripe removal image can be obtained, and the pixel values of all pixels form the first horizontal stripe removal image.
[0101] Exemplarily, since the first light field distribution map includes the Y channel, the U channel, and the V channel, the second light field distribution map includes the Y channel, the U channel, and the V channel, and the short exposure image includes the Y channel, the U channel, and the V channel, therefore, the Y channel, the U channel, and the V channel can be processed separately to obtain the Y channel, the U channel, and the V channel of the first horizontal stripe removal image, and then the first horizontal stripe removal image can be obtained.
[0102] In the above process, since the second light field distribution map is a filter of the short exposure image, that is, both the second light field distribution map and the short exposure image have horizontal stripes, and since the first light field distribution map is a filter of the long exposure image, that is, the first light field distribution map has no horizontal stripes, therefore, when processing the short exposure image based on the first light field distribution map and the second light field distribution map, the horizontal stripes of the short exposure image can be removed to obtain the first horizontal stripe removal image.
[0103] Step 204: Filter the long-exposure image using a second filtering algorithm to obtain a third light field distribution map corresponding to the long-exposure image (the light field distribution map corresponding to the long-exposure image can be denoted as the third light field distribution map), and filter the short-exposure image using the second filtering algorithm to obtain a fourth light field distribution map corresponding to the short-exposure image (the light field distribution map corresponding to the short-exposure image can be denoted as the fourth light field distribution map).
[0104] Exemplarily, the second filtering algorithm can be any type of filtering algorithm, and there is no limitation on this second filtering algorithm. For example, the second filtering algorithm can be a two-dimensional filtering algorithm, and the two-dimensional filtering algorithm can perform two-dimensional matrix filtering on the entire image using a two-dimensional filter kernel.
[0105] For example, a two-dimensional filtering algorithm can be used to perform two-dimensional filtering on the long-exposure image to obtain a third light field distribution map corresponding to the long-exposure image. Regarding the implementation process of two-dimensional filtering, there is no limitation in this embodiment. The implementation process of two-dimensional filtering will be described below in combination with the following steps. Of course, only an example of two-dimensional filtering is shown here, and this embodiment is not limited to this implementation manner of two-dimensional filtering.
[0106] Step 2041: For each pixel point in the long-exposure image, determine the adjacent pixel points corresponding to the pixel point. The adjacent pixel points are the pixel points within a preset filtering radius centered on the pixel point.
[0107] Exemplarily, the preset filtering radius can be denoted as r, and the value of the preset filtering radius can be configured according to experience without limitation. For example, the preset filtering radius can be 1, 2, 3, etc. Among them, if the preset filtering radius is 1, the adjacent pixel points are the 8 pixel points within a range of 1 centered on the pixel point. See Figure 3 shown. The adjacent pixel points can be M22, M23, M24, M32, M34, M42, M43, M44. If the preset filtering radius is 2, the adjacent pixel points are the 24 pixel points within a range of 2 centered on the pixel point. See Figure 3 shown. The adjacent pixel points can be the 24 pixel points other than the pixel point M.
[0108] Step 2042: Based on the pixel values of the adjacent pixel points and the filtering operator of the adjacent pixel points, determine the target pixel value of the pixel point; among them, the filtering operator of the adjacent pixel points can be determined based on the positional relationship between the adjacent pixel points and the pixel point, a first preset parameter, and a second preset parameter. For example, the target pixel value of the pixel point can be determined based on the pixel values of the adjacent pixel points and the filtering operator of the adjacent pixel points, as well as the pixel value of the pixel point and the filtering operator of the pixel point.
[0109] For example, taking the pixel point (i, j) as an example, the target pixel value corresponding to the pixel point (i, j) can be determined using the following formula (4). Of course, formula (4) is just an example and is not limited in this regard.
[0110]
[0111] In formula (4), p2(i, j) represents the target pixel value corresponding to the pixel point (i, j), p(i + m, j + n) represents the pixel value corresponding to the adjacent pixel point (m, n) of the pixel point (i, j) in the long-exposure image, and H(i + m, j + n) represents the filtering operator of the adjacent pixel point (m, n) of the pixel point (i, j).
[0112] Obviously, when m is 0 and n is 0, p(i + m, j + n) represents the pixel value corresponding to the pixel point (i, j) in the long-exposure image, and H(i + m, j + n) represents the filtering operator corresponding to the pixel point (i, j).
[0113] Combined with Figure 3 To illustrate the above process, the pixel point (i, j) corresponds to Figure 3 the pixel point M therein. Assuming the preset filtering radius r is 2, then the value range of m is from -2 to +2, and the value range of n is from -2 to +2.
[0114] For example, when m takes the value of +2 and n takes the value of +1, then the adjacent pixel point (m, n) is the pixel point located in the second row above and the first column to the right of the pixel point M, that is, the adjacent pixel point (m, n) corresponds to the pixel point M14. Therefore, p(i + m, j + n) represents the pixel value corresponding to the pixel point M14 in the long-exposure image, and H(i + m, j + n) represents the filtering operator of the pixel point M14.
[0115] Another example, when m takes the value of -2 and n takes the value of -1, then the adjacent pixel point (m, n) is the pixel point located in the second row below and the first column to the left of the pixel point M, that is, the adjacent pixel point (m, n) corresponds to the pixel point M52. Therefore, p(i + m, j + n) represents the pixel value corresponding to the pixel point M52 in the long-exposure image, and H(i + m, j + n) represents the filtering operator of the pixel point M52.
[0116] In summary, based on the pixel values corresponding to each adjacent pixel point of the pixel point M in the long-exposure image and the filtering operators of the adjacent pixel points, the target pixel value of the pixel point M is obtained based on formula (4).
[0117] In a possible implementation manner, taking the pixel point (i, j) as an example, the filtering operator of the adjacent pixel point can be determined using formula (5). Of course, formula (5) is just an example and is not limited in this regard.
[0118]
[0119] In formula (5), w is the first preset parameter, which can be configured according to experience, and σ is the second preset parameter, which can also be configured according to experience. For an adjacent pixel located in the second row above the pixel point (i, j) and in the first column to the right of the pixel point (i, j) (such as Figure 3 the pixel point M14 in), the value of m is taken as +2 and the value of n is taken as +1 and substituted into formula (5), and the obtained value of H is the filtering operator of this adjacent pixel point.
[0120] For another example, for a pixel point located in the second row below the pixel point (i, j) and in the first column to the left of the pixel point (i, j) (such as Figure 3 the pixel point M52 in), the value of m is taken as -2 and the value of n is taken as -11 and substituted into formula (5), and the obtained value of H is the filtering operator of this adjacent pixel point.
[0121] And so on, the filtering operator of each adjacent pixel point of the pixel point (i, j) can be obtained.
[0122] When m is 0 and n is 0, the obtained value of H is the filtering operator of the pixel point (i, j).
[0123] Step 2043: Generate a third light field distribution map based on the target pixel values of each pixel point in the long-exposure image. For example, after obtaining the target pixel values of each pixel point in the long-exposure image, these target pixel values of the pixel points can be combined to obtain the third light field distribution map.
[0124] Exemplarily, the long-exposure image includes a Y channel, a U channel, and a V channel. The above steps can be used to process the Y channel of the long-exposure image to obtain the Y channel of the third light field distribution map, process the U channel of the long-exposure image to obtain the U channel of the third light field distribution map, and process the V channel of the long-exposure image to obtain the V channel of the third light field distribution map. Then, by combining the Y channel, U channel, and V channel of the third light field distribution map, the third light field distribution map corresponding to the long-exposure image can be obtained.
[0125] Exemplarily, a two-dimensional filtering algorithm can be adopted to perform two-dimensional filtering on the short-exposure image to obtain a fourth light field distribution map corresponding to the short-exposure image. For example, for each pixel point in the short-exposure image, the adjacent pixel points corresponding to this pixel point are determined, and based on the pixel values of the adjacent pixel points and the filtering operator of the adjacent pixel points, the target pixel value of this pixel point is determined; based on the target pixel values of each pixel point in the short-exposure image, a fourth light field distribution map is generated. Among them, the generation method of the fourth light field distribution map is similar to that of the third light field distribution map, and the long-exposure image can be replaced with the short-exposure image, which will not be repeated here.
[0126] Step 205: Generate a second stripe-removed image based on the third light field distribution map, the fourth light field distribution map, and the short-exposure image. This second stripe-removed image can be an image with stripes removed.
[0127] In a possible implementation manner, for each pixel point in the second stripe-removed image, based on the pixel value corresponding to this pixel point in the third light field distribution map, the pixel value corresponding to this pixel point in the fourth light field distribution map, and the pixel value corresponding to this pixel point in the short-exposure image, the pixel value corresponding to this pixel point in the second stripe-removed image is determined. Based on the pixel values of each pixel point in the second stripe-removed image, the second stripe-removed image can be generated, that is, by combining the pixel values of these pixel points.
[0128] For example, for each pixel point in the second stripe-removed image, taking the pixel point (i, j) as an example, the following formula (6) can be used to determine the pixel value corresponding to the pixel point (i, j) in the second stripe-removed image:
[0129]
[0130] In formula (6), p2(i, j) represents the pixel value corresponding to the pixel point (i, j) in the second stripe-removed image, E L,2 (i, j) represents the pixel value corresponding to the pixel point (i, j) in the third light field distribution map, E S,2 (i, j) represents the pixel value corresponding to the pixel point (i, j) in the fourth light field distribution map, p S (i, j) represents the pixel value corresponding to the pixel point (i, j) in the short-exposure image. In summary, the pixel value corresponding to the pixel point (i, j) in the second stripe-removed image can be obtained, and the pixel values of all pixel points form the second stripe-removed image.
[0131] Exemplarily, since the third light field distribution map includes the Y channel, the U channel, and the V channel, the fourth light field distribution map includes the Y channel, the U channel, and the V channel, and the short-exposure image includes the Y channel, the U channel, and the V channel, therefore, the Y channel, the U channel, and the V channel can be processed separately to obtain the Y channel, the U channel, and the V channel of the second stripe-removed image, and then the second stripe-removed image can be obtained.
[0132] In the above process, since the fourth light field distribution map is a filter of the short-exposure image, that is, both the fourth light field distribution map and the short-exposure image have stripes, and since the third light field distribution map is a filter of the long-exposure image, that is, the third light field distribution map has no stripes, therefore, when processing the short-exposure image based on the third light field distribution map and the fourth light field distribution map, the stripes of the short-exposure image can be removed to obtain the second stripe-removed image.
[0133] Step 206: Generate a target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image of the current frame, and the short-exposure image of the previous frame corresponding to the current frame.
[0134] For example, the motion area information can be obtained based on the short-exposure image of the current frame and the short-exposure image of the previous frame, and the first stripe-removed image and the second stripe-removed image can be fused based on the motion area information to obtain the final stripe-removed result image, and the final stripe-removed result image is called the target image. The target image not only removes the stroboscopic stripes in the image but also can maintain the clarity of moving objects.
[0135] In a possible implementation manner, based on the first stripe-removed image, the second stripe-removed image, the short-exposure image of the current frame, and the short-exposure image of the previous frame, the following steps can be used to generate the target image:
[0136] Step 2061: Determine the residual image between the short-exposure image of the current frame and the short-exposure image of the previous frame. For example, for each pixel point in the residual image, based on the difference between the pixel value of the pixel point in the short-exposure image of the current frame and the pixel value of the pixel point in the short-exposure image of the previous frame, determine the target pixel value of the pixel point in the residual image. Generate the residual image based on the target pixel values of all pixel points in the residual image, such as combining the target pixel values of all pixel points into the residual image.
[0137] Step 2062: Use the residual image to determine the motion area information, and the motion area information is the motion area information corresponding to the first stripe-removed image and also the motion area information corresponding to the second stripe-removed image.
[0138] Exemplarily, since the residual image is the residual between two adjacent frames of images, if the pixel value of a pixel point in the residual image is 0, it means that the object corresponding to this pixel point has not moved (i.e., the pixel values in two adjacent frames of images are the same). If the pixel value of a pixel point in the residual image is not 0, it means that the object corresponding to this pixel point may have moved (i.e., the pixel values in two adjacent frames of images are different). Based on the above principle, the motion area information can be determined based on this residual image. The motion area information includes a motion area and a non-motion area. The motion area refers to the area where the object moves. The motion area can be composed of multiple pixel points. The non-motion area refers to the area where the object has not moved. The non-motion area can be composed of multiple pixel points.
[0139] In a possible implementation manner, the following steps can be used to determine the motion area information. Of course, the following method is only an example of determining the motion area information, and there is no limitation on this determination method.
[0140] Step S11: Determine the luminance motion area based on the residual image, where the luminance motion area can be the columns in the luminance channel (i.e., the Y channel) of the residual image whose column means are greater than the first threshold.
[0141] For example, the mean value of each column in the luminance channel of the residual image can be determined, that is, for each column in the luminance channel, calculate the average value of the pixel values of all pixel points in this column. Then, compare the mean value of each column with the first threshold th1 (which can be configured according to experience and is not limited in this regard). If the mean value of a certain column is greater than the first threshold th1, then this column is used as the luminance motion area. If the mean value of a certain column is not greater than the first threshold th1, then this column is not used as the luminance motion area. After performing the above processing on each column of the luminance channel, all the columns used as the luminance motion area can be obtained, and these columns are combined to form the luminance motion area.
[0142] Step S12: Determine the chrominance motion area based on the residual image, where the chrominance motion area can be the columns in the chrominance channel (such as the U channel or the V channel) of the residual image whose column means are greater than the second threshold.
[0143] For example, the mean value of each column in the chrominance channel of the residual image can be determined, that is, for each column in the chrominance channel, calculate the average value of the pixel values of all pixel points in this column. Then, compare the mean value of each column with the second threshold th2 (which can be configured according to experience and is not limited in this regard). If the mean value of a certain column is greater than the second threshold th2, then this column is used as the chrominance motion area. If the mean value of a certain column is not greater than the second threshold th2, then this column is not used as the chrominance motion area. After performing the above processing on each column of the chrominance channel, all the columns used as the chrominance motion area can be obtained, and these columns are combined to form the chrominance motion area.
[0144] Step S13: Determine the first target motion region based on the union of the luminance motion region and the chrominance motion region. That is to say, use the union of the luminance motion region and the chrominance motion region as the first target motion region.
[0145] Step S14: Convert the luminance channel of the residual image into a binary image based on the third threshold.
[0146] For example, for each pixel point in the luminance channel of the residual image, if the pixel value of this pixel point is greater than the third threshold th3 (which can be configured according to experience and is not limited here), then determine that the binary value of this pixel point is 1 (or 255). If the pixel value of this pixel point is not greater than the third threshold th3, then determine that the binary value of this pixel point is 0. After obtaining the binary values of all pixel points in the luminance channel, all the binary values of the pixel points can be combined to form a binary image. That is to say, for each pixel point in the binary image, the pixel value of this pixel point can be 1 or 0.
[0147] Step S15: Determine the second target motion region based on the binary image; among them, based on the number of non-zero pixel points in each row of this binary image, the second target motion region can be the rows where the number of non-zero pixel points is greater than the fourth threshold. That is to say, the second target motion region can include multiple row regions.
[0148] For example, the number of non-zero pixel points in each row of the binary image can be determined. For example, count the number of non-zero pixel points in the first row of the binary image, that is, the number of pixel points with a pixel value of 1, count the number of non-zero pixel points in the second row of the binary image, and so on. For each row in the binary image, if the number of non-zero pixel points in this row is greater than the preset threshold th4 (which can be configured according to experience), then use this row as the second target motion region. If the number of non-zero pixel points in this row is not greater than the preset threshold th4, then do not use this row as the second target motion region. After the above processing for each row in the binary image, all the rows that are used as the second target motion region can be obtained, and these rows are combined to form the second target motion region.
[0149] Step S16: Determine the motion region information based on the intersection of the first target motion region and the second target motion region. This motion region information includes the motion region and the non-motion region. For example, the intersection region of the first target motion region and the second target motion region can be used as the motion region, and the non-intersection region of the first target motion region and the second target motion region can be used as the non-motion region.
[0150] So far, step 2062 is completed, and the motion region information can be determined using the residual image.
[0151] Step 2063: Based on the motion area information (such as the motion area and the non-motion area), fuse the first stripe-removed image and the second stripe-removed image to obtain the target image.
[0152] In a possible implementation manner, the following steps can be used to fuse and obtain the target image. Of course, the following method is only an example of fusing to obtain the target image, and there is no limitation on this implementation manner.
[0153] Step S21: Based on the motion area information (such as the motion area and the non-motion area), divide the target image into a first sub-region, a second sub-region, and a third sub-region. Among them, the first sub-region can be a non-transition region corresponding to the motion area, the second sub-region can be a non-transition region corresponding to the non-motion area, and the third sub-region can be a transition region between the motion area and the non-motion area.
[0154] For example, the length k1 + k2 of the transition region (i.e., k1 + k2 pixel points) can be pre-configured. For each pixel point in the motion area, if the interval between this pixel point and the boundary pixel point of the non-motion area is greater than k1 pixel points, then this pixel point belongs to the non-transition region corresponding to the motion area, and this pixel point is divided into the first sub-region. If the interval between this pixel point and the boundary pixel point of the non-motion area is not greater than k1 pixel points, then this pixel point belongs to the transition region between the motion area and the non-motion area, and this pixel point is divided into the third sub-region. And for each pixel point in the non-motion area, if the interval between this pixel point and the boundary pixel point of the motion area is greater than k2 pixel points, then this pixel point belongs to the non-transition region corresponding to the non-motion area, and this pixel point is divided into the second sub-region. If the interval between this pixel point and the boundary pixel point of the motion area is not greater than k2 pixel points, then this pixel point belongs to the transition region between the motion area and the non-motion area, and this pixel point is divided into the third sub-region.
[0155] Step S22: Determine the sub-image of the first sub-region based on the second stripe-removed image.
[0156] For each pixel point in the first sub-region, the pixel value corresponding to this pixel point in the second stripe-removed image can be used as the pixel value corresponding to this pixel point in the sub-image of the first sub-region.
[0157] Step S23: Determine the sub-image of the second sub-region based on the first stripe-removed image.
[0158] For each pixel point in the second sub-region, the pixel value corresponding to this pixel point in the first stripe-removed image can be used as the pixel value corresponding to this pixel point in the sub-image of the second sub-region.
[0159] Step S24: Determine the sub-image of the third sub-region based on the first stripe-removed image and the second stripe-removed image, that is, perform a weighting operation on the first stripe-removed image and the second stripe-removed image.
[0160] For each pixel point in the third sub-region, the target pixel value corresponding to this pixel point in the sub-image of the third sub-region can be determined based on the first pixel value corresponding to this pixel point in the first stripe-removed image and the second pixel value corresponding to this pixel point in the second stripe-removed image.
[0161] For example, the target pixel value of this pixel point can be determined by the following formula: T = T1 * W1 + T2 * W2. In the above formula, T represents the target pixel value, T1 represents the first pixel value, T2 represents the second pixel value, W1 represents the weight value corresponding to the first pixel value, and W2 represents the weight value corresponding to the second pixel value.
[0162] Among them, the sum of W1 and W2 can be 1. If this pixel point is located in the motion region, then W2 can be greater than W1. Moreover, the larger the interval between this pixel point and the boundary pixel point of the non-motion region, the larger the value of W2, and the smaller the interval between this pixel point and the boundary pixel point of the non-motion region, the smaller the value of W2. Or, if this pixel point is located in the non-motion region, then W1 can be greater than W2. Moreover, the larger the interval between this pixel point and the boundary pixel point of the motion region, the larger the value of W1, and the smaller the interval between this pixel point and the boundary pixel point of the motion region, the smaller the value of W1.
[0163] Step S25: Generate a target image based on the sub-image of the first sub-region, the sub-image of the second sub-region, and the sub-image of the third sub-region. For example, by combining the sub-image of the first sub-region, the sub-image of the second sub-region, and the sub-image of the third sub-region, the target image can be obtained.
[0164] In summary, the first stripe-removed image and the second stripe-removed image can be fused using the motion region information. During the fusion process, the second stripe-removed image is selected for the motion region, the first stripe-removed image is selected for the non-motion region, and a weighted fusion transition process is performed at the edge position of the motion region to obtain the target image after stripe removal. The target image can remove the stripe phenomenon caused by stroboscopic light and keep the moving object clear. After the above processing, the target image with removed stripes corresponding to the short-exposure image can be obtained, that is, the target image is used to replace the short-exposure image, that is, the target image can be output.
[0165] In the above embodiments, the sub-image of the first sub-region is determined based on the second stripe-removed image, and the sub-image of the second sub-region is determined based on the first stripe-removed image. The reason is as follows: The first stripe-removed image is an image obtained based on a one-dimensional filtering algorithm, and the stationary region of the one-dimensional filtering algorithm is relatively clear, that is, it has a better effect on the non-moving region. Therefore, for the second sub-region corresponding to the non-moving region, the first stripe-removed image has a better effect, that is, the non-moving region selects the first stripe-removed image. The second stripe-removed image is an image obtained based on a two-dimensional filtering algorithm, and the moving region of the two-dimensional filtering algorithm is relatively clear, that is, it has a better effect on the moving region. Therefore, for the first sub-region corresponding to the moving region, the second stripe-removed image has a better effect, that is, the moving region selects the second stripe-removed image.
[0166] As can be seen from the above technical solutions, in the embodiments of the present application, the first filtering algorithm can be used to filter the long-exposure image and the short-exposure image to obtain the first light field distribution map and the second light field distribution map, and the second filtering algorithm can be used to filter the long-exposure image and the short-exposure image to obtain the third light field distribution map and the fourth light field distribution map. Then, a stripe-removed image is generated based on the first light field distribution map, the second light field distribution map, the third light field distribution map, and the fourth light field distribution map, and a target image is generated based on the stripe-removed image. Since the stripe-removed image is an image with stripes removed, when generating the target image based on the stripe-removed image, the target image is an image with stripes removed, so that the stripes in the image can be removed, such as the stripes caused by stroboscopic in the image, and the image quality can be improved. It can maintain the clarity of moving objects, reduce motion blur, and improve the overall image effect. Moreover, it is not necessary to know the light source frequency of the environment, and it is not necessary to control the shutter time to match the light source frequency of the environment, which can avoid the influence of the light source frequency.
[0167] Based on the same application concept as the above method, in the embodiments of the present application, an image processing device is proposed. Refer to Figure 4 As shown in the structural schematic diagram of the image processing device, the device may include:
[0168] An acquisition module 41, configured to acquire a long-exposure image of the current frame and the short-exposure image of the current frame; wherein, the exposure duration corresponding to the long-exposure image is greater than the exposure duration corresponding to the short-exposure image;
[0169] A processing module 42, configured to filter the long-exposure image by using a first filtering algorithm to obtain a first light field distribution map corresponding to the long-exposure image, and filter the short-exposure image by using the first filtering algorithm to obtain a second light field distribution map corresponding to the short-exposure image;
[0170] A generating module 43, configured to generate a first stripe-removed image based on the first light field distribution map, the second light field distribution map, and the short-exposure image, where the first stripe-removed image is an image with stripes removed; the generating module 43 is further configured to generate a target image based on the first stripe-removed image.
[0171] In a possible implementation manner, the processing module 42 is further configured to filter the long-exposure image by using a second filtering algorithm to obtain a third light field distribution map corresponding to the long-exposure image, and filter the short-exposure image by using the second filtering algorithm to obtain a fourth light field distribution map corresponding to the short-exposure image; the generating module is further configured to generate a second stripe-removed image based on the third light field distribution map, the fourth light field distribution map, and the short-exposure image, where the second stripe-removed image is an image with stripes removed; when the generating module generates the target image based on the first stripe-removed image, specifically: generate the target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image, and the short-exposure image of the previous frame corresponding to the current frame.
[0172] In a possible implementation manner, the first filtering algorithm includes a one-dimensional filtering algorithm. When the processing module 42 filters the long-exposure image by using the first filtering algorithm to obtain the first light field distribution map corresponding to the long-exposure image, specifically: for each pixel point in the long-exposure image, determine the pixel difference between the pixel point and the previous pixel point based on the first filtering direction; map the pixel difference to a first weight value based on a preset mapping curve, and determine a second weight value based on the first weight value; determine the target pixel value of the pixel point based on the pixel value of the pixel point, the first weight value, the pixel value of the previous pixel point, and the second weight value; generate a first intermediate image based on the target pixel values of each pixel point in the long-exposure image; for each pixel point in the first intermediate image, determine the pixel difference between the pixel point and the previous pixel point based on the second filtering direction; map the pixel difference to a third weight value based on a preset mapping curve, and determine a fourth weight value based on the third weight value; determine the target pixel value of the pixel point based on the pixel value of the pixel point, the third weight value, the pixel value of the previous pixel point, and the fourth weight value; generate a second intermediate image based on the target pixel values of each pixel point in the first intermediate image; generate the first light field distribution map corresponding to the long-exposure image based on the second intermediate image.
[0173] In a possible implementation manner, the second filtering algorithm includes a two-dimensional filtering algorithm. When the processing module 42 filters the long-exposure image by using the second filtering algorithm to obtain the third light field distribution map corresponding to the long-exposure image, it is specifically configured to: for each pixel point in the long-exposure image, determine the adjacent pixel points corresponding to the pixel point, where the adjacent pixel points are the pixel points within a preset filtering radius centered on the pixel point; based on the pixel values of the adjacent pixel points and the filtering operator of the adjacent pixel points, determine the target pixel value of the pixel point; wherein, the filtering operator of the adjacent pixel points is determined based on the positional relationship between the adjacent pixel points and the pixel point, a first preset parameter, and a second preset parameter; generate the third light field distribution map based on the target pixel values of each pixel point in the long-exposure image.
[0174] In a possible implementation manner, when the generating module 43 generates the target image based on the first stripe removal image, the second stripe removal image, the short-exposure image, and the short-exposure image corresponding to the previous frame of the current frame, it is specifically configured to: determine the residual image between the short-exposure image and the short-exposure image of the previous frame; use the residual image to determine the motion area information corresponding to the first stripe removal image; based on the motion area information, fuse the first stripe removal image and the second stripe removal image to obtain the target image.
[0175] In a possible implementation manner, when the generating module 43 uses the residual image to determine the motion area information corresponding to the first stripe removal image, it is specifically configured to: determine the luminance motion area and the chrominance motion area based on the residual image, and determine the first target motion area based on the union of the luminance motion area and the chrominance motion area; wherein, the luminance motion area is the column whose column mean value in the luminance channel of the residual image is greater than a first threshold; the chrominance motion area is the column whose column mean value in the chrominance channel of the residual image is greater than a second threshold; convert the luminance channel of the residual image into a binary image based on a third threshold, and determine the second target motion area based on the binary image; wherein, based on the number of non-zero pixel points in each row of the binary image, the second target motion area is the row whose number of non-zero pixel points is greater than a fourth threshold; determine the motion area information based on the intersection of the first target motion area and the second target motion area, and the motion area information includes a motion area and a non-motion area.
[0176] In a possible implementation manner, when the generating module 43 fuses the first stripe-removed image and the second stripe-removed image based on the motion area information to obtain the target image, it specifically is used for: dividing the target image into a first sub-region, a second sub-region, and a third sub-region based on the motion area information; wherein, the first sub-region is a non-transition region corresponding to the motion area, the second sub-region is a non-transition region corresponding to the non-motion area, and the third sub-region is a transition region between the motion area and the non-motion area; determining a sub-image of the first sub-region based on the second stripe-removed image, determining a sub-image of the second sub-region based on the first stripe-removed image, and determining a sub-image of the third sub-region based on the first stripe-removed image and the second stripe-removed image; generating the target image based on the sub-image of the first sub-region, the sub-image of the second sub-region, and the sub-image of the third sub-region.
[0177] Based on the same application concept as the above method, an image processing device is proposed in an embodiment of the present application. Refer to Figure 5 As shown, the image processing device includes: a processor 51 and a machine-readable storage medium 52. The machine-readable storage medium 52 stores machine-executable instructions that can be executed by the processor 51; the processor 51 is used to execute the machine-executable instructions to implement the image processing method disclosed in the above embodiments of the present application.
[0178] Based on the same application concept as the above method, an embodiment of the present application further provides a machine-readable storage medium. A number of computer instructions are stored on the machine-readable storage medium. When the computer instructions are executed by a processor, the image processing method disclosed in the above examples of the present application can be implemented.
[0179] Wherein, the above machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0180] For the convenience of description, when describing the above device, various units are described separately according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in one or more software and / or hardware.
[0181] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0182] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or a plurality of flows and / or blocks
[0183] Moreover, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one or more of the flows Figure 1 or a plurality of flows and / or blocks
[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Therefore, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or a plurality of flows and / or blocks
[0185] The above are only the embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. An image processing method, characterized in that, The method includes: Obtaining a long-exposure image of the current frame and a short-exposure image of the current frame; wherein, the exposure duration corresponding to the long-exposure image is greater than the exposure duration corresponding to the short-exposure image; Filtering the long-exposure image and the short-exposure image by using a first filtering algorithm to obtain a first light field distribution map corresponding to the long-exposure image and a second light field distribution map corresponding to the short-exposure image; Generating a first stripe-removed image based on the first light field distribution map, the second light field distribution map, and the short-exposure image, where the first stripe-removed image is an image with stripes removed; wherein, for each pixel point in the first stripe-removed image, based on the pixel value corresponding to the pixel point in the first light field distribution map, the pixel value corresponding to the pixel point in the second light field distribution map, and the pixel value corresponding to the pixel point in the short-exposure image, determining the pixel value corresponding to the pixel point in the first stripe-removed image; generating the first stripe-removed image based on the pixel values of each pixel point in the first stripe-removed image; Generating a target image based on the first stripe-removed image.
2. The method according to claim 1, characterized in that After obtaining the long-exposure image of the current frame and the short-exposure image of the current frame, the method further includes: Filtering the long-exposure image and the short-exposure image by using a second filtering algorithm to obtain a third light field distribution map corresponding to the long-exposure image and a fourth light field distribution map corresponding to the short-exposure image; Generating a second stripe-removed image based on the third light field distribution map, the fourth light field distribution map, and the short-exposure image, where the second stripe-removed image is an image with stripes removed; The generating the target image based on the first stripe-removed image includes: Generating the target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image, and the short-exposure image of the previous frame corresponding to the current frame.
3. The method according to claim 2, wherein The first filtering algorithm includes a one-dimensional filtering algorithm, and the filtering the long-exposure image by using the first filtering algorithm to obtain the first light field distribution map corresponding to the long-exposure image includes: For each pixel point in the long-exposure image, determining the pixel difference between the pixel point and the previous pixel point based on the first filtering direction; mapping the pixel difference to a first weight value based on a preset mapping curve, and determining a second weight value based on the first weight value; determining the target pixel value of the pixel point based on the pixel value of the pixel point, the first weight value, the pixel value of the previous pixel point, and the second weight value; generating a first intermediate image based on the target pixel values of each pixel point in the long-exposure image; For each pixel point in the first intermediate image, determining the pixel difference between the pixel point and the previous pixel point based on the second filtering direction; mapping the pixel difference to a third weight value based on a preset mapping curve, and determining a fourth weight value based on the third weight value; determining the target pixel value of the pixel point based on the pixel value of the pixel point, the third weight value, the pixel value of the previous pixel point, and the fourth weight value; generating a second intermediate image based on the target pixel values of each pixel point in the first intermediate image; Generate a first light field distribution map corresponding to the long-exposure image based on the second intermediate image.
4. The method according to claim 2, wherein the second filtering algorithm includes a two-dimensional filtering algorithm, and filtering the long-exposure image by using the second filtering algorithm to obtain a third light field distribution map corresponding to the long-exposure image, including: For each pixel point in the long-exposure image, determine the adjacent pixel points corresponding to the pixel point, where the adjacent pixel points are the pixel points within a preset filtering radius centered on the pixel point; Based on the pixel values of the adjacent pixel points and the filtering operator of the adjacent pixel points, determine the target pixel value of the pixel point; wherein, the filtering operator of the adjacent pixel points is determined based on the positional relationship between the adjacent pixel points and the pixel point, a first preset parameter, and a second preset parameter; Generate the third light field distribution map based on the target pixel values of each pixel point in the long-exposure image.
5. The method according to claim 2, wherein generating the target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image, and the short-exposure image corresponding to the previous frame of the current frame includes: Determine the residual image between the short-exposure image and the short-exposure image of the previous frame; Use the residual image to determine the motion area information corresponding to the first stripe-removed image; Fuse the first stripe-removed image and the second stripe-removed image based on the motion area information to obtain the target image.
6. The method according to claim 5, wherein The using the residual image to determine the motion area information corresponding to the first stripe-removed image includes: Determine a luminance motion area and a chrominance motion area based on the residual image, and determine a first target motion area based on the union of the luminance motion area and the chrominance motion area; wherein, the luminance motion area is the column in the luminance channel of the residual image whose column mean is greater than a first threshold; the chrominance motion area is the column in the chrominance channel of the residual image whose column mean is greater than a second threshold; Convert the luminance channel of the residual image into a binary image based on a third threshold, and determine a second target motion area based on the binary image; wherein, based on the number of non-zero pixel points in each row of the binary image, the second target motion area is the row whose number of non-zero pixel points is greater than a fourth threshold; Determine the motion area information based on the intersection of the first target motion area and the second target motion area, and the motion area information includes a motion area and a non-motion area.
7. The method according to claim 5, characterized in that The motion area information includes a motion area and a non-motion area, and the fusing the first stripe-removed image and the second stripe-removed image based on the motion area information to obtain the target image includes: Divide the target image into a first sub-region, a second sub-region, and a third sub-region based on the motion area information; wherein, the first sub-region is a non-transition region corresponding to the motion area, the second sub-region is a non-transition region corresponding to the non-motion area, and the third sub-region is a transition region between the motion area and the non-motion area; Determine the sub-image of the first sub-region based on the second stripe-removed image, determine the sub-image of the second sub-region based on the first stripe-removed image, and determine the sub-image of the third sub-region based on the first stripe-removed image and the second stripe-removed image; Generate the target image based on the sub-image of the first sub-region, the sub-image of the second sub-region, and the sub-image of the third sub-region.
8. An image processing apparatus, characterized in that, The device includes: An acquisition module, configured to acquire a long-exposure image of the current frame and a short-exposure image of the current frame; wherein, the exposure duration corresponding to the long-exposure image is greater than the exposure duration corresponding to the short-exposure image; A processing module, configured to filter the long-exposure image by using a first filtering algorithm to obtain a first light field distribution map corresponding to the long-exposure image, and filter the short-exposure image by using the first filtering algorithm to obtain a second light field distribution map corresponding to the short-exposure image; A generation module, configured to generate a first stripe-removed image based on the first light field distribution map, the second light field distribution map, and the short-exposure image, where the first stripe-removed image is an image with stripes removed; wherein, for each pixel point in the first stripe-removed image, determine the pixel value corresponding to the pixel point in the first stripe-removed image based on the pixel value corresponding to the pixel point in the first light field distribution map, the pixel value corresponding to the pixel point in the second light field distribution map, and the pixel value corresponding to the pixel point in the short-exposure image; generate the first stripe-removed image based on the pixel values of each pixel point in the first stripe-removed image; The generation module is further configured to generate a target image based on the first stripe-removed image.
9. The device according to claim 8, wherein The processing module is further configured to filter the long-exposure image by using a second filtering algorithm to obtain a third light field distribution map corresponding to the long-exposure image, and filter the short-exposure image by using the second filtering algorithm to obtain a fourth light field distribution map corresponding to the short-exposure image; The generation module is further configured to generate a second stripe-removed image based on the third light field distribution map, the fourth light field distribution map, and the short-exposure image, where the second stripe-removed image is an image with stripes removed; When the generation module generates the target image based on the first stripe-removed image, it is specifically configured to: generate the target image based on the first stripe-removed image, the second stripe-removed image, the short-exposure image, and the short-exposure image of the previous frame corresponding to the current frame.
10. The device according to claim 9, wherein The first filtering algorithm includes a one-dimensional filtering algorithm. When the processing module filters the long-exposure image by using the first filtering algorithm to obtain the first light field distribution map corresponding to the long-exposure image, it is specifically configured to: For each pixel point in the long-exposure image, based on the first filtering direction, determine the pixel difference between this pixel point and the previous pixel point; map the pixel difference to a first weight value based on a preset mapping curve, and determine a second weight value based on the first weight value; based on the pixel value of this pixel point, the first weight value, the pixel value of the previous pixel point, and the second weight value, determine the target pixel value of this pixel point; Generate a first intermediate image based on the target pixel values of each pixel point in the long-exposure image; For each pixel point in the first intermediate image, based on the second filtering direction, determine the pixel difference between this pixel point and the previous pixel point; Map the pixel difference to a third weight value based on a preset mapping curve, and determine a fourth weight value based on the third weight value; based on the pixel value of this pixel point, the third weight value, the pixel value of the previous pixel point, and the fourth weight value, determine the target pixel value of this pixel point; Generate a second intermediate image based on the target pixel values of each pixel point in the first intermediate image; Generate a first light field distribution map corresponding to the long-exposure image based on the second intermediate image.
Citation Information
Patent Citations
Image processing method, mobile terminal and storage medium
CN113179374A
Image processing method, device and equipment
CN113222870A