System and method for motion warping using multi-exposure frames

A method includes obtaining, using at least one image sensor of an electronic device, a first image frame and multiple second image frames of a scene. Each of the second image frames has an exposure time different from an exposure time of the first image frame. The method also includes encoding, using at least one processor, each of the first image frame and the second image frames using a convolutional neural network to generate a corresponding feature map. The method further includes aligning, using the at least one processor, encoded features of the feature map corresponding to the first image frame with encoded features of the feature maps corresponding to the second image frames.

TECHNICAL FIELD

This disclosure relates generally to image capturing systems. More specifically, this disclosure relates to a system and method for motion warping using multi-exposure frames.

BACKGROUND

Many mobile electronic devices, such as smartphones and tablet computers, include cameras that can be used to capture still and video images. While convenient, cameras on mobile electronic devices typically suffer from a number of shortcomings. For example, cameras on mobile electronic devices typically have poor performance in low-light situations. While it is possible to increase the amount of light collected at an image sensor by increasing the exposure time, this also increases the risk of producing blurred images due to object and camera motion. One approach to addressing blur is to capture multiple image frames of a scene and then combine the “best” parts of the image frames to produce a blended image. However, producing a blended image from a set of image frames with different exposures is a challenging process, especially for dynamic scenes.

SUMMARY

This disclosure provides a system and method for motion warping using multi-exposure frames.

In a first embodiment, a method includes obtaining, using at least one image sensor of an electronic device, a first image frame and multiple second image frames of a scene. Each of the second image frames has an exposure time different from an exposure time of the first image frame. The method also includes encoding, using at least one processor, each of the first image frame and the second image frames using a convolutional neural network to generate a corresponding feature map. The method further includes aligning, using the at least one processor, encoded features of the feature map corresponding to the first image frame with encoded features of the feature maps corresponding to the second image frames.

In a second embodiment, an electronic device includes at least one image sensor and at least one processing device. The at least one processing device is configured to obtain a first image frame and multiple second image frames of a scene using the at least one image sensor. Each of the second image frames has an exposure time different from an exposure time of the first image frame. The at least one processing device is also configured to encode each of the first image frame and the second image frames using a convolutional neural network to generate a corresponding feature map. The at least one processing device is further configured to align encoded features of the feature map corresponding to the first image frame with encoded features of the feature maps corresponding to the second image frames.

In a third embodiment, a non-transitory machine-readable medium contains instructions that when executed cause at least one processor of an electronic device to obtain, using at least one image sensor of the electronic device, a first image frame and multiple second image frames of a scene. Each of the second image frames has an exposure time different from an exposure time of the first image frame. The medium also contains instructions that when executed cause the at least one processor to encode each of the first image frame and the second image frames using a convolutional neural network to generate a corresponding feature map. The medium further contains instructions that when executed cause the at least one processor to align encoded features of the feature map corresponding to the first image frame with encoded features of the feature maps corresponding to the second image frames.

In a fourth embodiment, a method includes obtaining, using at least one image sensor of an electronic device, a first image frame and multiple second image frames of a scene. Each of the second image frames has an exposure time different from an exposure time of the first image frame. The method also includes, using at least one processor, generating blur kernels indicating a motion direction of the first image frame using an optical flow network. The method further includes refining, using the at least one processor, the blur kernels using a convolutional neural network. In addition, the method includes generating, using the at least one processor, a target image frame of the scene using the refined blur kernels and occlusion masks for the second image frames.

DETAILED DESCRIPTION

FIGS. 1 through 12, discussed below, and the various embodiments of this disclosure are described with reference to the accompanying drawings. However, it should be appreciated that this disclosure is not limited to these embodiments, and all changes and/or equivalents or replacements thereto also belong to the scope of this disclosure. The same or similar reference denotations may be used to refer to the same or similar elements throughout the specification and the drawings.

As noted above, many mobile electronic devices, such as smartphones and tablet computers, include cameras that can be used to capture still and video images, but these cameras suffer from a number of shortcomings. For example, these cameras typically have poor performance in low-light situations. While it is possible to increase the amount of light collected at an image sensor by increasing the exposure time, this also increases the risk of producing blurred images due to object and camera motion. One approach to addressing blur, referred to as multi-frame imaging, is to capture multiple image frames of a scene and then combine the “best” parts of the image frames to produce a blended image. Multi-frame imaging plays an important role in tasks such as image deblurring, high dynamic range (HDR) imaging, noise reduction, and the like.

When a scene contains moving objects, it becomes very challenging to handle the motion in multiple image frames. One approach for handling this problem involves detecting each motion region and excluding that region during multi-frame fusion. This approach can result in a region around the moving object having the same quality as if a single image frame is used. Another approach is to register one or more non-reference image frames based on an optical flow and then merge the aligned image frames. However, this registration can be error-prone and can result in inaccurate optical flow estimation. A small offset in optical flow can negatively affect continuous sharp edges in a non-reference image frame.

This disclosure provides various techniques for motion warping in which one or more extracted features of non-reference image frames are aligned to those of a reference image frame according to optical flows between the image frames. As described in more detail below, the motion warping techniques of this disclosure can be flexibly incorporated into generative networks to align the extracted features before feeding them to decoding layers. The disclosed embodiments can be advantageously used in motion deblurring, HDR imaging, multi-frame denoising, and other imaging applications.

Note that while the techniques described below are often described as being performed using a mobile electronic device, other electronic devices could also be used to perform or support these techniques. Thus, these techniques could be used in various types of electronic devices. Also, while the techniques described below are often described as processing image frames when capturing still images of a scene, the same or similar approaches could be used to support the capture of video images.

FIG. 1illustrates an example network configuration100including an electronic device in accordance with this disclosure. The embodiment of the network configuration100shown inFIG. 1is for illustration only. Other embodiments of the network configuration100could be used without departing from the scope of this disclosure.

According to embodiments of this disclosure, an electronic device101is included in the network configuration100. The electronic device101can include at least one of a bus110, a processor120, a memory130, an input/output (I/O) interface150, a display160, a communication interface170, or a sensor180. In some embodiments, the electronic device101may exclude at least one of these components or may add at least one other component. The bus110includes a circuit for connecting the components120-180with one another and for transferring communications (such as control messages and/or data) between the components.

The processor120includes one or more of a central processing unit (CPU), an application processor (AP), or a communication processor (CP). The processor120is able to perform control on at least one of the other components of the electronic device101and/or perform an operation or data processing relating to communication. In some embodiments, the processor120can be a graphics processor unit (GPU). For example, the processor120can receive image data captured by at least one camera during a capture event. Among other things, the processor120can process the image data (as discussed in more detail below) using a convolutional neural network to perform motion warping.

The memory130can include a volatile and/or non-volatile memory. For example, the memory130can store commands or data related to at least one other component of the electronic device101. According to embodiments of this disclosure, the memory130can store software and/or a program140. The program140includes, for example, a kernel141, middleware143, an application programming interface (API)145, and/or an application program (or “application”)147. At least a portion of the kernel141, middleware143, or API145may be denoted an operating system (OS).

The kernel141can control or manage system resources (such as the bus110, processor120, or memory130) used to perform operations or functions implemented in other programs (such as the middleware143, API145, or application program147). The kernel141provides an interface that allows the middleware143, the API145, or the application147to access the individual components of the electronic device101to control or manage the system resources. The application147includes one or more applications for image capture and image processing as discussed below. These functions can be performed by a single application or by multiple applications that each carries out one or more of these functions. The middleware143can function as a relay to allow the API145or the application147to communicate data with the kernel141, for instance. A plurality of applications147can be provided. The middleware143is able to control work requests received from the applications147, such as by allocating the priority of using the system resources of the electronic device101(like the bus110, the processor120, or the memory130) to at least one of the plurality of applications147. The API145is an interface allowing the application147to control functions provided from the kernel141or the middleware143. For example, the API145includes at least one interface or function (such as a command) for filing control, window control, image processing, or text control.

The I/O interface150serves as an interface that can, for example, transfer commands or data input from a user or other external devices to other component(s) of the electronic device101. The I/O interface150can also output commands or data received from other component(s) of the electronic device101to the user or the other external device.

The display160includes, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, a quantum-dot light emitting diode (QLED) display, a microelectromechanical systems (MEMS) display, or an electronic paper display. The display160can also be a depth-aware display, such as a multi-focal display. The display160is able to display, for example, various contents (such as text, images, videos, icons, or symbols) to the user. The display160can include a touchscreen and may receive, for example, a touch, gesture, proximity, or hovering input using an electronic pen or a body portion of the user.

The communication interface170, for example, is able to set up communication between the electronic device101and an external electronic device (such as a first electronic device102, a second electronic device104, or a server106). For example, the communication interface170can be connected with a network162or164through wireless or wired communication to communicate with the external electronic device. The communication interface170can be a wired or wireless transceiver or any other component for transmitting and receiving signals, such as images.

The electronic device101further includes one or more sensors180that can meter a physical quantity or detect an activation state of the electronic device101and convert metered or detected information into an electrical signal. For example, one or more sensors180include one or more cameras or other image sensors for capturing images of a scene. The sensor(s)180may also include one or more buttons for touch input, a gesture sensor, a gyroscope or gyro sensor, an air pressure sensor, a magnetic sensor or magnetometer, an acceleration sensor or accelerometer, a grip sensor, a proximity sensor, a color sensor (such as a red green blue (RGB) sensor), a bio-physical sensor, a temperature sensor, a humidity sensor, an illumination sensor, an ultraviolet (UV) sensor, an electromyography (EMG) sensor, an electroencephalogram (EEG) sensor, an electrocardiogram (ECG) sensor, an infrared (IR) sensor, an ultrasound sensor, an iris sensor, or a fingerprint sensor. The sensor(s)180can further include an inertial measurement unit, which can include one or more accelerometers, gyroscopes, and other components. In addition, the sensor(s)180can include a control circuit for controlling at least one of the sensors included here. Any of these sensor(s)180can be located within the electronic device101. The one or more cameras or other image sensors can optionally be used in conjunction with at least one flash190. The flash190represents a device configured to generate illumination for use in image capture by the electronic device101, such as one or more LEDs.

The first external electronic device102or the second external electronic device104can be a wearable device or an electronic device-mountable wearable device (such as an HMD). When the electronic device101is mounted in the electronic device102(such as the HMD), the electronic device101can communicate with the electronic device102through the communication interface170. The electronic device101can be directly connected with the electronic device102to communicate with the electronic device102without involving with a separate network. The electronic device101can also be an augmented reality wearable device, such as eyeglasses, that include one or more cameras.

The first and second external electronic devices102and104and server106each can be a device of the same or a different type from the electronic device101. According to certain embodiments of this disclosure, the server106includes a group of one or more servers. Also, according to certain embodiments of this disclosure, all or some of the operations executed on the electronic device101can be executed on another or multiple other electronic devices (such as the electronic devices102and104or server106). Further, according to certain embodiments of this disclosure, when the electronic device101should perform some function or service automatically or at a request, the electronic device101, instead of executing the function or service on its own or additionally, can request another device (such as electronic devices102and104or server106) to perform at least some functions associated therewith. The other electronic device (such as electronic devices102and104or server106) is able to execute the requested functions or additional functions and transfer a result of the execution to the electronic device101. The electronic device101can provide a requested function or service by processing the received result as it is or additionally. To that end, a cloud computing, distributed computing, or client-server computing technique may be used, for example. WhileFIG. 1shows that the electronic device101includes the communication interface170to communicate with the external electronic device104or server106via the network162or164, the electronic device101may be independently operated without a separate communication function according to some embodiments of this disclosure.

The server106can optionally support the electronic device101by performing or supporting at least one of the operations (or functions) implemented on the electronic device101. For example, the server106can include a processing module or processor that may support the processor120implemented in the electronic device101.

FIG. 2illustrates an example process200for motion warping using multi-exposure image frames in accordance with this disclosure. For ease of explanation, the process200shown inFIG. 2is described as involving the use of the electronic device101ofFIG. 1. However, the process200shown inFIG. 2could be used with any other suitable electronic device and in any suitable system.

As shown inFIG. 2, the electronic device101receives or obtains multiple image frames202,203,204of a scene captured at approximately the same moment using at least one camera or other image sensor180of the electronic device101. The image frame202(also referred to as “long frame IL”) is captured using a long exposure time, which is as long as, or longer than, an automatically-determined “normal” exposure time. Because the exposure time is long, one or more moving objects in the image frame202may have blurry features. The image frames203-204(also referred to as “short frame Is1” and “short frame Is2,” respectively) are captured using a short exposure time, which is short at least relative to the normal and long exposure times. Because the exposure time is short, the image frames203-204record the one or more moving objects with less or no motion blur. Note that as used here, the terms “short,” “normal,” and “long” are relative to each other and can represent any suitable exposure times, as long as “normal” is longer than “short” and “long” is as long as, or longer than, “normal.” In many cases, “normal” refers to the automatically-determined exposure time that results in an image having a minimum of under-exposed and/or over-exposed regions, which is often referred to as an EV-0 exposure time.

Because of the short exposure time, the two short frames203-204record any moving objects with less or no motion blur (relative to the image frame202). In contrast, the long exposure time of the long frame202results in possible blur for any moving objects. To correct the blur in the process200, the electronic device101uses the long frame202as a reference frame and uses the short frames203-204as non-reference frames. The electronic device101aligns any moving objects in the short frames203-204with any corresponding moving objects in the long frame202. However, as described in greater detail below, the alignment is performed on encoded features instead of the original image frames. That is, instead of directly moving image frames, the electronic device101first encodes each of the short frames203-204into a feature space and then aligns the features. This gives more robust motion compensation without distorting image features, resulting in fewer errors.

The electronic device101inputs the three image frames202,203,204to respective encoder networks210. Each of the encoder networks210is based on a convolutional neural network architecture. A convolutional neural network architecture generally represents a type of deep artificial neural network, which is often applied to analyze images. Each encoder network210is composed of multiple convolutional layers212. Each of the convolutional layers212represents a layer of convolutional neurons, which operate to apply a convolution operation that emulates the response of individual neurons to visual stimuli. Each neuron typically applies some function to its input values (often by weighting different input values differently) to generate output values. Each encoder network210here is shown as including three convolutional layers212, but each encoder network210could include different numbers of convolutional layers. In some embodiments, each encoder network210includes, or is part of, a generative adversarial network (GAN). The output of each encoder network210is a feature map that includes a number of features (such as 64, 128, 256, or other number of features). In the process200, FL(x,y), Fs1(x,y), and Fs2(x,y) represent the encoded feature maps for the image frames202,203, and204, respectively.

The electronic device101also provides the non-reference short frames203-204to an optical flow network206for optical flow estimation. Optical flow estimation is a technique for pixel-wise prediction of motion in an image over time. In the process200, the optical flow network206receives the short frames203-204and determines the motion between the short frames203-204. The optical flow network206includes any suitable functions, processes, or algorithms for determining motion between image frames. In some embodiments, the optical flow network206can include a neural network, such as a convolutional neural network. The output of the optical flow network206is an optical flow map208, which is a matrix of values indicating pixel-wise x and y differences (referred to as Δx and Δy) between the short frames203-204.

In the process200, the encoded feature maps Fs1(x,y) and Fs2(x,y) generated from the short frames203-204are aligned to the feature map FL(x,y) generated from the long frame202. To accomplish this, the electronic device101performs warping operations214-215. Each warping operation214-215receives the optical flow map208generated from the optical flow network206and applies a translation operation to the corresponding encoded feature map Fs1(x,y) or Fs2(x,y). The translation amount is determined by the Δx and Δy values in the optical flow map208. In some embodiments, each warping operation214-215is scaled down to match the downscaling from the image to the encoded feature maps. The warping operations214-215result in translated feature maps

At this point in the process200, the three feature maps representing the moving objects, namely

Fs⁢1⁡(x+12⁢Δ⁢x,y+12⁢Δ⁢y),Fs⁢2⁡(x-12⁢Δ⁢x,y-12⁢Δ⁢y),
and FL(x,y), are aligned. The electronic device101combines the aligned features using a concatenator operation216, and the combined features are input into a decoder network220. The concatenated features encode the aligned sharp information from the short frames203-204to the motion blur regions of the long frame202so that the decoder network220can generate natural sharp edges.

Like the encoder networks210, the decoder network220is based on a convolutional neural network architecture. In some embodiments, the decoder network220includes, or is part of, a GAN. As shown inFIG. 2, the decoder network220is composed of multiple residual blocks222, multiple transposed convolutional layers224, and a standard convolutional layer226. WhileFIG. 2shows nine residual blocks222, two transposed convolutional layers224, and one standard convolutional layer226, other embodiments of the decoder network220could include other numbers of residual blocks, transposed convolutional layers, and standard convolutional layers.

The decoder network220is trained to combine the feature map FLfor the long frame202and the feature maps Fs1and Fs2for the short frames203-204and generate a sharp frame230(referred to as/target). The trained decoder network220optimizes the image quality of the sharp frame230such that the sharp frame230exhibits little or no blurring. In some embodiments, the decoder network220(particularly the residual blocks222) perform a blending operation to generate the sharp frame230. The sharp frame230can then be output as a final image for viewing, storing, or further image processing.

AlthoughFIG. 2illustrates one example of a process200for motion warping using multi-exposure image frames, various changes may be made toFIG. 2. For example, while the process200is shown as using two short image frames, other embodiments could use more than two short image frames. Also, the operations of the process200can be performed by any suitable component(s) of an electronic device101or other device, including the processor120of the electronic device101.

FIG. 3illustrates an example process300for training a convolutional neural network in accordance with this disclosure. Using the process300, a convolutional neural network305can be trained for motion warping using multi-exposure image frames. For ease of explanation, the process300is described as involving the use of the electronic device101ofFIG. 1and some of the components depicted in the process200ofFIG. 2. However, the process300could be used with any other suitable device and any other suitable convolutional neural network architecture.

During the training process300, the electronic device101trains the convolutional neural network305, which includes the encoder networks210, the decoder network220, or a combination of these. The training process300is performed to help define what a sharp frame230should look like. In order to perform the training process300, the electronic device101obtains training data, which includes one or more long frames202and multiple short frames203-204associated with each long frame202. If the training data simply included long and short frames, it would be difficult or impossible to define ground truths, since the long and short frames may not represent the ground truths. Thus, the electronic device101also obtains a ground-truth sharp frame310associated with each long frame202. A method for obtaining the training data (including the long frames202, short frames203-204, and ground-truth sharp frames310) is described below in conjunction withFIG. 4.

As shown inFIG. 3, the training process300uses a GAN training architecture, which includes a generator315and a discriminator320. The generator315receives the input information and generates the desired output, which in this case is represented by the restored sharp frame230. The discriminator320determines whether or not the desired output is believable or accurate. The electronic device101performs the functions of the generator315and the discriminator320to train the convolutional neural network305in an end-to-end fashion. In some embodiments, the discriminator320can include multiple functions325, including a convolutional layer, a normalization function, and a rectified linear unit (ReLU) function.

The electronic device101trains the convolutional neural network305by operating in an iterative manner to generate the restored sharp frame230. Ideally, during multiple iterations through the training process300, the convolutional neural network305generally improves the generation of the restored sharp frames230and moves towards producing the ground-truth sharp frames310.

For each iteration through the training process300, the electronic device101may perform a loss computation function, which computes a total loss function for the convolutional neural network305. The loss helps guide updating of weights of the convolutional neural network305. For example, the electronic device101can compute the total loss function according to the following:
L=λLcontent+LGAN
where L is the total loss function, λ is a training parameter set to achieve a goal of balancing content loss and GAN loss, λLcontentis the content loss, and LGANis the GAN loss. Content loss is a measurement of the difference between a ground-truth sharp frame310and a restored sharp frame230. In some embodiments, the content loss can be L1 or L2 loss. The GAN loss can be any standard adversarial loss. For example, as shown inFIG. 3, the GAN loss can be the Wasserstein distance, which is a distance measurement (or loss measurement) used in Wasserstein GANs.

Based on the computed loss, the electronic device101adjusts the convolutional neural network305by updating the weights used by the convolutional neural network305. For example, the electronic device101can alter the weights used in the generator315, the discriminator320, or other parameters of the convolutional neural network305. Once the updated weights are determined, the electronic device101performs another iteration of training for the convolutional neural network305. The overall goal of the training process300is to reduce or minimize the value of the loss function.

AlthoughFIG. 3illustrates one example of a process300for training a convolutional neural network, various changes may be made toFIG. 3. For example, the convolutional neural network305may be trained in any other suitable manner, which may or may not involve the use of a generator and a discriminator.

FIG. 4illustrates an example process400for generating training data for the training process300ofFIG. 3in accordance with this disclosure. In particular, the process400can be used for generating long frames, short frames, and ground-truth sharp frames to be used as training data. For ease of explanation, the process400is described as involving the use of the electronic device101ofFIG. 1and the process300ofFIG. 3. However, the process400could be used with any other suitable device and any other suitable network training process.

As shown inFIG. 4, an image sensor of the electronic device101(such as a high-speed camera) captures multiple video frames402in a burst over a short period of time (such as 100-150 milliseconds). The video frames402depict movement of at least one object over the time burst. In some embodiments, the video frames402may be captured at 240 frames per second.

The electronic device101selects two of the video frames402captured at different times to become the short frames203-204. InFIG. 4, the end frames of the captured video frames402are selected as the short frames203-204. However, in other embodiments, other frames among the captured video frames402could be selected as the short frames203-204. The electronic device101also selects one of the captured video frames402at or near the middle point of the burst as the ground-truth sharp frame310.

To obtain the long frame202(which includes realistic motion blurred portions), the electronic device101blends multiple image frames together. To get a larger sample for blending that includes more representations of object movement, the electronic device101generates multiple interpolated frames404(represented inFIG. 4as slightly shorter lines) by interpolating pairs of adjacent video frames402. Once the interpolated frames404are generated over a time span (such as 50-100 milliseconds) within the burst, the electronic device101averages the video frames402and their corresponding interpolated frames404over the time span to create the synthesized long frame202with realistic motion blur as shown inFIG. 4.

The resulting long frame202, the short frames203-204, and the ground-truth sharp frame310can be used as one set of training data for the training process300. Additional training data can be generated by shifting the examined sample shown inFIG. 4to the left or right by one or more captured video frames402. Even more additional training data can be generated by repeating the process400with additional captured video frames402.

AlthoughFIG. 4illustrates one example of a process400for generating training data, various changes may be made toFIG. 4. For example, the number of captured video frames and interpolated frames comprising the long frame can be greater or fewer than shown inFIG. 4.

FIG. 5illustrates an example process500for motion warping using multi-exposure image frames to produce an HDR frame in accordance with this disclosure. For ease of explanation, the process500is described as involving the use of the electronic device101ofFIG. 1and multiple components that are the same as, or similar to, components shown inFIG. 2. However, the process500could be used with any other suitable device and components.

As shown inFIG. 5, the electronic device101receives or obtains multiple image frames501,502,503of a scene captured at approximately the same moment using at least one camera or other image sensor180of the electronic device101. The image frame501of the scene (also referred to as “long frame Ilong”) is captured using a long exposure time. The image frame502(also referred to as “normal frame Inormal”) is captured using a normal exposure time. The image frame503(also referred to as “short frame Ishort”) is captured using a short exposure time. Generally speaking, the long frame501is useful for capturing dark or shadow areas, the normal frame502captures details in a subject of the scene, and the short frame503captures bright areas. The electronic device101uses the normal frame502as a reference frame and uses the long frame501and short frame503as non-reference frames.

The electronic device101inputs each of the three image frames501,502,503to a respective encoder network511,512,513, which may be the same as or similar to the encoder networks210ofFIG. 2. As an example, the components of the encoder networks511,512,513could be the same as the encoder networks210, but the trained parameters of the encoder networks511,512,513could be different from those of the encoder networks210. The output of each encoder network511,512,513is a feature map for that exposure level (Flong, Fnormal, Fshort), where the feature map includes a number of identified features.

To align the feature maps Flong, Fshortgenerated from the long frame501and the short frame503, respectively, with the feature map Fnormalfrom the normal frame502, the electronic device101performs warping operations514-515, which may be the same as or similar to the warping operations214-215ofFIG. 2. The warping operations514-515result in translated feature maps that are aligned with each other. The electronic device101combines the aligned features using a concatenator operation516and then inputs the combined features into a decoder network520.

The decoder network520is trained to select features from the different feature maps Flong, Fnormal, Fshort, which are associated with different exposure levels, and blend the features to generate an HDR image frame530(referred to as IHDR). In some embodiments, the decoder network520applies an HDR blending algorithm to the feature maps in order to generate the HDR image frame530with reduced or minimal blur since the feature maps are well-aligned. The decoder network520may use any suitable blending technique or algorithm to generate an HDR image frame530based on multiple feature maps.

AlthoughFIG. 5illustrates one example of a process500for motion warping using multi-exposure image frames to produce an HDR frame, various changes may be made toFIG. 5. For example, more than one long frame or short frame may be used as non-reference frames in the process500.

FIG. 6illustrates another example process600for training a convolutional neural network in accordance with this disclosure. Using the process600, a convolutional neural network605can be trained for motion warping using multi-exposure image frames to produce an HDR frame. For ease of explanation, the process600is described as involving the use of the electronic device101ofFIG. 1and some of the components depicted in the process500ofFIG. 5. However, the process600could be used with any other suitable device and any other suitable convolutional neural network architecture.

During the training process600, the electronic device101trains the convolutional neural network605, which includes the encoder networks511,512,513, the decoder network520, or a combination of these. In order to perform the training process600, the electronic device101obtains training data, which includes one or more long frames501, one or more normal frames502, and one or more short frames503. In some embodiments, at least some of the training data can be generated using the process400ofFIG. 4or a similar process.

As shown inFIG. 6, the training process600uses a GAN training architecture, which includes a generator615and a discriminator620. These may be the same as or similar to corresponding components ofFIG. 3. The challenge in HDR is creating one or more ground-truth HDR frames610to be used to define content loss. This is solved by performing the training process600in two stages.

In the first stage (“Stage I”), the electronic device101trains the convolutional neural network605in an end-to-end fashion (training the generator and discriminator together) using both GAN loss (such as the Wasserstein distance) and content loss similar to the training process500. The frames501,502,503used as training samples in the first stage are selected to have only static scenes, since it is easier to create ground-truth HDR frames610from static scenes. In the second stage (“Stage II”), the electronic device101fine-tunes the convolutional neural network605using only GAN loss. In the second stage, the frames501,502,503selected as training samples include scenes that contain moving objects. Since the second stage of the training process600uses only the GAN loss (no content loss), ground-truth HDR frames610are not needed for fine tuning.

AlthoughFIG. 6illustrates one example of a process600for training a convolutional neural network, various changes may be made toFIG. 6. For example, the convolutional neural network605may be trained in any other suitable manner, which may or may not involve the use of a generator and a discriminator.

FIG. 7illustrates an example process700for denoising using multiple image frames in accordance with this disclosure. The process700can be used for denoising when a scene contains moving objects. For ease of explanation, the process700is described as involving the use of the electronic device101ofFIG. 1and multiple components that may be the same as or similar to components shown inFIG. 2. However, the process700could be used with any other suitable device and components.

As shown inFIG. 7, the electronic device101receives or obtains multiple image frames701,702,703of a scene captured at approximately the same moment using at least one camera or other image sensor180of the electronic device101. Each of the image frames701,702,703is “noisy,” meaning there is noise present in each of the image frames701,702,703. All of the image frames701,702,703can have the same exposure level. Among the image frames701,702,703, the electronic device101selects the image frame702as the reference frame. The image frame702could be selected because it is the sharpest image of the image frames701,702,703, because it is the frame captured in the middle temporally, or because it is selected at random. In general, any desired selection technique may be used here. The electronic device101uses the other image frames701and703as non-reference frames.

The electronic device101inputs each of the three image frames701,702,703to a respective encoder network711,712,713, which may be the same as or similar to the encoder networks210ofFIG. 2. The output of each encoder network711,712,713is a feature map corresponding to that image frame (F1, F2, F3), where the feature map includes a number of identified features.

To align the feature maps F1, F3generated from the image frames701and703, respectively, with the feature map F2from the reference image frame702, the electronic device101performs warping operations714-715, which may be the same as or similar to the warping operations214-215ofFIG. 2. The warping operations714-715result in translated feature maps that are aligned with each other. The electronic device101combines the aligned features using a concatenator operation716and inputs the combined features into a decoder network720. The decoder network720is trained to select features from the different feature maps F1, F2, F3and blend the features to generate a noise-free image frame730(or at least a noise-reduced image). In some embodiments, the training can be performed similar to the training process600ofFIG. 6, since there may be no good ground truth images available.

AlthoughFIG. 7illustrates one example of a process700for denoising using multiple image frames, various changes may be made toFIG. 7. For example, more than two noisy frames may be used as non-reference image frames in the process700.

FIGS. 8A and 8Billustrate examples of benefits that can be realized using one or more of the embodiments of this disclosure. More specifically,FIGS. 8A and 8Bdepict a comparison between an image801of a scene captured using conventional image processing and an image802of the same scene captured using one of the embodiments described above. InFIG. 8A, the image801was captured and processed using a conventional image operation. As evident byFIG. 8A, the image801exhibits significant blurring around the subject's arm803and shirt logo804. In contrast, the image802inFIG. 8Bwas captured and processed using the deblurring operations as described above. The resulting image802provides superior results compared to the image801, particularly around the subject's arm803and shirt logo804. In the images801-802, the subject's face is obscured for privacy.

AlthoughFIGS. 8A and 8Billustrate examples of benefits that can be realized using one or more of the embodiments of this disclosure, various changes may be made toFIGS. 8A and 8B. For example, images can be captured of numerous scenes under different lighting conditions, and these figures do not limit the scope of this disclosure. These figures are merely meant to illustrate example types of benefits that might be obtainable using the techniques described above.

FIG. 9illustrates an example method900for motion warping using multiple image frames in accordance with this disclosure. For ease of explanation, the method900shown inFIG. 9is described as involving the use of the electronic device101ofFIG. 1. However, the method900shown inFIG. 9could be used with any other suitable electronic device and in any suitable system.

As shown inFIG. 9, a first image frame and multiple second image frames of a scene are obtained using at least one image sensor of an electronic device at step902. Each of the second image frames has an exposure time different from an exposure time of the first image frame. This could include, for example, the processor120of the electronic device101receiving a capture request and causing a camera (sensor180) to capture multiple image frames, such as the image frames202,203,204or the image frames501,502,503. In some embodiments, the exposure time of each image frame is shorter than the exposure time of the first image frame. For example, the exposure time of the short frames203-204is shorter than the exposure time of the long frame202. In other embodiments, one of the second image frames has an exposure time that is longer than the exposure time of the first image frame, and another of the second image frames has an exposure time that is shorter than the exposure time of the first image frame. For instance, the long frame501has an exposure time that is longer than the exposure time of the normal frame502, and the short frame503has an exposure time that is shorter than the exposure time of the normal frame502.

Each of the first image frame and the second image frames is encoded to generate a corresponding feature map at step904. In some embodiments, the encoding is performed using a convolutional neural network, which may include a generative adversarial network. This could include, for example, the electronic device101encoding each of the image frames202,203,204using the encoder networks210or encoding each of the image frames501,502,503using the encoder networks511,512,513.

At least one optical flow network is used to generate at least one optical flow map representing pixel-wise differences between at least one pair of frames among the first image frame and the second image frames at step906. This could include, for example, the electronic device101using the optical flow network206to generate the optical flow map208or using the optical flow networks505-506to generate the optical flow maps508-509. A warping operation is performed on at least one of the feature maps using the at least one optical flow map at step908. This could include, for example, the electronic device101performing the warping operations214-215using the optical flow map208or performing the warping operations514-515using the optical flow maps508-509.

The feature maps having the aligned encoded features are concatenated at step910. This could include, for example, the electronic device101performing the concatenator operation216or the concatenator operation516. The feature maps having the aligned encoded features are decoded at step912using the convolutional neural network in order to generate a target image frame of the scene. This could include, for example, the electronic device101decoding the aligned feature maps using the decoder network220or the decoder network520to generate the sharp frame230or the HDR image frame530.

AlthoughFIG. 9illustrates one example of a method900for motion warping using multiple image frames, various changes may be made toFIG. 9. For example, while shown as a series of steps, various steps inFIG. 9could overlap, occur in parallel, occur in a different order, or occur any number of times.

Blind motion deblurring is another type of deblurring operation that can be performed for images captured in dim lighting. Blind motion deblurring is typically most successful when non-uniform blur kernels are accurately estimated. Some approaches use three consecutive blurry frames and attempt to determine per-pixel kernels by bi-linearly interpolating optical flows between two neighboring blurry frames. However, such methods often fail to accurately estimate the optical flow between two blurry frames. Moreover, such approaches may not successfully restore background regions that are occluded by moving objects. To address these and other issues, the following embodiment includes two or more sharp short-exposure frames that are captured before and after a target long-exposure frame so that kernel estimation is much more accurate.

FIG. 10illustrates an example process1000for removing motion blur using multi-exposure image frames in accordance with this disclosure. For ease of explanation, the process1000shown inFIG. 10is described as involving the use of the electronic device101ofFIG. 1and multiple components that are the same as, or similar to, components shown inFIG. 2. However, the process1000could be used with any other suitable device and components.

As shown inFIG. 10, the electronic device101receives or obtains multiple image frames1002,1003,1004of a scene captured at approximately the same moment using at least one camera or other image sensor180of the electronic device101. The image frame1002of the scene (also referred to as “long frame IL”) is captured using a long exposure time. The image frames1003-1004of the scene (also referred to as “short frame Is1” and “short frame Is2,” respectively) are captured using a short exposure time. As in some of the embodiments described above, the long frame1002includes blurry sections.

The electronic device101provides the image frames1002,1003,1004to an optical flow network1006for optical flow estimation. The electronic device101uses the optical flow network1006to compute the optical flow (motion) between the two short frames1003-1004and to compute blur kernels1008that approximate the motion direction for the long frame1002. The blur kernels1008represent deconvolution kernels, which are a spatially varying set of filter kernels that can be used to sharpen an image. Each blur kernel1008can be computed by interpolating the optical flow at each pixel. For example, assume that the optical flow at pixel (x, y) is (u, v). The optical flow network1006can operate by interpolating the optical flow into a blur kernel k according to the following:

After the blur kernels1008are generated, the electronic device101provides the blur kernels1008to a kernel refine network1010in order to refine the blur kernels1008. The kernel refine network1010is a convolutional neural network that operates to refine the blur kernels1008to fit an accurate exposure time window for the long frame1002. The kernel refine network1010may include multiple convolution layers (such as 3×3 convolution layers) followed by multiple transposed convolutional layers (such as 3×3 transposed convolution layers). The output of the kernel refine network1010is multiple refined kernels1012. In some embodiments, the kernel refine network1010can be trained using reblur loss by enforcing a ground-truth sharp image, when convolved with an estimated kernel, to be the same as a blur input. In some cases, this can be expressed in the following manner:

k^=arg⁢mink⁢Isharp*k-Iblur2
where Isharpis the ground-truth sharp image, k is the estimated kernel, and Ibluris the blur input.

The electronic device101also estimates an occlusion mask1014for each of the short frames1003-1004. Each occlusion mask1014estimates the background objects that are partially occluded by a moving object. The occlusion masks1014will be applied to the short frames1003-1004to recover lost background in the long frame1002as discussed below. The electronic device101can use any suitable technique for occlusion mask estimation.

The electronic device101further performs an occlusion-aware deconvolution operation1016. The occlusion-aware deconvolution operation1016is performed to recover the blurred object by applying the refined kernels1012to the long frame1002and restoring the occluded background area by applying occlusion masks1014to the short frames1003-1004. For example, given the image frames1002,1003,1004(identified below as IL, Is1, and Is2) and the occlusion masks1014(identified below as M1and M2) as inputs, the motion blur problem can be modeled as:
IL=Isharp*K++M1⊙Is1+M2⊙Is2.
Since the blur kernels k and the occlusion masks M1and M2are fixed, only the sharp image (identified below as Isharp) needs to be recovered, which can be expressed as follows:
I′L=IL−M1⊙Is1−M2⊙Is2
I′L=Isharp*K
The objective function to estimate Isharpmay be expressed as follows, where a primal-dual update can be used to optimally compute Îsharp.

In addition, the electronic device101performs a static background rendering1018to render the static background of the sharp image. For example, according to the per-pixel kernels, the electronic device101can estimate a static background mask M and apply alpha blending between the long frame1002(IL) and the estimated Îsharpto transfer the high-quality background from the input to a restored sharp image frame1020.

AlthoughFIG. 10illustrates one example of a process1000for removing motion blur using multi-exposure image frames, various changes may be made toFIG. 10. For example, more than two short frames may be used as non-reference frames in the process1000.

FIGS. 11A and 11Billustrate examples of benefits that can be realized using one or more of the embodiments of this disclosure. More specifically,FIGS. 11A and 11Bdepict a comparison between an image1101of a scene captured using conventional image processing and an image1102of the same scene captured using the embodiment disclosed inFIG. 10. InFIG. 11A, the image1101was captured and processed using a conventional image operation. As evident byFIG. 11A, the image1101exhibits significant blurring around the subject's hand and leg. In contrast, the image1102inFIG. 11Bwas captured and processed using the deblurring operations as described above. The resulting image1102provides superior results compared to the image1101, particularly around the subject's hand and leg. In the images1101-1102, the subject's face is obscured for privacy.

AlthoughFIGS. 11A and 11Billustrate examples of benefits that can be realized using one or more of the embodiments of this disclosure, various changes may be made to these figures. For example, images can be captured of numerous scenes under different lighting conditions, and these figures do not limit the scope of this disclosure. These figures are merely meant to illustrate example types of benefits that might be obtainable using the techniques described above.

FIG. 12illustrates an example method1200for removing motion blur using multi-exposure image frames in accordance with this disclosure. For ease of explanation, the method1200shown inFIG. 12is described as involving the use of the electronic device101ofFIG. 1. However, the method1200shown inFIG. 12could be used with any other suitable electronic device and in any suitable system.

As shown inFIG. 12, a first image frame and multiple second image frames of a scene are obtained using at least one image sensor of an electronic device at step1202. Each of the second image frames has an exposure time different from the first image frame. This could include, for example, the processor120of the electronic device101receiving a capture request and causing a camera (sensor180) to capture multiple image frames, such as the image frames1002,1003,1004. In some embodiments, the exposure time of each second image frame is shorter than the exposure time of the first image frame. For example, the exposure time of the short frames1003-1004is shorter than the exposure time of the long frame1002.

An optical flow network is used to generate blur kernels indicating a motion direction of the first image frame at step1204. This could include, for example, the electronic device101using the optical flow network1006to generate the blur kernels1008. The blur kernels are refined using a convolutional neural network at step1206. This could include, for example, the electronic device101using the kernel refine network1010to generate the refined kernels1012from the blur kernels1008. Occlusion masks are estimated for the second image frames at step1208. This could include, for example, the electronic device101estimating the occlusion masks1014for the short frames1003-1004.

A target image frame of the scene is generated using the refined blur kernels and occlusion masks for the second image frames at step1210. This could include, for example, the electronic device101generating the sharp image frame1020using the refined kernels1012and the occlusion masks1014. In some embodiments, the target image frame is generated by (i) performing an occlusion-aware deconvolution operation using the refined blur kernels and occlusion masks and (ii) rendering a static background of the target image frame, such as described with respect to the occlusion-aware deconvolution operation1016and the background rendering operation1018.

AlthoughFIG. 12illustrates one example of a method1200for removing motion blur using multi-exposure image frames, various changes may be made toFIG. 12. For example, while shown as a series of steps, various steps inFIG. 12could overlap, occur in parallel, occur in a different order, or occur any number of times.

It should be noted that while various operations are described above as being performed using one or more devices, those operations can be implemented in any suitable manner. For example, each of the functions in the electronic device101or server106can be implemented or supported using one or more software applications or other software instructions that are executed by at least one processor120of the electronic device101or server106. In other embodiments, at least some of the functions in the electronic device101or server106can be implemented or supported using dedicated hardware components. In general, the operations of each device can be performed using any suitable hardware or any suitable combination of hardware and software/firmware instructions.