Sign In to Follow Application
View All Documents & Correspondence

Image Processing Device, Image Processing Method, And Program

Abstract: The present invention relates to an image processing apparatus, an image processing method, and a program that are capable of removing an influence due to illumination components from a plurality of images in which illumination environments are different and generating an image having high color reproducibility. A demosaic processing unit 221 performs a demosaic process on a reference image held in a reference mosaic image holding unit 111. A demosaic processing unit 222 performs a demosaic process on a processing target image that is held in a processing target mosaic image holding unit 112. A white balance calculation unit 230 calculates a white- balance value for each channel with respect to the reference image. A channel gain calculation unit 250 calculates a gain for each channel for converting illumination components on the basis of RGB values of the reference image and the processing target image, and the white balance of the reference image. At the time of gain calculation, blackout condition, saturation, and the like are considered. A channel gain application unit 2 60 applies the gain calculated by the channel gain calculation unit 250 to each channel of the processing target image.

Get Free WhatsApp Updates!
Notices, Deadlines & Correspondence

Patent Information

Application #
Filing Date
28 February 2011
Publication Number
48/2011
Publication Type
INA
Invention Field
NO SUBJECT
Status
Email
Parent Application

Applicants

SONY CORPORATION
1-7-1 KONAN, MINATO-KU, TOKYO 108-0075

Inventors

1. HIROAKI TAKAHASHI
C/O SONY CORPORATION, 1-7-1 KONAN, MINATO-KU, TOKYO 108-0075
2. TOMOO MITSUNAGA
C/O SONY CORPORATION, 1-7-1 KONAN, MINATO-KU, TOKYO 108-0075

Specification

DESCRIPTION Title of Invention: IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM Technical Field [0001] The present invention relates to image processing apparatuses and, more particularly, to an image processing apparatus for generating an image having high color reproducibility from a captured image, a processing method for use with these, and a program for causing a computer to perform such a method. Background Art [0002] A typical example of image processing using a plurality of images in which the illumination environment is different is a white balance process using two images, namely, a flash emission image and a non-flash emission image, for the purpose of improving color reproducibility of images by emitting a flash. In general, since flash light and ambient light differ in color temperature, when taking a using a flash, the color balance of illumination differs between a place at which the flash is emitted and other places. For this reason, the color balance of light that hits a subject changes for each area. In a gain process for performing uniform white balance on a screen as in the related art, there is a case in which breakdown occurs. With regard to this, attempts in which flash components of illumination and ambient light components are separated from two images, namely, a flash emission image and a non-flash emission image, and a white-balance gain is adjusted for each pixel, have been made (see, for example, PTL 1). Citation List Patent Literature [3] PTL 1: Japanese Unexamined Patent Application Publication No. 2005-210485 (Fig. 1) Summary of Invention Technical Problem [4] In the technique of the related art using a plurality of images, the white balance problem has been solved by separating illumination components by calculating the difference between two images, by processing each component processed on the basis of the white balance of an image captured under a single illumination environment, and by combining the components. However, in the technique of the related art, there are two major problems as follows. [5] The first problem is that it is not possible to deal with changes in ambient light. In order to handle a difference between a reference image and a processing target image as a problem of single illumination, it is necessary that illumination components other than flash components are constant between two images. For this reason, in a case where a change, such as sunlight decreases, occurs at image- capturing time, it is not possible to successfully deal with such a change. [6] The second problem is that dealing with a moving subject is difficult. Among pixels belonging to a subject that has moved between a reference image and a processing target image, pixels having a different spectral reflectance are compared, and separation of illumination components on the basis of the difference between the images cannot be performed. For this reason, in the technique of the related art, there is a problem in that it is not possible to deal with a combination of an image in which the orientation of a camera has changed, an image in which a moving subject is included, and the like. With respect to these image processing problems for a plurality of images, solving means, such as use of a tripod, or positioning performed using a global motion vector and block matching, has been proposed. However, in the case where a tripod is used, an offset caused by a camera being moved can be compensated for, but it is not possible to deal with a moving subject. In a global motion vector and block matching, in general, motion is estimated on the basis of the difference between two images, of SAD (Sum of Absolute Differences). However, in a case where the illumination environment is different, it is not possible to determine whether the difference is caused by a change in illumination components or by a moving subject, presenting the problem that accuracy is low. [7] The present invention has been made in view of such circumstances, and aims to remove influences due to illumination components from a plurality of images with a different illumination environment and to generate an image having high color reproducibility. Solution to Problem [8] The present invention has been achieved to solve the above-described problems. A first aspect thereof provides an image processing apparatus including: a channel gain calculation unit that calculates a gain for converting illumination components for each channel at each pixel position on the basis of a reference image and a processing target image that are captured under different illumination environments; and a channel gain application unit that applies the gain to the processing target image, an image processing method, and a program. As a result, effects of converting illumination components for each channel at each pixel position of the processing target image by using the reference image captured under a different illumination environment are brought about. [9] Furthermore, in the first aspect, the channel gain calculation unit may calculate a gain in such a manner that the gain of a specific channel of the processing target image is fixed and a color balance of the processing target pixel is made to match that of the reference image. Furthermore, the channel gain calculation unit may fix a luminance value of the processing target image and may calculate the gain so that a color balance of the processing target pixel matches that of the reference image. [10] Furthermore, in the first aspect, the channel gain calculation unit may set a predetermined upper limit value as the gain in a case where a value exceeding the upper limit value is calculated as the gain, and may set a predetermined lower limit value as the gain in a case where a value that falls below the lower limit value is calculated as the gain. As a result, effects of removing a gain that deviates from the range of the upper limit value and the lower limit value are brought about. [11] Furthermore, in the first aspect, the channel gain calculation unit may further include a saturation degree calculation unit that calculates a saturation degree of pixels of pixel values on the basis of the reference image, and a saturation compensation unit that performs a process for compensating for the gain in accordance with the saturation degree. As a result, effects of compensating for the gain in accordance with the saturation degree are brought about. [12] Furthermore, in the first aspect, the channel gain calculation unit may include a blackout condition degree calculation unit that calculates a blackout condition degree of pixels on the basis of pixel values of the reference image; and a blackout condition compensation unit that performs the process for compensating for the gain in accordance with the blackout condition degree. The channel gain calculation unit may include a blackout condition degree calculation unit that calculates a blackout condition degree of pixels on the basis of pixel values of the reference image and an inter-channel ratio of the reference image to the processing target image, and a blackout condition compensation unit that performs the process for compensating for the gain in accordance with the blackout condition degree. As a result, effects of compensating for a gain in accordance with the blackout condition degree are brought about. [13] Furthermore, in the first aspect, the image processing apparatus may further include an exposure compensation unit that adjusts an intensity so that exposure intensities become equal in order to compensate for a difference between image-capturing conditions of the reference image and the processing target image. As a result, effects of compensating for a difference in the image-capturing conditions are brought about. [14] Furthermore, in the first aspect, the channel gain application unit may include a saturation reliability calculation unit that calculates a saturation reliability of pixels on the basis of pixel values of the reference image, and a smoothing processing unit that performs spatial smoothing on the gain on the basis of the saturation reliability and then applies the gain to the processing target pixel. As a result, effects of converting illumination components by the gain at which a spatial smoothing is performed on the basis of the saturation reliability are brought about. [15] Furthermore, in the first aspect, the channel gain application unit may include a blackout condition reliability calculation unit that calculates a blackout condition reliability of pixels on the basis of pixel values of the reference image, and a smoothing processing unit that performs spatial smoothing on the gain on the basis of the blackout condition reliability and then applies the gain to the processing target pixel. The channel gain application unit may include a blackout condition reliability calculation unit that calculates a blackout condition reliability of pixels on the basis of pixel values of the reference image and an inter-channel ratio of the reference image to the processing target image, and a smoothing processing unit that performs spatial smoothing on the gain on the basis of the blackout condition reliability and that applies the gain to the processing target pixel. As a result, effects of converting illumination components by the gain at which a spatial smoothing is performed on the basis of the blackout condition reliability are brought about. [16] Furthermore, in this first aspect, the channel gain application unit may include a moving subject reliability calculation unit that determines whether or not the pixel is a subject that has moved in space on the basis of a change in characteristic values in corresponding pixels of the reference image and the processing target image and that calculates a moving subject reliability; and a smoothing processing unit that performs spatial smoothing on the gain on the basis of the moving subject reliability and then applies the gain to the processing target pixel. In this first aspect, the moving subject reliability calculation unit may include a ratio reverse degree calculation unit that calculates the moving subject reliability in accordance with whether or not a change of signal intensities of pixels of the processing target image is in reverse to the direction of a change of illumination components of the entire reference image and processing target image. As a result, effects of converting illumination components by the gain at which a spatial smoothing is performed on the basis of the moving subject reliability are brought about. [17] Furthermore, in the first aspect, the image processing apparatus may further include a resolution conversion unit that converts a resolution of the reference image or the processing target image and then supplies the image to the channel gain calculation unit. At that time, in the first aspect, the resolution conversion unit may perform the resolution conversion by reduction based on thinning out of pixels or may perform the resolution conversion by reduction based on an average of pixels in a block. The resolution conversion unit may perform the resolution conversion by reduction based on a central value of pixels in a block. Furthermore, the resolution conversion unit may perform the resolution conversion by an edge storage type smoothing filter process. As a result, effects of causing the size of the reference image to match the size of the processing target image are brought about. [0018] Furthermore, in the first aspect, the image processing apparatus may further include: a frame memory for storing images that are captured continuously; an addition unit that adds the images that are captured continuously while performing weighting thereon and that generates an input image; and a control parameter determination unit that determines a control parameter used for the continuous image capturing so as to perform image-capture repetition control. As a result, effects of using an image that is combined from a plurality of images that are continuously captured as input images are brought about. [19] Furthermore, in the first aspect, a combination in which the reference image is an image captured without flash emission, and the processing target image is an image captured with flash emission may be used. [20] Furthermore, in the first aspect, the channel gain application unit may include a luminance calculation unit that calculates a luminance on the basis of pixel values of ^ the processing target image, and a smoothing processing unit that performs spatial smoothing on the gain on the basis of the difference in the luminances between pixels and then applies the gain to the processing target pixel. In this case, the luminance calculation unit may calculate the luminance as a linear sum using a weight that is set in advance to the pixel value of the processing target image, and may calculate the luminance on the basis of multiple regression analysis in which an intensity ratio of corresponding pixels of the reference image and the processing target image is an object variate, and the pixel value of the processing target image is an explanatory variate. [21] Furthermore, a second aspect of the present invention provides an image processing apparatus including: a block histogram calculation unit that calculates a frequent value of pixels of a processing target image as a block histogram with regard to each of blocks such that an area is divided into a plurality of portions in a spatial axis direction and in a luminance axis direction; a block integration value calculation unit that calculates an integration value of characteristic values belonging to each of the blocks; a weighted product-sum unit that calculates a global gain value at the target pixel position on the basis of the block histogram, the block integration value, and the luminance value at the target pixel position; and a gain application unit that applies the global gain value to the processing target image. As a result, effects of obtaining a global gain value and converting the illumination components for each channel at each pixel position of the processing target image by using the reference image that is captured under a different illumination environment and by using the global gain value are brought about. [0022] Furthermore, in the second aspect, the integration value of the characteristic value for each of the blocks may be a grand total, for each channel, of gains for converting illumination components for each channel of pixels belonging to each of the blocks, or may be a central value of the gains, for each channel, for converting illumination components of pixels belonging to each of the blocks is multiplied by a frequent value of pixels of the processing target image in the block. [23] Furthermore, in the second aspect, the weighted product-sum unit may include a first interpolation unit that performs an interpolation of the block histogram to the target pixel position by using a weight function in a spatial axis direction, which is defined in advance; a second interpolation unit that performs an interpolation of a characteristic value for each block to the target pixel position by using a weight function in a spatial axis direction, which is defined in advance; a first product-sum unit that calculates a load sum of the interpolated block histogram by using a weight function in a luminance axis direction, which is defined in advance; a second - product-sum unit that calculates a load sum of interpolated characteristic values by using a weight function in a luminance axis direction, which is defined in advance; and a division unit that divides an output of the second product- sum unit by an output of the first product-sum unit. Furthermore, the storage and management process in the weighted product-sum unit may be performed in the order of interpolation in the luminance direction and interpolation in the space direction by interchanging the order. [0024] Furthermore, in this second aspect, the weighted product-sum unit may include a first division unit that divides the characteristic value for each block by the value of the block histogram so as to calculate an average characteristic value at each block position; a comparison unit that compares the average characteristic value with a characteristic value regarding the target pixel position so as to calculate a weight; a first multiplication unit that multiplies the weight calculated in the comparison unit by the characteristic value for each block at a corresponding block position; a second multiplication unit that multiplies the weight calculated in the comparison unit by the value of the block histogram at a corresponding block position; a first interpolation unit that performs an interpolation of a weighted block histogram that is an output of the first multiplication unit to the target pixel position in accordance with a weight function in a spatial axis direction, which is defined in advance; a second interpolation unit that performs an interpolation of a weighted characteristic value for each block, which is an output of the second multiplication unit, to the target pixel position by using a weight function in a spatial axis direction, which is defined in advance; a first product-sum unit that calculates a load sum of the interpolated block histograms by using a weight function in a luminance axis direction, which is defined in advance; a second product-sum unit that calculates a load sum of the interpolated characteristic values by using a weight function in the luminance axis direction, which is defined in advance; and a second division unit that divides an output of the second product-sum unit by an output of the first product-sum unit. Advantageous Effects of Invention [25] According to the present invention, it is possible to obtain superior advantages such that influences due to illumination components can be removed from a plurality of images whose illumination environment is different, and an image having high color reproducibility can be generated. Brief Description of Drawings [26] [Fig. 1] Fig. 1 illustrates an example of an image-capturing device in an embodiment of the present invention. [Fig. 2] Fig. 2 illustrates an example of processing functions of an image processing circuit 23 in a first embodiment of the present invention. [Fig. 3] Fig. 3 illustrates a Bayer arrangement as an example of a color arrangement of a mosaic image that is assumed in the embodiment of the present invention. [Fig. 4] Fig. 4 illustrates a Bayer set in a Bayer arrangement as an example of a color arrangement of a mosaic image that is assumed in the embodiment of the present invention. [Fig. 5] Fig. 5 illustrates an example of the configuration of an illumination component conversion processing unit 120 in the first embodiment of the present invention. [Fig. 6] Fig. 6 illustrates an example of the configuration of a channel gain calculation unit 250 in the first embodiment of the present invention. [Fig. 7] Fig. 7 illustrates an example of a blackout condition degree in the first embodiment of the present invention. [Fig. 8] Fig. 8 illustrates another example of the blackout condition degree in the first embodiment of the present invention. [Fig. 9] Fig. 9 illustrates an example of a saturation degree in the first embodiment of the present invention. [Fig. 10] Fig. 10 illustrates an example of the configuration of a channel gain application unit 260 in the embodiment of the present invention. [Fig. 11] Fig. 11 illustrates an example of the operation of an image-capturing device in the embodiment of the present invention. [Fig. 12] Fig. 12 illustrates an example of the operation of an illumination component conversion processing procedure in the first embodiment of the present invention. [Fig. 13] Fig. 13 illustrates an example of the operation of a channel gain calculation processing procedure in the first embodiment of the present invention. [Fig. 14] Fig. 14 illustrates an example of the operation of a channel gain application processing procedure in the first embodiment of the present invention. [Fig. 15] Fig. 15 illustrates an example of the configuration of the illumination component conversion - processing unit 120 in a second embodiment of the present invention. [Fig. 16] Fig. 16 illustrates an example of the configuration of a channel gain application unit 2 60 in the second embodiment of the present invention. [Fig. 17] Fig. 17 illustrates an example of a saturation reliability in the second embodiment of the present invention. [Fig. 18] Fig. 18 illustrates an example of a blackout condition reliability in the second embodiment of the present invention. [Fig. 19] Fig. 19 illustrates another example of the blackout condition reliability in the second embodiment of the present invention. [Fig. 20] Fig. 20 illustrates an example of the configuration of a moving subject reliability calculation unit 4 60 in the second embodiment of the present invention. [Fig. 21] Fig. 21 illustrates an example of a ratio reverse degree in the second embodiment of the present invention. [Fig. 22] Fig. 22 illustrates an example of a prediction ratio in the second embodiment of the present invention. [Fig. 23] Fig. 23 illustrates an example of a spectral reflectance change amount in the second embodiment of the present invention. [Fig. 24] Fig. 24 illustrates an example of the operation of the channel gain application unit 260 in the second embodiment of the present invention. [Fig. 25] Fig. 25 illustrates an example of the operation of a moving subject reliability calculation unit 460 in the embodiment of the present invention. [Fig. 26] Fig. 26 illustrates an example of processing functions of a smoothing processing unit 480 in a third embodiment of the present invention. [Fig. 27] Fig. 27 illustrates an example of the configuration of block integration value calculation units 531 and 532 and a block histogram calculation unit 533 in the third embodiment of the present invention. [Fig. 28] Fig. 28 illustrates an example of the configuration of weighted product-sum units 561 and 562 in the third embodiment of the present invention. [Fig. 29] Fig. 29 illustrates an example of the shape of a luminance weight function in the third embodiment of the present invention. [Fig. 30] Fig. 30 illustrates a first half of the smoothing processing unit 480 in the third embodiment of the present invention. [Fig. 31] Fig. 31 illustrates a second half of an example of the operation of the smoothing processing unit 480 in the third embodiment of the present invention. [Fig. 32] Fig. 32 illustrates an example of the operation of block integration value calculation units 531 and 532 and a block histogram calculation unit 533 in the third embodiment of the present invention. [Fig. 33] Fig. 33 illustrates an example of the operation of the weighted product-sum units 561 and 562 in the third embodiment of the present invention. [Fig. 34] Fig. 34 illustrates an example of the configuration of an illumination component conversion processing unit 120 in a fourth embodiment of the present invention. [Fig. 35] Fig. 35 illustrates an example of the configuration of a channel gain application unit 260 in the fourth embodiment of the present invention. [Fig. 36] Fig. 36 illustrates an example of the configuration of a smoothing processing unit 480 in the fourth embodiment of the present invention. [Fig. 37] Fig. 37 illustrates an example of the operation of the illumination component conversion processing unit 120 in the fourth embodiment of the present invention. [Fig. 38] Fig. 38 illustrates an example of the operation of the channel gain application unit 260 in the fourth embodiment of the present invention. [Fig. 39] Fig. 39 illustrates a first half of an example of the operation of the smoothing processing unit 480 in the fourth embodiment of the present invention. [Fig. 40] Fig. 40 illustrates a second half of the example of the operation of the smoothing processing unit 480 in the fourth embodiment of the present invention. [Fig. 41] Fig. 41 illustrates an example of the configuration of an illumination component conversion processing unit 120 in a fifth embodiment of the present invention. [Fig. 42] Fig. 42 illustrates an example of the configuration of a frame addition unit 280 in the fifth embodiment of the present invention. [Fig. 43] Fig. 43 illustrates a first half of an example of the operation of the illumination component conversion processing unit 120 in the fifth embodiment of the present invention. [Fig. 44] Fig. 44 illustrates a second half of the example of the operation of the illumination component conversion processing unit 120 in the fifth embodiment of the present invention. [Fig. 45] Fig. 45 illustrates an example of processing functions of an image processing circuit 23 in a sixth embodiment of the present invention. [Fig. 46] Fig. 46 illustrates an example of processing functions of an image processing circuit 23 in a seventh embodiment of the present invention. [Fig. 47] Fig. 47 illustrates an example of processing s, functions of an image processing circuit 23 in an eighth embodiment of the present invention. [Fig. 48] Fig. 48 illustrates an example of processing functions of a smoothing processing unit 480 in the embodiment of the present invention. [Fig. 49] Fig. 49 illustrates another example of the processing functions of a smoothing processing unit 480 in the embodiment of the present invention. [Fig. 50] Fig. 50 illustrates a first half of an example of the operation of the smoothing processing unit 480 in a ninth embodiment of the present invention, which corresponds to the example of the processing functions of Fig. 48. [Fig. 51] Fig. 51 illustrates a second half of the example of the operation of the smoothing processing unit 480 in the ninth embodiment of the present invention, which corresponds to the example of the processing functions of Fig. 48. [Fig. 52] Fig. 52 illustrates a first example of the operation of the smoothing processing unit 480 in the ninth embodiment of the present invention, which corresponds to the example of the processing functions of Fig. 49. [Fig. 53] Fig. 53 illustrates a second example of the operation of the smoothing processing unit 480 in the ninth embodiment of the present invention, which corresponds to the example of the processing functions of Fig. 49. [Fig. 54] Fig. 54 illustrates a third example of the operation of the smoothing processing unit 480 in the ninth embodiment of the present invention, which corresponds to the example of the processing functions of Fig. 49. [Fig. 55] Fig. 55 illustrates an example of processing functions of the smoothing processing unit 480 in a tenth embodiment of the present invention. [Fig. 56] Fig. 56 illustrates an example of the configuration of weighted product-sum units 561 and 562 in the tenth embodiment of the present invention. [Fig. 57] Fig. 57 illustrates an example of the calculation of a weight 0 of weighted product sum in the tenth embodiment of the present invention. [Fig. 58] Fig. 58 illustrates another example of processing functions of the smoothing processing unit 480 in the tenth embodiment of the present invention. [Fig. 59] Fig. 59 illustrates an example of the configuration of weighted product-sum units 561 and 562 corresponding to the processing functions of Fig. 58 of the smoothing processing unit 480 in the tenth embodiment of the present invention. [Fig. 60] Fig. 60 illustrates an example of the operation corresponding to the example of the processing functions of Fig. 55 of the smoothing processing unit 480 in the tenth embodiment of the present invention. [Fig. 61] Fig. 61 illustrates a first half of an example of v. the operation of the weighted product-sum units 561 and 562 in the tenth embodiment of the present invention. [Fig. 62] Fig. 62 illustrates a second half of the example of the operation of the weighted product-sum units 561 and 562 in the tenth embodiment of the present invention. [Fig. 63] Fig. 63 illustrates an example of the operation of the smoothing processing unit 480 in the tenth embodiment of the present invention. Description of Embodiments [0027] Hereinafter, modes for carrying out the present invention (hereinafter referred to as embodiments) will be described. The description will be given in the following order. 1. First Embodiment (example in which gain application is performed by multiplication) 2. Second Embodiment (example in which gain application is performed by weight smoothing) 3. Third Embodiment (example in which gain application is performed by edge preservation type smoothing using block histogram) 4. Fourth Embodiment (example in which resolution conversion is performed on input image) 5. Fifth Embodiment (example in which input images are combined by using frame memory) 6. Sixth Embodiment (example in which white balance process is performed at stage proceeding illumination component conversion process) 7. Seventh Embodiment (example in which input image on which white balance process has been performed is used) 8. Eighth Embodiment (example in which input image on which gamma correction process has been performed is used) 9. Ninth Embodiment (example in which luminance is calculated using multiple regression analysis) 10. Tenth Embodiment (example in which smoothing is performed using gain) [28] <1. First Embodiment> [Example of configuration of image-capturing device] Fig. 1 illustrates an example of an image-capturing device in an embodiment of the present invention. This image-capturing device, when broadly classified, includes an optical system, a signal processing system, a recording system, a display system, and a control system. [29] The optical system includes a lens 11 for collecting light from an optical image of a subject, an aperture 12 for adjusting the amount of light of the optical image, and an image-capturing element 13 for performing photoelectric conversion on the collected optical image so as to be converted into an electrical signal. The image-capturing element 13 is realized by, for example, a CCD image sensor or a CMOS image sensor. [30] The signal processing system includes a sampling circuit 21, an A/D conversion circuit 22, and an image processing circuit 23. The sampling circuit 21 samples an electrical signal from the image-capturing element 13. This sampling circuit 21 is realized by, for example, a correlation double sampling circuit (CDS). As a result, noise that occurs in the image-capturing element 13 is ** reduced. The A/D conversion circuit 22 converts an analog signal supplied from the sampling circuit 21 into a digital signal. The image processing circuit 23 performs predetermined image processing on a digital signal input from the A/D conversion circuit 22. The image processing circuit 23 is realized by, for example, a DSP (Digital Signal Processor). Meanwhile, the details of the process performed by the image processing circuit 23 will be described later. [31] The recording system includes a memory 32 for storing an image signal, and a coder/decoder 31 for coding an image signal that is processed by the image processing circuit 23, recording it in the memory 32, further reading an image signal from the memory 32 and decoding it, and supplying the image signal to the image processing circuit 23. Meanwhile, the memory 32 may be a magnetic disk, an optical disc, a magneto-optical disc, a semiconductor memory, or the like. [32] The display system includes a display driver 41 for outputting an image signal processed by the image processing circuit 23 to the display unit 42, and a display unit 42 for displaying an image corresponding to the input image signal. The display unit 42 is realized by, for example, an LCD (Liquid Crystal Display) or the like, and has a function as a finder. [33] The control system includes a timing generator 51, an operation input acceptance unit 52, a driver 53, a control unit 54, a flash emitting unit 61, and a flash control unit 62. The timing generator 51 controls the operation timing of the image-capturing element 13, the sampling circuit 21, the A/D conversion circuit 22, and the image processing circuit 23. The operation input acceptance unit 52 accepts a shutter operation and other commands input by a user. The driver 53 is a driver for connecting peripheral devices. A magnetic disk, an optical disc, a magneto-optical disc, a semiconductor memory, or the like is connected to the driver 53. The control unit 54 controls the entire image-capturing device. This control unit 54 reads a controlling program stored in these through the driver 53, and performs control in accordance with the read controlling program, a command from the user, which is input from the operation input acceptance unit 52, and the like. The flash emitting unit 61 illuminates a subject at the time of image-capturing with light, and is sometimes called as a strobe. The flash control unit 62 controls the flash emitting unit 61, and causes the flash emitting unit 61 to emit light in accordance with instructions from the user, the neighboring brightness, and the like. [34] The image processing circuit 23, the coder/decoder 31, the memory 32, the display driver 41, the timing generator 51, the operation input acceptance unit 52, the control unit 54, and the flash control unit 62 are interconnected with one another through a bus 59. [35] In the image-capturing device, the optical image (incident light) of the subject enters the image-capturing element 13 through the lens 11 and the aperture 12, and is photoelectrically converted by the image-capturing element 13 so as to become an electrical signal. Noise components of the obtained electrical signal are removed by the sampling circuit 21. After the electrical signal is ^ digitized by the A/D conversion circuit 22, it is temporarily stored in an image memory (not shown) incorporated in the image processing circuit 23. [36] Meanwhile, in a usual state, under the control by the timing generator 51 on the signal processing system, an image signal is constantly overwritten at a fixed frame rate in the image memory incorporated in the image processing circuit 23. The image signal of the image memory incorporated in the image processing circuit 23 is output to the display unit 42 through the display driver 41, and a corresponding image is displayed on the display unit 42. [37] The display unit 42 also serves as a finder for the image-capturing device. In a case where the user presses a shutter button included in the operation input acceptance unit 52, the control unit 54 controls the signal processing system so that the timing generator 51 holds the image signal immediately after the shutter button is pressed, that is, the image signal is not overwritten in the image memory of the image processing circuit 23. The image data held in the image memory of the image processing circuit 23 is coded by the coder/decoder 31 and is recorded in the memory 32. With the operation of the image-capturing device such as those described above, the acquisition of one image data is completed. [38] [Example of processing functions of image processing circuit 23] Fig. 2 illustrates an example of processing functions of the image processing circuit 23 in a first embodiment of the present invention. The image processing circuit 23 includes an illumination component conversion processing unit 120, a white balance processing unit 130, a demosaic processing unit 140, a gradation correction processing unit 150, a gamma correction processing unit 160, and a YC conversion processing unit 170. The image processing circuit 23 performs image processing by using a mosaic image digitized by the A/D conversion circuit 22 as an input image. A mosaic image is such that an intensity signal corresponding to one of the colors of R, G, and B is stored in each pixel, and for the color arrangement thereof, a Bayer arrangement shown in Fig. 3 is assumed. Meanwhile, a mosaic image is sometimes called as RAW data. Furthermore, the intensity signal stored in each pixel is not limited to R, G, and B, and may be C, M, and Y or color information other than that. [39] The image processing circuit 23 includes, as input unit, a reference mosaic image holding unit 111 and a processing target mosaic image holding unit 112. The reference mosaic image holding unit 111 is a memory for holding a mosaic image (reference image Mc) serving as a reference (criterion). The processing target mosaic image holding unit 112 is a memory for holding a mosaic image (processing target image Ms) serving as a processing target (subject). In the embodiment of the present invention, it is assumed that the color balance of the processing target image is adjusted by using the color balance (the ratio of color) in the reference image. [40] The illumination component conversion processing unit 120 converts the illumination components of the processing target image by using the ratio of the colors in the reference image, and generates a mosaic image Mi. That is, the processing target image is multiplied by an appropriate coefficient for each channel so as to become equal to the color balance of the reference image so as to be converted into a color balance of a single light source. Meanwhile, the configuration of the illumination component conversion processing unit 120 will be described later. [41] The white balance processing unit 130 performs a white balance process on the mosaic image M1. The white balance processing unit 130 multiplies an appropriate coefficient to the mosaic image M1 in accordance with the color possessed by each pixel intensity so that the color balance of a subject area of an achromatic color becomes an achromatic color. The mosaic image Mw on which the white balance process has been performed is supplied to the demosaic processing unit 140. [42] The demosaic processing unit 140 performs an interpolation process (demosaic process) so that the intensities of all the channels of R, G, and B are fully prepared at the pixel positions of the mosaic image Mw. The demosaic image [Rg, Gg, Bg]T on which this interpolation process has been performed are three images (RGB images) corresponding to three colors of R (Red), G (Green), and B (Blue), and are supplied to the gradation correction processing unit 150. Meanwhile, the matrix AT means a transposition matrix of a matrix A. [43] The gradation correction processing unit 150 performs a gradation correction process on each pixel in the image [Rg, Gg, Bg]T of the output of the demosaic processing unit 140. The image [Ru, Gu, BU]T on which the gradation correction process has been performed is supplied to the gamma correction processing unit 160. [44] The gamma correction processing unit 160 performs a gamma correction process on the image [Ru, GU, BU]T. The gamma correction process is a correction for reproducing a display close to the input image on the display unit 42. The output [RUY, Guy, BUY]T of the gamma correction processing unit 160 is supplied to the YC conversion processing unit 170. [45] The YC conversion processing unit 170 performs a YC matrix process and band limitation for chroma components on the gamma-corrected 3-channel image [RUY, GUY, BUY]T, thereby outputting a luminance signal Y and a color-difference signal C (Cr, Cb). The luminance signal and the color- difference signal are held in the Y image holding unit 191 and the C image holding unit 192, respectively, and are supplied to the coder/decoder 31 at a subsequent stage of the image processing circuit 23. [46] Meanwhile, in a usual case, an RGB signal is supplied to the display driver 41. This RGB signal is such that the luminance signal and the color-difference signal, which are outputs of the YC conversion processing unit 170, are converted into an RGB signal. [47] [Bayer arrangement and Bayer set] Fig. 3 illustrates a Bayer arrangement as an example of a color arrangement of a mosaic image that is assumed in the embodiment of the present invention. In this Bayer arrangement, pixels of the color G are arranged in a checkered pattern, pixels of the color R are arranged in the form of a regular lattice every other pixel in the horizontal direction and in the vertical direction at positions other than those of the pixels, and pixels of the color B are arranged in the form of a regular lattice every other pixel in the horizontal direction and in the vertical direction at the positions of the remaining pixels. [48] Fig. 4 illustrates a Bayer set in a Bayer arrangement as an example of a color arrangement of a mosaic image that is assumed in the embodiment of the present invention. In the embodiment of the present invention, during a conversion process for illumination components in the illumination component conversion processing unit 120, four pixels of horizontal two pixels x vertical two pixels of a mosaic image may be handled as a unit. A set of four pixels will be referred to as a Bayer set. Specifically, a collection of those four pixels by using a position 601 adjacent to four pixels of G, B, R, and G as the center is a Bayer set 602. [49] [Example of configuration of illumination component conversion processing unit 120] Fig. 5 illustrates an example of the configuration of an illumination component conversion processing unit 120 in the first embodiment of the present invention. The illumination component conversion processing unit 120 includes demosaic processing units 221 and 222, a white balance calculation unit 230, a reference image white balance holding unit 240, a channel gain calculation unit 250, and a channel gain application unit 260. [50] The demosaic processing unit 221 performs a demosaic process on a reference image held in the reference mosaic image holding unit 111, and generates a demosaic image Ic(p) of the reference image in which channels necessary for obtaining an intensity and a reliability are fully prepared for each pixel. Meanwhile, p denotes each pixel position. The demosaic processing unit 222 performs a demosaic process on the processing target image held in the processing target mosaic image holding unit 112, and generates a demosaic image Is(p) of the processing target image in which channels necessary for obtaining an intensity and a reliability are fully prepared for each pixel. Meanwhile, in the first embodiment of the present invention, it is sufficient that a G channel for obtaining an intensity is obtained for each v pixel. [0051] When a demosaic process is to be performed, the demosaic processing units 221 and 222 may perform a simplified process for performing demosaicing at the position 601 by using the Bayer set 602 of Fig. 4 as a processing unit. The demosaicing method at this time may be a process in which for the pixels of the R and B channels, the pixels are used "as is", and for the pixels of the G channel, an average of two pixels is calculated. In this case, an image in which the height and width thereof is reduced by 1/2 and three channels are fully prepared is generated. Furthermore, the demosaic process in the demosaic processing units 221 and 222 may be performed for each pixel by referring to a wider area like the demosaic process in the demosaic processing unit 140 of Fig. 2. In this case, a reduction is not performed, and only the demosaicing is performed. Furthermore, when a demosaic process is performed for each pixel, the pixel pM before demosaicing becomes identical to the pixel p after demosaicing, and the line from the mosaic image Ms to the gain application unit becomes unnecessary. [0052] The white balance calculation unit 230 calculates, for each channel, a white-balance gain of the reference image held in the reference mosaic image holding unit 111. As a method of calculating a white balance at this time, a gain such that the ratio of the average values of the RGB pixels of the entire screen is 1:1:1 on the basis of the gray world hypothesis may be obtained. Furthermore, as another calculation method, a white balance can be obtained as an optimization problem as described in paragraphs 0071 to 0081 of Japanese Unexamined Patent Application Publication No. 2006-67561 together with the processing target image held in the processing target mosaic image holding unit 112. In addition, the white balance may be set by a technique similar to that of the white balance processing unit 130 in Fig. 2. Furthermore, the white balance may take a form in which the white balance is set in advance before image- capturing. The setting method assumes a method in which setting is performed by an image-capturing person at an image-capturing time on the basis of the color temperature measured by another apparatus, such as a colormeter. By setting a fluorescent lamp or a scene such as a cloudy sky, setting is possible by using a preset white balance. Alternatively, setting may also be performed by capturing an image of a white body by using a custom white balance (white set) function. The calculated white balance is stored in the reference image white balance holding unit 240. [53] The channel gain calculation unit 250 calculates a gain FS(p), for each channel for color balance adjustment on the basis of the R, G, and B values of the reference image and the processing target image, and the white balance of the reference image. The gain FS(p) is a gain value for each channel for converting the illumination components of the processing target image. As will be described later, this gain can be obtained by obtaining the ratio of the reference image to the processing target image by using any of the channels as a reference. For example, in a case where the G channel is used as a reference, the gain FSG(p) of the G channel is "1". The gain calculated by the channel gain calculation unit 250 is supplied to the channel gain application unit 260. [54] The channel gain application unit 260 applies the gain calculated by the channel gain calculation unit 250 to each channel of the processing target image. Although the details of the gain application will be described later, the simplest application form is considered such that the processing target image is multiplied by a gain. The mosaic image Mi on which gain application has been performed by the channel gain application unit 2 60 is held in the illumination component converted mosaic image holding unit 290 and is supplied to the white balance processing unit 130 at a subsequent stage. [55] [Example of configuration of channel gain calculation unit 250] Fig. 6 illustrates an example of the configuration of the channel gain calculation unit 250 in the first embodiment of the present invention. The channel gain calculation unit 250 includes color conversion gain calculation units 311 and 312, and calculates a gain S(p). [56] In the embodiment of the present invention, a gain is obtained for each channel of each pixel by using two images (reference image and processing target image) that are captured under different illumination environments with respect to the same subject and is applied, thereby generating an image having high color reproducibility. The reference image is an image whose white balance for each pixel has already been obtained or which can be easily obtained by a technique of related art or the like. On the other hand, the processing target image is assumed to be an image in which the estimation of a white-balance gain for each pixel is difficult from the image itself, such as an image captured under a plurality of light sources having a color temperature different from that of the reference image. As a result, by obtaining the white balance of the reference ^ image, it becomes possible to indirectly calculate the white balance of the processing target image, making it possible to solve the problem of the white balance with respect to the image captured under a plurality of light sources. As a specific combination, a combination of an image captured without causing a flash to emit light and an image captured by causing a flash to emit light is assumed. Furthermore, as another example, a combination of an image having band- shaped noise (flicker) due to an influence of a fluorescent lamp and an image not having that, a combination of images for which light sources are changed in an environment in which a plurality of light sources exist, or the like is assumed. [57] When the intensity measured by a sensor in each pixel is denoted as I, the illumination intensity as E, and the spectral reflectance as p, an approximation can be made in accordance with the relationship of the following equation. I(p) = E(p)-p(p) where [Maths 1] Here, when the ratio of two images is calculated by setting the intensity of the reference image as Ic and the intensity of the processing target image as is, it is possible to approximately cancel the influence of the spectral reflectance ρ for each channel, and the ratio Ko of the yes illumination components that are not dependent on the spectral reflectance can be obtained as the following equation. [Math 2] [58] When comparing two images, by correcting the image- capturing conditions so as to make the image-capturing conditions uniform, it is possible to normalize the value Ko so as to make Ko be the ratio of a pure illumination color balance. By dividing a processing target pixel Is by the value Ko, it is possible to map the illumination components of the processing target pixel into the color balance of the illumination of the reference image. However, if the processing target pixel is simply divided by Ko, as well as the color balance, the signal intensities are made uniform to the intensity of the reference image and thus, improvement advantage of the intensity by flash is lost. Accordingly, in order to maintain the illumination intensity, a correction that cancels an intensity change is added, and the gain S can be represented as the following equation. [Math 3] where KI denotes the value that is determined for each pixel according to the definition of the intensity. In the embodiment of the present invention, the following relation is used to fix the value of the G channel similarly to the gain of a typical white balance. KI(p) = KoG(p) = Gs(p)/Gc(p) that is, [Math 4] S10P12 87 The color conversion gain calculation units 311 and 312 calculate the gain SR(P) and SB(p), respectively, in accordance with the above equation. Meanwhile, in the embodiment of the present invention, since it is presumed that the value of the G channel is fixed, the gain SG(p) always becomes "1". Meanwhile, the reason why the value of the G channel is fixed is that the signal of the G channel has the greatest number of pixels, furthermore, the sensitivity is high, and thus, the reliability is considered to be high. [59] Meanwhile, in the embodiment of the present invention, the gain S is calculated by the ratio Ko of the same channel between the images. The same process may be realized by changing the computation order. In general, a division process is a process in which the computation cost is high. In order to reduce the number of computations, use of a technique, such as a process based on a reciprocal look-up table or subtraction after being converted into a logarithm, is preferable. Furthermore, for the value of KI, needless to say, a ratio of other than the G channel, such as a luminance value for each pixel, can be used. [60] By multiplying the gain obtained in this manner to each pixel in the channel gain application unit 2 60, an image whose illumination intensity is equal to that of the processing target image can be obtained at the color balance of the reference image. In the technique according to the embodiment of the present invention, separation of light sources is not performed, and by viewing the combined light of the processing target image as one light source, the combined light is mapped to the color balance of the illumination of the reference image. For this reason, even if the difference of the two images is formed of plural light sources, the embodiment operates normally. [61] However, in the above equation, it is presumed that the color balance of the reference image is correct. In a case where the channel of each pixel is saturated or a blackout condition has occurred, the color balance itself of the reference pixel is not correct. Furthermore, in even the pixels corresponding to a moving subject, the ratio Ko is not obtained correctly, and the gain S may become a very large value or a very small value. For this reason, the illumination component conversion processing unit 120 further includes upper limit value clipping units 321 and 322 and lower limit value clipping units 331 and 332. With this arrangement, an upper limit value and a lower limit value are set in the values of the gain, and a clipping process is performed, thereby suppressing an extreme artifact. Furthermore, the illumination component conversion processing unit 120 further includes blackout condition compensation units 341 and 342, a blackout condition degree calculation unit 345, saturation compensation units 351 and 352, and a saturation degree calculation unit 355. With this arrangement, reference values for a blackout condition and saturation are given, a determination is made as to the effectiveness of the gain S, and a weighted average with a compensation value determined in a scheme unique to the time of blackout condition and saturation is set as a gain, thereby obtaining a gain at which a large breakdown does not occur. [62] The upper limit value clipping units 321 and 322 perform a clipping process so that the gain SR(p) or SB(p) becomes an upper limit value in a case where it exceeds the upper limit value. The lower limit value clipping units 331 and 332 perform a clipping process so that the gain SR(p) or SB(p) becomes a lower limit value in a case where it falls ^ below the lower limit value. The gain upper limit value can be set in advance in the gain upper limit value R holding unit 323 or in the gain upper limit value B holding unit 324. Furthermore, the gain lower limit value can be set in advance in the gain lower limit value R holding unit 333 or in the gain lower limit value B holding unit 334. The gain upper limit value and the gain lower limit value may be set from the outside or may be calculated internally and then set. When calculating the gain upper limit value and the gain lower limit value, the following equation can be used. [Math 5] [Math 6] [63] In the above equations, WBC is a white balance for the reference image, and WBS is a white balance for the processing target image. Consequently, the gain applied to each pixel together with the gain in the white balance processing unit 130 at a subsequent stage falls below between the white balance of the reference image corresponding to the channel and the white balance of the processing target image, and a large breakdown can be prevented. Here, for WBC, the value calculated by the white balance calculation unit 230 can be used. Furthermore, for WBS, the white-balance value obtained by measuring the flash emitting unit 61 of Fig. 1 in advance. Furthermore, a value obtained from the processing target image by the same technique as that of WBC may be used. [Math 7] [64] The gains SmacR(p) and SmaCB(p) on which a clipping process has been performed by the upper limit value clipping units 321 and 322 are supplied to the lower limit value clipping units 331 and 332, respectively. Furthermore, the gains SminCR(p) and SminCB(p) on which a clipping process has been performed by the lower limit value clipping units 331 and 332 are supplied to the blackout condition compensation units 341 and 342, respectively. [65] The blackout condition degree calculation unit 345 calculates a blackout condition degree indicating a degree to which the blackout condition has occurred on the basis of the value of a specific channel of the reference image or the processing target image. Here, for the specific channel, the G channel is assumed. In general, in an image sensor, linearity is lost in the characteristics of the sensor in a blackout condition area. In addition, regarding a channel in which a complete blackout condition occurs and the pixel value has become 0, the ratio Ko is not correctly obtained. Accordingly, for the pixel having a very small pixel value, it is necessary to calculate the gain by another method. When the target pixel of the processing target image is dark, this is inconspicuous even if an incorrect gain is calculated and a color balance is applied. However, when the target pixel has a sufficient luminance by a flash, the breakdown of the color balance is greatly conspicuous. As a result of this, it is preferable that the characteristic demanded for the blackout condition degree takes a large value when the reference image has a very small value, and shows a large value when the processing target image becomes ^ sufficiently bright due to a flash. [66] Accordingly, for the blackout condition degree PGB(p), it is effective that a value that suddenly decreases from 0 to the value of Gc serving as a certain threshold value, and that becomes 0 at and over the threshold value is used as in Fig. 7 and in the following equation. [Math 7] where Ghite_level is an upper limit value of Gc. This equation is used to calculate a blackout condition degree from the pixel value of the reference image. [67] Furthermore, in order to make clear that the area has become bright as a result of a flash being hit, the blackout condition degree PGB(p) may be set in accordance with Fig. 8 and the following equation. This equation is used to calculate a blackout condition degree on the basis of the pixel value of the reference image and the inter-channel ratio of the reference image to the processing target image. [Math 8] where expCV is the coefficient for correcting a difference in the exposure, which results from the difference in the ^ aperture, the shutter speed, and the ISO sensitivity setting for the sensor, between the reference image and the processing target image. Furthermore, in a simplified form, expCV may be set in accordance with the following equation based on Exif information, where F denotes the F value indicating an aperture, t denotes the shutter speed, and ISO denotes ISO sensitivity. The respective subscripts c mean a reference image, and subscripts s mean a processing target image. [Math 9] [0068] The blackout condition degree of the latter suddenly decreases from 0 to the value of Gs-expCV at which exposure is adjusted, and becomes 0 at and following Gs'expCV, The blackout condition degree has a large value when the intensity Gc of G of the reference image is small and a blackout condition has occurred on account of monotonously decreasing characteristic. In addition, as a result of having attributes in the form of a downwardly convex from 0 to Gs-expCV, the blackout condition degree has a large value when the ratio of the reference image to the processing target image after exposure adjustment is large, that is, when the contribution rate of the flash is large. In the case of a weight having such characteristics, the weight calculation method is not limited to the above-mentioned equation. [69] The blackout condition compensation value R holding unit 343 and the blackout condition compensation value B holding unit 344 hold a blackout condition compensation value serving as a criterion when a blackout condition is to be compensated for. It is effective that the blackout condition compensation value is set as WBs/WBc by considering that the illumination components of the processing target pixels are almost produced by a flash. For WBc and WBs at this time, values identical to those for the white balance, which are used to calculate the upper limit value and the lower limit value, can be used. Furthermore, for WBs herein, the white-balance value obtained by double white balance correction described in Japanese Patent No. 3889017 may be used. [70] The blackout condition compensation units 341 and 342 perform a process that causes the gains Sminc (SminCR (p) and SmincB (P) ) to approach the blackout condition compensation values held in the blackout condition compensation value R holding unit 343 and the blackout condition compensation value B holding unit 344. Specifically, the blackout condition compensation units 341 and 342 generate gains SbiacR (P) and SbiacB(p) in accordance with a pro-rata process (weighted average) with Sminc in which the blackout condition degree PGB(p) is a weight, and the blackout condition compensation value. [71] The saturation degree calculation unit 355 calculates a saturation degree indicating the degree to which the reference image is saturated (whiteout condition) on the basis of the value of the G channel of the reference image. In general, in the saturation area of the image sensor, the linearity is lost in the characteristics of the sensor. Then, in addition, regarding a channel in which the image is completely saturated and the value has reached the upper limit value, the ratio Ko is not correctly obtained. Accordingly, regarding a pixel whose pixel value is very large, it is necessary to calculate the gain by another method. For the saturation degree PGS(p), a value having such characteristics as those of Fig. 9 is considered to be effective. That is, the saturation degree is 0 up to a certain threshold value, and the saturation degree suddenly increases in an area in which the intensity Gc of G of the reference image exceeds the threshold value. In a case where the reference pixel is saturated, it is expected that, also in the processing target pixel, ambient light components among the illumination components have a sufficient magnitude. [72] The saturation compensation value R holding unit 353 and the saturation compensation value B holding unit 354 hold a saturation compensation value serving as a criterion when the saturation is to be compensated for. It is considered to be effective that this saturation compensation value is set to "1". [73] The saturation compensation units 351 and 352 perform a process for making gains SBLAC (SBLACR(P) (p) and SbiacB(p)) approach the saturation compensation value held in the saturation compensation value R holding unit 353 and the saturation compensation value B holding unit 354. Specifically, the saturation compensation units 351 and 352 generate gains FSR(P) and FSB(p) in accordance with a pro-rata process (weighted average) of the gain Sbiac in which the saturation degree PGS(p) is a weight, and the saturation compensation value. [74] Meanwhile, in the above-mentioned blackout condition degree calculation unit 345 and saturation degree calculation unit 355, a determination is made as to the blackout condition degree and the saturation degree by using the G channel, but this determination is not limited to the G channel. A determination using R and B channels, or a determination based on the maximum/minimum, the linear sum, and the luminance value thereof, and the like,are also effective. [75] In the channel gain calculation unit 250, in the intensity in the gain obtained by the color conversion gain calculation units 311 and 312, in the blackout condition degree determination by the blackout condition degree calculation unit 345, and in the saturation degree determination by the saturation degree calculation unit 355, the G channel is used. Thus, it is necessary to have a value for the G channel for each pixel in addition to the original channel in the mosaic image, but it is not necessarily necessary regarding channels other than that. Furthermore, this channel that becomes necessary for each pixel changes as the channel serving as a criterion for an intensity is changed. [0076] [First example of configuration of channel gain application unit 260] Fig. 10 illustrates a first example of the configuration of a channel gain application unit 260 in the embodiment of the present invention. The first example of the configuration of the channel gain application unit 2 60 includes multiplication units 261 and 262. The multiplication unit 261 multiplies Rs(p) of a processing target image Is(p) from the demosaic processing unit 222 by a gain FSR(p) from the channel gain calculation unit 250. The multiplication unit 262 multiplies Bs(p) of the processing target image Is(p) from the demosaic processing unit 222 by a gain FSB(p) from the channel gain calculation unit 250. When the processes of them are represented by an equation, the following equation is obtained. R1(p) = FSR(p) x Rs(p) B1(p) = FSB(P) X Bs(p) [77] R1 (p) and Bi(p) form the R channel and the B channel of the mosaic image Mi, respectively. Furthermore, in the embodiment of the present invention, since the gain for the G channel is fixed to 1, the value for the G channel is not changed before and after the illumination component conversion process. For this reason, the respective pixels of G of the mosaic image Ms of the processing target image are read as G at corresponding positions in the mosaic image Mi and are stored. Depending on the intensity of the signal held when the gain is to be calculated, it becomes necessary to apply a gain for the G channel. In that case, in the channel gain calculation unit 250, the gain for the G channel is calculated conforming to the R and B channels, and the gain is applied in the channel gain application unit 260. [78] Meanwhile, in the first example of the configuration of the channel gain application unit 260, the input of the reference image Ic(p) from the demosaic processing unit 221 becomes unnecessary. [79] [Example of operation] Fig. 11 illustrates an example of the operation of an image-capturing device in the embodiment of the present invention. First, image capturing is performed without causing the flash emitting unit 61 to emit light (step S901). The image is stored as a mosaic image Mc of the reference image in the reference mosaic image holding unit 111 (step S902). Next, image capturing in which the flash emitting unit 61 is made to emit light is performed (step S903). The image is stored as a mosaic image Ms of the processing target image and is stored in the processing target mosaic image holding unit 112 (step S904). [80] After that, the illumination component conversion processing unit 120 of the image processing circuit 23 adjusts the color balance of the processing target image on the basis of the two captured images, and converts the illumination components into the color balance of a single light source (step S910). Then, the white balance processing unit 130 adjusts the color balance of the mosaic image (step S905). Next, the demosaic processing unit 140 generates an RGB image in which the RGB information is fully- prepared on each pixel from the mosaic image (step S906). Next, the gradation correction processing unit 150 performs a gradation correction process on the RGB image (step S907) . Next, the gamma correction processing unit 160 performs a gamma correction process on the image that has been subjected to gradation correction (step S908). Next, the YC conversion processing unit 17 0 converts the gamma-corrected RGB image into a YC image (step S909). The converted YC image is output for the display on an LCD or for the storage on a recording medium. As a result of the above, the operation of the image processing unit for one frame is completed. If there is no input of the subsequent frame, the operation of the image processing unit is completed. Meanwhile, the image-capturing order may be reversed in such a manner that, regarding the presence or absence of the light emission of the flash emitting unit 61, the image with light emission is captured earlier. [81] Fig. 12 illustrates an example of the operation of an illumination component conversion processing procedure (step S910) in the first embodiment of the present invention. First, the reference image is read (step S911), and a white balance for each channel for the reference image is calculated (step S912). The calculated white balance is held in the reference image white balance holding unit 240 (step S913). Hereinafter, in the following steps, processing for each pixel is made to proceed with respect to the entire screen. [0082] Next, the processing target image is read (step S914). The read reference image and processing target image are subjected to a demosaic process in the demosaic processing units 221 and 222, respectively (steps S915 and S916). At this time, the order of the demosaic processes does not matter. Then, in the channel gain calculation unit 250, the gain for each channel for color balance adjustment is calculated from the values of R, G, and B of the reference image and the processing target image (step S917). The calculated gain is used for each channel of the processing target image in the channel gain application unit 2 60 (step S918). The processing target image that is processed in this manner is held in the illumination component converted ^ mosaic image holding unit 290 (step S919). [83] When the processing of steps S911 to S919 is completed, the illumination component conversion process for one frame is completed. [84] Fig. 13 illustrates an example of the operation of a channel gain calculation processing procedure (step S917) in the first embodiment of the present invention. First, a gain upper limit value or a lower limit value is set correspondingly in the gain upper limit value R holding unit 323, the gain upper limit value B holding unit 324, the gain lower limit value R holding unit 333, and the gain lower limit value B holding unit 334 (step S921). Furthermore, a ^ blackout condition compensation value is set in the blackout condition compensation value R holding unit 343 and the blackout condition compensation value B holding unit 344, and a saturation compensation value is set in the saturation compensation value R holding unit 353 and the saturation compensation value B holding unit 354 (step S922) . Then, the following processing is repeated by using each pixel as a target. [85] In a loop L702, the pixel of the processing target image and the pixel of the reference image are obtained (step S923). Then, in the blackout condition degree calculation unit 345, a blackout condition degree is calculated (step S924), and in the saturation degree calculation unit 355, a saturation degree is calculated (step S925). Then, furthermore, the following processing is repeated by using each channel (the R channel and the B channel) as a target (loop L703). [86] In the loop L703, a color conversion gain is calculated by the color conversion gain calculation units 311 and 312 (step S926). At this time, when the gain exceeds the gain upper limit value that is held in the gain upper limit value B holding unit 324 or the gain upper limit value R holding unit 323 (step S927), a clipping process using the gain i, upper limit value is performed (step S928). In a case where the gain lower limit value falls below the gain lower limit value that is held in the gain lower limit value R holding unit 333 or the gain lower limit value B holding unit 334 (step S929), a clipping process using the gain lower limit value is performed (step S931) . The clipping processes may be performed in the order of the lower limit value and the upper limit value. Furthermore, in the blackout condition compensation unit 341 or 342, blackout condition compensation corresponding to the blackout condition degree is performed (step S932). Furthermore, in the saturation compensation unit 351 or 352, saturation degree compensation corresponding to the saturation degree is performed (step S933). The gain that is obtained in this manner is stored in a memory (not shown) (step S934). [87] When the processing of steps S926 to S934 in the loop L703 is completed, the same processing is repeated with regard to the next channel. When the processing for all the channels is completed, control exits from the loop L7 03, and the processing for the next pixel is repeated. When the processing for all the pixels is completed, control exits from the loop L7 02, and the channel gain computation process for one frame is completed. Meanwhile, in the first embodiment of the present invention, it is possible that, between step S923 and step S924, the demosaic processes performed in step S915 and step S916 in Fig. 12 are inserted as processes for each pixel. As a result, the processes of steps S914 to S916 in Fig. 12 can be performed in combination in the loop L702. [88] Fig. 14 illustrates an example of the operation of a channel gain application processing procedure (step S918) in the first embodiment of the present invention. Here, the following processing is repeated by using each pixel as a target (loop L704). [89] In the loop L704, the RGB value (Rs(p) and Bs(p)) and the gain (FSR(p) and FSB(P)) of the processing target image are obtained (step S937). The RGB value and the gain are multiplied by each other for each channel by the multiplication units 261 and 262 (step S938). This multiplication result is held, as the pixel value of the gain-applied mosaic image Mi for each channel, at a position appropriate for the position of the original pixel in the mosaic image Ms of the processing target image of the illumination component converted mosaic image holding unit 290 (step S939). Furthermore, the process of step S939 referred to herein is step S919 in Fig. 12, and the other processing can be omitted by storing the processing result in one of them. [90] When the processing in all the pixels is completed, control exits from the loop L7 04, and the channel gain application process for one frame is completed. Meanwhile, in the first embodiment of the present invention, by inserting the processes of steps S938 to S939 immediately after step S933 in Fig. 13, the loop L703 in Fig. 13 and the loop L704 in Fig. 14 can be formed as a common loop process. Furthermore, at this time, steps S934 and S937 are omitted. [91] As described above, according to the first embodiment of the present invention, the gain for each pixel is obtained so as to become the color balance of the reference image, and this gain is used in each pixel of the processing target image by the multiplication units 261 and 262, thereby making it possible to generate an image having high color reproducibility. Furthermore, when the gain is to be calculated, in a case where the gain becomes outside the upper limit value or the lower limit value, by performing a clipping process in the upper limit value clipping units 321 and 322 and the lower limit value clipping units 331 and 332, it is possible to suppress an extreme artifact. Furthermore, when the gain is to be calculated, in a case where a blackout condition or saturation has occurred, a weighted ^ average with the compensation value is set as a gain in the blackout condition compensation units 341 and 342 and the saturation compensation units 351 and 352, making it possible to obtain a gain at which a large breakdown does not occur. [0092] <2. Second Embodiment> In the above-described first embodiment, gain application is performed by a simple multiplication in the multiplication units 261 and 262. However, when an actual gain application is to be performed, there is a case in which the coordinate of the pixel subtly deviate, and a case can occur in which in a state as is, it is not possible to sufficiently deal with the disturbance. Accordingly, in the following, a description will be given of an example in which robust gain application is performed by performing smoothing from the neighboring pixels in accordance with the reliability of each pixel. Meanwhile, since the assumed configuration of the image-capturing device and the image processing circuit 23 is the same as that of the first embodiment, the description thereof is omitted. [0093] [Example of configuration of illumination component conversion processing unit 120] Fig. 15 illustrates an example of the configuration of the illumination component conversion processing unit 120 in a second embodiment of the present invention. The example of the configuration of the illumination component conversion processing unit 120 differs from the first example of the configuration described with reference to Fig. 5 in that the output from the demosaic processing unit 221 is input to the channel gain application unit 2 60, and is the same as the configuration of the first example of the configuration except for this point. Therefore, the description of the other configuration is omitted. [94] [Example of configuration of channel gain application unit 260] Fig. 16 illustrates an example of the configuration of the channel gain application unit 260 in the second embodiment of the present invention. The example of the configuration of the channel gain application unit 260 includes division units 421 to 423, exposure compensation units 431 to 433, a saturation reliability calculation unit 440, a blackout condition reliability calculation unit 450, a moving subject reliability calculation unit 460, a reliability selection unit 470, and a smoothing processing unit 480. [95] The division units 421 to 423 generate a ratio Ko for each channel of each pixel between the reference image and the processing target image. In general, a division is a process in which a computation cost is high. Therefore, this division is preferably realized by a process using a reciprocal look-up table or a technique in which a subtraction after being converted into a logarithm for the purpose of reducing the number of computations is performed. [96] The exposure compensation units 431 to 433 perform a process for compensating for a difference in the image- capturing conditions of two images. As a result of this exposure compensation process, the intensity is adjusted so that the exposure intensities in an area in which the illumination environments in the reference image and the processing target image are equal and stationary become equal to each other. In general, in image capturing using a digital camera, even if an image of the same subject is captured under an equal illumination environment, the signal intensity that is observed differs depending on ISO sensitivity setting for an aperture, a shutter speed, and a sensor. This exposure compensation process is a process for adjusting the gain so that a subject whose image is captured under the same conditions has the same intensity. [97] This exposure compensation process is, in a simplified ^ form, realized by multiplying the exposure compensation value expCV calculated from each parameter of the Exif information by the ratio Ko. As a result, the ratio K after compensation is obtained. KG(p) = KOg(p) x expCV KR(p) = KoR(p) x expCV KB(p) = KOB(P) X expCV Meanwhile, this exposure compensation process can be omitted by considering an offset for the amount of the exposure compensation value in the condition determination at a subsequent stage. [98] The saturation reliability calculation unit 440 calculates the reliability of the reference image from the viewpoint of saturation degree. In general, in the image sensor, linear characteristics of the sensor do not hold in the saturation area. In addition, regarding a channel that is completely saturated and whose value is clipped by the upper limit value, it is difficult to correctly obtain the gain. Accordingly, during a smoothing process, it is considered to be effective that the weight of the saturated pixel is decreased and the value of the pixel is obtained using the information on the neighboring pixels having a high reliability. Therefore, for the saturation reliability ST(p), as shown in Fig. 17, characteristics in which the ^ intensity Gc of the reference image is 1 up to the threshold value and the value suddenly decreases with an increase in the intensity after the certain threshold value is exceeded are effective. Furthermore, the present technique can also be used as a method for calculating the saturation reliability of the processing target image. In that case, Gs is used in place of Gc. [99] The blackout condition reliability calculation unit 450 calculates the reliability of the reference image from the viewpoint of a blackout condition degree. In general, in the image sensor, the linearity does not hold in the characteristics of the sensor in the blackout condition area. In addition, in the channel in which a complete blackout condition occurs and the value is clipped in accordance with the lower limit value, it is difficult to correctly obtain the gain. Furthermore, such a breakdown is conspicuous when the intensity of the processing target image is great. Accordingly, it is considered to be effective that the value of the pixel is obtained by decreasing the weight during the smoothing process and by using the information on the neighboring pixels having a high reliability with respect to the pixel whose pixel value of the reference image is a very small value and whose pixel value of the processing target image is a sufficiently large value. Therefore, for the ^ blackout condition reliability BT(p), the value having characteristics like in the following equation shown in Fig. 18 is considered to be effective. This equation calculates the blackout condition degree on the basis of the pixel value of the reference image. Furthermore, the present technique can also be used as a method of calculating the blackout condition reliability of the processing target image. In that case, Gs is used in place of Gc. [Math 10] [0100] Furthermore, the blackout condition reliability BT(p) may be a value having characteristics like in the following equation shown in Fig. 19. This equation calculates the blackout condition degree on the basis of the pixel value of the reference image and an inter-channel ratio between the reference image and the processing target image. [Math 11] [0101] Meanwhile, in the above-mentioned saturation reliability calculation unit 440 and blackout condition reliability calculation unit 450, a determination as to the blackout condition degree and saturation degree is made by using the G channel, but this is not limited to the G channel. A determination using R and B channels, or a determination based on the maximum/minimum, the linear sum, and the luminance value thereof, and the like, are also effective. [0102] The moving subject reliability calculation unit 460 calculates the reliability of the reference image from the viewpoint of whether or not the subject is a moving subject. The moving subject reliability calculation unit 460 calculates the moving subject reliability MT(p) by considering the characteristic value of the distinguishable subject for any image of non-flash emission and flash emission and by making a determination as to whether or not each pixel is a moving subject. For such a characteristic value, for example, the spectral reflectance of the subject is considered. In general, since the comparison of pixels cannot be correctly performed in the moving subject, it is difficult to correctly obtain the gain. In such a pixel, it is considered to be effective that the weight is decreased during the smoothing process, and the value of the pixel is obtained by using the information on the neighboring pixels having higher reliability. [103] The reliability selection unit 470 selects the lowest reliability among the saturation reliability ST(p), the blackout condition reliability BT(p), and the moving subject reliability MT(p). As a result, the reliability FT(p) that is determined to be the most dubious is selected. Furthermore, during this selection, the reliability as the linear sum of the saturation reliability ST(p), the blackout condition reliability BT(p), and the moving subject reliability MT(p), may be calculated. [104] While the smoothing processing unit 480 performs smoothing on the basis of the reliability FT(p) obtained in this manner, the smoothing processing unit 480 applies the gains FSR(p) and FSB(p) to the RGB values (Rs(p) and Bs(p)) of the processing target image. As an example of the first processing functions of the smoothing processing unit 480, the processing functions is realized by the following equation in a case where weighted smoothing is performed in an area α . [Math 12] [105] The gain-applied mosaic image Mi is held in the illumination component converted mosaic image holding unit 290. Meanwhile, another example of the smoothing process will be described later. [106] [Example of configuration of moving subject reliability calculation unit 460] Fig. 20 illustrates an example of the configuration of the moving subject reliability calculation unit 460 in the second embodiment of the present invention. The moving subject reliability calculation unit 460 includes a ratio reverse degree calculation unit 461, a ratio prediction unit 462, a spectral reflectance change amount prediction unit 463, an ambient light spectral color-balance value holding unit 464, a flash light spectral color-balance value holding unit 4 65, and a minimum value selection unit 4 66. [107] The ambient light spectral color-balance value that is held in the ambient light spectral color-balance value holding unit 4 64 is a gain for each channel such that the signal intensity of an achromatic object body is of an achromatic color, that is, R:G:B = 1:1:1, with respect to the spectral of the ambient light in the reference image. In an approximate manner, the white balance WBC for the reference image can be used. In general, as the value of the white balance, a gain at which some amount of color shade is left for the object body of the achromatic color by considering image reproduction. However, for the ambient light spectral color-balance value, a gain such that R:G:B is completely 1:1:1 is obtained is preferable. Here, in order to distinguish the two, the gain is particularly represented as WBpc. [108] The flash light spectral color-balance value that is held in the flash light spectral color-balance value holding unit 4 65 is a gain for each channel such that the signal ^ intensity of the object body of an achromatic color becomes an achromatic color with respect to the spectral of the flash light by the flash emitting unit 61. In an approximate manner, the white balance WBS for the processing target image can be used. In general, as the value of the white balance, a gain at which some amount of color shade is left for the object body of the achromatic color by considering image reproduction. However, for the flash light spectral color-balance value, a gain such that R:G:B is completely 1:1:1 is obtained is preferable. Here, in order to distinguish the two, the gain is particularly represented as WBPf. Meanwhile, the color-balance values for spectral may be set by calculating them inside the image- capturing device, and may be set from the outside of the image-capturing device. The same also applies to ambient light. [109] The ratio reverse degree calculation unit 461 calculates a moving subject reliability from the viewpoint of the change direction of the pixel value. The ratio reverse degree calculation unit 461 determines that the pixel is a moving subject by detecting that the direction of the change of the pixel value is in reverse to the change direction of the illumination components of the entire image. In the example of flash emission/non-flash emission, if it is assumed that there is no change in the ambient light in the reference image and the processing target image that are continuously captured, in the image that is compensated for by the exposure compensation units 431 to 433, the ratio K after compensation will increase to more than "1" in the area in which a flash is emitted. Furthermore, the ratio K after compensation will become equal to "1" in the area in which a flash is not hit. Therefore, since it can be estimated that the signal intensity has decreased because the object body has moved in the area in which the ratio K after compensation becomes smaller than "1", a ratio reverse degree MTRK(p) can be determined using a function that is made to have characteristics shown in Fig. 21. That is, the ratio reverse degree MTRK(p) whose logK is negative and that has characteristics such that the greater the absolute value is, the more the value thereof approaches 0 is considered to be effective. [110] The ratio prediction unit 4 62 calculates the moving subject reliability from the viewpoint of the prediction value of the ratio K. The ratio prediction unit 462 predicts the value of the ratio K after compensation and measures the offset from the measured value, thereby determining that the pixel is a moving subject. The illumination components Es of the processing target image, which is a flash image, is represented by the addition of only E"c by the ambient light and E"pf by the flash light among the illumination components of the processing target image. Es(p) = E"c (p) + E"Pf (p) Therefore, the ratio Ko is represented by the following equation. [Math 13] [0111] Furthermore, the white-balance gain obtained from the spectral of the illumination is a gain that adjusts a color balance so that the channel intensity becomes R:G:B = 1:1:1 in a target in which the spectral reflectance is of an achromatic color, that is, Pr:Pg:Pb = 1:1:1. Therefore, the relationship of the following equation holds. [Math 14] [0112] On the basis of the above two equations, the prediction values eKR and eKB of the ratios of the R and B channels can be represented as the following equation. [Math 15] [113] Hear, the fact that the prediction value ek differs greatly from the measured value K is considered to be attributable to the fast that the spectral reflectance ρ is change and was not divisinle. As a result, it is determined that a pixel whose difference absolute value, ∆K =[K-EKL, is large is a moving subject, and a prediction ratio MTEK (p) having characteristics as in Fig. 22 is set. That is , by considering that the greater the value of ∆ K= [K-ekl, the large the influence due to the change in the spectral reflectance, ρ the weight during the smoothing process is decreased. Meanwhile, the prediction ratio in FIG.22 means the reliability associated with the error between the predicted ratio and the actual value ted with the error between the predicted ratio and the actual value. [0114] The spectral reflectance change amount prediction unit 463 calculates the moving subject reliability from the viewpoint of the prediction value of the spectral reflectance change amount. Similarly to the ratio prediction unit 4 62, the spectral reflectance change amount prediction unit 463 estimates the values of the intensity ratios K of the R and B channels on the basis of the value of the G channel. If the illumination intensity of the ambient light is changed to E'c between the reference image and the processing target image, the equation of the prediction values eKR and eKB of the ratio of the R and B channels can be rewritten as the following equation. [Math 16] Therefore, the ratio of R, G, and B can be approximated in accordance with the following equation. [Math 17] This equation means that the following three points exist in the same straight line. [Math 18] If these three points do not exist in the same straight line, it is considered that p could not be cancelled in the course of deducing the equation of the prediction values eKR and eKB of the above-mentioned ratio of the R and B channels. Consequently, the pixel can also be determined to be a moving subject. Whether or not the three points exist in a straight line can be determined on the basis of an angle 0 formed by the three points or the like. Therefore, it is preferable that the spectral reflectance change amount MTVR(p) have such characteristics as in Fig. 23 as a function of 0. That is, when the three points are lined up in a straight line, the weight in spatial smoothing approaches "1", and the angle 0 becomes "0" when it is 90°. Meanwhile, the spectral reflectance change amount in Fig. 23 means the reliability associated with the change of the spectral reflectance. [0115] The minimum value selection unit 466 selects the minimum value from among the values that are obtained in the ratio reverse degree calculation unit 461, the ratio prediction unit 462, and the spectral reflectance change amount prediction unit 4 63, and outputs the minimum value as the final moving subject reliability MT(p). Meanwhile, in the embodiment of the present invention, all of the ratio reverse degree calculation unit 461, the ratio prediction unit 4 62, and the spectral reflectance change amount ^ prediction unit 4 63 are used. However, only some of them may be used singly or in combination. [0116] [Example of operation] Fig. 24 illustrates an example of the operation of the channel gain application unit 2 60 in the second embodiment of the present invention. Here, the following processing is repeated by using each pixel as a target (loop L705). [117] In the loop L705, the RGB values (Rc(p), Gc(p) and Bc(p), and Rs(p), Gs(p) and Bs (p)) of the reference image and the processing target image are obtained (step S941). In the division units 421 to 423, the ratio Ko(p) of the RGB values of the reference image and the processing target image is calculated (step S942). Furthermore, in the exposure compensation units 431 to 433, an exposure compensation process in accordance with the setting at the time of image capturing is performed (step S943). As a result, in the still subject in which there is no change in the illumination environment, the ratio becomes "1". [118] Next, in the saturation reliability calculation unit 440, a saturation reliability ST(p) is calculated (step S944). In the blackout condition reliability calculation unit 450, a blackout condition reliability BT(p) is ^ calculated (step S945). Furthermore, in the moving subject reliability calculation unit 460, the moving subject reliability MT(p) is calculated (step S946). Then, the reliability selection unit 470 selects the lowest reliability among the saturation reliability ST(p), the blackout condition reliability BT(p), and the moving subject reliability MT(p) (step S947). The reliability that is obtained in this manner is stored in a memory (not shown) (step S948) . When the processing in all the pixels is completed, control exits from the loop L705. In the second embodiment of the present invention, by inserting the processing of steps S942 to S948 immediately after control exits from the loop L703 in Fig. 13, the loop L702 in Fig. 13 and the loop L705 in Fig. 24 can be formed as a common loop process. Since the value of each pixel has already been read in step S923, step S941 can be omitted. [119] Next, in the smoothing processing unit 480, a smoothing process is performed for each pixel (step S949). The pixel value to which the gain is applied in this manner is held in the illumination component converted mosaic image holding unit 290 (step S950). Furthermore, the process of step S950 referred to herein is step S919 in Fig. 12, and by storing the processing result in one of them, the other processes can be omitted. Upon completion of the processing in all the pixels, the channel gain application process for one frame is completed. [120] Fig. 25 illustrates an example of the operation of the moving subject reliability calculation unit 460 in the embodiment of the present invention. Here, the following processing is performed by using each pixel as a target. [121] First, the ratio K is obtained from the exposure compensation units 431 to 433 (step S951). Furthermore, the color balance of the ambient light in the reference image is obtained from the ambient light spectral color-balance value holding unit 4 64, and the color balance of the flash light is obtained from the flash light spectral color-balance value holding unit 465 (step S951). [0122] Then, in the ratio reverse degree calculation unit 461, a determination is made as to the reverse of the direction of the change of the entire image intensity and the orientation of the intensity of the pixel, and the ratio reverse degree is calculated in accordance with the degree thereof (step S952) . Furthermore, in the ratio prediction unit 4 62, a determination is made as. to whether or not the pixel is a moving subject according to the degree of the divergence between the measured value of the ratio K and the estimated value thereof, and the prediction ratio is determined (step S953). During the ratio prediction, since it is assumed that the spectral reflectance p is cancelled by the denominator/numerator, the divergence from the prediction indicates that the change of the spectral reflectance has been detected, and the pixel is determined to be a moving subject. Furthermore, in the spectral reflectance change amount prediction unit 4 63, the spectral reflectance change amount is predicted on the basis of the offset between the prediction value of the color balance and the measured value (step S954). Then, in the minimum value selection unit 466, the minimum value is selected from among the values obtained in the ratio reverse degree calculation unit 461, the ratio prediction unit 462, and the spectral reflectance change amount prediction unit 463 (step S955). This selected value is output as the final moving subject reliability MT(p). [0123] [123] As described above, according to the second embodiment of the present invention, a determination is made as to the reliability for each pixel from the viewpoint of the blackout condition, saturation, or the moving subject, and the weight of the pixel- having a low reliability is decreased during the smoothing, making it possible to use the information on the neighboring pixels and to perform ^ robust gain application. [124] In the second embodiment, an example in which simple weighted smoothing is performed during the smoothing process has been described. Alternatively, edge preservation type smoothing can be applied. Edge preservation smoothing is a nonlinear filter process in which the gradation is smoothed while leaving a conspicuous step difference, such as an object body boundary in the image. Since fine variation is removed while storing the object body contour that affects the ease of viewing, the edge preservation smoothing has long been used for a noise reduction process. The edge preservation smoothing process is also used for a gradation correction process in which a luminance difference other than detail components typified by texture is compressed by using property that can separate between fine luminance variation of texture inside an object body and a conspicuous luminance step difference of an object body contour. [125] In recent years, a technology called a bilateral filter has often been used among such edge preservation smoothing processes. In general, a bilateral filter BLF(p) for the luminance I(p) of an image adds pixel values I(p) in the surroundings of a center pixel position pc, which are weighted by two functions, that is, a weight function co(p - A- pc) in the space direction and a weight function In the third embodiment of the present invention, a pixel frequent value and a certain defined characteristic value are calculated in each of blocks that are divided into plural portions in the spatial axis and in the luminance axis, and thereafter, a characteristic value for each block is weight-added on the basis of the weight that is defined by the distance between each pixel position and each block. For the characteristic value, an integration value (grand total) of gains of pixels contained in the inside for each block, the central value of the gains of the pixels contained in the inside, the central value being multiplied by the number of pixels contained in the inside, or the like can be used. This computation is represented as the following equation. [Math 21] Here, i, j are indexes of a block in the spatial axis direction. Furthermore, X is the central value of the luminance range corresponding to a block. I(pc) is the value of the luminance at the coordinate position pc. S(i, j, X), is the integration value of the gain of a block(i, j, X) . H(i, j, X) is the value of the block histogram. The above equation corresponds to that in which the weight function co in the spatial axis of the joint bilateral filter and the weight function in the luminance axis are discretized in a stepwise manner along the division of the block, thereby exhibiting the effect of edge preservation smoothing. In addition, even if the cost of calculating the block histogram and the block integration value is subtracted, the number of computations of the weighted product sum for each block can be considerably decreased to less than that of the weighted product sum for each pixel. The larger the operator size of edge preservation smoothing, the larger this effect is. [0131] In addition, in the third embodiment of the present invention, an edge preservation type smoothing process in which, in addition to the weight, a weight t(p) determined for each pixel position is introduced, is proposed. The block histogram and the weighted integration of characteristic values inside a block are represented in the following manner. [Math 22] [Math 23] Here, ISW(i, j, A,) is the weighted gain integration value inside a block (i, j, X), and IFT(i, j, X) is the weighted frequent value inside the block (i, j, X), that is, the integration value of the weight itself. When this is applied to the previous equation, the following equation is obtained. [Math 24] S10P1287 This computation corresponds to that in which the weight function 00 in the spatial axis of the weighted joint bilateral filter and the weight function Φ in the luminance axis, which are represented by the following equation, are discretized in a stepwise manner along the division of the block. [Math 25] Therefore, there is an effect of edge preservation smoothing. In addition, even if the cost of calculating the block integration value is subtracted, the number of computations of the weighted product sum for each block can be considerably decreased to less than that of the weighted product sum for each pixel. The larger the operator size of edge preservation smoothing, the larger this effect is. [132] In addition, in the third embodiment of the present invention, a technique of decreasing the number of computations is provided. That is, a computation of convoluting a weight function in the luminance axis direction is performed on the block histogram and the gain integration value for each block in advance, and the result ^ thereof is held. In this case, the convolution computation on the block histogram is given in the following equation. [Math 26] Furthermore, the convolution computation on the block integration value is given in the following equation. [Math 27] In the weighted product-sum computation for each pixel, the block histogram in which the luminance weight function has already been convoluted and the result in which the weighted gain integration value is interpolated in the space direction needs only to be divided by each other. This computation is given in the following equation. [Math 28] This effect increases with a small number of divisions of blocks when compared to the original image size, that is, when a smoothing process is performed by considering a wide range in the image. [133] In addition, in the third embodiment of the present invention, the above-mentioned block histogram, the gain integration value for each block, or those convoluted by a luminance axis weight function, are stored in a memory. As a result, a technique used for an edge preservation smoothing process in a frame that is input next is provided. That is, in a case where the input is moving image data, large edge preservation smoothing can be performed with a small working memory without scanning all the pixels twice. [134] In addition, in the third embodiment of the present invention, a process for reducing the input image is performed before a process for calculating the above- mentioned block histogram, the above-mentioned gain integration value for each block, or those that are convoluted by a luminance axis weight function, is performed. As a result, the number of computations and the amount of memory for calculating the block histogram, the gain integration value for each block, or those that are convoluted by a luminance axis weight function are reduced. [135] Meanwhile, in the third embodiment, the configuration of the image-capturing device, the image processing circuit 23, and the illumination component conversion processing unit 120 that are assumed is the same as that of the second embodiment and thus, the description thereof is omitted. [136] [Example of processing functions of smoothing processing unit 480] Fig. 26 illustrates an example of the processing functions of a smoothing processing unit 480 in the third embodiment of the present invention. The example of processing functions of the smoothing processing unit 480 includes multiplication units 511 and 512, a luminance calculation unit 521, and a nonlinear conversion unit 522. Furthermore, the example of the second processing functions of the smoothing processing unit 480 includes block integration value calculation units 531 and 532, a block histogram calculation unit 533, block integration value holding units 541 and 542, and a block histogram holding unit 543. Furthermore, the example of the second processing functions of the smoothing processing unit 480 further includes phase compensation processing units 551 and 552, weighted product-sum units 561 and 562, and gain application units 571 and 572. [0137] The luminance calculation unit 521 calculates a luminance value L(p) from the RGB values of the processing target image. The luminance calculation unit 521 may, for example, calculate the luminance value by computing the linear sum of the RGB values using a preset coefficient (weight) with respect to the RGB values. Furthermore, this luminance calculation unit 521 may generate the luminance value by such a process for obtaining the maximum value from among the RGB values. [138] The nonlinear conversion unit 522 outputs a nonlinear conversion luminance value L In the scope of the present invention, as another embodiment, the illumination component conversion process can include a process for performing resolution conversion on an input image and making a comparison. The intermediate data in the illumination component conversion process is such that the global illumination distribution and the structure of the entire image are extracted. Consequently, even if the intermediate data is calculated image that is reduced in advance, those information are not deteriorated, and the number of computations can be decreased. Furthermore, by making a comparison after being reduced, it is possible to suppress the influence of the moving subject. In addition, with the introduction of a resolution conversion processing unit, a monitor image that is directed and output toward the LCD, or the like becomes usable. As a result, when the monitor image is used as a reference mosaic image, it is possible to generate an image having high color reproducibility without performing continuous image capturing of flash emission and non-flash emission, and this contributes to the saving of memory. A method of reducing the input image may be a simple method like a simple average of pixels belonging to an area in the mosaic image of the processing target image corresponding to each pixel position of the reduced image. [169] Meanwhile, in the fourth embodiment, since the configuration of the image-capturing device and the image processing circuit 23 that are assumed is the same as that of the third embodiment, the description thereof is omitted. [170] [Example of configuration of illumination component conversion processing unit 120] Fig. 34 illustrates an example of the configuration of an illumination component conversion processing unit 120 in the fourth embodiment of the present invention. Similarly to the third embodiment, the illumination component conversion processing unit 120 includes demosaic processing units 221 and 222, a white balance calculation unit 230, a reference image white balance holding unit 240, a channel gain calculation unit 250, and a channel gain application unit 2 60. In this example, the channel gain calculation unit 250 differs from the channel gain calculation unit 250 of Fig. 15 in input/output, and a value after resolution conversion is used. Other than that, the same operation is performed. The illumination component conversion processing unit 120 further includes resolution conversion units 271 and 272. [171] The resolution conversion units 271 and 272 change the size of an input image. A major objective of the resolution conversion is to reduce the image and suppress an influence of a difference other than the change in the illumination environment by a moving subject or the like. Another example of the objective is to make the size of the input image match between the reference image and the processing target image. It is common practice that a monitor image output to the LCD has a resolution smaller than that of an image captured in a normal process. For this reason, the sizes of two images differ, and the above-mentioned gain calculation cannot be directly used. In order to solve this problem, a technique in which resolution conversion for making the sizes of the reference image and the processing target image uniform with each other is performed and then the images are compared is effective. In that case, which one of expansion reduction the process performed by the resolution conversion units 271 and 272 becomes is determined on the basis of the size relationship between the image sizes of the reference image and the processing target image. When the process performed by the resolution conversion units 271 and 272 is an expansion process, the expansion process by the edge preservation type smoothing filter process is effective. In the smoothing process, since a smoothing process progresses even in a case where the illumination environment is greatly different in the boundary of the object body, a color blur occurs in the boundary. When the process performed by the resolution conversion units 271 and 272 is a reduction process, a comparatively simple method, such as a simple average, a central value, or a thinning process of pixels belonging to a block area in the original image corresponding to each pixel position of the reduced image, may be used. Furthermore, by performing the resolution conversion process in the resolution conversion units 271 and 272 at the same time as the demosaic process performed by the demosaic processing units 221 and 222, the number of computations can be reduced. Furthermore, the order of the resolution ' conversion process in the resolution conversion units 271 and 272 and the demosaic process performed by the demosaic processing units 221 and 222 may be changed. In that case, also, the number of computations can be reduced. [0172] [Example of configuration of channel gain application unit 260] Fig. 35 illustrates an example of the configuration of a channel gain application unit 2 60 in the fourth embodiment of the present invention. The channel gain application unit 2 60 includes the same configuration as in the second embodiment described in Fig. 16. However, when the reliability is to be generated, a reduced image is used. Reference images BRc(q), BGc(q), and BBc(q), which are reduced, and processing target images BRs(q), BGs(q), and BBs(q), which are reduced, are input. Furthermore, in the smoothing processing unit 480, in addition to the processing target images Rs(p), Gs(p), and Bs(p), the reduced processing target images BRs(q), BGs(q), and BBS(q) , a reliability BFT(q) based on the reduced image, and the gain BFSR(q) and BFSB(q) of the reduced image are input. Here, p and q denote each pixel. [0173] [Example of configuration of smoothing processing unit 480] Fig. 36 illustrates an example of the configuration of a smoothing processing unit 480 in the fourth embodiment of the present invention. The smoothing processing unit 480 includes the same configuration as that of the third embodiment described with reference to Fig. 26. However, the image used for the calculation of the block integration value is a reduced image. That is, the gains BFSR(q) and BFSB (q) of the reduced image and the reliability BFT(q) based on the reduced image are input to the multiplication units 511 and 512. Furthermore, the reduced processing target images BRs(q), BGs(q), and BBS (q) are input to the luminance calculation unit 523. [174] On the other hand, the size of the processing target image that is weighted-summed is maintained as is. That is, the processing target images Rs(p), Gs(p), and Bs(p) are input to the luminance calculation unit 521. Furthermore, the processing target images Rs(p) and Bs(p) are input to the gain application units 571 and 572, respectively. [175] [Example of operation] Fig. 37 illustrates an example of the operation of the illumination component conversion processing unit 120 in the fourth embodiment of the present invention. This example of the operation is basically the same as that of the first embodiment described with reference to Fig. 12. However, in the resolution conversion units 271 and 272, a process for reducing the reference image and the processing target image is performed (steps S821 and S822). Furthermore, in the channel gain application unit 260, the gain is expanded in accordance with the processing target image and is applied to each channel (step S818). At this time, the reliability is set on the basis of the determination as to whether or not the target pixel has deteriorated to a blackout condition or a whiteout condition or whether or not the target pixel is a moving subject. A space-smoothed gain is applied by the edge preservation type by considering the original pixel position of each channel. [0176] Fig. 38 illustrates an example of the operation of the channel gain application unit 2 60 in the fourth embodiment of the present invention. This example of the operation is basically the same as that of the second embodiment described with reference to Fig. 24. However, the difference is that the reliability is calculated on the basis of the reduced image. For this reason, the process of the loop L714 corresponding to the loop L705 is a process for each reduction pixel. Furthermore, as the loop L702 and the loop L705 can be formed as a common loop, the process corresponding to the loop L702 performed by the channel gain calculation unit 250 on the reduced image and the process of the loop 714 can be formed together to be a large loop process. Furthermore, the image used for the calculation of the block integration value is also a reduced image (step S841) . That is, the gains BFSR(q) and BFSB(q) of the reduced image and the reliability BFT(q) based on the reduced image are input to the multiplication units 511 and 512. Furthermore, the reduced processing target images BRs(q), BGg(q), and BBs(q) are input to the luminance calculation unit 523. Furthermore, the process of step S850 referred to herein is step S819 in Fig. 37. By storing the processing result in one of them, the other process can be omitted. [177] In this smoothing, smoothing corresponding to the pixel position in the mosaic image of the processing target image of the target channel in each pixel is preferable. As a result, the smoothing is a process that is applied while being expanded in accordance with the size of the mosaic image of the processing target image. At this time, although the edge preservation type smoothing process and the expansion process can be performed separately, it is preferable that these processes be performed at the same time from the viewpoint of the reduction in the number of computations. [178] Figs. 39 and 40 illustrate an example of the operation of a smoothing processing unit 480 in the fourth embodiment of the present invention. This example of the operation is basically the same as that of the third embodiment described with reference to Figs. 30 and 31. However, the image used for the calculation of the block integration value is a reduced image. That is, the gains BFSR(q) and BFSB(q) of the reduced image and the reliability BFT(q) based on the reduced image are input to the multiplication units 511 and 512. Furthermore, the reduced processing target images BRs(q), BGs(q), and BBs(q) are input to the luminance calculation unit 523. Furthermore, the size of the processing target image to be weighted-summed is maintained as is. For this reason, in the luminance calculation unit 521, the luminance is calculated on the basis of the processing target images Rs(p), Gs(p), and Bs(p) (step S872), and nonlinear conversion is performed in the nonlinear conversion unit 522 (step S873). A phase compensation process is performed on the nonlinearly converted luminance (step S875). Furthermore, in the weighted product-sum units 561 and 562, when the gain for the target pixel channel is to be calculated by the weighted product-sum computation of the block integration value (step S876), it is important to consider the block integration value and the distance of the target pixel by using the resolution of the mosaic image of the processing target image before reduction. Furthermore, the process of step S878 referred to herein is step S819 in Fig. 37 or step S850 in Fig. 38. By storing the processing result in one of them, the other processing can be omitted. Furthermore, in the fourth embodiment of the present invention, by inserting the processing steps S862 to S866 immediately after step S847 in Fig. 38, the loop L714 in Fig. 38 and the loop L715 in Fig. 3 9 can be formed as a common loop process. Since the value of each pixel has already been read in step S841, step S861 can be omitted. Furthermore, regarding the reliability, by directly using the value selected in step S847, the storage and the reading process of the reliability in steps S848 and S862 can be omitted. [0179] As described above, according to the fourth embodiment of the present invention, use of the reduced image makes it possible to decrease the overall number of computations and suppress the influence by the moving subject. [0180] <5. Fifth Embodiment> Furthermore, as another form of the illumination component conversion process, another form described below can be taken. In the illumination component conversion process described up to this point, a single image captured by a digital camera has been used as the reference image and the processing target image. A description will be given below of an embodiment that includes a frame memory and that deals with a scene other than flash emission or non-flash emission by generating a combined input image from a plurality of images. [0181] Meanwhile, in the fifth embodiment, the configuration of an image-capturing device and the image processing circuit 23, which are assumed, is the same as that of the fourth embodiment and thus, the description thereof is omitted. [0182] [Example of configuration of illumination component conversion processing unit 120] Fig. 41 illustrates an example of the configuration of the illumination component conversion processing unit 120 in the fifth embodiment of the present invention. Similarly to the fourth embodiment, the illumination component conversion processing unit 120 includes demosaic processing units 221 and 222, a white balance calculation unit 230, a reference image white balance holding unit 240, a channel gain calculation unit 250, and a channel gain application unit 2 60. The illumination component conversion processing unit 120 further includes a frame addition unit 280. The frame addition unit 280 generates a combined input image from a plurality of images. [0183] [Example of configuration of frame addition unit 280] Fig. 42 illustrates an example of the configuration of the frame addition unit 280 in the fifth embodiment of the present invention. The frame addition unit 280 includes addition units 281 and 282, a reference mosaic image holding unit 283, a processing target mosaic image holding unit 284, and a control parameter determination unit 285. [184] The reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 hold images captured in the past, and the addition result of them. In the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284, images that are integrated in the time direction are held. Furthermore, in the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284, in order to hold an accurate color balance in a wide intensity range, it is preferable that a high dynamic range (HDR) image based on 16-bit accuracy of each channel be held. [185] The addition unit 2 81 adds an image from a new reference mosaic image holding unit 213 and an image held in the reference mosaic image holding unit 283. The addition unit 282 adds an image from a new processing target mosaic image holding unit 214 and an image held in the processing target mosaic image holding unit 284. [186] The control parameter determination unit 285 determines whether or not new image-capturing is performed, and determines a control parameter during image capture on the basis of the image in the frame memory and the new captured image. As this control parameter, it is preferable that a sufficiently high-speed shutter speed be adopted so that camera shake and subject camera shake do not occur. Furthermore, the control parameter determination unit 285 performs control to perform continuous image capture while changing the exposure so that an appropriate RGB color balance in which there are no saturation and a blackout condition for all the pixel positions on the basis of the exposure setting parameters when the processing target image is to be captured and the value of the processing target image. [187] Furthermore, the control parameter determination unit 285 performs control of detecting flicker from an image held in the reference mosaic image holding unit 2 83 and the processing target mosaic image holding unit 284 and repeating image capturing until the influence thereof disappears. [188] Furthermore, as another control method, in the control parameter determination unit 285, a blackout condition or saturation may be detected from the image held in the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284. Then, by repeating image capturing while changing the exposure until the influence thereof disappears, it is possible to generate a wide dynamic range image. [189] Meanwhile, in the addition units 281 and 282, addition is preferably performed after accurate positioning is performed by block matching or the like. Alternatively, it is possible to combine with the resolution conversion process of the fourth embodiment. As a result, it becomes possible to obtain a satisfactory outcome even with a simple weighted addition average without performing positioning between the image held in the reference mosaic image holding unit 2 83 and the new image. [190] [Example of operation] Figs. 43 and 44 illustrate an example of the operation of the illumination component conversion processing unit 120 in the fifth embodiment of the present invention. The second half of the illumination component conversion processing unit 120 is the same as that of the first embodiment described with reference to Fig. 12, and the difference is that frame addition for the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 is performed in the first half. Meanwhile, the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 will be referred to as a frame memory in the following. [191] First, in the control parameter determination unit 285, a control parameter regarding image capturing is determined, and the first image is captured in accordance with this ^ control parameter (step S881) . The image that is captured at this time may be a reference image and a processing target image, or may be one of them. [192] Next, the processing of steps S882 to S885 is repeated for each pixel (loop L718). In the loop L718, the target pixel value of the image that is captured newly is obtained (step S882). Furthermore, the existing corresponding pixel value is obtained from the frame memory (step S883) . Then, in the addition units 281 and 282, the new pixel value and the image in the frame memory are weight-added (step S884). The addition result is rewritten as a new frame memory image in the frame memory (step S885) . [193] Upon completion of the processing of steps S882 to S885, the process for the next pixel is repeated. Upon completion of the processing for all the pixels, control exits from the loop L718, and the process proceeds to the subsequent step. At that time, in the control parameter determination unit 285, whether or not new image capturing should be performed is determined on the basis of the image in the frame memory and the new captured image, and a control parameter during image capturing is determined (step S886) . In the control parameter determination unit 2 85, when it is determined that additional image capturing is necessary, the process returns to step S881, where new image capturing is performed. In a case where the image in the frame memory is valid, the process proceeds to the subsequent step. The subsequent processing is the same as that of the first embodiment described with reference to Fig. 12. [194] As described above, according to the fifth embodiment of the present invention, a frame memory is provided, and a combined input image is generated from a plurality of images, thereby making it possible to deal with a scene of other than flash emission or non-flash emission. For example, in the image that is captured in a short time period exposure by using a CMOS sensor under the illumination of a fluorescent lamp or a mercury lamp, an area appears in which illumination conditions are different partially due to an influence of flicker. However, it is possible to deal with such an image. [195] Meanwhile, it is effective that the fifth embodiment is used in such a manner as to be combined with the fourth embodiment. [196] <6. Sixth Embodiment> [Example of processing functions of image processing circuit 23] Fig. 45 illustrates an example of processing functions of the image processing circuit 23 in a sixth embodiment of the present invention. The image processing circuit 23 differs from that of the first embodiment described with reference to Fig. 2 in that the white balance process is performed at a stage preceding the illumination component conversion processing unit 120. That is, the white-balance values estimated in the white balance processing units 131 and 132 are calculated, and are stored in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182, respectively. Then, the stored white-balance values are supplied to the illumination component conversion processing unit 120. [197] In the sixth embodiment, the processes in the color conversion gain calculation units 311 and 312 are as the following equation. [Math 33] [198] As a result, it becomes possible to simultaneously handle the gain of the illumination component conversion processing unit 120 and the gain of the white balance processing units 131 and 132. In this case, since the gains are multiplied by WBC with respect to the first embodiment, the value multiplied by WBC is set with regard to the gain upper limit value R holding unit 323 or the gain upper limit value B holding unit 324, or the gain lower limit value R holding unit 333 or the gain lower limit value B holding unit 334. As a result, it is effective that the upper limit value and the lower limit value represented by the following ^ equation are set. [Math 34] [Math 35] [0199] Furthermore, the same also applies to the blackout condition compensation value R holding unit 343 and the blackout condition compensation value B holding unit 344, and the saturation compensation value R holding unit 353 and the saturation compensation value B holding unit 354. It is sufficient that a blackout condition compensation value is set to WBS, and a saturation compensation value is set to WBC. Furthermore, for the calculation of the upper limit value, the lower limit value, and the compensation value, the values that are stored in the reference image white balance holding unit 181 and the processing target image white ^ balance holding unit 182 are used. [0200] Furthermore, at this time, the process by the white balance calculation unit 230 becomes unnecessary. The processes other than the above in the demosaic processing units 221 and 222 and the channel gain application unit 260 are the same as those of the first embodiment. [0201] <7. Seventh Embodiment> [Example of processing functions of image processing circuit 23] Fig. 46 illustrates an example of processing functions of an image processing circuit 23 in a seventh embodiment of the present invention. In the image processing circuit 23, the mosaic image on which not only gain calculation but also a white balance process has been performed actually is used as an input to the illumination component conversion processing unit. Here, the white balance processing units 131 and 132 calculate white balances, store the white balances in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182, respectively, and use the image on which the white balance process has been performed as an input to the illumination component conversion processing unit 120. [0202] With respect to the input I of the first embodiment, the input on which the white balance process has been performed in the seventh embodiment is given in the following equation. [Math 36] [0203] As a result, the ratio and the gain that are calculated in the color conversion gain calculation units 311 and 312 in the channel gain calculation unit 250 are represented in the following manner, respectively. [Math 37] [0204] Here, the ratio Ko has been multiplied by WBS/WBC, and the gains has been multiplied by WBC/WBS. When this fact is considered, the value multiplied by WBC/WBS with respect to the first embodiment is set with regard to the gain upper limit value R holding unit 323 or gain upper limit value B holding unit 324, or the gain lower limit value R holding unit 333 or the gain lower limit value B holding unit 334. As a result, it is effective that the upper limit value and the lower limit value are set in the following manner. [Math 39] [0205] Furthermore, the same also applies to the blackout condition compensation value R holding unit 343 and the blackout condition compensation value B holding unit 34 4, and the saturation compensation value R holding unit 353 and the saturation compensation value B holding unit 354. It is sufficient that the blackout condition compensation value is set to "1", and the saturation compensation value is set to WBC/WBS. Furthermore, for the calculation of the upper limit value, the lower limit value, and the compensation value, the values that are stored in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182 are used. [0206] Furthermore, as another form for obtaining the upper limit value, the lower limit value, and the compensation value, the following technique is considered. That is, for the value of WBc/WBs, the values that are stored in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182 are not used, and may be directly obtained from the reference image and the processing target image on which the white balance process has been performed. The equation of the ratio K of two images on which an exposure compensation process has been performed in the image on which the white balance process has been performed can be written like Math 41 by performing an exposure compensation process with respect to Math 37. Here, in the background area in which flash light does not reach, since the ratio K(p) is 1, the ratio of the white balance can be obtained as the value of each channel of Math 41 in such an area. Therefore, a threshold value is provided for KG, and WBc/WBs can be obtained as a reciprocal of the average or the central value of the values of the channels of K of the area in which KG is close to 1. [Math 41] [207] Furthermore, at this time, the process by the white balance calculation unit 230 becomes unnecessary. The processing in the demosaic processing units 221 and 222 is the same as that of the first embodiment. Furthermore, the process in the channel gain application unit 2 60 is a process in which the fact that the ratio Ko has been multiplied by WBS/WBC with respect to the first embodiment is considered. [208] <8. Eighth Embodiment> In the eighth embodiment of the present invention, two images on which some sort of conversion process has been added to RAW data are assumed. For example, two images on which the processes corresponding to the white balance processing unit 130 through to the YC conversion processing unit 170 in the image processing circuit 23 of the image- capturing device of Fig. 2 has been performed are assumed. As the image format, for example, JPEG (Joint Photographic Experts Group) format is assumed. Furthermore, it is assumed that for input images, three channels are fully- prepared for each pixel and that a white balance process has already been performed on each image. That is, similarly to the seventh embodiment, in the eighth embodiment, an image on which the white balance process has already been performed can be used as an input image. [0209] The main difference of the eighth embodiment from the other embodiments is that data for three channels has already been fully prepared for each pixel. As a result, the demosaic processing unit 221 for the reference image and the demosaic processing unit 222 for the processing target image in Fig. 5 become unnecessary and are bypassed. Furthermore, the operation of the white balance calculation unit 230 also differs. In the white balance calculation unit 230, it is assumed that a white-balance value obtained in advance by the white balance processing unit 130 is held and is stored as the value of WBc for the reference image in the reference image white balance holding unit. Regarding WBs, it is assumed that the value obtained by the white balance processing unit 130 in advance is held and used. Furthermore, as another form of setting of WBs, a white- balance value obtained by prior measurement for the flash emitting unit 61 of Fig. 1 may be used. Furthermore, as in __ Math 41 of the seventh embodiment, the ratio of the white balance of the reference image to the processing target image may be obtained as the ratio of two images after exposure compensation. Furthermore, another difference is that a nonlinear process corresponding to the gamma correction processing unit 160 of Fig. 2 has already been added to the input image and the intensity ratio K of the signals is not correctly obtained. For this reason, in the eighth embodiment, a process in which an input for the illumination component conversion process is used after an inverse gamma correction process is performed or a process that assumes a gamma correction process is desired to be changed. A block diagram that illustrates the configuration of the image processing circuit 23 in which an image after the inverse gamma correction process is an input is Fig. 47. [0210] [Example of processing functions of image processing circuit 23] Fig. 47 illustrates an example of processing functions of the image processing circuit 23 in an eighth embodiment of the present invention. The image processing circuit 23 includes inverse gamma correction processing units 133 and 134, an illumination component conversion processing unit 120, a gamma correction processing unit 160, a YC conversion processing unit 170, a reference image white balance holding unit 183, and a processing target image white balance holding unit 184. [0211] The input image for the image processing circuit 23 is an image that has already been decoded from the JPEG format and in which three channels are fully prepared for each pixel. For the inverse gamma correction process, inverse conversion of a gamma correction process when an image of the JPEG format is generated is desirable. In a case where it is not possible to know accurate inverse conversion, a simplified inverse gamma correction process may be used. A simplified process of the gamma correction process is given in the following equation. [Math 42] Therefore, it can be seen that it is sufficient that a correction process represented by the following equation, which is an inverse conversion equation of the above equation, is performed. [Math 43] Here, IWhite_level is the upper limit value of the input signal I for normalizing the input signal to the value of 0.0 to 1.0. The process for the image after inverse gamma correction conforms to the first embodiment of the present invention. Furthermore, the equations for calculating the gain upper limit value, the gain lower limit value, the saturation compensation value, and the blackout condition compensation value in the gain calculation unit conforms to Math 39 and Math 40 of the seventh embodiment. Furthermore, similarly to the seventh embodiment, the process in the channel gain application unit 260 is a process in which the fact that the ratio Ko has been multiplied by WBs/WBc with respect to the first embodiment is considered. [0212] Furthermore, after the illumination component conversion process, gamma correction needs to be performed again. It is preferable that this conversion be inverse conversion of the inverse gamma correction processing units 133 and 134 independently of the gamma correction process when an image of the JPEG format is generated. [213] Next, in the example of the functions of Fig. 47, processing in a case where inverse gamma correction processing units 133 and 134 and gamma correction processing unit 160 are omitted will be described. In general, it is preferable that the color balance adjustment process for each channel be performed by using an image called RAW data having spectroscopy characteristics of the sensor and the color filter arranged on the surface thereof, the color balance of illumination components, and linear characteristics for the intensity. It is considered that an illumination component conversion process is performed on an image conversion f has been performed on this RAW data. [214] If the adjustment of the color balance is to be performed at the stage of RAW data in the manner described above, the output to be obtained at this point is an image on which the conversion f has been performed after the color conversion process has been performed. Thus, the output can be represented as in the following. f(FS(p)-Is(p)) Here, in order to simplify the description, when the upper limit value clipping unit, the lower limit value clipping unit, the blackout condition compensation unit, and the saturation compensation unit in Fig. 6 are omitted, and it is set that gain S(p) = gain FS(p), the following is obtained. f (S(p)-Is (p) ) On the other hand, when the image after the conversion f is used as an input to the illumination component conversion processing unit 12 0, and the gain obtained by the color conversion gain calculation units 311 and 312 is denoted as tS(p), the image after the gain application is as in the following. tS(p)-f(I,(p)) To be obtained here is tS(p) that makes the results of the above two equations match each other. Therefore, the following equation is obtained. f (S(p) -Is(p) = tS(p) -f (Is(p) ) tS(p) = (F(S(p) -Ib(p))/F(Is(p) ) [0215] Here, it is assumed that with respect to the conversion f, the computation order of the multiplication and the division, and the conversion f is interchangeable. That is, the following equation is assumed to hold, f (I(p)•J(p)) = f(I(p))-f(J(p)) f(l/I(p)) = 1/f(I(p>) It can be seen that the use of this assumption makes it possible to obtain a corresponding color conversion gain tFS(p) as the following equation by performing the same process as that of Math 4 on the image after the conversion. [Math 44] That is, it is shown that the color conversion gain calculation method according to the embodiment of the present invention is also effective without performing an inverse conversion process with regard to the image on which the conversion f having the property of the above equation has been performed on the RAW data. [0216] The gamma correction process can be approximated to a conversion using an exponentiation function shown in Math 41 representing a simplified gamma correction process. Furthermore, this conversion satisfies the assumption regarding the conversion f. Therefore, it is possible to apply the illumination component conversion process shown in the embodiment of the present invention to the image after a gamma process without performing inverse conversion in an approximate manner. Furthermore, at this time, it is effective that for the gain upper limit value, the gain lower limit value, the saturation compensation value, and the blackout condition compensation value used in the channel gain calculation unit 250, values that obtained in Math 39 and Math 4 0 of the seventh embodiment of the inverse gamma correction process are correspondingly multiplied by y are used. Therefore, it is sufficient that the blackout condition compensation value is set to 1, the saturation compensation value is set to (WBc/WBs)y, and the gain upper limit value and the gain lower limit value are set by the following equations. [Math 45] [0217] In a case where an image that has been maintained as being gamma-processed is used as an input image, the ratio gamKo of the images in a gamma-corrected state is given in the following equation. [Math 47] Therefore, the ratio K after exposure correction due to the difference in the image-capturing environments is represented as the following equation by using gamKo. [Math 48] K = Ko-expCV = (gamKo)r -expCV [0218] The equation (Math 41) of the simplified process of the gamma correction process regarding garni is solved with respect to I and is substituted in each determination equation, it is possible to make a determination as to a blackout condition, saturation, and a moving subject when the image after gamma correction is used as an input. Furthermore, when the image after gamma correction is used as an input, "nonlinear conversion in the form of upwardly convex" has already been applied to the RGB value. Consequently, it follows that nonlinear conversion has been performed also on the luminance L represented by the linear sum thereof. Therefore, in the illumination component conversion process in which the image after gamma correction is used as an input image, it is possible to omit the process in the nonlinear conversion unit 522 (Fig. 26). Finally, the output of the illumination component conversion processing unit 120 is a signal equivalent to the output result of the gamma correction processing unit 160 in Fig. 2. [0219] As described above, according to the eighth embodiment of the present invention, even in a case where an image on which a gamma correction process has been performed is used ^ as the reference image and the processing target image, it is possible to generate an image having high color reproducibility. [220] <9. Ninth Embodiment> In the third or fourth embodiment, during edge preservation smoothing, a luminance is calculated from an RGB value in accordance with a fixed coefficient and then nonlinear conversion is performed. In a ninth embodiment of the present invention, it is assumed that the luminance is calculated by performing multiple regression analysis after the RGB value is subjected to nonlinear conversion. [0221] [Example of processing functions of smoothing processing unit 480] Fig. 48 illustrates an example of processing functions of a smoothing processing unit 480 in the ninth embodiment of the present invention. The example of the processing functions of the smoothing processing unit 480 includes nonlinear conversion units 611 and 621 to 623 and a luminance calculation unit 630 in place of the luminance calculation unit 521 and the nonlinear conversion unit 522 in the third embodiment shown in Fig. 26. [0222] The nonlinear conversion unit 611 performs a nonlinear conversion on the intensity ratio KG(p) of the G channel and outputs a nonlinear intensity ratio KG(nl) (p) . The nonlinear conversion unit 621 to 623 perform a nonlinear conversion on each of the RGB values Rs(p), Gs(p), and Bs(p) of the processing target image Is(p), and output nonlinear RGB values Rs(nl)(p), Gs(nl)(p), and Bs(nl)(p)- Similarly to the nonlinear conversion unit 522, it is useful for the nonlinear conversion units 611 and 621 to 623 to apply, for example, "monotonously increasing characteristics in the form of an upwardly convex", such as a y curve, exponentiation characteristic using an exponentiation smaller than 1, or logarithm conversion. Here, the reason why nonlinear conversion is performed is to improve the accuracy for a straight line model by changing the distribution of the pixel values. Furthermore, there are advantages that the correlation between the intensity ratio Kg (p) and the gain increases as a result of this nonlinear conversion, and the relationship between them becomes easy to understand. Meanwhile, in the present embodiment, the intensity ratio KG(p) is used as the input of the nonlinear conversion unit 611. Instead, KR(p), KB(p), l/KR(p), l/KG(p), or 1/Kb (p) may be used. Furthermore, the color conversion gain itself, that is, FSR(p) and FSB(p) may be used. [0223] The luminance calculation unit 630 calculates a nonlinearly converted luminance value L(nl> (p) from the outputs of the nonlinear conversion units 611 and 621 to 623. The luminance calculation unit 521 in the third embodiment calculates the linear sum of the RGB values on the basis of a fixed coefficient. The luminance calculation unit 630 calculates a luminance value on the basis of the coefficient obtained in accordance with the image. As an example thereof, the luminance calculation unit 630 performs multiple regression analysis on the outputs of the nonlinear conversion units 611 and 621 to 623, and calculates a luminance value by using the obtained multiple regression analysis parameter as a coefficient. Meanwhile, here, because the luminance value is calculated from the nonlinearly converted value, the value differs from the luminance value in a strict sense. Similarly to the third embodiment, since an objective is to calculate a nonlinearly converted luminance value L(nl) (p) in the end, , the value is handled as a luminance value in a wide sense. The luminance calculation unit 630 includes a multiple regression analysis unit 631, a multiple regression analysis parameter holding unit 632, and a multiple regression prediction value calculation unit 633. [224] The multiple regression analysis unit 631 performs multiple regression analysis on the outputs of the nonlinear ^ conversion units 611 and 621 to 623. The multiple regression analysis unit 631 obtains multiple regression analysis parameters CCR, CCG, CCB, and CC0ffSet that minimizes the values of the following equation. Here, CCR, CCG, and CCB are partial regression coefficients, and CC0ffSet is a segment. ∑ (KG(n1)(p) - (CCR Rs(n1) (p) + CCG-Gs(nl) (p) + CCB-Bs(nl) (p) + CCoffset) ) 2 [225] That is, here, multiple regression analysis in which Rs(nl) (p) , Gs(nl)(p), and Bs(nl) (p) are explanatory variates, and KG(nl) (p) is an object variate is performed. Meanwhile, it is assumed in this example that one set of multiple regression analysis parameters are obtained with respect to the entire one screen. Alternatively, a multiple regression analysis parameter is obtained for each small area, which is a portion of the screen. Furthermore, here, multiple regression analysis is performed by using all the channels of RGB. Alternatively, multiple regression analysis may be performed by using only a specific channel, and multiple regression analysis may be performed by fixing CCoffset to 0. The multiple regression analysis parameter holding unit 632 is a memory for holding the multiple regression analysis parameters CCR, CCG, CCB, and CC0ffSet, which are obtained by the multiple regression analysis unit 631. The multiple ^ regression analysis parameters held in the multiple regression analysis parameter holding unit 632 are supplied to the multiple regression prediction value calculation unit 633. [0226] The multiple regression prediction value calculation unit 633 calculates the nonlinearly converted luminance value L(nl)(p) as a multiple regression prediction value in accordance with the multiple regression analysis parameters held in the multiple regression analysis parameter holding unit 632. The multiple regression prediction value calculation unit 633 calculates the luminance value L(nl> (p) that is nonlinearly converted in accordance with the following equation. L(nl>(p) = CCR• Rs(nl) (p) + CCG• Gs(nl) (p) + CCb• Bs(nl) (p) + CCoffset [0227] Since the nonlinearly converted luminance value L (p) , and BBs(nl) (p) . Similarly to the nonlinear conversion unit 522, it is useful for the nonlinear conversion units 612 and 621 to 623 and 641 to 643 to apply, for example, "monotonously increasing characteristics in the form of an upwardly convex", such as a y curve, exponentiation characteristic using an exponentiation smaller than 1, or logarithm conversion. [0230] The luminance calculation unit 630 calculates a nonlinearly converted luminance value L(nl) (p) from the outputs of the nonlinear conversion units 611 and 621 to 623 and 641 to 643. The luminance calculation unit 630 calculates a luminance value on the basis of the coefficient obtained in accordance with the reduced image. The luminance calculation unit 630 includes a multiple regression analysis unit 634, a multiple regression analysis parameter holding unit 635, and multiple regression prediction value calculation units 633 and 636. [231] The multiple regression analysis unit 634 performs multiple regression analysis on the outputs of the nonlinear conversion units 612 and 641 to 643. The multiple regression analysis unit 634 is the same as the multiple regression analysis unit 631 described using the example of Fig. 48 except that the analysis target is based on a reduced image. [232] The multiple regression analysis parameter holding unit 635 is a memory for holding multiple regression analysis parameters CCr, CCG, CCb, and CC0FFSet/ which are obtained by the multiple regression analysis unit 634. The multiple regression analysis parameters held in the multiple regression analysis parameter holding unit 635 are supplied to the multiple regression prediction value calculation units 633 and 636. [233] The multiple regression prediction value calculation unit 633 calculates the nonlinearly converted luminance value L(nl> (p) as a multiple regression prediction value in accordance with the multiple regression analysis parameters held in the multiple regression analysis parameter holding unit 635. Furthermore, the multiple regression prediction value calculation unit 63 6 calculates the nonlinearly converted luminance value BL(nl) (p) of the reduced image as a multiple regression prediction value in accordance with the multiple regression analysis parameters held in the multiple regression analysis parameter holding unit 635. In the >5 multiple regression prediction value calculation units 633 and 636, the same multiple regression analysis parameters are used. [234] [Example of operation] Figs. 50 and 51 illustrate an example of the operation of the smoothing processing unit 480 in the ninth embodiment of the present invention, which corresponds to the example of the processing functions of Fig. 48. Meanwhile, here, the same processes as those of Fig. 30 are designated with the same reference numerals. [235] Here, first, the processing of steps S751 to S753 is repeated by using each pixel as a target (loop L719). In the loop L719, the RGB values of the processing target image and the intensity ratio of the G channel are obtained (step S751). The RGB values and the intensity ratio are nonlinearly converted in the nonlinear conversion units 611 and 621 to 623 (step S752). The nonlinearly converted RGB values and the intensity ratio are stored in a memory (not shown) (step S753). [0236] When a nonlinear conversion process is performed on each pixel, in the multiple regression analysis unit 631, multiple regression analysis in which Rs(nl) (p) , Gs(nl) (p) , and Bs(nl) (p) are explanatory variates, and KG(nl) (p) is an object variate is performed (step S754) . As a result, the multiple regression analysis parameters obtained by the multiple regression analysis are held in the multiple regression analysis parameter holding unit 632 (step S755). [237] When the multiple regression analysis parameters are obtained by the multiple regression analysis, the processing of steps S756 to S967 is repeated by using each pixel as a target (loop L720). In the loop L720, the RGB values after the nonlinear conversion process of the processing target image are obtained (step S756) . Furthermore, the gains FSR(p) and FSB(p) and the reliability FT(p) of the corresponding pixel are obtained (step S962). In addition, the multiple regression analysis parameters held in the multiple regression analysis parameter holding unit 632 are obtained (step S757). Then, in the multiple regression prediction value calculation unit 633, the multiple regression prediction value is calculated as a nonlinearly converted luminance value L(nl) (p) (step S758). The subsequent processing is the same as that described with reference to Fig. 31 and accordingly, the description thereof is omitted. [238] Figs. 52 to 54 illustrate an example of the operation of the smoothing processing unit 480 in the ninth embodiment of the present invention, which corresponds to the example of the processing functions of Fig. 49. The example of the operation is basically the same as the example of the operation corresponding to the example of processing functions of Fig. 48, which are described with reference to Figs. 50 and 51. However, the image used for the calculation of the block integration value is a reduced image. That is, the gains BFSR(q) and BFSB(q) of the reduced image and the reliability BFT(q) based on the reduced image are input to the multiplication units 511 and 512. Furthermore, the intensity ratio BKG(p) of the reduced image, and the reduced processing target images BRs(q), BGs(q), and BBs(q) are input to the nonlinear conversion units 612 and 641 to 643. Furthermore, the size of the processing target images that are weighted-summed are maintained as is. [239] Here, first, the processing of steps S761 to S763 is repeated by using each pixel of the reduced image as a target (loop L721). The processing content of steps S761 to S763 is the same as the processing of steps S751 to S753 described above and thus, the description thereof herein is omitted. Furthermore, the processing content of steps S764 and S765, which follow the above, is the same as the processing of steps S754 and S755 described above and thus, the description thereof is omitted. [240] When the multiple regression analysis parameters are obtained by the multiple regression analysis, the processing of steps S766 to S866 is repeated by using each pixel of the reduced image as a target (loop L722). Meanwhile, here, the same processes as those of Fig. 39 are designated with the same reference numerals. The processing content of steps S766 to S866 in the loop L722 is the same as the processing of steps S756 to S966 described above and thus, the description thereof herein is omitted. [241] On the other hand, the image that is weighted-summed is not a reduced image but a processing target image. Therefore, in the loop L723, each process is repeated by using each pixel of the processing target image as a target. In the loop L723, the RGB values of the processing target image and the block integration value of the weight itself are obtained (step S871). In addition, the multiple regression analysis parameters held in the multiple regression analysis parameter holding unit 632 are obtained (step S771). The RGB values are nonlinearly converted in the nonlinear conversion units 621 to 623 (step S772). Then, in the multiple regression prediction value calculation unit 633, the multiple regression prediction value is calculated as a nonlinearly converted luminance value L(nl) (p) (step S773) . Since the subsequent processing is the same as that described in Fig. 40, the description thereof herein is omitted. [242] As described above, according to the ninth embodiment of the present invention, when edge preservation type smoothing using a block integration value is to be performed, it is possible to perform smoothing in the luminance direction by using a luminance corresponding to an image. [243] <10. Tenth Embodiment In the above-mentioned third or fourth embodiment, when edge preservation smoothing is to be performed, smoothing is performed on the basis of a histogram of the surroundings of a position and a luminance. In the tenth embodiment of the present invention, it is assumed that smoothing is performed by using a rough gain itself for weighted product sum. [244] [Example of processing functions of smoothing processing unit 480] Fig. 55 illustrates an example of processing functions of the smoothing processing unit 480 in the tenth embodiment of the present invention. In the example of the processing functions of the smoothing processing unit 480, furthermore, ^ gains FSR(p) and FSB(p) are input to weighted product-sum units 561 and 562 in the third embodiment shown in Fig. 26. In the weighted product-sum units 561 and 562, by comparing the gains FSR(p) and FSB(p) at the position p with the average gains HSWR(r) and HSWB(r) of the coordinate r corresponding to the position p and the luminance value L(nl) (p) , a weight for weighted product sum is calculated. [245] [Example of configuration of weighted product-sum units 561 and 562] Fig. 56 illustrates an example of the configuration of the weighted product-sum units 561 and 562 in the tenth embodiment of the present invention. Each of the weighted product-sum units 561 and 562 includes a configuration in which a division unit 651, a comparison unit 652, and multiplication units 653 and 654 are provided at a stage preceding the interpolation units 563 and 564 in the third embodiment shown in Fig. 28. [246] The division unit 651 divides, for each coordinate r, the block integration values ISWR(r) and ISWB(r) held in the block integration value holding units 541 and 542 by the block histogram IFT(r) held by the block histogram holding unit 543. As a result, the average white balance at the coordinate r is calculated. Meanwhile, the block integration value and the block histogram are discretized with respect to the spatial position and the luminance. The coordinate r indicates the three-dimensional coordinate (i, j, X) of the spatial position i, j and the luminance X. HSWR(r) and HSWB(r) that are calculated by the division unit 651 are obtained in accordance with the following equation. HSWr(r) = ISWR (r)/1FT(r) HSWB(r) = ISWB(r)/IFT(r) Meanwhile, the division unit 651 is an example of the first division unit described in the Claims. [0247] The comparison unit 652 compares the gains FSR(p) and FSb (p) at the position p of the processing target image with the average gains HSWR(r) and HSWB(r) of the coordinate r of the block corresponding to the position p, thereby calculating the weight 8 of weighted product sum. This weight 0 indicates a value in the range of 1 to 0 in accordance with the value of AMax(r) as in Fig. 57. AMax(r) means the larger of absR and absB. Meanwhile, ABS is a function indicating an absolute value. ∆Max (r) = max (absR, absB absR = ABS(FSR(p) - HSWR (r) )/SWUNITR absB = ABS(FSB(p) - HSWB (r) )/SWUNITB [248] Here, SWUNITR and SWUNITB are defined in accordance with the following equation. SWUNITR = ABS (gain upper limit valueR - gain lower limit valueR) SWUNITB = ABS (gain upper limit valueB - gain lower limit valueB) The gain upper limit value and the gain lower limit value are the same as those shown in Math 5 and Math 6. By dividing the diffe rence of the average gains by SWUNIT, the difference between the gain and the average gain is normalized to a range of 0.0 to 1.0. Since the gain of each pixel is clipped by the upper limit value and the lower limit value, the range of the absolute value of the difference is from the 0 to "upper limit value - lower limit value". Furthermore, as a result of this normalization, the difference between R and B can be compared so as to set the larger one as ∆Max(r). [249] Meanwhile, here, AMax(r) is set to the large one of absR and absB, and the weight 0 is obtained as a weight common to the R channel and the B channel. Alternatively, absR and absB may be handled individually, and weights 0R and 6b independent of the R channel and the B channel may be obtained. In this case, the weighted gain SWR(r) or SWB(r) of the block area is calculated for each' of the R channel and the B channel. [0250] Furthermore, in this example, the relationship between the weight 0 and AMax(r) is assumed as in Fig. 57, but is not limited to this example. It is sufficient that the relationship has characteristics such that the weight 0 monotonously decreases with an increase in ∆Max(r). [0251] The multiplication unit 653 multiplies, for each coordinate r, the block integration values ISWR(r) and ISWB(r) held in the block integration value holding units 541 and 542 by the weight 0 calculated by the comparison unit 652. Furthermore, the multiplication unit 654 multiplies, for each coordinate r, the block histogram IFT(r) held in the block histogram holding unit 543 by the weight 0 calculated by the comparison unit 652. The multiplication result by the multiplication unit 653 is supplied to the interpolation unit 563, and the multiplication result by the multiplication unit 654 is supplied to the interpolation unit 564. Meanwhile, the multiplication unit 653 is an example of the first multiplication unit described in the Claims. Furthermore, the multiplication unit 654 is an example of the second multiplication unit described in the Claims. [252] Although the configuration subsequent to the ^ interpolation units 563 and 564 is the same as that in Fig. 28, as a result of the weight 0 being multiplied in the manner described above, the values obtained in the following manner differ. First, the interpolation unit 563 interpolates the input from the multiplication unit 653 in accordance with the value co(r, p) of the space weight function table held in the space weight function table holding unit 565. As a result, the interpolation unit 563 outputs the following values. ∑ ω (i, j, p) θ (∆Max (i, j, λ .))-ISWR(i, j, X) ∑ ω (i, j, p) . θ (∆Max (i, j, ,) λ)-ISWB(i, 3, Here, the coordinate r is developed to a three-dimensional coordinate (i, j, of the spatial position i, j and the luminance X. Furthermore, the computation E is assumed herein to perform the summation for the spatial position i, j [253] The interpolation unit 564 interpolates input from the multiplication unit 654 in accordance with the value co(r, p) of the space weight function table held in the space weight function table holding unit 565. As a result, the following value are output. ∑ ω (i, j, p) • θ (∆Max (i, j, λ))-IFT(i, j, λ) The computation £ is assumed herein to perform the summation for the spatial position i, j. [0254] The product-sum unit 566 calculates the result in which the luminance weighted values are weighted-summed with respect to the output of the interpolation unit 563. The luminance weighted value is calculated by using the value y(X, L

Documents