CROSS-REFERENCE TO RELATED APPLICATIONSThis application claims priority as a continuation application under 35 U.S.C. §120 of earlier filed application Ser. No. 11/347,904 (filed Feb. 6, 2006) entitled “Raw Image Processing”, KASPERKIEWICZ, ET AL. et al., which is hereby incorporated by reference.
STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENTNot applicable.
BACKGROUNDThe proliferation of comparatively high-resolution digital imaging devices, such as digital still cameras, has led to the pursuit of increasingly higher-resolution photo manipulation, printing and other tools. However, in order to contain cost, many consumer-grade digital color cameras are single-sensor digital cameras. As the name implies, in a single-sensor digital camera only a single image sensor is used to capture color information for each pixel in a color image. Each image sensor, which is typically a charge-coupled device (CCD) or a complementary metal oxide semiconductor (CMOS), is part of a sensor array that together represent the pixels of a color image. Each image sensor can only generate information about a single color at a given pixel. These single color pixels are used to comprise an image in a so-called “Raw” format. The expanding digital image market has brought recognition that the raw image files generated by digital cameras and other devices represent an opportunity to extract the highest possible level of detail from the device.
A color image, however, is represented by combining three separate monochromatic images. In order to display a color image, all of the red, blue and green (RGB) color values are needed at each pixel. In an ideal (and expensive) camera system, each pixel in the sensor array would be provided with three image sensors—each one measuring a red, green or blue pixel color. In a single-sensor digital camera, however, only a single red, blue or green color value can be determined at a given pixel. In order to obtain the other two missing colors, they must be estimated or interpolated from surrounding pixels in the image. These estimation and interpolation techniques are called “demosaicing” algorithms.
The term “demosaicing” is derived from the fact that a color filter array (CFA) is used in front of the image sensors, with the CFA being arranged in a mosaic pattern. This mosaic pattern has only one color value for each of the pixels in the image. In order to obtain the full-color image, the mosaic pattern must be demosaiced. Thus, demosaicing is the process of interpolating back the raw image captured with a mosaic-pattern CFA, so that a full RGB value can be associated with every pixel.
Today, raw sensor data is converted into RGB data in two ways. The data may be demosaiced by the hardware of an image capture device (e.g., cameras and viewers). Alternatively, the raw data may be demosaiced and processed by a personal computer (PC). For example, the data may be downloaded from a camera onto a PC where it may be processed by an application or an operating system to create an image stored in a more readily processed format, such as JPEG (Joint Photographic Experts Group) or TIFF (Tagged Image File Format). Compared to the Raw format, these more readily processed formats are inferior and lead to, for example, loss in color depth and poor compressions.
Demosaicing on an image capture device and on a PC differ in at least one significant way. On-device demo saicing often requires only a fraction of a second, while the same processing can take 30 seconds or more on a PC. With the premium modern computer users place on speed and performance, the PC's demosaicing delay is unacceptable to most users, and more readily processed formats such as JPEG are more commonly used. In short, the poor speed of performance experienced when working with raw image data causes users to select the more readily processed formats, despite the superior level of detail and precision offered by raw image data.
SUMMARYThe present invention meets the above needs and overcomes one or more deficiencies in the prior art by providing systems and methods for processing raw image data with a graphics processing unit (GPU). Raw image data generated by an imaging sensor is received. A set of instructions for demosaicing the raw image data is communicated to the GPU. The GPU is enabled to demosaic the raw image data by executing the set of instructions. This demosaicing generates an output image having multiple color values per pixel (e.g., an RGB image).
It should be noted that this Summary is provided to generally introduce the reader to one or more select concepts described below in the Detailed Description in a simplified form. This Summary is not intended to identify key and/or required features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGThe present invention is described in detail below with reference to the attached drawing figures, wherein:
FIGS. 1A and 1B are block diagrams of an exemplary computing system environment suitable for use in implementing the present invention;
FIG. 2 illustrates an overall environment in which systems and methods for processing raw image files may operate in accordance with one embodiment of the present invention;
FIG. 3 illustrates a method in accordance with one embodiment of the present invention for processing raw image data with a GPU;
FIG. 4 is a schematic diagram illustrating a system for processing raw image data with a GPU in accordance with one embodiment of the present invention; and
FIG. 5 is a schematic diagram illustrating a system for processing a raw image in accordance with one embodiment of the present invention.
DETAILED DESCRIPTIONThe subject matter of the present invention is described with specificity to meet statutory requirements. However, the description itself is not intended to limit the scope of this patent. Rather, the inventors have contemplated that the claimed subject matter might also be embodied in other ways, to include different steps or combinations of steps similar to the ones described in this document, in conjunction with other present or future technologies. Moreover, although the term “step” may be used herein to connote different elements of methods employed, the term should not be interpreted as implying any particular order among or between various steps herein disclosed unless and except when the order of individual steps is explicitly described. Further, the present invention is described in detail below with reference to the attached drawing figures, which are incorporated in their entirety by reference herein.
The present invention provides an improved system and method for processing digital images. It will be understood and appreciated by those of ordinary skill in the art that a “digital image,” as the term is utilized herein, refers to any digital image data including a static and/or dynamic digital image (e.g., video) and that any and all combinations or variations thereof are contemplated to be within the scope of the present invention. An exemplary operating environment for the present invention is described below.
Referring initially toFIG. 1A in particular, an exemplary operating environment for implementing the present invention is shown and designated generally ascomputing device100.Computing device100 is but one example of a suitable computing environment and is not intended to suggest any limitation as to the scope of use or functionality of the invention. Neither should the computing-environment100 be interpreted as having any dependency or requirement relating to any one or combination of components illustrated.
The invention may be described in the general context of computer code or machine-useable instructions, including computer-executable instructions such as program modules, being executed by a computer or other machine, such as a personal data assistant or other handheld device. Generally, program modules including routines, programs, objects, components, data structures, etc., refer to code that perform particular tasks or implement particular abstract data types. The invention may be practiced in a variety of system configurations, including hand-held devices, consumer electronics, general-purpose computers, specialty computing devices (e.g., cameras and printers), etc. The invention may also be practiced in distributed computing environments where tasks are performed by remote-processing devices that are linked through a communications network.
With reference toFIG. 1A,computing device100 includes abus110 that directly or indirectly couples the following elements:memory112, a central processing unit (CPU)114, one ormore presentation components116, input/output ports118, input/output components120, anillustrative power supply122 and a graphics processing unit (GPU)124.Bus110 represents what may be one or more busses (such as an address bus, data bus, or combination thereof). Although the various blocks ofFIG. 1A are shown with lines for the sake of clarity, in reality, delineating various components is not so clear, and metaphorically, the lines would more accurately be gray and fuzzy. For example, one may consider a presentation component such as a display device to be an I/O component. Also, CPUs and GPUs have memory. The diagram ofFIG. 1A is merely illustrative of an exemplary computing device that can be used in connection with one or more embodiments of the present invention. Distinction is not made between such categories as “workstation,” “server,” “laptop,” “hand-held device,” etc., as all are contemplated within the scope ofFIG. 1A and reference to “computing device.”
Computing device100 typically includes a variety of computer-readable media. By way of example, and not limitation, computer-readable media may comprise Random Access Memory (RAM); Read Only Memory (ROM); Electronically Erasable Programmable Read Only Memory (EEPROM); flash memory or other memory technologies; CDROM, digital versatile disks (DVD) or other optical or holographic media; magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, carrier wave or any other medium that can be used to encode desired information and be accessed by computingdevice100.
Memory112 includes computer-storage media in the form of volatile and/or nonvolatile memory. The memory may be removable, nonremovable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical-disc drives, etc.Computing device100 includes one or more processors that read data from various entities such asmemory112 or I/O components120. Presentation component(s)116 present data indications to a user or other device. Exemplary presentation components include a display device, speaker, printing component, vibrating component, etc.
I/O ports118 allowcomputing device100 to be logically coupled to other devices including I/O components120, some of which may be built in. Illustrative components include a microphone, joystick, game pad, satellite dish, scanner, printer, wireless device, etc.
FIG. 1B details components of thecomputing device100 that may be used in raw image processing. For example, thecomputing device100 may be used to implement a Directed Acyclic Graph (“graph”) or a graphics pipeline that processes and applies various effects and adjustments to a raw image. As known to those skilled in the art, graphs and graphics pipelines relate to a series of operations that are performed on a digital image. These graphs and pipelines are generally designed to allow efficient processing of a digital image, while taking advantage of available hardware.
To implement a graph/graphics pipeline, one or more procedural shaders on theGPU124 are utilized. Procedural shaders are specialized processing subunits of theGPU124 for performing specialized operations on graphics data. An example of a procedural shader is avertex shader126, which generally operates on vertices. For instance, thevertex shader126 can apply computations of positions, colors and texturing coordinates to individual vertices. The vertex shader126 may perform either fixed or programmable function computations on streams of vertices specified in the memory of the graphics pipeline. Another example of a procedural shader is apixel shader128. For instance, the outputs of thevertex shader126 can be passed to thepixel shader128, which in turn operates on each individual pixel. After a procedural shader concludes its operations, the information is placed in aGPU buffer130, which may be presented on an attached display device or may be sent back to the host for further operation.
TheGPU buffer130 provides a storage location on theGPU124 where an image may be stored. As various image processing operations are performed with respect to an image, the image may be accessed from theGPU buffer130, altered and re-stored on thebuffer130. As known to those skilled in the art, theGPU buffer130 allows the image being processed to remain on theGPU124 while it is transformed by a graphics pipeline. As it is time-consuming to transfer an image from theGPU124 to thememory112, it may be preferable for an image to remain on theGPU buffer130 until processing operations are completed.
With respect to thepixel shader128, specialized pixel shading functionality can be achieved by downloading instructions to thepixel shader128. For instance, downloaded instructions may enable performance of a demosaicing algorithm. Furthermore, the functionality of many different operations may be provided by instruction sets tailored to thepixel shader128. For example, negating, remapping, biasing, and other functionality are extremely useful for many graphics applications. The ability to program thepixel shader128 is advantageous for graphics operations, and specialized sets of instructions may add value by easing development and improving performance. By executing these instructions, a variety of functions can be performed by thepixel shader128, assuming the instruction count limit and other hardware limitations of thepixel shader128 are not exceeded.
FIG. 2 illustrates anoverall environment200 in which a system and method for processing raw image files may operate, according to one embodiment of the invention. As illustrated in this figure, images may be captured in electronic form by animaging device208. Theimaging device208 may be a digital still camera, digital video camera, scanner, a camera-equipped cellular telephone or personal digital assistant (PDA), or other input device or hardware. Theimaging device208 may generate araw image file210 or raw image data reflecting the captured image at the lowest level of hardware activity. As will be appreciated by those skilled in the art, the “raw image data,” as the terms are used herein, may be stored in a variety of formats and generally refers to the data generated by or impressed on the embedded sensors of theimaging device208, itself. In the case of a digital camera, the sensors of theimaging device208 may be or include electro-optical sensors, such as charged-coupled devices (CCDs) or complementary metal oxide semiconductor image sensors (CMOS).
In general, theimaging device208 may generate theraw image file210 and communicate that file to aclient202, such as a personal computer, for extraction, manipulation and processing. For example, theclient202 may be thecomputing device100 ofFIG. 1. Theclient202 may present auser interface204, such as a graphical user interface, a text or command line interface, an interface including audio input or output, or other interfaces. Theimaging device208 may communicate theraw image file210 to theclient202, for instance to store that file in astorage location206, which may be or include hard disk storage, optical storage or other storage or media.
FIG. 3 illustrates amethod300 for processing raw image data with a GPU. At302, themethod300 receives raw image data generated by an image sensor. For example, a digital camera may generate the raw image data, and this data may be communicated to a PC. The raw image data may be contained in a file such as theraw image file210 ofFIG. 2. Such a file may be generated by any number of devices, including a digital still camera, a digital video camera and a camera-equipped cellular telephone.
At304, themethod300 communicates a set of instructions for demosaicing the raw image data to a GPU. For example, the instructions may be downloaded to a pixel shader. As previously discussed, a pixel shader may receive and execute a set of instructions with respect to a digital image. The pixel shader may then generate an RGB image, pixel-by-pixel, in accordance with the demosaicing instructions.
There are numerous demosaicing algorithms known in the art. One of the simplest approaches to demosaicing is bilinear interpolation. In general, bilinear interpolation uses three color planes that are independent of each other. Bilinear interpolation determines the missing color values by linearly interpolating between the nearest known values. However, bilinear techniques also generate significant artifacts (i.e., loss of sharpness caused by color bleeding at distinct edges) in the color image, which can severely degrade image quality. Some nonlinear interpolation techniques produce noticeably improved image quality, while requiring significantly more complex computational operations. Those skilled in the art will recognize that the present invention is not limited to a particular type of demosaicing algorithm, and the instructions communicated at304 may enable implementation of any number of known demosaicing algorithms.
At306, themethod300 enables the GPU to demosaic the raw image data to create an RGB image. In one embodiment, the set of instructions communicated at304 may enable the pixel shader of the GPU to perform a demosaicing algorithm. GPUs have highly specialized parallel processing pipelines that allow for rapid computation of RGB pixel values. Themethod300 may use this specialized hardware to demosaic the raw image data. As will be appreciated by those skilled in the art, demosaicing on the GPU will be performed in a fraction of the time needed to perform the same demosaicing on a CPU.
Themethod300, at308, stores the RGB output image in a GPU buffer. The GPU buffer is a memory location on the GPU that may store images in any number of formats. Importantly, by storing the image in the GPU buffer, it remains on the GPU and eliminates the delay caused by copying the image to the system memory of the PC. Further, the image remains available for further processing by, for example, a graphics pipeline.
While the RGB image remains in the GPU buffer, it may be desirable for a user to view the image. Accordingly, at310, themethod300 accesses the GPU buffer to enable generation of a visual representation of the RGB output image. To generate this visual representation, any number of rendering techniques known in the art may be utilized. In this manner, the need to copy the image from the GPU is eliminated, while the user is permitted to view a representation of the RGB output image.
Themethod300, at312, utilizes the GPU to apply effects to the image. For example, the user may be presented an image editor interface that provides a variety of editing controls. Using these controls, a user may select numerous image alterations to be applied to the output image.
To alter the image, the color values associated with the image's pixels must undergo a transformation operation. These transformations may be referred to as effects. An effect, as that term is utilized herein, is a basic image processing class. That is, effects are basically pixel operators that take in buffers and pixel data, manipulate the data, and output modified pixels. For instance, a sharpening effect takes in image pixels, sharpens the pixel edges and outputs an image that is sharper than the image pixels taken in. In another example, an exposure effect takes in image pixel data, adjusts the apparent overall brightness of the image and outputs an image having a modified appearance. Different effects, e.g., masking, blending, rotating, and the like, may be defined to implement a variety of image processing algorithms.
To apply various effects, a GPU may be used to implement a graph or graphics pipeline. Utilizing the GPU, pixel data may be transformed in a variety of ways at an accelerated pace (i.e., faster than the CPU could do it itself). In one embodiment, the effects pipeline dynamically modifies the image data “non-destructively.” “Non-destructive editing” or “non-destructive processing” refers to editing (or processing) wherein rendering takes place beginning from unaltered originally-loaded image data. Each time a change is made, the alteration is added to the image data without altering the raw data, e.g. as records in the image metadata. Hence, the pipeline reflects the revision history (or progeny) of the image—including the underlying raw data.
FIG. 4 illustrates asystem400 for processing raw image data with a GPU. Thesystem400 includes a rawdata input interface402. The rawdata input interface402 may be configured to receive raw image data generated by an imaging sensor. The rawdata input interface402 may, for example, receive a file such as theraw image file210 ofFIG. 2. Such a file may be generated by any number of devices. In one embodiment, a camera configured to communicate the raw data to the rawdata input interface402 generates the raw image data.
AGPU controller404 is also included in thesystem400. TheGPU controller404 may be configured to communicate instructions for demosaicing the raw image data to a GPU. For example, the instructions may be loaded onto the GPU's programmable pixel shader. Any number of demosaicing algorithms may be acceptable for the GPU to implement in accordance with the communicated instructions. Techniques for such control of a GPU are known in the art. In one embodiment, once the raw image data has been converted into an RGB image, the output RGB image is stored in a buffer residing on the GPU. In one embodiment, the output image may be stored into a processed file format by using an image file encoder (e.g., a codec). This embodiment may enable fast batch processing of Raw images, with the final result being a set of processed image files.
Thesystem400 further includes aGPU buffer viewer406 configured to access the GPU buffer. While it may be time-consuming to copy an image from the GPU buffer to the memory of a computer system, generating a visual representation of the image may be accomplished relatively quickly. Accordingly, theGPU buffer viewer406 may access the GPU buffer without copying the image data from the GPU. By accessing the image in the buffer, theGPU buffer viewer406 may generate a view of the image for rendering to a user. Those skilled in the art will appreciate that a variety of rendering techniques exist in the art for generating such a view.
Thesystem400 also includes animage processing engine408 and animage processing interface410. As will be appreciated by those skilled in the art, a variety of alterations may be made to an image by a GPU. For example, any number of effects may be applied to an image. To edit an image, theimage processing engine408 may access the image in the GPU buffer, apply desire effects and then re-store the processed image on the buffer. In this manner, the image remains on the GPU while it is altered by theimage processing engine408. As part of the editing process, theimage processing interface410 may display to the user a representation of the image, such as a view provided by theGPU buffer viewer406. Theimage processing interface410 may also display controls related to editing the image. For example, the user may select effects to be applied to the image, while theimage processing engine408 applies the selected effects to the image. In one embodiment, an entire effects pipeline, starting with the raw image data, may be implemented on the GPU by thesystem400. Those skilled in the art will appreciate that, because the GPU is utilized to perform each of the image processing operations, this processing will occur in substantially real-time.
FIG. 5 illustrates asystem500 for processing a raw image. The system includesraw image data502, which is introduced to aGPU processing platform504. TheGPU processing platform504 may enable performance of a variety of GPU operations with respect to theraw image data502. For example, theraw image data502 may be fed into araw image processor506. Theraw image processor506 may be configured to perform operations on theraw image data502, such as one-channel noise reduction and 1-channel sharpening. Those skilled in the art will appreciate that raw image processing may require numerous one-channel operations, and each of these operations may be enabled by theraw image processor506.
Once all one-channel operations have been completed, the raw data may be converted into a three-channel image (e.g., an RGB image) by ademosaicing component508. Any number of demosaicing algorithms may be implemented on the GPU by thedemo saicing component508. As previously mentioned, the GPU is capable of demosaicing the raw data much more quickly on than a CPU, and thus, such demosaicing may be performed by thedemosaicing component508 without a noticeable delay.
After demosaicing, a three-channel image processor510 may transform the image. Any number of GPU-performed operations may be enabled by the three-channel image processor510. For example, curves (e.g., exposure compensation and color balance) and three-channel noise reduction/sharpening may be applied by the three-channel image processor510. As will be appreciated by those skilled in the art, the three-channel image processor510 may be used to implement a graph or graphics pipeline within the processing environment afforded by the GPU.
As theraw image data502 is processed by theGPU processing platform504, the image is stored in aGPU buffer512. TheGPU buffer512 provides a storage location on the GPU where image data may be stored. As various image processing operations are performed, the image may be accessed from theGPU buffer512, altered and re-stored on thebuffer512. Thus, theGPU buffer512 allows the image to remain on the GPU while it is being transformed. In one embodiment, theGPU processing platform504 dynamically modifies the image data non-destructively. In this case, the image stored in theGPU buffer512 reflects the various modifications to the image.
To allow user interaction with the image processing of theGPU processing platform504, thesystem500 may include auser interface514. Theuser interface514 includes abuffer viewer516 configured to present a visual representation of the image to the user. To generate this visual representation, thebuffer viewer516 may access theGPU buffer512. For example, thebuffer viewer516 may be similar to theGPU buffer viewer406 ofFIG. 4. Without copying the image itself from theGPU buffer512,buffer viewer516 may provide a “window” into theGPU buffer512 by enabling display of the image as it is processed on the GPU. For example, the user may be presented the RGB version of the image, as generated by thedemosaicing component508. Those skilled in the art will appreciate that thebuffer viewer516 may utilize any number of known rendering techniques to generate a view of the image for display by theuser interface514.
Theuser interface514 also includes animage editing interface518. Theimage editing interface518 may be configured to receive user inputs requesting alterations to the image. For, example, theimage editing interface518 may receive an input requesting a change to the level of exposure. Any number of imaging editing controls may be provided by theimage editing interface518, and a variety of user inputs related to transforming the image may be received. Theimage editing interface518 may enable transformation of the image in response to the user inputs. In one embodiment, theimage editing interface518 enables the three-channel image processor510 to apply the transformations/effects indicated by the user inputs. As such, the requested transformation will be applied by the GPU to the image, and the transformed image will be stored in theGPU buffer512. Subsequently, thebuffer viewer516 may access the transformed image and generate a view for display by theuser interface514.
Alternative embodiments and implementations of the present invention will become apparent to those skilled in the art to which it pertains upon review of the specification, including the drawing figures. Accordingly, the scope of the present invention is defined by the appended claims rather than the foregoing description.