System and method for synthesizing low-light images

A method of generating a low-light image is provided. The method includes receiving a raw image, removing an amount of first illumination from the raw image, applying a low exposure condition to the raw image having the amount of first illumination removed, and applying an amount of low-light illumination to the raw image having the applied low exposure condition.

BACKGROUND

The disclosure relates to a system, method and device for synthesizing low-light images such as nighttime images.

2. Description of Related Art

Capturing images at night and in low-light environments is challenging due to the low photon count hitting the camera sensor. Because of the weak signal, the image must be gained (i.e., using high ISO), which further amplifies the sensor noise. This is particularly troublesome for smartphone cameras, where the sensor's small form factor limits the amount of light per pixel, resulting in significant noise levels in low-light and night environments. When noisy sensor images are processed by the camera's image signal processor (ISP), the noise is often amplified, resulting in noisy and aesthetically unappealing final standard RGB (sRGB) output images. Capturing the scene using a long exposure (e.g., several seconds) is often not viable as it requires the camera to be placed on a tripod to avoid camera shake and the scene needs to remain static to avoid motion blur. Some systems implement neural networks to process a noisy nighttime image to improve the quality of the image. However, a large number of training pairs (e.g., an input noisy image and a ground-truth image) is required, which is expensive and time consuming. Furthermore, the input noisy image and ground-truth images vary from sensor to sensor, meaning that a neural network trained based on a first sensor may not necessarily operate correctly on a second sensor.

SUMMARY

In accordance with an aspect of the disclosure, a method of generating a low-light image may include receiving a raw image, removing an amount of first illumination from the raw image, applying a low exposure condition to the raw image having the amount of first illumination removed, and applying an amount of low-light illumination to the raw image having the applied low exposure condition.

In accordance with an aspect of the disclosure, a system for generating a low-light image may include a memory storing instructions and a processor configured to execute the instructions to receive a raw image, remove an amount of first illumination from the raw image, apply a low exposure condition to the raw image having the amount of first illumination removed, and apply an amount of low-light illumination to the raw image having the applied low exposure condition.

In accordance with an aspect of the disclosure, a non-transitory, computer-readable storage medium may store instructions that, when executed, cause at least one processor to receive a raw image, remove an amount of first illumination from the raw image, apply a low exposure condition to the raw image having the amount of first illumination removed, and apply an amount of low-light illumination to the raw image having the applied low exposure condition.

DETAILED DESCRIPTION

FIG.1is a diagram of a system according to an embodiment.FIG.1includes a user device110, a server device120, and a network130. The user device110and the server device120may interconnect via wired connections, wireless connections, or a combination of wired and wireless connections.

The user device110may include a computing device (e.g., a desktop computer, a laptop computer, a tablet computer, a handheld computer, a smart speaker, a server device, etc.), a mobile phone (e.g., a smart phone, a radiotelephone, etc.), a camera device, a wearable device (e.g., a pair of smart glasses or a smart watch), or a similar device.

The server device120includes one or more devices. For example, the server device120may be a server device, a computing device, or the like.

FIG.2is a diagram of components of one or more devices ofFIG.1according to an embodiment. Device200may correspond to the user device110and/or the server device120.

As shown inFIG.2, the device200may include a bus210, a processor220, a memory230, a storage component240, an input component250, an output component260, and a communication interface270.

The bus210includes a component that permits communication among the components of the device200. The processor220is implemented in hardware, firmware, or a combination of hardware and software. The processor220is a central processing unit (CPU), a graphics processing unit (GPU), an accelerated processing unit (APU), a microprocessor, a microcontroller, a digital signal processor (DSP), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), or another type of processing component. The processor220includes one or more processors capable of being programmed to perform a function.

The memory230includes a random access memory (RAM), a read only memory (ROM), and/or another type of dynamic or static storage device (e.g., a flash memory, a magnetic memory, and/or an optical memory) that stores information and/or instructions for use by the processor220.

The input component250includes a component that permits the device200to receive information, such as via user input (e.g., a touch screen display, a keyboard, a keypad, a mouse, a button, a switch, and/or a microphone). The input component250may include a sensor for sensing information (e.g., a global positioning system (GPS) component, an accelerometer, a gyroscope, and/or an actuator).

The output component260includes a component that provides output information from the device200(e.g., a display, a speaker, and/or one or more light-emitting diodes (LEDs)).

The communication interface270includes a transceiver-like component (e.g., a transceiver and/or a separate receiver and transmitter) that enables the device200to communicate with other devices, such as via a wired connection, a wireless connection, or a combination of wired and wireless connections. The communication interface270may permit device200to receive information from another device and/or provide information to another device. For example, the communication interface270may include an Ethernet interface, an optical interface, a coaxial interface, an infrared interface, a radio frequency (RF) interface, a universal serial bus (USB) interface, a Wi-Fi interface, a cellular network interface, or the like.

The device200may perform one or more processes described herein. The device200may perform operations based on the processor220executing software instructions stored by a non-transitory computer-readable medium, such as the memory230and/or the storage component240. A computer-readable medium is defined herein as a non-transitory memory device. A memory device includes memory space within a single physical storage device or memory space spread across multiple physical storage devices.

Software instructions may be read into the memory230and/or the storage component240from another computer-readable medium or from another device via the communication interface270. When executed, software instructions stored in the memory230and/or storage component240may cause the processor220to perform one or more processes described herein.

Additionally, or alternatively, hardwired circuitry may be used in place of or in combination with software instructions to perform one or more processes described herein. Thus, embodiments described herein are not limited to any specific combination of hardware circuitry and software.

FIG.3is a diagram of captured images, according to an embodiment. Image302is an example of a ground-truth nighttime image and image304is an example of a nighttime image captured by a camera or sensor. The ground-truth image302may have been captured via long-exposure, by a camera specialized for nighttime capture, etc., whereas image304may have been captured by a non-specialized, ordinary camera (e.g., sensor in a portable device). Thus, image304includes undesirable noise.

To remove the noise from, for example, image304, one method may include implementing a neural network, and training the neural network based on the ground-truth image302and the noisy image304. However, capturing nighttime ground-truth images requires significant time and resources (i.e., long exposure capturing, specialized equipment, etc.). Furthermore, the noisy image304may be captured from one type of sensor, and any training performed based on the noisy image304may not operate correctly for another type of sensor (e.g., different sensors in different portable devices).

Provided herein is a system and method for generating, from daytime or other high-illumination images, images with simulated low-light or nighttime illumination and simulated noise that can be used as pairs to train networks for removing noise from captured low-light or nighttime images. While certain examples in this disclosure refer to “nighttime” and “daytime” images, this disclosure contemplates that the systems and methods disclosed herein may be used to synthesize low-light images from high-illumination images in general.

By generating images with simulated nighttime illumination from captured daytime images, the resources required to properly train a network (e.g., to generate training image pairs) are significantly reduced due to the ease at which quality daytime images can be captured (i.e., due to outdoor, natural lighting, daytime images of sufficient quality can be captured with less expensive equipment and the capturing process does not require long exposure times).

FIG.4is a diagram of an example of simulating nighttime lighting and noise in an image, according to an embodiment. According to embodiments of the disclosure, a daytime image402may be captured, and nighttime illumination may be simulated on the image402, as shown by image404. Additionally, noise may be simulated on the image404, as shown in image406. Thus, image404and406may be used as a training pair, where image404functions as the ground-truth image.

FIG.5is a flowchart of a method for generating nighttime images, according to an embodiment.FIG.6is a diagram of a captured daytime image, according to an embodiment.FIG.7is a diagram of a daytime raw image, according to an embodiment. In operation502, the system receives a daytime raw image. Image602is an example of a captured daytime image as the image would be displayed on a display screen. However, image702is an example of the raw daytime image of image602. The raw image may refer to the image as captured by the sensor before the image is processed (i.e., image702may be the raw image and image602may be the processed and displayed image). In an embodiment, the image702may be denoted as

Iday∈ℝH2×W2×4,
where H and W denote the image size in pixels. For visualization purposes, the raw images in the figures have been demosiaced, and gamma has been applied.

FIG.8is a diagram of a normalized daytime raw image, according to an embodiment. In operation504, the system normalizes the daytime raw image. Image802is an example of a normalized daytime raw image. Each pixel of the daytime raw image (e.g., image702) may have integer values between 0 and a predefined white level setting (e.g., [0. white_level]), where white_level corresponds to the maximum reading value of the sensor. Thus, the system normalizes the daytime raw image to floating point values of 0 to 1 (i.e., the value of 1 replaces the value of white_level). In an embodiment, the normalized image802may be denoted as

In=Iday-blwl-bl,
where bland wldenote the black-level and white-level provided by the metadata of a camera.

FIG.9is a diagram of a daytime raw image with an amount of daytime illumination removed, according to an embodiment. In operation506, the system removes day lighting from the normalized daytime raw image. The system may remove day lighting from the normalized daytime image by applying a white balance. In one embodiment, the system may remove day-lighting based on an auto-white-balance (AWB) routine of a camera capturing the raw image. Image902is an example of an image with an amount of daytime illumination removed (e.g., having a white balancing operation applied to it). The white balanced image may be represented as Iw=InLday, where Inis the normalized image, and

Lday=diag⁡(1r,1g,1g,1b)
and Ldayis determined using the daytime illuminant estimate from the AWB function of the camera. The green-channel values g in Ldaymay be normalized to 1. The system may apply an as-shot neutral to the raw image to white balance the image. The as-shot neutral may refer to the daytime illuminant as estimated by a camera described above and may be provided as metadata with the raw image.

FIG.10is a diagram of a daytime raw image with an applied low exposure condition, according to an embodiment.FIG.11is a graph showing distribution of average intensity, according to an embodiment. In operation508, the system applies a low exposure condition on the normalized raw image with the removed daytime illumination. Image1002is an example of an image (e.g., image902) having an applied low exposure condition. The low exposure condition may be determined based on a sample of nighttime average intensity. Graph1102shows a distribution of average intensity for a set of sampled daytime images and nighttime images, and the low exposure condition may be determined based on the average intensity for the set of sampled nighttime images. The system may apply the low exposure condition by multiplying the image (i.e., the pixel values of the image) by a global scale factor. The global scale factor may be determined based on the distribution of average intensity of the set of sampled nighttime images. The global scale factor may also be randomly selected around the distribution of average intensity. Applying the low exposure condition darkens the image, simulating a nighttime image without nighttime illuminations. The resulting darkened image may be expressed as Ie=Iw*d, where d corresponds to the global scale factor.

In operation510, the system applies a nighttime illumination to the raw image with the applied low exposure. The system may apply the nighttime illumination as global single illuminant (e.g., a single illuminant applied to the raw image). The system may also apply the nighttime illumination as one or more local illuminants (e.g., illuminants applied to portions, sections, or specific pixels of the raw image).

FIG.12is a diagram of a raw image with an applied amount of nighttime illumination, according to an embodiment. Image1202is an example of an image where a global single illuminant is applied. The system may determine a nighttime illuminant from a distribution of nighttime illuminants and then color cast the image1202with the determined nighttime illuminant. In some embodiments, the system acquires images of a gray card under different night illuminations (e.g., full nighttime environments, nighttime environments with local lighting and reflections, low-light environments, etc.) to obtain a set or dictionary (e.g., a database) of nighttime illuminations. To relight the scene with a global single illuminant, the system may randomly sample a nighttime illuminant. The system may fit a two-dimensional Gaussian distribution of joint chromaticity values

(rg⁢and⁢bg)
around the database of night illuminations. Then the system may randomly sample night illuminant y from the distribution as in Equations (1) and (2):

where μ and Σ are the mean and covariance of the normalized chromaticity values in, respectively, M is the number of night illuminants in, and y, μ∈2, and Σ∈2×2.

Additionally, or alternatively, the system may apply the nighttime illumination as local illuminants by sampling a small set (e.g., five to seven) of nighttime illuminants. The relit image Irmay be expressed as in Equation (3):

where Lnighti=diag(ri, gi, gi, bi), with i={1, . . . , N}, representing the set of night illumination samples. The scalar wiis used to control the strength of the light source. The mask Mimay be modeled as a two-dimensional Gaussian function G(xi, yi, σxi, σyi). The system may randomly position a light source with a center of (xi, yi) that lies within the image excluding, for example, a boundary percentage (e.g., excluding 10% of the image near the edges of the image). The spread of the light source is modulated by (σxi, σyi), which may be randomly selected between [0.5, 1] of the image size. Ierepresents the image with the applied lower exposure condition. The same Gaussian kernel may be applied to all channels

(i.e.,Mi∈ℝH2×W2×4,
where H, W denote the image size in pixels). The operator ⊙ may denote element wise multiplication. One of the illuminants (e.g., i=1), may be selected as an ambient light, with mask M1being a mask of all 1s and having a weak strength w1set between 5% and 10% of the other illuminants. Irmay be denormalized by the white level to obtain the synthetic nighttime image as Inight=Ir(wl−bl)+bl.

FIG.13is a diagram of a relighting mask, according to an embodiment. The mask1302may include an illumination area1304that, when applied to an image, provides a local illumination to the image. The number of illumination areas may be random and/or uniform. The color of the illumination area1304may be determined from a random sample from a two-dimensional Gaussian distribution. The location of the illumination area1304may be random and/or uniform or at a predetermined location on the mask1302. The shape of the illumination area1304may be determined based on a two-dimensional Gaussian distribution, with an automatically selected sigma. The size of the illumination area1304may be random and/or uniform, or may be of a predetermined portion percentage of the mask1302. The intensity of the illumination area1304may be scaled to a maximum level (e.g., 1.0) or at values lower than the maximum level.

Image1416may be generated and rendered with an average illuminant

FIG.15is a diagram showing an example of an applied lighting mask, according to an embodiment. Image1502is an example of an image that has been processed according to operations502-508. Image1504is an example where multiple local illuminants have been applied to image1502.

FIG.16is a diagram of an application of a lighting mask to a raw image, according to an embodiment. A daytime white balanced image1602may be produced from a raw sensor image, and the raw sensor image may be locally relit as image1614. The masks1604,1606,1608and1610may be combined to form a combined mask1612, and the combined mask1612may be applied to form locally relit image1614.

FIG.17is a diagram showing examples of applying amounts of nighttime illumination to images, according to an embodiment. Image1702is an example of a daytime white balanced image rendered from the raw sensor image, and image1704is an example of the raw sensor image with the daytime illumination removed. The system may determine locations of lights or windows or other objects in the image that generate and/or reflect light, thereby providing a light source within the image when the objects are active. In image1706, the raw image is relit based on illumination samples. Image1706may be rendered to produce a nighttime clean image, as in image1708. In image1706and1708, local illuminants are applied to locations of lamps, such as lamp1710, to simulate the nighttime illumination.

In operation512, the system may output the clean raw image with applied nighttime illumination. The system may set the output clean raw image as a ground-truth image for later training of a neural network.

FIG.18is a diagram of an application of noise to an image, according to an embodiment. In operation514, the system may apply noise to the raw image with the applied nighttime illumination. For example, image1802is a clean image with nighttime illumination applied, and the system may apply noise to the image1802to produce image1804. The system may apply noise to the image1802based on noise parameters from a target sensor. That is, the noise may be signal-dependent. By applying noise to the image1802, an image may be generated that simulates sensor infractions when capturing a nighttime image.

The image Inightmay represent a high-quality long-exposure, low-ISO nighttime image. Adding noise to Inightproduces a low-quality, short-exposure, high-ISO nighttime image. The noisy raw image may be generated as in Equation (4):
Ĩnight←Inight+(0,β1Inight,+β2)  (4)

where β1and β2are the shot and read noise parameters, respectively. β1and β2may be empirically determined for different ISO levels based on measuring the noise of real noisy/clean nighttime image pairs.

In operation516, the system outputs the raw image with the applied noise. The system may set the image with the applied noise as a degraded nighttime image and train a neural network based on the ground-truth image being the target image that was output at operation512.

FIG.19is a flowchart of a method for generating low-light images, according to an embodiment. In operation1902, the system receives a raw image. In operation1904, the system removes an amount of first illumination from the raw image. In operation1906, the system applies a low exposure condition to the raw image having the amount of first illumination removed. In operation1908, the system applies an amount of low-light illumination to the raw image having the applied low exposure condition.

Some embodiments may relate to a system, a method, and/or a computer readable medium at any possible technical detail level of integration. The computer readable medium may include a computer-readable non-transitory storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out operations.

The descriptions of the various aspects and embodiments have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Even though combinations of features are recited in the claims and/or disclosed in the specification, these combinations are not intended to limit the disclosure of possible implementations. In fact, many of these features may be combined in ways not specifically recited in the claims and/or disclosed in the specification. Although each dependent claim listed below may directly depend on only one claim, the disclosure of possible implementations includes each dependent claim in combination with every other claim in the claim set. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.