Embodiments of the invention relate generally to image processing and more particularly to approaches for adjusting signal values from an array of pixels.
Imagers, for example CCD, CMOS and others, are widely used in imaging applications, for example, in digital still and video cameras. A pixel array is made up of many pixels arranged in rows and columns. Each pixel senses light and forms an electrical signal corresponding to the amount of light sensed. To capture a digital representation of light entering the camera based on an image, circuitry converts the electrical signals from each pixel to digital values and stores them. Each of these stored digital values corresponds to a component of the viewed image entering the camera as light.
In an ideal digital camera, each pixel in the array behaves identically regardless of its position in the array. As a result, all pixels should have the same output value for a given light stimulus. For example, consider an image of a scene of uniform radiance. Because the light intensities of each component of such an image is equal, if an ideal camera photographed this image, each pixel of a pixel array would generate the same output value.
Actual digital cameras, however, do not behave in this ideal manner. When a digital camera photographs a scene of uniform radiance, the signal values read from the pixel array are not necessarily equal. For example, the array in a typical digital camera might generate pixel signal values such that pixel signals from portions near the outside of the array are darker than pixel signals from the center portion of the image, even though the outputs should be uniform.
It is well known that for a given optical lens used with a digital still or video camera, the pixels of the pixel array will generally have varying signal values even if the imaged scene is of uniform radiance. The varying responsiveness depends on a pixel's spatial location within the pixel array. One source of such variations is lens shading. Lens shading can cause pixels in a pixel array located farther away from the center of the pixel array to have a lower value when compared to pixels located closer to the center of the pixel array, when the camera is exposed to a scene of uniform radiance. Other sources may also contribute to variations in a pixel value with spatial location, and more complex patterns of spatial variation may also occur.
Such variations in a pixel value can be compensated for by adjusting, for example, the gain applied to the pixel values based on spatial location in a pixel array. For lens shading adjustment, for example, it may happen that the farther away a pixel is from the center of the pixel array, the more gain is needed to be applied to the pixel value. In addition, sometimes an optical lens is not centered with respect to the optical center of the imager; the effect is that lens shading may not be centered at the center of the imager pixel array. Other types of changes in optical state and variations in lens optics may further contribute to a non-uniform pixel response across the pixel array. For example, variations in iris opening or focus position may affect a pixel value depending on spatial location.
Variations in a pixel value caused by the spatial position of a pixel in a pixel array can be measured and the pixel response value can be adjusted with a pixel value gain adjustment. Lens shading, for example, can be adjusted using a set of positional gain adjustment values, which adjust pixel values in post-capture image processing. With reference to positional gain adjustment to compensate for shading variations with a fixed optical state/configuration, gain adjustments across the pixel array can typically be provided as pixel signal correction values, one corresponding to each of the pixels. The set of pixel signal correction values for the entire pixel array forms a gain adjustment surface for each of a plurality of color channels. The gain adjustment surface is applied to pixels of the corresponding color channel during post-capture image processing to correct for variations in pixel values due to the spatial location of the pixels in the pixel array.
The required correction will have an approximately symmetrical form, although the center of symmetry is not necessarily the center of the image. Moreover, the center for each color channel may not be in exactly the same place, and the asymmetry for each field may be different.
Thus, lens correction logic needs to be calibrated for the position of the lens with respect to the die. Conceivably, this calibration needs to be performed individually for every module (chip and lens combination) produced. However, if the calibration data cannot be stored in non-volatile memory on the module, it must be associated with the module throughout the manufacturing process until it can be programmed into off-module non-volatile memory, which adds significant inconvenience and cost to the manufacturing process.
Therefore, it is not cost-effective to calibrate and store the gain of every pixel individually. Rather, the required gain may be described as a mathematical surface, which can be created on the fly by a logic circuit from a set of parameters. One such method that uses a polynomial function to describe the gain adjustment surface is described in copending application Ser. No. 11/512,303, entitled METHOD, APPARATUS, AND SYSTEM PROVIDING POLYNOMIAL BASED CORRECTION PIXEL ARRAY OUTPUT, filed on Aug. 30, 2006. This approach allows a very large degree of flexibility, having the capacity to model the asymmetry and hence gives good correction, but still requires a relatively large number of parameters. Horizontally, the gain is represented as a fourth order polynomial, which requires five parameters. Each of these parameters is derived vertically from fourth order polynomials each of which has five terms and there are 4 color channels, so the total storage requirement is 100 (16-bit) coefficients.
Accordingly, there exists a need for a method and system that allows for generation of an adjustment surface from stored values that has a reduced storage requirement. There further exists a need for a method and system that allows the information necessary for calculating the adjustment surface to be stored on the chip of the imager.
In the following detailed description, reference is made to the accompanying drawings which form a part hereof, and in which are shown, by way of illustration, specific embodiments. These embodiments are described in sufficient detail to enable those skilled in the art to make and use them, and it is to be understood that structural, logical or procedural changes may be made. Particularly, in the description below, processes are described by way of flowchart. In some instances, steps which follow other steps may be reversed, be in a different sequence or be in parallel, except where a following procedural step requires the presence of a prior procedural step. The disclosed processes may be implemented by an image processing pipeline which may be implemented by digital hardware circuits, a programmed processor, or some combination of the two. Any circuit which is capable of processing digital image pixel values can be used.
Any type of image processor 1110 may be used to implement the various disclosed embodiments, including processors utilizing hardware including circuitry, software storable in a computer readable medium and executable by a microprocessor, or a combination of both. The embodiments may be implemented as part of an image capturing system, for example, a camera, or as a separate stand-alone image processing system which processes previously captured and stored images. Additionally, one could apply the embodiments to pixel arrays using any type of technology, such as arrays using charge coupled devices (CCD) or using complementary metal oxide semiconductor (CMOS) devices, or other types of pixel arrays.
As illustrated by
The overall process performed by image processor 1110 is illustrated in
SV
corrected
=SV
acquired×Correction_factor (1)
The correction factor of the disclosed embodiments is determined using functions based on the hyperbolic cosine of an elliptical radius. The center, size and orientation of the ellipse are parameters determined during calibration (described later) for a given imager and lens combination.
The hyperbolic cosine function, hereafter referred to as “cosh,” is defined as follows:
For the purposes of simplification of a hardware implementation of the disclosed embodiments, the cosh function is approximated by truncating its Taylor series to the first two non-constant terms:
For the range of interest, the underestimation of cosh(x) caused by this approximation is small and the approximation allows for smaller hardware requirements.
In order to scale and center the function according to the characteristics of the lens system, at least two parameters are needed per dimension and they are determined during a trial-and-error calibration process. Assuming g(x) to be the required gain at a position x in the x-direction, then g(x)=cosh(sx(x−cx)), where sx is a constant scaling factor in the x-direction and cx is a constant center value in the x-direction. For a two-dimensional image, the same constants are needed in the y-direction and the constant values sy and cy are also determined by the calibration process.
“Elliptical Cosh” Gain Adjustment Approximation:
In one disclosed embodiment, the positional gain adjustment surface is approximated as the hyperbolic cosine of the radius of an ellipse with its major and minor axes aligned along the x- and y-axes. This method is referred to herein as the “elliptical cosh” method. An example of a gain surface resulting from the elliptical cosh method is shown in
where r is the radius of the ellipse, sx is the constant scaling factor in the x-direction, cx is the constant center value in the x-direction, sy is the constant scaling factor in the y-direction and cy is the constant center value in the y-direction. It should be noted that the values of cx and cy are based on the center of the correction surface for the image, and not necessarily on the center of the image array itself.
As shown above in Equation (4), the value of the radius of the ellipse is determined in accordance with Equation (5):
r
2=(sx(x−cx))2+(sy(y−cy))2 (5)
This radius equation results in a correction surface of an ellipse with its major and minor axes aligned along the x- and y-axes.
As can be seen in
Assuming a monochrome line-by-line image scan, the operation of the circuit 200 is now described. At the start of the readout of each row, during the horizontal blanking period, multiplexers 101, 104 and 105 are controlled so that they are all in the y-position. The output of subtractor 102 is then (y−cy) and the output of multiplier 103 is (sy(y−cy)). Multiplier 106 squares this result (e.g., sy2(y−cy)2) and the squared result is input into register 113, where it is held for the active part of the line. In the active data period, the three multiplexers 101, 104, 105 are switched to the x-position. Subtractor 102 and multipliers 103 and 106 work to produce the square of the scaled offset x value (e.g., sx2(x−cx)2) in the same manner in which the scaled offset y value is determined. The two squared values are then added together in adder 114 yielding the value of r2 (e.g., sx2(x−cy)2+sy2(y−cy)2) as shown in Equation (5). The output of adder 114 is input into both inputs of multiplier 107 producing the 4th power of the radius (r4) and simultaneously into constant multiplier 108, which multiplies the squared term by the constant c12. The output from multiplier 108 is added to constant c24 in adder 109, the output of which is added to the output of multiplier 107 in adder 110. The output of adder 110 is thus (r4+c12(r)2+c24) where r2 is as shown in Equation (5). The output of adder 110 is the positional gain adjustment value for the pixel located at (x,y) and is multiplied by the value of the pixel signal in accordance with Equation (1), resulting in the corrected pixel signal value.
“Rotated Elliptical Cosh” Gain Adjustment Approximation:
In another disclosed embodiment, the positional gain adjustment surface is approximated as the hyperbolic cosine of the radius of an ellipse with its major and minor axes not aligned along the x and y axes. This method is referred to herein as the “rotated elliptical cosh” method. An example of a gain surface resulting from the rotated elliptical cosh method is shown in
r
2=(sx(x−cx))2+(sy(y−cy))2+sxysxsy(x−cx)(y−cy); (6)
where r is the radius of the ellipse, sx is the constant scaling factor in the x-direction, cx is the constant center value in the x-direction, sy is the constant scaling factor in the y-direction and cy is the constant center value in the y-direction. The term sxy is a constant scaling factor that acts to move the axes of the ellipse away from the x- and y-axes. It should again be noted that cx and cy are based on the center of the correction surface for the image, but not necessarily on the center of the image array itself.
Positive values of the additional sxy constant have the effect of reducing the gain (and hence pulling the contours of the positional gain adjustment surface) towards the top right and bottom left of the image. Negative values of the additional sxy constant have the effect of reducing the gain (and hence pulling the contours of the positional gain adjustment surface) towards the top left and bottom right of the image. By setting the values sx, sy and sxy appropriately (during the calibration procedure), an ellipse of arbitrary rotation and eccentricity may be used to sufficiently approximate the positional gain adjustment surface. Using this additional constant value, sxy, the gain of a particular pixel (x,y) is determined in accordance with Equation (7):
As can be seen in
Assuming a monochrome line-by-line image scan, the operation of the circuit 300 is now described. At the start of the readout of each row, during the horizontal blanking period, multiplexers 101, 104 and 105 are controlled so that they are all in the y-position. The output of subtractor 102 is (y−cy) and the output of multiplier 103 is (sy(y−cy)). Multiplier 106 squares this result (e.g., sy2(y−cy)2) and the squared result is input into register 113, where it is held for the active part of the line. Also during the blanking period, multiplier 116 multiplies the output of multiplier 103 (sy(y−cy)) by the constant say and the result (sxysy(y−cy)) is stored in register 117. In the active data period, three multiplexers 101, 104, 105 are switched to the x-position. Subtractor 102 and multipliers 103 and 106 work to produce the square of the scaled offset x value (e.g., sx2(x−cx)2) in the same manner in which the scaled offset y value is determined. The two squared values are then added together in adder 114, resulting in the value (sx2(x−cx)2+sy2(y−cy)2). The value of register 117 does not change during the active data period, but is input into multiplier 116 through multiplexer 115 resulting in an output from multiplier 116 of sxysx(y−cy)(x−cx). The output of multiplexer 116 is then added to the output of adder 114 using adder 118, resulting in the value of r2 (in accordance with Equation (6)).
The output of adder 118 is input into both inputs of multiplier 107 producing the 4th power of the radius (r4) and simultaneously into constant multiplier 108, which multiplies the squared term by the constant c2. The output from multiplier 108 is added to constant c24 in adder 109, the output of which is added to the output of multiplier 107 in adder 110. The output of adder 110 is r4+c12(r)2+c24 where r2 can be determined in accordance with Equation (6). The output of adder 110 is the positional gain adjustment value for the pixel (x,y) and is multiplied by the value of the pixel signal in accordance with Equation (1), resulting in the corrected pixel signal value.
“Rotated Elliptical Polynomial” Gain Adjustment Approximation:
In a further disclosed embodiment, the positional gain adjustment surface is approximated by a polynomial which is derived from the rotated elliptical cosh. This method will be referred to throughout as the “rotated elliptical polynomial” method. For the rotated elliptical polynomial method, the radius equation for the rotated elliptical cosh method (Equation (6)) is scaled by a factor of (1/sx), resulting in a scaled radius in accordance with Equation (8):
r′
2=(x−cx)2+k1(y−cy)2+k2(x−cx)(y−cy); (8)
where, r′ is the scaled radius, cx is the constant center value in the x-direction, cy is the constant center value in the y-direction, k1 represents the relative scaling between the horizontal and vertical gain surface and k2 represents the diagonal scaling between opposite corners. It should again be noted that cx and cy are based on the center of the correction surface for the image, but not necessarily on the center of the image array itself. Also, the value of k1 is generally close to one and the value of k2 is generally close to zero.
The gain for a particular pixel (x,y) is determined in accordance with Equation (9):
G(r′)=1+g1(r′)2+g2(r′)4; (9)
where the function G is the gain of the pixel having a scaled radius of r′ in accordance with Equation (8) and g1 and g2 are the gains of the second and fourth powers of the radius. Given that the radius is unscaled with respect to x, these values are in general small but highly variable in order of magnitude. Equation (9) is the result of a relaxing of the relationship among the terms of the cosh function. This relaxing allows a further simplification in that there is no longer the possibility that the function can result in a square root of zero, as can happen if the sxy constant is not carefully chosen.
Assuming a monochrome line-by-line scan, the operation of the circuit 400 is now described. At the start of the readout of each row, during the horizontal blanking period, the five multiplexers 401, 404, 405, 410, 411 are controlled so that they all input their upper input. The output of subtractor 402 is (y−cy) and the output of multiplier 403 is ((y−cy)2), which is input into multiplier 412 via multiplexer 410, resulting in a value of (k1(y−cy)2) which is stored in register 413, where it is held for the active part of the line. The output of multiplier 406 is k2(y−cy) which is stored in register 407, where it is held for the active part of the line.
In the active data period, multiplexers 401, 404, 405, 410 and 411 are controlled so that they all input their lower input. The output of subtractor 402 is (x−cx) and the output of multiplier 403 is ((x−cx)2). The value stored in register 407 is multiplied by the output of subtractor 402 in multiplier 406, resulting in a value of (k2(x−cx)(y−cy)), which is input into adder 408 along with the output of multiplier 403, resulting in a value of (k2(x−cx)(y−cy)+(x−cx)2) which is input into adder 409 along with the value stored in register 413, resulting in ((x−cx)2+k1(y−cy)2+k2(x−cx)(y−cy)) or r′2. The r′2 value is input into multiplier 412 along with the constant value g1 (multiplexer 411). The output of multiplier 412 is input into both inputs of multiplier 414, resulting in the value (g12r′4). This value output from multiplier 414 is then input into multiplier 415 along with a constant value of g2/(g12) resulting in (g2r′4). This value is input into adder 416 along with the output of multiplier 412, resulting in a value of (g1r′2+g2r′4) that is input into adder 417 along with a constant value of 1. The output of adder 417 is the equation for the gain of the pixel value in accordance with Equation (9). The output of adder 410 is the positional gain adjustment value for the pixel (x,y) and is multiplied by the value of the pixel signal in accordance with Equation (1), resulting in the corrected pixel signal value.
It should be noted that although for each of the embodiments, the operation is described with reference to a monochrome image, that the disclosed embodiments are intended to be implemented for each color channel of an image. For each color channel, the necessary constants (depending on the chosen method) are independently calibrated using the trial-and-error method of calibration. The trial-and-error method of calibration involves repeatedly choosing a parameter at random, changing it by a random amount and accepting the new result if it was better than the old result, using the least squared error from the mean level as the criterion. It should also be noted that the parameters representing the center of the correction surface (cx and cy) will likely be different for each color channel of the image, as shown for example, in
It should further be noted that although the disclosed embodiments for gain adjustment have been described with reference to hardware solutions, that the embodiments may also be implemented by a processor executing a program, or by a combination of a hardware solution and a processor. The correction methods may also be implemented as computer instructions and stored on a computer readable storage medium for execution by a computer or processor which processes raw pixel value from a pixel array, with the result being stored in an imager for use by an image processor circuit.
The imager 1100 comprises a sensor core 1200 that communicates with an image processor 1110 that is connected to an output interface 1130. A phase lock loop (PLL) 1244 is used as a clock for the sensor core 1200. The image processor 1110, which is responsible for image and color processing, includes interpolation line buffers 1112, decimator line buffers 1114, and a color processing pipeline 1120. One of the functions of the color processing pipeline 1120 is the performance of pixel signal value correction in accordance with the disclosed embodiments, discussed above.
The output interface 1130 includes an output first-in-first-out (FIFO) parallel buffer 1132 and a serial Mobile Industry Processing Interface (MIPI) output 1134, particularly where the imager 1100 is used in a camera in a mobile telephone environment. The user can select either a serial output or a parallel output by setting registers in a configuration register within the imager 1100 chip. An internal bus 140 connects read only memory (ROM) 1142, a microcontroller 1144, and a static random access memory (SRAM) 1146 to the sensor core 1200, image processor 1110, and output interface 1130. The read only memory (ROM) 1142 may serve as a storage location for the constants used to generate the correction values, in accordance with disclosed embodiments.
As noted, disclosed embodiments may be implemented as part of an image processor 1110 and can be implemented using hardware components including an ASIC, a processor executing a program, or other signal processing hardware and/or processor structure or any combination thereof.
Disclosed embodiments may be implemented as part of a camera such as e.g., a digital still or video camera, or other image acquisition system, and may also be implemented as stand-alone software or as a plug-in software component for use in a computer, such as a personal computer, for processing separate images. In such applications, the process can be implemented as computer instruction code contained on a storage medium for use in the computer image-processing system.
For example,
The camera system 1800 is an example of a processor system having digital circuits that could include image sensor devices. Without being limiting, such a system could also include a computer system, cell phone system, scanner system, machine vision system, vehicle navigation system, video phone, surveillance system, star tracker system, motion detection system, image stabilization system, and other image processing systems.
Although the disclosed embodiments employ a pixel processing circuit, e.g., image processor 1110, which is part of an imager 1100, the pixel processing described above may also be carried out on a stand-alone computer in accordance with software instructions and vertical and horizontal correction value curves and any other parameters stored on any type of storage medium.
While several embodiments have been described in detail, it should be readily understood that the invention is not limited to the disclosed embodiments. Rather the disclosed embodiments can be modified to incorporate any number of variations, alterations, substitutions or equivalent arrangements not heretofore described.
Number | Date | Country | Kind |
---|---|---|---|
0801443.3 | Jan 2008 | GB | national |