Image processing method, electronic equipment and readable storage medium
By adopting the interleaved exposure technology in the first exposure mode in the electronic device, the alternate exposure of the first exposure time and the second exposure time is solved, and the image stripe problem caused by the strobe light source and the strobe screen is achieved, and high-quality image capture is achieved.
Patent Information
- Application Number
- CN202311699250.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2025-06-13
AI Technical Summary
During shooting, the strobe light source and the strobe screen cause stripes to appear in the image, affecting the image quality, and it is difficult for the prior art to ensure image clarity and avoid streaks at the same time.
The first exposure mode is adopted, and the first exposure time is interleaved by the first exposure time and the second exposure time. The first exposure time is an integer multiple of the period of the strobe light source or the strobe screen, and the second exposure time is less than the first exposure time to avoid streaks and ensure image clarity.
Effectively avoid streaks in images during preview and shooting, improving image quality, especially when a moving scene and strobe light source or screen exists.
Smart Images

Figure CN120151644A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of image processing technologies, and in particular, to an image processing method, an electronic device, and a readable storage medium. Background Art
[0002] In order to capture wonderful moments during movement, it is often necessary to shorten the exposure duration of the camera to improve image clarity. When there is a stroboscopic light source in the shooting scene and the exposure duration of the camera is not an integer multiple of the stroboscopic period of the stroboscopic light source, banding will appear in the preview and captured images of the camera, affecting the image quality.
[0003] Currently, an electronic device can detect the frequency of the stroboscopic light source and adjust the exposure duration according to this frequency to avoid banding in the preview and captured images. However, this strategy cannot guarantee the clarity of the captured image and will affect the image quality. Summary of the Invention
[0004] Embodiments of the present application provide an image processing method, an electronic device, and a readable storage medium, which can avoid stripes in the preview and captured images and can also guarantee the clarity of the captured image.
[0005] In a first aspect, the present application provides an image processing method. The execution subject of this method can be an electronic device or a chip in the electronic device. The following takes the electronic device as an example for illustration. In this method, in the preview mode, the electronic device acquires an image in a first exposure mode. Wherein, the first exposure mode means that the electronic device alternately exposes according to a first exposure duration and a second exposure duration. The first exposure duration is an integer multiple of the stroboscopic period of the stroboscopic light source in the environment where the electronic device is located, and the second exposure duration is less than the first exposure duration. Wherein, a first image is obtained by exposing according to the first exposure duration, and a second image is obtained by exposing according to the second exposure duration.
[0006] In the present application, in the preview mode, the electronic device can display the first image. Since the first exposure duration is an integer multiple of the stroboscopic period, there are no stripes in the first image. The electronic device displays the first image, which can avoid the stroboscopic phenomenon and improve the quality of the preview image.
[0007] In some embodiments, the second exposure duration is less than the first exposure duration. The second exposure duration can be an integer multiple of the stroboscopic period or not an integer multiple of the stroboscopic period. Exemplarily, the first exposure duration is 2 times the stroboscopic period, and the second exposure duration is less than the first exposure duration, such as the second exposure duration is 1 times the stroboscopic period.
[0008] The electronic device receives a photographing instruction. In some embodiments, when the second exposure duration is an integer multiple of the stroboscopic period, there are no stripes in the second image obtained by exposing according to the second exposure duration. And since the second exposure duration is less than the first exposure duration, the second image obtained by exposing according to the second exposure duration can capture an image with high clarity.
[0009] In some embodiments, when the second exposure duration is not an integer multiple of the stroboscopic period, there are stripes in the second image obtained by exposing according to the second exposure duration. Additionally, since the second exposure duration is less than the first exposure duration, the second image obtained by exposing according to the second exposure duration can capture an image with high clarity, and the clarity of the second image is higher than that of the first image. Therefore, in response to the photographing instruction, the electronic device can first remove the stripes in the second image to obtain a processed second image, and then display the processed second image, which can ensure that the electronic device can display an image with higher clarity and improve the user experience.
[0010] It should be understood that in the following embodiments, taking "the second exposure duration is less than the first exposure duration and the second exposure duration is not an integer multiple of the stroboscopic period" as an example, the image processing method provided by the embodiments of the present application is introduced.
[0011] In a possible implementation, the electronic device receives an instruction to run a camera application and can detect whether there is a stroboscopic light source in the environment. Among them, when there is a stroboscopic light source in the environment, the electronic device can adjust the first exposure duration to be an integer multiple of the stroboscopic period of the stroboscopic light source. When there is no stroboscopic light source in the environment, the electronic device can not adjust the first exposure duration.
[0012] After the electronic device adjusts the first exposure duration, or when the electronic device detects that there is no stroboscopic light source in the environment, the electronic device can determine whether there is a moving area in the image based on two adjacent images obtained by exposing according to the first exposure duration. Among them, when there is a moving area in the image, in order to ensure the clarity of the image during shooting, the electronic device can adjust the second exposure duration to be less than the first exposure duration. When there is no moving area in the image, the electronic device can not adjust the second exposure duration.
[0013] In the embodiments of the present application, the information about the stripes in the second image is obtained based on the first image and the second image.
[0014] In some embodiments, the first image and the second image used to obtain the information of the stripes in the second image can be understood as: the first image and the second image obtained by the electronic device through one exposure with a first exposure duration and a second exposure duration. In some embodiments, to ensure the real-time nature of shooting, the first image and the second image used to obtain the information of the stripes in the second image can be understood as: within a preset range from the target moment, the first image and the second image obtained by the electronic device through one exposure with a first exposure duration and a second exposure duration. It should be understood that the target moment is the moment when the electronic device receives the photographing instruction.
[0015] In some embodiments, because of the interleaved exposure with the first exposure duration and the second exposure duration, at least one first image and at least one second image can be obtained. In response to the photographing instruction, the electronic device can select a set of the first image and the second image that is closest to the target moment in the memory buffer. In this set of the first image and the second image that is closest to the target moment, the first image can be referred to as the target first image, and the second image can be referred to as the target second image. In other words, the target first image is the first image that is closest to the target moment among the at least one first image, and the target second image is the second image that is closest to the target moment among the at least one second image.
[0016] In this example, when the electronic device receives the photographing instruction, it can eliminate the stripes in the target second image according to the information of the stripes in the target second image, and obtain the processed target second image. The information of the stripes is obtained based on the target first image and the target second image. Correspondingly, the electronic device can display the processed target second image.
[0017] In the following embodiments, taking "the electronic device obtains the information of the stripes in the target second image according to the target first image and the target second image" as an example, the method for the electronic device to obtain the information of the stripes in the second image and eliminate the stripes in the second image is described as follows:
[0018] In the embodiments of the present application, the electronic device performs interleaved exposure according to the first exposure duration and the second exposure duration, and can obtain at least one first image and at least one second image. The electronic device can determine the information of the stripes in the target second image according to the target first image and the target second image, and eliminate the stripes in the target second image according to the information of the stripes in the target second image, to obtain the processed target second image, and display the processed target second image.
[0019] Wherein, the target first image is the first image that is closest to the target moment among the at least one first image, the target second image is the second image that is closest to the target moment among the at least one second image, and the target moment is the moment when the photographing instruction is received.
[0020] In a possible implementation, a stripe detection model can be pre-configured in the electronic device. The stripe detection model is trained based on a first set of positive samples and a first set of negative samples. The first set of positive samples includes a first image and a second image under different stroboscopic light sources, and the first set of negative samples includes a first image and a second image without a stroboscopic light source. The stripe detection model is used to output information about the stripes in the image.
[0021] In this example, the electronic device can input the target first image and the target second image into the stripe detection model to obtain information about the stripes in the target second image.
[0022] Wherein, the information about the stripes is an energy gain map, and the energy gain map is used to characterize the fluctuation of the energy introduced by the stroboscopic light source in the target second image. The electronic device can process the target second image according to the energy gain map to obtain the processed target second image.
[0023] Exemplarily, the stripes in the target second image can be regarded as an embodiment of the energy fluctuation caused by the introduction of the stroboscopic light source. Since it is known that "the result after the energy fluctuation caused by the introduction of the stroboscopic light source, that is, the target second image", in some embodiments, the electronic device can calculate the image before the introduction of the stroboscopic light source, that is, the processed target second image (the target second image without energy fluctuation), based on the energy gain map (the ratio of energy before and after the fluctuation) and the target second image.
[0024] In a possible implementation, the electronic device can divide the target first image and the target second image into corresponding N regions, and obtain the first information of each region in the target first image and the second information of each region in the target second image by separating the RGB channels. The electronic device can determine the information about the stripes in the target second image according to the first information and the second information. Wherein, N is an integer greater than or equal to 1.
[0025] In this example, the first information and the second information include at least one of the following: the mean, variance, and histogram of each channel in the RGB channels, and the information about the stripes includes the type and position of the stripes.
[0026] In some embodiments, the types of the stripes include at least one of the following: light stripes, black stripes, and colored stripes. A stripe detection rule can be configured in the electronic device, and the electronic device can determine the information about the stripes in the target second image based on the stripe detection rule, the first information of each region in the target first image, and the second information of each region in the target second image. The stripe detection rule can be referred to the following description:
[0027] First, when the difference between the first information and the second information of a channel in the M regions is greater than or equal to the first threshold, determine that the type of the stripe is a light stripe, where M is an integer greater than or equal to 1 and less than or equal to the second threshold, and the second threshold is less than N.
[0028] Second, when the difference between the first information and the second information of a channel in the N regions is greater than or equal to the first threshold, determine that the type of the stripe is a black stripe.
[0029] Third, when the difference between the first information and the second information of each channel in the M regions is greater than or equal to the first threshold, determine that the type of the stripe is a color stripe.
[0030] In this example, a stripe elimination model can be pre-configured in the electronic device. The stripe elimination model is trained based on the second training data, and the second training data may include: an image with stripes and the information of the stripes in the image. The stripe elimination model is used to output the processed target second image. In this example, after the electronic device obtains the information of the stripes in the target second image, that is, the type and position of the stripes, the electronic device can input the target second image and the information of the stripes in the target second image into the stripe elimination model, and the stripe elimination model can output the processed target second image.
[0031] In the above example, the electronic device can use different methods to obtain the information of the stripes in the target second image, and based on the information of the stripes in the target second image, eliminate the stripes in the target second image. In this way, when the electronic device receives a photographing instruction, it can display the processed target second image, and the stripes in the target second image have been eliminated, so that the user can be prevented from seeing the stripes and the quality of the image during shooting can be improved.
[0032] In a possible implementation manner, the electronic device can not only perform stripe detection, but also perform screen detection to eliminate the stripes in the image caused by a flickering screen.
[0033] In this implementation manner, the electronic device can detect whether there is a flickering screen in the target second image according to the target first image and the target second image. Wherein, when there is a flickering screen in the target second image, the electronic device can replace the area of the flickering screen in the target second image with the area of the flickering screen in the target first image, so that the stripes introduced by the flickering screen in the image can be eliminated and the image quality can be improved.
[0034] The method for the electronic device to perform screen detection is described below:
[0035] First, a screen detection model is pre-configured in the electronic device. The screen detection model is trained based on second positive samples and second negative samples. The second positive samples include the first image and the second image when there is a stroboscopic screen. The second negative samples include the first image and the second image when there is no stroboscopic screen, and the first image and the second image when there is an object similar to the screen. The screen detection model is used to output whether there is a stroboscopic screen in the image, and when there is a stroboscopic screen in the image, the screen detection model can output the position of the stroboscopic screen.
[0036] In this example, the electronic device can input the target first image and the target second image into the screen detection model to obtain a stroboscopic screen detection result. The stroboscopic screen detection result includes whether there is a stroboscopic screen and the position of the stroboscopic screen.
[0037] In a possible implementation, the stripe detection model and the screen detection model can be integrated together. The integrated model can be called a stripe detection classification model. The stripe detection classification model is used to detect stripes and output corresponding detection results based on the source of the stripes. In this implementation, the electronic device can input the target first image and the target second image into the stripe detection classification model. The stripe detection classification model can identify the stripe detection classification model of the stripes and output results based on the stripe detection classification model of the stripes. Among them, the source of the stripes can include: stroboscopic light source, stroboscopic screen.
[0038] Among them, when the source of the stripes is a stroboscopic light source, the detection result output by the stripe detection classification model can include: the energy gain map corresponding to the target second image. When the source of the stripes is a stroboscopic screen, the detection result output by the stripe detection classification model can include: the position of the stroboscopic screen.
[0039] In this implementation, the electronic device can use one model to simultaneously perform stripe detection and screen detection on the target second image.
[0040] Second, the electronic device can detect whether there is a stroboscopic screen in the target second image according to the first information and the second information. Exemplarily, when the difference between the first information and the second information in a local area of the target first image and the target second image is greater than or equal to the first threshold, it is determined that there is a stroboscopic screen in the target second image.
[0041] It should be understood that in this example, the electronic device can perform stripe detection (such as obtaining information about the stripes in the target second image) and screen detection (determining whether there is a stroboscopic screen in the target second image) according to the first information and the second information.
[0042] In a possible implementation, the electronic device may determine whether there is hand shake during shooting based on the attitude data of the electronic device. Among them, when there is hand shake, there will be a difference in the content of the first image obtained by exposing according to the first exposure time and the second image obtained by exposing according to the second exposure time. In the embodiments of the present application, in order to avoid the problem of inaccurate image preview and shooting display caused by hand shake, after receiving a photographing instruction, the electronic device may perform global registration on the target first image and the target second image.
[0043] Global registration can be understood as: determining the matching regions in the target first image and the target second image, and performing screen detection and stripe detection on this region. Among them, the matching regions in the target first image and the target second image can be understood as: regions with the same content.
[0044] After the electronic device performs global registration on the target first image and the target second image, it may obtain the information of the stripes in the target second image and eliminate the stripes in the target second image according to the stripe detection method, screen detection method, etc. described in the above examples.
[0045] In this example, when there is hand shake, the electronic device may perform global registration on the target first image and the target second image, and the electronic device may perform screen detection and stripe detection on the matching regions in the target first image and the target second image, so as to avoid the problem of inaccurate detection results caused by hand shake.
[0046] In a second aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory. The memory is used to store computer-executable program code, and the program code includes instructions; when the processor executes the instructions, the instructions cause the electronic device to execute the method in the first aspect.
[0047] In a third aspect, an embodiment of the present application provides an electronic device, which may include units, modules or circuits for executing the method provided in the first aspect above.
[0048] In a fourth aspect, an embodiment of the present application provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the method in the first aspect above.
[0049] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored, and when running on a computer, cause the computer to execute the method in the first aspect above.
[0050] For the possible implementation manners of the second to fifth aspects above, the beneficial effects can refer to the beneficial effects brought by the first aspect above, and will not be elaborated here. Description of the Drawings
[0051] Figure 1 Schematic diagram of an image taken when there is a stroboscopic light source;
[0052] Figure 2 Schematic diagram of an image taken when there is a stroboscopic screen;
[0053] Figure 3 Schematic diagram of a preview interface;
[0054] Figure 4 Schematic flowchart of an embodiment of the image processing method provided by an embodiment of the present application;
[0055] Figure 5 Schematic diagram of an interface during the photographing process provided by an embodiment of the present application;
[0056] Figure 6 Another schematic flowchart of the image processing method provided by an embodiment of the present application;
[0057] Figure 7A For Figure 6 Simplified flowchart of stripe detection in;
[0058] Figure 7B Schematic flowchart of a screen detection provided by an embodiment of the present application;
[0059] Figure 7C Schematic flowchart of a screen detection and a stripe detection provided by an embodiment of the present application;
[0060] Figure 8A Another schematic flowchart of the image processing method provided by an embodiment of the present application;
[0061] Figure 8B Schematic diagram of dividing a target first image and a target second image provided by an embodiment of the present application;
[0062] Figure 9A For Figure 8A Simplified flowchart of stripe detection in;
[0063] Figure 9B Another schematic flowchart of a screen detection and a stripe detection provided by an embodiment of the present application;
[0064] Figure 10 Another schematic flowchart of the image processing method provided by an embodiment of the present application;
[0065] Figure 11 Another schematic flowchart of the image processing method provided by an embodiment of the present application;
[0066] Figure 12Another flowchart of the image processing method provided by the embodiments of the present application;
[0067] Figure 13 Another flowchart of the image processing method provided by the embodiments of the present application;
[0068] Figure 14 Another flowchart of the image processing method provided by the embodiments of the present application;
[0069] Figure 15 Another flowchart of the image processing method provided by the embodiments of the present application;
[0070] Figure 16 A schematic structural diagram of an electronic device provided by the embodiments of the present application. Detailed implementation manners
[0071] For the convenience of understanding, the relevant terms and concepts involved in the embodiments of the present application are introduced below:
[0072] Electronic device: The electronic device in the present application refers to a device that includes a camera and supports the long and short exposure frame fusion (stagger) technology. For example, the electronic device may include, but is not limited to: mobile phones, tablet computers (portable android devices, PADs), personal digital assistants (PDAs), handheld devices with wireless communication functions, computing devices, monitoring devices, vehicle-mounted devices or wearable devices, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in smart homes, etc. The form of the electronic device is not specifically limited in the embodiments of the present application.
[0073] Exposure duration: It refers to the time interval when the shutter of the camera is opened and closed. For example, when shooting a person or an object in motion, if a shorter exposure duration is used, clear action details can be captured. If a longer exposure duration is used, motion blur will occur.
[0074] Stroboscopic light source: In the embodiments of the present application, it refers to an artificial light-emitting device, which may include, but is not limited to, a light-emitting lighting device (referred to as a lighting device for short) and a light-emitting display device. Among them, for example, the lighting device may be an indoor lighting lamp, stage lighting, studio lighting, etc. The light-emitting display device may include, but is not limited to: electronic devices, projectors, etc.
[0075] In some embodiments, the screen of the light-emitting display device may be a stroboscopic screen, and the definition of the stroboscopic screen may refer to the following related description.
[0076] Among them, when the environment where the electronic device is located is an outdoor scene with sufficient light, the natural light in the outdoor scene can meet the exposure requirements of the electronic device. Even if there is a stroboscopic light source, it has little impact on the image quality of the preview and shooting of the electronic device. When the shooting environment is an indoor place, such as provided with light by lighting equipment, the sufficient light in the indoor place can also meet the exposure requirements of the electronic device. However, lighting equipment generally operates under the drive of alternating current. Affected by the alternating current, there is a stroboscopic (flicker) phenomenon in the lighting equipment. The brightness of the lighting equipment is affected by the alternating current. As the amplitude of the alternating current changes periodically, the brightness of the lighting equipment also changes accordingly. Exemplarily, if the lighting equipment operates under the drive of 50 Hz (or 60 Hz) alternating current, the lighting equipment flickers 100 times (or 120 times) per second.
[0077] Stroboscopic period: The time taken for a stroboscopic light source to undergo one stroboscopic event. For example, if the lighting equipment flickers 100 times (or 120 times) per second, the stroboscopic period of the lighting equipment can be 10 ms (or 8.3 ms).
[0078] Stroboscopic phenomenon: The electronic device acquires images by means of progressive exposure. When the exposure duration is not an integer multiple of the stroboscopic period, at different stages within the stroboscopic period corresponding to each exposure duration of the electronic device, the brightness of the images continuously acquired by the electronic device will be inconsistent. As a result, banding and / or band-like stripes will appear on the preview and captured images of the electronic device. It should be understood that in the following embodiments, the banding and / or band-like stripes caused by the stroboscopic phenomenon are simply referred to as stripes.
[0079] First, the electronic device generates a preview image stream and displays the preview image stream on the display screen to form a preview image, enabling the user to view the preview image through the display screen. If the exposure duration set by the electronic device is not an integer multiple of the stroboscopic period of the lighting equipment, when the electronic device acquires the images in the preview image stream, the number of stroboscopic events included in each image exposure is different, resulting in different brightnesses among the images in the preview image stream acquired by the electronic device. When the electronic device displays the preview image stream, due to the different brightnesses of the different images, the user will think that the brightness of the display screen of the electronic device has changed. This phenomenon is called the stroboscopic phenomenon. When the user actually views the preview image, due to visual persistence, stripes will be seen on the preview image.
[0080] Second, when the photographing control of the electronic device is triggered and the electronic device captures an image, the image sensor captures the image by line-by-line exposure. Due to the flickering of the stroboscopic light source, during the process of the image sensor capturing the image by line-by-line exposure, the exposure of different lines in a frame of image will be different, resulting in bright and dark stripes on the image generated by the electronic device, as Figure 1 shown.
[0081] Dimming methods of the screen: including direct current (DC) dimming and pulse width modulation (PWM) dimming. Among them, DC dimming changes the screen brightness by changing the voltage or current. When the screen uses DC dimming, when the electronic device captures the screen, there will be no banding stripes in the preview and captured images. PWM dimming adjusts the screen brightness by changing the duty cycle, and the screen will alternate between bright and off. When the screen uses PWM dimming, when the electronic device captures the screen, stripes will appear in the screen area of the preview and captured images.
[0082] In some embodiments, the screen can be the screen of other electronic devices in the environment where the electronic device is located. The description of other electronic devices can refer to the relevant examples of the above electronic devices. Alternatively, the screen can also be a projection screen, etc.
[0083] In some embodiments, the screen can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. The embodiments of the present application do not limit this.
[0084] Exemplarily, taking an LED screen as an example, the general control method of the LED screen is the row-column separate control mode (zone scanning refresh + PWM dimming). A complete frame of image is generated by line-by-line scanning within the refresh time of each frame of image, and the scanning methods include 1 / 2 scan, 1 / 4 scan, 1 / 8 scan, 1 / 16 scan, etc. When the exposure duration of the camera is not an integer multiple of the refresh period of the screen, an image being refreshed line by line will be captured, and stripes will appear, as Figure 2As shown. Exemplarily, when the refresh rate of the screen is 90 Hz, the refresh period of the screen (ie, the refresh time of each frame of the image) is 11.1 ms.
[0085] In some embodiments, a screen dimmed by PWM (stroboscopic screen) can be used as a stroboscopic light source. In the following embodiments, the stroboscopic light source and the screen are detected separately for explanation.
[0086] Stroboscopic screen: A screen that can cause streaks when previewing and shooting. In the embodiment of the present application, it refers to a screen that adopts PWM dimming mode.
[0087] It should be noted that the streaks caused by stroboscopic light and stroboscopic screens have different manifestations. The stroboscopic light can cause streaks in the global range of the image, while the stroboscopic screen will cause streaks in the local range of the image. Figure 1 , when there is a stroboscopic light source, the whole image will have stripes, when there is a stroboscopic screen, only the stroboscopic screen area and part of the area around the screen will have stripes in the image. It should be understood that Figure 2 In the example, stripes appearing in the stroboscopic screen area in the image are used for explanation. The global range can be understood as the entire image area, and the local range refers to a certain area in the image, such as the area where the stroboscopic screen is located and / or a part of the area around the screen. In the following embodiments, based on the different manifestations of the stripes caused by the stroboscopic light source and the stripes caused by the stroboscopic screen, it can be distinguished whether the stripes are caused by the stroboscopic light source or the stroboscopic screen. For details, please refer to the relevant description in the following embodiments.
[0088] Preview mode: The process of capturing and displaying a preview image before an electronic device captures an image. Figure 3 Taking a mobile phone as an example, when a user opens a camera application, the electronic device may be in a preview mode. When the electronic device is in the preview mode, the electronic device may display a preview interface 301. The preview interface 301 may include a preview box 31, a photo taking control 32, etc. The preview box 31 may display a preview image.
[0089] Shooting: can be understood as taking a photo or capturing a snapshot. For example, a user may trigger the electronic device to shoot by operating the photo control 32 in the preview interface 301. Alternatively, a user may trigger the electronic device to shoot by using a voice command, which is not limited in the present embodiment of the application.
[0090] Staggered long and short exposure frame fusion: Traditional "multi-frame high dynamic range (HDR) images" with "frames" as the output unit need to complete the shooting of the previous frame before starting the shooting of the next frame, and the interval between frames is relatively long. If the object being photographed is moving at high speed, its position in the previous frame and the next frame will change significantly, resulting in the "ghosting" defect easily appearing in the finally synthesized HDR image. The new staggered HDR technology is a "long and short frame" shooting with "rows" as the output unit. It can simultaneously obtain multiple frames with different exposure lengths during a single shooting, greatly reducing the time interval between frames, thereby reducing the possibility of "ghosting" occurring.
[0091] In the embodiments of the present application, the electronic device supports the stagger technology, and the electronic device can perform exposure in an alternating manner of long and short exposure durations. For example, the electronic device can perform staggered exposure according to the first exposure duration and the second exposure duration, and continuously output two frames within a very short time interval. Taking the example of outputting images at a speed of 30fps during preview, the electronic device can perform exposure in sequence according to the first exposure duration and the second exposure duration within 33ms. Among them, the first exposure frame N can be obtained according to the first exposure duration, and the second exposure frame S can be obtained by exposing according to the second exposure duration. In other words, the electronic device can capture the first exposure frame N and the second exposure frame S within 33ms. Here, fps refers to frames per second.
[0092] In some embodiments, the first exposure frame N can be referred to as the first image, and the second exposure frame S can be referred to as the second image.
[0093] Image sensor: It is used to capture images during the exposure duration, and is also responsible for the power-on or power-off timing diagram of the hardware sensor, and is also used for matching control, real-time image sensor configuration, and reset functions. Among them, the alternating exposure method of the first exposure duration and the second exposure duration can be achieved by setting the image sensor.
[0094] In summary, when there is a strobe light source in the environment where the electronic device is located, if the exposure duration of the camera is not an integer multiple of the strobe period of the strobe light source, stripes will appear in the previewed and photographed images of the electronic device, affecting the image quality. In addition, when the photographed image of the electronic device contains a strobe screen, if the exposure duration of the camera is not an integer multiple of the refresh period of the screen, stripes will also appear in the previewed and photographed images of the electronic device, affecting the image quality.
[0095] For the strobe light source, the following two solutions can be adopted currently:
[0096] Method 1: Ensure image quality at the expense of image sharpness. Adjust the exposure duration to an integer multiple of the stroboscopic period, so that stripes will appear in the images previewed and captured by the electronic device. However, in a motion scenario, this solution cannot guarantee image sharpness, resulting in motion blur and low image quality.
[0097] Method 2: Ensure image sharpness. Reduce the exposure duration to obtain a clear image. However, in this solution, since the exposure duration is not an integer multiple of the stroboscopic period of the stroboscopic light source, stripes will appear in the image, resulting in low image quality.
[0098] Currently, in a scenario with a stroboscopic light source and / or a screen, no specific solution has been proposed on how to improve image quality. In the embodiments of this application, for these two aspects of the stroboscopic light source and the screen, an image processing method is provided. The electronic device can adopt the stagger technology and alternately expose with a first exposure duration and a second exposure duration. The first exposure duration is an integer multiple of the stroboscopic period, so that stripes can be avoided from appearing in the image. The second exposure duration is less than the first exposure duration, so that the image sharpness can be guaranteed. In this way, the image quality of the preview and capture of the electronic device can be improved.
[0099] It should be understood that the image processing method provided by the embodiments of this application can be applied to a scenario including a stroboscopic light source and / or a screen, especially applicable to a scenario of shooting the instantaneous state of a target object or a scenario with motion, and can effectively eliminate the stroboscopic phenomenon of the preview image and the stripes in the captured image. For example, applicable scenarios can include, but are not limited to: conducting a sports competition in an indoor scenario, such as a basketball game, a swimming competition, etc. When a user watches a basketball game, the user can use the electronic device to capture the wonderful moments during the game. Another example is when activities are carried out in an outdoor venue and lighting equipment is used to provide lighting when the outdoor sunlight is insufficient, such as an outdoor parent-child activity, an outdoor football game, etc. In this case, the electronic device can be used to capture the wonderful moments during the activity or the game.
[0100] It should be understood that based on the concept of solving Problem 1 "stripes caused by the stroboscopic light source" and Problem 2 "stripes caused by the stroboscopic screen", the image processing method provided by the embodiments of this application will be described below.
[0101] The following describes the image processing method provided by the embodiments of this application in conjunction with specific embodiments. These embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0102] Solving Problem 1: Stripes caused by the stroboscopic light source
[0103] Figure 4 This is a schematic flowchart of an embodiment of the image processing method provided by the embodiments of this application. Refer toFigure 4 , the image processing method provided by the embodiments of the present application may include:
[0104] S401, receive an instruction to run the camera application, and detect whether there is a stroboscopic light source in the environment where the electronic device is located.
[0105] The embodiments of the present application do not limit the way for the user to trigger the electronic device to run the camera application. Exemplarily, the user can operate the icon of the camera application on the desktop of the electronic device to trigger the electronic device to run the camera application, or the user can use a voice command or the like to trigger the electronic device to run the camera application. Correspondingly, the electronic device can receive the instruction to run the camera application, run the camera application, and display a preview interface, as shown in Figure 3 shown.
[0106] In some embodiments, a detection device for detecting a stroboscopic light source may be provided in the electronic device. The detection device is used to detect whether there is a stroboscopic light source in the environment where the electronic device is located. And when there is a stroboscopic light source in the environment where the electronic device is located, the detection device can detect the frequency of the stroboscopic light source and the degree of light source fluctuation. Correspondingly, the electronic device can determine whether there is a stroboscopic light source in the environment where the electronic device is located according to the data collected by the detection device.
[0107] S402, when there is a stroboscopic light source, adjust the first exposure duration to an integer multiple of the stroboscopic period of the stroboscopic light source.
[0108] The detection device can detect the frequency of the stroboscopic light source and the degree of light source fluctuation. Among them, the electronic device can determine the stroboscopic period of the stroboscopic light source according to the frequency of the stroboscopic light source. The electronic device can adjust the first exposure duration to an integer multiple of the stroboscopic period of the stroboscopic light source. The embodiments of the present application do not limit this integer multiple. For example, the integer multiple can be 1 time, 2 times, etc.
[0109] It should be understood that when there is no stroboscopic light source in the environment where the electronic device is located, the electronic device does not need to adjust the first exposure duration and can directly execute S403.
[0110] S403, determine whether there is a moving area in the images obtained by exposing according to the first exposure duration.
[0111] The electronic device alternately exposes with the first exposure duration and the second exposure duration. Among them, the first image can be obtained by exposing according to the first exposure duration, and the second image can be obtained by exposing according to the second exposure duration. Since the electronic device has adjusted the first exposure duration to an integer multiple of the stroboscopic period of the stroboscopic light source in S402, there are no stripes in the first image obtained by exposing according to the first exposure duration.
[0112] In the embodiments of the present application, since there are no stripes in the first image, it will not affect the accuracy of the electronic device in performing motion detection. Herein, motion detection can be understood as: the electronic device determines whether there is a motion area in the image. The electronic device can determine whether there is a motion area in the image based on two adjacent images (two first images) obtained by exposure with the first exposure duration. Herein, two adjacent images can be understood as: in the process of alternating exposure with the first exposure duration and the second exposure duration, two images (first images) obtained by exposure with the first exposure duration in two adjacent times.
[0113] Exemplarily, the electronic device can recognize the content in two adjacent images. When there are significant changes in the content of the two images, the electronic device can determine that there is a motion area in the image. In some embodiments, a repeatability threshold can be preset. For example, when the repeatability of the content in the two images is greater than or equal to the repeatability threshold, the electronic device can determine that there is no motion area in the image. For example, when the repeatability of the content in the two images is less than the repeatability threshold, the electronic device can determine that there are significant changes in the content of the image and determine that there is a motion area in the image. It should be understood that the embodiments of the present application do not limit the method for determining the motion area based on two images, and the above is only an example for illustration.
[0114] S404, when there is a motion area in the image, adjust the second exposure duration to be less than the first exposure duration.
[0115] When there is a motion area in the image, in order to ensure the clarity of the image, the electronic device can adjust the second exposure duration to be less than the first exposure duration.
[0116] In some embodiments, the second exposure duration can be less than the stroboscopic period.
[0117] In some embodiments, when there is a motion area in the image, the electronic device can adjust the second exposure duration based on two adjacent images obtained by exposure with the first exposure duration, in combination with the motion speed of the motion area and / or the ambient brightness. Exemplarily, the greater the motion speed, the shorter the second exposure duration, and the greater the ambient brightness, the shorter the second exposure duration. In the embodiments of the present application, a mapping relationship between the motion speed and / or the ambient brightness and the second exposure duration can be pre-configured in the electronic device. The electronic device can adjust the second exposure duration based on two adjacent images obtained by exposure with the first exposure duration, in combination with the motion speed and / or the ambient brightness of the motion area, and the mapping relationship, wherein the second exposure duration is less than the first exposure duration.
[0118] Herein, the ambient brightness can be determined by a sensor (brightness sensor) configured in the electronic device, or the electronic device can determine it based on the image.
[0119] It should be understood that when there is no moving area in the image, since the electronic device does not need to capture a dynamically high-definition image, the electronic device can directly execute S405 without adjusting the second exposure duration.
[0120] S405. In the preview mode, the electronic device acquires an image using the first exposure mode.
[0121] Based on the settings of the above steps, in the preview mode, the electronic device can acquire an image using the first exposure mode. Among them, the first exposure mode means alternating exposure according to the first exposure duration and the second exposure duration. The first exposure duration is an integer multiple of the strobe period of the strobe light source in the environment where the electronic device is located, and the second exposure duration is less than the first exposure duration.
[0122] Among them, the first image can be obtained by exposing according to the first exposure duration, and the second image can be obtained by exposing according to the second exposure duration. Since the electronic device alternates exposure according to the first exposure duration and the second exposure duration, in the preview mode, the electronic device can acquire at least one first image and at least one second image. Exemplarily, the electronic device can sequentially acquire the first image 1, the second image 1, the first image 2, the second image 2, and so on.
[0123] In some embodiments, the electronic device can store at least one first image and at least one second image. For example, the electronic device can store at least one first image and at least one second image acquired in the memory buffer.
[0124] S406. Display the first image.
[0125] When the electronic device displays the first image, it can be understood that the electronic device can display at least one first image according to the screen refresh frequency.
[0126] Since the first exposure duration is an integer multiple of the strobe period, there are no stripes in the first image obtained by exposing according to the first exposure duration. In the embodiments of the present application, in the preview mode, the electronic device can display the first image. In this way, in the preview interface, the electronic device displays the first image, and the stroboscopic phenomenon can be avoided, and the user will not see stripes.
[0127] Exemplarily, taking the electronic device displaying the first image as an example, referring to Figure 5 a in, the image displayed in the preview frame 31 is the first image, and there are no stripes on the first image.
[0128] S407. Receive a photographing instruction, eliminate the stripes in the second image according to the stripe information in the second image, and obtain a processed second image. The stripe information in the second image is obtained based on the first image and the second image.
[0129] The photographing instruction is used to instruct the electronic device to capture an image.
[0130] In some embodiments, the second exposure duration is less than the first exposure duration. The second exposure duration can be an integer multiple of the stroboscopic period or not an integer multiple of the stroboscopic period. Exemplarily, the first exposure duration is 2 times the stroboscopic period, and the second exposure duration is less than the first exposure duration. For example, the second exposure duration is 1 times the stroboscopic period.
[0131] Among them, when the second exposure duration is an integer multiple of the stroboscopic period, there are no stripes in the second image obtained by exposing according to the second exposure duration. And because the second exposure duration is less than the first exposure duration, the second image obtained by exposing according to the second exposure duration can capture an image with high clarity. In this example, when the electronic device receives the photographing instruction, it may not execute the step of "eliminating the stripes in the second image according to the stripe information in the second image" in S407, but directly display the second image. Exemplarily, the second image can be the second image closest to the received photographing instruction.
[0132] It should be understood that the solution where the second exposure duration is an integer multiple of the stroboscopic period in the embodiments of the present application will not be elaborated. Hereinafter, an example will be given with "the first exposure duration is an integer multiple of the stroboscopic period, the second exposure duration is less than the first exposure duration, and the second exposure duration is not an integer multiple of the stroboscopic period".
[0133] In some embodiments, when the second exposure duration is not an integer multiple of the stroboscopic period, there are stripes in the second image obtained by exposing according to the second exposure duration. In addition, because the second exposure duration is less than the first exposure duration, the second image obtained by exposing according to the second exposure duration can capture an image with high clarity, and the clarity of the second image is higher than that of the first image. Therefore, when the electronic device responds to the photographing instruction, it can first eliminate the stripes in the second image to obtain a processed second image, and then display the processed second image, which can ensure that the electronic device can display an image with higher clarity and improve the user experience.
[0134] In the embodiments of the present application, the electronic device can eliminate the stripes in the second image according to the stripe information in the second image to obtain a processed second image. Among them, the stripe information in the second image is obtained based on the first image and the second image.
[0135] In some embodiments, the first image and the second image used to obtain the information of the stripes in the second image can be understood as: the first image and the second image obtained by the electronic device through one exposure with a first exposure duration and a second exposure duration. In some embodiments, to ensure the real-time performance of shooting, the first image and the second image used to obtain the information of the stripes in the second image can be understood as: within a preset range from the target moment, the first image and the second image obtained by the electronic device through one exposure with a first exposure duration and a second exposure duration. It should be understood that the target moment is the moment when the electronic device receives the photographing instruction.
[0136] In some embodiments, because of the interleaved exposure with the first exposure duration and the second exposure duration, at least one first image and at least one second image can be obtained. In response to the photographing instruction, the electronic device can select a set of the first image and the second image that is closest to the target moment in the memory buffer. In this set of the first image and the second image that is closest to the target moment, the first image can be called the target first image, and the second image can be called the target second image. In other words, the target first image is the first image that is closest to the target moment among at least one first image, and the target second image is the second image that is closest to the target moment among at least one second image.
[0137] In this example, S407 can be replaced with: receiving the photographing instruction, eliminating the stripes in the target second image according to the information of the stripes in the target second image, and obtaining the processed target second image, where the information of the stripes is obtained based on the target first image and the target second image. Correspondingly, S408 can be replaced with: displaying the processed target second image.
[0138] In some embodiments, the electronic device can compare each pixel in the first image and the second image, determine the target pixels containing stripes, and use the positions of the target pixels as the positions of the stripes. In this example, the information of the stripes can include the positions of the stripes.
[0139] Since the first image does not contain stripes, in some embodiments, the electronic device can replace the pixels at the positions of the stripes in the first image with the corresponding pixels in the second image to eliminate the stripes in the second image. Additionally, because the clarity of the second image and the first image is different, in some embodiments, the electronic device can perform upsampling on the part of the pixels replaced in the second image to improve the clarity at the replacement positions.
[0140] In some embodiments, the electronic device can also perform stripe detection by using Method 1 or Method 2 in the following embodiments. Stripe detection can be understood as: obtaining the information of the stripes in the second image based on the first image and the second image, and specifically, reference can be made to the description in the embodiment of Figure 6 - FIG. 9.
[0141] S408. Display the processed second image.
[0142] In some embodiments, after the electronic device obtains the processed second image, it can directly display the processed second image. In some embodiments, after the electronic device obtains the processed second image, it can display a thumbnail of the processed second image. When the user clicks on the thumbnail, the electronic device can display the processed second image.
[0143] Refer to Figure 5 b in [reference], when the user operates the photographing button 32, the electronic device can execute S407. When the electronic device obtains the processed second image, the electronic device can display a thumbnail of the processed second image in the thumbnail display frame 33. When the user clicks on the thumbnail display frame 33, the electronic device can display the processed second image, as shown in Figure 5 c in [reference]. It should be understood that in the embodiments of the present application, in order to indicate that the clarity of the second image is higher than that of the first image, different transparencies can be used to represent the first image and the second image. For example, the transparency of the first image is higher than that of the second image, which is used to indicate that the clarity of the first image is lower than that of the second image.
[0144] In the embodiments of the present application, in the preview mode, when the electronic device detects a stroboscopic light source, it can adjust the first exposure duration to an integer multiple of the stroboscopic period of the stroboscopic light source. And when the electronic device determines that there is a moving area based on the two images obtained by exposing according to the first exposure duration, the electronic device can adjust the second exposure duration to be less than the first exposure duration. Among them, the electronic device can obtain the first image by exposing according to the first exposure duration. Since the first exposure duration is an integer multiple of the stroboscopic period of the stroboscopic light source, there are no stripes in the first image. The second image can be obtained by exposing according to the second exposure duration. Since the second exposure duration is less than the first exposure duration, the clarity of the second image is higher than that of the first image.
[0145] In the preview mode, the electronic device displays the first image, which can avoid the stroboscopic phenomenon. There are no stripes on the preview image, which can improve the quality of the preview image. When the user triggers the electronic device to take a photo, when the second exposure duration is an integer multiple of the stroboscopic period, the electronic device can display the second image, and there are no stripes in the second image. When the second exposure duration is not an integer multiple of the stroboscopic period, the electronic device can eliminate the stripes in the second image according to the stripe information in the second image, and display the processed second image. On the one hand, since the stripes in the second image are eliminated, the user cannot see the stripes in the captured image. On the other hand, since the second exposure duration is less than the first exposure duration, the clarity of the second image is high, which can ensure the clarity of the image and improve the quality of the captured image.
[0146] Taking the target first image and the target second image as examples, the method of "the electronic device eliminates the stripes in the target second image according to the information of the stripes in the target second image" will be introduced in detail below. Specifically, it can refer to the following Method 1 and Method 2:
[0147] Method 1
[0148] Figure 6 This is another schematic flowchart of the image processing method provided by the embodiments of the present application. Refer to Figure 6 , the image processing method provided by the embodiments of the present application may include:
[0149] S601. In the preview mode, collect an image in the first exposure mode.
[0150] S602. Display the first image.
[0151] S601-S602 can refer to the descriptions in S405-S406.
[0152] S603. Receive a photographing instruction, input the target first image and the target second image into the stripe detection model, and obtain the information of the stripes in the target second image.
[0153] The stripe detection model is trained based on the first positive samples and the first negative samples. The first positive samples include the first image and the second image under different stroboscopic light sources, and the first negative samples include the first image and the second image when there is no stroboscopic light source. In some embodiments, the electronic device may train the stripe detection model based on the first positive samples and the first negative samples, or the training device may train the stripe detection model based on the first positive samples and the first negative samples, and configure the stripe detection model in the electronic device. Taking the training device as an example below, the process of training the stripe detection model will be briefly described:
[0154] Exemplarily, different stroboscopic light sources may include but are not limited to: lighting devices with different brightness, colors, and environments. Different environments may include, for example: home environment, stadium environment, factory environment, stage environment, photography studio environment, etc. Under different stroboscopic light sources, the test device may collect images in the first exposure mode to obtain at least one first image and at least one second image, and the at least one first image and the at least one second image may be used as the first positive samples. It should be understood that when the test device collects images in the first exposure mode, the first exposure duration therein is an integer multiple of the stroboscopic period of the stroboscopic light source where the test device is located, the second exposure duration is less than the first exposure duration, and is not an integer multiple of the stroboscopic period. Similarly, in an environment without a stroboscopic light source, the test device may collect images in the first exposure mode to obtain at least one first image and at least one second image, and the at least one first image and the at least one second image may be used as the first negative samples.
[0155] It should be understood that the first image and the second image in the first positive sample and the first negative sample can be referred to as test images.
[0156] The training device can input the first positive sample and the first negative sample into the initial network model for training to obtain a stripe detection model, which is used to output the information of the stripes in the second image. In some embodiments, the initial network model may include, but is not limited to, a recurrent neural network (RNN) and a convolutional neural network (CNN). The embodiments of the present application will not elaborate on the training process, and reference can be made to the current model training process.
[0157] In some embodiments, when the stripe detection model detects stripes, it can also output the type of the stripes, and the type of the stripes may include, but is not limited to, light stripes, black stripes, and colored stripes. In this example, the first positive sample may include the first image and the second image containing different types of stripes under different stroboscopic light sources, and the first negative sample includes the first image and the second image when there is no stroboscopic light source.
[0158] S604. Process the target second image according to the energy gain map to obtain the processed target second image.
[0159] In some embodiments, the information of the stripes in the target second image may be an energy gain map (gain map). Among them, the energy gain map is used to characterize the fluctuation of the energy introduced by the stroboscopic light source in the target second image. Or, the energy gain map can be understood as the ratio of the energy introduced by the stroboscopic light source before and after the energy fluctuation, and the ratio of the energy before and after the fluctuation can be represented by the gain (gain value) in the gain map.
[0160] In the embodiments of the present application, the stripes in the target second image can be regarded as an embodiment of the energy fluctuation caused by the introduction of the stroboscopic light source. Since it is known that "the result after the energy fluctuation caused by the introduction of the stroboscopic light source, that is, the target second image", in some embodiments, the electronic device can calculate the image before the introduction of the stroboscopic light source, that is, the processed target second image (the target second image not affected by the energy fluctuation), according to the energy gain map (the ratio of the energy before and after the fluctuation) and the target second image. Specifically, the electronic device can calculate the energy corresponding to the target second image and the gain value of the corresponding pixel in the gain map to obtain the processed target second image.
[0161] In some embodiments, a first stripe elimination model may be configured in an electronic device. The first stripe elimination model is trained based on first training data, which may include: at least one first image, at least one second image collected by a test device using a first exposure mode under different stroboscopic light sources, and an energy gain map corresponding to each second image. The first stripe elimination model is used to output a processed target second image. The training process of the first stripe elimination model in the embodiments of the present application will not be elaborated.
[0162] In this example, after the electronic device obtains the information of the stripes in the target second image, that is, the energy gain map corresponding to the target second image, the electronic device may input the target first image, the target second image, and the energy gain map corresponding to the target second image into the first stripe elimination model, and the first stripe elimination model may output a processed target second image.
[0163] S605. Display the processed target second image.
[0164] S605 may refer to the description in S408.
[0165] Figure 7A For Figure 6 is a simplified flowchart of stripe detection. Refer to Figure 7A , in order to improve the image processing speed, the electronic device may first perform downsampling processing on the target first image and the target second image. After the downsampling processing, the processed target first image and target second image may be input into a stripe detection model, and the stripe detection model may output an energy gain map corresponding to the target second image, which is caused by the stroboscopic light source.
[0166] In some embodiments, the stripe detection model may perform downsampling processing on the target first image and the target second image, so that the electronic device only needs to input the target first image and the target second image into the stripe detection model, without pre-downsampling the target first image and the target second image.
[0167] In some embodiments, the Figure 7A shown detection method may be referred to as stripe detection.
[0168] To facilitate the understanding of the screen detection method in the following embodiments, the screen detection method is introduced here:
[0169] In some embodiments, a screen detection model may be configured in an electronic device. The screen detection model is used to detect a stroboscopic screen. The screen detection model is trained based on second positive samples and second negative samples. The second positive samples include a first image and a second image when there is a stroboscopic screen. The second negative samples include a first image and a second image when there is no stroboscopic screen, and a first image and a second image when there is an object similar to the screen.
[0170] In some embodiments, the electronic device may train a screen detection model based on the second positive samples and the second negative samples, or the training device may train a screen detection model based on the second positive samples and the second negative samples and configure the screen detection model in the electronic device. Taking the training device as an example, the process of training the screen detection model is briefly described below:
[0171] Exemplarily, the stroboscopic screen may include, but is not limited to, the screens of different electronic devices such as mobile phones and PADs, projection screens, etc. Under the condition that there is a stroboscopic screen, the test device may collect images in the first exposure mode to obtain at least one first image and at least one second image, and the at least one first image and at least one second image may be used as the second positive samples. It should be understood that the refresh period of the stroboscopic screen may be known. Correspondingly, when the test device collects images in the first exposure mode, the first exposure duration therein is an integer multiple of the refresh period of the stroboscopic screen, the second exposure duration is less than the first exposure duration, and is not an integer multiple of the refresh period.
[0172] Similarly, when there is no stroboscopic screen, the test device may collect images in the first exposure mode to obtain at least one first image and at least one second image, and the at least one first image and at least one second image may be used as the second negative samples. In addition, there are many types of screen-like objects in the actual scenario, that is, objects similar to the screen. In the embodiments of the present application, in order to improve the detection accuracy of the screen, when there is a screen-like object, the test device may also collect images in the first exposure mode to obtain at least one first image and at least one second image, and the at least one first image and at least one second image may be used as the second negative samples. Screen-like objects may be objects similar to the screen in terms of shape, brightness, etc., such as pillows, books, photo frames, and picture albums.
[0173] The training device may input the second positive samples and the second negative samples into an initial network model for training to obtain a screen detection model, and the screen detection model is used for the stroboscopic screen detection result. For example, the stroboscopic screen detection result may include: whether there is a stroboscopic screen in the target image, and the position of the stroboscopic screen when there is a stroboscopic screen.
[0174] Figure 7B For the flow schematic diagram of screen detection. Refer toFigure 7B To improve the processing speed of the image, the electronic device may first perform downsampling on the target first image and the target second image. After the downsampling, the processed target first image and target second image may be input into the screen detection model. For example, the screen detection model may output the position of the flickering screen in the target second image.
[0175] In some embodiments, the Figure 7B detection method shown may be referred to as screen detection.
[0176] Since the screen detection model is trained based on the characteristics of the flickering screen (such as flickering stripes), in some embodiments, the screen detection model can be regarded as a model for detecting stripes (the stripes in the flickering screen). In some embodiments, the stripe detection model and the screen detection model may be integrated together, and the integrated model may be referred to as a stripe detection classification model. The stripe detection classification model is used to detect stripes and output corresponding detection results based on the source of the stripes.
[0177] Referring to Figure 7C , the electronic device inputs the processed target first image and target second image into the stripe detection classification model. The stripe detection classification model can identify the stripe detection classification model of the stripes and output results based on the stripe detection classification model of the stripes. Among them, the source of the stripes may include: a flickering light source, a flickering screen. When the source of the stripes is a flickering light source, the detection results output by the stripe detection classification model may include: the energy gain map corresponding to the target second image. When the source of the stripes is a flickering screen, the detection results output by the stripe detection classification model may include: the position of the flickering screen.
[0178] In some embodiments, the Figure 7C detection method shown may be referred to as "stripe detection + screen detection".
[0179] Method 2
[0180] Figure 8A This is another schematic flowchart of the image processing method provided by the embodiments of the present application. Referring to Figure 8A , the image processing method provided by the embodiments of the present application may include:
[0181] S801, in the preview mode, acquire an image in the first exposure mode.
[0182] S802, display the first image.
[0183] S801 - S802 may refer to the description in S405 - S406.
[0184] S803. Receive a photographing instruction and divide the target first image and the target second image into corresponding N regions, where N is an integer greater than or equal to 1.
[0185] In the embodiments of the present application, the electronic device can divide the target first image and the target second image into corresponding N regions, and detect the information of the stripes in the target second image based on the information in the corresponding N regions in the target first image and the target second image. In some embodiments, taking the target first image as an example, the sizes of the N regions can be equal or unequal.
[0186] Exemplarily, referring to Figure 8B , the electronic device can divide the target first image into 9 regions of 3 rows and 3 columns with equal sizes, namely region 1 - region 9. The electronic device divides the target second image into 9 regions of 3 rows and 3 columns with equal sizes, namely region 1A - region 9A, according to the same division rule as the target first image. Among them, region 1 - region 9 and region 1A - region 9A correspond to each other one by one. In other words, the 9 regions in the target first image correspond to the 9 regions in the target second image.
[0187] S804. Divide into RGB channels, and obtain the first information of each region in the target first image and the second information of each region in the target second image.
[0188] Taking the target first image as an example, the first information of each region in the target first image may include at least one of the following: the mean, variance, and histogram of each channel in the RGB channels. Taking the target second image as an example, the second information of each region in the target second image may include at least one of the following: the mean, variance, and histogram of each channel in the RGB channels. The embodiments of the present application do not elaborate on the methods for obtaining the first information and the second information, and the existing methods can be referred to.
[0189] S805. Determine the information of the stripes in the target second image according to the first information and the second information.
[0190] The information of the stripes in the target second image may include: the type of the stripes and the position of the stripes. In some embodiments, the type of the stripes includes at least one of the following: light stripes, black stripes, and colored stripes.
[0191] In some embodiments, a stripe detection rule can be pre - configured in the electronic device. The electronic device can determine the information of the stripes in the target second image based on this stripe detection rule, the first information of each region in the target first image, and the second information of each region in the target second image.
[0192] In the embodiments of the present application, the stripe detection rule can be as follows:
[0193] When the difference between the first information and the second information of a channel in M regions is greater than or equal to the first threshold, determine that the type of the stripe is a light stripe. Here, M is an integer greater than or equal to 1 and less than or equal to the second threshold, and the second threshold is less than N. Exemplarily, taking the first information and the second information as variances and taking the B channel as an example of the channel, assuming the second threshold is 4, in the target first image and the target second image, when the differences in the variances of the B channel in 3 out of 9 regions are greater than or equal to the first threshold, the electronic device can determine that the type of the stripe is a light stripe.
[0194] When the difference between the first information and the second information of a channel in N regions is greater than or equal to the first threshold, determine that the type of the stripe is a black stripe. Exemplarily, taking the first information and the second information as variances and taking the B channel as an example of the channel, in the target first image and the target second image, when the differences in the variances of the B channel in all 9 regions are greater than or equal to the first threshold, the electronic device can determine that the type of the stripe is a dark stripe.
[0195] When the difference between the first information and the second information of each channel in M regions is greater than or equal to the first threshold, determine that the type of the stripe is a color stripe. Exemplarily, taking the first information and the second information as variances as an example, assuming the second threshold is 4, in the target first image and the target second image, when the differences in the variances of each channel in 3 out of 9 regions are greater than or equal to the first threshold, the electronic device can determine that the type of the stripe is a color stripe.
[0196] In addition, the electronic device can compare the target first image and the target second image to determine the position of the stripe.
[0197] In summary, the electronic device can obtain the information of the stripe in the target second image.
[0198] Figure 9A For Figure 8A is a simplified flowchart of medium stripe detection. Refer to Figure 9A , in order to improve the processing speed of the image, the electronic device can first perform downsampling processing on the target first image and the target second image. After the downsampling processing, the processed target first image and the target second image can be divided into corresponding N regions. The electronic device can obtain the first information of each region in the target first image and the second information of each region in the target second image by dividing the RGB channels. The electronic device compares the first information of each region in the target first image and the second information of each region in the target second image to obtain the information of the stripe.
[0199] In some embodiments, the Figure 9A shown detection method can be called stripe detection.
[0200] To facilitate the understanding of the screen detection method in the following embodiments, the method of screen detection is introduced here:
[0201] Since the stripes caused by the stroboscopic light source and the stripes caused by the stroboscopic screen have different manifestations. Among them, the stroboscopic light source can cause stripes in the global range of the image, while the stroboscopic screen will cause stripes in the local range of the image. In this embodiment, the electronic device can determine the source of the stripes and the information of the stripes according to the first information of each region in the target first image and the second information of each region in the target second image. The process of the electronic device determining the source of the stripes is described here:
[0202] Figure 9B FIG. is a schematic flow chart of stripe detection and screen detection. To improve the processing speed of the image, the electronic device can first perform downsampling processing on the target first image and the target second image. After the downsampling processing, the processed target first image and target second image can be divided into corresponding N regions. The electronic device can obtain the first information of each region in the target first image and the second information of each region in the target second image by dividing the RGB channels. The electronic device compares the first information of each region in the target first image with the second information of each region in the target second image. Among them, when the difference between the first information and the second information of the local region in the target first image and the target second image is greater than or equal to the first threshold, it is determined that there is a stroboscopic screen in the target second image. The size of the local region is smaller than the size of the target second image, and the local region is of a preset shape. Exemplarily, the preset shape can be the shape of the stroboscopic screen, such as a rectangle, an arc, a circle, a sphere, etc., and the embodiments of the present application do not limit this.
[0203] Similarly, referring to 9B, the electronic device can also compare the first information of each region in the target first image with the second information of each region in the target second image to determine the information of the stripes in the target second image.
[0204] In some embodiments, the Figure 9B shown detection method can be called stripe detection and screen detection.
[0205] S806, process the target second image according to the information of the stripes in the target second image to obtain the processed target second image.
[0206] In some embodiments, a stripe elimination model can be configured in an electronic device, and this stripe elimination model can be referred to as the second stripe elimination model. The second stripe elimination model is trained based on second training data, which can include: images with stripes and information about the stripes in the images. The second stripe elimination model is used to output a processed target second image. The training process of the second stripe elimination model in the embodiments of the present application will not be elaborated.
[0207] In this example, after the electronic device obtains the information about the stripes in the target second image, that is, the type and position of the stripes, the electronic device can input the target second image and the information about the stripes in the target second image into the second stripe elimination model, and the second stripe elimination model can output a processed target second image.
[0208] S807, display the processed target second image.
[0209] S807 can refer to the description in S408.
[0210] In the above example, methods for the electronic device to perform stripe detection and screen detection are introduced. There are various methods, all of which can identify the information about the stripes in the target second image to facilitate subsequent elimination of the stripes in the target second image. In addition, in the methods of Method 1 and Method 2, methods for identifying a stroboscopic screen (screen detection) are also introduced, which can effectively identify the stroboscopic screen in the target second image. In this example, the method for the electronic device to eliminate the stripes caused by the stroboscopic screen in the target second image can also refer to Figure 10 the description in
[0211] Solve Problem 2: Stroboscopic screen
[0212] In the above embodiments, methods for the electronic device to perform stripe detection and screen detection are described. In some embodiments, when there is a stroboscopic screen in the shooting scene, it will also cause stripes to appear in the preview and shooting images. The following embodiments introduce the method for the electronic device to process the stripes introduced by the stroboscopic screen.
[0213] Figure 10 This is another flowchart of the image processing method provided by the embodiments of the present application. Refer to Figure 10 , the image processing method provided by the embodiments of the present application can include:
[0214] S1001, detect whether there is a stroboscopic screen in the target second image according to the target first image and the target second image.
[0215] In some embodiments, the electronic device can execute S1001 after receiving a photographing instruction. In some embodiments, the electronic device can execute S1001 in the preview mode.
[0216] Among them, S1001 can refer to Figure 7B , Figure 7C , and Figure 9B the description of the screen detection method in. It should be understood that when the electronic device executes Figure 7C or Figure 9B the detection method in, the electronic device can perform stripe detection and screen detection simultaneously.
[0217] Exemplarily, when the electronic device executes Figure 7C the detection method in, the electronic device can input the target first image and the target second image after downsampling processing into the stripe detection classification model, and the stripe detection classification model can output a detection result according to the source of the stripe. Among them, when there is a stroboscopic screen in the target second image, the stripe detection classification model can output the position of the stroboscopic screen.
[0218] S1002, when there is a stroboscopic screen in the target second image, replace the area of the stroboscopic screen in the target second image with the area of the stroboscopic screen in the target first image.
[0219] In some embodiments, when there is a stroboscopic screen in the target second image, since the stroboscopic screen causes local stripes and there are no stripes in the target first image, the electronic device can replace the area of the stroboscopic screen in the target second image with the area of the stroboscopic screen in the target first image, so as to obtain a target second image without stripes.
[0220] In the embodiments of the present application, when there is a stroboscopic screen in the shooting scene, the electronic device can replace the area of the stroboscopic screen in the target second image with the area of the stroboscopic screen in the target first image to eliminate the stripes caused by the stroboscopic screen in the target second image.
[0221] In some embodiments, when there is a stroboscopic screen in the shooting scene, the electronic device can also adopt the method of "eliminating the stripes in the target second image based on the stripe information" in the above embodiments to eliminate the stripes caused by the stroboscopic screen in the target second image.
[0222] In some embodiments, when there is a stroboscopic light source and a stroboscopic screen in the shooting scene, the methods for solving Problem 1 and Problem 2 in the above embodiments can be combined to eliminate the stripes introduced by the stroboscopic light source and the stripes introduced by the stroboscopic screen.
[0223] Based on the image processing method introduced in the above embodiments, the following introduces the image processing method provided by the embodiments of the present application in combination with several possible implementation manners:
[0224] Implementation manner 1:
[0225] Figure 11Another flowchart of the image processing method provided by the embodiments of this application. Refer to Figure 11 , in the preview mode, the electronic device can perform stroboscopic light source detection to detect whether there is a stroboscopic light source in the environment where the electronic device is located. Among them, when there is a stroboscopic light source in the environment where the electronic device is located, the electronic device can adjust the first exposure duration, and specifically refer to the description in S402. In addition, the electronic device can also perform motion detection based on two adjacent images obtained by exposure with the first exposure duration, that is, determine whether there is a motion area in the image. Among them, when there is a motion area in the image, the electronic device can adjust the second exposure duration, and specifically refer to the description in S404.
[0226] In some embodiments, in the preview mode, the electronic device can also perform screen detection and stripe detection based on the first image obtained by exposure with the first exposure duration and the second image obtained by exposure with the second exposure duration, and can refer to the descriptions in Method 1 and Method 2 in the above embodiments. Among them, the first image and the second image can be the first image and the second image obtained by the electronic device each time it exposes with the first exposure duration and the second exposure duration, or, after several exposures at intervals, select a set of the first image and the second image obtained by exposure with the first exposure duration and the second exposure duration.
[0227] In some embodiments, in response to a shooting instruction, the electronic device can eliminate the stripes in the target second image according to the results of screen detection and stripe detection, and display the processed target second image, and specifically refer to the descriptions in Method 1 and Method 2 in the above embodiments.
[0228] In some embodiments, in response to a shooting instruction, the electronic device can determine how to display the image according to the motion detection result. Among them, when there is no motion area in the image, the electronic device can display the target first image. When there is a motion area in the image, for the clarity of the captured image, the electronic device can further determine how to display the image according to the results of screen detection and stripe detection. Among them, when there is a motion area in the image and the environment where the electronic device is located does not include stripes caused by a stroboscopic screen and a stroboscopic light source, the electronic device can display the target second image. When there is a motion area in the image and the environment where the electronic device is located includes a stroboscopic screen and / or stripes caused by a stroboscopic light source, the electronic device can eliminate the stripes in the target second image according to the results of screen detection and stripe detection, and display the processed target second image, and specifically refer to the descriptions in Method 1 and Method 2 in the above embodiments.
[0229] Implementation method 2:
[0230] Figure 12 Another flowchart of the image processing method provided by the embodiments of this application.Figure 12 The difference from Figure 11 is that after the electronic device receives a photographing instruction, the electronic device can perform screen detection and stripe detection based on the target first image and the target second image. Similarly, the electronic device can determine how to display an image according to the motion detection result, the screen detection result, and the stripe detection result, which can refer to the description in Figure 11 .
[0231] Figure 12 The advantage of the embodiment in is that there is no need to continuously perform screen detection and stripe detection in the preview mode, and screen detection and stripe detection can be performed when a photographing instruction is received (such as performing screen detection and stripe detection based on the target first image and the target second image), which can reduce the power consumption of the electronic device.
[0232] Implementation method three:
[0233] Figure 13 FIG. is another schematic flowchart of the image processing method provided by the embodiment of the present application. Figure 13 The difference from Figure 12 is that in the preview mode, the electronic device can perform screen detection by using the method in implementation method two, and after the electronic device receives a photographing instruction, the electronic device can perform screen detection again by using the method in implementation method one. Similarly, the electronic device can determine how to display an image according to the motion detection result, the screen detection result, and the stripe detection result, which can refer to the description in Figure 11 .
[0234] Figure 13 The advantage of the embodiment in is that the detection speed of implementation method two is faster than that of implementation method one. Screen detection can be quickly performed by using implementation method two in the preview mode. After receiving a photographing instruction, the electronic device can further perform screen detection and stripe detection by using implementation method one. On the one hand, double detection can ensure the accuracy of the screen detection result, and on the other hand, the results of screen detection and stripe detection can guide how the subsequent electronic device displays an image.
[0235] Implementation method four:
[0236] Figure 14 FIG. is another schematic flowchart of the image processing method provided by the embodiment of the present application. Figure 14 The difference from Figure 13 is that the electronic device can collect the attitude data of the electronic device, and the attitude data can include but are not limited to: data collected by an inertial measurement unit (IMU), acceleration data, gyroscope data, etc.
[0237] An electronic device can determine whether there is a hand shake phenomenon during shooting based on the attitude data of the electronic device. Among them, when there is a hand shake phenomenon, there will be a difference in the content of the first image obtained by exposing according to the first exposure time and the second image obtained by exposing according to the second exposure time. In the embodiments of the present application, in order to avoid the problem of inaccurate image preview and shooting display caused by hand shake, after receiving a photographing instruction, the electronic device can perform global registration on the target first image and the target second image.
[0238] Global registration can be understood as: determining the matching regions in the target first image and the target second image, and performing screen detection and stripe detection on this region. Among them, the matching regions in the target first image and the target second image can be understood as: regions with the same content. Similarly, the electronic device can determine how to display the image according to the motion detection result, the screen detection result, and the stripe detection result, which can be referred to Figure 11 in the description.
[0239] Figure 14 The advantages of the embodiments in
[0240] It should be understood that Figure 14 the method of performing global registration on the target first image and the target second image in Figures 11 - 12 can be applied to the method in Figure 14 which is described by taking Figure 13 as an example on the basis of
[0241] Implementation method five:
[0242] Figure 15 This is another flow schematic diagram of the image processing method provided by the embodiments of the present application. Figure 15 The difference from Figure 14 is that when the electronic device determines how to display the image according to the motion detection result, the screen detection result, and the stripe detection result, if there is a non-moving area in the target second image, the difference in clarity caused by the second exposure duration and the first exposure duration has little impact on the non-moving area. Therefore, when there are stripes in the target second image, the electronic device can replace the stripe area in the target second image with the corresponding area in the target first image.
[0243] Figure 15The advantages of the embodiments in [reference] are as follows: For the moving area and non-moving area in the target second image, the electronic device can adopt different methods to eliminate stripes. On the premise of improving the image quality, the clarity of the image can also be ensured.
[0244] It should be understood that Figure 15 in [reference], the method of adopting different methods to display images for the moving area and non-moving area in the target second image can be applied to Figures 11 - 14 the method in [reference], Figure 15 in [reference] taking Figure 14 as an example for illustration.
[0245] It should be noted that the data involved in this application (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data authorized by users or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0246] In one embodiment, the embodiments of this application also provide an electronic device. Referring to Figure 16 , the electronic device may include: a processor 1601 (such as a CPU) and a memory 1602. The memory 1602 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory. Various instructions can be stored in the memory 1602 to complete various processing functions and implement the method steps of this application.
[0247] Optionally, the electronic device involved in this application may further include: a power supply 1603, a communication bus 1604, and a communication port 1605. The above communication port 1605 is used to implement connection and communication between the electronic device and other peripherals. In the embodiments of this application, the memory 1602 is used to store computer-executable program code, and the program code includes instructions; when the processor 1601 executes the instructions, the instructions cause the processor 1601 of the electronic device to execute the actions in the above method embodiments, and its implementation principle and technical effects are similar and will not be elaborated here.
[0248] Optionally, the electronic device may further include a display screen 1606, and the display screen 1606 is used to display the interface of the electronic device. For example, in the preview mode, the display screen 1606 can display the first image, and when the electronic device receives a photographing instruction, the display screen 1606 can also display the processed target second image.
[0249] It should be noted that the modules or components described in the above embodiments may be one or more integrated circuits configured to implement the above methods. For example: one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code, such as a controller. Again, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0250] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
[0251] The term "a plurality of" in this document refers to two or more. The term "and / or" in this document is merely a description of the associated relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, in this document, the character " / " generally indicates that the associated objects before and after are in an "or" relationship; in a formula, the character " / " indicates that the associated objects before and after are in a "division" relationship. Furthermore, it should be understood that in the description of this application, terms such as "first" and "second" are only used for the purpose of distinguishing descriptions, and should not be construed as indicating or implying relative importance, nor as indicating or implying an order.
[0252] It can be understood that the various numerical numbers involved in the embodiments of this application are only for the convenience of description and are not used to limit the scope of the embodiments of this application.
[0253] It can be understood that in the embodiments of this application, the magnitudes of the sequence numbers of the above processes do not mean the sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
Claims
1. An image processing method, characterized in that, applied to an electronic device, the method includes: In the preview mode, collect images in a first exposure mode, where the first exposure mode means alternating exposure according to a first exposure duration and a second exposure duration. The first exposure duration is an integer multiple of the stroboscopic period of the stroboscopic light source in the environment where the electronic device is located, and the second exposure duration is less than the first exposure duration. Among them, a first image is obtained by exposing according to the first exposure duration, and a second image is obtained by exposing according to the second exposure duration; Display the first image; Receive a photographing instruction, and according to the information of the stripes in the second image, eliminate the stripes in the second image to obtain a processed second image. The information of the stripes is obtained based on the first image and the second image; Display the processed second image.
2. The method according to claim 1, characterized in that, before collecting images in the first exposure mode, it further includes: Receive an instruction to run the camera application, and detect whether there is a stroboscopic light source in the environment; If so, adjust the first exposure duration to an integer multiple of the stroboscopic period of the stroboscopic light source; Determine whether there is a moving area in the image according to two adjacent images obtained by exposing according to the first exposure duration; If so, adjust the second exposure duration to be less than the first exposure duration.
3. The method according to claim 1 or 2, characterized in that, The first exposure duration and the second exposure duration are alternately exposed to obtain at least one first image and at least one second image; the method further includes: According to the target first image and the target second image, determine the information of the stripes in the target second image. The target first image is the first image closest to the target time among the at least one first image, and the target second image is the second image closest to the target time among the at least one second image. The target time is the time when the photographing instruction is received; The step of eliminating the stripes in the second image according to the information of the stripes in the second image to obtain a processed second image includes: Eliminate the stripes in the target second image according to the information of the stripes in the target second image to obtain a processed target second image; The step of displaying the processed second image includes: Display the processed target second image.
4. The method according to claim 3, characterized in that, The step of determining the information of the stripes in the target second image according to the target first image and the target second image includes: Input the target first image and the target second image into a stripe detection model to obtain the information of the stripes in the target second image. The stripe detection model is trained based on a first positive sample and a first negative sample. The first positive sample includes the first image and the second image under different stroboscopic light sources, and the first negative sample includes the first image and the second image when there is no stroboscopic light source.
5. The method according to claim 4, characterized in that, The information of the stripes is an energy gain map, and the energy gain map is used to characterize the fluctuation of the energy introduced by the stroboscopic light source in the target second image; Eliminating the stripes in the target second image according to the information of the stripes in the target second image to obtain a processed target second image includes: Processing the target second image according to the energy gain map to obtain the processed target second image.
6. The method according to claim 3, wherein, Determining the information of the stripes in the target second image according to the target first image and the target second image includes: Dividing the target first image and the target second image into corresponding N regions, where N is an integer greater than or equal to 1; Obtaining first information of each region in the target first image and second information of each region in the target second image by dividing RGB channels; Determining the information of the stripes in the target second image according to the first information and the second information.
7. The method according to claim 6, wherein, The first information and the second information include at least one of the following: the mean, variance, and histogram of each channel in the RGB channels, and the information of the stripes includes: the type of the stripes and the position of the stripes.
8. The method according to claim 6 or 7, wherein, The types of the stripes include at least one of the following: light stripes, black stripes, and colored stripes; determining the information of the stripes in the target second image according to the first information and the second information includes: When the difference between the first information and the second information of one channel in M regions is greater than or equal to a first threshold, determining that the type of the stripes is light stripes, where M is an integer greater than or equal to 1 and less than or equal to a second threshold, and the second threshold is less than N; When the difference between the first information and the second information of one channel in N regions is greater than or equal to the first threshold, determining that the type of the stripes is black stripes; When the difference between the first information and the second information of each channel in the M regions is greater than or equal to the first threshold, determining that the type of the stripes is colored stripes.
9. The method according to any one of claims 6-8, wherein, Eliminating the stripes in the target second image according to the information of the stripes in the target second image to obtain a processed target second image includes: Inputting the information of the stripes in the target second image and the target second image into a stripe elimination model to eliminate the stripes in the target second image to obtain the processed target second image, and the stripe elimination model is trained based on training data, and the training data includes images with stripes and the information of the stripes in the images.
10. The method according to any one of claims 3-9, wherein, The method further includes: Detecting whether there is a stroboscopic screen in the target second image according to the target first image and the target second image; If so, replace the area of the stroboscopic screen in the target second image with the area of the stroboscopic screen in the target first image.
11. The method according to claim 10, wherein, detecting whether there is a stroboscopic screen in the target second image according to the target first image and the target second image includes: inputting the target first image and the target second image into a screen detection model to obtain a stroboscopic screen detection result, the stroboscopic screen detection result including whether there is a stroboscopic screen and the position of the stroboscopic screen, the screen detection model being trained based on second positive samples and second negative samples, the second positive samples including a first image and a second image when there is a stroboscopic screen, and the second negative samples including a first image and a second image when there is no stroboscopic screen, and a first image and a second image when there is an object similar to the screen.
12. The method according to claim 10, wherein, detecting whether there is a stroboscopic screen in the target second image according to the target first image and the target second image includes: detecting whether there is a stroboscopic screen in the target second image according to first information and second information.
13. The method according to claim 12, wherein, detecting whether there is a stroboscopic screen in the target second image according to first information and second information includes: when the difference between the first information and the second information in a local area of the target first image and the target second image is greater than or equal to a first threshold, determining that there is a stroboscopic screen in the target second image.
14. The method according to any one of claims 3-9, wherein, before determining the information of the stripes in the target second image according to the target first image and the target second image, it includes: performing global registration on the target first image and the target second image according to the attitude data of the electronic device.
15. An electronic device, wherein, it includes: a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, so that the processor executes the method according to any one of claims 1-14.
16. A computer-readable storage medium, wherein, the computer-readable storage medium stores a computer program or instructions, and when the computer program or instructions are run, the method according to any one of claims 1-14 is implemented.