The present invention is directed to a method and apparatus for resizing raw image data before storing the data.
Mobile telephones, personal digital assistants, portable music players, digital cameras, and other similar devices enjoy widespread popularity today. These small, light-weight devices typically rely on a battery as the primary power source during use. Because of their popularity, competition among makers of these devices is intense. Accordingly, there is an ever-present need to minimize the cost, size, weight, and power consumption of the components used in these devices.
There is also a need to add features to these devices in order to make particular devices more appealing than other devices to consumers. A common feature now found in many of these battery-powered mobile devices is an image sensor integrated circuit (“IC”) for capturing digital photographs. Adding an image capture feature, however, increases both the amount of memory needed and the demands on available memory bandwidth, which in turn increase component size and power consumption. Moreover, the image sensor is often employed to capture video rather than still images, which multiplies memory and memory bandwidth proportionally.
Of course, the need to minimize cost, size, weight, and power consumption of components is not limited to battery-powered mobile devices. It is generally important to minimize these design parameters in all computer and communication systems.
Thus, there is a need to reduce memory requirements, demands on available memory bandwidth, and power consumption associated with an image capture feature in computer and communication systems, and particularly, in battery-powered mobile devices. Accordingly, there is a need for a method and apparatus for resizing raw image data before storing the data.
In one embodiment, the invention is directed to a method of: (a) receiving raw data representing an image, (b) transforming the raw image data to change at least one dimension of the image, and (c) storing the raw image data in a memory subsequent to the step (b) of transforming the image data. In various embodiments, the step of (b) transforming the raw image data crops or scales the image.
In another embodiment, the invention is directed to a device that includes an image sensor for generating raw data representing an image and a resizing unit coupled with the image sensor. The resizing unit is preferably adapted for dimensionally transforming the raw image data and for writing the raw image data to a memory. The device preferably also includes a memory for storing the raw image data. In various embodiments, the resizing unit is adapted to transform the raw image data by cropping or scaling the image.
In yet another embodiment, the invention is directed to a graphics processing unit. The graphics processing unit includes a memory for storing raw image data and a resizing unit for dimensionally transforming the raw image data. The graphics processing unit preferably includes a memory for storing the raw image data. In various embodiments, the resizing unit is adapted to transform the raw image data by scaling or cropping the image.
In a further embodiment, the invention is directed to a program of instruction embodied on a computer readable medium for performing a method of: (a) receiving raw data representing an image; (b) transforming the raw image data to change the dimensions of the image; and (c) causing the transformed raw image data to be stored in a memory. The dimensional transformation may be scaling, cropping, or both.
Preferred embodiments of the invention are directed to a methods, apparatus, and articles of manufacture for resizing raw image data before storing the data.
“Raw image data” generally refers to the data created by an image sensor or other photosensitive device (“image sensor”). Image sensors usually have an array of a large number of small, light-detecting elements (“photosites”), each of which is able to convert photons into electrons. When an image is projected onto the array, the incident light is converted into an analog voltage at each photosite that is subsequently converted to discrete, quantized voltage, thereby forming a two-dimensional array of thousands or millions digital values for defining a corresponding number of pixels that may be used to render an image. Exemplary image sensors include charge coupled devices (“CCDs”) and complimentary metal oxide semi-conductor (“CMOS”) image sensors. Image sensors are commonly disposed on a discrete, dedicated integrated circuit (“IC”).
Generally, the photosites provided in an image sensor are not capable of distinguishing color however; they produce “gray-scale” pixels. Color digital images are captured by pairing an image sensor with a color filter array (“CFA”). Alternatively, color images can be captured with a device that uses several image sensors. In these devices, each of the image sensors is adapted to be responsive only to light a particular region of the spectrum, such as with the use of single-color filters, and appropriate optics are provided so that that an image is projected onto each of the sensors in the same manner. Devices that employ a single image sensor are simpler (and less expensive) than devices having multiple image sensors, and accordingly, such devices are ordinarily used in battery-powered mobile devices. While one or more preferred embodiments of the present invention employ a single image sensor paired with a CFA, it should be appreciated that raw image data may be provided by any source.
In single image sensor devices, the CFA is placed in the optical path between the incident light and the array of photosites. The CFA includes one filter for each of the photosites and is positioned so that each filter is aligned to overlap with one of the photosites. Generally, three types of filters are provided, each type for passing only light of one region of the visible spectrum. In this way, each photosite is adapted to be responsive only to light in a particular region of the spectrum.
A commonly used CFA is a “Bayer” CFA. The individual filters in the Bayer CFA are adapted for passing light of either the red, green, or blue regions of the spectrum.
An image sensor overlaid with a CFA outputs one raw pixel per photosite. These raw pixels may be 8, 10, or another number of bits per pixel. Raw pixels are generally not suitable for viewing on an LCD, CRT, or other types of display devices. Typically, display devices require pixels that have a red, green, and blue component (“RGB” pixels). RGB pixels are commonly 8 bits per component, or 24 bits per pixel. While raw pixels are ordinarily 8 or 10 bits, and RGB pixels are ordinarily 24 bits, it will be appreciated that any number of bits may be employed for representing raw pixels or pixels comprised of components.
Raw pixels must first be converted to RGB pixels before an image can be displayed (or converted to another color space). From
Referring to
The flow diagram of
After the dimensionally transformed image, comprised of raw pixels, is fetched from memory and de-mosaiced, the pixels may be stored, or further processed in a variety of ways. For instance, the image data may be converted to another color model, such as YUV. After the image data is converted to YUV, it may be chroma subsampled to create, for example, YUV 4:2:0 image data. In addition, the image data may be compressed using JPEG or another image compression technique. Further, the image data may be used to drive a display device for rendering the image or it may be transmitted to another system. In addition, the image data fetched from memory and subsequently de-mosaiced may be up-scaled, down-scaled, or cropped to fit a particular display device size. However, this latter step may not be necessary as the raw image was dimensionally transformed before storing.
There are several advantages of dimensionally transforming the raw image before storing it. As the amount of data is reduced before storing, the dimensionally transformed raw image takes less space in memory than the full raw image. This reduces memory requirements and the number of memory accesses needed to store and fetch the raw image. In addition, after the raw image is fetched from memory, the processing necessary to de-mosaic the dimensionally transformed raw image is less than that required for the full raw image.
Referring to
The camera module 38 includes an image sensor 46 and an interface unit 48. The image sensor 46 is preferably a single sensor of the CMOS type, but may be a CCD or other type of sensor. Preferably, a CFA 58 overlays a plurality of photosites 60 of the image sensor 46. With the CFA 58, each photosite of the image sensor 46 is adapted to respond only to light of a particular region of a spectrum. Preferably, the photosites are responsive only to light of one of a first, second, or third region of a spectrum. As one example, the photosites are responsive only to light of one of the red, green, or blue regions of the visible spectrum. Alternatively, a plurality of image sensors may be provided along with suitable optical elements for providing that the same image impinges in the same position on each of the multiple sensors, where each of the multiple sensors is adapted to respond only to light of a particular region of a spectrum.
The graphics display controller 40 is provided with a camera interface 50. The camera interface 50 and the interface unit 48 of the image sensor 46 are coupled with one another via a bus 52. The interface 48 serves to enable to the camera 38 to communicate with other devices over the bus 52 using a protocol required by the bus 52. Similarly, the camera interface 50 is adapted to enable the display controller 40 to communicate over the bus 52 using the protocol required by the bus 52. Accordingly, the camera interface 50 is able to receive raw image data from the camera module 38, as shown in
The resizer unit 60 is adapted for receiving raw pixel data and outputting dimensionally transformed raw image data. In one embodiment, the resizer unit 60 includes an input coupled with the camera interface 50 and an output coupled with a memory 62. Raw pixels may be provided in raster order to the resizer unit 60 and the unit is preferably adapted to recognize the type of raw pixel as it is received. “Raster order” refers to a pattern in which the array of raw pixels is scanned from side to side in lines from top to bottom.
Assume that the raw pixels corresponding to one of red, green, and blue spectral regions, and referred to below simply as red, green, and blue raw pixels, are received in raster order by the resizer unit 60. Referring to the exemplary raw image 22 of
As one example of the operation of the resizer unit 60, consider the case of down-scaling the raw image using a scaling algorithm that deletes selected pixels in a regular pattern. For this example, assume that the raw image 22 of
R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15.
After deleting the pixels in the odd rows, the pixels in the even rows remain:
R0, R1, R2, R3, R8, R9, R10, R11.
And after deleting the even pixels, the following pixels remain:
R1, R3, R9, R11.
In this example, the scaling algorithm provides for deleting blue raw pixels from the blue plane in a similar manner. Green raw pixels are deleted a little differently. Alternate groups of two rows of the image are deleted. Within the remaining alternate groups of two rows, even pixels are deleted from the remaining rows. The scaled raw image 24 shown in
As mentioned above, known scaling algorithms may be adapted to preserve color information. In other words, raw image data may be transformed in such a way that the color information of raw data that is eliminated from the image in the transformation (such as because of its spatial position in the image) is preserved for later use. To illustrate, assume that the raw image 22 is to be down-scaled in the vertical dimension by deleting even rows, leaving only the odd rows of the image. However, down-scaling a raw image by deleting even rows results in a raw image that has only green and blue raw pixels, as all of the red raw pixels (present only in the even rows) are deleted. When the scaled, raw image is processed using a de-mosaicing algorithm for the purpose of creating pixels having a red, green, and blue components, the algorithm will have no red color information with which to work. As this may present a difficulty, according to preferred embodiments, a scaling algorithm is adapted to preserve color information. In particular, the scaling algorithm is modified to save color information for a raw pixel that is removed from the image until such time that the color information of that raw pixel can be used in a de-mosaicing process. Continuing the example, the scaling algorithm is adapted to delete only the green pixels in even rows of the image, but the red pixels in the odd rows are saved, along with the all of the pixels in the odd rows, for later use by a de-mosaicing algorithm.
The output of the resizer unit 60 is preferably coupled with the memory 62. The memory 62 is preferably included in the display controller, but in alternative embodiments may be provided in a separate IC or device. The memory 62 may be a memory dedicated for the purpose of storing dimensionally transformed raw image, or may be a memory used for storing other data as well. Preferably, the memory 62 is of the DRAM type, but the memory 62 may be an SRAM, Flash memory, hard disk, floppy disk, or any other type of memory.
A de-mosaic unit 64 is preferably also included in the display controller 40. The de-mosaic unit 64 is adapted to fetch dimensionally transformed raw image that has been stored in the memory 62 by the resizer unit 60, to perform a de-mosaicing algorithm on the fetched data, and to output pixels. The de-mosaic unit 64 is preferably capable of employing any suitable de-mosaicing algorithm. Preferably, the de-mosaic unit 64 outputs 24-bit RGB pixels. Alternatively, the de-mosaic unit 64 outputs 24-bit YUV pixels. The de-mosaic unit 64 may employ any suitable de-mosaicing algorithm. The de-mosaic unit 64 may provide pixels to one or more destination units or devices. For example, the de-mosaic unit 64 may provide pixels to an image processing block 66, to a display interface 68, or to a host interface 70.
The image processing block 66 is adapted to perform one or more operations on image data, such as converting pixels from one color space to another, such as from RGB to YUV, sub-sampling YUV data to create, for example, YUV 4:2:0 data, or compressing image data using JPEG or another image compression technique. The image processing block 66 may provide its output to the memory 62 for storing processed data, to the host interface 70 for presentation to the host 42, or, as shown in
The display interface 68 is adapted to receive pixels suitable for display and to present the pixels to the display device 44 in accord with the protocol and timing requirements required by the display device 44.
As shown in
In operation, an image is captured by the image sensor 46 and raw pixel data is transmitted to the resizer unit 60 via the interface 48, bus 52, and camera interface 50. The resizer 60 recognizes the type of raw pixel as each is received and applies a scaling algorithm appropriate for the identified type of pixel, such as down-scaling the image by deleting some raw pixels and causing others to be stored in the memory 62. After the entire raw image has been captured, resized, and stored, the memory 62 contains only the raw pixels of the dimensionally transformed image. The de-mosaic unit 64 fetches dimensionally transformed raw image from the memory 62, and converts the raw pixels into RGB pixels. The RGB image data is then provided to other units for further processing or display.
The exemplary device 36 provides advantages over known devices. Specifically, by dimensionally transforming the raw image before storing it, the amount of data needed to be stored in the memory 62 is reduced. This reduces memory requirements and the number of memory accesses needed to store and to fetch the raw image. In addition, after the raw image is fetched from memory, the processing performed by the de-mosaic unit 64 on the dimensionally transformed raw image data is less than what would be required if the full raw image were stored.
The present invention has been described for use with image data received from a camera that is integrated in the system or device. It should be appreciated that the invention may be practiced with image data that is received from any image data source, whether integrated or remote. For example, the image data may be transmitted over a network by a camera remote from the system or device incorporating the present invention.
Any of the operations described herein that form part of the invention are useful machine operations. The invention also relates to a device or an apparatus for performing these operations. The device may be specially constructed for the required purposes, such as the described mobile device, or it may be a general purpose computer selectively activated or configured by a computer program stored in the computer. In particular, various general purpose machines may be used with computer programs written in accordance with the teachings herein, or it may be more convenient to construct a more specialized apparatus to perform the required operations.
The invention can also be embodied as computer readable code on a computer readable medium. The computer readable medium is any data storage device that can store data which can be thereafter read by a computer system. The computer readable medium also includes an electromagnetic carrier wave in which the computer code is embodied. Examples of the computer readable medium include flash memory, hard drives, network attached storage, ROM, RAM, CDs, magnetic tapes, and other optical and non-optical data storage devices. The computer readable medium can also be distributed over a network-coupled computer system so that the computer readable code is stored and executed in a distributed fashion.
The above described invention may be practiced with a wide variety of computer system configurations including hand-held devices, microprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers and the like. Although the foregoing invention has been described in some detail for purposes or purposes of clarity of understanding, it will be apparent that certain changes and modifications may be practiced within the scope of the appended claims. Accordingly, the present embodiments are to be considered as illustrative and not restrictive, and the invention is not to be limited to the details given herein, but may be modified within the scope and equivalents of the appended claims. Further, the terms and expressions which have been employed in the foregoing specification are used as terms of description and not of limitation, and there is no intention in the use of such terms and expressions to exclude equivalents of the features shown and described or portions thereof, it being recognized that the scope of the invention is defined and limited only by the claims which follow.