Patent Publication Number: US-7586642-B2

Title: Color-space transformation-matrix calculating system and calculating method

Description:
BACKGROUND OF THE INVENTION 
   1. Field of the Invention 
   The present invention relates to a color adjusting method that optimizes color signals to improve the reproduction of a color image of an object. Further, the present invention relates to a color-space transformation-matrix calculation method that optimizes matrix elements for adjusting color signals. 
   2. Description of the Related Art 
   In recent years, it has become popular to digitalize images for convenience of transmitting the image information precisely between different types of devices. For example, an image input device, such as a digital camera, an image scanner, and so on, transform color images of an object to signals representing the three primary colors, such as RGB signals, and then output the signals to an image output device, such as a monitor, a printer, and the like. Generally, the image output device reproduces the color image in accordance with the RGB signals, i.e. indicating an image on a screen or printing out an image on paper. The RGB signals obtained by the image input device depend on the characteristics of the optical system of the photographing lens, color filter, imaging device, and so on. Further, the images reproduced by the image output device are also different from one another in regard to how they are reproduced even when the same RGB signals are supplied. Furthermore, the characteristics of the image input device and the image output device are different, since each device has peculiar characteristics. Therefore the reproduction of a color image based on the RGB signals is disadvantageous for reproducing the original color of the object. Therefore, the RGB signal based method is poor for reproducing precise color. 
   Accordingly, color signals based on the sRGB standard which is a standard for the image input devices and image output devices, is generally used these days. The image input device outputs color signals after transforming the obtained RGB signals to signals based on the sRGB standard. Thereby, precise color reproduction is performed as long as the image output devices are comparable with the sRGB standard. Namely, tints quite similar to the original object can be reproduced. A variety of methods for performing color adjustment are known in the art. For example, the reproduced color is converted to the original color by adjusting the spectrum characteristics of an optical filter, provided in an imaging system, to the sRGB standard or by transforming the RGB signals electronically by a matrix transformation. 
   Conventionally, multiple linear regression analysis is used to improve the accuracy of color transformation methods that use a color space transformation matrix for electronic color adjustment. The multiple linear regression analysis optimizes the matrix elements by a statistical analysis which considers the relation between the original color and the reproduced color as a cause and effect relation. Namely, the matrix elements are obtained by optimizing these elements under the condition that the difference between the signal levels of the predicted reproduced colors, which is obtained by performing a provisional color space transformation matrix operation on the RGB signals from the imaging system, and the signal levels of the original colors, is below or equal to a permissible value. For example, a method that uses multiple linear regression analysis to provide a matrix that transforms RGB signals to XYZ signals of a different calorimetric system, is disclosed in the Japanese unexamined patent publication (KOKAI) No. 10-164381. 
   The degree of coincidence between the reproduced colors and the original color is generally evaluated by using three elements that are based on the human physiological color sense, such as hue, saturation, and lightness. Particularly, the difference in hue tends to be sensed as a difference in tint by a person. However, the relations between the RGB signals and the hue are not linear relations, therefore, the evaluation of accuracy for the above discussed multiple linear regression analysis is difficult. Namely, even when the difference between the signal levels of the RGB signals and the signal levels of the original color is within the permissible range, the difference in the hue might be such that the colors are regarded as different colors by a person. 
   SUMMARY OF THE INVENTION 
   Therefore, an object of the present invention is to provide a color space transformation matrix that has the advantage of accurately reproducing an original color, particularly in regard to hue. 
   According to the present invention, a color space transformation matrix calculating system that optimizes a color space transformation matrix is provided. The color space transformation matrix is a matrix for transforming a color in a first color space to a color in a second color space and is a product of a first matrix and a second matrix. Further, the system comprises a first and second optimizer. 
   The first and second optimizers calculate elements of the first and second matrices by multiple linear regression analysis. Input colors in the first color space, which correspond to a plurality of color patches, are set as first explanatory variables. First goal colors that relate to hue in a second color space and which correspond to the color patches are set as first criterion variables. Further, the elements of the first matrix are set as partial regression coefficients. Saturation and hue for each of the color patches differ slightly from each other. Further, a second optimizer calculates elements of a second matrix by multiple linear regression analysis. Hue corrected colors obtained by using the first matrix and the input colors in the first color space are set as second explanatory variables. Second goal colors that relate to saturation in a second color space and which correspond to the color patches are set as second criterion variables. The elements of the second matrix are set as partial regression coefficients. 
   Further, a method for calculating and optimizing a color space transformation matrix is provided. The color space transformation matrix transforms colors in a first color space to colors in a second color space. The method comprises steps of optimizing elements of first and second matrices by using multiple linear regression analysis. 
   To optimize the elements of the first matrix, input colors in the first color space, which correspond to a plurality of color patches, are set as first explanatory variables. First goal colors that relate to hue in a second color space and which correspond to the plurality of color patches are set as first criterion variables. The elements of the first matrix are set as partial regression coefficients. 
   Further, to optimize the elements of the second matrix by using multiple linear regression analysis, hue corrected colors obtained by using the first matrix and the input colors in the first color space are set as second explanatory variables. Second goal colors that relate to saturation in a second color space and which correspond to the plurality of color patches are set as second criterion variables. Further, the elements of the second matrix are set as partial regression coefficients. 
   Further still, according to the present invention, a color space transformation matrix calculating system that comprises a matrix optimizer is provided. 
   The matrix optimizer calculates elements of the color space transformation matrix, by using the least square method, and based on input colors in the first color space and goal colors in the second color space. The input and goal colors correspond to colors of the color patches. Saturation and hue for each of the color patches differ slightly from each other. 
   Furthermore, according to the present invention, a method for calculating a color space transformation matrix is provided that optimizes elements of the color space transformation matrix, by using the least square method, and based on input colors in the first color space and goal colors in the second color space. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The objects and advantages of the present invention will be better understood from the following description, with reference to the accompanying drawings in which: 
       FIG. 1  schematically illustrates how the color space transformation matrix is calculated and a method for a color transformation, in the first embodiment; 
       FIG. 2  illustrates the CIE-L*a*b* color space where the illuminating light source is the standard light of CIE-D 65 , which represents day light of 6504 K color temperature; 
       FIG. 3  is a block diagram schematically showing the processes that are carried out in the color space transformation matrix calculating process and the relations between each of the color signals; 
       FIGS. 4A-4C  are flow charts of the color space transformation calculating processes; 
       FIG. 5  illustrates the L*a*b* color space with the light source illuminating a standard light of CIE-D 65  for the second embodiment; 
       FIG. 6  is a block diagram schematically showing the processes that are carried out in the color space transformation matrix calculating process and the relations between each of the color signals; and 
       FIGS. 7A-7C  are flow charts of the color space transformation calculating processes for the second embodiment. 
   

   DESCRIPTION OF THE PREFERRED EMBODIMENTS 
   The present invention is described below with reference to the embodiments shown in the drawings. 
     FIG. 1  schematically illustrates a first embodiment and shows how the color space transformation matrix is calculated and the method for color transformation, in the present embodiment. 
   The digital still camera  10  is an example of an image input device that captures a full color image of an object by using an imaging device. The digital still camera  10  includes an imaging optical system  12  and an imaging device, such as a CCD  14 . The CCD  14 , for example, is provided with an RGB color chip filter  16  which is mounted in front of the imaging surface of the CCD  14 . An optical image produced on the imaging device, through the imaging optical system  12 , is subjected to photoelectrical conversion by the CCD  14  and output therefrom as analog signals. The output analog signals are then subjected to analog signal processes and A/D conversion. Thereby the digital image signals are fed to a digital signal processor  20  as one frame of RAW data. 
   The digital signal processor  20 , carries out a color separation process, a white balance adjusting process, a color adjusting process, and a gradation adjusting process, in order, and generates the sRGB signals in the second color space. The color separation process generates RGB signals from the RAW data for each pixel. The white balance adjusting process optimizes each of the R, G, and B gains in accordance with the standard white signal values. The color adjusting process transforms the color gamut of the primary RGB signals in the first color space to the gamut defined by the sRGB standard in order to bring the reproduced colors close to the objective colors (ex. the original color of the object). The gradation adjusting process optimizes the gradation to counterbalance the gamma characteristics of the monitor  30 . The digital signal processor  20  is able to transmit the sRGB signals to external devices, including an image output device, such as the monitor  30  (CRT or LCD) connected to a personal computer, a printer (not depicted), and so on, via an interface (not depicted). 
   The sRGB signals are signals that are based on the international standard for color reproduction that was standardized by IEC. Further, in the sRGB standard, the color reproduction and gamut are prescribed based on the standard CRT monitor. In this case, the prescribed standard white values for the white balance adjusting process is preset to CIE-D 65 . Further, the gamut of the RGB signals is adjusted to a prescribed gamut by the color adjusting process and the gamma value is preset as 2.2 in the gradation adjusting process. 
   In the digital signal processor  20 , the signal processing is carried out based on the sRGB standard. However, devices having characteristics matching the sRGB standard are not always used by the imaging system (including the imaging optical system  12 , CCD 14 , RGB color chip filter  16 , etc.). Therefore, the color information of the object obtained by this system is not precisely adjusted to the sRGB standard and the reproduced colors do not coincide with the original colors. Although, various types of optical compensating techniques have been applied to compensate for the sensitivity characteristics of the imaging system, regarding the sRGB standard, they are not sufficient to achieve the complete coincidence, and in fact, the attainment of complete coincidence is extremely difficult. Therefore, the discrepancy in the characteristics of the imaging system regarding the sRGB standard may be compensated for by electronically adjusting the signal level of the RGB signals obtained by the imaging system. However, the sensitivity characteristics of the imaging system are peculiar to each digital still camera, and are different from each other. Therefore, it is impossible to logically define the relationship between the original color information of the object and the color information obtained by the digital still camera  10 , since they do not have any regular relationship, so that the signal processing should include processes that are peculiar to each of the colors. When each of the R, G, and B signals is represented by 8-bit data, the number of colors will become (2 8 ) 3 =167777216, thus it is impractical to carry out optimum color adjusting processes for all the colors. 
   Consequently, a color space transformation matrix is previously calculated and preset in the digital still camera. The color space transformation matrix is obtained by using a color chart having a plurality of color samples where the saturation and hue are phased, such as the Macbeth color checker 40 (registered trademark) having 24 color patches P 1 -P 24  as described in  FIG. 1 , where only part of the color patches are numbered for convenience. Namely, the elements of the matrix are defined so that the RGB signals of the color patches, obtained by the digital still camera  10 , coincide with the corresponding RGB signals obtained by a calorimeter. The colors of the color patches are accurately determined by the calorimeter. Further, the color chart must be imaged by the digital still camera  10  under the same illumination conditions adopted in the color determination carried out by the calorimeter. When the object is imaged, the color adjusting process performed by the digital signal processor  20  is carried out by applying the above-obtained color space transformation matrix. Thereby, high fidelity color reproduction can be achieved regarding the values obtained by the calorimeter. 
   The color space transformation matrix may be obtained by an externally provided color space transformation-matrix calculating device or matrix generator  34 , such as a personal computer, and may be initially stored in a memory  22  of the digital still camera  10 . The digital still camera  10  transmits the RAW data, which are obtained by means of imaging the Macbeth color checker 40, to the matrix generator  34  from the digital signal processor  20 . The color space transformation matrix is a 3×3 matrix that is determined at the final stage of the manufacturing processes of the digital still camera  10 , in cooperation with the matrix generator  34 , where the nine matrix elements of the matrix are determined depending on the spectral sensitivity characteristics of the individual imaging system mounted in each digital still camera  10   
   The relations between the input RGB signals C in  (R in , G in , B in ) and the output RGB signals C es  (R es , G es , B es ) can be described by a linear equation, such as Eq. (1), where “C in ” denotes an input color which is given by the RAW data, “M” denotes the color space transformation matrix, and “C es ” denotes a corrected color which is obtained by using the color transformation matrix M for the input color C in . Further, the below Eq. (2) describes Eq. (1) by using the matrix elements, where variables m 1 -m 9  are the matrix elements of the color space transformation matrix M.
 
 Ces=M·Cin   (1)
 
   
     
       
         
           
             
               
                 
                   ( 
                   
                     
                       
                         
                           R 
                           es 
                         
                       
                     
                     
                       
                         
                           G 
                           es 
                         
                       
                     
                     
                       
                         
                           B 
                           es 
                         
                       
                     
                   
                   ) 
                 
                 = 
                 
                   
                     ( 
                     
                       
                         
                           
                             m 
                             1 
                           
                         
                         
                           
                             m 
                             2 
                           
                         
                         
                           
                             m 
                             3 
                           
                         
                       
                       
                         
                           
                             m 
                             4 
                           
                         
                         
                           
                             m 
                             5 
                           
                         
                         
                           
                             m 
                             6 
                           
                         
                       
                       
                         
                           
                             m 
                             7 
                           
                         
                         
                           
                             m 
                             8 
                           
                         
                         
                           
                             m 
                             9 
                           
                         
                       
                     
                     ) 
                   
                   ⁢ 
                   
                     ( 
                     
                       
                         
                           
                             R 
                             in 
                           
                         
                       
                       
                         
                           
                             G 
                             in 
                           
                         
                       
                       
                         
                           
                             B 
                             in 
                           
                         
                       
                     
                     ) 
                   
                 
               
             
             
               
                 ( 
                 2 
                 ) 
               
             
           
         
       
     
   
   Note that, since the purpose of the present embodiment is to achieve precise color reproduction, the objective values or goals that are set for calculating the color space transformation matrix M are preset to the colorimetric values of the color patches P 1 -P 24 . However, when it is desirable to reproduce particular colors, such as human skin color or a blue-sky color, as preferred colors and not the precise colors, the values which are obtained by matching the calorimetric values with reference to the particular colors, may be preset as the objective values. Further, the RGB signals given by the calorimetric values can be directly obtained by measuring the levels of each of the R, G, and B signals with a color-measuring instrument. Further, the spectral reflectance may be measured by a spectrophotometer, or the color-measuring instrument may obtain XYZ signals or L*a*B* signals, which are for systems other than the RGB color system. In these cases, the spectral reflectance, the XYZ signals, and L*a*b* signals may be converted to the RGB signals. 
   Since the Macbeth color checker 40 is a ready-made item in the market, it is easy to obtain. Further, since the calorimetric values of the patches P 1 -P 24  are already known, it can save time and expense for the calorimetric operations. For example, the colorimetric signals or values of the first color patch P 1  (dark skin) are x=0.4002, y=0.3504, and Y=10.05, and they can be transformed to RGB signals by using the well-known formula, where x=X/(X+Y+Z), y=Y/(X+Y+Z) and X, Y, and Z are the tristimulus values of the XYZ color system. The first to eighteenth color patches P 1 -P 18  are chromatic colors and the nineteenth to twenty-fourth color patches P 19 -P 24 , in the lowest line, are achromatic colors. 
   The color chart is not restricted to the Macbeth color checker chart described in the present embodiment, but can also be a color chart of which color patches are distributed uniformly over a uniform color space, such as the JIS standard color chart. The color space transformation matrix obtained based on the Macbeth color checker 40 can precisely reproduce the colors corresponding to each of the color patches P 1 -P 24 , however, it does not guarantee the precise reproduction of other colors. Therefore, when a peculiar color chart that includes the specific colors (human skin color, blue sky color, and verdure color), which may appear frequently in photography, is prepared and used, these specific colors can be reproduced with fidelity. 
   With reference to  FIG. 2  and  FIG. 3 , the calculation of the color space transformation matrix will be explained. In  FIG. 2 , the CIE-L*a*b* color space (in the following, simply referred to as Lab color space) is depicted, where the light source illuminates a standard light of CIE-D65, which represents day light of 6504 K color temperature. A color that corresponds to an input color C in  and an objective color C me  (hereinafter, referred to as a goal color), to which the input color should be adjusted, are indicated as respective points in this Lab color space. The L*a*b* signals of the goal color C me  are preset to the values that are obtained by the calorimeter.  FIG. 3  is a block diagram schematically showing the processes being carried out in the color space transformation matrix calculating process and the relations between each of the color signals. 
   In the matrix operations, colors are dealt with in the same way as RGB signals. However, L*a*b* signals are used to evaluate the coincidence between the colors. This is because the Lab color space is a uniform color space that has good correlation with the human color perception with respect to distance of the coordinates. Any color can be represented by the L* dimension relating to lightness, and the two remaining dimensions, a* and b*, relating to hue and saturation. The lightness dimension L* indicates lightness by the dimension from 0%, which corresponds to black, to 100%, which corresponds to white. The hue is indicated by an angle in the a*b*-plane, orthogonal to L* with respect to the origin, such that it is within the range from 0° to 360°. As a positive value along the a* axis increases, red is enhanced, and opposite to this, as a negative value increases, green is enhanced. Further, as a positive value along the b* axis increases, yellow is enhanced, and opposite to this, as a negative value increases, blue is enhanced. Namely, the saturation increases as the radius from the origin increases, and a color becomes more vivid. At the origin, it is achromatic. 
   The transformation from RGB signals to L*a*b* signals is performed using the following well known Eqs. (3) and (4). Eq. (3) is a formula to transform the RGB signals to the XYZ signals. Eq. (4) is a formula to transform the XYZ signals to the L*a*b* signals. When evaluating the coincidence of colors, the RGB signals are transformed to the L*a*b* signals via the XYZ signals. On the other hand, when operating the matrix, the L*a*b* signals are again transformed to the RGB signals via the XYZ signals. The transformations from the L*a*b* signals to the RGB signals are carried out by using the inverse transformations of Eqs. (3) and (4), however they are not specified here. 
                   (         X           Y           Z         )     =       (         0.4124       0.3576       0.1805           0.2126       0.7152       0.0722           0.0193       0.1192       0.9505         )     ⁢     (         R           G           B         )               (   3   )               
where, a viewing angle of a standard observer is 2° and the standard CIE-D65 illumination is used.
 
                         L   *     =       116   ×     f   ⁡     (   Y   )         -   16                   a   *     =     500   ×     {       f   ⁡     (   X   )       -     f   ⁡     (   Y   )         }                     b   *     =     200   ×     {       f   ⁡     (   Y   )       -     f   ⁡     (   Z   )         }                     (   4   )               
where
   f ( X )= X   1/3  when  X/ 95.047≦0.008856,   f ( X )=7.787 X+ 16/116 when 0.008856&lt; X/ 95.047,   f ( Y )= Y   1/3  when  Y/ 100.000≦0.008856,   f ( Y )=7.787 Y+ 16/116 when 0.008856&lt; Y/ 100.000,   f ( Z )= Z   1/3  when  Z/ 108.883≦0.008856, and   f ( Z )=7.787 Z+ 16/116 when 0.008856&lt; Z/ 108.883. 
   In the present embodiment, the color space transformation matrix M is optimized, so that the hues of the corrected colors C es  obtained from the input colors C in , which relate to the eighteen colors of the color patches P 1 -P 18 , coincide with those of the corresponding respective goal colors C me , and then the optimization regarding the saturation is performed. The degree of coincidence between the corrected color C es  and the goal color C me  is estimated in the Lab color space, in accordance with the difference between the hue angle θ es  of the corrected color C es  and the hue angle θ ms  of the goal color C me . Hue angle θ (such as θ es  and θ ms ) is a rotating angle of a point, which is obtained by projecting each point in the three-dimensional Lab color space onto the a*b*-plane, about the origin measured from the a*-axis, and is defined by Eq. (5). The hue angles θ es  and θ ms  are respectively obtained by substituting the a* coordinate value and the b* coordinate value of the corrected color C es  and the goal color C me  into Eq. (5). In the present embodiment, the coincidence of the hue has priority, since a difference in the hue is more easily recognized as a difference in the color, when compared to a difference in saturation, due to the nature of human perception. 
   
     
       
         
           
             
               
                 θ 
                 = 
                 
                   
                     tan 
                     
                       - 
                       1 
                     
                   
                   ⁡ 
                   
                     ( 
                     
                       
                         b 
                         * 
                       
                       
                         a 
                         * 
                       
                     
                     ) 
                   
                 
               
             
             
               
                 ( 
                 5 
                 ) 
               
             
           
         
       
     
   
   An input color C in  is orthogonally projected onto a line L that connects the origin and a goal color C me  in the Lab color space and the color of the projected point is set as a hue optimizing goal color C me ′ in order to adjust the hue. The transformations from the L*a*b* signals of the hue optimizing goal color C me ′ to the RGB signals via the XYZ signals are then carried out for all eighteen colors, so that a hue-optimizing matrix M_hue (the first matrix) which matches each of the input colors C in , corresponding to the eighteen colors, with the corresponding hue optimizing goal colors C me ′, is obtained by means of multiple linear regression analysis. The RGB signals of the hue optimizing goal color C me ′ are the primary goal color signals which relate to the hue. The line L is a set of points corresponding to colors having a hue which is identical to that of the goal color C me . The hue optimizing goal color C me ′, where the input color C in  is orthogonally projected onto the line L, is a color which has the same hue as the goal C me  and which is nearest to the input color C in  in the Lab color space. Namely, the hue can be adjusted by the minimum distance in the Lab color space when setting the hue optimizing goal color C me ′ as the goal color. Note that, in  FIG. 2 , only one color is depicted as a representative color. The hue corrected colors C es ′, obtained by using the hue-optimizing matrix M_hue on each of the input colors C in , substantially coincide with the corresponding hue optimizing goal colors C me ′. 
   A saturation-optimizing matrix M_sat (the second matrix) which is used to match each of the hue-corrected colors C es ′, corresponding to the eighteen colors, to the corresponding goal colors C me , is obtained by means of multiple linear regression analysis to adjust the saturation. The RGB signals of the goal color C me  are the secondary goal color signals relating to saturation. The corrected colors C es , obtained by using the saturation-optimizing matrix M_sat for each of the hue corrected colors C es ′, substantially coincide with the corresponding goal colors C me . 
   The color space transformation matrix M for transforming the input color C in  to the corrected color C es  is obtained by the product of the hue-optimizing matrix M_hue, which approximates hue for the goal color C me , and the saturation-optimizing matrix M_sat, which approximates saturation for the goal color C me , as described in the following Eq. (6). The formula equivalent to Eq. (6) using matrix elements is indicated by Eq. (7). Where, variables m′ 1 -m′ 9  are the matrix elements of the hue-optimizing matrix M_hue and variables m′ 1 -m′ 9  are the matrix elements of the saturation-optimizing matrix M_sat.
 
 M=M _sat· M _hue  (6)
 
   
     
       
         
           
             
               
                 
                   ( 
                   
                     
                       
                         
                           m 
                           1 
                         
                       
                       
                         
                           m 
                           2 
                         
                       
                       
                         
                           m 
                           3 
                         
                       
                     
                     
                       
                         
                           m 
                           4 
                         
                       
                       
                         
                           m 
                           5 
                         
                       
                       
                         
                           m 
                           6 
                         
                       
                     
                     
                       
                         
                           m 
                           7 
                         
                       
                       
                         
                           m 
                           8 
                         
                       
                       
                         
                           m 
                           9 
                         
                       
                     
                   
                   ) 
                 
                 = 
                 
                   
                     ( 
                     
                       
                         
                           
                             m 
                             1 
                             ″ 
                           
                         
                         
                           
                             m 
                             2 
                             ″ 
                           
                         
                         
                           
                             m 
                             3 
                             ″ 
                           
                         
                       
                       
                         
                           
                             m 
                             4 
                             ″ 
                           
                         
                         
                           
                             m 
                             5 
                             ″ 
                           
                         
                         
                           
                             m 
                             6 
                             ″ 
                           
                         
                       
                       
                         
                           
                             m 
                             7 
                             ″ 
                           
                         
                         
                           
                             m 
                             8 
                             ″ 
                           
                         
                         
                           
                             m 
                             9 
                             ″ 
                           
                         
                       
                     
                     ) 
                   
                   ⁢ 
                   
                     ( 
                     
                       
                         
                           
                             m 
                             1 
                             ′ 
                           
                         
                         
                           
                             m 
                             2 
                             ′ 
                           
                         
                         
                           
                             m 
                             3 
                             ′ 
                           
                         
                       
                       
                         
                           
                             m 
                             4 
                             ′ 
                           
                         
                         
                           
                             m 
                             5 
                             ′ 
                           
                         
                         
                           
                             m 
                             6 
                             ′ 
                           
                         
                       
                       
                         
                           
                             m 
                             7 
                             ′ 
                           
                         
                         
                           
                             m 
                             8 
                             ′ 
                           
                         
                         
                           
                             m 
                             9 
                             ′ 
                           
                         
                       
                     
                     ) 
                   
                 
               
             
             
               
                 ( 
                 7 
                 ) 
               
             
           
         
       
     
   
   Namely, the transformation of the input color C in  to the corrected color C es  by using the color space transformation matrix M is achieved by carrying out the saturation optimization process after carrying out the hue optimization process, to match the input color C in  to the corrected color C es  (refer to Eq. (8)). 
   
     
       
         
           
             
               
                 
                   
                     
                       Ces 
                       = 
                       
                         M 
                         · 
                         
                           C 
                           in 
                         
                       
                     
                   
                 
                 
                   
                     
                       = 
                       
                         
                           ( 
                           
                             M_sat 
                             · 
                             M_hue 
                           
                           ) 
                         
                         · 
                         
                           C 
                           in 
                         
                       
                     
                   
                 
                 
                   
                     
                       = 
                       
                         M_sat 
                         · 
                         
                           ( 
                           
                             M_hue 
                             · 
                             
                               C 
                               in 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 
                   
                     
                       = 
                       
                         M_sat 
                         · 
                         
                           C 
                           es 
                           ′ 
                         
                       
                     
                   
                 
               
             
             
               
                 ( 
                 8 
                 ) 
               
             
           
         
       
     
   
   Next, with reference to the flow charts of  FIGS. 4A to 4C , the color space transformation calculating process is explained in detail. 
   In Step S 102 , the Macbeth color checker 40 having twenty-four colors of color patches P 1 -P 24  is prepared. These twenty-four colors, color patches P 1 -P 24 , are imaged by the digital still camera  10  under the illumination condition of CIE-D 65 , and then the RAW data obtained by the preceding photographing operations are transmitted to the matrix generator  34 . 
   The matrix generator  34  obtains the RGB signals of the input colors C in , which correspond to the eighteen chromatic color patches P 1 -P 18 , in accordance with the RAW data (Step S 104 ). Here, to discriminate color data corresponding to each of the chromatic color patches P 1 -P 18 , parameters i (i=1,2, . . . ,18) indicating the order of the chromatic color patches P 1 -P 18  are defined. Further, the input color corresponding to the i-th color patch P i  is represented by C in (i) and its RGB signals are represented by (R in (i), G in (i), B in (i)). The RGB signals (R in (i), G in (i), B in (i)) of the input color C in (i) are the mean values (hereinafter, referred to as RGB mean values) of each of the RGB signals for the 30×30 pixels selected from the imaging area corresponding to the color patch P i , and are 8-bit data. To secure the reliability of the RGB mean values, defect pixels are excluded from the 30×30 pixels. Note that for the RGB signals, (R in (i), G in (i), B in (i)) 10-bit data, 12-bit data, and so on, can be used. 
   The 19th to 24th color patches P 19 -P 24  of the Macbeth color checker 40 are achromatic colors in six steps. In detail, the 19th color patch P 19  is white, the 20th color patch P 20  is gray 8, the 21st color patch P 21  is gray 6.5, the 22nd color patch P 22  is gray 5, the 23rd color patch P 23  is gray 3.5, and the 24th color patch P 24  is black. 
   These six color patches P 19 -P 24 , the achromatic colors, are used to adjust the gray scale. Specifically, the RGB mean values are obtained form 30×30 pixels that are selected from the imaging area corresponding to each of the color patches P 19 -P 24 , and in turn offset values for each of the R, G, and B colors are obtained so as to minimize the difference between the RGB mean values of the six achromatic color patches P 19 -P 24  and each of the corresponding goal values (e.g. calorimetric signals) Prior to the acquisition of the RGB signals (R in (i), G in (i), B in (i)) of the input color C in (i) for the chromatic color patches Pi (i=1,2, . . . , 18) in step S 104 , each of the offset values are deducted from the R, G, and B signals of the RAW data, so that the white and black levels for the image are adjusted, and at the same time, the gray scale is adjusted to the appropriate level. Note that, the gray scale or tone is normalized by γ=1.0. 
   Further, the six achromatic color patches P 19 - 24  are also used in the white balance correction, such that the R, G, and B gains are defined based on the RGB mean values of each of the achromatic color patches P 19 -P 24  from the RAW data, and thereby the RGB mean values of the eighteen chromatic color patches P 1 -P 18  are obtained under the corrected gains. 
   Therefore, the RGB signals (R in (i), G in (i), B in (i)) of the input color C in (i) for the eighteen chromatic color patches Pi (i=1, 2, . . . , 18) obtained in step S 104  have already been subjected to the gray scale correction and the white balance correction, and are normalized by γ=1.0. 
   Further, in step S 106 , the colorimetric signals (RGB signals) of the eighteen color patches P 1 -P 18 , which are already known, are input to the matrix generator  34 . Note that, when the input data are not RGB signals, such as XYZ signals, L*a*b* signals, or spectral reflectance signals, they are transformed to the RGB signals by well-known formulations. Further, when the colorimetric signals are unknown, the color patches P 1 -P 18  are measured under the same illumination condition as the above imaging, prior to step S 106 . 
   In step S 108 , the goal color of the i-th (i=1,2, . . . , 18) color patch P i  is defined as C me (i) and its RGB signals are defined as (R me (i), G me (i), B me (i)). Further, the calorimetric signals obtained in step S 106  are preset as the RGB signals (R me (i), G me (i), B me (i)) of the goal color C me (i). In the present embodiment, since precise color reproduction is desired, the colorimetric signals are preset as the RGB signals (R me (i), G me (i), B me (i)) of the goal color C me (i), however, when reproduction of specific colors is preferred, the values of R me (i), G me (i), and B me (i) can be replaced in accordance with requirements. Note that, steps S 106  and S 108  can be carried out anytime before step 
   In step S 110 , the RGB signals (R in (i), G in (i), B in (i)) of the eighteen input colors C in (i) (i=1,2, . . . ,18), obtained in step S 104 , are transformed to the L*a*b* signals via the XYZ signals using Eqs. (3) and (4). Similarly, the RGB signals (R me (i), G me (i), B me (i)) of the eighteen goal colors C me (i) (i=1, 2, . . . , 18), obtained in step S 108  are transformed to the L*a*b* signals. 
   In step S 112 , the hue optimizing goal colors C me ′( 1 )-C me ′( 18 ) are preset for each of the eighteen colors and the corresponding L*a*b* signals are obtained. Namely, a point in the Lab color space which is obtained by orthogonal projection of the input color C in (i) onto the line connecting the i-th goal color C me (i) (i=1, 2, . . . , 18) and the origin of the Lab color space is preset as the hue optimizing goal color C me ′(i), and its L*a*b* coordinates are obtained. Further, in step S 114 , the L*a*b* signals of the hue optimizing goal colors C me ′( 1 )-C me ′( 18 ) are transformed to the RGB signals via the XYZ signals and the RGB signals (R me ′( 1 ), G me ′( 1 ), B me ′( 1 )) to (R me ′( 18 ), G me ′( 18 ), B me ′( 18 )) are obtained. 
   In step S 120 , multiple linear regression analysis is carried out. The multiple linear regression analysis is configured such that the multiple linear regression model assumes the RGB signals of the eighteen input colors C in ( 1 )-C in ( 18 ) as a set of explanatory variables, the RGB signals of the eighteen hue optimizing goal colors C me ′( 1 )-C me ′( 18 ) as a set of criterion variables, and the matrix elements m′ 1 -m′ 9  of the hue-optimizing matrix M_hue as partial regression coefficients. In step S 122 , the matrix elements m′ 1 -m′ 9  of the hue-optimizing matrix M_hue are obtained. 
   In this multiple linear regression model, a linear formula, as described by Eq. (9), is assumed for the eighteen colors. The formula is expressed by matrices B in  and B me ′, which represent the RGB signals of the input colors C in ( 1 )-C in ( 18 ) as column vectors and hue optimizing goal colors C me ′( 1 ) -C me ′( 18 ), and the hue-optimizing matrix M_hue which is comprised of the partial regression coefficients. Eq. (9) is also expressed by the matrix elements as Eq. (10).
 
 B   me   ′=M _hue· B   in   (9)
 
   
     
       
         
           
             
               
                 
                   ( 
                   
                     
                       
                         
                           
                             R 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             1 
                             ) 
                           
                         
                       
                       
                         
                           
                             R 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             2 
                             ) 
                           
                         
                       
                       
                         ⋯ 
                       
                       
                         
                           
                             R 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             18 
                             ) 
                           
                         
                       
                     
                     
                       
                         
                           
                             G 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             1 
                             ) 
                           
                         
                       
                       
                         
                           
                             G 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             2 
                             ) 
                           
                         
                       
                       
                         ⋯ 
                       
                       
                         
                           
                             G 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             18 
                             ) 
                           
                         
                       
                     
                     
                       
                         
                           
                             B 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             1 
                             ) 
                           
                         
                       
                       
                         
                           
                             B 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             2 
                             ) 
                           
                         
                       
                       
                         ⋯ 
                       
                       
                         
                           
                             B 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             18 
                             ) 
                           
                         
                       
                     
                   
                   ) 
                 
                 = 
                 
                   
                     ( 
                     
                       
                         
                           
                             m 
                             1 
                             ′ 
                           
                         
                         
                           
                             m 
                             2 
                             ′ 
                           
                         
                         
                           
                             m 
                             3 
                             ′ 
                           
                         
                       
                       
                         
                           
                             m 
                             4 
                             ′ 
                           
                         
                         
                           
                             m 
                             5 
                             ′ 
                           
                         
                         
                           
                             m 
                             6 
                             ′ 
                           
                         
                       
                       
                         
                           
                             m 
                             7 
                             ′ 
                           
                         
                         
                           
                             m 
                             8 
                             ′ 
                           
                         
                         
                           
                             m 
                             9 
                             ′ 
                           
                         
                       
                     
                     ) 
                   
                   ⁢ 
                   
                     ( 
                     
                       
                         
                           
                             
                               R 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               1 
                               ) 
                             
                           
                         
                         
                           
                             
                               R 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               2 
                               ) 
                             
                           
                         
                         
                           ⋯ 
                         
                         
                           
                             
                               R 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               18 
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               G 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               1 
                               ) 
                             
                           
                         
                         
                           
                             
                               G 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               2 
                               ) 
                             
                           
                         
                         
                           ⋯ 
                         
                         
                           
                             
                               G 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               18 
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               B 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               1 
                               ) 
                             
                           
                         
                         
                           
                             
                               B 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               2 
                               ) 
                             
                           
                         
                         
                           ⋯ 
                         
                         
                           
                             
                               B 
                               in 
                             
                             ⁡ 
                             
                               ( 
                               18 
                               ) 
                             
                           
                         
                       
                     
                     ) 
                   
                 
               
             
             
               
                 ( 
                 10 
                 ) 
               
             
           
         
       
     
   
   The hue-optimizing matrix M_hue is obtained by means of well known optimization techniques, such as the least square method. Namely, the left-hand side (the RGB values of the hue optimizing goal colors C me ′( 1 )-C me ′( 18 )) and the right-hand side (the RGB values obtained by using the hue-optimizing matrix M_hue for the input colors C in ( 1 )-C in ( 18 )) of the above-described multiple linear regression model do not actually coincide with each other and there are some errors. Therefore, Eq. (9) is reformed into Eq. (10) under the conditions of minimizing the square errors between the right and left hand sides, so that the partial regression coefficients of M_hue are obtained by solving Eq. (11).
 
 M _hue=[( B   in   ·B   in   t ) −1 ( B   in   ·B   me ′ t )] t    (11)
 
where, ( ) t  denotes a transposed matrix and ( ) −1  denotes an inverse matrix.
 
   When the multiple linear regression analysis is completed and the hue-optimizing matrix M_hue is obtained, the validity of the obtained hue-optimizing matrix M_hue is evaluated in the succeeding steps S 124 -S 130 . 
   In step S 124 , the RGB signals (R es ( 1 ), G es ( 1 ), B es ( 1 ))-(R es ( 18 ), G es ( 18 ), B es ( 18 )) of the hue corrected colors C es ′( 1 ) -C es ′( 18 ) are obtained by transforming the RGB signals of the input colors C in ( 1 ) -C in ( 18 ) using hue-optimizing matrix M_hue (refer to Eq. 12). In step S 126 , the L*a*b* signals of the hue corrected colors C es ′( 1 )-C es ′( 18 ) are obtained from the RGB signals by applying Eqs. (3) and (4) via the XYZ signals.
 
 C   es   ′=M _hue· C   in    (12)
 
   In step S 128 , a hue error θs 2  is obtained in accordance with the L*a*b* signals of the hue optimizing goal colors C me ′( 1 )-C me ′( 18 ), which were preset in step S 112 , and the L*a*b* signals of the hue corrected colors C es ′( 1 )-C es ′( 18 ), which were obtained in step S 126 . In detail, for each i-th color, i=1, 2, . . . , 18, a hue angle θ me ′(i) is obtained from the L*a*b* signals of the hue optimizing goal color C me ′(i) by using Eq. (5) and a hue angle θ es ′(i) is obtained from the L*a*b* signals of the hue corrected color C es ′(i) by using Eq. (5). Further, the sum of the square differences between the hue angles θ me ′(i) and θ es ′(i) for the eighteen colors is calculated as the hue error θs 2 . 
   
     
       
         
           
             
               
                 
                   θ 
                   S 
                   2 
                 
                 = 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     24 
                   
                   ⁢ 
                   
                     
                       { 
                       
                         
                           
                             θ 
                             me 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             i 
                             ) 
                           
                         
                         - 
                         
                           
                             θ 
                             es 
                             ′ 
                           
                           ⁡ 
                           
                             ( 
                             i 
                             ) 
                           
                         
                       
                       } 
                     
                     2 
                   
                 
               
             
             
               
                 ( 
                 13 
                 ) 
               
             
           
         
       
     
   
   In step S 130  whether the hue error θs 2  is less than or equal to the permissible value α is determined. When the hue error θs 2  is beyond the permissible value α, the process returns to step S 108  and replaces at least one of the goal colors C me ( 1 )-C me ( 18 ), and further calculates a new hue-optimizing matrix M_hue. Note that, when returning to step S 108 , and when the RGB signals of the goal colors C me ( 1 )-C me ( 18 ) are altered, each of the values should be determined under the condition that only a small change in the hue is made, such that it would not change the tint of a reproduced color on the monitor  30  from the original color of the object. 
   When it is determined, in step s 130 , that the hue error θs 2  is below or equal to the permissible value α, the hue-optimizing matrix M_hue is determined as a matrix that transforms the input colors C in  to the values which precisely approximate the goal colors C me  with respect to hue. Accordingly, steps S 140 -S 144  are carried out to obtain the saturation-optimizing matrix M_sat. 
   In step S 140 , multiple linear regression analysis is carried out by establishing the multiple linear regression model to adjust not only hue but also saturation. This multiple linear regression model, as shown in Eq. (14), regards the RGB signals of the eighteen hue corrected colors C es ′( 1 )-C es ′( 18 ), obtained in step S 124 , as a set of explanatory variables and the eighteen saturation optimizing goal colors C me ( 1 )-C me ( 18 ), preset in step S 108 , as a set of criterion variables. The “B in ” in Eq. (14) denotes a matrix with column vectors of the hue corrected color C es ′( 1 )-C es ′( 18 ) and “B me ” denotes a matrix with column vectors of the saturation optimizing goal colors C me ( 1 )-C me ( 18 ). In step S 142 , the calculated partial regression coefficients a″ 1 -a″ 9  are set as the matrix elements of the saturation matrix M_sat. The method for obtaining the saturation-optimizing matrix M_sat is the same as the method for obtaining the hue-optimizing matrix M_hue, in steps S 120 -S 122 , therefore it is not detailed here.
 
 B   me   =M _sat· B   es    (14)
 
   When the saturation-optimizing matrix M_sat is obtained in step S 142 , the color space transformation matrix M is obtained, in step s 144 , by the above-described Eq. (6) or Eq. (7). The RGB signals of the input colors C in ( 1 )-C in ( 18 ) are then transformed by the color space transformation matrix M to the RGB signals (R es ( 1 ), G es ( 1 ) B es ( 1 ))-(R es ( 18 ), G es ( 18 ), B es ( 18 )) of the corrected color C es ( 1 )-C es ( 18 ) in step S 146 , see Eqs. (1) and (2). Further, in step S 148 , the L*a*b* signals of the corrected colors C es ( 1 )-C es ( 18 ) are obtained from the RGB signals via the XYZ signals by using Eqs. (3) and (4). In step S 150 , a hue error θ s   2  between the corrected colors C es ( 1 )-C es ( 18 ) and the goal colors C me ( 1 )-C me ( 18 ) is obtained. The way in which the hue error θ s   2  is obtained, in step S 150 , is the same as that in step S 128 , thus it is not detailed here. 
   In step S 152 , whether the hue error θ s   2  is below or equal to the permissible value α is determined. When the hue error θ s   2  is beyond the permissible value α, the process returns to step S 108 . On the other hand, when it is determined that the hue error θ s   2  is below or equal to the permissible value α, the color space transformation matrix M is determined as a matrix that transforms the input colors C in  to the values which precisely approximate the goal colors C me  with respect to hue and saturation. Thereby, in step S 154 , the current values of the color space transformation matrix M are determined as the goal. The values of the elements of the color space transformation matrix M are transmitted to the digital still camera  10  from the matrix generator  34  and stored in the memory  22  in step S 156 , and thus the process ends. 
   Accordingly, when applying the above-obtained color space transformation matrix M for a color adjusting process of the digital still camera  10 , sRGB signals are obtained that are able to reproduce colors with fidelity, particularly regarding hue, which is based on the calorimetric signals. Therefore, an object image having colors quite close to the original object colors can be displayed on the monitor  30 . 
   As described above, according to the first embodiment, a color adjusting process can be carried out which takes the characteristics of the human visual sensation into consideration, that is, considering the difference of hue as important for sensing the color difference. The color space transformation matrix M is obtained as a product of the two matrices, the hue-optimizing matrix M_hue and the saturation-optimizing matrix M_sat, where each of the matrices is obtained by separate multiple linear regression analysis. Namely, both the hue-optimizing matrix M_hue and the saturation-optimizing matrix M_sat optimize hue and saturation in relation to the goal color C me . Thereby, priority can be given to adjusting the hue of the corrected color C es  to the goal color C me , so that the color reproduction of an object image on the monitor  30  is improved. 
   In the above-described multiple linear regression analysis, differences of the hue angle between a corrected color C es  and a goal color C me  are distributed uniformly for each of the colors, however, when the hue coincidence of particular colors needs to be improved, such as human skin color, the set of criterion variables, such as the hue optimizing goal color C me ′( 1 )-C me ′( 18 ) and the goal colors C me ( 1 )-C me ( 18 ) may be weighted before carrying out the multiple linear regression analysis in steps S 120  and S 140 . Namely, in this case, the multiple linear regression analysis is carried out by setting criterion variables as products of weights W(i), which are given to each of the eighteen colors, and the hue optimizing goal colors C me ′(i), or products of weights W(i) and the goal colors C me . Eq. (15) is a formula used when the multiple linear regression analysis is carried out while weighting the hue optimizing goal colors C me ′( 1 )-C me ′( 18 ) to generate the desired hue, and Eq. (16) is a formula used when the multiple linear regression analysis is carried out while weighting the goal colors C me ( 1 )-C me ( 18 ) to generate the desired saturation.
 
 W·B   me   ′=M _hue· B   in    (15)
 
 W·B   me   =M _sat· B   es    (16)
 
where, W denotes a matrix with the elements corresponding to the weight W(i) for the eighteen colors, and the sum of the weights W( 1 )-W( 18 ) is  1 . With this weighting, the color reproduction for a particular color is improved as the weighting for the particular color is enhanced.
 
   Next, a second embodiment of the present invention will be explained. In the second embodiment, the calculation of the color space transformation matrix is different from that of the first embodiment. 
   With reference to  FIG. 5  and  FIG. 6 , the calculation of the color space transformation matrix in the second embodiment will be explained. In  FIG. 5 , the Lab color space, with a light source illuminating the standard light of CIE-D 65 , which represents day light at a 6504 K color. temperature, is depicted. A color that corresponds to an input color C in , a predicted or corrected color C es  which is obtained by the input color C in  and the color space transformation matrix M, and a goal color C me , to which the input color should be adjusted, are indicated as respective points in this Lab color space. Note that, in  FIG. 5 , the distances between each of the three points are emphasized for convenience of explanation. The L*a*b* signals of the goal color C me  are preset to the values that are obtained by the colorimetric measurement. Further,  FIG. 6  is a block diagram schematically showing the processes being carried out in the color space transformation matrix calculating process and the relations between each of the color signals. 
   In the first embodiment, the multiple linear regression analysis is used to optimize the color space transformation matrix M. However, in the second embodiment, the elements m 1 -m 9  of the color space transformation matrix M are optimized by using the damped least square method. Namely, the color space transformation matrix M is derived as the sum square of the color differences ΔE between the corrected color C es  and the goal color C me  for all of the eighteen colors not to go over the permissible error. The corrected colors C es  obtained by using the optimized color space transformation matrix M for each of the input colors C in  approximately coincide with the goal color C me . 
   The color difference between the corrected color C es  and the goal color C me  for one color is denoted by Eq. (17) and it is evaluated in the Lab space. In Eq. (17), L*a*b* signals of a corrected color C es  are denoted by (L* es , a* es , b* es ) and of a goal color C me  by (L* me , a* me , b* me ).
 
Δ E ={(Δ L* ) 2 +(Δ a *) 2 +(Δ b* ) 2 } 1/2   (17)
 
where, ΔL*=L* me −L* es Δa*=a* me −a* es Δb*=b* me −b* es .
 
   Hereinafter, to discriminate each of the color differences corresponding to the eighteen colors, the color differences will be indexed by the numbers of the color patches, for example ΔE 1 , ΔE 2 , . . . , ΔE 18 . When denoting the color patch number by a parameter “i”, each of the color differences is represented by ΔE i . Further, the matrix elements m 1 , m 2 , . . . , m 9  will be denoted by the index parameter “j” (j=1, 2, . . . , 9) for example m j . Since the corrected color C es  is obtained by using the color space transformation matrix M on the input color C in , as described in Eqs. (1) and (2), the color difference ΔE can be considered as a function ΔE i (m j ) which includes the matrix elements m j  as parameters. 
   In the damped least square method, the sum square of ΔE i  (i=1, 2, . . . , 18) obtained for each of the eighteen colors is defined as a merit function φ (see Eq. (18)). The matrix elements m j  (j=1, 2, . . . , 9) are optimized in order to make the value of the merit function φ below or equal to a predetermined threshold value. The conditions under which the merit function φ is minimized are given by nine equations which are represented by Eq. (19). However, Eq. (18) is nonlinear so that the matrix elements m j  can not be solved analytically. Therefore, the color differences ΔE i  are linearized about the starting point m j0 . When substituting the linearized color differences ΔE i , the merit function φ is expressed by a quadratic expression of m j . Thus, substituting this quadratic formula into Eq. (19), the extreme value of the merit function φ satisfies the linear equation with nine unknowns. By solving this linear equation, approximate solutions for the matrix elements m j  are obtained. 
   
     
       
         
           
             
               
                 ϕ 
                 = 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     18 
                   
                   ⁢ 
                   
                     
                       ( 
                       
                         Δ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           E 
                           i 
                         
                       
                       ) 
                     
                     2 
                   
                 
               
             
             
               
                 ( 
                 18 
                 ) 
               
             
           
         
       
     
   
   
     
       
         
           
             
               
                 
                   
                     ∂ 
                     ϕ 
                   
                   
                     ∂ 
                     
                       m 
                       j 
                     
                   
                 
                 = 
                 
                   0 
                   ⁢ 
                   
                       
                   
                   ⁢ 
                   
                     ( 
                     
                       
                         j 
                         = 
                         1 
                       
                       , 
                       2 
                       , 
                       
                         … 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         9 
                       
                     
                     ) 
                   
                 
               
             
             
               
                 ( 
                 19 
                 ) 
               
             
           
         
       
     
   
   The above linear equation is called a normal equation of the least square method. By deforming this normal equation to obtain displacement Δm j , from the starting point m j0  toward the solution, it is expressed as Eq. (20), as in the matrix form. The Δm denotes a column vector, where the elements Δm 1 , Δm 2 , . . . , Δm 9  represent displacement from the starting point m 10 -m 90  toward the solution for each m j . The ΔE denotes a column vector, where the elements ΔE 1 , ΔE 2 , . . . , ΔE 18  represent the color differences, and A denotes a Jacobian matrix at the starting point m j0 . Therefore, the column vector Δm, the displacement Δm 1 , Δm 2 , . . . , Δm 9  toward the solution, is immediately obtained by using the column vector ΔE and the Jacobian matrix A under Eq. (20).
 
Δ m =−( A   t   ·A ) −1   ·A   t   ΔE   (20)
 
where,
 
   
     
       
         
           
             Δ 
             ⁢ 
             
                 
             
             ⁢ 
             m 
           
           = 
           
             
               
                 ( 
                 
                   
                     
                       
                         Δ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           m 
                           1 
                         
                       
                     
                   
                   
                     
                       
                         Δ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           m 
                           2 
                         
                       
                     
                   
                   
                     
                       ⋮ 
                     
                   
                   
                     
                       
                         Δ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           m 
                           9 
                         
                       
                     
                   
                 
                 ) 
               
               ⁢ 
               
                   
               
               ⁢ 
               Δ 
               ⁢ 
               
                   
               
               ⁢ 
               E 
             
             = 
             
               
                 
                   ( 
                   
                     
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             E 
                             1 
                           
                         
                       
                     
                     
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             E 
                             2 
                           
                         
                       
                     
                     
                       
                         ⋮ 
                       
                     
                     
                       
                         
                           Δ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             E 
                             9 
                           
                         
                       
                     
                   
                   ) 
                 
                 ⁢ 
                 
                     
                 
                 ⁢ 
                 A 
               
               = 
               
                 
                   
                     ( 
                     
                       
                         
                           
                             a 
                             
                               1 
                               ⁢ 
                               _ 
                               ⁢ 
                               1 
                             
                           
                         
                         
                           
                             a 
                             
                               1 
                               ⁢ 
                               _ 
                               ⁢ 
                               2 
                             
                           
                         
                         
                           ⋯ 
                         
                         
                           
                             a 
                             
                               1 
                               ⁢ 
                               _ 
                               ⁢ 
                               9 
                             
                           
                         
                       
                       
                         
                           
                             a 
                             
                               2 
                               ⁢ 
                               _ 
                               ⁢ 
                               1 
                             
                           
                         
                         
                           ⋯ 
                         
                         
                           ⋯ 
                         
                         
                           
                             a 
                             
                               2 
                               ⁢ 
                               _ 
                               ⁢ 
                               9 
                             
                           
                         
                       
                       
                         
                           ⋮ 
                         
                         
                           ⋮ 
                         
                         
                           ⋮ 
                         
                         
                           ⋮ 
                         
                       
                       
                         
                           
                             a 
                             
                               18 
                               ⁢ 
                               _ 
                               ⁢ 
                               1 
                             
                           
                         
                         
                           ⋯ 
                         
                         
                           ⋯ 
                         
                         
                           
                             a 
                             
                               18 
                               ⁢ 
                               _ 
                               ⁢ 
                               9 
                             
                           
                         
                       
                     
                     ) 
                   
                   ⁢ 
                   
                       
                   
                   ⁢ 
                   
                     a 
                     i_j 
                   
                 
                 = 
                 
                   
                     
                       
                         ∂ 
                         Δ 
                       
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         E 
                         i 
                       
                     
                     
                       ∂ 
                       
                         m 
                         j 
                       
                     
                   
                   ⁢ 
                   
                     ❘ 
                     
                       
                         m 
                         j 
                       
                       = 
                       
                         m 
                         jo 
                       
                     
                   
                 
               
             
           
         
       
     
   
   Therefore, approximate solutions for the matrix elements m 1 -m 9  are obtained by adding the displacement Δm 1 , Δm 2 , . . . , Δm 9  (obtained from Eq. (20) by substituting given initial values to the starting point m 10 -m 90 . Further, the approximate solution obtained by the above process then becomes a new starting point m j0  and a new approximate solution for the matrix elements m 1 -m 9  is again obtained. This operation is repeated until the merit function φ yields a value below or equal to the threshold value. When the value of the merit function reaches a point below or equal to the threshold value, the approximate values at that time are determined to have converged to a solution of the matrix elements m 1 -m 9  and are set as the elements. 
   Note that, the merit function φ is not restricted to Eq. (18). For example, as shown in Eq. (21), a function wherein a term of the sum square of Δm j  multiplied by a damping factor D (&gt;0), is added to the sum square of the color differences ΔE i , may be adopted for the merit function φ, in order to secure the convergence of the solution, and for efficiency. As the value of the damping factor D increases, the approximation error decreases, but the speed of convergence is reduced. The method using the damping factor D is well known in the art, so it is not detailed here. In the present embodiment, the damping factor D is set to a predetermined value. However, the value of the damping factor D may be altered during the iteration process for obtaining the approximate solution. In this case, the normal equation is expressed as Eq. (22). 
                 ϕ   =         ∑     i   =   1     18     ⁢     Δ   ⁢           ⁢     E   i   2         +     D   ⁢       ∑     j   =   1     9     ⁢     Δ   ⁢           ⁢     m   j   2                     (   21   )               Δ m =−( A   t   ·A+D·I ) −1   ·A   t   ·ΔE   (22) 
   where, “I” in Eq. (22) denotes a unit matrix. 
   In the above-described optimization of the matrix, the difference between the corrected color C es  and the goal color C me  is merely evaluated by the color difference ΔE in the Lab space. However, the difference Δθ (see Eq. (23)) between the hue angles θ es  and θ me  of the above corrected and goal colors may be incorporated into the evaluation in order to give priority to the hue coincidence, since human eyes are sensitive to a difference in hue rather than saturation. An equation in which the sum of the squares of the hue angle differences Δθ is added to the first term of right-hand side of Eq. (21) is expressed as Eq. (24). Note that, the hue angle differences Δθ are small compared to the color difference ΔE, so that the hue angle differences Δθ in Eq. (24) may be weighted to improve the coincidence of hue. 
   
     
       
         
           
             
               
                 Δθ 
                 = 
                 
                   
                     
                       θ 
                       me 
                     
                     - 
                     
                       θ 
                       es 
                     
                   
                   = 
                   
                     
                       
                         tan 
                         
                           - 
                           1 
                         
                       
                       ⁡ 
                       
                         ( 
                         
                           
                             b 
                             me 
                             * 
                           
                           
                             a 
                             me 
                             * 
                           
                         
                         ) 
                       
                     
                     - 
                     
                       
                         tan 
                         
                           - 
                           1 
                         
                       
                       ⁡ 
                       
                         ( 
                         
                           
                             b 
                             es 
                             * 
                           
                           
                             a 
                             es 
                             * 
                           
                         
                         ) 
                       
                     
                   
                 
               
             
             
               
                 ( 
                 23 
                 ) 
               
             
           
           
             
               
                 ϕ 
                 = 
                 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       18 
                     
                     ⁢ 
                     
                       { 
                       
                         
                           
                             ( 
                             
                               Δ 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 E 
                                 i 
                               
                             
                             ) 
                           
                           2 
                         
                         + 
                         
                           
                             ( 
                             
                               Δ 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 θ 
                                 i 
                               
                             
                             ) 
                           
                           2 
                         
                       
                       } 
                     
                   
                   + 
                   
                     D 
                     ⁢ 
                     
                       
                         ∑ 
                         
                           j 
                           = 
                           1 
                         
                         9 
                       
                       ⁢ 
                       
                         Δ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           m 
                           j 
                           2 
                         
                       
                     
                   
                 
               
             
             
               
                 ( 
                 24 
                 ) 
               
             
           
         
       
     
   
   Furthermore, the color differences between the corrected colors C es  and the goal colors C me  for each of the colors are distributed uniformly in the matrix optimization process using the merit function φ, which is defined by one of Eq. (18), (21), and (24). However, when it is necessary to improve the hue coincidence of particular colors, such as human skin color, the color differences ΔE i  may be weighted by the weights W i  (i=1, 2, . . . , 18), which are given to each of the eighteen colors. The sum of the weights W 1 -W 18  is 1. The merit function, when the weights W i  are applied to the merit function φ of Eq. (21) is expressed by Eq. (25). With this weighting, the color reproduction for a particular color is improved since the weighting for the particular color is enhanced. 
   
     
       
         
           
             
               
                 ϕ 
                 = 
                 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       18 
                     
                     ⁢ 
                     
                       
                         ( 
                         
                           
                             
                               W 
                               i 
                             
                             · 
                             Δ 
                           
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             E 
                             i 
                           
                         
                         ) 
                       
                       2 
                     
                   
                   + 
                   
                     D 
                     ⁢ 
                     
                       
                         ∑ 
                         
                           j 
                           = 
                           1 
                         
                         9 
                       
                       ⁢ 
                       
                         Δ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           m 
                           j 
                           2 
                         
                       
                     
                   
                 
               
             
             
               
                 ( 
                 25 
                 ) 
               
             
           
         
       
     
   
   When the initial values for the starting point m 10 , m 20 , . . . , m 90  are properly given in the calculation of the optimization, the number of iterations is reduced and thus the computing time is shortened. Therefore, it is preferable to preset the initial values as close to the solution as possible. In the present embodiment, the initial values of the starting point m 10 , m 20 , . . . , m 90  are initially preset to 1, 0, 0, 0, 1, 0, 0, 0, and 1, respectively, since input color C in  and the goal color C es  are assumed to be the same. Namely, the initial color space transformation matrix M is primarily given as the unit matrix. Further, in the present embodiment, eight initial values are fixed and the remaining one element is solely varied little by little in minute steps (e.g. 0.01) from the value “1” or “0”, within a predetermined range (e.g. ±0.3), so that a plurality of initial starting points are given. Further the optimization is carried out for each of the initial starting points and provides a plurality of solutions corresponding to each of the initial values. The optimum solution for an object is selected from those solutions. Conventionally, the initial values are selected based on the experiment of a designer or by referring to data. However, according to the initial value setting procedure of the present embodiment, even a user who is not well skilled in the art can easily obtain an optimum solution. 
   With reference to the flow charts of  FIGS. 7A to 7C , the color space transformation calculating process for the second embodiment is explained in detail. 
   The processes in steps S 202 -S 210  are the same as those in steps S 102 -S 110  of the first embodiment (see FIG.  4 A), so that the description for these steps is omitted. When the process of step S 210  is complete, the operations specific to the second embodiment are performed. Namely, at step S 210 , the L*a*b* signals for each of the eighteen input color C in (i) (i=1, 2, . . . , 18), which are obtained at step S 204 , are derived and are denoted by (L* in (i), a* in (i), b* in (i)). Further, the L*a*b* signals for each of the eighteen goal colors C em (i) (i=1, 2, . . . , 18), which are obtained at step S 208 , are derived and denoted by (L* me (i), a* me (i), b* me (i)) 
   From step S 212  through step S 226 , the damped least square method is carried out and nine matrix elements m 1 , m 2 , . . . , m 9  for the color space transformation matrix M are obtained. In step S 212 , the initial values of the starting point m 10 , m 20 , . . . , m 90  are preset as 1, 0, 0, 0, 1, 0, 0, 0, 1, by assuming the input color C in  and the goal color C es  to be the same. 
   Further in step S 214 , the displacement Δm 1 -Δm 9  from the starting point toward the solution is obtained from the normal equation (20) of the above-mentioned least square method, and added to the starting point m 10 -m 20  in order to obtain approximate solution for the matrix elements m 1 -m 9 . In step S 216 , whether the approximate solution is sufficiently close or substantially equal to the real solution is determined. Namely, whether the sum square of the color differences ΔE 1 -ΔE 18 , in the Lab space, between the goal colors C me ( 1 )-C me ( 18 ) and the corrected colors C es ( 1 )-C es ( 18 ) are within the permissible error ranges, is determined. Here, the corrected colors C es ( 1 )-C es ( 18 ) are obtained by using the color space transformation matrix M for the input colors C in ( 1 )-C in ( 18 ), where the elements of the matrix are given by the predicted or approximate solution. When it is determined that the predicted solution has converged or is close enough to the real solution, the predicted solution is provisionally stored in the memory (not shown) of the matrix generator  34  (step  218 ) and the process proceeds to step S 224 . When it is determined, in step S 216 , that the predicted solution has not converged, whether the calculation in step S 214  has been iterated more than ten times is further determined in step S 220 . When the iteration has not reached ten times, the values of the starting point m 10 -m 90  are altered by the current solutions (the sum of the initial values of m 10 -m 90  and the displacement Δm 1 -Δm 9 ) in step S 222 , and the process returns to step S 214 . When the iteration of the calculation in step S 214  has exceeded ten times, the process proceeds to step S 224  from step S 220 . 
   In short, in steps S 212 -S 222 , the approximate solution of the matrix elements m 1 -m 9  is predicted by assuming the initial values of the starting point m 10 -m 90  as 1, 0, 0, 0, 1, 0, 0, 0, 1, and then the matrix elements m 1 -m 9  are renewed using the predicted solution, as a new starting point m 10 -m 90 , and these processes are repeated until the color difference value is evaluated to be below or equal to the permissible error level. However, when the calculation does not converge although the calculation has been repeated more than ten times, this optimizing process is terminated. Note that, in the present embodiment, the number of times necessary for iteration to achieve the convergence is predicted to be about four or five times, thus the limit for iterations is preset to ten times. However, the number of times for the iteration is not restricted to that in the present embodiment, and it may be changed in accordance with the performance of the matrix generator. 
   The solution that is obtained by optimizing the calculation of steps S 214 -S 222  is dependent on the initial values of the starting points m 10 -m 90 , which are given at step  212 , so that solution is generally changed when the initial values are altered. Therefore, in the present embodiment, eight elements are fixed for the initial values “1” and “0”. On the other hand, the remaining one element is varied from the primarily given initial value within a predetermined range (±0.3) in steps of 0.01, and 270 (30×9) sets of initial values are given. In turn, the solutions for each set of initial values are calculated. In step S 224 , whether the optimizing process for every set of initial values has been completed, is determined. When it is not completed, the process returns to step S 212  and a set of initial values that have not been used for the calculation are preset as new initial values and the optimizing calculation is again carried out. When it is determined that the optimizing process has been carried out for all sets of initial values, the process proceeds to step S 226 . At this time, a plurality of solutions for the matrix elements m 1 -m 9  that satisfy the condition that the sum of the squares of the color differences ΔE 1 -ΔE 18  for all eighteen colors is below or equal to permissible error, is stored in the memory. 
   In step S 226 , the optimum solution is selected from the plurality of solutions for the matrix elements m 1 -m 9 . Namely, a solution that gives the minimum sum of the squares of the hue angle differences Δθ 1 -Δθ 18  between the corrected colors C es ( 1 )-C es ( 18 ) and the goal colors C me ( 1 )-C me ( 18 ), is selected, so that the corrected colors C es ( 1 )-C es ( 18 ) are obtained by using the color space transformation matrix in which a solution of the matrix elements is preset. Therefore, the matrix elements m 1 -m 9 , obtained in step S 226 , give the sum of the squares of the color difference ΔE 1 -ΔE 18 , for each of the eighteen colors of the Macbeth color checker 40, which is below or equal to the permissible error, and minimize the sum square of the hue angle differences Δθ 1 -Δθ 18 . 
   Note that, the conditions for selecting the optimum solution are not restricted to the present embodiment, and can be altered as to requirements. For example, when it is necessary to give priority to a selected color, such as human skin color, a severe condition for the color difference between the corrected color C es  and the goal color C me  for the selected color, may be added. 
   In steps S 232 - 242 , the validity of the obtained color space transformation matrix M is evaluated. In step S 232 , the obtained solution is preset for the color space transformation matrix M, and then the RGB signals (R es ( 1 ), G es ( 1 ), B es ( 1 )-(R es ( 18 ), G es ( 18 ), B es ( 18 )) of the corrected colors C es ( 1 )-C es ( 18 ) are obtained by using the color space transformation matrix M for the input colors C in ( 1 )-C in ( 18 ), see Eqs. (1) and (2). Further, in step S 234 , the L*a*b* signals (L* es ( 1 ), a* es ( 1 ), b* es ( 1 ))-(L* es ( 18 ), a* es ( 18 ), b* es ( 18 )) of the corrected colors C es ( 1 )-C es ( 18 ) are obtained by using Eqs. (3) and (4) via the XYZ signals. 
   Further, in step S 236 , the hue angle differences Δθ 1  to Δθ 18  are calculated by Eq. (23), based on the L*a*b* signals (L* es ( 1 ), a* es ( 1 ), b* es ( 1 ))-(L* es ( 18 ), a* es ( 18 ) b* es ( 18 )) of the corrected colors C es ( 1 )-C es ( 18 ) that have been calculated in step S 234  and the L*a*b* signals (L* me ( 1 ), a* me ( 1 ), b* me ( 1 ))-(L* me ( 18 ), a* me ( 18 ), b* me ( 18 )) of the goal colors C me ( 1 )-C me ( 18 ) that have been calculated in step S 210 . In turn, the hue error θs 2 , which is the sum of the squares of the hue angle differences Δθ 1  to Δθ 18 , is obtained by Eq. (26). 
   
     
       
         
           
             
               
                 
                   θ 
                   s 
                   2 
                 
                 = 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     18 
                   
                   ⁢ 
                   
                     
                       ( 
                       
                         Δ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           θ 
                           i 
                         
                       
                       ) 
                     
                     2 
                   
                 
               
             
             
               
                 ( 
                 26 
                 ) 
               
             
           
         
       
     
   
   In step S 238 , whether the hue error θs 2  is below or equal to a permissible value α is determined. When the hue error θs 2  is above the permissible value α, the process returns to step S 208  and at least one of the goal colors C me ( 1 )-C me ( 18 ) is replaced, and further a new color space transformation matrix M is calculated. Note that, when returning to step S 208  and when the RGB signals of the goal colors C me ( 1 )-C me ( 18 ) are altered, each of the values should be determined under the condition of making only a small change in hue, so as not to change the tint of a reproduced color on the monitor  30  from the original color of the object. 
   When it is determined, in step S 238 , that the hue error θs 2  is below or equal to the permissible value α, the color space transformation matrix M is determined as a matrix that transforms the input colors C in  to values which precisely approximate the goal colors C me  with respect to hue. Accordingly, in step S 240 , the current matrix elements of the color space transformation matrix M are determined as the solution, and then, in step S 242 , the matrix elements of the color space transformation matrix M are transmitted from the matrix generator  34  to the digital still camera  10  and are stored in the memory  22 . 
   Accordingly, when using the above-obtained color space transformation matrix M for a color adjusting process of the digital still camera  10 , sRGB signals based on the colorimetric signals are obtained with fidelity. Therefore, an object image having colors quite close to the original object colors can be displayed on the monitor  30 . 
   As described above, in the second embodiment, the color space transformation matrix, which is used to correct color, is obtained by means of the damped least square method. In this damped least square method, the evaluation of the color difference and hue in the Lab space can be incorporated into the merit function φ, refer to Eqs. (18), (21), (24), and (25). The RGB signals are easily transformed to the color signals in the uniform color space (e.g. L*a*b* color space), and conditions (such as making coincidence in color or hue) in the L*a*b* color space or uniform color space can be easily given. Further, the color differences ΔE i  are linearized in the damped least square method, so that the optimizing calculations are simplified and calculation time is made short. The transformation from the RGB color space to the L*a*b* color space is significantly complicated, since it includes multiple calculations. However, when using the damped least square method, the calculation time is reduced, since it is not necessary to retransform the L*a*b* signals into RGB signals. This is because there is no need to compensate the color space transformation matrix based on the evaluation of coincidence between the corrected colors C es  and the goal colors C me , which is not carried out in the L*a*b* color space. 
   Note that, the image input device is not restricted to the digital still camera  10  of the present embodiments, but it can also be any type of device, such as digital video camera, scanner, electronic endoscope, and the like. Further, in the present embodiments, the matrix generator  34  is configured as an external device to the digital still camera  10 , however the matrix generating function may be incorporated into the digital still camera  10 . Furthermore, it may be configured as an image processing software application that is able to calculate the color space transformation matrix and is able to correct colors, so that the software may be installed in a personal computer system and the RAW data from the digital still camera  10  are subjected to the color correction processes in the personal computer system. 
   In the present embodiments, the color space transformation matrix that adjusts colors of RGB signals obtained by the imaging system is based on the sRGB standard. However, the matrix calculating methods in the present embodiments are not restricted to the calculation of a matrix that is specific to this type of color correction. For example, a color space transformation matrix that interactively transforms color signals between different color spaces, such as a transformation of RGB signals to XYZ signals or to CMYK signals for printing, and a transformation of CMY signals for complementary colors to RGB signals, may be calculated by the above-discussed method. 
   Although the embodiments of the present invention have been described herein with reference to the accompanying drawings, obviously many modifications and changes may be made by those skilled in this art without departing from the scope of the invention. 
   The present disclosure relates to subject matter contained in Japanese Patent Applications Nos. 2003-201668 and 2003-201792 (both filed on Jul.25, 2003), which are expressly incorporated herein, by reference, in their entirety.