The present application claims the benefit of the earlier filing date of application number GB1103755.3 which was filed at the United Kingdom patent office on 7 Mar. 2011, the entire content of which application is incorporated herein by reference.
1. Field of the Invention
This invention relates to image processing.
2. Description of the Related Art
An example image processing application will now be described in connection with a digital video camera.
In order to generate a colour image using a solid state image sensor (such as a charge coupled device (CCD) image sensor) it is necessary to ensure that different colour components are detected in respect of each pixel position. Some arrangement of colour filters is needed because typically the individual photosensors in an image sensor detect light intensity with little or no wavelength specificity, and therefore cannot themselves detect separate colour information.
One way to provide colour detection is to employ multiple image sensors, each detecting a respective colour component. For example, many digital video cameras use a three CCD system, with each CCD detecting a respective one of green, red and blue colour components. This arrangement requires the three CCDs to be optically aligned with one another to a sub-pixel accuracy, and also needs a light splitter and colour filter arrangement. Optical filters such as dichroic (or thin film) filters may be used for this task, as they have the useful property of passing light of a range of wavelengths while deflecting (rather than absorbing) light outside that range.
However, many digital cameras instead make use of a single CCD operating in conjunction with a colour filter array (CFA). The CFA is a mosaic of tiny colour filters fabricated over the individual pixel sensors of the image sensor.
The colour filters filter the light by wavelength range, such that the separate filtered intensities include information about the colour of light. Absorption (rather than dichroic) filters are generally used.
An example of the use of a CFA is shown schematically in
There are many types of CFA. For example, a so-called Bayer filter, originally proposed in U.S. 3,971,065, contains filter elements giving information about the intensity of light in red, green, and blue (RGB) wavelength regions. An example of the pixel filter layout of a Bayer filter is shown in
One reason that more green elements are provided than red or blue elements is that the human eye is generally more sensitive to green light than to the other primary colours. So, the additional resolution in respect of green light mimics the colour response of the human eye. It is also useful because when red, green and blue colour component signals are electrically combined together to form a monochromatic luminance signal (Y), contributions from each colour component are weighted so that the luminance signal contains a greater proportion of the green component than either of the other two components.
The raw image data captured by the image sensor is then converted to the full-colour image, with intensities of all three primary colours represented at each pixel, by a so-called demosaicing algorithm which is tailored for each type of colour filter. In other words, the mosaic relationship of the detected colour components is undone by the demosaicing algorithm so as to provide, for each pixel, all three colour components in respect of a single effective pixel position. In the system of
The foregoing paragraphs have been provided by way of general introduction, and are not intended to limit the scope of the appended claims. The described embodiments, together with further advantages, will be best understood by reference to the detailed description below taken in conjunction with the accompanying drawings.
This invention provides an image sensor comprising:
an array of photosensors each having a respective colour filter so as to restrict the sensitivity of that photosensor to a primary colour range selected from a set of three or more primary colour ranges, the array being such that the photosensors in alternate rows are sensitive to a first primary colour range, and photosensors in intervening rows are sensitive to the other primary colour ranges; and
a pixel data reader arranged to output, in respect of each successive image of a video signal, pixel data from a first subset of the rows sensitive to the first primary colour range, the first subset being the same from image to image of the video signal;
the pixel data reader being arranged to output pixel data from a second subset of the rows of photosensors sensitive to the other primary colour ranges, the second subset changing from image to image of the video signal.
The invention provides an advantageous technique for reading a subset of pixel data from an image sensor of the type defined, while maintaining the same positions of one colour (such as green) pixels from frame to frame.
Various further respective aspects and features of the invention are defined in the appended claims.
A more complete appreciation of the disclosure and many of the attendant advantages thereof will be readily obtained as the same becomes better understood by reference to the following detailed description when considered in connection with the accompanying drawings, in which:
Reference is now made to the drawings, in which like reference numerals designate identical or corresponding parts throughout the several views.
Another proposed type of CFA is a so-called double Bayer filter, an example of which is shown schematically in
In
In the CFA/CCD sensor 220 operating at its full resolution, the output pixel positions are aligned to the green sample positions. This means that at each output pixel position only the green sample value is known, the blue and red sample values must be estimated using the green sample values and the surrounding blue and red sample values.
An image processor 230 provides the demosaic functions described above. The image processor 230 may be implemented within the body of the camera itself or within (for example) a separate camera control unit (CCU).
Either the CFA/CCD sensor 220 or the image processor 230 (or a combination of the two) provides a pixel data reader for reading appropriate pixel data from the CFA/CCD sensor.
The image processor 230 may operate in at least two modes. These are shown as separate processing paths for clarity of the diagram, but they may of course share some processing resources. Because of the different way in which data is read from the CFA/CCD sensor in the two cases, it is envisaged that the user chooses between the two modes for any particular video capturing operation. That is to say, the apparatus of
In a first processing path 240, referred to as “HQ” (high quality) mode, the full resolution (4k×2k, 60p) image data generated by the CFA/CCD 220 is passed to a demosaic processor 250 which generates 4k×2k 60p GBR (green, blue, red) video data. This can be provided as an output 260 if required. Alternatively (or in addition), since many display devices in current use have a maximum display resolution of 2048×1080 pixels or 1920×1012 pixels (“2k×1k”, or just “2k”), the 4k×2k 60p data may be spatially down-converted by a down converter 270 to the lower resolution of 2k×1k, 60p for display on a 2k×1k display device 280.
In a second processing path 300, referred to as “HS” (high speed) mode, only a subset of the pixel data is read from the CFA/CCD image sensor 220 in respect of each successive image, which allows images to be read from the CFA/CCD image sensor 220 at twice the rate of the HQ mode, namely 120 progressively scanned pictures per second or “120p”. The subset of data read from the CFA/CCD image sensor may be considered as 4k×1k 120p data, although image data at this resolution is not provided as an output from the apparatus. The 120p image data is passed to a demosaic processor and down converter 310 for direct output as 2k×1k, 120p image data. In the second processing path, therefore, there is no possibility of an intermediate output of 4k×2k image data. However, the second processing path allows the output of 2k×1k data at the higher picture rate of 120p.
The patterns of captured green, blue and red pixels from which the output images may be derived in the first and second processing paths will now be described.
In the first processing path (HQ mode), the green component of each output pixel is derived from one or more of the captured green pixels. The red component of that output pixel is derived by interpolation between red pixels and, potentially, interpolated green pixels surrounding that green pixel. By using the green samples, colour difference signals are formed between the interpolated green samples and known blue/red samples for the interpolation process. This helps maintain a constant hue. The blue component of that output pixel is derived by interpolation between blue pixels and, potentially, interpolated green pixels surrounding that green pixel. This arrangement is illustrated schematically in
In the second processing path (HS mode), different options exist:
Therefore, in the alternate-BR mode, the pixel data reader mentioned above is arranged to output, in respect of each successive image of a video signal, pixel data from a first subset of the rows sensitive to the first primary colour range (green in this example), the first subset being the same from image to image of the video signal; and to output pixel data from a second subset of the rows of photosensors sensitive to the other primary colour ranges (blue and red in this example), the second subset changing from image to image of the video signal. In embodiments of the invention, the first subset comprises alternate ones of those rows sensitive to the first primary colour range, and/or the second subset alternates, from image to image of the video signal, between two possible second subsets of rows. In embodiments of the invention the two possible second subsets comprise: a second subset comprising those rows immediately beneath respective rows in the first subset; and a second subset comprising those rows immediately above respective rows in the first subset. In embodiments of the invention, pixel positions in the rows in the second subset are horizontally offset with respect to pixel positions in the rows of the first subset.
Embodiments of the invention relate to the alternate-BR mode.
In such embodiments of the invention, the demosaic and down converter 300 provides a demosaic processor for receiving a video signal comprising pixel data from an array of photosensors (such as that provided by the CFA/CCD sensor 220), the demosaic processor comprising a vertical interpolator for vertically shifting pixel data of the second subset so as to be vertically aligned with pixel data of the first subset. In embodiments of the invention, in which pixel positions in the rows in the second subset are horizontally offset with respect to pixel positions in the rows of the first subset, the technique makes use of a first horizontal interpolator for horizontally shifting the pixel positions of pixel data of rows of the first subset so as to provide intermediate pixel data which is vertically aligned with pixel data of rows of the second subset, the intermediate pixel data being supplied as an input to the vertical interpolator; and a second horizontal interpolator for horizontally shifting pixel data output by the vertical interpolator so as to be horizontally aligned with pixel data of rows of the first subset.
The alternate BR line scan pattern shown in
The GBR signals read from the CCD/CFA 220 are supplied as an input signal 530. The positions of green, blue and red pixels (as read from the CCD/CFA) in the signal 530 are shown as 530′ at the lower part of
From the signal 530, the green data is passed to a horizontal green interpolator which carries out a horizontal spatial interpolation to generate an interpolated green signal G′ which, in combination with the original signals B and R forms a second GBR signal 540. The horizontally-shifted pixel positions of the interpolated green signal G′ (shifted by 0.5 pixel) are also schematically illustrated at 540′. They are vertically stacked in alignment with the positions of the B and R pixels.
The signal 540 is supplied as an input to a vertical colour interpolator 510 which interpolates between pixel positions of the B and R signals respectively to generate vertically shifted signals B′ and R′ at pixel positions corresponding to the pixel positions in the signal G′. This interpolation of the B and R signals involves shifting one row down by 0.5 pixel and the next row up by 0.5 pixel, and so on. The G′ signal is then subtracted from the B′ and R′ signals to generate (B′−G′) and (R′−G′) signals respectively as part of a third intermediate signal 550 having pixel positions shown as 550′.
Finally, the original G signal and the (B′−G′) and (R′−G′) signals are supplied as inputs to a horizontal colour interpolator 520. The colour difference values are interpolated horizontally to calculate a colour difference value at the required output pixel position. The interpolated colour difference value is then used to calculate the required red/blue value, so as to generate an output signal 560 comprising the original G signal along with B″ and R″ signals which have pixel positions now aligned to the pixel positions in the G signal (as shown at 560′).
Natural images usually exhibit a high degree of spatial correlation between the colour channels. It is this high correlation probability that allows the spatial interpolators of the present embodiments to more accurately estimate the missing colour sample values than a simple uncorrelated bilinear interpolator. The spatial interpolator equations are all based on the rule that within a local region of an image, the differences or ratios between different colour channels along an interpolation direction are constant.
Colour difference rule between adjacent pixels n and n+1:
(Gn+1−Gn)≈αB(Bn+1−Bn) Eq. 1
(Gn+1−Gn)≈αR(Rn+1−Rn) Eq. 2
Colour Ratio Rule:
Where: αB=G/B gain and αR=G/R gain.
The alpha terms in the above equations are the white balance gain for the blue and red channels. These terms are used to correct any imbalance in the three input channels.
In embodiments of the invention it is only the colour difference [Eq. 1 and Eq. 2] rule that is used to derive the spatial interpolator equations.
In
The multipliers 700, 710 receive a control signal a which is the output of a motion detector 730, indicative of inter-image motion in the input image at that pixel position. The parameter a varies between −1 and 1, having a low absolute value when inter-image motion is low, a high absolute value when inter-image motion is high, and a polarity depending on the direction (relative to the current frame) having greater inter-image motion. The derivation of this parameter will be described further below. The multiplier 700 multiplies the output signal 560 by 1−¦α¦ (where the symbol ¦ . . . ¦ indicates absolute value) and the multiplier 710 multiplies an output signal (to be described below) of the enhanced interpolator by α, with the outputs of the two multipliers being added by the adder 720 to generate an output signal 740.
Turning now to the enhanced interpolation process, the current frame n is processed by the horizontal green interpolator 500 as described above. The previous frame n−1 and the next frame n+1 are processed by equivalent horizontal green interpolators 502, 504. In fact, depending on the design, it may be that only one horizontal green interpolator 500 is needed, with its results being stored between the processing of successive frames.
In the enhanced process, the outputs of the horizontal green interpolations are passed to enhanced vertical colour interpolators, specifically a backward enhanced vertical colour interpolator 512 and a forward enhanced vertical colour interpolator 514. These are identical in operation, apart from the fact that their inputs are different. The inputs to the backward enhanced vertical colour interpolator 512 are the outputs of the horizontal green interpolators in respect of frame n−1 and frame n. The inputs to the forward enhanced vertical colour interpolator 514 are the outputs of the horizontal green interpolators in respect of frame n and frame n+1.
The respective outputs of the backward enhanced vertical colour interpolator 512 and the forward enhanced vertical colour interpolator 514 are supplied to a multiplexer 750 which tests the polarity of the motion control signal a generated by the motion detector 730. If the polarity of the motion control signal indicates that motion is greater in a backward image direction, then the results of the backward enhanced vertical colour interpolator 512 are passed by the multiplexer 750; otherwise, or if α is zero, the results of the forward enhanced vertical colour interpolator 514 are passed by the multiplexer 750.
The output of the multiplexer 750 is passed to an enhanced horizontal colour interpolator 522, the output of which is passed to the multiplier 710 as described above.
This is the first stage of the demosaicing process. Horizontal estimates for the unknown green sample values that are vertically aligned with the known colour samples are calculated using a Bessel Centre Difference interpolator (though other interpolation techniques such as Sinc or linear interpolation may be used). The horizontal green interpolator is used to estimate the value of the green signal midway between the known green sample values.
The relative spatial positions of input green (G) pixels used by this interpolator are shown schematically in
Definitions:
G=Green Sample
Note that the notation whereby a bar is drawn over a variable name is used interchangeably with the notation G′ and the like.
A Bessel centre difference interpolator is used to estimate the value of the green signal at pixel position zero (shown at the centre of
This is the second stage of the demosaicing process. The vertical colour difference interpolator is used to estimate the blue and red colour difference values at the green sample values that are calculated in the first stage.
This interpolator uses additional blue/red sample values from temporally adjacent frames to produce a revised estimate for the colour difference signal.
The relative spatial positions of the samples used by this interpolator are shown in
Definitions:
G=Green Sample
B=Blue Sample
R=Red Sample
αB=Blue White Balance αR=Red White Balance
North (N) and South (S) directional estimates for the blue and red sample values are calculated using the following equations:
The South (S) estimate for the colour difference is calculated using the following equations:
The North (N) estimate for the colour difference is calculated using the following equations:
Final Colour Difference Estimate:
0
=
N−αV(
0
=
N−αV(
This is an alternative vertical colour difference interpolator for the enhanced demosaicing process. This interpolator uses additional green, and blue/red sample values from temporally adjacent frames to produce an revised estimate for the colour difference signal. This interpolator can be used with the alternate GBR line scan.
The relative spatial positions of the samples used by this interpolator are shown in
Definitions:
G=Green Sample G=Green Estimate
B=Blue Sample
R=Red Sample
αB=Blue White Balance αR=Red White Balance
The North (N) and South (S) directional estimates for the blue and red sample values are calculated using the following equations:
The South (S) estimate for the colour difference is calculated using the following equations:
The North (N) estimate for the colour difference is calculated using the following equations:
Final Colour Difference Estimate:
0
=
N−αV(
0
=
N−αV(
This is the third stage of the enhanced demosaicing process. The horizontal colour interpolator uses the vertical colour difference estimates that were calculated in the second stage and the known green sample values to estimate the blue and red signal values at green pixel positions.
This interpolator uses only colour difference values from the current frame to produce estimates for the blue and red signal values at green pixel positions.
The relative spatial positions of the samples used by this interpolator are shown in
Definitions:
G=Green Sample
αB=Blue White Balance αR=Red White Balance
A Bessel centre difference interpolator is used to estimate the value of the colour difference signal at pixel position zero. The estimates for the unknown colour difference values are calculated using the following equations.
The final colour estimate is given by:
This is an alternative horizontal colour interpolator for the enhanced demosaicing process. This interpolator uses additional colour difference values from temporally adjacent frames to produce revised estimates for the blue and red signal values at green pixel positions. This interpolator can be used with both the alternate line scans.
The relative spatial positions of the samples used by this interpolator are shown in
Definitions:
G=Green Sample
αB=Blue White Balance αR=Red White Balance
A Bessel centre difference interpolator is used to estimate the value of the colour difference signal at pixel position zero. The estimates for the unknown colour difference values are calculated using the following equations.
The final colour estimate is given by:
Forward SAD Calculation:
Backward SAD Calculation:
Where:
m=3 line=2y−2
n=5 pixel=x−2
Combined SAD Calculation:
The motion control signal (α) is calculated from the SAD value generated by the motion detector using the following equation:
Where SADmin and SADmax are programmable constants, and the expression α=α′×(SAD>0)?1:−1 means that the final a value is generated by multiplying α′ by the sign of the SAD value. Example results of the SAD derivation are shown in
As described above, at known green sample positions the motion indicator (α) is used to blend the results of the standard demosaicing algorithm with the results of the enhanced demosaicing algorithm.
Scaling
The 4096×1080 image from the demosaic process is scaled by the scaling filter 810 to the following output formats simultaneously:
2048×1080
1920×1012
The 2048×1080 requires a 2→1 scaling horizontally and no scaling vertically, while the 1920×1012 scaling requires a 32→15 scaling horizontally and a 16→15 scaling vertically. The aspect ratio (H:V) is maintained for both output formats at 256:135.
The output image (4096×1080) is generated by scaling horizontally and vertically using one of the following methods, to the correct output dimensions.
Sinc Scaling Filter
Linear Scaling Filter
Gaussian Scaling Filter
The number of taps used for each type of scaling filter are listed below:
The Sinc scaling filter taps are generated using the Sinc scaling function:
The horizontal and vertical Sinc scaling filters produce the sharpest output image. The frequency response is not circular and some ringing is noticeable even with ringing reduction enabled.
The filter taps are generated using known techniques. The linear scaling filter taps are generated using the linear scaling function:
The horizontal and vertical linear scaling filters use the smallest number of filter taps.
The Gaussian scaling filter taps are generated using the Gaussian scaling function:
y→e
−πx
Eq. 55
The horizontal and vertical Gaussian scaling filters produce a smooth output image with a circular frequency response.
The techniques described above can of course be implemented by computer software running on a general purpose data processing apparatus, by hardware, by programmable hardware such as an application specific integrated circuit or a field programmable gate array, or by combinations of these. Where an implementation involves computer software, it will be appreciated that such software, and a non-transitory machine-readable medium carrying such software, such as an optical disc, a magnetic disk, semiconductor memory or the like, represent embodiments of the invention.
The foregoing discussion discloses and describes merely exemplary embodiments of the present invention. As will be understood by those skilled in the art, the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting of the scope of the invention, as well as other claims. The disclosure, including any readily discernible variants of the teachings hearing, define, in part, the scope of the foregoing claim terminology such that no inventive subject matter is dedicated to the public.
Number | Date | Country | Kind |
---|---|---|---|
1103755.3 | Mar 2011 | GB | national |