The invention concerns correcting vignetting in imaging chain for processing image data obtained from sensors of a digital imaging device into a processed image.
Vignetting is a well-known effect observable especially in digitally recorded images and characterized as a circularly symmetrical shading in the border areas of the image. In other words brightness of the image decreases towards borders of the image. The vignetting is sometimes called a light fall-off. Part of the vignetting effect is due to the imaging optical components, e.g. lenses, since the refraction in the border areas of the optics typically cause decrease in light level of the final image near the image borders. Part of the vignetting effect is sensor related. Factors effecting sensor related vignetting are micro lenses and the fill factor of the sensors. The fill factor is ratio of the light sensitive area of a sensor pixel on its total area. Fill factors of pixels are improved by applying in front of each pixel a tiny individual micro lens that converges the light hitting the micro lens further on the even smaller-sized light sensitive element, e.g. photodiode, below it. Further, if the incoming light hits the sensor in deep enough angles, it may be absorbed to the “pixel walls” instead of reaching the actual light sensitive element on the bottom of the sensor.
Some digital camera manufacturers do not correct the vignetting effect at all. With high quality optics vignetting may be neglible and it needs not to be corrected. However, typically digital camera sensor manufacturers use some sort of vignetting elimination. Especially in the very small sized digital camera modules, which typically include optical modules integrating both the optics and the sensors, there usually is vignetting effect present. Usually the vignetting effect in small and low-cost devices is significant and some correction for vignetting is required.
In the prior solutions the vignetting effect is commonly corrected by compensating brightness of the image after the image has been recorded. Typically only the luminance level of the final image is corrected. In many cases more accurate, but still simple method is needed in order to achieve a better image by a small and compact imaging device. Typically in prior solutions either the correction is demanding, hard and time-consuming to implement, or the correction is only an average resulting to in-accurate final image. One disadvantage with the prior brightness correction is that the colours having different wavelengths have been treated in a similar manner. Typically correction values used in prior art are average values and no chromatic correction is applied, although sensors include pixels with different colours and also the final image is presented in colours.
The aim of the present invention is to overcome the drawbacks of the prior solutions for correcting vignetting effect in the final processed image. One aim of the present invention is to enhance quality of the final image especially by compensating vignetting effect more accurately and separately for all primary colours of the sensor. Another aim of the present invention is to remain the solution simple, and usable especially in compact, small, cheap and lightweight camera devices. A further aim of the invention is to provide a simple and effective manner to characterize the vignetting related performance of an imaging module using only a limited number of parameters.
The aim of the present invention is achieved by determining and compensating the vignetting effect of the digital image captured with the imaging module separately for at least two of the primary colour components of the imaging module.
A method according to the invention for forming a model for improving image quality of a digital image captured with an imaging module that comprises at least an imaging optics and an image sensor, where the image is formed through the imaging optics onto the light sensitive image sensor, is characterized in that
A model according to the invention for correcting vignetting from a digital image captured with an imaging module that comprises at least an imaging optics and an image sensor, where the image is formed through the imaging optics onto the light sensitive image sensor, is characterized in that the model is obtainable by said method according to the invention for forming a model for improving image quality of a digital image captured with an imaging module.
A model according to the invention can be used for correcting vignetting from a digital image.
A Method according to the invention for improving image quality of a digital image captured with an imaging module including an imaging optics and an image sensor, where the image is formed through the imaging optics onto the light sensitive image sensor, is characterized in that
Apparatus according to the invention for determining a model for improving image quality of a digital image captured with an imaging module including an imaging optics and an image sensor, where the image is formed through the imaging optics onto the light sensitive image sensor, is characterized in that the apparatus includes:
An imaging module according to the invention and including an imaging optics and an image sensor for forming an image through the imaging optics onto the light sensitive image sensor is characterized in that a model of the kind described above according to the invention for correcting vignetting from a digital image captured with an imaging module is related to said imaging module.
A device according to the invention is characterized in that the device includes an imaging module of the kind described above according to the invention.
A program module according to the invention for compensating a vignetting effect in a device including an imaging module is characterized in that the program module includes programmable means for implementing a method of the kind described above according to the invention for improving image quality of a digital image captured with an imaging module.
A program product according to the invention for compensating of a vignetting effect in an imaging module is characterized in that the program product includes software means for implementing a method of the kind described above according to the invention for improving image quality of a digital image captured with an imaging module.
Embodiments of the present invention are described in the dependent claims.
Apparatus according to embodiments for determining a model for improving image quality of a digital image captured with an imaging module including an imaging optics and an image sensor, where the image is formed through the imaging optics onto the light sensitive image sensor, includes means for determining vignetting effect separately for at least two of the primary colours of the image module. According to an embodiment apparatus includes means for formulating vignetting models for at least two of the primary colour components of said imaging module, and means for combining said vignetting models into a single correction function defined using correction coefficients, the correction function including means for defining a correction gain for different points (x,y) of the image.
According to embodiments method for forming a model for improving image quality of a digital image captured with an imaging module including an imaging optics and an image sensor, where the image is formed through the imaging optics onto the light sensitive image sensor, includes step of determining vignetting effect of the digital image captured with the imaging module separately for at least two of the primary colour components of the imaging module. According to embodiments method includes the steps of formulating vignetting models for at least two of the primary colour components of said imaging module, and combining said vignetting models into a single correction function defined using correction coefficients, the correction function defining a correction gain for different points (x,y) of the image.
According to an embodiment of the present invention the raw data achieved from the camera-sensor-module is processed so that the vignetting effect from the final processed image is corrected accurately. According to the embodiment of the present invention correction is implemented with a simple model having minimum number of parameters. In the embodiments of the present invention the good quality of the correction is achieved by simple and light model that is executable also with small, compact devices.
According to an embodiment of the present invention the vignetting correction is modelled with a polynomial that is parameterised. According to one embodiment the polynomial is a 6th degree polynomial. In embodiments the polynomial contains a parameter for modelling the difference in vignetting between different primary colour components. Thus in the present invention the differences between colour components are taken into account. The applied colour components can be three colour RGB-components (red, green, blue), four colour CMYG-components (cyan, magenta, yellow, green) or any other chosen primary colour components. Also according to correction of the present embodiment it is possible to define centre for vignetting that is different from image centre. This is advantageous for slightly misaligned optics, in which the optical axis and the centre axis of the visible pixels are not exactly congruent for manufacturing reasons etc.
According to another embodiment of the present invention the vignetting correction is modelled with a polynomial including a parameter for describing a pixel shape. In this embodiment there is also modelled pixels that are not square shaped. Some sensors have pixels having height different than the width. Different kind of non-square shapes of pixels is taken into account in the embodiment of the present invention. Model of the embodiment includes a parameter, which describes the shape of the pixel, which is taken it into consideration also when forming the final image, i.e. when using the formed model.
The algorithm presented in the embodiments of the present invention is simple. One advantage is that the correction parameters need to be determined only once to a certain camera-sensor-type. After the determination parameters can be used for modelling and correcting images produced with said camera-sensor-type. Further the correction according to embodiments of the present invention is easy to transfer from sensor manufacturer to camera manufacturer, since only few parameters are needed to characterize the correction function used for the sensor module. The minimum information is required to be transmitted to the camera manufacturer and to be stored and used in a final product (i.e. camera) when using the vignetting compensation. Due to simplicity of the method of the embodiments, it is possible, if necessary, to characterize individual optical modules during their manufacture and implement individual correction for those modules in the final camera products.
In embodiments of the present invention number of characterizing features in correction function is kept in minimum. This allows easy introduction of new sensor modules by applying only a minimum number of parameters. It is enough that sensor manufacturer transmits with a new sensor the certain required coefficients and parameters that characterize the sensor in question. The coefficients and parameters used in the model are typically the same for a certain set of sensors. According to one embodiment the coefficients and parameter values are sensor-specific. Typically also used optics influences the parameters of the model. According to an embodiment parameters and coefficients of the model are determined for a certain optic-sensor-module. If there are any changes in optics or in sensors, parameters and coefficients for the model are determined again. New determination according to an embodiment is easy and fast to implement, so vignetting is modelled effortlessly to a new configuration of optic-sensor-module.
In the embodiments of the present invention the required parameters describe size of an image plane, vignetting effect in a certain point (x,y) of the image plane, degree of compensation and coefficients for each primary colour components. Embodiments of the invention allow the manufacturer of a module having imaging optics and imaging light sensor to characterize the vignetting performance of the module and provide the camera manufacturer implementing the module in his product a simple set of parameters, which parameters can be used in the end product to make the necessary image correction.
According to the embodiments the amount of information is kept in minimum and the implementation is kept easy, simple and cheap. The parameters are easy and effortless to transmit and execution of the model remains light. According to embodiments of the present invention only little amount of memory is consumed when modelling and compensating the vignetting effect in a camera device. Further parameters and coefficients for modelling are determined only once for a certain camera-sensor-module, so continuous calculations are not required. According to embodiments of the present invention the model is easily applicable for different sensors by only using different set of parameters. The modelling, i.e. use of the model with the determined parameters and coefficients, according to embodiments is executable also in small, compact devices effectively. Embodiments can be used with zooming and cropping functions. One important benefit of embodiments is that scaling of an image does not change the parameters used in the model.
In the following embodiments of the present invention are described in detail with the accompanying pictures in which
In the following description of the various embodiments, reference is made to the accompanying drawings, which form a part here of, and in which is shown by way of illustration various embodiments in which the invention may be practised. It is to be understood that other embodiments may be utilized, and structural and functional modifications may be made without departing from the scope of the present invention.
In an embodiment of
The processed data is then transmitted to on external or to an integrated peripheral or interface 104. The block 104, where the data can be transmitted to or used in, is for example a digital still camera, such as a minicam or a miniature USB (Universal Serial Bus) flash drive; a digital video camera; an USB application, such as a web camera, a toy, a game or a biometric application; or an embedded application, such as a PDA (personal digital assistant), a network camera, a notebook, a PC (personal computer), a mobile phone, a set-top-box or a security application.
The image sensor in
A CCD sensor 102 consists of several individual elements. These elements are capable of collecting, storing and transporting electrical charge from one element to another. Each photosensitive element will then represent a picture element, i.e. a pixel. Usually each pixel in a digital camera sensor 102 contains a light sensitive photodiode. Data processing block 103 typically includes one or more output amplifiers at the edge of the chip in order to collect the signals from the CCD 102. After the sensor 102 is exposed with a light pattern, an electronic image is obtained in data processing block 103 by applying series of pulses that transfer the charge of one pixel after another to the output amplifier, line after line. The output amplifier converts the charge into a voltage. External electronics in a data processing block 103 will transform this output signal into a form suitable for e.g. monitors 104.
Where a CCD sensor every pixel's charge is transferred through a very limited number of output nodes to be converted to voltage, buffered and sent off-chip as an analog signal, in CMOS sensor, on the other hand, each pixel has its own charge-to-voltage conversion. In CMOS each pixel contains not just a photodiode, but in addition amplifiers and selection circuitry. CMOS sensor includes often also digitization circuits so that the chip outputs digital bits. These additional functions of CMOS compared to CCD reduce the area available for light capture, and with each pixel doing its own conversation, uniformity is lower. CCD arrays can be arranged as a linear array, frame transfer area array, full frame area array, and interline transfer area array. CCDs offer good image performance (measured in quantum efficiency and noise) at the expense of the system size. CMOS imagers offer more functions on the chip, lower power dissipation (at the chip level), and smaller system size at the expense of image quality and flexibility.
The photosensitive elements, e.g. photodiodes, of sensors measure brightness of light. Photodiodes are monochrome devices and unable to differ wavelengths of light. Image sensors 102 can be a monochrome sensor or a colour sensor. A monochrome image sensor senses only in black and white, i.e. shades of gray. In a colour image sensor an integral colour filter array is situated on top of a sensor in order to be able to distinguish colours. The colour array is typically a Bayer colour filter array. Digital imaging optical format is a measure of the size of the imaging area. Optical format is used to determine what size lens is necessary for use with the imager. Optical format refers to the length of the diagonal of the imaging area. The number of pixels and pixel size are also important factors for final image. Horizontal pixels refer to the number of pixels in a row of the image sensor. Vertical pixels refer to the number of pixels in a column of the image sensor. Usually pixels are square, but another shapes, e.g. rectangular, are also possible.
According to one embodiment there is made a calibration measure over a uniformly illuminated target to specify the amount of vignetting in a calibration image. The calibration image recorded from a uniformly illuminated target is divided in certain number of blocks. Typically blocks are equal in size. According to an embodiment a certain area of an image requiring more detailed correction, has smaller blocks situated in more dense and compact way. The number of blocks should be chosen so that number of those is optimal for implementation. One typical number for blocks is 19×19. There is typically chosen odd number of blocks so that the centre of the image can be determined as one block or within one block, e.g. a centre point of the block. The number of blocks is determined taking into consideration size of the image and number of pixels in it. The blocks must be big enough in size so that background noise will not disturb the implementation. On the other hand the blocks must be small enough in order to have stable vignetting effect inside one block. If there are too many small blocks, there will be disturbing noise. If the blocks are too wide, there will be difference in vignetting inside one block. Both mentioned disadvantages, the background noise and vignetting variations inside one block, will disturb modelling and cause vagueness to resulting image. The size of blocks is chosen such that optimum quality is achieved and annoying by-effects are minimized.
After blocks are determined, every colour point is determined separately in every block. Used colour components can be a typical three colour component including three primary colours, i.e. RGB (red, green, blue), or for example a four colour component, i.e. so called CMYG (cyan, magenta, yellow, green), or any other suitable colour component. Values for each colour component in each block are according to an embodiment stored in a form of matrix.
According to one embodiment modelling is implemented with RGB colour components by using the green colour component as a reference component. Reason for choosing the green component as a reference is that there is twice the number of green pixels compared to the number of any other colour component in the sensor having the three colour component. As can be seen from the
A uniformly illuminated target 300 forming a calibration image is divided to blocks 303 in
Values stored in matrices can be used to form curves, as presented in
In the following exemplary embodiment circularly symmetrical vignetting is assumed. According to embodiments of the present invention correction gain of vignetting effect is function of a distance from the vignetting centre. The correction of vignetting is modelled with a 6th degree polynomial. This polynomial is applied separately to every colour. In the embodiment the input data, i.e. the raw camera data is in linear colour space and the black level is zero. The 6th degree polynomial modelling the correction of vignetting is parametrized with a coefficient aCOEFF, and parameters a1, a2, a3. The coefficient aCOEFF illustrates the degree of correction and the parameters a1, a2, a3 depend on optics-sensor-module employed. Values for the parameters a1, a2, a3 are achieved from the matrices stored. Values calculated for the green colour component on the line 302 of
In the present embodiment the centre of vignetting is determined as a middle point of an image. According to an embodiment centre of vignetting has the smallest correction gain (1.0) and the point that is the farthest from the centre has the biggest correction gain. According to another embodiment the distance having the biggest correction gain can be determined to any valid distance from the vignetting centre in the visible area. According to an embodiment the correction gain can vary as function of square distance over the visible area. The differences in vignetting between the colour components are parametrized with multipliers, for example RCOEFF for red, GCOEFF for green and BCOEFF for blue. The centre of vignetting is indicated with (xVIGNCENTER, yVIGNCENTER). The value (xVIGNCENTER, yVIGNCENTER)=(0.5, 0.5) corresponds to the centre of the visible image area and the value (xVIGNCENTER, yVIGNCENTER)=(0.0, 0.0) corresponds to the left/bottom edge of the visible image area.
The vignetting elimination that corresponds to the parameters is described by the following equation, for all colour components, for example in this embodiment red, green and blue (RGB). The equation is formulated mathematically in the following way:
∀C∈{R,G,B}{circumflex over ( )}∀x∈N|x∈[0,xSIZE[{circumflex over ( )}∉y∈N|y∈[0,ySIZE[:CCORRECTED(x,y)=CORIGINAL(x,y)·GAINVE(x,y), where
GAINVE(x,y)=1.0+CCOEFF·aCOEFF·(a1·d(x,y)2+a2·d(x,y)4+a3·d(x,y)6)
In the previous 6th degree equation for correction GAIN, which represents the polynomial for modelling the vignetting correction according to an embodiment of the present invention, xSIZE∈N and ySIZE∈N.
CCOEFF∈R. CCOEFF represents the coefficient for a certain colour component, for example one of the RGB components.
aCOEFF∈R|aCOEFF∈[0.0, 1.0]. aCOEFF typically has value of one (1) representing the degree of compensation. The value one corresponds to the full compensation.
ai∈R|i∈{1,2,3}. The coefficients ai of the expression (a1·d(x,y)2+a2·d(x,y)4+a3·d(x,y)6) are included in the matrices calculated from the original illuminated target according to an embodiment of the present invention. The matrices includes the expression (a1·d(x,y)2+a2·d(x,y)4+a3·d(x,y)6) for certain distance (x,y) from the centre of vignetting. In this equation the distances are formulated as follows
d(x,y)2=(x−xVIGNCENTRE·(xSIZE−1))2+(y−yVIGNCENTRE·(ySIZE−1))2/(xF−xVIGNCENTRE·(xSIZE−1))2+(yF−yVIGNCENTRE·(ySIZE−1))2
where
(x,y) is the pixel coordinate, and xSIZE and ySIZE are the width and height of the visible image area in pixels, respectively.
(xF,yF) is the corner point of the visible image area that is the farthest from the centre point of vignetting. The centre point of vignetting is determined as (xVIGNCENTRE·(xSIZE−1), yVIGNCENTRE·(ySIZE−1)).
xVIGNCENTRE is x-coordinate for the centre point of vignetting. With aid of this parameter it is possible to determine a centre of vignetting, which differs from the centre of the image plane. In other words this embodiment allows the displacement of the centre of the vignetting to be taken into account when forming the final image.
yVIGNCENTER is y-coordinate for the centre spot of vignetting, similarly.
xF is x-coordinate for the farthest point of the image plane from the centre of vignetting.
yF is corresponding y-coordinate for the farthest point of the image plane from the centre of vignetting. If the point of examination (x,y) is the farthest point of the image plane, i.e. (x,y)=(xF, yF), the distance d(x,y) from the point of examination to the centre point of the vignetting is 1. The farthest distance d(x,y) from the centre of vignetting is always 1.
((xSIZE−1) is distance between the farthest horizontal points of the visible image area.
(ySIZE−1)) is distance between the farthest vertical points of the visible image area.
According to an embodiment all different colours used are weighed with the colour coefficients CCOEFF. This has the advantage that only one look-up-table needs to be produced for a used reference colour and other colour components are implemented by adding a colour coefficient CCOEFF to a reference correction model. The implementation including only one look-up-table is typically most efficient for memory and computing. According to another embodiment there is produced number of look-up-tables, usually one for each colour. According to another embodiment the coefficients for different colours are determined separately. Colour coefficients are measured as a function of a square distance.
The value of aCOEFF representing ratio of compensation can be adjusted to be smaller, i.e. to decrease the degree of compensation, since with the high correction also possible annoying noise is gained equally. According to an embodiment the value for aCOEFF is determined with the other coefficients and parameters of a correction polynomial and stored in the look-up-table with the other values for certain optic-sensor-module or -type.
The values of coefficients ai depend on optic-sensor-module used and are different for different type of sensors. Number of coefficients ai is typically at least two. According to an embodiments three coefficients ai is used, i.e. i=1,2,3. Regardless of number of coefficients, it is possible to determine for certain i, that ai=0. Thus, valid number of coefficients depends e.g. on application, used equipment and requirements. According to an embodiment coefficients ai need not be calculated for every pixel of an image separately, but the coefficients can be determined block by block. Correction coefficients ai are calculated as a function of square distance. Calculated values are stored in a look-up-table. Used accuracy can be varied according to an application and requirements. The more dense calculations yield to more accurate and detailed correction coefficients. It is possible, but usually not necessary, to calculate the coefficients as for each possible distance, i.e. for each pixel place separately. According to an embodiment correction coefficients ai are calculated for each block, for example 512-1024 times depending on chosen number of blocks divided from the image plane. When speed is an issue and number of individual calculations needs to be minimized, the distance can be determined according to the middle point of a block. Blocks are typically sized as 2×2, 2×4, 4×2, 4×4, and so on (in pixels). In a correction phase, when using the correction model for enhancing an image, the distance square can be calculated for place of an each pixel separately. An image can also be divided in blocks in a correction phase, but the size of the blocks should remain relatively small in order to keep the final image continuous. Neighbouring blocks having different correction coefficients can cause aberrations in the final image, i.e. the visible image also has different blocks due to different correction coefficients.
In
The distance between image centre 501 and vignetting centre 502 is in this embodiment illustrated with line segment 503. The farthest distance form the vignetting centre 502 to a corner of an image plane 504 is determined to be equal to 1. The other edges of image plane have thus distance less than one from the vignetting centre 502 according to an embodiment of the present invention. According to the embodiment the centre of vignetting 502 has the smallest correction gain (1.0) and the point that is the farthest from the centre, i.e. upper left corner of the image plane in
According to another embodiment the model also takes into account the shape of pixels. Pixels do not need to be square shaped, but those can be for example rectangular, i.e. the height of a pixel is not the same as the width. For example blocks divided from the image plane in
d(x,y)2=(x−xVIGNCENTRE·(xSIZE−1)2+aspect_ratioCOEFF2·(y−yVIGNCENTRE·(ySIZE−1))2/(xF−xVIGNCENTRE·(xSIZE−1))2+aspect_ratioCOEFF2 ·(yF−yVIGNCENTRE·(ySIZE−1))2.
The value of parameter aspect_ratioCOEFF is 1.0 for square shaped pixels. In the embodiment with rectangular shaped blocks, it is essentially important to differ the horizontal and vertical directions, since there can be a remarkable difference in size. The ignorance of shape may yield to unallowable compensation of vignetting. This embodiment enables use of sensors having non-square rectangular pixels or other elliptical shading.
Typically the correction polynomial according to embodiments of the present invention is determined for certain optic-sensor-type. After determination the correction polynomial can be used in such or certain kind of devices for correcting vignetting effect from the final image. According to an embodiment in a correction phase, i.e. when using the polynomial, it is possible to apply the correction polynomial to each pixel separately. According to another embodiment the image is divided into block also in correction phase in order to speed up the phase and make it more efficient.
Embodiments include a model for correcting vignetting from a digital image captured with an imaging module is obtainable by the method described in previous. Embodiments include further a method for determining a model for correcting vignetting from a digital image captured with an imaging module. Embodiments include also a method for using a model for correcting vignetting from a digital image captured with an imaging module.
According to an embodiment a method for improving image quality of a digital image captured with an imaging module including an imaging optics and an image sensor, where the image is formed through the imaging optics onto the light sensitive image sensor, includes steps of compensating vignetting effect separately for at least two of primary colours of the imaging module. According to an embodiment a method for improving image quality includes a step of applying a correction function for at least two of the primary components of said imaging module, wherein the correction function includes correction coefficients pre-determined for a certain imaging module and a pre-determined correction gain for different points (x,y) of the image.
Embodiments include an imaging module including an imaging optics and an image sensor for forming an image through the imaging optics onto the light sensitive image sensor, wherein the imaging module includes a correction function obtainable by the invention.
Embodiments include a device including an imaging module according to embodiments of the present invention. The device according to embodiments is a mobile phone, camera phone, portable digital camera, or any other small, compact device including an imaging module. A device typically includes a program module for compensating a vignetting effect in the device including an optic-sensor-module. The program module includes programmable means for implementing method steps according to embodiments of the invention. A device can include a program product for compensating of a vignetting effect in an optic-sensor-module. The program product includes software means for implementing method steps according to embodiments of the invention.
Number | Date | Country | Kind |
---|---|---|---|
PCT/FI04/50082 | Jun 2004 | WO | international |