|Publication number||USRE42555 E1|
|Application number||US 11/267,917|
|Publication date||Jul 19, 2011|
|Priority date||Sep 1, 1999|
|Also published as||US6642962|
|Publication number||11267917, 267917, US RE42555 E1, US RE42555E1, US-E1-RE42555, USRE42555 E1, USRE42555E1|
|Inventors||Tao Lin, Vincent Chor-Fung Yu, Tianhua Tang, Beong-Kwon Hwang|
|Original Assignee||Faust Communications, Llc|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (28), Referenced by (5), Classifications (17), Legal Events (3)|
|External Links: USPTO, USPTO Assignment, Espacenet|
This invention relates to digital cameras, and more particularly to digital signal processing that integrates color interpolation with edge detection.
Digital cameras are being improved and lowered in cost at an amazing rate. In a recent year, more digital cameras were sold than traditional film cameras. Images from digital cameras can be downloaded and stored on personal computers. Digital pictures can be converted to common formats such as JPEG and sent as e-mail attachments or posted to virtual photo albums on the Internet. Video as well as still images can be captured, depending on the kind of digital camera.
The R, G, or B digital values in the Bayer pattern are processed by processor 10 to generate luminance-chrominance YUV pixels. The YUV pixels can then be displayed on display 19 or compressed by compressor 18 and stored on disk 17 or on a solid-state memory. YUV pixels often have a 4:4:4 format, with 8 bits for each of 2 colors and for the luminance.
Sensor 12 detects red, blue and green colors. However, each array point in sensor 12 can detect only one of the three primary colors. Rather than outputting an RGB pixel, sensor 12 can output only a single-color pixel at any given time. For example, a line of pixels output by sensor 12 might have a red pixel followed by a green pixel. Another line might have alternating green and blue pixels.
Each pixel represents the intensity of one of the primary colors at a point in the sensor array. Thus a red pixel indicates the intensity of red light at a point, while a neighboring green pixel indicates the intensity of green light at the next point in the sensor array. Each pixel contains only one-third of the total color information.
The remaining color information is obtained by interpolation. The green intensity of a red pixel is calculated by averaging the green intensities of neighboring green pixels. The blue intensity for that red pixel is calculated by averaging or interpolating the nearest blue pixels. Processor 10 performs this color interpolation, calculating the missing primary-color intensities for each pixel location.
Processor 10 also may perform other enhancements to the image. Edges may appear fuzzy because the color interpolation tends to spread out features. These edges can be sharpened by detecting the edges and enhancing the color change at the edge to make the color transition more abrupt. Color conversion from RGB to YUV is also performed by processor 10.
The electrical currents produced by the different primary colors can vary, depending on the sensor used and the wavelength and energy of the light photons. An adjustment known as a white-balance is often performed before processor 10, either on analog or digital values. Each primary color can be multiplied by a different gain to better balance the colors. Compensation can also be made for different lighting conditions, increasing all primary colors for dark pictures or decreasing all colors for bright pictures (overexposure).
A personal computer displays full-color pixels that have all three primary-color intensities (RGB). In contrast, the sensor in a digital camera can detect only one of the three primary colors for each point in the 800×600 sensor array. Detectors for green are alternated with red detectors in the first line, while green detectors are alternated with blue detectors in the second line.
The first horizontal line and each odd line have alternating red and green detectors, so pixels output from these odd lines are in a R-G-R-G-R-G-R-G sequence. The second horizontal line and each even line have alternating green and blue detectors, so pixels output from these even lines are in a G-B-G-B-G-B-G-B sequence.
Half of the pixels are green pixels, while one-quarter of the pixels are read and the last quarter are blue. The green pixels form a checkerboard pattern, with blue and red pixels surrounded by green pixels. Since the human eye is more sensitive to green, the Bayer pattern has more green pixels than red or blue.
The green intensity for a red pixel location can be interpolated by averaging the four green pixels that surround the red pixel. For example, the green intensity for red pixel at location (3,3) is the sum of green pixels (3,2), (3,4), (2,3), and (4,3), divided by four. Likewise, the green intensity for a blue pixel location can be interpolated by averaging the four surrounding green pixels. For blue pixel (2,4), the interpolated green intensity is the sum of green pixels (2,3), (2,5), (1,4), and (3,4), divided by four.
The red and blue values for a green pixel location can also be calculated from the 2 red and 2 blue pixels that surround each green pixel. For green pixel (2,3), the interpolated red value is the average of red pixels (1,3) and (3,3) above and below the green pixel, while the interpolated blue value is the average of blue pixels (2,2) and (2,4) to the right and left of the green pixel.
Many different techniques have been used for color interpolation and white balance. See U.S. Pat. Nos. 5,504,524 and 5,260,774, which show white-balance from analog signals. Sometimes a whole frame buffer is used for white balance or interpolation. Whole-frame buffers can be large, mega-pixel buffers that hold all 800×600 pixels. See, U.S. Pat. No. 5,260,774, FIGS. 1-3. Color and edge enhancement are often not performed or are performed by a separate unit, perhaps also using a whole-frame buffer.
While such digital-camera processors are useful, cost reduction is desirable since digital cameras are price-sensitive consumer devices. Whole-frame buffers require large memories, and as digital cameras are increased in resolution, larger memories are needed for the larger number of pixels.
What is desired is a digital-camera processor that does not use a whole-frame buffer. It is desired to perform color interpolation of Bayer-pattern pixels without storing all the pixels in a frame. It is desired to use smaller line buffers, which store only a few lines of pixels rather than all 600 lines in a SVGA image. It is further desired to perform both color interpolation and edge detection at the same time, using integrated hardware. It is desired to merge the edge detector into the interpolator. It is desired to also perform while balance, edge enhancement, and YUV conversion without using a whole-frame buffer. It is desired to process all pixels in a frame in a single pass, without storing all the pixels.
A digital-image processor has a line buffer that receives mono-color pixels captured by an image sensor. The line buffer stores only a fraction of a whole frame of an image. The fraction is less than 5 percent of a number of pixels in the whole frame.
A merged pipeline receives an array of mono-color pixels from the line buffer. It generates missing color values for a middle pixel. The middle pixel is a mono-color pixel in a middle of the array from the line buffer.
The merged pipeline also generates an upper primary color value for an upper pixel immediately above the middle pixel and a lower primary color value for a lower pixel immediately below the middle pixel.
An edge detector receives the upper primary color value and the lower primary color value and a primary color value for the middle pixel. The edge detector detects an edge between the middle pixel and a neighboring pixel. An edge enhancer is activated by the edge detector when the edge is detected. It increases a magnitude of the middle pixel when the edge is detected. The merged pipeline outputs interpolated color values for the middle pixel. Thus interpolation and edge detection are performed by the merged pipeline using the line buffer.
In further aspects of the invention a color-space converter is coupled to receive the middle pixel including the missing color values generated by the merged pipeline. It converts color values into luminance and chromatic values. The edge enhancer increases the luminance value of the middle pixel when activated. The color-space converter converts from red, green, blue RGB color values to luminance and chromatic YUV values representing a color of a pixel.
In further aspects the edge detector receives green color values. The edge detector performs edge detection using green values, but the edge enhancer sharpens edges by adjusting the luminance value of the middle pixel.
In further aspects the merged pipeline has a horizontal interpolator that receives the array from the line buffer. It averages mono-color pixels within a same horizontal line to produce intermediate color values. A column register is coupled to receive the intermediate color values from the horizontal interpolator. It stores intermediate color values for a single column of pixels in the array. A vertical interpolator receives the intermediate color values from the column register. It averages intermediate color values within a same single column of pixels. The vertical interpolator outputs RGB color values for the middle pixel, but it also outputs G values as the upper and lower primary color values to the edge detector. Thus horizontal and vertical interpolation are performed separately.
In still further aspects of the invention the column register includes one green register for each of at least 5 lines. The column register also includes at least 3 shared registers for a middle line containing the middle pixel and an upper and a lower line immediately above and below the middle line. Thus the shared registers alternately store red and blue color values for alternate clock cycles.
The present invention relates to an improvement in digital-image processing. The following description is presented to enable one of ordinary skill in the art to make and use the invention as provided in the context of a particular application and its requirements. Various modifications to the preferred embodiment will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed.
Minimizing the amount of buffer memory required to process images from a digital camera is an important design goal. The inventors have realized that whole-frame buffers become more expensive as camera resolution increases, since each image contains more pixels. Such whole-frame buffers are often used between the different processing units, such as between the color interpolator and the edge detector and color enhancer.
The different processing units, such as white balance, pixel-interpolation, edge detect and enhancement, YUV conversion and color enhancement usually operate as independent units. Buffers are used between units to allow for slightly different processing rates. These buffers require memory and add cost.
The inventors have realized that a tightly-integrated processor can perform the various functions in a single, tightly-coupled pipeline. In particular, pixel interpolation and edge detection can use many, of the same adders and storage registers, allowing interpolation and edge detection to be performed at the same time on the same area of the image. The interpolation results can immediately be converted to YUV format, enhanced, and output, eliminating the need for large intermediate buffers.
White balance can be performed on the fly as the pixels are sent from the sensor to the interpolator. Thus a separate frame buffer for white balance can also be eliminated.
A small buffer is used between the white balancer and the interpolator. This is a line buffer rather than a frame buffer, since only a few lines of the image are stored. The line buffer stores a portion of the image that is currently being interpolated. Only 2 to 4 lines of the 600 or more lines need to be stored in the line buffer, providing a memory savings of better than 99%. Even for different resolutions, the line buffers still require only 5% of the memory needed for a whole frame buffer.
Using the 2-4 line buffer, plus a few individual pixel registers in the pipeline, allows the following operations to be performed in a single pass through the processor:
No frame buffers are needed within the pipeline. The sensor can input pixels in the Bayer pattern directly to the processor without buffering. Pixels output from the processor can be immediately sent to display, storage, or compression buffers.
The sensitivity of the sensor to the different primary colors is not equal. Some colors experience more attenuation than others. Also, the image may be under or over exposed. White balancer 26 multiplies each pixel from front end 22 by a gain. Red pixels are multiplied by a red gain, blue pixels by a blue gain, and green pixels by a green gain. The pixel-gain product is output from white balancer 26 to line buffer 30.
The pixel gains may be pre-set gains, or may be calculated on the fly. Pre-set gains can be calculated at the factory for the sensor type and fixed gains stored in a register and applied to white balancer 26. Video digital cameras produce a series of frames, and still cameras are normally pointed toward the picture before shooting, so gain calculator 24 can generate a running average of all pixels for each of the 3 colors from one frame, and use the averages to calculate gains for the next frame. Averages can also be generated for just a portion of an image frame, and the gains applied to the entire image or a portion of the image.
Four-line buffer 30 contains about four lines of pixels, rather than all 600 or more lines. For SVGA resolution, each line contains 800 pixels, so line buffer 30 contains 800×4 or 3,200 pixels. These are single-color pixels of 12 bits per color, so the memory size is 38 Kbytes. Other resolutions, such as 1024×768 have more pixels per line, so the size of line buffer 30 can increase to 48 Kbytes or more.
Interpolator 41 performs both horizontal and vertical interpolation to generate all three color components (R,G,B) for each pixel. Interpolation is performed by adding weighted color values from neighboring pixels of the desired color. Only the neighboring pixels that touch the current pixel location are added in the interpolation. There are a total of 8 such neighboring pixels—three pixels on three lines.
The interpolation weighting or filter varies by color, since there are twice as many green pixels in a Bayer pattern as there are red or blue pixels. The green pixels form a checkerboard pattern with green pixels on every line, but the red or blue pixels form a more open pattern with pixels only on alternating lines.
The interpolation filter for green is:
which is a 3×3 kernel that can be separated into a 3×1 kernel and a 1×3 kernel:
The 3×1 kernel is implemented as a vertical interpolation step that multiplies the pixel above by ¼ and the pixel below by ¼, while the current pixel location is multiplied by ½. The 1×3 kernel becomes a horizontal interpolation step that multiplies the pixel on the left by ½ and the pixel to the right by ½, while the current pixel location is multiplied by 1. Since half of the locations in a Bayer pattern are missing green values, not all of the kernel coefficients are used to calculate a pixel's green value.
The interpolation filter for red and blue is:
which is a 3×3 kernel that can be separated into a 3×1 kernel and a 1×3 kernel:
The 3×1 kernel is implemented as a vertical interpolation step that multiplies the pixel above by ½ and the pixel below by ½, while the current pixel location is multiplied by 1. The 1×3 kernel becomes a horizontal interpolation step that multiplies the pixel on the left by ½ and the pixel to the right by ½, while the current pixel location is multiplied by 1. Since only one-quarter of the locations in a Bayer pattern contain red (blue) values, not all of the kernel coefficients are used to calculate a pixel's red (blue) value.
Horizontal adders 40 perform the horizontal interpolation for green, red, and blue for a current pixel location and some of the immediately surrounding pixel locations. The results are stored in column register 32. Column register 32 contains color components for just one column. Horizontal adders 40 calculate the green components for 5 lines of this column, while red and blue components are calculated for only 3 lines of this column. Thus column register 32 stores color components for a small region of the image.
These color components are not complete, since only the horizontal kernel has been applied to the pixels from line buffer 30. Vertical adders 50 perform the vertical interpolation from the horizontal results stored in column register 32, using the vertical kernels for green and red/blue. All three color components for a current pixel are generated by vertical adders 50, and this RGB value is stored in RGB register 34. The current pixel is a pixel in the third of the four lines from line buffer 30, and in the column from column register 32.
The green components for the line above and line below the current pixel are also generated by vertical adders 50. Thus the green components are generated for three lines of the column stored in column register 32. The green values are stored in green register 34′.
The RBG value for the currently-processed pixel from RGB register 34 is converted to YUV format by YUV converter 60. Color enhancer 38 receives the 2 chromatic values (U and V) and multiplies these values by a filter value to enhance certain colors. The enhanced U and V value for the current pixel is then output for display, storage, or compression.
The green values from green register 34′ are used for edge detection. The last set of green values for the previous 2 columns are stored in pipeline registers 64, so that a total of 9 green values are stored (three lines by three columns). An edge can be detected from the current (middle) pixel by comparison to the 8 surrounding pixels. When a difference above a threshold value is detected, and edge is signaled by edge detector 62. Edge enhancer 36 is then activated. Edge enhancer 36 receives the luminance (Y) value from YUV converter 60 for the current pixel, and simply outputs the Y value when no edge is detected. When edge detector 62 detects an edge, edge enhancer 36 multiplies the Y value by a filter to increase or decrease the brightness of the pixel, thereby enhancing or sharpening the edge.
The pipeline delay through pipeline registers 34′ and edge detector 62 matches the pipeline delay through RGB register 34 and YUV converter 60, so that the same current pixel is edge detected and YUV-converted. Thus edge detection and YUV conversion occur simultaneously for the same pixel. Horizontal adders 40 and vertical adders 50 interpolate for both RGB-YUV conversion and edge detection. Green values are calculated for two additional lines so that edge detection can also be performed using the intermediate results. Edge enhancement and color enhancement are also performed at the same time on the same pixel by color enhancer 38 and edge enhancer 36.
By performing a few additional calculations, interpolator 41 provides inputs to edge detector 62 as well as the current RGB value. Simultaneous edge detection is then possible using the same pipeline. Edge detection is performed on the green values rather than on the Y values so that edge detection can occur earlier in the pipeline.
The most-recently-received four lines are stored in line buffer 30 for the preferred embodiment. Horizontal lines H1, H2, H3, and H4 have been stored in the four lines of line buffer 30. Horizontal line H5 is currently being received from the sensor and white balancer. Pixels along line H5 replace line Hi pixels in the first row of line buffer 30. Thus pixels to the left of the first row are from line H5 while pixels to the right are from the older line H1.
A small overlapping region occurs in a current column 70. Pixels received from the sensor are first stored in a small temporary buffer 31 in line buffer 30. Temporary buffer 31 contains a few pixels that have just been received from the sensor. Pixels in the current column 70 and in the 2 surrounding columns of oldest line H1 are not discarded immediately, but instead are sent to interpolator 41. Using temporary buffer 31 to store new pixels from line H5 allows for 5 lines of pixels (H1 to H5) to be sent to interpolator 41 for current column 70. Pixels from oldest line Hi are discarded after being sent to interpolator 41.
Current column 70 includes the actual current column and two adjacent columns, for five horizontal lines. A region of 5×3 pixels is sent from line buffer 30 to interpolator 41 for each clock cycle. This 5×3 region provides enough pixels for interpolation of a current pixel location's RGB values, and green values for the pixels immediately above and below the current pixel location. Thus edge detection values are also generated by interpolator 41.
Horizontal adders 40 receive the 5×3 array of pixel values and perform horizontal interpolation on some of the values, as shown later in
Horizontal adders produce green values for all five lines, which are stored in column register 32 as G(H1), G(H2), G(H3), G(H4), G(H5). G(H3) is the green value for the current pixel, which is line 3 of the current column. Green values for two pixels above and two pixels below the current line are stored for edge detection.
Red and Blue values are generated and stored for the current line and for the line above and the line below the current line. Since the Bayer pattern alternates lines with red and blue pixels, the values stored in column registers 32 alternates. For example, for one column B(H2) and B(H4) are stored with R(H3), while in the next clock cycle for the next column (pixel) R(H2) and R(H4) are stored with B(H3). The same register in column register 32 can store B(H2) one cycle and R(H2) the next cycle. Thus a total of 5 green values and 3 blue/red values are stored in the 8 registers in column register 32.
Vertical interpolation adds weighted color values from only one column. Thus the color values from column register 32 contain enough information to apply the vertical interpolation filters. Vertical adders 50 receive the R, G, and B values from column register 32, perform shifts to apply the weightings of the vertical filters, and then generate sums. Vertical adders 50 perform vertical interpolation as shown later in
The R, G, and B values for the current pixel in line H3 are all generated and stored in RGB register 34. The green values for the lines H2 and H4 are also calculated by vertical adders 50 and stored in register 34. The RGB values for line H3 are output to the YUV converter, while the G values for lines H2, H3, and H4 are output to the edge detector.
The three G values for lines H2, H3, H4 are stored in pipeline register 64 for the next 2 clock cycles, while the next 2 pixels are generated in line H3. Pipeline register 64 thus stores a 3×3 array of green values, for 3 lines and 3 columns. An edge can be detected by a sudden change in green value from the middle pixel to one or more of the 8 surrounding green values. Since YUV conversion requires a clock delay, by the time the YUV values are available, the current pixel is in the middle of the 3×3 array of pipeline register 64.
Pipeline delays cause the meaning of the “current” pixel to change in each pipeline stage (pipestage). For example, the pixel being converted from RGB to YUV is one pixel (column) to the right (ahead) of the “current” column of pixels being added by vertical adders 50, and two pixels (columns) to the right of the “current” column of pixels being added in horizontal adder 40. The “current” pixel being edge and color enhanced is one column to the left of the pixel in the YUV converter stage.
The subscripts shown with the pixels indicate the row and column. For example, the current pixel in the first clock cycle is in line H3, column 2, which contains G32 from the Bayer-pattern input. The next current pixel at row 3, column 3 has just a red value—R33. The Blue and green components for pixel 3,3 must be interpolated.
For the first clock cycle, pixel R32 is the current pixel. A 5×3 array of pixel values are sent from line buffer 30 to the horizontal adders. This 5×3 array includes the first three columns and all 5 lines. R11, G12, and R13 are sent from the first line, G21, B22, G23 are sent from the second line, R31, G32, and R33 from the third line, G41, B42, G43 from the fourth line, R51, G52, and R53 from the fifth line. In the next clock cycle, when R33 becomes the current pixel, the second, third, and fourth columns of all five lines are sent from line buffer 30 to the horizontal adders. The 5×3 pixel array includes G12, R13, G14 from line H1, B22, G23, B24 from line H2, G32, R33, G34 from line H3, B42, G43, B44 from line H4, and G52, R53, G54 from line H5.
The green values of the first and fifth lines are already available from the Bayer pattern and are simply copied to column register 32 as G12, G52. The G value from the third line, G32, is also copied to column register 32. The blue values are available for pixels 2,2 and 4,2, so these are copied from line buffer 30 to column buffer 32 as B22, B42.
The red value for the current pixel at 3,2 is not available and must be computed from the surrounding red values. Since horizontal interpolation is being performed, only red values from the same row are added. The red values R31, R33 to the right and left of location 3,2 are shifted to the right by one binary position to weight these by ½. The shifted R31, R33 are input to adder 46, producing the (R31+R33)/2. This is the intermediate R32 value after horizontal interpolation but before vertical interpolation.
Green values for locations 2,2 and 4,2 are also not available and must be interpolated. Again, only green values from the same horizontal line are added by horizontal adders 40. Green values G21, G23 are right-shifted by one bit and input to adder 44, which outputs (G21+G23)/2 as the intermediate G22 stored in column register 32. Green values G41, G43 are right-shifted by one bit and input to adder 48, which outputs (G41+G43)/2 as the intermediate G42 stored in column register 32. Column register 32 contains 5 green values, two of which were generated by adders 48. A red value was generated by adder 44, and 2 blue values were copied over. A total of 8 color components are stored in column register 32 for 5 pixels in one column.
The current column is 3 and the current row is 3. The red value R33 in the third line is the current pixel that will have the full RGB value generated by interpolation. The 5×3 array of pixel values sent from line buffer 30 (
The red values of the first, third, and fifth lines are already available from the Bayer pattern, however, only green values are needed for the first and last lines, so R13 and R53 are discarded. R33 is simply copied to column register 32. The green values are available for pixels 2,2 and 4,2, so these are copied from line buffer 30 to column buffer 32 as G23, G43.
The green value for the current pixel at 3,3 is not available and must be computed from the surrounding green values. Since horizontal interpolation is being performed, only green values from the same row are added. The green values G32, G34 to the right and left of location 3,3 are shifted to the right by one binary position to weight these by ½. The shifted G32, G34 are input to adder 46, producing the (G32+G34)/2. This is the intermediate G33 value after horizontal interpolation but before vertical interpolation.
Green values for the first and last row must also be generated by adders 42, 49 in the same manner. Column register 32 stores (G12+G14)/2 as intermediate G13 and (G52+G54)/2 as the intermediate G53.
Blue values for locations 2,3 and 4,3 are also not available and must be interpolated. Again, only blue values from the same horizontal line are added by horizontal adders 44, 48. Blue values B22, B24 are right-shifted by one bit and input to adder 44, which outputs (B22+B24)/2 as the intermediate B23 stored in column register 32. Blue values B42, B44 are right-shifted by one bit and input to adder 48, which outputs (B42+B44)/2 as the intermediate B43 stored in column register 32.
Column register 32 contains 5 green values, three of which were generated by adders 42, 46, 49. Two blue values were generated by adders 44, 48, and 1 red value was copied over. A total of 8 color components are stored in column register 32 for 5 pixels in one column. The same registers and adders are thus used for different color components for alternating cycles. A similar but somewhat different pair of operations occurs for green-blue lines than was shown for
The current column is 2 and the current row is 3. The green value G32 in the third line is the current pixel that will have the full RGB value generated by interpolation. The 1×3 array of pixel values stored by the horizontal interpolator into column register 32 (
The green values for the second and fourth rows are calculated by adders 52, 58. The green values G12, G32 are input to adder 52 after being right-shifted by 2 binary bits (multiplied by one quarter). The intermediate value for G22 (calculated as (G21+G23)/2 by the horizontal adder) is right-shifted by one bit before input to adder 52, which generates the sum (G12+G32+G21+G23)/4, which is the final interpolated value for G22.
Likewise, the green values G32, G52 are input to adder 58 after being right-shifted by 2 binary bits (multiplied by one quarter). The intermediate value for G42 (calculated as (G41+G43)/2 by the horizontal adder) is right-shifted by one bit before input to adder 58, which generates the sum (G32+G52+G41+G43)/4, which is the final interpolated value for G42.
The red value for location 3,2 has already been calculated during horizontal interpolation as (R31+R32)/2. This value is copied from column register 32 to RGB register 34 as the R value. Vertical interpolation is not needed since there are no red values in the lines above and below the current line.
The blue value for location 3,2 is generated by adder 56 by adding B22 and B42 after right-shifting by one bit. The blue value saved in RGB register 34 is (B22+B42)/2, representing the interpolated B32.
Adder 54 calculates the final green value for the current pixel, G32. According to the vertical filter for green, the G32 value from column register 32 is combined with the interpolated green values above and below the current location. G32 from column register 32 is right-shifted by one bit (divide by 2) and input to adder 56 along with the intermediate G22, (G21+G23)/2, and the intermediate G42, (G41+G43)/2, each right-shifted by two bit-positions for a divide by four. The result from adder 56 is:
Thus the R, B, and G values for the current pixel location (3,2) are calculated and stored in RGB register 34, while the G values above and below the current location (G22 and G42) are also stored for edge detection.
The current column is 3 and the current row is 3. The green value G33 in the third line is the current pixel that will have the full RGB value generated by interpolation. The 1×3 array of pixel values stored by the horizontal interpolator into column register 32 (
The green values for the second and fourth rows are calculated by adders 52, 58. According to the vertical filter for green, the G23 value from column register 32 is combined with the interpolated green values above and below the current location. G23 from column register 32 is right-shifted by one bit (divide by 2) and input to adder 52 along with the intermediate G13, (G12+G14)/2, and the intermediate G33, (G32+G34)/2, each right-shifted by two bit-positions for a divide by four. The result from adder 52 is:
For the fourth line, G43 from column register 32 is right-shifted by one bit (divide by 2) and input to adder 58 along with the intermediate G33, (G32+G34)2, and the intermediate G53, (G52+G54)/2, each right-shifted by two bit-positions for a divide by four. The result from adder 58 is:
The red value for location 3,3 is available from the Bayer-pattern input as R33. This value is copied from column register 32 to RGB register 34 as the R value. Vertical interpolation is not needed since there are no red values in the lines above and below the current line.
The blue value for location 3,3 is generated by adder 56 by adding the intermediate B23 and B43 after right-shifting by one bit. The blue value saved in RGB register 34 is (B22+B24+B42+B44)/4, representing the interpolated B33.
Adder 54 calculates the final green value for the current pixel, G33. G23 and G43 are right-shifted by one bit and input to adder 54, while the intermediate result for G33, (G32+G34)/2, is also right-shifted by one bit and input to adder 54. The sum from adder 54 is (G23+G32+G34+G43)/4, the interpolated value for G33.
The R, B, and G values for the current pixel location (3,3) are calculated and stored in RGB register 34, while the G values above and below the current location (G23 and G43) are also stored for edge detection.
Multiplier 72 in white balancer 26 receives the mono-color pixels from the sensor after the A/D converter. The pixels can be in a format of either 8, 9, or 10 bits per mono-color pixel. Multiplier 72 multiplies green pixels by the green gain, red pixels by the red gain, and blue pixels by the blue gain. A simple sequencer can apply the proper gain to multiplier 72. For example, the red and green gain can be alternately applied to pixels in the first and all odd lines, while the green and blue gain is alternately applied to the second line and all even lines.
Multiplier 72 outputs a 16-bit result. Clipper 73 clips the 16-bit result from multiplier 72 to a 12-bit value that is stored in the line buffer and later interpolated. The gains applied to multiplier 72 have 12 bits in a 4.8 format—four bits of integer and an 8-bit fraction.
The three gains applied to multiplier 72 can simply be numbers stores in 3 programmable registers. The gains can be constants determined by the sensor and known or assumed lighting conditions.
In more complex embodiments, the gains are calculated from a previous frame of Bayer-pattern data and applied to the current frame. Averages for each color (R, G, B) are generated for all pixels in a frame or a range within the frame. The frame can be divided into several regions and the averages calculated for each region. Regions with averages that are far away from the average for all regions can be discarded.
The white-balance calculator also finds the maximum values for each of the three color components over the frame. The gains are then the maximum value divided by the average for each color. Many clock cycles can be used to generate these averages and gains, so a small adder/subtractor can be used recursively.
Each color component is first multiplied by a constant. The red component is multiplied by 0.299 decimal using multiplier 74. The blue component is multiplied by 0.141 decimal using multiplier 78, while the green component is multiplied by 0.587 decimal by multiplier 76. Of course, the decimal numbers are converted to 8-bit binary values before being applied to the multiplier.
The 14 most-significant-bits (MSBs) from multipliers 74, 76, 78 are sent to adder 84. Adder 84 generates the sum of all three color components, which is the overall luminance Y. A 12-bit value is output by adder 84 and any carry-out is ignored.
Adders 82, 86 subtract the luminance Y from the original R and B values, respectively, to produce the V and U chromatic values. The carry-out is the sign bit, which is appended to an 11-bit output to produce a 12-bit value in two's complement.
Adder 96 then sums the products from multipliers 92, 94, producing a 12-bit value that is clipped to an 8-bit value (between −128 and 127) by clipper 100. Adder 97 then sums the products from multipliers 93, 95, also producing a 12-bit value that is clipped to an 8-bit value by clipper 102. Adders 98, 99 then add 128 to the clipped values, shifting the results, which are output as the enhanced U and V values.
Edge detection is performed with a 3×3 filter. The 3×3 filter operates on the 3 columns of 3 lines of pixels in the pipeline register. Only the green values are used for edge detection since there are twice as many green pixels as red or blue pixels in the Bayer-pattern input. The following non-separable filter may be multiplied by the 9 green values in the pipeline register:
The absolute value of the output of the filter is then compared to a register-programmable threshold. When the absolute value of the filter output exceeds the threshold, then the edge enhancer is activated. The edge enhancer multiplies the edge by a scaling factor. The scaling factor is also register-programmable. The result of the edge-scaling factor multiply is then added to the current Y value, for the pixel in the middle of the pipeline register. The result may then be clipped to 12 bits.
The following filter may also be used. Since this filter is separable into horizontal and vertical filters, it may be easier to implement:
This operation requires 8 or 4 operations for each pixel being edge detected. Other filters can also be used that amplify differences between adjacent pixels.
A digital-camera processor does not use a whole-frame buffer. It performs color interpolation of Bayer-pattern pixels without storing all the pixels in a frame. Smaller line buffers are used, which store only a few lines of pixels rather than all 600 lines in a SVGA image. Both color interpolation and edge detection are performed at the same time, using integrated hardware. The edge detector is merged into the same pipeline as the interpolator. White balance, edge enhancement, YUV conversion and color enhancement are also performed without using a whole-frame buffer. All pixels in a frame are processed in a single pass, without storing all the pixels.
Only 2 to 4 lines of the 600 or more lines need to be stored in the line buffer, providing a memory savings of better than 99%. The unified pipeline and line buffer can be integrated together on a single substrate. The chip can be all-digital since white balance, interpolation, YUV conversion, edge detection and enhancement are all performed digitally. Since the edge detection is tightly integrated with the interpolation pipeline, a separate multi-line buffer between the interpolator output and the edge-detector input is not needed.
Several other embodiments are contemplated by the inventors. The invention has been described as interpolating for locations that already have green values in the Bayer pattern. This produces a smoother color. However, it is possible to skip interpolation for locations that already have green values. The small temporary buffer in the line buffer can be expanded, and can receive either the newest pixels or the oldest pixels in the line buffer. The size of the line buffer can also be varied for different horizontal resolutions, and for different edge-detection areas. For example, the edge-detection filter can use a 1×3 kernel instead of a 3×3 kernel. For a 1×3 kernel, edge detection is performed within one horizontal line. Then only 2 full lines need to be stored in the line buffer, plus the temporary buffer with the data for a small portion of a third line. In general, when the edge-detection filter operates on n lines, the line buffer must store n+1 full lines.
Different segmentation of the pipeline can be substituted, depending on logic delays in each pipestage. Rapid clocking and slow adders may require 2 clock cycles for each adder in the interpolator, or slower clocks and faster logic may allow both horizontal and vertical adders to operate in a single pipestage without actually latching in the intermediate values. Similar adjustments and modifications can be made to other stages and functional units.
Different data encodings and primary colors can be used. Bit widths can be varied. Many data formats may be used with the invention. Additional functions can be added. Many arrangements of adders, shifters, and logic units are possible. Adders may be reused or used recursively. Some image sensors may alter the Bayer pattern in different ways, such as by producing data from lower lines before upper lines. Various modifications can be made as needed.
The foregoing description of the embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US4760441||May 13, 1987||Jul 26, 1988||Nec Corporation||Solid-state color imaging apparatus having color filter array which eliminates vertical color error|
|US4764805||Jun 2, 1987||Aug 16, 1988||Eastman Kodak Company||Image transmission system with line averaging preview mode using two-pass block-edge interpolation|
|US4796085||Feb 17, 1987||Jan 3, 1989||Fuji Photo Film Co., Ltd.||Device for interpolating missing color-difference signal by averaging line-sequential color-difference signals|
|US4796095||Sep 22, 1987||Jan 3, 1989||Rioch Company, Limited||Method of generating image scanning clock signals in optical scanning apparatus|
|US5008739||Feb 13, 1989||Apr 16, 1991||Eastman Kodak Company||Real-time digital processor for producing full resolution color signals from a multi-color image sensor|
|US5172227||Dec 10, 1990||Dec 15, 1992||Eastman Kodak Company||Image compression with color interpolation for a single sensor image system|
|US5260774||Apr 12, 1990||Nov 9, 1993||Canon Kabushiki Kaisha||White balance control for still image sensing apparatus|
|US5262849||Oct 30, 1991||Nov 16, 1993||Canon Kabushiki Kaisha||Digital camera processing device having variably settable interpolation|
|US5265200||Nov 1, 1990||Nov 23, 1993||International Business Machines Corporation||System and method for automatic image saturation, gamma, and exposure correction in a digitizing video capture system|
|US5325182||Jun 22, 1992||Jun 28, 1994||Sanyo Electric Co., Ltd.||Video signal processing circuit incorporated in a integrated circuit|
|US5371546||Jan 4, 1993||Dec 6, 1994||Nec Corporation||LSI encoding device with pixel data blocking and vertical decimating circuits|
|US5382976||Jun 30, 1993||Jan 17, 1995||Eastman Kodak Company||Apparatus and method for adaptively interpolating a full color image utilizing luminance gradients|
|US5396441||Jan 12, 1994||Mar 7, 1995||Hitachi, Ltd.||Signal interpolation apparatus and signal interpolation method|
|US5414465||Jan 3, 1994||May 9, 1995||Sony Corporation||Luminance signal generator with interpolation|
|US5504524||Oct 13, 1994||Apr 2, 1996||Vlsi Vision Limited||Method and apparatus for controlling color balance of a video signal|
|US5506619||Mar 17, 1995||Apr 9, 1996||Eastman Kodak Company||Adaptive color plan interpolation in single sensor color electronic camera|
|US5528292||Dec 20, 1994||Jun 18, 1996||Canon Kabushiki Kaisha||Electric still camera having a plurality of image pickup elements with color filters|
|US5579047||Aug 2, 1994||Nov 26, 1996||Canon Kabushiki Kaisha||Image signal processing apparatus using color filters and an image pick-up device providing interlaced field signals|
|US5596367||Feb 23, 1996||Jan 21, 1997||Eastman Kodak Company||Averaging green values for green photosites in electronic cameras|
|US5739867||Feb 24, 1997||Apr 14, 1998||Paradise Electronics, Inc.||Method and apparatus for upscaling an image in both horizontal and vertical directions|
|US5808674||Sep 9, 1996||Sep 15, 1998||Eastman Kodak Company||Producing and improved digital image from digital signals corresponding to pairs of photosites|
|US5821999||Jun 14, 1996||Oct 13, 1998||Iterated Systems, Inc.||Method and system for fractally interpolating intensity values for a single color component array obtained from a single color sensor|
|US5886797||Jan 11, 1995||Mar 23, 1999||Ricoh Co. Ltd.||Method and apparatus for controlling a spatial filtering process based on characteristics of image data|
|US5887085||Aug 31, 1995||Mar 23, 1999||Rohm Co., Ltd.||Image processing device|
|US5889554||Oct 23, 1996||Mar 30, 1999||Eastman Kodak Company||Process and system for generating a full color image of multispectral image from the image data of a CCD image sensor with a mosaic color filter|
|US5987221||Jan 24, 1997||Nov 16, 1999||Hewlett-Packard Company||Encoded orphan pixels for discriminating halftone data from text and line art data|
|US6421084||Mar 2, 1998||Jul 16, 2002||Compaq Computer Corporation||Method for interpolating a full color image from a single sensor using multiple threshold-based gradients|
|US6563537||Jul 30, 1998||May 13, 2003||Fuji Photo Film Co., Ltd.||Image signal interpolation|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US8159557 *||Sep 23, 2008||Apr 17, 2012||United Microelectronics Corp.||Method of generating a gain of an image frame|
|US8363135 *||Jan 30, 2009||Jan 29, 2013||Nxp B.V.||Method and device for reconstructing a color image|
|US20100073528 *||Mar 25, 2010||Yuan-Che Lee||Method of generating a gain of an image frame|
|US20100321543 *||Jan 30, 2009||Dec 23, 2010||Nxp B.V.||Method and device for reconstructing a color image|
|US20140132808 *||Oct 2, 2013||May 15, 2014||Samsung Electronics Co., Ltd.||Method and apparatus for interpolating color|
|U.S. Classification||348/252, 348/352, 348/222.1, 348/223.1, 382/266|
|International Classification||H04N5/208, H04N9/04, G06T3/40, G06T5/00|
|Cooperative Classification||G06T3/403, G06T3/4015, H04N9/045, G06T3/4007|
|European Classification||G06T3/40B, G06T3/40C, H04N9/04B, G06T3/40E|
|Jun 30, 2010||AS||Assignment|
Owner name: FAUST COMMUNICATIONS, LLC, NEVADA
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:NEOMAGIC CORPORATION;REEL/FRAME:024611/0444
Effective date: 20050406
Owner name: NEOMAGIC CORP., CALIFORNIA
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:LIN, TAO;YU, VINCENT CHOR-FUNG;TANG, TIANHUA;AND OTHERS;REEL/FRAME:024619/0650
Effective date: 19990901
|Apr 24, 2015||FPAY||Fee payment|
Year of fee payment: 12
|Sep 21, 2015||AS||Assignment|
Owner name: XYLON LLC, NEVADA
Free format text: MERGER;ASSIGNOR:FAUST COMMUNICATIONS LLC;REEL/FRAME:036641/0051
Effective date: 20150813