System and method for motion warping using multi-exposure frames
11503221 · 2022-11-15
Assignee
Inventors
Cpc classification
H04N19/42
ELECTRICITY
H04N23/743
ELECTRICITY
International classification
H04N19/42
ELECTRICITY
Abstract
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.
Claims
1. A method comprising: 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 having an exposure time different from an exposure time of the first image frame; 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; generating, using the at least one processor, at least one optical flow map representing pixel-wise differences between at least one pair of image frames among the first and second image frames using at least one optical flow network; and 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 by performing warping operations on the encoded features of the feature maps corresponding to the second image frames using the at least one optical flow map.
2. The method of claim 1, further comprising: decoding, using the at least one processor, the feature maps having the aligned encoded features using the convolutional neural network to generate a target image frame of the scene.
3. The method of claim 1, wherein the exposure time of each second image frame is shorter than the exposure time of the first image frame.
4. The method of claim 1, wherein: the exposure time of one of the second image frames is longer than the exposure time of the first image frame; and the exposure time of another of the second image frames is shorter than the exposure time of the first image frame.
5. The method of claim 1, further comprising: concatenating the feature maps having the aligned encoded features before decoding the feature maps having the aligned encoded features.
6. The method of claim 1, wherein the first image frame is used as a reference frame and the second image frames are used as non-reference frames.
7. The method of claim 1, wherein the convolutional neural network comprises a generative adversarial network.
8. An electronic device comprising: at least one image sensor; and at least one processing device 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 having an exposure time different from an exposure time of the first image frame; encode each of the first image frame and the second image frames using a convolutional neural network to generate a corresponding feature map; generate at least one optical flow map representing pixel-wise differences between at least one pair of image frames among the first and second image frames using at least one optical flow network; and 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; wherein, to align the encoded features, the at least one processing device is configured to perform warping operations on the encoded features of the feature maps corresponding to the second image frames using the at least one optical flow map.
9. The electronic device of claim 8, wherein the at least one processing device is further configured to: decode the feature maps having the aligned encoded features using the convolutional neural network to generate a target image frame of the scene.
10. The electronic device of claim 8, wherein the exposure time of each second image frame is shorter than the exposure time of the first image frame.
11. The electronic device of claim 8, wherein: the exposure time of one of the second image frames is longer than the exposure time of the first image frame; and the exposure time of another of the second image frames is shorter than the exposure time of the first image frame.
12. The electronic device of claim 8, wherein the at least one processing device is further configured to concatenate the feature maps having the aligned encoded features before decoding the feature maps having the aligned encoded features.
13. The electronic device of claim 8, wherein the first image frame is used as a reference frame and the second image frames are used as non-reference frames.
14. The electronic device of claim 8, wherein the convolutional neural network comprises a generative adversarial network.
15. A non-transitory machine-readable medium containing 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 having an exposure time different from an exposure time of the first image frame; encode each of the first image frame and the second image frames using a convolutional neural network to generate a corresponding feature map; generate at least one optical flow map representing pixel-wise differences between at least one pair of image frames among the first and second image frames using at least one optical flow network; and 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; wherein the instructions that when executed cause the at least one processor to align the encoded features comprise instructions that when executed cause the at least one processor to perform warping operations on the encoded features of the feature maps corresponding to the second image frames using the at least one optical flow map.
16. The non-transitory machine-readable medium of claim 15, wherein the instructions when executed further cause the at least one processor to: decode the feature maps having the aligned encoded features using the convolutional neural network to generate a target image frame of the scene.
17. The non-transitory machine-readable medium of claim 15, wherein the exposure time of each second image frame is shorter than the exposure time of the first image frame.
18. The non-transitory machine-readable medium of claim 15, wherein: the exposure time of one of the second image frames is longer than the exposure time of the first image frame; and the exposure time of another of the second image frames is shorter than the exposure time of the first image frame.
19. The non-transitory machine-readable medium of claim 15, wherein the instructions when executed further cause the at least one processor to: concatenate the feature maps having the aligned encoded features before decoding the feature maps having the aligned encoded features.
20. The non-transitory machine-readable medium of claim 15, wherein the first image frame is used as a reference frame and the second image frames are used as non-reference frames.
21. The non-transitory machine-readable medium of claim 15, wherein the convolutional neural network comprises a generative adversarial network.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) For a more complete understanding of this disclosure and its advantages, reference is now made to the following description taken in conjunction with the accompanying drawings, in which like reference numerals represent like parts:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
DETAILED DESCRIPTION
(14)
(15) 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.
(16) 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.
(17) 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.
(18) 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.
(19)
(20) According to embodiments of this disclosure, an electronic device 101 is included in the network configuration 100. The electronic device 101 can include at least one of a bus 110, a processor 120, a memory 130, an input/output (I/O) interface 150, a display 160, a communication interface 170, or a sensor 180. In some embodiments, the electronic device 101 may exclude at least one of these components or may add at least one other component. The bus 110 includes a circuit for connecting the components 120-180 with one another and for transferring communications (such as control messages and/or data) between the components.
(21) The processor 120 includes one or more of a central processing unit (CPU), an application processor (AP), or a communication processor (CP). The processor 120 is able to perform control on at least one of the other components of the electronic device 101 and/or perform an operation or data processing relating to communication. In some embodiments, the processor 120 can be a graphics processor unit (GPU). For example, the processor 120 can receive image data captured by at least one camera during a capture event. Among other things, the processor 120 can process the image data (as discussed in more detail below) using a convolutional neural network to perform motion warping.
(22) The memory 130 can include a volatile and/or non-volatile memory. For example, the memory 130 can store commands or data related to at least one other component of the electronic device 101. According to embodiments of this disclosure, the memory 130 can store software and/or a program 140. The program 140 includes, for example, a kernel 141, middleware 143, an application programming interface (API) 145, and/or an application program (or “application”) 147. At least a portion of the kernel 141, middleware 143, or API 145 may be denoted an operating system (OS).
(23) The kernel 141 can control or manage system resources (such as the bus 110, processor 120, or memory 130) used to perform operations or functions implemented in other programs (such as the middleware 143, API 145, or application program 147). The kernel 141 provides an interface that allows the middleware 143, the API 145, or the application 147 to access the individual components of the electronic device 101 to control or manage the system resources. The application 147 includes 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 middleware 143 can function as a relay to allow the API 145 or the application 147 to communicate data with the kernel 141, for instance. A plurality of applications 147 can be provided. The middleware 143 is able to control work requests received from the applications 147, such as by allocating the priority of using the system resources of the electronic device 101 (like the bus 110, the processor 120, or the memory 130) to at least one of the plurality of applications 147. The API 145 is an interface allowing the application 147 to control functions provided from the kernel 141 or the middleware 143. For example, the API 145 includes at least one interface or function (such as a command) for filing control, window control, image processing, or text control.
(24) The I/O interface 150 serves 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 device 101. The I/O interface 150 can also output commands or data received from other component(s) of the electronic device 101 to the user or the other external device.
(25) The display 160 includes, 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 display 160 can also be a depth-aware display, such as a multi-focal display. The display 160 is able to display, for example, various contents (such as text, images, videos, icons, or symbols) to the user. The display 160 can 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.
(26) The communication interface 170, for example, is able to set up communication between the electronic device 101 and an external electronic device (such as a first electronic device 102, a second electronic device 104, or a server 106). For example, the communication interface 170 can be connected with a network 162 or 164 through wireless or wired communication to communicate with the external electronic device. The communication interface 170 can be a wired or wireless transceiver or any other component for transmitting and receiving signals, such as images.
(27) The electronic device 101 further includes one or more sensors 180 that can meter a physical quantity or detect an activation state of the electronic device 101 and convert metered or detected information into an electrical signal. For example, one or more sensors 180 include one or more cameras or other image sensors for capturing images of a scene. The sensor(s) 180 may 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) 180 can further include an inertial measurement unit, which can include one or more accelerometers, gyroscopes, and other components. In addition, the sensor(s) 180 can include a control circuit for controlling at least one of the sensors included here. Any of these sensor(s) 180 can be located within the electronic device 101. The one or more cameras or other image sensors can optionally be used in conjunction with at least one flash 190. The flash 190 represents a device configured to generate illumination for use in image capture by the electronic device 101, such as one or more LEDs.
(28) The first external electronic device 102 or the second external electronic device 104 can be a wearable device or an electronic device-mountable wearable device (such as an HMD). When the electronic device 101 is mounted in the electronic device 102 (such as the HMD), the electronic device 101 can communicate with the electronic device 102 through the communication interface 170. The electronic device 101 can be directly connected with the electronic device 102 to communicate with the electronic device 102 without involving with a separate network. The electronic device 101 can also be an augmented reality wearable device, such as eyeglasses, that include one or more cameras.
(29) The wireless communication is able to use at least one of, for example, long term evolution (LTE), long term evolution-advanced (LTE-A), 5th generation wireless system (5G), millimeter-wave or 60 GHz wireless communication, Wireless USB, code division multiple access (CDMA), wideband code division multiple access (WCDMA), universal mobile telecommunication system (UMTS), wireless broadband (WiBro), or global system for mobile communication (GSM), as a cellular communication protocol. The wired connection can include, for example, at least one of a universal serial bus (USB), high definition multimedia interface (HDMI), recommended standard 232 (RS-232), or plain old telephone service (POTS). The network 162 or 164 includes at least one communication network, such as a computer network (like a local area network (LAN) or wide area network (WAN)), Internet, or a telephone network.
(30) The first and second external electronic devices 102 and 104 and server 106 each can be a device of the same or a different type from the electronic device 101. According to certain embodiments of this disclosure, the server 106 includes 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 device 101 can be executed on another or multiple other electronic devices (such as the electronic devices 102 and 104 or server 106). Further, according to certain embodiments of this disclosure, when the electronic device 101 should perform some function or service automatically or at a request, the electronic device 101, instead of executing the function or service on its own or additionally, can request another device (such as electronic devices 102 and 104 or server 106) to perform at least some functions associated therewith. The other electronic device (such as electronic devices 102 and 104 or server 106) is able to execute the requested functions or additional functions and transfer a result of the execution to the electronic device 101. The electronic device 101 can 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. While
(31) The server 106 can optionally support the electronic device 101 by performing or supporting at least one of the operations (or functions) implemented on the electronic device 101. For example, the server 106 can include a processing module or processor that may support the processor 120 implemented in the electronic device 101.
(32) Although
(33)
(34) As shown in
(35) Because of the short exposure time, the two short frames 203-204 record any moving objects with less or no motion blur (relative to the image frame 202). In contrast, the long exposure time of the long frame 202 results in possible blur for any moving objects. To correct the blur in the process 200, the electronic device 101 uses the long frame 202 as a reference frame and uses the short frames 203-204 as non-reference frames. The electronic device 101 aligns any moving objects in the short frames 203-204 with any corresponding moving objects in the long frame 202. 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 device 101 first encodes each of the short frames 203-204 into a feature space and then aligns the features. This gives more robust motion compensation without distorting image features, resulting in fewer errors.
(36) The electronic device 101 inputs the three image frames 202, 203, 204 to respective encoder networks 210. Each of the encoder networks 210 is 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 network 210 is composed of multiple convolutional layers 212. Each of the convolutional layers 212 represents 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 network 210 here is shown as including three convolutional layers 212, but each encoder network 210 could include different numbers of convolutional layers. In some embodiments, each encoder network 210 includes, or is part of, a generative adversarial network (GAN). The output of each encoder network 210 is a feature map that includes a number of features (such as 64, 128, 256, or other number of features). In the process 200, F.sub.L(x,y), F.sub.s1(x,y), and F.sub.s2(x,y) represent the encoded feature maps for the image frames 202, 203, and 204, respectively.
(37) The electronic device 101 also provides the non-reference short frames 203-204 to an optical flow network 206 for optical flow estimation. Optical flow estimation is a technique for pixel-wise prediction of motion in an image over time. In the process 200, the optical flow network 206 receives the short frames 203-204 and determines the motion between the short frames 203-204. The optical flow network 206 includes any suitable functions, processes, or algorithms for determining motion between image frames. In some embodiments, the optical flow network 206 can include a neural network, such as a convolutional neural network. The output of the optical flow network 206 is an optical flow map 208, which is a matrix of values indicating pixel-wise x and y differences (referred to as Δx and Δy) between the short frames 203-204.
(38) In the process 200, the encoded feature maps F.sub.s1(x,y) and F.sub.s2(x,y) generated from the short frames 203-204 are aligned to the feature map F.sub.L(x,y) generated from the long frame 202. To accomplish this, the electronic device 101 performs warping operations 214-215. Each warping operation 214-215 receives the optical flow map 208 generated from the optical flow network 206 and applies a translation operation to the corresponding encoded feature map F.sub.s1(x,y) or F.sub.s2(x,y). The translation amount is determined by the Δx and Δy values in the optical flow map 208. In some embodiments, each warping operation 214-215 is scaled down to match the downscaling from the image to the encoded feature maps. The warping operations 214-215 result in translated feature maps
(39)
(40) At this point in the process 200, the three feature maps representing the moving objects, namely
(41)
and F.sub.L(x,y), are aligned. The electronic device 101 combines the aligned features using a concatenator operation 216, and the combined features are input into a decoder network 220. The concatenated features encode the aligned sharp information from the short frames 203-204 to the motion blur regions of the long frame 202 so that the decoder network 220 can generate natural sharp edges.
(42) Like the encoder networks 210, the decoder network 220 is based on a convolutional neural network architecture. In some embodiments, the decoder network 220 includes, or is part of, a GAN. As shown in
(43) The decoder network 220 is trained to combine the feature map F.sub.L for the long frame 202 and the feature maps F.sub.s1 and F.sub.s2 for the short frames 203-204 and generate a sharp frame 230 (referred to as/target). The trained decoder network 220 optimizes the image quality of the sharp frame 230 such that the sharp frame 230 exhibits little or no blurring. In some embodiments, the decoder network 220 (particularly the residual blocks 222) perform a blending operation to generate the sharp frame 230. The sharp frame 230 can then be output as a final image for viewing, storing, or further image processing.
(44) Although
(45)
(46) During the training process 300, the electronic device 101 trains the convolutional neural network 305, which includes the encoder networks 210, the decoder network 220, or a combination of these. The training process 300 is performed to help define what a sharp frame 230 should look like. In order to perform the training process 300, the electronic device 101 obtains training data, which includes one or more long frames 202 and multiple short frames 203-204 associated with each long frame 202. 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 device 101 also obtains a ground-truth sharp frame 310 associated with each long frame 202. A method for obtaining the training data (including the long frames 202, short frames 203-204, and ground-truth sharp frames 310) is described below in conjunction with
(47) As shown in
(48) The electronic device 101 trains the convolutional neural network 305 by operating in an iterative manner to generate the restored sharp frame 230. Ideally, during multiple iterations through the training process 300, the convolutional neural network 305 generally improves the generation of the restored sharp frames 230 and moves towards producing the ground-truth sharp frames 310.
(49) For each iteration through the training process 300, the electronic device 101 may perform a loss computation function, which computes a total loss function for the convolutional neural network 305. The loss helps guide updating of weights of the convolutional neural network 305. For example, the electronic device 101 can compute the total loss function according to the following:
L=λL.sub.content+L.sub.GAN
where L is the total loss function, λ is a training parameter set to achieve a goal of balancing content loss and GAN loss, λL.sub.content is the content loss, and L.sub.GAN is the GAN loss. Content loss is a measurement of the difference between a ground-truth sharp frame 310 and a restored sharp frame 230. 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 in
(50) Based on the computed loss, the electronic device 101 adjusts the convolutional neural network 305 by updating the weights used by the convolutional neural network 305. For example, the electronic device 101 can alter the weights used in the generator 315, the discriminator 320, or other parameters of the convolutional neural network 305. Once the updated weights are determined, the electronic device 101 performs another iteration of training for the convolutional neural network 305. The overall goal of the training process 300 is to reduce or minimize the value of the loss function.
(51) Although
(52)
(53) As shown in
(54) The electronic device 101 selects two of the video frames 402 captured at different times to become the short frames 203-204. In
(55) To obtain the long frame 202 (which includes realistic motion blurred portions), the electronic device 101 blends multiple image frames together. To get a larger sample for blending that includes more representations of object movement, the electronic device 101 generates multiple interpolated frames 404 (represented in
(56) The resulting long frame 202, the short frames 203-204, and the ground-truth sharp frame 310 can be used as one set of training data for the training process 300. Additional training data can be generated by shifting the examined sample shown in
(57) Although
(58)
(59) As shown in
(60) The electronic device 101 inputs each of the three image frames 501, 502, 503 to a respective encoder network 511, 512, 513, which may be the same as or similar to the encoder networks 210 of
(61) The electronic device 101 also provides the non-reference long frame 501 and the reference normal frame 502 to a first optical flow network 505 for optical flow estimation. Similarly, the electronic device 101 provides the non-reference short frame 503 and the reference normal frame 502 to a second optical flow network 506 for optical flow estimation. The optical flow network 505 determines an optical flow map 508 from the long frame 501 to the normal frame 502, and the optical flow network 506 determines an optical flow map 509 from the short frame 503 to the normal frame 502. Each of the optical flow networks 505 and 506 may be the same as or similar to the optical flow network 206 of
(62) To align the feature maps F.sub.long, F.sub.short generated from the long frame 501 and the short frame 503, respectively, with the feature map F.sub.normal from the normal frame 502, the electronic device 101 performs warping operations 514-515, which may be the same as or similar to the warping operations 214-215 of
(63) The decoder network 520 is trained to select features from the different feature maps F.sub.long, F.sub.normal, F.sub.short, which are associated with different exposure levels, and blend the features to generate an HDR image frame 530 (referred to as I.sub.HDR). In some embodiments, the decoder network 520 applies an HDR blending algorithm to the feature maps in order to generate the HDR image frame 530 with reduced or minimal blur since the feature maps are well-aligned. The decoder network 520 may use any suitable blending technique or algorithm to generate an HDR image frame 530 based on multiple feature maps.
(64) Although
(65)
(66) During the training process 600, the electronic device 101 trains the convolutional neural network 605, which includes the encoder networks 511, 512, 513, the decoder network 520, or a combination of these. In order to perform the training process 600, the electronic device 101 obtains training data, which includes one or more long frames 501, one or more normal frames 502, and one or more short frames 503. In some embodiments, at least some of the training data can be generated using the process 400 of
(67) As shown in
(68) In the first stage (“Stage I”), the electronic device 101 trains the convolutional neural network 605 in 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 process 500. The frames 501, 502, 503 used as training samples in the first stage are selected to have only static scenes, since it is easier to create ground-truth HDR frames 610 from static scenes. In the second stage (“Stage II”), the electronic device 101 fine-tunes the convolutional neural network 605 using only GAN loss. In the second stage, the frames 501, 502, 503 selected as training samples include scenes that contain moving objects. Since the second stage of the training process 600 uses only the GAN loss (no content loss), ground-truth HDR frames 610 are not needed for fine tuning.
(69) Although
(70)
(71) As shown in
(72) The electronic device 101 inputs each of the three image frames 701, 702, 703 to a respective encoder network 711, 712, 713, which may be the same as or similar to the encoder networks 210 of
(73) To align the feature maps F.sub.1, F.sub.3 generated from the image frames 701 and 703, respectively, with the feature map F.sub.2 from the reference image frame 702, the electronic device 101 performs warping operations 714-715, which may be the same as or similar to the warping operations 214-215 of
(74) Although
(75)
(76) Although
(77)
(78) As shown in
(79) Each of the first image frame and the second image frames is encoded to generate a corresponding feature map at step 904. 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 device 101 encoding each of the image frames 202, 203, 204 using the encoder networks 210 or encoding each of the image frames 501, 502, 503 using the encoder networks 511, 512, 513.
(80) 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 step 906. This could include, for example, the electronic device 101 using the optical flow network 206 to generate the optical flow map 208 or using the optical flow networks 505-506 to generate the optical flow maps 508-509. A warping operation is performed on at least one of the feature maps using the at least one optical flow map at step 908. This could include, for example, the electronic device 101 performing the warping operations 214-215 using the optical flow map 208 or performing the warping operations 514-515 using the optical flow maps 508-509.
(81) The feature maps having the aligned encoded features are concatenated at step 910. This could include, for example, the electronic device 101 performing the concatenator operation 216 or the concatenator operation 516. The feature maps having the aligned encoded features are decoded at step 912 using the convolutional neural network in order to generate a target image frame of the scene. This could include, for example, the electronic device 101 decoding the aligned feature maps using the decoder network 220 or the decoder network 520 to generate the sharp frame 230 or the HDR image frame 530.
(82) Although
(83) 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.
(84)
(85) As shown in
(86) The electronic device 101 provides the image frames 1002, 1003, 1004 to an optical flow network 1006 for optical flow estimation. The electronic device 101 uses the optical flow network 1006 to compute the optical flow (motion) between the two short frames 1003-1004 and to compute blur kernels 1008 that approximate the motion direction for the long frame 1002. The blur kernels 1008 represent deconvolution kernels, which are a spatially varying set of filter kernels that can be used to sharpen an image. Each blur kernel 1008 can 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 network 1006 can operate by interpolating the optical flow into a blur kernel k according to the following:
(87)
(88) After the blur kernels 1008 are generated, the electronic device 101 provides the blur kernels 1008 to a kernel refine network 1010 in order to refine the blur kernels 1008. The kernel refine network 1010 is a convolutional neural network that operates to refine the blur kernels 1008 to fit an accurate exposure time window for the long frame 1002. The kernel refine network 1010 may 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 network 1010 is multiple refined kernels 1012. In some embodiments, the kernel refine network 1010 can 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:
(89)
where I.sub.sharp is the ground-truth sharp image, k is the estimated kernel, and I.sub.blur is the blur input.
(90) The electronic device 101 also estimates an occlusion mask 1014 for each of the short frames 1003-1004. Each occlusion mask 1014 estimates the background objects that are partially occluded by a moving object. The occlusion masks 1014 will be applied to the short frames 1003-1004 to recover lost background in the long frame 1002 as discussed below. The electronic device 101 can use any suitable technique for occlusion mask estimation.
(91) The electronic device 101 further performs an occlusion-aware deconvolution operation 1016. The occlusion-aware deconvolution operation 1016 is performed to recover the blurred object by applying the refined kernels 1012 to the long frame 1002 and restoring the occluded background area by applying occlusion masks 1014 to the short frames 1003-1004. For example, given the image frames 1002, 1003, 1004 (identified below as I.sub.L, I.sub.s1, and I.sub.s2) and the occlusion masks 1014 (identified below as M.sub.1 and M.sub.2) as inputs, the motion blur problem can be modeled as:
I.sub.L=I.sub.sharp*K++M.sub.1⊙I.sub.s1+M.sub.2⊙I.sub.s2.
Since the blur kernels k and the occlusion masks M.sub.1 and M.sub.2 are fixed, only the sharp image (identified below as I.sub.sharp) needs to be recovered, which can be expressed as follows:
I′.sub.L=I.sub.L−M.sub.1⊙I.sub.s1−M.sub.2⊙I.sub.s2
I′.sub.L=I.sub.sharp*K
The objective function to estimate I.sub.sharp may be expressed as follows, where a primal-dual update can be used to optimally compute Î.sub.sharp.
(92)
(93) In addition, the electronic device 101 performs a static background rendering 1018 to render the static background of the sharp image. For example, according to the per-pixel kernels, the electronic device 101 can estimate a static background mask M and apply alpha blending between the long frame 1002 (I.sub.L) and the estimated Î.sub.sharp to transfer the high-quality background from the input to a restored sharp image frame 1020.
(94) Although
(95)
(96) Although
(97)
(98) As shown in
(99) An optical flow network is used to generate blur kernels indicating a motion direction of the first image frame at step 1204. This could include, for example, the electronic device 101 using the optical flow network 1006 to generate the blur kernels 1008. The blur kernels are refined using a convolutional neural network at step 1206. This could include, for example, the electronic device 101 using the kernel refine network 1010 to generate the refined kernels 1012 from the blur kernels 1008. Occlusion masks are estimated for the second image frames at step 1208. This could include, for example, the electronic device 101 estimating the occlusion masks 1014 for the short frames 1003-1004.
(100) A target image frame of the scene is generated using the refined blur kernels and occlusion masks for the second image frames at step 1210. This could include, for example, the electronic device 101 generating the sharp image frame 1020 using the refined kernels 1012 and the occlusion masks 1014. 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 operation 1016 and the background rendering operation 1018.
(101) Although
(102) 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 device 101 or server 106 can be implemented or supported using one or more software applications or other software instructions that are executed by at least one processor 120 of the electronic device 101 or server 106. In other embodiments, at least some of the functions in the electronic device 101 or server 106 can 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.
(103) Although this disclosure has been described with reference to various example embodiments, various changes and modifications may be suggested to one skilled in the art. It is intended that this disclosure encompass such changes and modifications as fall within the scope of the appended claims.