Patent ID: 12229914

DETAILED DESCRIPTION

This specification describes a system that performs highlight recovery on a region of clipped pixels while maintaining a required data precision.

FIG.3is a block diagram of an image processing pipeline300of an ISP that includes a highlight recovery block312.

FIG.1is a block diagram of an image processing pipeline100of a prior art image signal processor (ISP) that performs color propagation highlight recovery.

The input to the ISP is raw pixel data302, e.g., pixel data captured by a camera. the raw pixel data302can include a value of one or more channels for each pixel. The input data for each pixel in the raw pixel data102has a bit precision of bpp_in.

After receiving the raw pixel data302, the ISP can process the raw pixel data302using a sequence of one or more blocks304,306,308, and310before performing highlight recover in block312to generate output pixel data322. One or more of the blocks can be non-gain-applying blocks (in the example depicted inFIG.3, block304and306). One or more of the blocks can be gain applying blocks (in the example depicted inFIG.1, blocks308and310). AlthoughFIG.3depicts a sequence of non-gain-applying blocks followed by a sequence of gain-applying blocks, generally the gain-applying and non-gain-applying blocks can be in any order in the ISP.

The non-gain-applying blocks generate output data that has the same data precision bpp_in as the input data to the blocks. For example, the non-gain-applying blocks of the ISP can include a linearization block304and a black level correction block306.

The gain-applying blocks generate output data that requires a higher data precision that the input data to the blocks. That is, one or more pixel values in the output data of the blocks exceed the maximum value allowed by the data precision bpp_in. For example, the gain-applying blocks of the ISP can include a lens shading correction block308and a white balance gain block310.

The gain-applying blocks308and310do not clip the channel values of the pixels whose data precision exceeds bpp_in. Instead, the blocks maintain the unclipped values of the pixels, allotting more bits per pixel in the output data than were allowed in the input data to the blocks.

As a particular example, the lens shading correction block308receives input data with precision bpp_in and adds an additional N bpp, so that the output data of the block308has a data precision of bpp_in +N. Similarly, the white balance gain block310receives input data with precision bpp_in +N and adds an additional M bpp, so that the output data of the block310has a data precision of bpp_in +N+M In some implementations, other gain-applying blocks can also be included in the ISP, e.g., a “Digital Gain” block.

Following the gain applying blocks308and310is a highlight recovery block312, which performs a hue correction process on the channel values of the pixels. The highlight recovery block312receives input data with precision bpp_in +N+M and generates the output pixel data322that has data precision bpp_in. That is, the highlight recovery block312recovers the hue of each pixel in the input data of the block312while also reducing the data precision of the pixels back down to the required data precision bpp_in. In particular, the highlight recovery block312can identify the one or more pixels represented in the input data of the block312that have a data precision greater than bpp_in, and processes those pixels so that their unclipped hue is preserved but their data precision is returned to bpp_in. A data precision of bpp_in might be required by a downstream block of the ISP to further process or display the image, or it might be required to satisfy a storage constraint on the size of the image.

In particular, the the highlight recovery block312receives unclipped pixel channel data as input. To recover the hue of a pixel whose data precision is greater than bpp_in, the highlight recovery block312processes i) the unclipped pixel channel data and ii) a clipped version of the unclipped pixel channel data using a recovery pipeline313of the highlight recover block312.

At block314of the recovery pipeline313, the highlight recovery block312processes, for each pixel in the unclipped pixel channel data, the unclipped channel values of the pixel to generate an unclipped hue for the pixel. This process is described in more detail below with reference toFIG.6.

At block316of the recovery pipeline313, the highlight recovery block312clips, for each pixel in the unclipped pixel channel data, the channel values of the pixel to generate clipped channel values. The clipped channel values of the pixel have a data precision of bpp_in.

At block318of the recovery pipeline313, the highlight recovery block312processes, for each pixel, the clipped channel values of the pixel to generate a clipped hue for the pixel.

At block320of the recovery pipeline313, the highlight recovery block312combines, for each pixel, the unclipped hue of the pixel and the clipped hue of the pixel to recover the hue in the clipped channel values and generate the output pixel data322. This process is described in more detail below with reference toFIG.7. The output pixel data322includes final pixel channel values for each pixel that have the correct hue and satisfy the data precision requirement of bpp_in. The output pixel data322can then be passed to later blocks of the ISP.

For each pixel, processing the pixel using the highlight recovery block312to recover the hue of the pixel only requires the ISP to store the clipped and unclipped versions of the pixel's values, instead of the values of the given pixel and multiple surrounding pixels as is required in some existing systems. Thus, the hardware and SRAM requirements of the process described with reference toFIG.3are significantly less than in the prior art color propagation highlight recovery process described above. In some implementations, the process ofFIG.3does not require SRAM at all.

FIG.4is a diagram400of an example image that was processed by an ISP using a highlight recovery process, e.g., the highlight recover process described above with reference toFIG.3.

The image is of the same neon sign that reads “Drive-Thru Open” as appears inFIG.2. The letters that read “Drive-Thru” are blue neon lights and the letters that read “Open” are red neon lights.

As depicted in the diagram400, each of the blue letters spelling “Drive-Thru” has two regions: a white region410, and a blue region420. Unlike in the image generated by color propagation highlight recovery depicted inFIG.2, there is essentially no discolored region.

In the center of each blue neon letter is the white region410. The image has white pixels in the white region410, because the intensity of the light in that region resulted in maximum pixel values, given the exposure setting of the device that generated the image.

Surrounding the white region410of each blue neon letter is the blue region420. Many of the pixels in the blue region420, particularly those closest to the white region410, experienced data precision gain. If the values of these pixels had been clipped by the gain applying blocks of the ISP and processed by a color propagation highlight recovery block, e.g., the color propagation highlight recovery block112depicted inFIG.1, then the pixels would have been discolored, as they were in the discolored region220ofFIG.2. However, the values of the pixels were not clipped by the gain applying blocks; instead, the values were preserved and later processed by a highlight recovery block of the ISP, e.g., the highlight recovery block312depicted inFIG.3. Thus, the pixels properly recovered their hue, and the image correctly has only blue pixels (represented by dots) in the blue region420.

The red neon lights spelling “Open” show similar features. Each of the red letters has two regions: a white region430and a red region440. There is no discolored region.

In the center of each red neon letter is the white region430. The image has white pixels in the white region240, because the intensity of the light in that region resulted in maximum pixel values, given the exposure setting of the device that generated the image.

Surrounding the white region320of each red neon letter is the red region440. Many of the pixels in the red region440, particularly those closest to the white region430, experienced data precision gain and were processed by the highlight recovery block of the ISP. As described above, the pixels properly recovered their hue, and the image correctly has only red pixels (represented by plaid) in the red region440.

FIG.5is a flowchart of an example process500for hue correction. The process can be implemented by one or more computer programs installed on one or more computers and programmed in accordance with this specification. For example, the process500can be performed by a highlight recovery block of an ISP, e.g., the highlight recovery block312shown inFIG.3. For convenience, the process will be described as being performed by a system of one or more computers.

The system receives unclipped pixel channel values for multiple pixels of an image (step510). The channel values for one or more pixels have a data precision that exceeds a maximum data precision bpp_in.

The system determines hue values for each pixel using the respective pixel channel values (step520). An example process for determining hue values is described in more detail below with reference toFIG.6.

The system generates clipped channel values for each pixel (step530). A clipped channel value equals the respective unclipped channel value if the unclipped channel value is less than or equal to a threshold value, and equals the threshold value if the unclipped channel value is greater than the threshold value. The threshold value can be determined according to the maximum data precision bpp_in. For example, as stated above, a bpp_in of 24 allows for each channel to have a value between 0 and 255, and so the threshold value can be set to 255.

The system generates, for each pixel, final channel values using the hue values of the pixel and the clipped channel values of the pixel (step540). An example process for generating final channel values is described in more detail below with reference toFIG.7. The final channel values have the correct hue and satisfy the data precision requirement, and can be provided to later blocks of the ISP.

FIG.6is a flowchart of an example process600for generating hue values of a pixel using unclipped channel values of the pixel. The process can be implemented by one or more computer programs installed on one or more computers and programmed in accordance with this specification. For example, the process600can be performed by a highlight recovery block of an ISP, e.g., the highlight recovery block312shown inFIG.3. For convenience, the process will be described as being performed by a system of one or more computers.

For convenience, the below description refers to pixel channel data that is represented by R, G, and B channels. However, it is to be understood that the process600can be applied for any choice of channels.

The system determines a mean μunclippedof the unclipped channel values {R,G,B} of the pixel (step610). For example, the system can determine the mean μunclippedto be the average of the channel values, i.e., (R+G+B)/3. As another example, the system can determine μunclippedto be a more generic weighted mean. As a particular example, the system can determine μunclipped=wRR+wGG+wBB, where w{R,G,B}□[0,1] and wR+wG+wB=1.

The system generates initial hue values μunclippedfor the pixel (step620). For example, the system can generate the initial hue values μunclippedby calculating the difference between the unclipped channel values {R,G,B} and the mean μunclippedof the unclipped channel values, i.e., μunclipped={R,G,B}−μunclipped.

The system generates hue values hueunclippedby normalizing the initial hue values (step630). The initial hue values μunclippedcan be normalized by dividing the initial hue values μunclippedby a length of a vector composed of the initial hue values,

e.g.,hu⁢eu⁢n⁢clipped=ρu⁢n⁢clippedρu⁢n⁢clipped2,
where ∥⋅∥2is the L2-norm. The hue values hueunclippedcan be used to recover the hue of clipped versions of the channel values of the pixel, e.g., using the process described below with reference toFIG.7.

FIG.7is a flowchart of an example process700for generating final channel values of a pixel using clipped channel values and hue values of the pixel. The process can be implemented by one or more computer programs installed on one or more computers and programmed in accordance with this specification. For example, the process700can be performed by a highlight recovery block of an ISP, e.g., the highlight recovery block312shown inFIG.3. For convenience, the process will be described as being performed by a system of one or more computers.

For convenience, the below description refers to pixel channel data that is represented by R, G, and B channels. However, it is to be understood that the process600can be applied for any choice of channels.

The system determines a mean μclippedof the clipped channel values {R,G,B}clipped(step710). As described above, the system can determine the mean μclippedto be the average of the channel values, i.e., (Rclipped+Gclipped+Bclipped)/3. As another example, the system can determine the μclippedto be a more generic weighted mean, e.g., wRRclipped+wGGclipped+wBBclipped.

The system generates clipped hue values μclipped(step720). For example, the system can generate the initial hue values μclippedby calculating the difference between the clipped channel values {R,G,B}clippedand the mean μclippedof the clipped channel values, i.e., μclipped={R,G,B}clipped−μclipped.

The system obtains unclipped hue values hueunclippedof the pixel generated using the unclipped channel values of the pixel (step725). For example, the system can generate the hue values hueunclippedusing the process described above with respect toFIG.6.

The system generates scaled hue values huescaledby scaling the unclipped hue values of the pixel hueunclippedusing the clipped hue values ρclipped(step730). The unclipped hue values hueunclippedcan be scaled by multiplying the unclipped hue values by a length of a vector composed of the clipped hue values. As a particular example, the system can compute
huescaled=hueunclipped·∥ρclipped∥2

where ∥⋅∥2is the L2-norm.

The system generates final channel values {R,G,B}finalfor the pixel using the scaled hue values huescaled(step794). For example, the system can determine the sum of i) the mean of the clipped values μclippedand i) the scaled hue values huescaled, i.e.,
{R,G,B}final=huescaled+μclipped.

The system can then pass the final values {R,G,B}finalto later blocks of the ISP.

In some implementations, the system can apply tone adjustments to each of the channels of a given pixel before or after highlight recovery.

In some implementations, the system can perform highlight recovery on an image after demosaicing the image. In other words, the system can process the output of an image sensor overlaid with a color filter array, e.g., a Bayer filter, to convert the output into a different color space, e.g., the RGB color space. In some other implementations, the system can demosaic the image after performing highlight recovery.

Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by, or to control the operation of, data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them. Alternatively or in addition, the program instructions can be encoded on an artificially-generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus.

The term “data processing apparatus” refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can also be, or further include, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment for computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.

A computer program which may also be referred to or described as a program, software, a software application, an app, a module, a software module, a script, or code) can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub-programs, or portions of code. A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a data communication network.

For a system of one or more computers to be configured to perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that in operation cause the system to perform the operations or actions. For one or more computer programs to be configured to perform particular operations or actions means that the one or more programs include instructions that, when executed by data processing apparatus, cause the apparatus to perform the operations or actions.

The processes and logic flows described in this specification can be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers.

Computers suitable for the execution of a computer program can be based on general or special purpose microprocessors or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. The central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few.

Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.

To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and pointing device, e.g., a mouse, trackball, or a presence sensitive display or other surface by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user's device in response to requests received from the web browser. Also, a computer can interact with a user by sending text messages or other forms of message to a personal device, e.g., a smartphone, running a messaging application, and receiving responsive messages from the user in return.

In addition to the embodiments described above, the following embodiments are also innovative:

Embodiment 1 is a system comprising:

an image capture device configured to generate raw image data of an image, the raw image data comprising, for each of a plurality of highlight regions in the image, original channel values for one or more channels of the highlight region; and

an image signal processor comprising:one or more components of an image processing pipeline that are configured to process the raw image data to generate updated image data, wherein the updated image data comprises updated channel values for each highlight region in the image, and wherein, for each of one or more highlight regions of the image, one or more updated channel values of the highlight region exceed a maximum channel value according to a predetermined data precision, anda highlight recovery circuit configured to perform a hue correction process on the updated channel values of the one or more highlight regions of the image, wherein performing the hue correction process comprises processing the updated channel values to generate final channel values that i) satisfy the predetermined data precision and ii) recover hue values of the one or more highlight regions of the image.

Embodiment 2 is the system of embodiment 1, wherein the highlight regions are individual pixels and wherein the one or more channels comprise an R channel, a G channel, and a B channel.

Embodiment 3 is the system of embodiment 1, wherein the highlight regions are groups of four pixels arranged in two-by-two grids in a color filter array, wherein each of the pixels has a single value representing a single color, and wherein the one or more channels comprise the values of the four pixels.

Embodiment 4 is the system of any one of embodiments 1-3, wherein performing the hue correction process comprises, for each highlight region in the image:calculating hue values including adjusting the respective updated channel values for each of the one or more channels of the highlight region, wherein the hue values represent a proportion of the updated channel values of the channels;generating a clipped channel value for each of the one or more channels, wherein the clipped channel value equals the respective updated channel value if the updated channel value is less than or equal to the maximum channel value, and equals the maximum channel value if the updated channel value is greater than the maximum channel value; andcalculating a final channel value for each of the one or more channels including adjusting the respective clipped channel values using the respective hue values to emulate the proportion of the updated channel values of the channels.

Embodiment 5 is the system of embodiment 4, wherein calculating, for each highlight region in the image, hue values further comprises:determining a measure of central tendency of the respective updated channel values of the one or more channels of the highlight region; andcalculating hue values including adjusting the respective updated channel values for each of the one or more channels using the measure of central tendency of the updated channel values of the highlight region.

Embodiment 6 is the system of embodiment 5, wherein calculating, for each highlight region in the image, a final channel value for each of the one or more channels comprises:determining a measure of the central tendency of the clipped channel values of the one or more channels; andcalculating a final channel value for each of the one or more channels including adjusting the respective clipped channel values using the respective hue values and the measure of central tendency of the clipped channel values of the highlight region.

Embodiment 7 is the system of embodiment 6, wherein for each highlight region:

the measure of central tendency of the updated channel values and the clipped channel values of the one or more channels is a mean of the respective channel values; and

calculating the hue values of the one or more channels comprises:generating initial hue values by calculating the difference between the updated channel values and the mean of the updated channel values; andgenerating the hue values by normalizing the initial hue values comprising dividing the initial hue values by a length of a first vector wherein each element of the first vector is an initial hue value.

Embodiment 8 is the system of embodiment 7, wherein calculating the final channel values of the one or more channels comprises:generating scaled hue values by scaling the hue values by a length of a second vector, wherein each element of the second vector is a difference between the clipped channel value of a channel and the mean of the clipped channel values; andgenerating the final channel values by adding the scaled hue values to the mean of the clipped channel values.

Embodiment 9 is a method comprising:

receiving raw image data of an image, the raw image data comprising, for each of a plurality of highlight regions in the image, original channel values for one or more channels of the highlight region;

processing the raw image data to generate updated image data, wherein the updated image data comprises updated channel values for each highlight region in the image, and wherein, for each of one or more highlight regions of the image, one or more updated channel values of the highlight region exceed a maximum channel value according to a predetermined data precision; and

performing a hue correction process on the updated channel values of the one or more highlight regions of the image, wherein performing the hue correction process comprises processing the updated channel values to generate final channel values that i) satisfy the predetermined data precision and ii) recover hue values of the one or more highlight regions of the image.

Embodiment 10 is the method of embodiment 9, wherein the highlight regions are individual pixels and wherein the one or more channels comprise an R channel, a G channel, and a B channel.

Embodiment 11 is the method of embodiment 9, wherein the highlight regions are groups of four pixels arranged in two-by-two grids in a color filter array, wherein each of the pixels has a single value representing a single color, and wherein the one or more channels comprise the values of the four pixels.

Embodiment 12 is the method of any one of embodiments 8-11, wherein performing the hue correction process comprises, for each highlight region in the image:

calculating hue values including adjusting the respective updated channel values for each of the one or more channels of the highlight region, wherein the hue values represent a proportion of the updated channel values of the channels;

generating a clipped channel value for each of the one or more channels, wherein the clipped channel value equals the respective updated channel value if the updated channel value is less than or equal to the maximum channel value, and equals the maximum channel value if the updated channel value is greater than the maximum channel value; and

calculating a final channel value for each of the one or more channels including adjusting the respective clipped channel values using the respective hue values to emulate the proportion of the updated channel values of the channels.

Embodiment 13 is the method of embodiment 12, wherein calculating, for each highlight region in the image, hue values further comprises:

determining a measure of central tendency of the updated channel values of the one or more channels of the highlight region; and

calculating hue values including adjusting the updated channel values for each of the one or more channels using the measure of central tendency of the updated channel values of the highlight region.

Embodiment 14 is the method of embodiment 13, wherein calculating, for each highlight region in the image, a final channel value for each of the one or more channels comprises:

determining a measure of the central tendency of the clipped channel values of the one or more channels; and

calculating a final channel value for each of the one or more channels including adjusting the respective clipped channel values using the respective hue values and the measure of central tendency of the clipped channel values.

Embodiment 15 is the method of embodiment 14, wherein for each highlight region:

the measure of central tendency of the updated channel values and the clipped channel values of the one or more channels is a mean of the respective channel values; and

calculating the hue values of the one or more channels comprises:generating initial hue values by calculating the difference between the updated channel values and the mean of the updated channel values; andgenerating the hue values by normalizing the initial hue values comprising dividing the initial hue values by a length of a first vector wherein each element of the first vector is an initial hue value.

Embodiment 16 is the method of embodiment 15, wherein calculating the final channel values of the one or more channels comprises:

generating scaled hue values by scaling the hue values by a length of a second vector, wherein each element of the second vector is a difference between the clipped channel value of a channel and the mean of the clipped channel values; and

generating the final channel values by adding the scaled hue values to the mean of the clipped channel values.

Embodiment 17 is one or more non-transitory computer storage media encoded with computer program instructions that when executed by a plurality of computers cause the plurality of computers to perform the method of any one of embodiments 9-16.

While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In certain some cases, multitasking and parallel processing may be advantageous.