1. Field of the Invention
The present invention relates to image data filtering.
2. Background Art
An increasing number of devices are being produced that are enabled to capture and display images. For example, mobile devices, such as cell phones, are increasingly being equipped with cameras to capture images, including still snapshots and motion video recording. Images captured by such devices can frequently be viewed on displays of the devices, as well as being transferred from the devices for viewing elsewhere. To view the images on relatively small devices, the images typically must be viewed on small display screens that are not capable of viewing the full resolution of the captured images. Thus, such devices must include at least limited image processing capability to down-size the images for viewing on the small display screens.
Many mobile devices have limited processing capability due to cost, power consumption, and size constraints. However, the processing of captured images, especially the processing of video, is very computationally intensive. For example, many mobile devices have cameras capable of capturing images of 2 MegaPixels (MPel) or more. Thus, a processor of such a mobile device must be capable of processing a large amount of data for each captured image. Furthermore, encoding and decoding (e.g., QCIF) of image data may need to be performed by the processor at frame rates such as 15 fps and 30 fps, respectively, as well as the performance of other functions.
To deal with such high-resource demanding tasks, mobile device developers have resorted to including high-powered processing chips in the devices, which have higher clock rates and larger on-chip cache memory, or to including dedicated video/image processing chips. Such approaches result in higher cost devices with higher levels of power consumption, which may not be desirable in battery powered mobile devices.
Thus, ways are desired for handling an image processing workload in devices, such as mobile devices, without significantly raising device costs and power consumption levels.
Methods, systems, and apparatuses are described for processing captured image data in devices. Subsampling is performed according to selected subsample patterns to down-size a captured image frame. The subsample patterns used for subsampling may be selected in a random or other fashion, to avoid repetition of sample patterns in a spatial domain (same image frame) and/or in a time domain (across multiple image frames). Subsampling in this manner avoids fixed noise patterns and/or other image issues, for example.
In a first example, a first array of pixel data values corresponding to a captured image is received. The first array is segmented into a plurality of N by M array portions. A subsample pattern is selected for each N by M array portion of the plurality of N by M array portions from a plurality of subsample patterns so that each N by M array portion has a corresponding selected subsample pattern. Each N by M array portion is subsampled according to the corresponding selected subsample pattern to generate a second array of filtered pixel data values. The second array of filtered pixel data values corresponds to a down-sized version of the captured image.
In an example aspect, the subsampling of each N by M array portion includes calculating a filtered pixel data value for each N by M array portion. A filtered pixel data value is calculated by applying a function to a subset of the pixel data values of an array portion according to the corresponding selected subsample pattern. By using a subset of the pixel data values, a number of calculations is reduced compared to using all of the pixel data values of an N by M array portion.
Pixel data arrays of multiple color channels corresponding to the captured image may each be processed in this manner. Furthermore, pixel data arrays corresponding to additional captured image frames in a video stream may be processed in this manner.
In a further example, an image subsampling system includes an image array portion selector, a subsampling pattern selector, and a subsampling module. The image array portion selector is configured to select N by M array portions from a first array of pixel data values that correspond to a captured image. The subsampling pattern selector is configured to select a subsample pattern for each N by M array portion from a plurality of subsample patterns. Each N by M array portion has a corresponding selected subsample pattern. The subsampling module is configured to subsample each N by M array portion according to the corresponding selected subsample pattern to generate a second array of filtered pixel data values. The second array of filtered pixel data values corresponds to a down-sized version of the captured image.
These and other objects, advantages and features will become readily apparent in view of the following detailed description of the invention. Note that the Summary and Abstract sections may set forth one or more, but not all exemplary embodiments of the present invention as contemplated by the inventor(s).
The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate the present invention and, together with the description, further serve to explain the principles of the invention and to enable a person skilled in the pertinent art to make and use the invention.
The present invention will now be described with reference to the accompanying drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Additionally, the left-most digit(s) of a reference number identifies the drawing in which the reference number first appears.
The present specification discloses one or more embodiments that incorporate the features of the invention. The disclosed embodiment(s) merely exemplify the invention. The scope of the invention is not limited to the disclosed embodiment(s). The invention is defined by the claims appended hereto.
References in the specification to “one embodiment,” “an embodiment,” “an example embodiment,” etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
Furthermore, it should be understood that spatial descriptions (e.g., “above,” “below,” “up,” “left,” “right,” “down,” “top,” “bottom,” “vertical,” “horizontal,” etc.) used herein are for purposes of illustration only, and that practical implementations of the structures described herein can be spatially arranged in any orientation or manner.
Embodiments of the present invention relate to image processing performed in devices. For example, embodiments include mobile devices where image processing must be performed with limited resources. Types of such mobile devices include mobile phones (e.g., cell phones), handheld computing devices (e.g., personal digital assistants (PDAs), BLACKBERRY devices, PALM devices, etc.), handheld music players (e.g., APPLE IPODs, MP3 players, etc.), and further types of mobile devices. Such mobile devices may include a camera used to capture images, such as still images and video images. The captured images are processed internal to the mobile device.
As shown in
Battery 122 provides power to the components of mobile device 100 that require power. Battery 122 may be any type of battery, including one or more rechargeable and/or non-rechargeable batteries.
Keypad 126 is a user interface device that includes a plurality of keys enabling a user of mobile device 100 to enter data, commands, and/or to otherwise interact with mobile device 100. Mobile device 100 may include additional and/or alternative user interface devices to keypad 126, such as a touch pad, a roller ball, a stick, a click wheel, and/or voice recognition technology.
Image sensor device 102 is an image capturing device. For example, image sensor device 102 may include an array of photoelectric light sensors, such as a charge coupled device (CCD) or a CMOS (complementary metal-oxide-semiconductor) sensor device. Image sensor device 102 typically includes a two-dimensional array of sensor elements organized into rows and columns. For example,
A/D 104 receives analog image signal 128, converts analog image signal 128 to digital form, and outputs a digital image signal 130. Digital image signal 130 includes digital representations of each of the analog values generated by the pixel sensors, and thus includes a digital representation of the captured image. For instance,
The pixel pattern shown for image data 300 in
Image processor 106 receives digital image signal 130. Image processor 106 performs image processing of the digital pixel sensor data received in digital image signal 130. For example, image processor 106 may be used to generate pixels of all three colors at all pixel positions when a Bayer pattern image is output by image sensor device 102. Image processor 106 may perform a demosaicing algorithm to interpolate red, green, and blue pixel data values for each pixel position of the array of image data 200 shown in
Image processor 106 performs processing of digital image signal 130, such as described above, and generates an image processor output signal 132. Image processor output signal 132 includes processed pixel data values that correspond to the image captured by image sensor device 102. Image processor output signal 132 includes color channels 502, 504, and 506, which each include a corresponding full array of pixel data values, respectively representing red, green, and blue color images corresponding to the captured image.
Note that in an embodiment, two or more of image sensor device 102, A/D 104, and image processor 106 may be included together in a single IC chip, such as a CMOS chip, particularly when image sensor device 102 is a CMOS sensor, or may be in two or more separate chips. For instance,
CPU 114 is shown in
Microphone 110 and audio CODEC 112 may be present in some applications of mobile device 100, such as mobile phone applications and video applications (e.g., where audio corresponding to the video images is recorded). Microphone 110 captures audio, including any sounds such as voice, etc. Microphone 110 may be any type of microphone. Microphone 110 generates an audio signal that is received by audio codec 112. The audio signal may include a stream of digital data, or analog information that is converted to digital form by an analog-to-digital (A/D) converter of audio codec 112. Audio codec 112 encodes (e.g., compresses) the received audio of the received audio signal. Audio codec 112 generates an encoded audio data stream that is received by CPU 114.
CPU 114 receives image processor output signal 132 from image processor 106 and receives the audio data stream from audio codec 112. As shown in
When present, RF transceiver 116 is configured to enable wireless communications for mobile device 116. For example, RF transceiver 116 may enable telephone calls, such as telephone calls according to a cellular protocol. RF transceiver 116 may include a frequency up-converter (transmitter) and down-converter (receiver). For example, RF transceiver 116 may transmit RF signals to antenna 118 containing audio information corresponding to voice of a user of mobile device 100. RF transceiver 116 may receive RF signals from antenna 118 corresponding to audio information received from another device in communication with mobile device 100. RF transceiver 116 provides the received audio information to CPU 114. In another example, RF transceiver 116 may be configured to receive television signals for mobile device 100, to be displayed by display 120. In another example, RF transceiver 116 may transmit images captured by image sensor device 102, including still and/or video images, from mobile device 100. In another example, RF transceiver 116 may enable a wireless local area network (WLAN) link (including an IEEE 802.11 WLAN standard link), and/or other type of wireless communication link.
CPU 114 provides audio data received by RF transceiver 116 to audio codec 112. Audio codec 112 performs bit stream decoding of the received audio data (if needed) and converts the decoded data to an analog signal. Speaker 108 receives the analog signal, and outputs corresponding sound.
Image processor 106, audio codec 112, and CPU 114 may be implemented in hardware, software, firmware, and/or any combination thereof. For example, CPU 114 may be implemented as a proprietary or commercially available processor, such as an ARM (advanced RISC machine) core configuration, that executes code to perform its functions. Audio codec 112 may be configured to process proprietary and/or industry standard audio protocols. Image processor 106 may be a proprietary or commercially available image signal processing chip, for example.
Display 120 receives image data from CPU 114, such as image data generated by image processor 106. For example, display 120 may be used to display images captured by image sensor device 102. Display 120 may include any type of display mechanism, including an LCD (liquid crystal display) panel or other display mechanism.
Depending on the particular implementation, image processor 106 formats the image data output in image processor output signal 132 according to a proprietary or known video data format. Display 120 is configured to receive the formatted data, and to display a corresponding captured image. In one example, image processor 106 may output a plurality of data words, where each data word corresponds to an image pixel. A data word may include multiple data portions that correspond to the various color channels for an image pixel. Any number of bits may be used for each color channel, and the data word may have any length.
For instance, in one standard implementation, the data word may be a 24-bit data word that includes 8 bits for the red color channel, 8 bits for the green color channel, and 8 bits for the blue color channel. In another standard implementation, as shown in
In some implementations, display 120 has a display screen that is not capable of viewing the full resolution of the images captured by image sensor device 102. Image sensor devices 102 may have various sizes, including numbers of pixels in the hundreds of thousand, or millions, such as 1 megapixel (Mpel), 2 Mpels, 4 Mpels, 8 Mpels, etc.). Display 120 may be capable of displaying relatively smaller image sizes. In one example, an image captured by image sensor device 102 may be 640 pixels by 480 pixels in size (307,200 pixels). In contrast, a display screen of display 120 may be 128 pixels by 96 pixels in size (12,288 pixels). Thus, display 120 (having a 12,288 pixel screen size) is not capable of displaying the entire captured image (having 307,200 pixels) at once.
To accommodate such differences between a size of display 120 and a size of captured images, CPU 114 (e.g., image processor 136) must down-size a captured image received from image processor 106 before providing the image to display 120. This is illustrated in
Such image downsizing may be performed by a subsampling process. In computer graphics, subsampling is a process used to reduce an image size. Subsampling is a type of image scaling, and may alter the appearance of an image or reduce the quantity of information required to store an image. Two types of subsampling are replacement and interpolation. The replacement technique selects a single pixel from a group and uses it to represent the entire group. The interpolation technique uses a statistical sample of the group (such as a mean) to create a new representation of the entire group.
In a subsampling process used in the current example, a captured image pixel array of 307,200 pixel data values may be divided into a plurality of sections having 25 pixels each. An averaging function can be performed on the 25 pixel data values of each section to generate a single representative pixel for display for each section. In this manner, an averaged pixel is generated for each section of 25 pixels, creating an image of 12,288 averaged pixels for display by display 120. However, performing an averaging function on 25 pixel data values requires a large number of operations. For example, the following equation (Equation 1) represents an averaging function for a number P of pixels:
For the current example of P=25 pixels, each ai may be equal to 1/25 for uniform averaging. In one implementation, a total of 49 operations must be performed to determine an average, including 25 multiplication operations and 24 addition operations. Each multiplication and addition operation may take more than one CPU cycle, leading to a fairly large number of operations required to process a single pixel data value. Furthermore, this averaging function must be performed 12,288 times to generate 12,288 average pixels. Still further, this averaging operation must be performed for every captured image frame in a captured video stream. Encoding and decoding (e.g., QCIF) functions may also need to be performed by CPU 114 on the video data, at frame rates such as 15 fps and 30 fps, respectively, as well as performing other functions required by CPU 114. The processing of captured images greatly adds to the workload of CPU 114.
To handle the increased processing load, mobile devices 100 typically are provided with high performance CPUs and/or special purpose image processing chips, which are expensive and consume greater amounts of power, in an undesired manner. Embodiments of the present invention overcome deficiencies of conventional mobile devices. Embodiments enable the down-sizing and display of captured images on mobile devices, while reducing CPU performance and power consumption requirements. Example embodiments are described in the following section.
The example embodiments described herein are provided for illustrative purposes, and are not limiting. The examples described herein may be adapted to any type of mobile device. Furthermore, additional structural and operational embodiments, including modifications/alterations, will become apparent to persons skilled in the relevant art(s) from the teachings herein.
In embodiments of the present invention, enhanced subsampling techniques are used to filter an image, while reducing a number of required calculations as compared to conventional techniques.
Flowchart 800 begins with step 802. In step 802, a first array of pixel data values corresponding to a captured image is received. For example, the first array of pixel data values may be one of color channels 502, 504, or 506 shown in
In step 804, the first array is segmented into a plurality of N by M array portions. For example,
X≧x×N, and
Y≧y×M.
Width “X′ and height “Y” of array 900 may have the same or different values. Width “N′ and height “M” of array portions 902 may have the same or different values.
In step 806, a subsample pattern is selected for each N by M array portion of the plurality of N by M array portions. In an embodiment, subsample patterns are selected from a plurality of subsample patterns so that each N by M array portion (such as N by M array portion 1000) has a corresponding selected subsample pattern.
Subsample pattern 1100 of
Subsample pattern 1200 of
Subsample pattern 1300 of
Subsample pattern 1400 of
Five non-zero subsampling scaling values are used and arranged in subsample patterns 1100 and 1400 so that a minimal number of non-zero scaling values is used, while having one non-zero scaling value in each column and row. In contrast, in subsample pattern 1200, each row has a non-zero scaling value, while only one column (the second column) has non-zero scaling values. In subsample pattern 1300, each column has a non-zero scaling value, while only one row (the third row) has non-zero scaling values. In further patterns, one or more rows and/or columns may not include a non-zero scaling value, may include a single non-zero scaling value, or may include multiple non-zero scaling values.
Subsample patterns 1100, 1200, 1300, and 1400 are provided for purposes of illustration. Any type of subsample pattern may be used, including any number of coordinates having non-zero subsampling scaling values. For example, subsample patterns 1100, 1200, 1300, and 1400 each include 5 non-zero subsampling scaling values “sxy.” More than 5 or less than 5 non-zero subsampling scaling values may be used, as desired for the particular application. Furthermore, any configuration of non-zero subsampling scaling values may be present in a subsample pattern, including one or more full or partially full horizontal bars, one or more full or partially full vertical bars, one or more full or partially full diagonal bars, one or more “X” patterns, a quincunx pattern, a full or partially full shape such as a circle, a rectangle, or a diamond, other pattern, or any irregular pattern.
In step 808, each N by M array portion is subsampled according to the corresponding selected subsample pattern to generate a second array of filtered pixel data values. In embodiments, a filtered pixel data value is calculated for each N by M array portion by applying the selected subsample pattern. The filtered pixel data value is calculated by applying a function to a subset of the pixel data values of the N by M array portion according to the corresponding selected subsample pattern.
For instance, continuing the present example, subsample pattern 1100 of
filtered pixel data value=S11R11+S22R22+S33R33+S44R44+S55R55 Equation 2
In Equation 2 above, multiplications involving subsample scaling values that are equal to zero are not performed, and thus are not shown. In an embodiment, the red pixel data values of N by M array portion 1002 may have bit lengths of 5 bits (as in
R11=16
R22=7
R33=23
R44=31
R55=3
Subsampling scaling values S11, S22, S33, S44, and S55 may all have the same value, or may have different values, as desired. For instance, in the present example, S11, S22, S33, S44, and S55 may have equal weighting, and are equal to ⅕ (0.2). Thus, a filtered pixel data value may be calculated according to the Equation 2 for the present example, as follows:
filtered pixel data value=(0.2)16+(0.2)7+(0.2)23+(0.2)31+(0.2)3=16
Thus, in the current example, a red filtered data pixel for N by M array portion 1002 of
Equation 2 shown above for calculating a filtered pixel data value for an N by M array portion can be generalized as follows:
As described above, subsampling scaling values s11-sxy can have zero or non-zero values, depending on the configuration of the particular subsampling pattern. In embodiments, at least some of the scaling values s11-sxy have zero values. Because some of scaling values s11-Sxy have zero values, calculations do not need to be performed in Equation 3 on all pixel data values of each N by M array portion. This reduces a number of required calculations to generate a down-sized image array, and thus reduces an overall processing load.
Equation 3 can be used to calculate a filtered pixel data value for each N×M array portion 902aa-902xy of the entire array 900 shown in
In an embodiment, array 1500 is a down-sized version of a single color channel corresponding to a captured image. For example, array 1500 may be a down-sized version of array 1000 shown in
Note that in an embodiment, for processing of additional color channels of a captured image, the receiving, segmenting, and subsampling of steps 802, 804, and 808 may be performed using the same subsample patterns selected during the first color channel iteration of step 806. Thus, in such an embodiment, step 806 does not need to be repeated for color channels subsequent to the first color channel.
Furthermore, flowchart 800 may be repeated for each captured image in a video stream. In this manner, down-sized images may be generated to be shown in sequence on a smaller display, to provide video on the smaller display.
A device may be configured in a variety of ways to implement flowchart 800 of
Array portion selector 1706 may be configured to perform steps 802 and 804 of flowchart 800 in
Subsample pattern selector 1708 may be configured to perform step 806 of flowchart 800. As shown in
Subsampling module 1710 may be configured to perform step 808 of flowchart 800. As shown in
In embodiments, image subsampling system 1700 is configured to perform its functions for one or more color channels of each captured image, such as for captured images in a video stream.
If the same subsample pattern is used for all N by M array portions for a particular captured image, a fixed pattern noise may appear. To mitigate such fixed pattern noise, subsample pattern selector 1708 may be configured to avoid repeating selection of subsample patterns from subsample patterns 1712 in some manner. This may be accomplished in a variety of ways. For example, in one embodiment, subsample pattern selector 1708 may be configured to select subsample patterns such that adjacent N by M data array portions 1718 in array 1714 have non-matching subsample patterns. For example, referring to
In another embodiment, subsample pattern selector 1708 selects subsample patterns from subsample patterns 1712 in a random (e.g., true random or pseudo-random) manner. For instance, as shown in
In another embodiment, subsample pattern selector 1708 selects subsample patterns from subsample patterns 1712 according to an index array. For example, subsample pattern selector 1708 can be configured to perform flowchart 1900 shown in
Flowchart 1900 begins with step 1902. In step 1902, an index array is received having an index value corresponding to each of the plurality of N by M array portions. For instance,
In the example of
In step 1904, each index value of the index array is assigned a subsample pattern from the plurality of subsample patterns. In an embodiment, subsample pattern selector 1708 selects a different subsample pattern of subsample patterns 1712 for each index value. In the current example, subsample pattern selector 1708 selects five subsampling patterns to correspond to index values IV1-IV5. For instance, subsample pattern 1100 of
In step 1906, for each N by M array portion, the subsample pattern that is assigned to the index value corresponding to the N by M array portion is selected. According to step 1906, step 806 of flowchart 800 is performed by selecting the subsample pattern for an N by M array portion according to the index value assigned in the index array. For example, referring to index array 2000 of
According to flowchart 1900, the distribution of subsample patterns applied to N by M array portions of an array can be controlled by inserting the index values IV into an index array in any desired manner. Subsampling patterns can be reassigned to each index value periodically, such as each time a new captured image is being processed, to avoid a noise pattern occurring in a video display in the time domain.
As described above, if the same subsample pattern is used for all N by M array portions for a particular captured image, a fixed pattern noise may appear. A solution to this problem described above is to avoid using the same sampling pattern for adjacent array portions (e.g., avoiding repetition in the “spatial domain”). A similar problem can occur in the time domain, if the same subsample pattern is used for a particular N by M array portion location across multiple sequential captured images. To mitigate such a noise pattern issue, subsample pattern selector 1708 may be configured to avoid repeating selection of the same subsample pattern from subsample patterns 1712 for images captured adjacently in the time domain. Thus, in an embodiment, flowchart 800 may include step 2102 shown in
In step 2102, subsample patterns are selected such that the N by M data array portions of the first array have subsample patterns that do not match subsample patterns of corresponding N by M array portions in a temporally adjacent captured image in a video image stream. For example,
Four subsample patterns are shown in
Subsample patterns adjacent in the time domain may be selected to be different in a variety of ways. For example, selection of adjacent subsample patterns in the time domain may be performed in the manners described above for adjacent subsample patterns in the spatial (same image) domain, including through random selection, using an index array, etc.
In this document, the terms “computer program medium” and “computer usable medium” are used to generally refer to media such as a removable storage unit, a hard disk installed in hard disk drive, and signals (i.e., electronic, electromagnetic, optical, or other types of signals capable of being received by a communications interface). These computer program products are means for providing software to a computer system and to storing software in a computer system or other device. The invention, in an embodiment, is directed to such computer program products.
In an embodiment where aspects of the present invention are implemented using software/firmware, the software/firmware may be stored in a computer program product and loaded into a computer system or other device using a removable storage drive, hard drive, or communications interface. The computer system or other device may execute the software/firmware from storage such as a hard drive or memory device (e.g., a ROM device such as an electrically erasable ROM, electrically programmable ROM, a RAM device such as a static RAM, dynamic RAM, etc.). This control logic software/firmware, when executed by a processor, causes the processor to perform the functions of the invention as described herein.
According to an example embodiment, a mobile device may execute computer-readable instructions to process image data, as further described elsewhere herein (e.g., as described with respect to flowchart 800 of
While various embodiments of the present invention have been described above, it should be understood that they have been presented by way of example only, and not limitation. It will be apparent to persons skilled in the relevant art that various changes in form and detail can be made therein without departing from the spirit and scope of the invention. Thus, the breadth and scope of the present invention should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.