The field of this disclosure relates generally to imaging and more particularly, but not exclusively, to systems and methods for reading optical codes.
Optical codes encode useful, optically-readable information typically about the items to which they are attached or otherwise associated. Perhaps the best example of an optical code is the bar code. Bar codes are ubiquitously found on or associated with objects of various types, such as the packaging of retail, wholesale, and inventory goods; retail product presentation fixtures (e.g., shelves); goods undergoing manufacturing; personal or company assets; and documents. By encoding information, a bar code typically serves as an identifier of an object, whether the identification be to a class of objects (e.g., containers of milk) or a unique item (e.g., U.S. Pat. No. 7,201,322). A typical linear or one-dimensional bar code, such as a UPC code, consists of alternating bars (i.e., relatively dark areas) and spaces (i.e., relatively light areas). In a UPC code, for example, the pattern of alternating bars and spaces and the widths of those bars and spaces represent a string of binary ones and zeros, wherein the width of any particular bar or space is an integer multiple of a specified minimum width, which is called a “module” or “unit.” Thus, to decode the information, a bar code reader must be able to reliably discern the pattern of bars and spaces, such as by determining the locations of edges demarking adjacent bars and spaces from one another, across the entire length of the bar code.
Linear bar codes are just one example of the many types of optical codes in use today. Higher-dimensional optical codes, such as, two-dimensional matrix codes (e.g., MaxiCode) or stacked codes (e.g., PDF 417), which are also sometimes referred to as “bar codes,” are also used for various purposes.
Different methods and types of optical code readers are available for capturing an optical code and for decoding the information represented by the optical code. For example, image-based optical code readers are available that include imagers, such as charge-coupled devices (CCDs) or complementary metal oxide semiconductor (CMOS) imagers, that generate electronic image data that represent an image of a captured optical code. Image-based optical code readers are used for reading one-dimensional optical codes and higher-dimensional optical codes. Because optical codes most often include dark and light patterns (e.g., black and white) that represent binary data, imagers of image-based optical code readers are typically monochrome so that uniform sensitivity for each pixel of the imager is achieved.
Common imagers made for image capturing devices, such as still cameras and video cameras, however, are primarily color imagers—not monochrome. Because imagers made for many image capturing devices are color, color imagers are generally made in higher volume and have become more widely available and may be less expensive than monochrome imagers. Common color imagers include a color filter array placed over pixel sensors arranged in a grid of rows and columns. A typical color filter pattern is the Bayer pattern 100 shown in
Some image-based optical code readers have included color imagers, but the present inventor has recognized that interpolation methods used with color-imager-based optical code readers degrade spatial resolution of optical code images making it difficult to detect accurately edge locations of optical codes. For example, a typical color-imager-based optical code reader that has the same number of total pixels as a monochrome-imager-based optical code reader has lower spatial resolution than the monochrome-imager-based optical code reader due to the color interpolation process. Alternatively, the typical color-imager-based optical code reader will have more total pixels than the monochrome-imager-based optical code reader to compensate for the degrading effects of the color interpolation process.
This disclosure describes improved optical code readers and associated methods.
One embodiment discloses a method of processing image data that represent light intensity values sensed by different pixels of a color image sensor array used in an optical code reader to improve edge location detection accuracy of optical code elements. The color image sensor array includes first and second sets of pixels. The pixels of the first and second sets are arranged along multiple parallel axes of a first axes group and along multiple parallel axes of a second axes group transverse to the first axes group in a checkerboard pattern. The first set of pixels and the second set of pixels are sensitive to visible wavelength bands of light that are different from one another. The pixels of the first set sense light reflected from an optical code that is positioned within a field of view of the optical code reader. The reflected light forms an image of the optical code on the color image sensor array. The image includes a pattern of dark and light elements that have edges to be detected that are oriented to be appreciably parallel to the axes of the first axes group. A first set of image data representing intensity values sensed by the first set of pixels is produced, and a second set of image data is produced from the first set of image data. The second set of image data represents interpolated intensity values that correspond to locations of selected pixels of the second set. For each location of a selected pixel of the second set, a corresponding interpolated intensity value is produced by using only intensity values sensed by pixels of the first set that share an axis of the first axes group with the selected pixel to thereby preserve spatial resolution along the second axes group and improve location detection accuracy of the edges of the dark and light elements of the optical code.
Additional aspects and advantages will be apparent from the following detailed description of preferred embodiments, which proceeds with reference to the accompanying drawings.
With references to the above-listed drawings, this section describes particular embodiments and their detailed construction and operation.
The red, green, and blue pixels 304, 306, and 308 of the color image sensor array 202 are arranged along multiple parallel axes of a first axes group 310 and along multiple parallel axes of a second axes group 312 transverse to the first axes group 310 in a Bayer pattern. The green pixels 306 are positioned at every other pixel location to form a checkerboard pattern with a combination of the red pixels 304 and blue pixels 308.
The red pixels 304 of color image sensor array 202 are sensitive to visible light having wavelengths that correspond to the color red (wavelengths ranging between about 600 nanometers (nm) and about 750 nm). The green pixels 306 are sensitive to visible light having wavelengths that correspond to the color green (wavelengths ranging between about 500 nm and about 600 nm). The blue pixels 308 are sensitive to visible light having wavelengths that correspond to the color blue (wavelengths ranging between about 400 nm and about 500 nm). The red, green, and blue pixels 304, 306, and 308 produce image data representing light intensities sensed by the pixels.
The optical code reader 200 includes an optical system 204 positioned to focus light on the color image sensor array 202. The optical system 204 may include conventional optical components, such as one or more lenses, an aperture, and, in some cases, a mechanical shutter. As an alternative to a mechanical shutter, the color image sensor array 202 may include electronic shuttering means.
The optical code reader 200 may include one or more artificial illumination sources 206 positioned to illuminate a field of view 208 of the optical code reader 200 (two artificial illumination sources are shown in
The optical code reader 200 includes a data processing system 210. The data processing system 210 may include conventional hardware, such as camera interface hardware, and one or more programmable central processing units (CPU). The data processing system 210 may also include a field programmable gate array (FPGA) for performing various operations described below (e.g., pixel selection, interpolation, edge detection) to reduce the loading of other processor-based stages and, thus, allow for higher pixel rate processing or slower processor speeds. An FPGA may also implement spatial filtering of images using, for example, one-dimensional or two-dimensional convolution kernels for improving a signal-to-noise ratio (by reducing noise using a low-pass or band-pass filter), or for sharpening an image using a high-pass filter. Filters implemented by an FPGA may also be used to compute signal values between pixel sites to produce higher resolution interpolated images. Alternatively, or in addition, to an FPGA, the data processing system may include various types of programmable or non-programmable logic hardware, such as a complex programmable logic device (CPLD), a masked logic array, a standard cell, and a full custom application specific integrated circuit (ASIC), to perform the various operations.
The data processing system 210 may be contained within a housing 205 of the optical code reader 200. Alternatively, the data processing system 210 may be external to the housing 205 of the optical code reader 200, the data processing system 210 and the optical code reader 200 may communicate through a wired (e.g., EIA232, USB) or wireless (e.g., WLAN, Bluetooth®) communication link, and the data processing system 210 may communicate simultaneously with multiple optical code readers 200.
In operation, the optical code 212 is positioned in, or passed through, the field of view 208 of the optical code reader 200. The field of view 208 of the optical code reader 200 may be illuminated by artificial light generated by artificial illumination sources 206 or by ambient light. The light that illuminates the field of view 208 includes light having wavelengths that correspond to the color green. The light reflects off the optical code 212 toward the optical system 204. The optical system 204 focuses the reflected light on the pixels of the color image sensor array 202—the focused light forming an image of the optical code 212 on the pixels. A first set of image data representing the intensities values of light sensed by the green pixels 306 is transmitted to the data processing system 210. The data processing system 210 uses the first set of image data to produce a second set of image data representing interpolated intensity values for red and blue pixel locations. The first and second sets of image data are used to decode the optical code 212 (e.g., detect the edges 404 of the dark elements 400 and light elements 402, classify cells as dark or light). The red pixels 304 and the blue pixels 308 may also produce image data representing the intensities values of light sensed by the red and blue pixels 304 and 308. The image data produced by the red and blue pixels 304 and 308, however, may be replaced by the second set of image data or ignored. The image data produced by the red and blue pixels 304 and 308 may be retained for other purposes such as providing a color image on a display for human viewing.
Orientations of the optical code 212 and the parallel axes of the first and second axes groups 310 and 312 will now be described.
Production of the interpolated intensity values according to one embodiment will now be described in more detail. The interpolated intensity values correspond to selected locations of the red pixels 304 and the blue pixels 308. For a selected location, an interpolated intensity value is produced using only the intensity values of the green pixels 306 located along the axis of the first axes group 310 (i.e., the intensity values of the green pixels 306 that share an axis of the first axes group 310 with the selected location). In other words, the data processing system 210 performs single-axis interpolation—the axis of interpolation corresponding to the orientation of the edges 404′ of the image 212′ of the optical code 212. For example,
By using only the intensity values of green pixels 306 located along axes appreciably parallel to the edges of optical codes to produce interpolated intensity values, the locations of the edges of optical codes are preserved more accurately compared to methods that interpolate across the edges of optical codes. In other words, the above-described method preserves spatial resolution of the color image sensor array 202 along the parallel axes of the second axes group 312 so that the locations of the edges of optical codes may be accurately identified. Thus, the above-described method allows the color image sensor array 202 to achieve a spatial resolution across optical code edges that is comparable to that achieved by a monochrome imager having the same number of pixels as the sum of the red, green, and blue pixels 304, 306, and 308. In addition, by using only information from the green pixels 306 to read the optical code 212, problems associated with, and the need to compensate for, differences in sensitivity between the red pixels 304, green pixels 306, and blue pixels 308 may be avoided.
If the selected pixel is a red pixel 304 or a blue pixel 308, the intensity value is ignored or discarded, and the data processing system 210 identifies the neighboring green pixels 306 that share an axis of the first axes group 310 with the selected pixel (step 708). For example, for the blue pixel 308 in the first column and second row of
The data processing system 210 need not perform all the above-described steps, and the data processing system 210 may perform alternative steps. For example, although linear interpolation has been described, the data processing system 210 may perform other known interpolation methods using one or more green pixels 306 located along the parallel axes of the first axes group 310 (i.e., other more computationally complex interpolation methods may be used to achieve higher levels of accuracy such as polynomial or spline interpolation). Additional information about various interpolation methods can be found in W
For some locations of the red and blue pixels 304 and 308, interpolated intensity values may not be produced (i.e., some locations are not selected locations). For example, for a color image sensor array 202 with n parallel axes of the second axes group 312 (i.e., n rows), interpolated intensity values need not be produced for red or blue pixels located along the first axis of the second axes group 312 (e.g., the top edge row of the color image sensor array 202) and the nth axis of the second axes group (e.g., the bottom edge row of the color image sensor array 202). In one embodiment, the intensity values of the green pixels 306 are the only intensity values used from the top edge and bottom edge rows to read the optical code 212. Alternatively, the intensity values of the top edge and bottom edge rows may not be used to decode the optical code 212.
Although the system and method described above correspond to an example where the image 212′ of the optical code 212 is oriented in a picket fence orientation, the image 212′ of the optical code 212 may also be oriented in a ladder orientation. With the ladder orientation, the parallel axes of the first axes group 310 correspond to the rows of pixels and interpolation is performed using the green pixels 306 of the rows instead of the green pixels of the columns so that spatial resolution in a direction across the edges 404′ of the image 212′ may be preserved.
In an alternative embodiment, the single-axis interpolation described above is performed along the axes of the first axes group 310 and then along the axes of the second axes group 312 so that two sets of interpolated intensity values are produced. The two sets of interpolated intensity values may be produced from the same set of green intensity values (e.g., a single frame) or from different sets of green intensity values (e.g., different frames). The sets of interpolated intensity values are used independently, in combination with the corresponding set of green intensity values, to identify the edges of the optical code 212 and, thereby, decode it. In other words, two interpolated images (including green intensity values and interpolated intensity values) are computed, one using vertical interpolation and the other using horizontal interpolation, and each interpolated image may be decoded independently.
For example, after capturing an image of the optical code 212, in a first processing round, the data processing system 210 performs the method 700 for each pixel of the color image sensor array 202 (note, the pixels of the first and nth rows need not be processed); then, in a second processing round, the data processing system 210 performs the method 700 for each pixel of the color image sensor array (again, the pixels of the first and nth rows need not be processed) with the exception that in steps 708 and 710, the neighboring green pixels 306 that share an axis of the second axes group 312 with the selected pixel are identified and their intensity values are used to produce the mean intensity value (e.g., for the red pixel 304 in the second column, third row of
By independently generating two interpolated images—one reflecting horizontal interpolation and the other reflecting vertical interpolation—locations of the edges 404 of the optical code 212 may be accurately identified regardless of the orientation of the optical code 212 (e.g., picket fence or ladder). Moreover, the optical code reader 200 need not attempt to determine the orientation of the optical code 212 prior to interpolating and decoding. For example, labels on packages and/or other optical codes within the field of view 208 of the optical code reader 200 may make it difficult for the optical code reader 200 to determine, prior to decoding, the orientation of the optical code 212 (e.g., the edges of symbols on packaging labels may dominate over those of the optical code 212 when attempting to use conventional edge detection techniques (e.g., gradient computation) to determine the orientation of the optical code 212). The data processing system 210 may operate relatively quickly so that it generates the interpolated images and attempts to decoded them without significantly increasing the processing time.
Alternatively, the data processing system 210 may analyze the interpolated images to determine which interpolated image to decode. The interpolated images may be compared (e.g., edge sharpness comparison) to identify the interpolated image that most accurately reflects the locations of the optical code edges 404. Several possible measures of the amount of signal modulation may be implemented to choose the interpolated image that is most likely to have been interpolated in a direction substantially parallel to the edges 404 of the optical code 212. For example, one measurement may be standard deviation, in which the image is chosen that has the smallest standard deviation of pixel values along a row or column. Alternatively, a second measurement may be the differences between adjacent pixels, in which the image is chosen that has the smallest sum of the absolute values of the differences between adjacent pixels. The interpolated image that represents edges 404 in higher resolution may be selected for decoding. Choosing one of the interpolated images to decode—instead of decoding both interpolated images—may be useful in some applications.
The data processing system 210 may also use feedback information from a decoder implemented in the data processing system 210 to identify the orientation of the optical code 212 so that the optical code reader 200 can improve its performance during a subsequent read. For example, the decoder may be able to identify whether the optical code 212 is oriented in a picket fence or ladder orientation without being able to actually decode it. Accordingly, the decoder can communicate that the optical code 212 was in a particular orientation so that the data processing system 210 need only interpolate along either the first set of axes 310 or the second set of axes 312 during a subsequent attempt to read the optical code 212.
In the embodiments described above, green pixel data is used to compute interpolated intensity values and to decode the optical code 212. Skilled persons will recognize, however, that red pixel data, blue pixel data, or a combination of red and blue pixel data may be used in accordance with the above-described embodiments to compute interpolated intensity values corresponding to green pixel locations to decode the optical code 212.
Moreover, although the colors red, green, and blue and the Bayer pattern have been described above in connection with the color image sensor array 202, other colors and filter patterns may be used without departing from the scope and spirit of the present disclosure. For example, the color image sensor array 202 may include a cyan, yellow, green, and magenta (CYGM) filter; a red, green, blue, and emerald (RGBE) filter; or a white, red, green, and blue (WRGB) filter. The optical code reader 200 and its associated methods are flexible to compensate for the effects of these various filters. For example, single-axis interpolation may be conducted using one or more of the colors of these different filters.
Certain embodiments may be capable of achieving one or more of the following advantages: (1) enabling utilization of lower cost color imagers in optical code readers; (2) achieving higher spatial resolution with a color imagers by interpolating along—not across—optical code edges; (3) reducing processor loading to allow for higher pixel rate processing or lower processor speeds by performing various operations via an FPGA; and (4) reading higher density optical codes than would otherwise be possible.
Though the present invention has been set forth in the form of its preferred embodiments, it is nevertheless intended that modifications to the disclosed systems and methods may be made without departing from inventive concepts set forth herein.
This application claims benefit under 35 U.S.C. §119(e) of U.S. Provisional Application No. 61/116,425, titled “High-Resolution Interpolation for Color-Imager-Based Optical Code Readers,” filed Nov. 20, 2008, the entire contents of which is incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61116425 | Nov 2008 | US |