The invention is in the field of the processing of images acquired by a single-sensor camera. The invention relates more particularly to the reconstruction of colour images following their acquisition by a sensor covered with a filter composed of a mosaic of filters of several colours.
In general, a camera comprises at least one objective composed of one or more optical components such as lenses. The camera's objective directs the light captured onto a sensor composed of photosensitive cells. One or more colour filters are applied to the sensor in order to allow reconstitution of the spectrum of the light received by the sensor.
A camera may further comprise, on the optical path between the objective and the sensor, one or all of the following components: a filter that cuts the infrared (IRcut), an optical low-pass (OLP) spatial filter, microlenses for focusing the light onto each cell of the sensor.
A camera may be a photographic apparatus or any other means able to capture an image and having a photosensitive sensor provided with a matrix of colour filters, called a mosaic.
The general principle of the acquisition of a colour image 1 by a first photosensitive sensor 2 through a first mosaic of filters 3 is shown in
The colour image acquired 5 is an image with P colour components, i.e. with P colours. The P colour components are, in the example shown in
The reconstruction of an image after its acquisition by the first sensor 2 covered with the first mosaic of filters 3 uses a method called demosaicing or dematrixing. Since each pixel 4 is covered with a filter of a particular colour, a single colour is sampled per pixel. It is therefore necessary to implement a method for reconstructing the composition in colours of the light received by each pixel 4. A demosaicing method is used for this purpose. The demosaicing method consists in particular of interpolation of the chrominances of the different pixels 4. The demosaicing method uses a demosaicing matrix applied to the raw image 5 produced by the first sensor 2. By “raw image” 5 is meant the data leaving the first sensor 2 directly, after acquisition of the colour image 1.
The construction of a demosaicing matrix is carried out during a training process using a database of reference images. The database of reference images may comprise N reference images Ii, i∈[1, . . . , N] with P components. Starting from the database of reference images, a new database of N simulated images Ji is constructed. One simulated image Ji corresponds to each reference image Ii. The simulated images Ji represent a modelling of the raw images 5 produced by the first sensor 2 after acquisition of the images of the database of reference images by said first sensor 2. The simulated images Ji are obtained starting from the reference images Ii and by eliminating from the latter the colour components that are not measured by the first sensor 2. In practice, if the reference image Ii has P components, in the simulated image Ji only the component of the filter positioned on each pixel of the first sensor 2 is kept. The simulated image Ji then comprises a single plane. The simulated images Ji of the raw images 5 from the first sensor 2 are called mosaic images 5 hereinafter, and the images Ii originating from the reference database are called resolved images.
The model for calculation of the mosaic image Ji starting from the resolved image Ii may be expressed thus:
x=My (1000)
where M is a matrix of size hw×Phw.
The demosaicing matrix D can therefore be calculated as follows:
D=Ei=1 . . . N{(yxT(xxT)−1} (1001)
Ei=1 . . . N representing the expected value for the N images of the reference database compared with the N images of the database of the simulated images. The demosaicing matrix D thus calculated is of size Phw×hw.
Starting from the calculated demosaicing matrix D, it is possible to determine a vector matrix {tilde over (y)} that is an estimate of the image reconstructed according to the mosaic image from the first sensor 2.
{tilde over (y)}=Dx (1002)
Then, to reconstruct the colour image with P components, it is sufficient to transform the vector matrix {tilde over (y)} into an image with P components, each component corresponding to one of the P colours; this transformation is the inverse operation of the operation shown in
One of the problems of this method for reconstructing colour images is that the image to be reconstructed is larger than the captured colour image 1. The model used for image reconstruction then carries out an interpolation of P colours for a pixel starting from a single item of colour information, that of the pixel. This results in considerable instability of the matrix D thus calculated and therefore a poor quality of reconstruction of the colour image.
The state of the art proposes carrying out an interpolation starting from the neighbourhood of each pixel of the mosaic matrix in order to determine its colour. Such an interpolation makes it possible to reinforce the stability of the estimate of the demosaicing matrix D. It was proposed in patent applications FR2959092 and FR2917559 to use, for carrying out this interpolation, a so-called sliding neighbourhood as shown in
During reconstitution of the image, the colour of each pixel can therefore be reconstituted as a function of the colours of the pixels in its neighbourhood. Thus, the matrix D is defined by integrating the neighbourhoods of each pixel as follows: in the construction of the vector matrices x, y each pixel is increased by its neighbourhood and therefore the different neighbourhoods of each pixel are also stored in the vector matrices x, y. Even if taking the neighbourhoods into account in the calculation of the demosaicing matrices makes it possible to have better reconstitution of the image, it has the drawback of having to manipulate larger matrices and therefore requires substantial means for calculation and data storage.
An aim of the invention is in particular to propose an improvement of the known methods for calculating a demosaicing matrix. Another aim of the invention is to use this improvement in order to propose an optimization of the mosaics of filters associated with the sensors.
For this purpose, the present invention proposes a method for reconstructing a colour image, acquired by a photosensitive sensor of size H×w, covered with a mosaic, of size H×W, of P filters of different colours making up a base pattern of size h×w such that h<H and w<W. Said base pattern of the mosaic of filters is repeated so as to cover the mosaic of filters without overlap between the base patterns. Said method is carried out by computer. Said method comprises at least the following steps:
a second step of reconstructing a colour image producing the product of the demosaicing matrix D with a matrix representation of a mosaic image originating from the sensor after acquisition of the colour image by said sensor, said product of the demosaicing matrix D with the matrix representation of the mosaic image using an interpolation of the colour of each pixel of the mosaic image as a function of a neighbourhood, of size nh×nw pixels, of a base pattern of size h×w, corresponding to the base pattern of the mosaic of filters.
Advantageously, the size of the neighbourhood may be defined by nhnw=Phw.
A first demosaicing matrix D1 may be expressed as an expected value E calculated for the N reference images of the first database: D1=Ei=1 . . . N{(yx1T(x1x1T)−1}, where y is a matrix of HW/(hw) vectors of size Phw representing the colour image.
The first demosaicing matrix D1 may be expressed thus: D1=S1RM1T(M1RM1T)−1 with x1=M1y1, M1 being a matrix of projection of y1 on x1, y=S1y1, S1 being a matrix of reduction of the neighbourhood of the vector y1 and of transformation of the vector y1 into y, and
being a correlation matrix of the resolved images of the first database expressed as a function of the reduced neighbourhoods of size nh×nw.
The demosaicing matrix may be expressed as a function of the spectral sensitivity of the sensor and of the spectral functions of the P filters of different colours.
As the first database may alternatively comprise multi-spectral reflectance images, a second demosaicing matrix D2 can be defined by the expression:
The second demosaicing matrix D2 may be constructed according to the following steps:
construction of the second demosaicing matrix D2 with M1 being a matrix of projection of y1 onto x1 and S1 being a matrix of reduction of the neighbourhood of the vector y1 and of transformation into y.
C0 may also be a product of the spectral sensitivities of components of the optical path of the camera and the spectral sensitivity of the sensor, where said components may comprise at least one of the following: an objective of the camera, an infrared filter, a low-pass spatial filter, a microlens system.
Each row of the demosaicing matrix D, D1, D2 can be expressed as a convolution filter.
The invention also relates to a data processing system comprising means for carrying out the steps of the method for reconstructing a colour image.
The invention also relates to a computer program product comprising instructions which, when the program is executed by a computer, lead the computer to carry out the steps of the method for reconstructing a colour image.
Another aspect of the invention is that it can be applied to a method for optimizing spectral functions of filters and arranging the filters on a mosaic of P different colour filters, repeated so as to fill a base pattern of size h×w, said base pattern repeating so as to cover the mosaic of filters, said mosaic of filters being applied to a photosensitive sensor. Said method comprises a multicriteria optimization by minimizing an error of colour rendering and by minimizing a mean square error between an image originating from an ideal sensor, acquired starting from an image of a database of reference images, and an image originating from a sensor covered with the mosaic of P different filters, acquired starting from the same image of the database of reference images, said image acquired by the sensor covered with the mosaic of filters being reconstructed by the method for reconstructing a colour image.
The method of optimization further comprises minimizing an error of colour rendering between the image originating from the ideal sensor acquired starting from the image of the database of images, and an image originating from a sensor covered with a series of P filters, each of the P filters covering the whole of the sensor, said image being acquired starting from the same image of the database.
The method of optimization further comprises minimizing an error of colour rendering between a Macbeth test chart acquired by a perfect sensor and a Macbeth test chart acquired by a sensor provided with the mosaic of the P filters.
The invention also relates to a data processing system comprising means for carrying out the steps of the method of optimization.
The invention further relates to a computer program product comprising instructions which, when the program is executed by a computer, lead the computer to carry out the steps of the method of optimization.
Advantageously, the invention makes it possible to improve the speed of execution of the demosaicing algorithm as well as the overall size of the memory of a calculator used in the context of carrying out the invention.
Other advantages and features of the invention will become apparent on examining the detailed description of several embodiments, which are in no way limitative, and the attached drawings, in which:
The present invention relates in particular to the acquisition of a multi-chromatic or multi-component colour image of size H×W. In
Once the image has been acquired by the first sensor 2, it is processed in order to reconstruct the multi-component image. The processing carried out on the raw image leaving the first sensor 2 is a demosaicing process using a demosaicing matrix D1. The demosaicing matrix D1 is obtained by the method of least squares applied to the vector matrices x1, y:
D1=Ei=1 . . . N{yx1T(x1x1T)−1} (1003)
In expression (1003), y is a vector matrix as shown in
Throughout the description, H×W is used indiscriminately for the size of a matrix or of an image. In the case of a matrix, H×w represents the number of rows H by the number of columns W of the matrix. In the case of an image, H×W represents the dimensions of the image corresponding to a matrix of size H×W. In the same way, the size of the first base pattern 6 is of h rows by w columns. In an image, by extension, a portion of the image is defined, the size of which corresponds to the size of the first base pattern 6 in a matrix of the same size as the image. It may thus be said that the base pattern 6 is applied to the image. By analogy, the image portion corresponding to the base pattern, such as the third base pattern 21 shown in
In expression (1003), x1 is constructed as shown in
sensor 2 for example, as shown in
In general, the reduced neighbourhood 30 is defined such that nh>h and nw>w. For example, nhnw=Phw may be taken.
The same reduced neighbourhood 30 of size nh×nw according to the invention is therefore used for interpolating the colour of each pixel of the first base pattern 6 during reconstruction of the captured colour image 1 according to the invention. Thus, to construct the demosaicing matrix, the vector matrix x1 is constructed in such a way that each vector comprises only the components of the reduced neighbourhoods 30 of each first base pattern 6 making up the mosaic image 40. Each vector of x1 is therefore of size nhnw and the matrix x1 comprises HW/(hw) vectors of size nhnw. Thus, the demosaicing matrix D1 of expression (1003) is of size Phw×nhnw. Advantageously, such a matrix is of a smaller size than a matrix according to the state of the art while maintaining good quality in the reconstruction of a colour image. For example, it can be shown experimentally that the image reconstructed with a sliding neighbourhood of size nh×nw has the same performance as a reduced neighbourhood of size (nh+h−1)×(nw+w−1). From a theoretical viewpoint, the two neighbourhoods cover the same domain of the mosaic image. For example, for a Bayer base pattern of size 2×2 and a sliding neighbourhood of size 3×3, the same results as with a reduced neighbourhood of size 4×4 are obtained in terms of performance.
It is also possible to define a vector matrix y1, as shown in
A matrix M1 of projection of the vector matrix y1 of the resolved image with P components provided with its reduced neighbourhood 30 on the vector matrix x1 of the mosaic image 40 provided with its reduced neighbourhood 30 is defined, such that:
x1=M1y1 (1004)
A matrix S1 of reduction of the reduced neighbourhood 30 of the vector matrix y1 for transforming it into the vector matrix y is defined, such that:
y=S1y1 (1005)
It is thus possible to define the demosaicing matrix D1 as follows:
D1=S1RM1T(M1RM1T)−1 (1006)
where R is the correlation matrix such that:
Advantageously, using the formulation of D1 according to expression (1006), it is possible to calculate just once the correlation matrix R of the colour images of the database of reference images, or resolved images, said resolved images being provided with their reduced neighbourhood 30 of size nh×nw. Thus, it is possible to recalculate in a simple way the demosaicing matrix D1 by modifying the operators M1 and S1 according to the mosaic of filters considered.
An estimate of the error associated with the demosaicing method can be expressed thus:
e=Ei=1 . . . N{tr(({tilde over (y)}−y)({tilde over (y)}−y)T)} (1008)
therefore
e=tr{D1M1RM1T+D1T+S1RS1T−S1RM1TD1T−D1M1RS1T} (1009)
where tr is the trace operator.
It is thus possible to evaluate a priori the performance of a particular mosaic of filters for encoding a database of reference images.
The database of reference images makes it possible to calculate R for a given size of reduced neighbourhood nh×nw.
Defining the first base pattern 6 of the mosaic of filters makes it possible to calculate M1, S1 and D1.
Based on these data, the mean error in the reconstruction of an image, associated with the use of a particular mosaic positioned on the first sensor 2, can be calculated directly from the database of reference images.
In the same way, it is possible to calculate a mean value of a colour difference between the reference images and the resolved images in the manner described below.
A matrix containing the spectral quantum efficiency of the filters is denoted FQE. The spectral quantum efficiency can be measured with a monochromator, or estimated by an appropriate transformation if the spectral transmission functions of the filters are not known a priori. Measurement of the spectral quantum efficiency is carried out by proceeding with a recording of the data acquired by the first sensor 2 starting from the images corresponding to the quasi-chromatic light produced by the monochromator for each pixel of the base pattern. The levels of the images are then arranged in such a way that the levels of sensitivities associated with the exposure times during the measurement correspond, i.e. the levels of the images are multiplied by a factor depending on the exposure time for harmonizing the sensitivities in a given radiometric unit. To calculate a quantum efficiency of the P different pixels covered with the P different filters over a given wavelength range with a given wavelength spacing, an instrument is used for measuring the transparency of the filters, or the whole optical path, on NA intervals of wavelength. For example, for a range from 380 nm to 780 nm with a spacing of 1 nm, Nλ=401 is obtained.
A transform of the filter space to the standardized trichromatic CIE 1931-XYZ colour space can be defined as follows:
FtoXYZ=XYZTFQE(FQETFQE)−1 (1010)
where FQE is of size Nλ×P, XYZ is a matrix of size Nλ×3 containing the spectral functions of the filters defined for the CIE 1931-XYZ colour space, and FtoXYZ is of size 3×P. FtoXYZ is a transformation matrix allowing a colour image with P components to be converted into an image the colour coordinates of which are expressed in the CIE 1931-XYZ colour space. The CIE 1931-XYZ colour space was defined by the International Commission on Illumination (CIE) in 1931. By extending the size of the transformation matrix FtoXYZ to the size of the vector y, the transformation yXYZ is obtained, defined by:
yXYZ=(Ihw⊗FtoXYZ)y (1011)
in which Ihw is an identity matrix of size hw×hw and ⊗ represents a Kronecker product.
An approximation of the mean square colour difference Ei=1 . . . N{ΔE2} on the database of reference images for a given mosaic of filters and a defined size of neighbourhood is given by:
J′ being an approximation of the transform to the CIE L*a*b* colour space.
A representation in the CIE 1931-XYZ colour space is a linear representation of the visual system. Now, this representation is not satisfactory for predicting the colour differences. For that, therefore, the CIE L*a*b* colour space is used, which makes the colour space uniform so that it is closer to human perception. The CIE L*a*b* colour space was defined by the International Commission on Illumination (CIE) in 1976.
It is thus possible to test and evaluate different mosaics at lower computation cost, in particular because the calculation of R is carried out just once with the reduced neighbourhood 30 for each image of the first reference database, whatever mosaic is tested. It is thus possible to calculate a mean error in the reconstruction of the images of the reference database with a given mosaic.
Advantageously, it is possible to transform an image reconstructed by the demosaicing method according to the invention to any normalized space derived from the CIE 1931-XYZ colour space. For example, an sRGB space (meaning standard Red Green Blue) can be selected, which is a trichromatic colour space defined by standard CIE 61966-2-1 (1999). For example, a transformation to the sRGB colour space may be carried out as follows:
ySRGB=A(Ihw⊗FtoXYZ){tilde over (y)} (1016)
Using expression (1002) applied to D1 and x1, the following is obtained:
A being a transformation matrix from the CIE 1931-XYZ colour space to the sRGB colour space.
It is possible to express a multi-component image 54 starting from the multi-spectral reflectance image, by multiplying the multi-spectral reflectance image 52 by the spectral power density L(λ), to determine a radiance image 53. Then a matrix representing the radiance image 53 is multiplied by the transmission functions of the
filters F1(λ), F2(λ), . . . , FP(λ) as a function of the spectral component of the light and of C(λ). This operation may be carried out in vector form as shown in
The operation that is modelled by determining the demosaicing matrix is the reconstruction of a multi-component image starting from a mosaic image 56 produced by a third sensor 55 on which a second mosaic of filters 57, of spectral function F(λ), is positioned after acquisition of the radiance image 53. The second mosaic of filters 57 is composed of P filters defined for PA ranges of values in the spectral domain. In general, a spacing of 10 nm is considered for a spectral domain from 400 nm to 700 nm. The third sensor 55 is similar to the first sensor 2 shown in
A first vector matrix z0 may be constructed, the vectors of which are spectral components of the multi-spectral reflectance image 52, of size Pλ. The first vector matrix z0 is composed of HW different vectors.
A second vector matrix z representing the multi-spectral reflectance image 52 may also be constructed. To construct the second vector matrix z, the pixels are grouped together in groups of size hw, each group corresponding to the positions of the base patterns 6 on the second mosaic of filters 57 for all of the spectral components Pλ. Thus, the second vector matrix z is composed of HW/(hw) vectors of size hwPλ.
A third vector matrix z1 may be constructed starting from the multi-spectral reflectance image 52 using a neighbourhood of size nh×nw around each of the base patterns 6 on the second mosaic of filters 57. The cumulative vector of the spectral components of each of the pixels of the neighbourhood is of dimension nhnwPλ. The third matrix z1 is then composed of HW/(hw) different vectors.
y0=F0TC0L0z0 (1019)
In the same way as the vector matrix y is constructed starting from the multi-component resolved image Ii, as shown in
shown in
y=FTCLz (1020)
with the following expressions: F=Ihw⊗F0, C=Ihw⊗C0, and L=⊗IhwL0 in which Ihw is an identity matrix of size hw×hw.
The new demosaicing matrix D2 applied to a multi-spectral image may then be written as:
D2=FTCLS1R′L1TC1TF1M1T(M1F1TC1L1R′L1TC1TF1M1T)−1 (1021)
such that:
The new demosaicing matrix D2 thus defined makes it possible in addition to take into account any arrangement of the colours in the mosaic of filters, characterized by M1, of the transmission functions of the filters F0 and the spectral density of the light source L0. Advantageously, the formulation of D2 takes into account the definition of the reduced neighbourhood according to the invention.
It is also possible to calculate a priori the performance of a particular mosaic of filters, defined by the spatial arrangement of its filters, the spectral transmission functions of its filters and the light source used. For this purpose, it is possible for the equations for calculating the error of estimation associated with the demosaicing (1008), (1009) and the equations for calculating the colour difference (1012), (1013), (1014), (1015) associated with the demosaicing to be adapted to the multi-spectral domain.
The spectral quantum efficiency FQE of the filters is equivalent to the product of the transmission matrix of the filters F and C, C being the sensitivity of the sensor multiplied by the spectral transmission function of the components of the optical path of the camera without the mosaic of filters. By way of simplification, it is possible to consider only the sensitivity of the sensor for calculating C.
Advantageously, in equation (1021), the multiplication on the left by the expression FTCLS1 projects the image reconstructed according to the P colour components. In other words, FTCLS1 projects the Pλ components of the spectral domain on the P colours of the filters of the mosaic.
If the projection of the image reconstructed according to the P colour components is not carried out, then a reconstruction filter of the multi-spectral images is obtained. It is thus possible to estimate a colour spectrum for each pixel of the image reconstructed starting from the mosaic image.
A demosaicing matrix, such as the matrix D1, makes it possible to reconstruct the vector matrix {tilde over (y)} representing the image reconstructed starting from the vector matrix x1 representing the mosaic image: {tilde over (y)}=D1x1.
Each row of the demosaicing matrix may be regarded as a convolution filter that makes it possible to reconstruct one of the colours of one of the pixels of a fifth base pattern 70, of size h×w of the colour image, with P components. The fifth base pattern 70 is encoded as a first column vector 71 of size Phw, starting from a reduced neighbourhood 73, of size nh×nw, of the base pattern hw comprising said corresponding pixel in the mosaic image. The reduced neighbourhood 73 is encoded as a second column vector 74.
Each row of the demosaicing matrix D1 can be converted into an equivalent convolution filter 72 that is applied to each pixel of the mosaic image to reconstruct the pixels of the colour image with P components. Advantageously, expressing a demosaicing matrix as a set of convolution filters, each applicable to a pixel of the mosaic image, makes it possible to avoid converting the mosaic image into a vector matrix, which represents an expensive operation in terms of computation time, computation resources and memory. Advantageously, a reconstructed image is thus obtained which is not in the form of a vector matrix that has to be disassembled. It is thus possible to save on computation time, computation resources and memory by dispensing with the operation of transformation of the vector matrix of the reconstructed image into the complete reconstructed image, in which each pixel of the base pattern corresponds to a convolution filter.
Transformation into convolution filters may also apply to the demosaicing matrix D2 of a multi-spectral mosaic image.
The invention also makes it possible to carry out a method of spectral optimization of the transmission functions of the filters and of the arrangement of the filters on a base pattern of a mosaic.
For this purpose, training of the filter or demosaicing matrix is used, using the method of least squares with a reduced neighbourhood 30 according to the invention. As seen above and in particular in expression (1021), the demosaicing matrix may be expressed by means of the spectral functions of the filters F. By means of the demosaicing matrix, it is possible to calculate the quality criteria MSE (for Mean Square Error) and ΔE of the reconstruction of the image captured by the third sensor 55, into a colour image with P components. It is thus possible to optimize the parameters of the spectral functions of the filters in order to maximize the quality criteria of the image produced.
As shown in
In
The radiance image 53 can be measured by a first theoretical ideal imaging system, which comprises a system for dividing the luminous flux into three components. Each of the components passes through filters X(λ), Y(λ), Z(λ) and is then measured by a fourth ideal sensor 81. C(λ) is the spectral sensitivity of the optical path of the camera including the sensor, but without the mosaic of filters. Such an ideal imaging system directly captures the coordinates X, Y, Z of each pixel in the CIE 1931-XYZ colour space and directly produces a so-called ideal colour image 80, with three components in the CIE 1931-XYZ colour space.
A second imaging system may be composed of P colour filters, the transmission function of which is given by Fi=1 . . . P(λ). The light passes through each of these P filters, and it is then measured by a third sensor 55. The third sensor 55 produces a multi-component image 54 with P colour components, each corresponding to one of the P filters Fi(λ). The spectral sensitivity of the optical path of the camera including the third sensor 55, but without the mosaic of filters,
is C(λ). Alternatively, it can be considered that C(λ) is solely the spectral sensitivity of the sensor.
A third imaging system is the one that it is attempted to model. It is composed of a second matrix, or mosaic, of filters 83 of P different colours arranged on the first base pattern 6 and duplicated in the size of the third sensor 55. The third imaging system also comprises the third sensor 55.
Starting from the first vector matrix z0, a vector matrix yXYZ may be constructed corresponding to the ideal image of components XYZ such that:
yXYZ=XYZTL0z0 (1027)
with, for example:
There is also:
The matrix yXYZ is of size 3×HW and can be transformed into an image of size H×W×3 comprising the three components XYZ for each pixel of the reconstructed image.
Starting from the third matrix z1 of size nhnwPλ×HW(hw), the demosaicing matrix D2 can be written according to expression (1021).
This manner of writing D2 makes it possible to calculate once for the whole correlation matrix R′ for all the images of the database of reference images. This makes it possible to calculate the demosaicing matrix D1 for mosaics of filters defined a posteriori and encoded in the matrix F1 of the spectral functions of the filters. Thus, the model of D2 according to expression (1031) advantageously allows a direct expression of the demosaicing operator or matrix D2 as a function of the data of the problem that is to be solved, namely an optimization of the spectral functions of the filters of the mosaic of filters. It is thus possible to obtain F1 so as to optimize the quality of the reconstruction of the images acquired.
The optimization criteria used are the quality criteria of image reconstruction: spatial MSE and colorimetric ΔE.
The optimization criteria are calculated between an ideal image 80, produced by a fourth ideal sensor 81 starting from the multi-spectral reflectance image 52, and a mosaic image 56 acquired via the third mosaic of filters 83, demosaiced, i.e. dematrixed, and converted into a colour space allowing the calculation of the optimization criteria.
To calculate the optimization criteria, it is possible to adopt a position in the sRGB space or any other related space such as Adobe®RGB. To adopt a position in the sRGB space, the operations described above are carried out, i.e. conversion into the standardized trichromatic CIE 1931-XYZ colour space using equations (1010) and (1011) and then conversion into the sRGB space by means of equations (1016), (1017), (1018).
It is also possible to use another colour space. For example, a colour space that can be expressed on the basis of the XYZ space can be obtained by modifying matrix A. The other spaces require replacing FtoXYZ. For example, if a destination space is called ABC, it is necessary to estimate FtoABC by replacing XYZ with ABC in expression (1010).
It is also possible to calculate a criterion of the MSE type or a criterion of the PSNR type. PSNR (Peak To Noise Ratio) is a measure of colour distortion of the image. For two multi-component images expressed in the sRGB space, I′(x′,y′,c) and K′(x′,y′,c), normalized between 0 and 1, where c is one of the three colour components, the criterion MSE is calculated as:
The criterion PNSR is calculated as follows:
The calculation of LE is carried out by approximating the non-linear calculation by a piecewise linear function in the following way, for two images I′ and K′ expressed in the XYZ reference system:
in which:
where diag is a function that places a vector in the diagonal of a matrix.
As shown in
Each image is from one of three different processing routes 100, 101, 102 at the output of the third and fourth sensors 55, 81.
A first route 100 uses a first processing of a second processing route 101 that consists of transforming the multispectral reflectance image R(x′,y′,λ) into a matrix zo of HW vectors of size PA as shown in
Then a first processing of the first processing route 100 is a projection of the matrix z0 into the XYZ space as described by equation (1027). A vector matrix zXYZ of size 3×HW is obtained.
Then the matrix zXYZ is projected into the sRGB space by applying to it matrix A as described in equations (1017) and (1018). A new matrix ZsRGB of size 3×HW is obtained. The matrix zsRGB may then be “unfolded” to reconstitute the first three-component image 103 of size H×W in the sRGB colour space.
The second route 101 carries out, on the vector z0, the operation shown in
A third route 102, starting from the multispectral reflectance image R(x′,y′,λ) acquired by the third sensor 55 covered with the third mosaic of filters 83 gives a matrix zi as shown in
Starting from the different vector matrices shown in
their distribution on the third mosaic of filters 83. The calculations of the different ΔE are carried out according to formulae (1012), (1013), (1014) and (1015).
A first ΔE1 is calculated between the image contained in the matrix zXYZ produced directly starting from the multi-spectral reflectance image R(x′,y′,λ) and the image acquired directly via filters F1, F2, F3 and then passed through the conversion to the XYZ colour space: y0XYZ.
A second ΔE2 is calculated between the image contained in the matrix zXYZ and the image expressed in the XYZ colour space after acquisition by means of the third mosaic of filters 83: {tilde over (y)}XYZ.
A third ΔE3 is a purely spectral criterion not using reconstruction of an image for testing the colour rendering ability of the filters. To calculate the third ΔE3, the spectra of a Macbeth test chart or colour chart comprising 24 colours are used. Alternatively, it is also possible to use any other spectral reference base. Starting from the multi-spectral reflectance data of the 24 squares of the Macbeth test chart, on the one hand the transformation into the XYZ colour space is applied directly to obtain a fourth image and on the other hand the filters F1, F2, F3 and the sensitivity of the optical path of the camera and then conversion of the image at the output of the third sensor 55 into the XYZ colour space are applied to obtain a fifth image. The fourth and fifth images are used for calculating the third ΔE3.
In their turn, MSE and PNSR are calculated between the first image 103 produced directly starting from the multi-spectral reflectance image and the third image produced starting from the multi-spectral reflectance image after it passes through the mosaic matrix 83 and the third sensor 55.
A first step 100 is a step of acquisition of a colour image 101 by an image acquisition device 102. The image acquisition device 102 comprises a sensor 2, 55 as shown in
The device for constructing a demosaicing matrix comprises a first database 110. The first database 110 comprises so-called reference images. The reference images may be multi-component images, or multi-spectral images. The reference images may also be images outside of the visible spectrum. Starting from the first database 110, a first step of constructing a demosaicing matrix is a step of modelling mosaic images from a sensor covered with a mosaic of filters. The modelling is carried out by a simulation application 111 that implements a model of the sensor 2, 55. The simulation application 111 may be executed by one or more processors of a second calculator, or computer 112. Alternatively, the simulation application 111 may be executed by the first calculator 104.
Starting from each reference image, the simulation application 111 produces a mosaic image, which will populate a second database 114 of so-called mosaic images.
Once the second database 114 has been constructed, the second step 115 of the method for constructing the demosaicing matrix can be implemented. The method for constructing the demosaicing matrix can be carried out by a computer program, which is executed on one or more processors of the second calculator 112. Alternatively, the method for constructing the demosaicing matrix can be carried out on a third calculator, or computer (not shown), or else the first calculator 104. The method for constructing a demosaicing matrix uses the images of the two databases 110, 114. The first database 110 is used in order to produce a mosaic image starting from a reference image by applying to it a demosaicing matrix under test, i.e. using the demosaicing method according to the invention. The mosaic image thus produced is then compared with the mosaic image corresponding to the reference image in the second database 114. This comparison consists of calculating an error between the mosaic matrix produced by simulation and the mosaic matrix constructed by application of the demosaicing matrix under test. The method for constructing the demosaicing matrix is an iterative method: if the error of construction of the mosaic matrix is below a threshold, the method stops. If otherwise, a new demosaicing matrix is determined and tested.
The different embodiments of the present invention comprise various steps. These steps may be carried out by machine instructions executable by means of a microprocessor, for example.
Alternatively, these steps may be carried out by specific integrated circuits comprising hard-wired logic for executing the steps, or by any combination of programmable components and personalized components.
The present invention may also be supplied in the form of a computer program product, which may comprise a non-transitory computer storage medium containing instructions executable on a data processing machine, these instructions being usable for programming a computer (or any other electronic device) for executing the methods.
Number | Date | Country | Kind |
---|---|---|---|
1851978 | Mar 2018 | FR | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/EP2019/054222 | 2/20/2019 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2019/170420 | 9/12/2019 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
7149262 | Nayar et al. | Dec 2006 | B1 |
8564699 | Alleysson et al. | Oct 2013 | B2 |
8964250 | Alleysson et al. | Feb 2015 | B2 |
20020191854 | Kakarala | Dec 2002 | A1 |
Entry |
---|
French Search Report from French Patent Application No. 1851978 dated Nov. 5, 2018. |
International Search Report and Written Opinion for International Patent Application No. PCT/EP2019/054222, dated May 16, 2019. |
Trussell, H., et al., “Mathematics for Demosaicking,” IEEE Transactions on Image Processing, vol. 11, No. 4, Apr. 2002, pp. 485-492. |
Number | Date | Country | |
---|---|---|---|
20200413012 A1 | Dec 2020 | US |