Image processing method and related device

By acquiring and merging multiple frames of low dynamic range images, the problem of poor high dynamic range image effects of electronic equipment when shooting moving target objects is solved, and a more natural and high-quality image effect is achieved.

CN117793544BActive Publication Date: 2024-10-15HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410217098.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-28
Publication Date
2024-10-15
Estimated Expiration
2044-02-28

AI Technical Summary

Technical Problem

When shooting high dynamic range images, when electronic equipment uses multiple frames of low dynamic range images to synthesize high dynamic range images, the effect is not good when there are moving target objects, resulting in low quality of the synthesized image, especially the phenomenon of 'ghosting'.

Method used

By acquiring multiple frames of low dynamic range images with different exposure levels, the reference image and optical flow information are determined, the position of the target object is inferred, the inferred image is generated, and the key image is fused with the reference image to improve the quality of the high dynamic range image.

Benefits of technology

Improves the effect of high dynamic range images, reduces 'ghosting' phenomena, and enhances the naturalness and quality of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117793544B_ABST
    Figure CN117793544B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method and related devices. The method can be implemented by first acquiring multiple frames of low dynamic range images with different exposure levels; then determining a reference image from the multiple frames of low dynamic range images; then determining the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images; based on the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images, inferring the position of the target object in multiple frames of non-reference images in the multiple frames of low dynamic range images at the corresponding shooting time of the reference image; moving the target object in the non-reference image to the position at the corresponding shooting time of the reference image to obtain multiple frames of inferred images; determining the first key image and the second key image from the multiple frames of inferred images; fusing the first key image, the second key image and the reference image into a high dynamic range image. In this way, the effect of the synthesized high dynamic range image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and related devices. Background Art

[0002] With the continuous development of electronic devices, more and more users like to use electronic devices to capture images. When capturing high dynamic range images, electronic devices usually use multiple frames of low dynamic range (LDR) images to synthesize high dynamic range (HDR) images. However, when there are moving objects in the captured scene, the effect of synthesizing high dynamic range images using multiple frames of low dynamic range images is not good. Summary of the invention

[0003] The present application provides an image processing method and related devices, which can realize the synthesis of a high dynamic range image through multiple frames of low dynamic range images, thereby improving the effect of the synthesized high dynamic range image.

[0004] In a first aspect, the present application provides an image processing method, which is applied to an electronic device, wherein the electronic device includes a camera, and the method includes: acquiring, by the camera, a plurality of frames of low dynamic range images with different exposure levels in a sequence of shooting time; determining a reference image from the plurality of frames of low dynamic range images; determining optical flow information between images with adjacent shooting times in the plurality of frames of low dynamic range images; based on the optical flow information between images with adjacent shooting times in the plurality of frames of low dynamic range images, inferring a position of a target object in a plurality of non-reference images in the plurality of frames of low dynamic range images at a shooting time corresponding to the reference image, the non-reference image being different from the reference image; and based on the target object The position of the object in multiple non-reference images of the multiple low dynamic range images at the time of shooting corresponding to the reference image is determined, and the target object in the non-reference image is moved to the position at the time of shooting corresponding to the reference image to obtain multiple inferred images; a first key image and a second key image are determined from the multiple inferred images, and the position of the target object in the non-reference image corresponding to the first key image does not overlap with the position of the target object in the non-reference image corresponding to the second key image; the first key image, the second key image and the reference image are fused into a high dynamic range image, and the brightness range of the high dynamic range image is wider than the brightness range of the low dynamic range image.

[0005] The present application provides an image processing method that can determine a reference image, a first key image, and a second key image from multiple frames of low dynamic range images, and fuse them into a high dynamic range image based on the reference image, the first key image, and the second key image. In this way, by finding the optimal reference image, the first key image, and the second key image, the fused high dynamic range image can have a better effect.

[0006] In a possible implementation, the multiple frames of low dynamic range images include multiple frames of high exposure images and multiple frames of low exposure images, and the exposure level of the high exposure image is greater than the exposure level of the low exposure image.

[0007] In a possible implementation, the method further includes: determining the exposure values ​​of the multiple frames of low dynamic range images; determining the lowest exposure image with the lowest exposure value from the multiple frames of low dynamic range images; aligning the brightness of the multiple frames of high exposure images with the lowest exposure image; and determining a reference image from the multiple frames of low dynamic range images, specifically including: determining the reference image from the multiple frames of high exposure images with brightness alignment. In this way, aligning the brightness of the multiple frames of high exposure images with the lowest exposure image can improve the quality of the high exposure image and facilitate the subsequent calculation of the optical flow information between adjacent frames of the image, and the reference image determined from the brightness aligned multiple frames of high exposure images has more detail information and less noise.

[0008] In a possible implementation, the method further includes: aligning the multiple low-exposure images and the multiple high-exposure images after brightness alignment to the reference image as a whole. In this way, aligning the multiple low-exposure images and the multiple high-exposure images after brightness alignment to the reference image as a whole can reduce the amount of calculation and time of subsequent algorithms, such as image fusion algorithms.

[0009] In a possible implementation, determining the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images specifically includes: determining the optical flow information between images with adjacent shooting times in the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment. In this way, by determining the optical flow information between images with adjacent shooting times in the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment, it is convenient to subsequently infer the position of the target object in the multiple frames of non-reference images at the shooting time corresponding to the reference image.

[0010] In a possible implementation, based on the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images, the position of the target object in multiple frames of non-reference images in the multiple frames of low dynamic range images at the shooting time corresponding to the reference image is inferred, specifically including: based on the optical flow information between images with adjacent shooting times in the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment, the position of the target object in the multiple frames of non-reference images at the shooting time corresponding to the reference image is inferred; wherein the multiple frames of non-reference images include the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment.

[0011] In a possible implementation, based on the optical flow information between the images with adjacent shooting times in the multiple low-exposure images after overall alignment and the multiple high-exposure images after brightness alignment and overall alignment, the position of the target object in the multiple non-reference images at the shooting time corresponding to the reference image is inferred, specifically including: based on the optical flow information between the images with adjacent shooting times in the multiple low-exposure images after overall alignment and the multiple high-exposure images after brightness alignment and overall alignment, the position of the target object in the multiple non-reference images at the shooting time corresponding to the reference image is inferred by a Kalman filter algorithm. In this way, the position of the target object in the multiple non-reference images at the shooting time corresponding to the reference image inferred by the Kalman filter algorithm can be more accurate.

[0012] In a possible implementation manner, brightness alignment of the multiple frames of high-exposure images to the minimum-exposure image specifically includes: dividing exposure values ​​of the multiple frames of high-exposure images by the exposure value of the minimum-exposure image.

[0013] In a possible implementation manner, the multiple frames of low dynamic range images with different exposure levels include multiple frames of low dynamic range images with K exposure levels, where K is a positive integer greater than 2.

[0014] In a possible implementation, the method further includes: determining a brightness distribution histogram of the multiple low dynamic range images, the brightness distribution histogram being used to indicate the distribution of the brightness level and the number of pixels of the low dynamic range images; and determining a reference image from the multiple low dynamic range images, specifically including: determining the reference image with the most uniform brightness distribution from the multiple low dynamic range images based on the brightness distribution histogram of the multiple low dynamic range images. In this way, the reference image with the most uniform brightness distribution determined from the multiple low dynamic range images has better detail information.

[0015] In a possible implementation, the method further includes: determining the exposure values ​​of the multiple frames of low dynamic range images; determining the lowest exposure image with the lowest exposure value from the multiple frames of low dynamic range images; and aligning the brightness of multiple frames of non-lowest exposure images in the multiple frames of low dynamic range images to the lowest exposure image, wherein the multiple frames of non-lowest exposure images include the reference image and are different from the lowest exposure image. In this way, aligning the brightness of multiple frames of non-lowest exposure images to the lowest exposure image can improve the quality of multiple frames of non-lowest exposure images and facilitate the subsequent calculation of optical flow information between adjacent frames of the image.

[0016] In a possible implementation, the method further includes: aligning the multiple frames of non-minimum exposure images after aligning the minimum exposure image with the brightness with the reference image as a whole. In this way, aligning the multiple frames of non-minimum exposure images after aligning the minimum exposure image with the brightness with the reference image as a whole can reduce the amount of calculation and time of subsequent algorithms, such as image fusion algorithms.

[0017] In a possible implementation, determining the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images specifically includes: determining the optical flow information between the images with adjacent shooting times in the minimum exposure image after overall alignment and the multiple frames of non-minimum exposure images after brightness alignment and overall alignment. In this way, by determining the optical flow information between the images with adjacent shooting times in the minimum exposure image after overall alignment and the multiple frames of non-minimum exposure images after brightness alignment and overall alignment, it is convenient to subsequently infer the position of the target object in the multiple frames of non-reference images at the shooting time corresponding to the reference image.

[0018] In a possible implementation, the position of the target object in multiple non-reference images in the multiple low dynamic range images at the shooting time corresponding to the reference image is inferred based on the optical flow information between images with adjacent shooting times in the multiple low dynamic range images, specifically including: inferring the position of the target object in the multiple non-reference images at the shooting time corresponding to the reference image based on the optical flow information between images with adjacent shooting times in the multiple non-minimum exposure images after overall alignment and brightness alignment and overall alignment; wherein the multiple non-reference images include the minimum exposure image after overall alignment and the multiple non-minimum exposure images after brightness alignment and overall alignment.

[0019] In a possible implementation, the position of the target object in the multiple non-reference images at the time of shooting corresponding to the reference image is inferred based on the optical flow information between the images with adjacent shooting times in the minimum exposure image after overall alignment and the multiple non-minimum exposure images after brightness alignment and overall alignment, specifically including: inferring the position of the target object in the multiple non-reference images at the time of shooting corresponding to the reference image through a Kalman filter algorithm based on the optical flow information between the images with adjacent shooting times in the minimum exposure image after overall alignment and the multiple non-minimum exposure images after brightness alignment and overall alignment. In this way, the position of the target object in the multiple non-reference images at the time of shooting corresponding to the reference image inferred by the Kalman filter algorithm can be more accurate.

[0020] In a possible implementation, brightness alignment is performed on multiple frames of non-minimum exposure images in the multiple frames of low dynamic range images to the minimum exposure image, specifically including: dividing exposure values ​​of multiple frames of non-minimum exposure images in the multiple frames of low dynamic range images by the exposure value of the minimum exposure image.

[0021] In a second aspect, the present application provides an electronic device comprising a camera, one or more processors and one or more memories; wherein the camera, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer instructions, so that when the one or more processors execute the computer instructions, the electronic device executes the method in any possible implementation of the above-mentioned first aspect.

[0022] In a third aspect, the present application provides a chip, which is applied to an electronic device, the electronic device comprising a processing circuit and an interface circuit, the interface circuit being used to receive instructions and transmit them to the processing circuit, the processing circuit being used to run the instructions to execute the method in any possible implementation of the first aspect above.

[0023] In a fourth aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute a method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0025] Figure 2A-2C A schematic diagram of a low dynamic range image and a high dynamic range image provided in an embodiment of the present application;

[0026] Figure 3 A flowchart of an image processing method provided in an embodiment of the present application;

[0027] Figure 4A-4C Provide reference images, non-reference images and inferred images for the embodiments of the present application;

[0028] Figure 5A-Figure 5B The first key image and the second key image provided in the embodiment of the present application;

[0029] Figure 6 A schematic diagram of image fusion provided in an embodiment of the present application;

[0030] Figure 7A-7C A schematic diagram of overall alignment of a group of images is provided for an embodiment of the present application;

[0031] Figure 8 A schematic diagram of a brightness distribution histogram provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0033] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0034] The following introduces the hardware structure of an electronic device provided in an embodiment of the present application.

[0035] Figure 1 A schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application is shown.

[0036] It should be understood that Figure 1 The electronic device 100 shown is only an example, and the electronic device 100 may have more Figure 1 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Figure 1 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0037] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a gyroscope sensor 180B, an acceleration sensor 180E, and a touch sensor 180K, etc.

[0038] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0039] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0040] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0041] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0042] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0043] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

[0044] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.

[0045] The modulation and demodulation processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.

[0046] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0047] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0048] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0049] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of 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), miniled, microled, micro-oled, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0050] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor. ISP is used to process data fed back by camera 193. Camera 193 is used to capture static images or videos. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn.

[0051] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121.

[0052] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0053] The audio module 170 is used to convert digital audio information into analog audio signal output, and also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals.

[0054] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0055] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0056] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.

[0057] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0058] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0059] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0060] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0061] The buttons 190 include a power button, a volume button, etc. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card.

[0062] In the embodiment of the present application, the device type of the electronic device 100 can be any one of a mobile phone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), and smart home devices such as smart large screens and smart speakers, wearable devices such as smart bracelets, smart watches, and smart glasses, extended reality (XR) devices such as augmented reality (AR), virtual reality (VR), and mixed reality (MR), vehicle-mounted devices or smart city devices, etc.

[0063] The following introduces some concepts in the image processing process involved in the embodiments of the present application.

[0064] (1) Low dynamic range images: The width of the brightness range of low dynamic range images is relatively narrow. For example, the brightness range of low-exposure images in low dynamic range images is 0 lux (lux) - 25000 lux (lux), and the brightness range of high-exposure images in low dynamic range images is 25000 lux (lux) - 40000 lux (lux). As a result, low dynamic range images cannot accurately restore the details of higher brightness areas and lower brightness areas in real scenes.

[0065] (2) High dynamic range images: The brightness range of high dynamic range images is relatively wide, for example, the brightness range of high dynamic range images is 0 lux (lux) - 40000 lux (lux). In this way, high dynamic range images can reflect more details in real scenes, including details in higher brightness areas and details in lower brightness areas.

[0066] (3) Fusion: A high dynamic range image can be synthesized from multiple low dynamic range images. When synthesizing a high dynamic range image from multiple low dynamic range images, it is necessary to shoot multiple low dynamic range images with different exposure levels for the same scene. In the process of shooting multiple low dynamic range images using the electronic device 100, due to the shaking of the electronic device 100 or the movement of the target object, the position of the same target object in the multiple low dynamic range images may be different. Therefore, the synthesized high dynamic range image may contain content that is not in the captured scene. For example, there is only one target object in the captured scene, but all or part of multiple target objects may appear in the synthesized high dynamic range image. The phenomenon of content that is not in the captured scene appearing in the high dynamic range image can be called the "ghosting" phenomenon.

[0067] For example, in Figure 2A In the low dynamic range image shown in FIG. 1 , the target object 201 is moving rapidly. Figure 2A After the shooting time of a frame of low dynamic range image shown in the figure, another frame is shot. Figure 2B Another low dynamic range image is shown in Figure 2B In another low dynamic range image shown in FIG. 1 , the target object 201 is moving rapidly. Figure 2A The low dynamic range image shown is similar to Figure 2B The low dynamic range image shown is fused into Figure 2C The high dynamic range image shown in Figure 2C In the high dynamic range image shown, ghost images 202 may appear.

[0068] Therefore, the embodiment of the present solution provides an image processing method. The electronic device 100 can obtain multiple frames of low dynamic range images with different exposure levels; the electronic device 100 can determine a reference image from the multiple frames of low dynamic range images; the electronic device 100 can determine the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images; the electronic device 100 can infer the position of the target object in multiple frames of non-reference images in the multiple frames of low dynamic range images at the time of shooting corresponding to the reference image based on the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images; the electronic device 100 can move the target object in the non-reference image to the position at the time of shooting corresponding to the reference image to obtain multiple frames of inferred images; the electronic device 100 can determine the first key image and the second key image from the multiple frames of inferred images; the electronic device 100 can fuse the first key image, the second key image and the reference image into a high dynamic range image. In this way, when the electronic device 100 synthesizes a high dynamic range image from multiple frames of low dynamic range images, it can make the synthesized high dynamic range image more natural and of higher quality.

[0069] An image processing method provided by an embodiment of the present application is introduced below.

[0070] Figure 3 A flow chart of an image processing method provided in an embodiment of the present application is shown.

[0071] S301 , acquiring multiple frames of low dynamic range images with different exposure levels through a camera in a shooting time sequence.

[0072] The multiple frames of low dynamic range images with different exposure levels are used to indicate that the electronic device 100 obtains multiple frames of low dynamic range images with different brightness by adjusting the exposure parameters of the camera (such as shutter speed, aperture size, ISO sensitivity, etc.) during the process of shooting with the camera. Figure 2A and Figure 2B shown.

[0073] S302: Determine a reference image from the multiple frames of low dynamic range images.

[0074] The reference image may be an image frame with the most uniform brightness distribution among the multiple low dynamic range images, or the reference image may be an image frame with the most detail information among the multiple low dynamic range images. In this way, the amount of image processing calculation can be reduced during subsequent image processing.

[0075] S303: Determine optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images.

[0076] The electronic device 100 can determine the optical flow information between the images with adjacent shooting times in the multiple frames of low dynamic range images based on the optical flow algorithm. The optical flow information can be used to indicate the information of the motion vector of the target object in the time series between the images with adjacent shooting times in the multiple frames of low dynamic range images. The information of the motion vector may include the information of the position, movement direction and movement speed of the target object. For example, the motion vector of the target object in one frame of image can be [ , , , ],in,[ , ] is used to indicate the pixel coordinates of the target object, [ , ] is used to indicate the speed and direction of movement of the target object.

[0077] Among them, optical flow algorithms can include: pyramid optical flow method, Lucas-Kanade method and neural network-based optical flow method (FlowNet / FlowNet2.0) and other optical flow algorithms.

[0078] In this way, the electronic device 100 can determine the optical flow information between any two frames of low dynamic range images in the multiple frames of low dynamic range images, including the position, movement direction and movement speed of the target object, through the optical flow information between images with adjacent shooting times in the multiple frames of low dynamic range images, thereby facilitating subsequent image processing.

[0079] S304, based on the optical flow information between the images with adjacent shooting times in the multiple frames of low dynamic range images, infer the position of the target object in the multiple frames of non-reference images in the multiple frames of low dynamic range images at the time of shooting corresponding to the reference image, where the non-reference image is different from the reference image.

[0080] For example, Figure 4A The reference image shown includes a target object 201 and a shooting background 203, wherein: Figure 4A The reference image shown has unclear details. Figure 4B The non-reference image shown includes a target object 201 and a shooting background 203. The electronic device 100 may be based on Figure 4B The non-reference image shown is Figure 4A The optical flow information between the reference images shown in the figure is used to infer Figure 4B In the non-reference image shown, the target object 201 is Figure 4A The reference image shown corresponds to the position at the time of capture (e.g. Figure 4B Target object 204 in the non-reference image shown).

[0081] S305. Based on the position of the target object in the multiple non-reference images in the multiple low dynamic range images at the corresponding shooting time of the reference image, move the target object in the non-reference image to the position at the corresponding shooting time of the reference image to obtain multiple frames of inferred images.

[0082] For example, Figure 4C The inferred image shown is Figure 4B In the non-reference image shown, the target object 201 moves to Figure 4A The reference image shown corresponds to the position at the time of capture (e.g. Figure 4C Target object 205 in the inferred image shown), Figure 4C The position of the original target object 201 in the inferred image shown (for example, Figure 4C The inferred image shown has a hole region 206 where details are missing.

[0083] S306 , determining a first key image and a second key image from the multiple frames of inferred images, wherein a position of a target object in a non-reference image corresponding to the first key image does not overlap with a position of a target object in a non-reference frame corresponding to the second key image.

[0084] For example, Figure 5A The first key image shown includes a shooting background 203, a target object 205 and a hole area 206. Figure 5A The first key image is shown with missing information in the hole region 206 . Figure 5A The hole region 206 in the first key image shown corresponds to the position of the target object in the non-reference image corresponding to the first key image. Figure 5B The second key image shown includes a shooting background 203, a target object 205 and a hole area 206. Figure 5B The second key image is shown as having missing information in the hole region 206 . Figure 5B The hole region 206 in the second key image shown corresponds to the position of the target object in the non-reference image corresponding to the second key image. Figure 5A The hole region 206 in the first key image is shown as Figure 5B The hole regions 206 in the second key image are shown to be non-overlapping.

[0085] S307 : Fusing the first key image, the second key image, and the reference image into a high dynamic range image, wherein a brightness range of the high dynamic range image is wider than a brightness range of the low dynamic range image.

[0086] For example, Figure 6As shown, the reference image may include a target object 201 and a shooting background 203. Part of the information in the reference image is unclear (for example, the area shown in 207 of the reference image). The first key image includes the shooting background 203, the target object 205, and the hole area 206. The detail information in the hole area 206 of the first key image is missing. The second key image includes the shooting background 203, the target object 205, and the hole area 206. The detail information in the hole area 206 of the second key image is missing. The electronic device 100 can fill and repair the unclear detail information in the reference image using the clear detail information in the first key image and / or the clear detail information in the second key image to obtain a high dynamic range image.

[0087] In a possible implementation, the electronic device 100 may fuse the first key image or the second key image with the reference image into a high dynamic range image.

[0088] In this way, the high dynamic range image formed by the electronic device 100 through the fusion of the first key image, the second key image and the reference image is more natural and has higher quality.

[0089] In some embodiments, the electronic device 100 can acquire multiple frames of low dynamic range images through the camera in a shooting time sequence, wherein the multiple frames of low dynamic range images include multiple frames of high exposure images and multiple frames of low exposure images, and the exposure level of the high exposure image is greater than the exposure level of the low exposure image.

[0090] Among them, the low-exposure image is underexposed (for example, the amount of light received by the camera of the electronic device 100 is small), resulting in the low-exposure image being too dark and the details being unclear; the high-exposure image is overexposed (for example, the amount of light received by the camera of the electronic device 100 is too much), resulting in the high-exposure image being too bright and the bright parts being distorted.

[0091] In a possible implementation, the electronic device 100 may acquire multiple frames of low dynamic range images by alternately acquiring low exposure images and high exposure images. For example, the electronic device 100 may first acquire a frame of low exposure image, then acquire a frame of high exposure image, then acquire a frame of low exposure image, then acquire a frame of high exposure image, and so on, to acquire multiple frames of high exposure images and multiple frames of low exposure images. Among them, the low exposure image may be represented by identifiers S1, S2, S3, ..., the first frame of low exposure image acquired (for example, the identifier is S1), the second frame of low exposure image (for example, the identifier is S2), the third frame of low exposure image (for example, the identifier is S3), etc. The high exposure image may be represented by identifiers H1, H2, H3, ..., the first frame of high exposure image acquired (for example, the identifier is H1), the second frame of high exposure image (for example, the identifier is H2), the third frame of high exposure image (for example, the identifier is H3), etc. In this way, by alternately acquiring low-exposure images and high-exposure images, multiple frames of low dynamic range images with different exposure levels are acquired, so that there is a sufficient time interval between adjacent low-exposure images or adjacent high-exposure images.

[0092] In a possible implementation, the electronic device 100 may first acquire multiple frames of high-exposure images, and then acquire multiple frames of low-exposure images.

[0093] In a possible implementation, the electronic device 100 may first acquire multiple frames of low-exposure images, and then acquire multiple frames of high-exposure images.

[0094] The electronic device 100 may determine the exposure value of each low dynamic range image in the multiple low dynamic range images, and determine the lowest exposure image with the lowest exposure value from the multiple low dynamic range images. The exposure value is used to indicate the total amount of light received by each low dynamic range image when the electronic device 100 shoots multiple low dynamic range images. The electronic device 100 may calculate the exposure value of each low dynamic range image based on the shutter speed, aperture, and sensitivity (ISO). For example, when shooting a low dynamic range image, the shutter speed is 1 / 100 seconds, the aperture is f / 2.8 (where f represents the focal length, and 2.8 represents the relative aperture value of the aperture), and the ISO is 200. The electronic device 100 may determine the exposure value (EV) based on the shutter speed, aperture, and ISO values. For example, the EV value corresponding to the shutter speed of 1 / 100 seconds is 0, the EV value corresponding to the aperture of f / 2.8 is 0, and the EV value corresponding to the ISO sensitivity of 200 is 2. The electronic device 100 can add the EV values ​​of the shutter speed, aperture, and ISO sensitivity to obtain an exposure value of the low dynamic range image of 2. In this way, when the brightness of the high exposure image is subsequently adjusted based on the minimum exposure image, the brightness of the high exposure image after the brightness adjustment can be ensured to be not too dark as much as possible.

[0095] The electronic device 100 may divide the exposure value of the multiple frames of high-exposure images by the exposure value of the lowest-exposure image, so that the electronic device 100 aligns the brightness of the multiple frames of high-exposure images to the lowest-exposure image. For example, the electronic device 100 may divide the exposure value of a frame of high-exposure image (e.g., the exposure value is 8) by the exposure value of the lowest-exposure image (e.g., the exposure value is 2) to obtain the exposure value of the brightness-aligned high-exposure image (e.g., the exposure value is 4). In this way, by adjusting the exposure value of the high-exposure image, the high-exposure image and the low-exposure image can be made as close as possible in brightness, so as to better perform subsequent image fusion and synthesis.

[0096] In a possible implementation, the electronic device 100 may use any frame of the multiple frames of high-exposure images with aligned brightness as a reference image.

[0097] In a possible implementation, the electronic device 100 may use a frame with the most detail information among multiple frames of high-exposure images with aligned brightness as a reference image, so as to facilitate the fusion of subsequent images.

[0098] The electronic device 100 can determine the consistency transformation matrix between each low-exposure image in the multiple low-exposure images and the reference image, and align the multiple low-exposure images with the reference image as a whole based on the consistency transformation matrix between each low-exposure image in the multiple low-exposure images and the reference image. The consistency transformation matrix is ​​used to indicate the geometric transformation relationship between each low-exposure image in the multiple low-exposure images and the reference image. In this way, by aligning each low-exposure image in the multiple low-exposure images with the reference image, each low-exposure image in the multiple low-exposure images is spatially consistent with the reference image, so that subsequent image processing can be better performed.

[0099] The electronic device 100 may determine the consistency transformation matrix between each high-exposure image in the multiple high-exposure images after brightness alignment and the reference image, and align the multiple high-exposure images after brightness alignment with the reference image based on the consistency transformation matrix between each high-exposure image in the multiple high-exposure images and the reference image as a whole. In this way, by aligning each high-exposure image in the multiple high-exposure images after brightness alignment with the reference image, each high-exposure image in the multiple high-exposure images after brightness alignment and the reference image are spatially consistent, and subsequent image processing can be better performed.

[0100] For example, in Fig. 7A In the reference image shown, the shooting background 203 is in the middle of the image, and the target object 201 is moving. Figure 7BIn the image to be aligned with the reference image, the background 203 is located above the image and the target object 201 is moving. The electronic device 100 can determine Figure 7B The image shown is prepared for global alignment with the reference image. Fig. 7A The electronic device 100 can transform the consistency transformation matrix between the reference images shown in FIG. Figure 7B In the image to be aligned with the reference image as shown, the background 203 is moved to the middle of the image. Fig. 7A The reference image shown is aligned as a whole, and the Figure 7C The overall aligned image is shown. Figure 7C In the overall aligned image shown, the shooting background 203 is located in the middle of the image.

[0101] The electronic device 100 can determine the optical flow information between the images with adjacent shooting times in the multiple low-exposure images after overall alignment and the multiple high-exposure images after brightness alignment and overall alignment based on the optical flow algorithm. The optical flow information includes the forward optical flow and the reverse optical flow between the images with adjacent shooting times in the multiple low-exposure images after overall alignment and the multiple high-exposure images after brightness alignment and overall alignment. The optical flow information can be used to indicate the information of the motion vector of the target object in the time series between the images with adjacent shooting times in the multiple low-exposure images after overall alignment and the multiple high-exposure images after brightness alignment and overall alignment.

[0102] In this way, the electronic device 100 can determine the optical flow information between any two frames of the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment based on the optical flow information between images with adjacent shooting times in the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment, including the position, movement direction and movement speed of the target object, thereby facilitating subsequent image processing.

[0103] The electronic device 100 can infer the position of the target object in the multiple frames of non-reference images at the corresponding shooting time of the reference image based on the optical flow information between the images with adjacent shooting times in the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment; wherein the multiple frames of non-reference images include the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment.

[0104] In a possible implementation, based on the optical flow information between images with adjacent shooting times in the multiple low-exposure images after overall alignment and the multiple high-exposure images after brightness alignment and overall alignment, the position of the target object in the multiple non-reference images at the time when the reference image corresponds to the shooting time is inferred by the Kalman filter algorithm. In this way, the position of the target object in the multiple non-reference images at the time when the reference image corresponds to the shooting time inferred by the Kalman filter algorithm is more accurate.

[0105] The electronic device 100 can move the target object in the non-reference image to the position at the corresponding shooting time of the reference image based on the position of the target object in multiple non-reference images in the multiple low dynamic range images at the corresponding shooting time of the reference image, to obtain multiple frames of inferred images.

[0106] The electronic device 100 can determine a first key image and a second key image from the multiple frames of inferred images, wherein the position of the target object in the non-reference image corresponding to the first key image does not overlap with the position of the target object in the non-reference frame corresponding to the second key image.

[0107] The electronic device 100 may fuse the first key image, the second key image, and the reference image into a high dynamic range image.

[0108] In a possible implementation, the electronic device 100 may fuse the first key image or the second key image with the reference image into a high dynamic range image.

[0109] In this way, the high dynamic range image formed by the electronic device 100 through the fusion of the first key image, the second key image and the reference image is more natural and has higher quality.

[0110] In a possible implementation, after the electronic device 100 aligns the multiple frames of low-exposure images and the multiple frames of high-exposure images after brightness alignment with the reference image, the electronic device 100 can directly determine the key image A and the key image B from the multiple frames of low-exposure images that are aligned overall. Then, the electronic device 100 can infer the position of the target object in the key image A and the key image B at the time of shooting corresponding to the reference image based on the optical flow information between the images with adjacent shooting times in the multiple frames of low-exposure images after overall alignment and the multiple frames of high-exposure images after brightness alignment and overall alignment. The electronic device 100 can move the target object in the key image A to the position at the time of shooting corresponding to the reference image to obtain the first key image. The electronic device 100 can move the target object in the key image B to the position at the time of shooting corresponding to the reference image to obtain the second key image. The electronic device 100 can fuse the first key image, the second key image and the reference image into a high dynamic range image.

[0111] In some embodiments, the electronic device 100 can obtain multiple frames of low dynamic range images with different exposure levels through the camera in the order of shooting time, wherein the multiple frames of low dynamic range images with different exposure levels include multiple frames of low dynamic range images with K exposure levels, and K is a positive integer greater than 2.

[0112] The electronic device 100 may determine a brightness distribution histogram of multiple frames of low dynamic range images. The brightness distribution histogram is used to indicate the distribution of brightness levels and pixel numbers of the low dynamic range images. Figure 8 In the brightness distribution histogram shown, the horizontal axis of the brightness distribution histogram can represent the brightness level of the image from 0 to 255, and the vertical axis of the brightness distribution histogram can represent the number of pixels of the corresponding brightness level in the image. The number of pixels with a brightness level of 70 in the image is 100,000 pixels. In this way, the reference image selected by the brightness distribution histogram has a better exposure condition.

[0113] The electronic device 100 may determine a reference image with the most uniform brightness distribution from the multiple frames of low dynamic range images based on the brightness distribution histograms of the multiple frames of low dynamic range images.

[0114] The electronic device 100 may determine exposure values ​​of multiple frames of low dynamic range images, and determine a minimum exposure image having the lowest exposure value from the multiple frames of low dynamic range images.

[0115] The electronic device 100 may divide the exposure values ​​of the multiple frames of non-minimum exposure images in the multiple frames of low dynamic range images by the exposure value of the minimum exposure image, so that the electronic device 100 may perform brightness alignment on the multiple frames of low dynamic range images. The multiple frames of non-minimum exposure images include the reference image, and the multiple frames of non-minimum exposure images are different from the minimum exposure image.

[0116] The electronic device 100 can determine the consistency transformation matrix between the minimum exposure image and the multiple frames of non-minimum exposure images after brightness alignment and the reference image, and based on the consistency transformation matrix between the minimum exposure image and the multiple frames of non-minimum exposure images after brightness alignment and the reference image, align the minimum exposure image and the multiple frames of non-minimum exposure images after brightness alignment with the reference image as a whole.

[0117] The electronic device 100 may determine optical flow information between images with adjacent shooting times in the lowest exposure image after overall alignment and in the multiple frames of non-lowest exposure images after brightness alignment and overall alignment.

[0118] The electronic device 100 can infer the position of the target object in the multiple frames of non-reference images at the corresponding shooting time of the reference image based on the optical flow information between the images with adjacent shooting times in the minimum exposure image after overall alignment and the multiple frames of non-minimum exposure images after brightness alignment and overall alignment, and obtain multiple frames of inferred images; wherein the multiple frames of non-reference images include the minimum exposure image after overall alignment and the multiple frames of non-minimum exposure images after brightness alignment and overall alignment.

[0119] In one possible implementation, the electronic device 100 can infer the position of the target object in multiple frames of non-reference images at the corresponding shooting time of the reference image through a Kalman filtering algorithm based on the optical flow information between images with adjacent shooting times in the minimum exposure image after overall alignment and multiple frames of non-minimum exposure images after brightness alignment and overall alignment, and obtain multiple frames of inferred images.

[0120] The electronic device 100 can determine a first key image and a second key image from the multiple frames of inferred images, wherein the position of the target object in the non-reference image corresponding to the first key image does not overlap with the position of the target object in the non-reference frame corresponding to the second key image.

[0121] The electronic device 100 may fuse the first key image, the second key image, and the reference image into a high dynamic range image.

[0122] In this way, the high dynamic range image formed by the electronic device 100 through the fusion of the first key image, the second key image and the reference image is more natural and has higher quality.

[0123] In a possible implementation, after the electronic device 100 can align the minimum exposure image with the multiple frames of non-minimum exposure images after brightness alignment with the reference image as a whole, the electronic device 100 can directly determine the key image A and the key image B from the multiple frames of non-minimum exposure images after brightness alignment and overall alignment. Then, the electronic device 100 can infer the position of the target object in the key image A and the key image B at the corresponding shooting time of the reference image based on the optical flow information between the images with adjacent shooting times in the minimum exposure image after overall alignment and the multiple frames of non-minimum exposure images after brightness alignment and overall alignment. The electronic device 100 can move the target object in the key image A to the position at the corresponding shooting time of the reference image to obtain the first key image. The electronic device 100 can move the target object in the key image B to the position at the corresponding shooting time of the reference image to obtain the second key image. The electronic device 100 can fuse the first key image, the second key image and the reference image into a high dynamic range image.

[0124] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0125] The embodiments of the present application also provide a computer program product. When the computer program product is executed on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments.

[0126] The embodiment of the present application also provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.

[0127] The term "user interface (UI)" in the specification and drawings of this application refers to the medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as . A node corresponds to a control or attribute in the interface. After parsing and rendering, the node is presented as user-visible content. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code. For example, HTML is defined by 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0128] The most common form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operation that is displayed in a graphical manner. It can be an icon, window, control or other interface element displayed on the display screen of an electronic device, where a control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.

[0129] 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 process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0130] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0131] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. An image processing method, characterized in that: Applied to an electronic device, the electronic device includes a camera, and the method includes: Acquire, by the camera, a plurality of low dynamic range images with different exposure levels in sequence of shooting time, wherein the plurality of low dynamic range images include a plurality of high exposure images and a plurality of low exposure images, wherein the exposure level of the high exposure images is greater than that of the low exposure images, and wherein the high exposure images and the low exposure images are acquired alternately; Determine a reference image from the multiple frames of low dynamic range images; Determine optical flow information between images in the plurality of low dynamic range images that are adjacent in shooting time; Based on optical flow information between images in the multiple low dynamic range images with adjacent shooting times, inferring the position of the moving target object in multiple non-reference images in the multiple low dynamic range images at the time corresponding to the shooting time of the reference image, wherein the non-reference images are different from the reference image; Based on the position of the target object in the multiple non-reference images in the multiple low dynamic range images at the time when the reference image is taken, the target object in the non-reference image is moved to the position at the time when the reference image is taken, to obtain multiple frames of inferred images; Determine a first key image and a second key image from the multiple frames of inferred images, wherein a position of the target object in the non-reference image corresponding to the first key image does not overlap with a position of the target object in the non-reference image corresponding to the second key image; The first key image, the second key image, and the reference image are fused into a high dynamic range image, wherein a brightness range of the high dynamic range image is wider than a brightness range of the low dynamic range image.

2. The method according to claim 1, characterized in that: The method further comprises: Determining exposure values ​​of the multiple frames of low dynamic range images; Determining a minimum exposure image having the lowest exposure value from the multiple frames of low dynamic range images; Brightness aligning the multiple frames of high exposure images to the minimum exposure image; Determine a reference image from multiple frames of low dynamic range images, specifically including: The reference image is determined from the multiple frames of high-exposure images that are aligned in brightness.

3. The method according to claim 2, characterized in that After determining the reference image from the plurality of frames of high-exposure images aligned with brightness, the method further includes: The multiple frames of low-exposure images and the multiple frames of high-exposure images after brightness alignment are overall aligned with the reference image.

4. The method according to claim 3, characterized in that The determining of the optical flow information between images in the multiple frames of low dynamic range images that are adjacent in shooting time specifically includes: Determine optical flow information between images with adjacent shooting times in the multiple frames of low-exposure images after overall alignment and the multiple frames of high-exposure images after brightness alignment and overall alignment.

5. The method according to claim 4, characterized in that The inferring the position of the target object in the multiple non-reference images in the multiple low dynamic range image frames at the time when the reference image corresponds to the shooting time based on the optical flow information between the images in the multiple low dynamic range image frames with adjacent shooting times specifically includes: Based on the optical flow information between images with adjacent shooting times in the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment, the position of the target object in the multiple frames of non-reference images at the corresponding shooting time of the reference image is inferred; wherein the multiple frames of non-reference images include the multiple frames of low exposure images after overall alignment and the multiple frames of high exposure images after brightness alignment and overall alignment.

6. The method according to claim 5, characterized in that The inferring the position of the target object in the multiple frames of non-reference images at the time when the reference image corresponds to the shooting time based on the optical flow information between the multiple frames of low-exposure images after overall alignment and the multiple frames of high-exposure images after brightness alignment and overall alignment and having adjacent shooting times, specifically includes: Based on the optical flow information between images with adjacent shooting times in the multiple frames of low-exposure images after overall alignment and the multiple frames of high-exposure images after brightness alignment and overall alignment, the positions of the target object in the multiple frames of non-reference images at the corresponding shooting time of the reference image are inferred through the Kalman filtering algorithm.

7. The method according to claim 2, characterized in that The step of aligning the brightness of the multiple frames of high-exposure images to the minimum-exposure image specifically includes: The exposure values ​​of the multiple frames of high-exposure images are divided by the exposure value of the lowest-exposure image.

8. An electronic device, characterized in that: It includes a camera, one or more processors and one or more memories; wherein the camera, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer instructions, so that when the one or more processors execute the computer instructions, the electronic device executes the image processing method as described in any one of claims 1-7.

9. A chip, characterized in that: The chip is applied to an electronic device, and the chip comprises a processing circuit and an interface circuit, wherein the interface circuit is used to receive instructions and transmit the instructions to the processing circuit, and the processing circuit is used to run the instructions to execute the image processing method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a processor of an electronic device, enable the electronic device to execute the image processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • High dynamic range image photographing method, terminal, and computer readable storage medium

    CN107277387A

  • Multiple exposure high dynamic range image capture

    EP2515273A1

  • Robust image motion detection using scene analysis and image frame pairs

    US11113801B1

  • Device and algorithm for capturing high dynamic range (HDR) video

    US20140002694A1

  • Electronic device and method for processing image

    US20190122339A1