Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
METHOD FOR GENERATING IMAGE DATA FOR MACHINE LEARNING BASED IMAGING ALGORITHMS
Document Type and Number:
WIPO Patent Application WO/2020/156653
Kind Code:
A1
Abstract:
A method and system for converting arbitrary RGB images downloaded from online image sources to spectral images, and further processing the spectral images with the help of camera characterization data to input and ground truth image pairs to be used for training deep neural networks for image processing tasks such as Auto White Balance (AWB) or Color Shading Correction (CSC).

Inventors:
KOSKINEN SAMU (SE)
Application Number:
PCT/EP2019/052228
Publication Date:
August 06, 2020
Filing Date:
January 30, 2019
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
HUAWEI TECH CO LTD (CN)
KOSKINEN SAMU (SE)
International Classes:
H04N1/60
Foreign References:
US20180176420A12018-06-21
US20110032380A12011-02-10
US20050168645A12005-08-04
Other References:
None
Attorney, Agent or Firm:
KREUZ, Georg (DE)
Download PDF:
Claims:
CLAIMS

1. A method for processing image data, the method comprising the following steps: storing image data IWEB (101 ) representative of an image in a memory (2), wherein said image data IWEB is in RGB format; receiving said image data IWEB { 102) in an image signal processor (3); transforming said image data IWEB into linear RGB format (103) by applying inverse gamma correction to the image data IWEB, applying an observer color-mapping function (104) to said image data IWEB', transforming said image data IWEB into a spectral matching color space (106) where luminance components L and chrominance components c are separated; providing values of a natural spectrum l in the same spectral matching color space (107); applying spectral matching to said image data IWEB in said spectral matching color space (108), wherein said luminance components L are omitted and color differences between said image and said natural spectrum l are measured as the Euclidean distances between their pairs of chrominance components c; improving said spectral matching (109) by modifying said natural spectrum l in a sequence of iterative steps in order to reduce said Euclidean distances and to find a corresponding natural spectrum 4; and converting said image data IWEB to spectral image data ISPEC (110) of a spectral image using said corresponding natural spectrum l.

2. A method according to claim 1 , wherein the steps of the method are carried out in the sequence indicated in the claim.

3. A method according to any one of claims 1 or 2, wherein applying said observer color mapping function to said image data IWEB (104) comprises converting chromacity coordinates Cs of said image data IWEB (1041 ) from a source tristimulus color space into chromacity coordinates Ct in a target tristimulus color space, wherein said conversion is done using at least one of a conversion look-up table LUT, or a conversion matrix M, wherein the size of said conversion matrix M is at least 3x3.

4. A method according to claim 3, wherein the conversion of said chromacity coordinates is done using a conversion matrix M according to the formula: ct = Mcs and wherein the method further comprises optimizing said conversion matrix M (1046) using a gradient descent algorithm in an iteration loop according to the formula: where / refers to the number of colors used for said color-mapping function, CCIE represents the target chromacity coordinates in a standard color space, and CSRGB represents the source chromacity coordinates in the RGB color space; wherein each non-diagonal coefficient is optimized one by one, diagonal values are calculated right after each non-diagonal coefficient change to keep the sum of each row at 1 , and after calculating all the coefficients, the optimization step is applied again until no improvement can be noticed.

5. A method according to claim any one of claims 1 to 4, wherein applying said observer color mapping function to said image data IWEB (104) comprises fixing the target color space (1042) to the CIE 1931 Standard Observer color space, and defining a fixed number Nc of colors (1043) with known reflection spectra and calibration charts that cover the standard RGB color gamut to be used for said color-mapping function, wherein said fixed number Nc equals or is larger than 24.

6. A method according to claim 5, wherein applying said observer color-mapping function to said image data IWEB (104)further comprises selecting a number NL of illuminants / (1044) for which their spectra are available and whose distribution approximates normal statistical distribution of typical illuminant / use cases; selecting one of said number NL of illuminants / (1045) each time as selected illuminant m during said sequence of iterative steps; wherein said selection is carried as at least one of a random selection, or a selection based on information associated with said image such as metadata or image data I WEB, and wherein said number NL ranges from 10 to 1000, more preferably from 50 to 500, more preferably equals 100.

7. A method according to any one of claims 1 to 6, further comprising after applying said observer color-mapping function to said image data I WEB, applying inverse Auto White Balance correction (105) to said image data I WEB, wherein said inverse Auto White Balance correction is preferably applied before said spectral matching.

8. A method according to any one of claims 1 to 7, wherein said spectral matching color space is the CIELAB color space with values defined as (L)aibi, where L refers to the luminance components and ai,bi refer to the chrominance components as three numerical values.

9. A method according to any one of claims 1 to 8, wherein applying spectral matching to said image data IWEB (108) comprises interpolating between color values, wherein each pixel color is reconstructed from a set of natural spectral responses, and wherein interpolation weights are applied in the spectral domain to reconstruct the spectrum of the color of each pixel in said image according to the formula: wherein l(x,y) represents original image in the spectral domain, / represents the illuminant, wi represents the interpolation weights, and db represent the database of natural spectra under typical illuminations {Rdb, Gdb,Bdb}.

10. A method according to claim 9, wherein improving said spectral matching (109) comprises applying an iterative function (1091 ) that alters the interpolation spectra modulated by CIE Standard Observer curves: i e {ff , G , B}

wherein 1(A) is a spectrum of the image to be optimized, where A represents the CIE Standard Observer curves, SfIE represents the normalized weights based on the CIE Standard Observer curves, and cT and cs represent target RBG values and source RBG values respectively; and calculating the error (1092) between said target RBG values cT and source RBG values cs, wherein said iterative function is iteratively optimized until the error is: 0.00001

1 1. A method according to any one of claims 1 to 10, further comprising after converting said image data IWEB to spectral image data ISPEC, matching the brightness level (11 1 ) of said image for each pixel by applying multiplication of luminance values in the spectral domain.

12. A method according to any one of claims 1 to 1 1 , further comprising converting said spectral image data ISPEC to raw RGB image data IRAW (1 12) using camera characterization information regarding spatial spectral response of a camera sensor S, wherein spectral image data ISPEC associated with one spectral image is used to generate raw RGB image data IRAW^O multiple raw RGB images.

13. A method according to claim 12, wherein said camera characterization information is gained from spatial spectral measurement of a camera sensor.

14. A method according to any one of claims 12 or 13, wherein converting said spectral image data ISPEC to raw RGB image data IRAW (112) comprises calculating the RGB color response (1 121 ) of each pixel of said spectral image using said information regarding spatial spectral response of said camera sensor S and a spectrum A of an illuminant / selected when applying said observer color-mapping function to said image data

IWEB-

15. A method according to claim 14, wherein converting said spectral image data ISPEC to raw RGB image data /fMwfurther comprises calculating AWB correction gains (1 122) by multiplying the camera response at the center of said spectral image together with the illuminant / and summarizing the results for the R, G and B channels separately, calculating color shading and vignetting parameters (1 123) by multiplying the spatial camera response together with the illuminant / and summarizing the results the R, G and B channels separately, then applying the Auto White Balance gains and normalizing the responses at the image center; optionally applying vignetting correction (1 124) by applying the inverse of said vignetting parameters; applying Auto White Balance correction and color shading correction (1 125) based on the calculated parameters.

16. A method according to any one of claims 12 to 15, further comprising using said raw RGB image data /wfor the training of a deep learning model DL (113), wherein said deep learning model DL is configured to apply automatic image signal processing function to input image data, wherein said function is one of Auto White Balance correction or Color Shading Correction.

17. A computer-based system (1 ) for processing image data, the system comprising a memory device (2) configured to store image data IWEB of an image in RGB format; an image signal processor (3) configured to receive said image data IWEB as an input for an inverse image signal processing pipeline; and a storage device (4) configured to store instructions that, when executed by said image signal processor (3), cause the computer-based system (1 ) to perform a method according to any one of claims 1 to 16.

Description:
METHOD FOR GENERATING IMAGE DATA FOR MACHINE LEARNING BASED IMAGING

ALGORITHMS

TECHNICAL FIELD

The disclosure relates to image signal processing, in particular methods and systems for converting arbitrary RGB images to spectral images that can be further processed into raw RGB images for teaching deep learning algorithms.

BACKGROUND

The ultimate goal of a camera chip manufacturer is to manufacture a sensor S that captures an image / of a scene R illuminated by an illuminant / in a way that provides perfect image quality. For a mobile phone camera chip manufacturer, the goal can be defined in a more modest and practical way since there is still a quality gap between the best mobile phone cameras and the high-end DSLR cameras: to provide images of quality matching a high-quality DSLR camera. The goal is not readily achievable by sensor hardware only, but the sensor image (the raw RGB image) must be post-processed by a manufacturer defined Image Signal Processor (ISP) pipeline that consists of various algorithms such as noise reduction, lens shading correction, white balance (color constancy) correction and Bayer demosaicking. Since the introduction of deep learning it has become relevant to study whether all these algorithms can be replaced by end-to-end learnable deep image-to-image transfer architectures.

For training the deep architectures a large set of image pairs is needed, wherein each pair consists of a raw RGB image captured by a camera sensor S and a high quality (ideal) image captured by a high-end sensor that represents the ground truth S GT .

The challenge of this approach is the need of the large dataset that is laborious to collect, and the present errors in aligning the images captured by the camera sensor S and the high-end sensor that represents the ground truth S GT . For example, in the case of Auto White Balance (AWB) correction it might be possible but extremely time consuming to generate the training image pairs, as it would necessitate physically locating white color reference object in each scene to be captured. In other cases, such as Color Shading Correction (CSC), it would not even be possible to generate the training image pairs manually.

In the past data augmentations have been used in many deep learning based computer vision applications. These applications include image transformations, style transfers and generative adversarial networks. However, these methods are not generally applicable for learning the ISP related algorithms as those need more precise transformations to be used for learning.

To solve the problem for ISP related algorithms, RGB to spectral image conversion (RGB-to- SPEC) is an essential step for generating raw RGB images as observed by an approximated sensor. However, existing RGB-to-SPEC conversion methods assume that the spectral characterization of a device (display or camera device) is available, thus provide no solution for cases where there is no detailed information about the capturing devices (e.g. the input images are downloaded from the internet).

Other approaches include camera processing models that can be used also for reverse processing web images but they do not consider spectral reflectances, nor completely unknown camera profiles.

SUMMARY

It is an object to provide an improved image signal processing method that overcomes or at least reduces the problem mentioned above.

This object is achieved by the proposed method by converting arbitrary images IWEB to spectral ground truth image data ISPEC of the captured scene reflectances R under an arbitrary illumination /. The spectral image data ISPEC is then forward converted to raw RGB image data IRAW of a known sensor S. The generated images IRAW can then be used to train deep models for ISP algorithms, such as Auto White Balance (AWB) and Color Shading Correction (CSC).

The foregoing and other objects are achieved by the features of the independent claims. Further implementation forms are apparent from the dependent claims, the description and the figures.

According to a first aspect, there is provided a method for processing image data, the method comprising the following steps: storing image data IWEB representative of an image in a memory, wherein the image data IWEB is in RGB format; receiving the image data IWEB in an image signal processor; transforming the image data EB into linear RGB format by applying inverse gamma correction to the image data IWEB ' , applying an observer color-mapping function to the image data IWEB ' , transforming the image data IWEB into a spectral matching color space where luminance components L and chrominance components c are separated; providing values of a natural spectrum l in the same spectral matching color space; applying spectral matching to the image data IWEB in the spectral matching color space, wherein the luminance components L are omitted and color differences between the image and the natural spectrum l are measured as the Euclidean distances between their pairs of chrominance components c; improving the spectral matching by modifying the natural spectrum l in a sequence of iterative steps in order to reduce the Euclidean distances and to find a corresponding natural spectrum l\ and converting the image data IWEB to spectral image data ISPEC of a spectral image using the corresponding natural spectrum l.

With the proposed image data processing method it becomes possible to take arbitrary RGB images as input and convert them to raw RGB images with the ultimate goal of data augmentation for deep learning. The proposed method provides full control over the important scene, lens and camera parameters to“hallucinate” raw sensor images of a virtual camera that approximates any known sensor. The fact that the method ultimately enables to also simulate the ground truth images results in the possibility to download a huge number of arbitrary online images e.g. by known image scraping methods and convert them to sensor specific images that can be used to train deep models to replace traditional ISP algorithms. This approach not only saves time e.g. in the case of training machine learning models for AWB correction tasks but enables the training of previously impossible machine learning tasks such as Color Shading Correction.

In a possible implementation form of the first aspect the steps of the method are carried out in the sequence indicated in the description of the first aspect.

In a possible implementation form of the first aspect applying the observer color-mapping function to the image data IWEB comprises converting chromacity coordinates cs of the image data IWEB from a source tristimulus color space into chromacity coordinates C t in a target tristimulus color space, wherein the conversion is done using at least one of a conversion look-up table LUT, or a conversion matrix M, wherein the size of the conversion matrix M is at least 3x3.

In a possible implementation form of the first aspect the conversion of the chromacity coordinates is done using a conversion matrix M according to the formula: c t = Mc s and wherein the method further comprises optimizing the conversion matrix M using a gradient descent algorithm in an iteration loop according to the formula: where / refers to the number of colors used for the color-mapping function, CCIE represents the target chromacity coordinates in a standard color space, and C S RGB represents the source chromacity coordinates in the RGB color space; wherein each non-diagonal coefficient is optimized one by one, diagonal values are calculated right after each non-diagonal coefficient change to keep the sum of each row at 1 , and after calculating all the coefficients, the optimization step is applied again until no improvement can be noticed.

In a possible implementation form of the first aspect applying the observer color-mapping function to the image data IWEB comprises fixing the target color space to the CIE 1931 Standard Observer color space, and defining a fixed number N c of colors with known reflection spectra and calibration charts that cover the standard RGB color gamut to be used for the color-mapping function, wherein the fixed number N c equals or is larger than 24.

In a possible implementation form of the first aspect applying the observer color-mapping function to the image data IWEB further comprises selecting a number NL of illuminants / for which their spectra are available and whose distribution approximates normal statistical distribution of typical illuminant / use cases; selecting one of the number NL of illuminants / each time as selected illuminant m during the sequence of iterative steps; wherein the selection is carried as at least one of a random selection, or a selection based on information associated with the image such as metadata or image data I WEB, and wherein the number N L ranges from 10 to 1000, more preferably from 50 to 500, more preferably equals 100.

In a possible implementation form of the first aspect the method further comprises after applying the observer color-mapping function to the image data I WEB, applying inverse Auto White Balance correction to the image data I WEB, wherein the inverse Auto White Balance correction is preferably applied before the spectral matching.

In a possible implementation form of the first aspect the spectral matching color space is the CIELAB color space with values defined as (L)aibi, where L refers to the luminance components and aibi a refer to the chrominance components as three numerical values.

In a possible implementation form of the first aspect applying spectral matching to the image data IWEB comprises interpolating between color values, wherein each pixel color is reconstructed from a set of natural spectral responses, and wherein interpolation weights are applied in the spectral domain to reconstruct the spectrum of the color of each pixel in the image according to the formula: wherein l(x,y) represents original image in the spectral domain, / represents the illuminant, wi represents the interpolation weights, and db represent the database of natural spectra under typical illuminations {Rdb, Gdb,Bdb}.

In a possible implementation form of the first aspect improving the spectral matching comprises applying an iterative function that alters the interpolation spectra modulated by CIE Standard Observer curves: i e {R, G, B}

wherein 1(A) is a spectrum of the image to be optimized, where A represents the CIE Standard Observer curves, Sf IE represents the normalized weights based on the CIE Standard Observer curves, and c T and c s represent target RBG values and source RBG values respectively; and calculating the error between the target RBG values c T and source RBG values c s , wherein the iterative function is iteratively optimized until the error is: 0.00001

In a possible implementation form of the first aspect the method further comprises after converting the image data IWEB to spectral image data ISPEC, matching the brightness level of the image for each pixel by applying multiplication of luminance values in the spectral domain.

In a possible implementation form of the first aspect the method further comprises converting the spectral image data ISPEC to raw RGB image data IRAW using camera characterization information regarding spatial spectral response of a camera sensor S, wherein spectral image data ISPEC associated with one spectral image is used to generate raw RGB image data IRAW for multiple raw RGB images.

In a possible implementation form of the first aspect the camera characterization information is gained from spatial spectral measurement of a camera sensor.

In a possible implementation form of the first aspect converting the spectral image data ISPEC to raw RGB image data IRAW comprises calculating the RGB color response of each pixel of the spectral image using the information regarding spatial spectral response of the camera sensor S and a spectrum A of an illuminant / selected when applying the observer color-mapping function to the image data IWEB.

In a possible implementation form of the first aspect converting the spectral image data ISPEC to raw RGB image data IRAW further comprises calculating Auto White Balance correction gains by multiplying the camera response at the center of the spectral image together with the illuminant / and summarizing the results for the R, G and B channels separately, calculating color shading and vignetting parameters by multiplying the spatial camera response together with the illuminant / and summarizing the results the R, G and B channels separately, then applying the Auto White Balance gains and normalizing the responses at the image center; optionally applying vignetting correction by applying the inverse of the vignetting parameters; and applying Auto White Balance correction and color shading correction based on the calculated parameters.

In a possible implementation form of the first aspect the method further comprises using the raw RGB image data / wfor the training of a deep learning model DL, wherein the deep learning model DL is configured to apply automatic image signal processing function to input image data, wherein the function is one of Auto White Balance correction or Color Shading Correction.

According to a second aspect, there is provided a computer-based system for processing image data, the system comprising a memory device configured to store image data IWEB of an image in RGB format; an image signal processor configured to receive the image data IWEB as an input for an inverse image signal processing pipeline; and a storage device configured to store instructions that, when executed by the image signal processor, cause the computer-based system to perform a method according to any one of the possible implementation forms of the first aspect.

These and other aspects will be apparent from and the embodiment(s) described below.

BRIEF DESCRIPTION OF THE DRAWINGS

In the following detailed portion of the present disclosure, the aspects, embodiments and implementations will be explained in more detail with reference to the example embodiments shown in the drawings, in which:

Fig. 1 is a flow diagram of the image signal processing method in accordance with an embodiment of the first aspect. Fig. 2 is a flow diagram of applying an observer color-mapping function to the image data in accordance with another embodiment of the first aspect.

Fig. 3 is a flow diagram of the spectral refinement iteration in accordance with another embodiment of the first aspect. Fig. 4 is a flow diagram of converting spectral image data to raw RGB image data in accordance with another embodiment of the first aspect.

Fig. 5 is a flow diagram of generating raw RGB image data in accordance with another embodiment of the first aspect.

Fig. 6 is a flow diagram of using raw RGB image data for the training of a deep learning model in accordance with another embodiment of the first aspect.

Fig. 7 illustrates in a flow diagram the overview of the proposed image signal processing method in accordance with another embodiment of the first aspect.

Fig. 8 shows a block diagram illustrating an example of a hardware configuration of a computer-based system in accordance with the second aspect.

DETAILED DESCRIPTION

Fig. 1 illustrates in a flow diagram the core steps of the image signal processing method in accordance with the first aspect.

The main object of the method is to invert the standard Image Signal Processor (ISP) pipeline of a sensor S that produces an image / of scene colors R under the illumination /. The problem of image formation under a global illumination can be expressed as the following ISP equation:

In this equation (x,y) is a spatial image of three color channels Red, Green, Blue (R,G,B) with characteristic sensor curves over the wavelengths A, whereby /, is a “RAW image” that corresponds to sensor readings at each pixel. If the spectral image R is available, then the image /, can be rendered for arbitrary illumination L and sensor S.

In a first step 101 , images are stored as image data IWEB in a memory 2. In an embodiment the images are downloaded from online image sources and stored in a storage device 4 before being loaded for temporary storage into the memory 2. In an embodiment the images are downloaded using a scraping method. The images found online typically use the RGB or standard (sRGB) color space where the colors are independent of the capturing device. In order to convert these images to more useful observer RGB space we need to perform two steps: RGB linearization and color space conversion.

For this purpose, in a next step 102 the image data IWEB is transferred and received in an image signal processor 3.

In a next step 103 the image data EB is transformed into linear RGB format. During this step of RGB linearization inverse gamma correction is applied to the image data. This is necessary because the sRGB color space for images used for display purposes are inherently Gamma corrected. However, for processing purposes it is better to use a linear RGB color space (lin- RGB) where the color values correspond to the radiation. For this purpose, we use the following inverse Gamma correction formula:

C < 0.04045

C > 0.04045

wherein C' represent R, G, and B values in sRGB and C expresses the corresponding linear values in lin-RGB.

In a next color space conversion step 104 an observer color-mapping function is applied to the image data IWEB whereby the chromacity coordinates Ct in a target tristimulus color space are calculated from chromacity coordinates c s of a source tristimulus color space (e.g. lin-RGB). In an embodiment the color space is fixed to a standard observer color space. In other possible embodiments other observers can be used, e.g. camera sensor characteristics.

In an embodiment, in a next step 105 inverse Auto White Balance (AWB) correction is applied to the image data IWEB. This step, although not compulsory, needs to be considered before the spectral matching as all the information need to be in a common color space. In another embodiment, the white balance is corrected later, e.g. during the spectral database calculations. Inverting it at this point results in eliminating the need to do it during the iteration steps. The inversion is done using the ISP equation with the known illuminant / and observer S. The colors of the scene R can be assumed to be perfectly flat, i.e. gray, and can be left out of the ISP equation. Therefore, the color channel response differences can be calculated and normalized. The normalization gains are the same as AWB gains that can be inverted at this stage. In a next step 106 the image data is transformed into a spectral matching color space, where luminance components L and chrominance components c are separated and where color differences can be measured using Euclidean distances. In an embodiment, this color space is the CIELAB color space with values defined as (L)aibi, where L refers to the luminance components and ai,bi refer to the chrominance components as three numerical values. However, in other possible embodiments other color spaces such as YUV, CIELUV, HSV can be used.

After the inverted imaging pipeline the input image is given as lciE-RGB,m(x,y) in the linear observer color space with a randomly selected illuminant m. All RG B values are then converted to the spectral matching color space using the previously calculated natural spectra color values in the same color space {Rdb, Gdb, Bdb}i,m.

In a next step 107, values of a natural spectrum l are provided in the same spectral matching color space as the image data is transformed into. In an embodiment these values are provided from a database 9 of natural spectra. In an embodiment the database 9 provides a dataset that covers the color gamut of natural scenes. In an embodiment, values of the natural spectrum l are provided using the Munsell Glossy database, whereby each spectrum is converted to an observer RG B space with all m illuminants using the ISP equation to represent the database of natural spectra db under typical illuminations {Rdb, Gdb, Bdb}i,m. In an embodiment m=100.

In a next spectral matching step 108, the image tristimulus values are matched with tristimulus values of different natural spectra in the tristimulus space. The luminance components L are omitted and color differences between the image and the natural spectrum l are measured as the Euclidean distances between their pairs of chrominance components c. In an embodiment, an interpolation is performed for the spectral matching, where each pixel color is reconstructed from a set of natural spectral responses according to the formula: wherein l(x,y) represents original image in the spectral domain, / represents the illuminant, wi represents the interpolation weights, and db represent the database of natural spectra under typical illuminations {Rdb, Gdb,Bdb}.

The interpolation weights wi are used in the spectral domain to reconstruct the spectrum of the color of each pixel in the image. After this stage, we have the original image in the spectral domain l(x, y; 4, L 1 ) where L 1 denotes what that spectrum holds for the l-th illuminant in the set of available illuminants.

The quality of the interpolated spectrum depends on the quality of the spectral database and accuracy of the matching technique. It is noteworthy that the Munsell Spectral database is sparse and therefore leads to discretization error.

A next spectral refinement step 109 is therefore introduced in the method for this purpose, which provides more accurate spectrums when compared to RBG values of the input image pixels by modifying the natural spectrum 4 in a sequence of iterative steps in order to reduce the Euclidean distances and to find a corresponding natural spectrum 4.

In a next step 1 10 the image data IWEB is converted to spectral image data ISPEC using the corresponding natural spectrum l that has been determined during the iterative steps of the spectral refinement 109.

The outcome of the inversion of the image signal processing pipeline is l(A)R(A) where the illuminant can be arbitrary selected from a set of standard illuminants with known spectral (A) characteristics. From l(A)R(A) IRAW can be generated for any sensor S(4) whose spectral characteristics are known.

Fig. 2 illustrates the steps of applying an observer color-mapping function to the image data

IWEB.

In a first step 1041 , given the chromacity coordinates c s of a source tristimulus color space (e.g. lin-RGB) the coordinates C t in a target tristimulus color space can be computed. In an embodiment this conversion is done using a conversion look-up table LUT. In another embodiment this conversion is done using a conversion matrix M using the formula: c t = Mc s

In an embodiment the size of the conversion matrix M is 3 x 3. In other possible embodiments the size of the conversion matrix M can be larger, e.g. 4 x 4, 5 x 5, 6 x 6 and so on.

In a next step 1042 the target color space is fixed to an observer color space for which we know the spectral sensitivity curves Sx CIE (A), SY CIE (A) and Sz CIE (A). An ideal ISP pipeline produces a device independent image where colors rendered by an ideal display correspond to the colors observed by humans (on average). In an embodiment, the average human is defined as the CIE 1931 Standard Observer in the standard RGB (sRGB) color space and thus the target color space is fixed to the CIE 1931 Standard Observer. In a next step 1043, a fixed number N c of colors is defined that cover the sRGB color gamut and for which their reflection spectra are available. In an embodiment the 24 standard colors according to the well-known ColorChecker Color Rendition Chart are used, where each of the 24 colors represents the actual color of natural objects and reflects light just like its real-world counterpart. For these ColorChecker colors their reflectance spectra R i=1 - 24 (A) are available. In other possible embodiments other color charts can be used, wherein the fixed number N c of colors is smaller, equals or is larger than 24.

For a fixed illuminant L k (A) the formula according to the ISP equation is used to construct the RGB values observed by a standard observer (Cl E) for color/ illuminated by the fixed illuminant k.

While the observer space can be fixed to the CIE 1931 Standard Observer and the colors to the 24 ColorChecker colors the choice of illuminant has important role in data augmentation for imaging, as the imaging algorithms should be robust to all illumination types.

Therefore, in a next step 1044 a number N L of illuminants / are selected for which natural spectra are available and whose distribution approximates the typical use cases (e.g. Outdoor: daylight; Indoor: Fluorescent and Tungsten; Flash: LED). In one embodiment the illuminants are selected from standard illuminants. In one embodiment the number M_=100. In further possible embodiments the number N L ranges from 10 to 1000, more preferably from 50 to 500.

A distribution of standard illuminants according to a possible embodiment is illustrated in Table 1 .

Table 1. Database of standard illuminants used in the proposed data augmentation.

In a next step 1045 one of the number N L of illuminants / is selected for each image. In one embodiment the selection is carried as a random selection. In another embodiment the selection based on information associated with the image, such as metadata or image data I WEB· It can be noted that this selection does not affect the results, even for illuminants that are far from the one actually present when the image was captured. However, in an embodiment, a conversion matrix M k is formed for each fixed illuminant k.

In a next step 1046 the conversion matrix M can be optimized by the following optimization: where i may refer to the 24 ColorChecker colors. The source and target RGB values (R S RGB, G S RGB,B S RGB) T and (RCIE, GCIE,BCIE) T can be computed using the know spectra of illuminants and the sRGB and CIELAB color spaces.

In one embodiment a gradient descent algorithm is used for optimizing the conversion matrix M, whereby each non-diagonal coefficient is optimized one by one. After going through all the coefficients, the optimization is started again until no improvement can be noticed anymore. This iteration-based approach is needed as local minima of the coefficients are correlated with each other. CIE Delta E * is used as the cost function of the algorithm.

The diagonal values are calculated right after each coefficient change in order to keep the sum of each row at 1 so as not to affect the white balance at this stage.

For the inverted imaging pipeline the RGB or sRGB values are thus replaced by lin-RGB values and M ~1 can be used to convert the lin-RGB values to the observer color space.

Fig. 3 illustrates the spectral refinement iteration that provides more accurate spectrums when compared to RBG values of the input image pixels. For this purpose of spectral refinement different algorithms can be applied but they easily lead to unnaturally peaky spectra that do not occur in nature.

In a next step 1091 an iterative algorithm is applied that minimizes the CIE RGB error by altering the interpolation spectra modulated by the CIE Standard Observer curves as follows: i e {ff , G , B}

wherein !(l) is a spectrum of the image to be optimized, where A represents the CIE Standard Observer curves, Sf IE represents the normalized weights based on the CIE Standard Observer curves, and c T and c s represent target RBG values and source RBG values respectively. This step is also justified by the fact that the observer curves represent human color perception which has been evolved to match the natural environment.

In a next step 1092 the iterative function is iteratively optimized until the error is for all R,G,B values fulfills the criteria:

\c[ - c \ < 0.00001

Fig. 4 illustrates the steps of converting spectral image data ISPEC to raw RGB image data IRAW.

In a first step 1 1 1 , after the image data IWEB is converted to spectral image data ISPEC, the image brightness level for each pixel is matched by simple multiplication in the spectral domain.

In a next step 1 12 the spectral image data ISPEC IS converted to raw RGB image data / R eusing camera characterization information regarding spatial spectral response of a camera sensor S. In this step spectral image data ISPEC associated with one spectral image can be used to generate raw RGB image data fo A wtor multiple raw RGB images IRAW 1 to IRAW N using camera characterization information of spatial spectral responses of multiple camera sensors S 1 to S N .

In an embodiment the camera characterization information is gained from spatial spectral measurement of a camera sensor. For example, in an embodiment, a Labsphere QES-1000 device can be used to measure the spectral response of a mobile camera (such as the camera of the Huawei P20 smartphone) that supports RAW image output, which is needed in order to get accurate results. The spectral measurement device can measure the spectrum in the range of 380 to 1 100nm with 1 nm steps. For saving storage space and processing time, in an embodiment a range of 400 to 700nm is used with 5nm steps for all the calculations. In order to reduce the noise in the measurements in an embodiment 50x50 pixel areas for each color channel are averaged when calculating the spatial spectral grid. In an embodiment odd numbers of columns and rows are used to get one point at the image center. In a particularly advantageous embodiment this results in a grid of 59x79 points.

Fig. 5 illustrates the sequence of steps for generating raw RGB image data IRAW { 1 12).

In a first step 1 121 , the response of the camera sensor, the selected illuminant and the image reflectance spectrums are combined together at each spatial location according to the ISP equation to get the R,G,B responses. It is important to use the same illuminant that was used for converting the RBG image IWEB to a spectral image ISPEC to avoid color casts on the images.

In an embodiment the data ranges are defined for this step by setting the highest value to maximum of the data range. However, this can then result in similar exposures in all images which is not that realistic. Therefore, in another preferred embodiment a random multiplier between [0.6, 1.4] is introduced to the images, thereby causing some images to be underexposed and some overexposed with clipped highlights.

In a next step 1122, the ideal AWB correction gains are calculated by multiplying the camera response at the center together with the illuminant / and summarizing the results for R,G,B channels separately. This step gives the relative sensitivity of the color channels under gray color. The AWB gains can be calculated as follows:

In a next step 1123, the color shading and vignetting parameters are calculated by multiplying the spatial camera response together with the illuminant and summarizing the results for R,G,B channels separately, then applying the AWB gains and normalizing the responses at the image center. The min(R,G,B) values at each pixel location represent the vignetting, whereby color shading is the ratio of the color channel against the minimum response at the pixel location (x,y) according to the formula: where C is the value of either R, G or B.

In a next, optional step 1124, the vignetting correction can be applied to the image. The correction is simply the inverse of the calculated vignetting parameters.

In an embodiment, where the reference datasets are captured with DSLRs having very little vignetting the vignetting, correction can be applied right after calculating the RGB color response of each pixel 1 121. This way the vignetting correction does not have to be learned for the following steps.

In a next step 1 125, the accurate AWB and color shading correction values are applied to the image, thus resulting in getting all the remaining combinations of input and output training pairs.

Fig. 6 illustrates the steps of using raw RGB image data IRAW generated in step 112 described above as input for the training 113 of a deep learning model DL. The deep learning model DL is configured to apply automatic image signal processing function to input image data. The signal processing function can be either Auto White Balance (AWB) correction or Color Shading Correction (CSC).

Fig. 7 illustrates an overview of the proposed image signal processing method that takes arbitrary RGB images from a computer network 10 (e.g. images downloaded from online sources) as input image data IWEB 102 and converts them first to spectral image data ISPEC 1 10 then to raw RGB image data 1 12. The output image pairs of these steps can then be used in data augmentation for training input data in a deep learning model DL 1 13, which model can be used for automatic processing of tasks such as Auto White Balance correction or Color Shading Correction.

The proposed method provides full control over the important scene, lens and camera parameters to“hallucinate” raw sensor images of a virtual camera that approximates any known sensor. The generated data can be used to train deep models of the standard algorithms needed in modern image signal processors (ISPs) as it enables to simulate ground truth images.

Fig. 8 shows a block diagram illustrating an example of a hardware configuration of a computer-based system 1 in accordance with the second aspect. Steps and features that are the same or similar to corresponding steps and features previously described or shown herein are denoted by the same reference numeral as previously used for simplicity.

The computer-based system 1 may be connected to a database 9 configured for storing data of natural spectra, wherein the type of connection between the two can be direct or indirect, as will be described below.

The computer-based system 1 may comprise an Image Signal Processor (ISP) 12 configured for receiving image data IWEB as an input and for performing image data processing based on software-based instructions, a storage medium (HDD) 13 (HDD) for storing data to be processed and software-based instructions to be executed by the ISP 12, and a memory (RAM) configured for (temporarily) storing image data IWEB of an image in RGB format.

The computer-based system 1 may also comprise an input device (IN) 5 for receiving input from a user, an output device (OUT) 6 such as an electronic display for conveying information to a user, and a communication interface (COMM) 7 for communicating with external devices directly, or indirectly via a computer network 10.

The mentioned hardware elements within the computer-based system 1 may be connected via an internal bus 8 configured for handling data communication and processing operations. In one embodiment the computer-based system 1 and the database 9 are both included in the same physical device, connected via the internal bus 8.

In another embodiment the computer-based system 1 and the database 9 are, or are part of, physically different devices, and are connected via the communication interface (COMM) 7 either directly, or indirectly via a computer network 10.

The various aspects and implementations have been described in conjunction with various embodiments herein. However, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed subject-matter, from a study of the drawings, the disclosure, and the appended claims. In the claims, the word “comprising” does not exclude other elements or steps, and the indefinite article“a” or“an” does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measured cannot be used to advantage. A computer program may be stored/distributed on a suitable medium, such as an optical storage medium or a solid-state medium supplied together with or as part of other hardware, but may also be distributed in other forms, such as via the Internet or other wired or wireless telecommunication systems.

The reference signs used in the claims shall not be construed as limiting the scope. VALIDATION TEST RESULTS

To validate the proposed inverted imaging pipeline method we conducted a validation check with 1 ,000 randomly selected Openlmages images that were first transformed to the spectral domain using the method and then transformed back using the forward pipeline. After the backward-forward process we computed the mean, median, maximum and 99% percentile errors between the original and backward-forward processed pixels in all the images. The numbers were 0.0016, 0.0003, 1.7795 and 0.0198 reported as the color chromacity error, respectively.

In the color theory literature an error smaller than 1.0 is considered negligible. Thus, the errors are so small that they are not noticeable by a human. However, we also recognize that some of the optimized spectrums could be more natural in shape. The unnaturalness happened when there were zero values in the original input pixels. The spectral optimization routine in that case forced some of the related wavelengths to an absolute zero causing less natural spectral shapes. This can be improved by adding even a very small offset to the input image data but that in effect causes the error numbers to increase. In practice it is possible to tune the offset value between naturalness and numerical accuracy depending on the use case. An empirically estimated good range for the offset is [0, 10 4 ]. We used 10 6 in all of the presented calculations. The two datasets used for the color constancy experiments are Shi-Gehler (568 images, 2 cameras) and NUS (1 ,853 images, 9 cameras) for which we conducted cross dataset evaluation that tests, as well as generalization of the methods which is a very important consideration with deep learning methods. Training data is generated using the proposed method and by selecting images randomly from the recently published Google Openlmages dataset.

Table 2. Cross-dataset color constancy performance for the NUS dataset. The last column is the proportion of test images for which a sufficient accuracy (angular error < 3.0 ° ) was achieved.