WO2011004832A1 - 画像処理装置、画像処理方法およびプログラム - Google Patents

画像処理装置、画像処理方法およびプログラム Download PDF

Info

Publication number
WO2011004832A1
WO2011004832A1 PCT/JP2010/061513 JP2010061513W WO2011004832A1 WO 2011004832 A1 WO2011004832 A1 WO 2011004832A1 JP 2010061513 W JP2010061513 W JP 2010061513W WO 2011004832 A1 WO2011004832 A1 WO 2011004832A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
image
value
gain
pixel
Prior art date
Application number
PCT/JP2010/061513
Other languages
English (en)
French (fr)
Inventor
高橋 宏彰
光永 知生
Original Assignee
ソニー株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ソニー株式会社 filed Critical ソニー株式会社
Priority to CN201080002486.2A priority Critical patent/CN102138329B/zh
Priority to EP10797143.4A priority patent/EP2453658A4/en
Priority to US13/060,904 priority patent/US8659675B2/en
Publication of WO2011004832A1 publication Critical patent/WO2011004832A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/843Demosaicing, e.g. interpolating colour pixel values
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/10Circuitry of solid-state image sensors [SSIS]; Control thereof for transforming different wavelengths into image signals
    • H04N25/11Arrangement of colour filter arrays [CFA]; Filter mosaics
    • H04N25/13Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements
    • H04N25/134Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements based on three different wavelength filter elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Definitions

  • the present invention relates to an image processing apparatus, and more particularly to an image processing apparatus that generates an image with high color reproducibility from a captured image, a processing method therefor, and a program that causes a computer to execute the method.
  • the illumination components are separated by taking the difference between the two images, and each is processed as a white balance problem of an image captured in a single illumination environment and synthesized. Has been solved by.
  • the conventional method has two major problems as follows.
  • the first problem is that it cannot cope with changes in ambient light.
  • the illumination components other than the flash must be constant between the two images. For this reason, there is a problem that it becomes impossible to cope with changes such as when the sunlight is shaded during imaging.
  • the second problem is that it is difficult to handle moving subjects. For pixels belonging to a subject that has moved between the reference image and the processing target image, pixels having different spectral reflectances are compared, and illumination components cannot be separated based on image differences. For this reason, the conventional method has a problem that it cannot cope with a combination of an image in which the orientation of the camera is changed, an image in which a moving subject is present, and the like.
  • solutions such as the use of tripods, global motion vectors, and alignment by block matching have been proposed. However, when a tripod is used, the shift due to the camera moving can be solved, but it cannot cope with a moving subject.
  • the present invention has been made in view of such a situation, and an object of the present invention is to remove an influence of illumination components from a plurality of images having different illumination environments and to generate an image with high color reproducibility.
  • the present invention has been made in order to solve the above-described problems.
  • the first aspect of the present invention is to provide an illumination component for each channel at each pixel position from a reference image and a processing target image captured in different illumination environments.
  • An image processing apparatus, an image processing method, and a program including a channel gain calculation unit that calculates a gain for conversion and a channel gain application unit that applies the gain to the processing target image. This brings about the effect
  • the channel gain calculation unit fixes the gain of a specific channel of the processing target image and sets the gain so that the color balance of the processing target pixel matches the reference image. It may be calculated.
  • the channel gain calculation unit may calculate the gain so that the luminance value of the processing target image is fixed and the color balance of the processing target pixel matches the reference image.
  • the channel gain calculation unit sets the upper limit value as the gain when a value exceeding a predetermined upper limit value is calculated as the gain, or a value lower than a predetermined lower limit value. Is calculated as the gain, the lower limit value may be the gain. This brings about the effect of removing the gain that deviates from the range of the upper limit value and the lower limit value.
  • the channel gain calculation unit includes a saturation calculation unit that calculates a pixel saturation from the pixel value of the reference image, and a saturation that performs the gain compensation processing according to the saturation. And a compensation unit. This brings about the effect
  • the channel gain calculation unit includes a blackening degree calculation unit that calculates a blackout degree of a pixel from a pixel value of the reference image, and a gain compensation process according to the blackening degree. And a blackout compensation unit for performing the above.
  • the channel gain calculation unit includes a blackening degree calculation unit that calculates a blackening degree of a pixel from a pixel value of the reference image and an inter-channel ratio between the reference image and the processing target image, and a blackening degree. Accordingly, a blackout compensation unit that performs the compensation process for the gain may be provided. This brings about the effect of compensating the gain according to the degree of blackout.
  • an exposure compensation unit that adjusts the intensity so that the exposure intensity becomes equal may be further included in order to compensate for a difference in imaging conditions between the reference image and the processing target image. This brings about the effect
  • the channel gain application unit spatially smoothes the gain based on the saturation reliability calculation unit that calculates the saturation reliability of the pixel from the pixel value of the reference image, and the saturation reliability. And a smoothing processing unit applied to the processing target pixel. This brings about the effect
  • the channel gain application unit includes a blackout reliability calculation unit that calculates a blackout reliability of a pixel from a pixel value of the reference image, and the gain based on the blackout reliability. And a smoothing processing unit applied to the processing target pixel after spatial smoothing. Also, in this first aspect, the channel gain application unit calculates a blackout reliability for calculating a blackout reliability of a pixel from a pixel value of the reference image and a ratio between channels of the reference image and the processing target image. You may provide the calculation part and the smoothing process part which applies with respect to the said process target pixel, after spatially smoothing the said gain based on the said black-out-black reliability. This brings about the effect
  • the channel gain application unit determines whether the subject is a spatially moving pixel from a change in characteristic values of corresponding pixels of the reference image and the processing target image.
  • a moving subject reliability calculation unit that calculates reliability and a smoothing processing unit that spatially smoothes the gain based on the moving subject reliability and applies the gain to the processing target pixel.
  • the moving subject reliability calculation unit calculates the moving subject reliability according to a change in spectral reflectance of corresponding pixels of the reference image and the processing target image.
  • An amount prediction unit may be provided. This brings about the effect that the illumination component is converted by the gain that is spatially smoothed based on the moving subject reliability.
  • the image processing apparatus may further include a resolution conversion unit that converts the resolution of the reference image or the processing target image and supplies the converted image to the channel gain calculation unit.
  • the resolution conversion unit may perform the resolution conversion by reduction by thinning out pixels, or may perform the resolution conversion by reduction based on an average of pixels in a block. Further, the resolution conversion may be performed by reduction based on the median value of the pixels in the block. The resolution conversion may be performed by edge preserving smoothing filter processing. This brings about an effect that the sizes of the reference image and the processing target image are matched.
  • a frame memory for storing continuously captured images, an addition unit that creates an input image by weighting the continuously captured images, and the continuous imaging
  • a control parameter determination unit that determines a control parameter to be used and performs repetitive imaging control.
  • a combination may be used in which the reference image is an image captured without flash emission and the processing target image is an image captured with flash emission.
  • the channel gain application unit spatially smoothes the gain based on a luminance calculation unit that calculates luminance from the pixel value of the processing target image and a luminance difference between pixels. And a smoothing processing unit applied to the processing target pixel.
  • the luminance calculation unit may calculate the luminance as a linear sum with a weight set in advance for the pixel value of the processing target image, and the correspondence between the reference image and the processing target image.
  • the luminance may be calculated based on a multiple regression analysis in which the pixel intensity ratio is a target variable and the pixel value of the processing target image is an explanatory variable.
  • the second aspect of the present invention includes a block histogram calculation unit that calculates a frequency value of a pixel of a processing target image as a block histogram for each block obtained by dividing a region into a plurality of regions in the spatial axis direction and the luminance axis direction, A block integration value calculation unit for calculating an integral value of characteristic values belonging to the block, a weighted product-sum unit for calculating a global gain value at the pixel position from a block histogram, a block integration value, and a luminance value at the pixel position; An image processing apparatus including a gain application unit that applies the global gain value to a processing target image. Accordingly, the global gain value is obtained using the reference images captured in different illumination environments, and the illumination component is converted for each channel at each pixel position of the processing target image by applying the global gain value. Bring.
  • the integral value of the characteristic value for each block may be the sum of gain for each channel for converting the illumination component for each channel of the pixels belonging to each block, It may be obtained by multiplying the median value of each gain channel for converting the illumination component of the pixel belonging to each block by the frequency value of the pixel of the in-block processing target image.
  • the weighted product-sum unit is defined in advance as a first interpolation unit that performs interpolation of the block histogram to the pixel position by a predefined weight function in the spatial axis direction.
  • a second interpolation unit that interpolates the characteristic value for each block to the pixel position by a weight function in the spatial axis direction, and a load sum of the block histogram interpolated by a weight function in a predetermined luminance axis direction.
  • the storage processing in the weighted product-sum unit may be performed in the order of luminance direction interpolation and spatial direction interpolation by changing the order.
  • the weighted product-sum unit divides the characteristic value for each block by the value of the block histogram to calculate an average characteristic value for each block position, and the average characteristic
  • a comparison unit that calculates a weight by comparing a value with a characteristic value related to the pixel position; and a first multiplication unit that multiplies the characteristic value for each block at the corresponding block position by the weight calculated in the comparison unit;
  • a second multiplying unit that multiplies the weight calculated in the comparing unit by the value of the block histogram at the corresponding block position, and the first multiplying unit to the pixel position by a predefined weight function in the spatial axis direction.
  • a first interpolation unit that performs interpolation of a weighted block histogram that is an output of the above, and a predefined weight function in the spatial axis direction
  • a second interpolation unit for interpolating a weighted characteristic value for each block which is an output of the second multiplication unit to the pixel position, and a block histogram interpolated by a weight function in a predetermined luminance axis direction.
  • a first product-sum unit for calculating a load sum; a second product-sum unit for calculating a load sum of the characteristic values interpolated by a weight function in a predetermined luminance axis direction; and the second product-sum.
  • a division unit that divides the output of the unit by the output of the first product-sum unit.
  • the present invention it is possible to obtain an excellent effect that it is possible to remove an influence due to an illumination component from a plurality of images having different illumination environments and to generate an image with high color reproducibility.
  • FIG. 1 It is a figure which shows an example of the imaging device in embodiment of this invention. It is a figure which shows an example of the processing function of the image processing circuit 23 in the 1st Embodiment of this invention. It is a figure which shows the Bayer arrangement
  • FIG. 1 is a diagram illustrating an example of an imaging apparatus according to an embodiment of the present invention. This imaging apparatus is roughly composed of an optical system, a signal processing system, a recording system, a display system, and a control system.
  • the optical system includes a lens 11 that collects a light image of a subject, a diaphragm 12 that adjusts the amount of light in the light image, and an image sensor 13 that photoelectrically converts the collected light image into an electrical signal.
  • the image sensor 13 is realized by, for example, a CCD image sensor or a CMOS image sensor.
  • 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 electric signal from the image sensor 13.
  • the sampling circuit 21 is realized by, for example, a correlated double sampling circuit (CDS: Correlated Double Sampling). Thereby, noise generated in the image sensor 13 is reduced.
  • the A / D conversion circuit 22 converts the analog signal supplied from the sampling circuit 21 into a digital signal.
  • the image processing circuit 23 performs predetermined image processing on the 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). Details of processing executed by the image processing circuit 23 will be described later.
  • DSP Digital Signal Processor
  • the recording system encodes the image signal processed by the image processing circuit 23 and the memory 32 that stores the image signal, and records the image signal in the memory 32, and also reads and decodes the image signal from the memory 32, and the image processing circuit 23. And an encoder / decoder 31 to be supplied.
  • the memory 32 may be a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like.
  • the display system includes a display driver 41 that outputs an image signal processed by the image processing circuit 23 to the display unit 42, and a display unit 42 that displays 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 also has a function as a finder.
  • the control system includes a timing generator 51, an operation input receiving unit 52, a driver 53, a control unit 54, a flash light emitting unit 61, and a flash control unit 62.
  • the timing generator 51 controls the operation timing of the image sensor 13, the sampling circuit 21, the A / D conversion circuit 22, and the image processing circuit 23.
  • the operation input receiving unit 52 receives a shutter operation and other command inputs by the user.
  • the driver 53 is a driver for connecting peripheral devices.
  • the driver 53 is connected to a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory.
  • the control unit 54 controls the entire imaging apparatus.
  • the control unit 54 reads out the control programs stored therein via the driver 53, and performs control based on the read control program, a user command input from the operation input receiving unit 52, and the like. .
  • the flash light emitting unit 61 is used to illuminate a subject during imaging, and is sometimes called a strobe.
  • the flash control unit 62 controls the flash light emitting unit 61 and causes the flash light emitting unit 61 to emit light according to an instruction from the user, ambient brightness, and the like.
  • the image processing circuit 23, the encoder / decoder 31, the memory 32, the display driver 41, the timing generator 51, the operation input receiving unit 52, the control unit 54, and the flash control unit 62 are connected to each other via a bus 59. Has been.
  • an optical image (incident light) of a subject enters the image pickup device 13 through the lens 11 and the diaphragm 12, and is photoelectrically converted by the image pickup device 13 into an electric signal.
  • a noise component is removed from the obtained electric signal by the sampling circuit 21, digitized by the A / D conversion circuit 22, and then temporarily stored in an image memory (not shown) built in the image processing circuit 23.
  • the image signal built in the image processing circuit 23 is constantly overwritten at a constant frame rate by the control of the signal processing system by the timing generator 51.
  • the image signal of the image memory built in the image processing circuit 23 is output to the display unit 42 via the display driver 41, and a corresponding image is displayed on the display unit 42.
  • the display unit 42 also plays a role as a viewfinder of the imaging device.
  • the control unit 54 holds the image signal immediately after the shutter button is pressed to the timing generator 51, that is, image processing.
  • the signal processing system is controlled so that the image signal is not overwritten in the image memory of the circuit 23.
  • the image data held in the image memory of the image processing circuit 23 is encoded by the encoder / decoder 31 and recorded in the memory 32.
  • FIG. 2 is a diagram illustrating an example of a processing function of the image processing circuit 23 according to the 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 using the mosaic image digitized by the A / D conversion circuit 22 as an input image.
  • the mosaic image is an image in which an intensity signal corresponding to any of R, G, and B is stored in each pixel, and the color arrangement assumes a Bayer arrangement as shown in FIG. Note that the mosaic image may be referred to as RAW data.
  • the intensity signal stored in each pixel is not limited to R, G, and B, and may be C, M, Y, or other color information.
  • the image processing circuit 23 includes a reference mosaic image holding unit 111 and a processing target mosaic image holding unit 112 in an input unit.
  • the reference mosaic image holding unit 111 is a memory that holds a mosaic image (reference image M c ) serving as a reference (criterion).
  • the processing target mosaic image holding unit 112 is a memory that holds a mosaic image (processing target image M s ) to be processed. In the embodiment of the present invention, it is assumed that the color balance of the processing target image is adjusted using the color balance (color ratio) in the reference image.
  • Illumination component conversion processing unit 120 converts the illumination component of the use to the processing target image color ratio of the reference image, and generates a mosaic image M l. That is, the processing target image is converted to a single light source color balance by multiplying an appropriate coefficient for each channel so as to be equal to the color balance of the reference image.
  • the configuration of the illumination component conversion processing unit 120 will be described later.
  • White balance processing unit 130 is subjected to white balance processing on the mosaic image M l.
  • the white balance processing unit 130 multiplies the mosaic image M 1 by an appropriate coefficient according to the color of each pixel intensity so that the color balance of the achromatic subject region becomes an achromatic color.
  • the mosaic image Mw subjected to the white balance processing is supplied to the demosaic processing unit 140.
  • the demosaic processing unit 140 performs interpolation processing (demosaic processing) so that the intensities of all the R, G, and B channels are aligned at each pixel position of the mosaic image Mw .
  • the demosaic image [R g , G g , B g ] T subjected to this interpolation processing 3 corresponds to three colors R (Red: Red), G (Green: Green), and B (Blue: Blue).
  • One image (RGB image) is supplied to the gradation correction processing unit 150.
  • the matrix AT means a transposed matrix of the matrix A.
  • the gradation correction processing unit 150 performs gradation correction processing on each pixel in the image [R g , G g , B g ] T output from the demosaic processing unit 140.
  • the image [R u , G u , B u ] T subjected to the gradation correction processing is supplied to the gamma correction processing unit 160.
  • the gamma correction processing unit 160 performs gamma correction processing on the image [R u , G u , B u ] T.
  • the gamma correction processing is correction for reproducing a display faithful to the input image on the display unit 42.
  • the output [R u ⁇ , G u ⁇ , B u ⁇ ] T of the gamma correction processing unit 160 is supplied to the YC conversion processing unit 170.
  • the YC conversion processing unit 170 performs the YC matrix processing and band limitation on the chroma component on the gamma-corrected three-channel image [R u ⁇ , G u ⁇ , B u ⁇ ] T , thereby performing the luminance signal Y and the color difference signal C. (Cr, Cb) is output.
  • 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 supplied to the encoder / decoder 31 in the subsequent stage of the image processing circuit 23.
  • the display driver 41 is usually supplied with RGB signals.
  • This RGB signal is obtained by converting a luminance signal and a color difference signal, which are outputs of the YC conversion processing unit 170, into RGB signals.
  • FIG. 3 is a diagram illustrating a Bayer array as an example of a color array of a mosaic image assumed in the embodiment of the present invention.
  • the G color pixels are arranged in a checkered pattern, and at the other pixel positions, the R color pixels are arranged in a square lattice pattern every other pixel in the horizontal and vertical directions, and the remaining pixel positions.
  • B pixels are arranged in a square lattice pattern every other pixel in the horizontal and vertical directions.
  • FIG. 4 is a diagram showing a Bayer set in the Bayer array as an example of the color array of the mosaic image assumed in the embodiment of the present invention.
  • 4 pixels of 2 horizontal pixels ⁇ 2 vertical pixels of the mosaic image may be handled as a unit.
  • This set of four pixels is referred to as a Bayer set.
  • the Bayer set 602 is a collection of the four pixels around a position 601 in contact with the four pixels G, B, R, and G.
  • FIG. 5 is a diagram illustrating a configuration example of the illumination component conversion processing unit 120 according to 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.
  • the demosaic processing unit 221 performs demosaic processing on the reference image held in the reference mosaic image holding unit 111, and the demosaic image I of the reference image in which channels necessary for obtaining intensity and reliability for each pixel are prepared.
  • c (p) is generated. Note that p represents each pixel position.
  • the demosaic processing unit 222 performs demosaic processing on the processing target image held in the processing target mosaic image holding unit 112, and obtains a processing target image having channels necessary for obtaining intensity and reliability for each pixel.
  • the demosaic image I s (p) is generated.
  • the G channel for obtaining the intensity may be obtained for each pixel.
  • the demosaic processing units 221 and 222 may be simple processes that demosaic to the position 601 using the Bayer set 602 of FIG. 4 as a processing unit.
  • the demosaic method at this time may be a process in which the R and B channel pixels are used as they are, and the G channel pixel takes the average of the two pixels. In this case, the image is reduced to 1/2 in the vertical and horizontal directions, and an image having three channels is prepared.
  • the demosaic processing in the demosaic processing units 221 and 222 may be performed for each pixel with reference to a wider area, like the demosaic processing in the demosaic processing unit 140 of FIG. In this case, reduction is not performed and only demosaic is performed. Further, equalizes the pixel p M and the pixel p after demosaicing before demosaicing is when performing a demosaic processing for each pixel, the line from the mosaic image Ms to gain application unit is not necessary.
  • the white balance calculation unit 230 calculates a white balance gain for each channel with respect to the reference image held in the reference mosaic image holding unit 111.
  • the gain may be obtained so that the ratio of the average value of the RGB pixels of the entire screen is 1: 1: 1 based on the gray world hypothesis.
  • Another calculation method is an optimization problem as described in paragraphs 0071 to 0081 of JP-A-2006-67561 together with the processing target image held in the processing target mosaic image holding unit 112. It is also possible to ask for white balance. Further, it may be set by the same method as the white balance processing unit 130 in FIG. In addition, the white balance can be set in advance before imaging.
  • the photographer sets at the time of imaging based on the color temperature measured by another device such as a color meter.
  • another device such as a color meter.
  • preset white balance you can also use preset white balance. Or you may make it set by imaging a white object using a custom white balance (white set) function.
  • the calculated white balance is stored in the reference image white balance holding unit 240.
  • the channel gain calculation unit 250 calculates a gain FS (p) for each channel for color balance adjustment from the R, G, and B values of the reference image and the processing target image and the white balance of the reference image. is there.
  • the gain FS (p) is a gain value for each channel for converting the illumination component of the processing target image. As will be described later, this gain can be obtained by determining the ratio between the reference image and the processing target image with any channel as a reference. For example, when the G channel is used as a reference, the gain FS G (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.
  • 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 details of gain application will be described later, as a simplest application mode, it is conceivable to multiply a processing target image by a gain.
  • the mosaic image M 1 to which the gain is applied by the channel gain application unit 260 is held in the illumination component converted mosaic image holding unit 290 and supplied to the subsequent white balance processing unit 130.
  • FIG. 6 is a diagram illustrating a configuration example of the channel gain calculation unit 250 according to 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).
  • a gain is obtained for each channel of each pixel using two images (reference image and processing target image) captured in different illumination environments for the same subject, and applied. Generate images with high color reproducibility.
  • the reference image is an image for which white balance for each pixel has already been obtained or can be easily obtained by a conventional method or the like.
  • the processing target image is assumed to be an image in which it is difficult to estimate the white balance gain for each pixel from the image itself, such as an image captured under a plurality of light sources having different color temperatures from the reference image.
  • the white balance of the reference image it is possible to indirectly calculate the white balance of the processing target image, and it is possible to solve the problem of white balance with respect to an image captured under a plurality of light sources.
  • a combination of an image captured without flash emission and an image captured with flash emission is assumed.
  • a combination of an image having a band-like noise (flicker) due to the influence of a fluorescent lamp and an image not having it, a combination of an image in which the light source is changed in an environment where a plurality of light sources exist, and the like are assumed. .
  • the intensity measured by the sensor at each pixel is I
  • the illumination intensity is E
  • the spectral reflectance is ⁇
  • I (p) E (p) ⁇ ⁇ (p)
  • the intensity of the reference image I c when the intensity of the processing target image taking the ratio of the two images as I s, can counteract the effects of the spectral reflectance ⁇ in approximately each channel, the following equation
  • the ratio Ko of the illumination component that does not depend on the spectral reflectance can be obtained.
  • the value of Ko can be normalized, and Ko can be a pure illumination color balance ratio.
  • the target pixel I s in the value of this Ko it is possible to map the illumination component of the target pixel in the color balance of the illumination of the reference image.
  • simply dividing by Ko results in matching the intensity of the reference image with respect to the signal intensity as well as the color balance, and the effect of improving the intensity by the flash is lost. Therefore, in order to maintain the illumination intensity, a correction for canceling the intensity change is added, and the gain S can be expressed by the following equation.
  • KI is a value determined for each pixel in accordance with the definition of intensity.
  • the color conversion gain calculation units 311 and 312 calculate gains S R (p) and S B (p), respectively, using the above equations.
  • the gain S G (p) is always “1”. The reason why the value of the G channel is fixed is that the signal of the G channel has the largest number of pixels and the sensitivity is high, so that the reliability is considered high.
  • the gain S is calculated via the ratio Ko of the same channel between images, but the same processing may be realized by changing the calculation order.
  • division processing is processing with high calculation cost, it is desirable to use a method such as processing by an inverse lookup table or subtraction after conversion to logarithm in order to reduce the amount of calculation.
  • a ratio other than the G channel such as a luminance value for each pixel, can be used as the KI value.
  • the channel gain application unit 260 By multiplying each pixel by the gain obtained in this way in the channel gain application unit 260, it is possible to obtain an image whose illumination intensity is equal to the processing target image with the color balance of the reference image.
  • the light source is not separated, and the combined light of the processing target image is viewed as one light source and mapped to the color balance of the illumination of the reference image. For this reason, it operates normally even if the difference between the two images is composed of a plurality of light sources.
  • the illumination component conversion processing unit 120 further includes upper limit clipping units 321 and 322 and lower limit clipping units 331 and 332. As a result, an upper limit value and a lower limit value are set as gain values, and clipping processing is performed to suppress extreme artifacts.
  • the illumination component conversion processing unit 120 further includes blackout compensation units 341 and 342, a blackout degree calculation unit 345, saturation compensation units 351 and 352, and a saturation degree calculation unit 355.
  • blackout compensation units 341 and 342 determines the effectiveness of the gain S, and determines the gain as a weighted average with a compensation value determined by a measure specific to blackout or saturation. Therefore, the gain that does not cause a major failure is obtained.
  • the upper limit clipping units 321 and 322 perform clipping processing so that the upper limit value is reached when the gain S R (p) or S B (p) exceeds the upper limit value.
  • the lower limit clipping units 331 and 332 perform clipping processing so that the lower limit value is reached when the gain S R (p) or S B (p) is 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 the gain upper limit value B holding unit 324.
  • the gain lower limit value can be preset in the gain lower limit value R holding unit 333 or 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 set after being calculated internally. When calculating the gain upper limit value and the gain lower limit value, the following equations can be used.
  • WB c is the white balance for the reference image
  • WB s is the white balance for the processing target image.
  • the gains S maxcR (p) and S maxcB (p) clipped by the upper limit clipping units 321 and 322 are supplied to the lower limit clipping units 331 and 332.
  • the gains S mincR (p) and S mincB (p) clipped by the lower limit clipping units 331 and 332 are supplied to the blackout compensation units 341 and 342.
  • the blackout degree calculation unit 345 calculates a blackout degree indicating the degree of occurrence of blackout based on the value of a specific channel of the reference image or the processing target image.
  • the G channel is assumed as the specific channel.
  • the sensor characteristics are not linear.
  • the ratio Ko cannot be obtained correctly for a channel that is completely blacked out and has a pixel value of zero. Therefore, it is necessary to calculate the gain by another method for a pixel having a very small pixel value.
  • the pixel of the image to be processed is dark, it is inconspicuous even if the wrong gain is calculated and the color balance is applied. However, when the pixel has sufficient brightness by the flash, the failure of the color balance is conspicuous. From this, it is desirable that the characteristic required for the degree of blackout is large when the reference image is very small, and exhibits a large value when the processing target image becomes sufficiently bright due to flash.
  • the blackening degree PGB (p) may be set according to FIG. 8 and the following equation.
  • This equation calculates the degree of blackout from the pixel value of the reference image and the inter-channel ratio between the reference image and the processing target image.
  • expCV is a coefficient for correcting a difference in exposure due to a difference in aperture, shutter speed, and ISO sensitivity setting for the sensor between the reference image and the processing target image.
  • expCV may be set by the following equation based on Exif information.
  • F is an F value representing an aperture
  • t is a shutter speed
  • ISO ISO sensitivity.
  • Each subscript c means a reference image
  • subscript s means an image to be processed.
  • the blackout compensation value R holding unit 343 and the blackout compensation value B holding unit 344 hold a blackout compensation value that serves as a reference when compensating for the blackout. It is effective to set the blackout compensation value to WBs / WBc on the assumption that the illumination component of the processing target pixel is substantially due to the flash. As WBc and WBs at this time, values similar to the white balance used for calculating the upper limit value and the lower limit value can be used. As the WBs here, a white balance value obtained by double white balance correction described in Japanese Patent No. 3889017 may be used.
  • the blackout compensation units 341 and 342 compensate the gain Sminc ( SmincR (p) and SmincB (p)) in the blackout compensation value R holding unit 343 and the blackout compensation value B holding unit 344. A process of approaching the value is performed. Specifically, the blackout compensation units 341 and 342 perform the gain S bacR (p) and the proportional processing (weighted average) between S minc and the blackout compensation value with the blackening degree PGB (p) as a weight. to generate the S blacB (p).
  • the saturation calculation unit 355 calculates a saturation indicating the degree to which the reference image is saturated (out-of-white) based on the value of the G channel of the reference image.
  • the sensor characteristics are not linear.
  • the ratio Ko cannot be obtained correctly for a channel that is more completely saturated and whose value has reached the upper limit. Therefore, for a pixel having a very large pixel value, it is necessary to calculate the gain by another method.
  • a value having the characteristics shown in FIG. 9 is effective for the degree of saturation PGS (p). That is, 0 is saturation up to the value of certain threshold, abruptly saturation in a region where the intensity G c of G of the reference image exceeds a threshold value is increased.
  • the saturation compensation value R holding unit 353 and the saturation compensation value B holding unit 354 hold a saturation compensation value that serves as a reference when compensating for saturation. It is considered effective to set the saturation compensation value to “1”.
  • the saturation compensators 351 and 352 perform the gain FS R (p) and FS B by prorated processing (weighted average) of the gain S black and the saturation compensation value with the saturation PGS (p) as a weight. (P) is generated.
  • the blackening degree and saturation are determined using the G channel, but this is not limited to the G channel.
  • the determination based on the R and B channels, or their maximum / minimum, linear sum, luminance value, and the like is also effective.
  • the channel gain calculation unit 250 uses the G channel in the intensity obtained by the color conversion gain calculation units 311 and 312, the blackness level determination in the black level calculation unit 345, and the saturation level determination in the saturation level calculation unit 355, the mosaic is used.
  • the original channel on the image it is necessary to have a G channel value for each pixel, but other channels are not necessarily required. Further, the channel required for each pixel changes as the intensity reference channel is changed.
  • FIG. 10 is a diagram illustrating a first configuration example of the channel gain application unit 260 in the embodiment of the present invention.
  • the first configuration example of the channel gain application unit 260 includes multiplication units 261 and 262.
  • the multiplication unit 261 multiplies R s (p) of the processing target image I s (p) from the demosaic processing unit 222 and the gain FS R (p) from the channel gain calculation unit 250.
  • the multiplication unit 262 multiplies B s (p) of the processing target image I s (p) from the demosaic processing unit 222 and the gain FS B (p) from the channel gain calculation unit 250.
  • the processing of both is expressed by the following equation.
  • R l (p) and B l (p) constitute the R channel and the B channel of the mosaic image M l , respectively.
  • the G pixel of the mosaic image M s of the processing target image is read and stored as G at a corresponding position on the mosaic image M l . It is necessary to apply the gain to the G channel depending on the intensity of the signal held when calculating the gain.
  • the channel gain calculation unit 250 calculates the gain for the G channel in a form according to the R and B channels, and the channel gain application unit 260 applies the gain.
  • FIG. 11 is a diagram illustrating an operation example of the imaging apparatus according to the embodiment of the present invention.
  • imaging is performed without emitting the flash light emitting unit 61 (step S901), and stored in the reference mosaic image holding unit 111 as a mosaic image M c of the reference image (step S902).
  • the imaging light is emitted flash light emitting unit 61 is performed (step S903), and stored in the processing target mosaic image holding unit 112 as a mosaic image M s of the processing target image (step S904).
  • the illumination component conversion processing unit 120 of the image processing circuit 23 adjusts the color balance of the processing target image based on the two captured images, and converts the illumination component into a color balance of a single light source (step). S910).
  • the white balance processing unit 130 adjusts the color balance of the mosaic image (step S905).
  • the demosaic processing unit 140 generates an RGB image in which RGB information is aligned for each pixel from the mosaic image (step S906).
  • the gradation correction processing unit 150 performs gradation correction processing on the RGB image (step S907).
  • the gamma correction processing unit 160 performs gamma correction processing on the tone-corrected image (step S908).
  • the YC conversion processing unit 170 converts the gamma-corrected RGB image into a YC image (step S909).
  • the converted YC image is output for display on the LCD or storage on a recording medium. This completes the operation of the image processing unit for one frame. If there is no subsequent frame input, the operation of the image processing unit ends.
  • the imaging order may be reversed by capturing an image with light emission first.
  • FIG. 12 is a diagram illustrating an operation example of the illumination component conversion processing procedure (step S910) according to the first embodiment of the present invention.
  • a reference image is read (step S911), and a white balance for each channel with respect to the reference image is calculated (step S912).
  • the calculated white balance is held in the reference image white balance holding unit 240 (step S913).
  • the processing for each pixel is performed on the entire screen.
  • the processing target image is read (step S914).
  • These read reference image and processing target image are subjected to demosaic processing in the demosaic processing units 221 and 222, respectively (steps S915 and S916).
  • the order of demosaic processing is not limited.
  • the channel gain calculation unit 250 calculates the gain for each channel for color balance adjustment from the R, G, and B values of the reference image and the processing target image (step S917).
  • the calculated gain is applied to each channel of the processing target image in the channel gain application unit 260 (step S918).
  • the processing target image processed in this way is held in the illumination component converted mosaic image holding unit 290 (step S919).
  • FIG. 13 is a diagram showing an operation example of the channel gain calculation processing procedure (step S917) in the first embodiment of the present invention.
  • the gain upper limit value or the lower limit value is set 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, respectively (step S921). .
  • the blackout compensation value R holding unit 343 and the blackout compensation value B holding unit 344 are set with blackout compensation values
  • the saturation compensation value R holding unit 353 and the saturation compensation value B holding unit 354 are set with saturation compensation values.
  • the following processing is repeated for each pixel (loop L702).
  • the pixel of the processing target image and the pixel of the reference image are acquired (step S923).
  • the blackening degree calculation unit 345 calculates the blackening degree (step S924)
  • the saturation degree calculation unit 355 calculates the saturation degree (step S925). Further, the following processing is repeated for each channel (R channel and B channel) (loop L703).
  • the color conversion gain is calculated by the color conversion gain calculation units 311 and 312 (step S926).
  • step S927 if the gain upper limit value held in the gain upper limit value B holding unit 324 or the gain upper limit value R holding unit 323 is exceeded (step S927), clipping processing using the gain upper limit value is performed (step S928). .
  • step S929 If the gain lower limit value held by the gain lower limit value R holding unit 333 or the gain lower limit value B holding unit 334 is below (step S929), clipping processing by the gain lower limit value is performed (step S931). These clipping processes may be performed in the order of the lower limit value and the upper limit value.
  • the blackout compensation unit 341 or 342 performs blackout compensation according to the degree of blackout (step S932). Further, the saturation compensation unit 351 or 352 performs saturation compensation according to the saturation (step S933). The gain thus obtained is stored in a memory (not shown) (step S934).
  • steps S926 to S934 in the loop L703 When the processing of steps S926 to S934 in the loop L703 is completed, the same processing is repeated for the next channel. When the processing for all the channels is completed, the processing for the next pixel is repeated through the loop L703. When the processing for all the pixels is completed, the process exits the loop L702 and ends the channel gain calculation processing for one frame.
  • the demosaic process performed in steps S915 and S916 in FIG. 12 as a process for each pixel between steps S923 and S924. Thereby, the process of step S914 thru
  • FIG. 14 is a diagram illustrating an operation example of the channel gain application processing procedure (step S918) according to the first embodiment of the present invention. Here, the following processing is repeated for each pixel (loop L704).
  • the RGB values (R s (p) and B s (p)) and the gains (FS R (p) and FS B (p)) of the processing target image are acquired (step S937). These RGB values and gains are multiplied for each channel by the multipliers 261 and 262 (step S938). This multiplication result is held in a position corresponding to the gain applied original pixel positions on the mosaic image M s of the processed image of the illumination component converted mosaic image holding unit 290 for each channel as the pixel value of the mosaic image M l (Step S939). Further, the processing in step S939 referred to here is step S919 in FIG. 12, and the other processing can be omitted by storing the processing result in any one of them.
  • the process exits loop L704 and ends the channel gain application processing for one frame.
  • the processing in steps S938 to S939 is inserted immediately after step S933 in FIG. 13, so that the loop L703 in FIG. 13 and the loop L704 in FIG. It can be configured as a process. At this time, steps S934 and S937 are omitted.
  • the gain for each pixel is obtained so that the color balance of the reference image is obtained, and this is applied to each pixel of the processing target image by the multipliers 261 and 262.
  • the gain is out of the range of the upper limit value or the lower limit value
  • extreme artifacts are suppressed by performing clipping processing in the upper limit value clipping units 321 and 322 and the lower limit value clipping units 331 and 332 when the gain is calculated. can do.
  • the black loss compensation units 341 and 342 and the saturation compensation units 351 and 352 use the weighted average with the compensation value as a gain, thereby causing a large breakdown. Not gain gain.
  • Second Embodiment> gain application is performed by simple multiplication in the multipliers 261 and 262.
  • the coordinates of the pixel may be slightly shifted, and there may be a case where it is not possible to sufficiently deal with disturbances as it is. Therefore, an example in which robust gain application is performed by performing smoothing from surrounding pixels in accordance with the reliability of each pixel will be described below. Note that the configurations of the imaging device and the image processing circuit 23 that are the premise are the same as those in the first embodiment, and thus description thereof is omitted.
  • FIG. 15 is a diagram illustrating a configuration example of the illumination component conversion processing unit 120 according to the second embodiment of the present invention.
  • the configuration example of the illumination component conversion processing unit 120 is different from the first configuration example described with reference to FIG. 5 in that the output from the demosaic processing unit 221 is input to the channel gain application unit 260.
  • the configuration is the same as that of the first configuration example. Therefore, description of other configurations is omitted.
  • FIG. 16 is a diagram illustrating a configuration example of the channel gain application unit 260 according to the second embodiment of the present invention.
  • a configuration example 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 reliability calculation unit 450, and a moving subject reliability calculation unit 460. And a reliability selection unit 470 and a smoothing processing unit 480.
  • 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.
  • division is a process with high calculation cost. Therefore, it is desirable that this division is realized by a method such as processing using an inverse look-up table or subtraction after conversion to a logarithm to reduce the amount of computation.
  • Exposure compensation units 431 to 433 perform processing for compensating for a difference in imaging conditions of two images.
  • the intensity is adjusted so that the exposure intensity is equal in a region where the illumination environment in the reference image and the processing target image is equally quiet.
  • This exposure compensation process is a process of adjusting the gain so that the subjects imaged under the same conditions have the same intensity.
  • This exposure compensation processing is simply realized by multiplying the ratio Ko by the exposure compensation value expCV calculated from each parameter of the Exif information. Thereby, the ratio K after compensation is obtained.
  • the saturation reliability calculation unit 440 calculates the reliability of the reference image from the viewpoint of saturation.
  • the linear characteristic of the sensor does not hold in the saturation region. Furthermore, it is difficult to determine the gain correctly for a channel that is completely saturated and whose value is clipped at the upper limit. In view of this, it is considered effective to reduce the weight of a saturated pixel and obtain the value of that pixel based on information on peripheral pixels with higher reliability during the smoothing process. Accordingly, as shown in FIG. 17, the saturation reliability ST (p) is 1 until the intensity Gc of a certain reference image reaches a threshold value, and the value decreases rapidly as the intensity increases when the intensity exceeds a certain threshold value. Such characteristics are considered effective.
  • This method can also be used as a method for calculating the saturation reliability of the processing target image. In that case, Gs is used instead of Gc.
  • the blackout reliability calculation unit 450 calculates the reliability of the reference image from the viewpoint of the blackout degree.
  • linearity does not hold in the characteristics of the sensor in a blackout area.
  • such a failure is noticeable when the intensity of the processing target image is large. Therefore, for pixels with a very small pixel value in the reference image and a sufficiently large pixel value in the processing target image, the weight is reduced during the smoothing process, and the periphery with higher reliability It is considered effective to obtain the value of the pixel from the pixel information.
  • the blackout reliability BT (p) has a value having the following characteristic represented by FIG. This equation is for calculating the degree of blackout from the pixel value of the reference image.
  • this method can also be used as a blackout reliability calculation method for the processing target image. In that case, Gs is used instead of Gc.
  • the blackout reliability BT (p) may be a value having the following characteristic represented by FIG. This equation calculates the degree of blackout from the pixel value of the reference image and the inter-channel ratio between the reference image and the processing target image.
  • the saturation reliability calculation unit 440 and the blackout reliability calculation unit 450 described above use the G channel to determine the blackness and saturation, but this is not limited to the G channel.
  • the determination based on the R and B channels, or their maximum / minimum, linear sum, luminance value, and the like is also effective.
  • the moving subject reliability calculation unit 460 calculates the reliability of the reference image from the viewpoint of whether or not it is a moving subject.
  • the moving subject reliability calculation unit 460 determines whether each pixel is a moving subject by paying attention to the characteristic value of the subject that can be discriminated in both the non-flash light emission and light emission images, and determines the moving subject reliability MT ( p) is calculated.
  • a characteristic value for example, the spectral reflectance of the subject can be considered.
  • it is difficult to correctly obtain a gain because a pixel cannot be correctly compared in a moving subject. In such a pixel, it is considered effective to reduce the weight during the smoothing process and obtain the value of the pixel based on the information of the peripheral pixels with higher reliability.
  • the reliability selection unit 470 selects the lowest reliability among the saturation reliability ST (p), the blackout reliability BT (p), and the moving subject reliability MT (p). As a result, the reliability FT (p) determined to be the most suspicious is selected. In this selection, the reliability as a linear sum of the saturation reliability ST (p), the blackout reliability BT (p), and the moving subject reliability MT (p) may be calculated.
  • the smoothing processing unit 480 performs gain on the RGB values (R s (p) and B s (p)) of the processing target image while smoothing based on the reliability FT (p) obtained in this way. Apply FS R (p) and FS B (p). As a first processing function example of the smoothing processing unit 480, when weighted smoothing is performed in the region ⁇ , it is realized by the following equation.
  • the mosaic image M 1 to which gain is applied in this way is held in the illumination component converted mosaic image holding unit 290.
  • Other examples of the smoothing process will be described later.
  • FIG. 20 is a diagram illustrating a configuration example of the moving subject reliability calculation unit 460 according to the second embodiment of the present invention.
  • the moving subject reliability calculation unit 460 includes a ratio inversion 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, and a flash light spectral color balance.
  • a value holding unit 465 and a minimum value selection unit 466 are provided.
  • the white balance WB c for the reference image can be used.
  • WB pc the ambient light spectrum color balance value held in the ambient light spectrum color balance value holding unit 464 .
  • the flash light spectral color balance value held in the flash light spectral color balance value holding unit 465 is for each channel such that the signal intensity of the achromatic object is achromatic with respect to the flash light spectrum by the flash light emitting unit 61. Is the gain.
  • the white balance WB s for the processing target image can be used.
  • WB pf the color balance values for these spectra may be set by calculating inside the imaging apparatus, or may be set from outside the imaging apparatus. The same applies to ambient light.
  • the ratio reverse degree calculation unit 461 calculates the moving subject reliability from the viewpoint of the change direction of the pixel value.
  • the ratio reversal calculation unit 461 detects that the pixel value is a moving subject by detecting that the change direction of the pixel value is reversed with respect to the illumination component change direction of the entire image.
  • the compensated ratio K should be larger than “1”. Further, the ratio K after compensation should be equal to “1” in the region where the flash did not hit.
  • the ratio inversion ratio MTRK (p) is calculated by the function having the characteristics shown in FIG. Can be determined. That is, it is considered that the ratio reversal degree MTRK (p) having a characteristic that logK is negative and the value becomes closer to 0 as the absolute value becomes larger is effective.
  • the ratio prediction unit 462 calculates the moving subject reliability from the viewpoint of the predicted value of the ratio K.
  • the ratio predicting unit 462 determines that the object is a moving subject by predicting the value of the ratio K after compensation and measuring the deviation from the actually measured value.
  • Illumination component E s of the processing target image is a flash image is represented by adding the pf "E by only c and the flash light" E by ambient light of the illumination components of the processing target image.
  • E s (p) E ′′ c (p) + E ′′ pf (p) Therefore, the ratio Ko is expressed by the following equation.
  • This is a gain for adjusting the color balance so as to be 1: 1: 1. Therefore, the following relationship holds.
  • a pixel having a large difference absolute value, ⁇ K
  • the prediction ratio in FIG. 22 means reliability associated with an error between the predicted ratio and the actual value.
  • the spectral reflectance change amount prediction unit 463 calculates the moving subject reliability from the viewpoint of the predicted value of the spectral reflectance change amount. Similar to the ratio prediction unit 462, the spectral reflectance change amount prediction unit 463 estimates the value of the intensity ratio K of the R and B channels based on the value of the G channel.
  • the ratio of R, G, and B can be approximated by the following equation. This formula means that the following three points exist on the same straight line.
  • the spectral reflectance change amount MTVR (p) has a characteristic as shown in FIG. 23 as a function of ⁇ . That is, when aligned on a straight line, the weight in spatial smoothing approaches “1” and becomes “0” when the angle ⁇ is a right angle. Note that the amount of change in spectral reflectance in FIG. 23 means reliability associated with the change in spectral reflectance.
  • the minimum value selection unit 466 selects the minimum value from the values obtained by the ratio reversal degree calculation unit 461, the ratio prediction unit 462, and the spectral reflectance change amount prediction unit 463 to obtain the final moving subject reliability. It is output as MT (P).
  • MT MT
  • all of the ratio inversion calculation unit 461, the ratio prediction unit 462, and the spectral reflectance change amount prediction unit 463 are used, but only a part of them are used alone or in combination. Also good.
  • FIG. 24 is a diagram illustrating an operation example of the channel gain application unit 260 according to the second embodiment of the present invention. Here, the following processing is repeated for each pixel (loop L705).
  • RGB values (Rc (p), Gc (p) and Bc (p), Rs (p), Gs (p) and Bs (p)) of the reference image and the processing target image are acquired (step). S941).
  • the ratio Ko (p) of the RGB values of the reference image and the processing target image is calculated (step S942).
  • the exposure compensation units 431 to 433 perform exposure compensation processing according to settings at the time of imaging (step S943). As a result, the ratio is “1” for a stationary subject with no change in illumination environment.
  • the saturation reliability ST (p) is calculated in the saturation reliability calculation unit 440 (step S944).
  • the blackout reliability calculation unit 450 the blackout reliability BT (p) is calculated (step S945).
  • the moving subject reliability calculation unit 460 calculates the moving subject reliability MT (p) (step S946).
  • the reliability selection unit 470 selects the one with the lowest reliability among the saturation reliability ST (p), the blackout reliability BT (p), and the moving subject reliability MT (p) (step S947). .
  • the reliability thus obtained is stored in a memory (not shown) (step S948).
  • steps S942 to S948 is inserted immediately after exiting the loop L703 in FIG. 13, so that the loop L702 in FIG. 13 and the loop L705 in FIG. It can be configured as a loop process. Since the value of each pixel has already been read in step S923, step S941 can be omitted.
  • step S949 smoothing processing is performed for each pixel.
  • the pixel value to which the gain is applied in this way is held in the illumination component converted mosaic image holding unit 290 (step S950).
  • step S950 here is step S919 in FIG. 12, and the other processing can be omitted by storing the processing result in any one of them.
  • FIG. 25 is a diagram illustrating an operation example of the moving subject reliability calculation unit 460 in the embodiment of the present invention. Here, the following processing is performed for each pixel.
  • the ratio K is acquired from the exposure compensation units 431 to 433 (step S951).
  • the ambient light color balance in the reference image is acquired from the ambient light spectral color balance value holding unit 464
  • the flash light color balance is acquired from the flash light spectral color balance value holding unit 465 (step S951).
  • the ratio reversal degree calculation unit 461 determines the reversal of the intensity change direction and the pixel intensity direction of the entire image, and calculates the ratio reversal degree according to the degree (step S952). Further, the ratio prediction unit 462 determines whether or not the subject is a moving subject from the degree of deviation between the actually measured value and the estimated value of the ratio K, and determines the prediction ratio (step S953). Since it is assumed that the spectral reflectance ⁇ is canceled by the denominator at the time of the ratio prediction, the deviation from the prediction means that a change in the spectral reflectance is detected, and it is determined that the subject is a moving subject.
  • the spectral reflectance change amount prediction unit 463 predicts the spectral reflectance change amount from the difference between the color balance prediction value and the actual measurement value (step S954). Then, the minimum value selection unit 466 selects the minimum value from the values obtained by the ratio inversion 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).
  • the reliability of each pixel is determined from the viewpoint of blackout, saturation, or moving subject, and the weight of the pixel having low reliability during smoothing is determined.
  • the information on the surrounding pixels can be used, and robust gain application can be performed.
  • Edge preserving smoothing is a non-linear filter process that smoothes gradation while leaving a significant step such as an object boundary in an image. It has been used for noise reduction processing for a long time to remove minute fluctuations while preserving object contours that affect visibility.
  • This edge-preserving smoothing process uses a property that can separate fine luminance fluctuations of texture in an object and significant luminance steps of an object outline, and compresses luminance differences other than detail components represented by texture. It is also used for tone correction processing.
  • the bilateral filter BLF (p) for the luminance I (p) of the image has a weighting function ⁇ (p-pc) in the spatial direction and a weighting function ⁇ (I (p) ⁇ in the luminance value direction, as The pixel value I (p) around the center pixel position pc weighted by two of I (pc)) is added.
  • the denominator on the right side indicates the normalization coefficient of the weight value.
  • the weighting for each pixel in the local region changes depending on the luminance value of the central pixel. Therefore, since it is necessary to recalculate the weight value for each pixel, there is a problem that the amount of calculation becomes much larger than that of a normal linear FIR filter or the like.
  • a technique called a joint bilateral filter or a cross bilateral filter has been proposed.
  • the weighting for each pixel in the local region changes depending on the luminance value of the central pixel that is the filtering target, whereas in the joint bilateral filter, the characteristic value used for the weight calculation and the filtering target Characteristic values are different.
  • the expression by the joint bilateral filter JBLF (p) is as follows.
  • the above expression represents the pixel value S around the center pixel position pc weighted by two weight functions ⁇ (p-pc) in the spatial direction and weight function ⁇ (I (p) ⁇ I (pc)) in the luminance value direction.
  • This represents an operation for adding (p). For example, when there is a signal I having a high correlation with a signal S having a very poor S / N characteristic and a high S / N ratio, an edge having a good S / N ratio is obtained by performing weighting according to the I signal. Save-type filtering is possible.
  • the weighting for each pixel in the local region changes depending on the luminance value of the central pixel. Therefore, since it is necessary to recalculate the weight value for each pixel, there is a problem that the calculation amount is much larger than that of a normal linear FIR filter or the like.
  • I (pc) is a luminance value at the coordinate position pc.
  • S (i, j, ⁇ ) is an integral value of the gain of the block (i, j, ⁇ ).
  • H (i, j, ⁇ ) is a value of the block histogram. Since the above equation corresponds to the spatial weighting function ⁇ of the joint bilateral filter and the weighting function ⁇ of the luminance axis discretized on the staircase along the block division, there is an effect of edge preserving smoothing. Furthermore, even if the cost for calculating the block histogram and the block integration value is subtracted, the weighted product sum for each block can be much smaller than the weighted product sum for each pixel. This effect increases as the operator size for edge preserving smoothing increases.
  • the third embodiment of the present invention proposes an edge preserving smoothing process in which a weight ⁇ (p) determined for each pixel position is introduced in addition to the above weight.
  • the weighted integration of the block histogram and the characteristic value inside the block is expressed as follows.
  • ISW (i, j, ⁇ ) is a weighted gain integral value in the block (i, j, ⁇ )
  • IFT (i, j, ⁇ ) is a weighted frequency in the block (i, j, ⁇ ). Value, ie, the integral of the weight itself.
  • the third embodiment of the present invention provides a technique for reducing the amount of calculation. That is, an operation for convolving a weight function in the luminance axis direction is performed in advance on the block histogram and the gain integral value for each block, and the result is held.
  • the convolution operation to the block histogram is as follows.
  • the convolution operation to the block integration value is as follows. In the weighted product-sum operation for each pixel, it is only necessary to divide the result obtained by interpolating the block histogram in which the luminance weight function is already convolved and the weighted gain integral value in the spatial direction. This calculation is as follows. This effect is more significant when the number of block divisions is larger than the original image size, that is, when the smoothing process is performed by looking at a wide range in the image.
  • the above-described block histogram, gain integral value for each block, or a result obtained by convolving them with a luminance axis weight function is stored in a memory.
  • This provides a method used for edge preserving smoothing processing in the next input frame. That is, when the input is moving image data, it is possible to execute huge edge preserving smoothing with a small working memory without scanning all pixels twice.
  • the input image is reduced before the process of calculating the block histogram, the gain integral value for each block, or a result obtained by convolving them with a luminance axis weight function.
  • This reduces the amount of calculation and the amount of memory for calculating the block histogram, the gain integral value for each block, or the result of convolving them with the luminance axis weight function.
  • the configurations of the presumed imaging device, the image processing circuit 23, and the illumination component conversion processing unit 120 are the same as those in the second embodiment, and thus the description thereof is omitted.
  • FIG. 26 is a diagram illustrating a processing function example of the smoothing processing unit 480 in the third embodiment of the present invention.
  • the processing function example of the smoothing processing unit 480 includes multiplication units 511 and 512, a luminance calculation unit 521, and a nonlinear conversion unit 522.
  • the second processing function example 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, a block histogram holding unit 543, It has.
  • the second processing function example 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.
  • the luminance calculation unit 521 calculates the luminance value L (p) from the RGB values of the processing target image. For example, the luminance calculation unit 521 may calculate the luminance value by calculating a linear sum of the RGB values using a coefficient (weight) set in advance for the RGB values. In addition, the luminance calculation unit 521 may generate the luminance value by, for example, a process for obtaining the maximum value from the RGB values.
  • the non-linear conversion unit 522 performs non-linear conversion on the luminance value calculated by the luminance calculation unit 521 and outputs a non-linear conversion luminance value L (nl) (p). It is useful to apply a “upwardly convex monotone increasing characteristic” such as a power characteristic by an exponent smaller than 1 or a logarithmic transformation, for example, to the nonlinear conversion unit 522.
  • Multipliers 511 and 512 generate a weighted gain SW (p) for each channel by multiplying the gain FS (p) for each channel by the reliability FT (p) of the pixel.
  • the block integral value calculation units 531 and 532 divide an image into a plurality of blocks in the spatial axis direction and the luminance axis direction, and calculate an integral value of characteristic values belonging to each block.
  • the characteristic values here are the weighted gains SW R (p) and SW B (p) of the R and B channels weighted by the reliability FT (p).
  • the integrated values calculated by the block integrated value calculating units 531 and 532 are stored in the block integrated value holding unit 541 or 542. That is, the block integration value holding unit 541 holds the weighted gain ISW R (r) of the R channel.
  • the block integral value holding unit 542 holds the B channel weighted gain ISW B (r).
  • the block histogram calculation unit 533 integrates the reliability FT (p) belonging to each of the divided blocks, and calculates a pixel frequency value as a block histogram.
  • the block histogram IFT (r) calculated by the block histogram calculation unit 533 is stored in the block histogram holding unit 543.
  • the information held in the block integration value holding units 541 and 542 and the block histogram holding unit 543 is also referred to as intermediate data.
  • the phase compensation processing units 551 and 552 calculate a luminance value according to the position on the mosaic image of the processing target image corresponding to each channel of the pixel.
  • the luminance value is obtained at the position 601 for each Bayer set 602.
  • the processing by the phase compensation processing units 551 and 552 can be realized by linear interpolation processing from four neighboring luminance values for each pixel position on the mosaic image.
  • demosaic is performed for each pixel instead of the simple demosaic, since the luminance is obtained for each pixel of the mosaic image of the processing target image by the luminance calculation unit 521 and the nonlinear conversion unit 522, this phase compensation processing can be omitted. .
  • the weighted product-sum units 561 and 562 calculate the global gain value at the pixel position from the block histogram, the block integration value, and the luminance value at the pixel position.
  • the global gain value is information corresponding to the average gain of the object region to which the pixel position belongs.
  • Weighted product-sum unit 561 supplies the global gain value SW lR (p) to the gain application unit 571
  • the weighted product-sum unit 562 supplies global gain value SW lB to (p) the gain application unit 572.
  • the gain application units 571 and 572 apply the gain calculated by the weighted product-sum units 561 and 562 to each channel value.
  • the processing in the gain applying units 571 and 572 can be generally realized by multiplication. That is, the gain application units 571 and 572 each perform a calculation such as the following equation.
  • R l (p) R s (p) ⁇ SW lR (p)
  • B 1 (p) B s (p) ⁇ SW 1B (p)
  • the weighted product-sum units 561 and 562 and the gain application units 571 and 572 are examples of the smoothing processing unit described in the claims.
  • FIG. 27 is a diagram illustrating a configuration example of the block integration value calculation units 531 and 532 and the block histogram calculation unit 533 according to the third embodiment of the present invention.
  • Each of the block integration value calculation units 531 and 532 and the block histogram calculation unit 533 includes a block selection unit 534 and n integrators 535-1 to 535-1.
  • the number of block divisions in the width direction of the image is W
  • the number of block divisions in the height direction of the image is H
  • the number of block divisions in the luminance direction of the image is D
  • the number of blocks n is W ⁇ H ⁇ D. .
  • the block selection unit 534 classifies the input weighted feature value of each pixel into one of n blocks according to the pixel position and the luminance value.
  • the weighted feature value here is R, B channel gain SW R (p), SW B (p) or reliability FT (p) weighted by reliability FT (p).
  • the integrators 535-1 to 53-n add the classified weighted feature quantities.
  • Each of the integrators 535-1 to 535-1 holds an adder 536 and a register 537.
  • the adder 536 adds the classified weighted feature value and the value held in the register 537.
  • a register 537 holds the output of the adder 536.
  • FIG. 28 is a diagram illustrating a configuration example of the weighted product-sum units 561 and 562 in the third embodiment of the present invention.
  • Each of the weighted product-sum units 561 and 562 includes an interpolation unit 563 and 564, a space weight function table holding unit 565, a product-sum unit 566 and 567, a luminance weight function table holding unit 568, and a division unit 569. Prepare.
  • Interpolators 563 and 564 interpolate weighted feature amounts corresponding to the pixel positions of the input luminance values. That is, the interpolating unit 563 interpolates the block integral value ISW R (r) or ISW B (r) of the weighted gain SW R (r) or SW B (r) of the 4 ⁇ 4 block region in the spatial direction near the pixel position. . The interpolating unit 564 interpolates the block integral value IFT (r) of the reliability FT (p) itself of the 4 ⁇ 4 block region in the spatial direction near the pixel position. For example, a cubic B-spline function is suitable for the interpolation coefficient at that time.
  • the B-Spline function value is held as a space weight function table in the space weight function table holding unit 565 so that a necessary coefficient can be extracted based on the relative positional relationship between the neighboring block position and the pixel position. be able to.
  • the calculations performed by the interpolation units 563 and 564 are as follows.
  • i and j are indexes indicating neighboring 4 ⁇ 4 blocks.
  • is the median luminance level corresponding to each block of the histogram.
  • B_i, j is a B-Spline interpolation coefficient for the block corresponding to the index i, j.
  • ISW R (i, j, ⁇ ) and ISW B (i, j, ⁇ ) are block integrals of the weighted gains SW R (p) or SW B (p) of the block corresponding to (i, j, ⁇ ). Value.
  • IFT (i, j, ⁇ ) is an integral value (block histogram) with respect to the reliability FT (p) itself of the block corresponding to (i, j, ⁇ ).
  • the interpolation unit 563 is an example of a first interpolation unit described in the claims.
  • the interpolation unit 564 is an example of a second interpolation unit described in the claims.
  • the product-sum units 566 and 567 calculate the result of product-summing the luminance weight values with respect to the weighted integral values corresponding to the pixel positions.
  • the luminance weight value is calculated using a table stored in the luminance weight function table holding unit 568.
  • FIG. 29 is a diagram illustrating an example of the shape of the luminance weight function stored in the luminance weight function table holding unit 568.
  • the luminance weight function has a larger value as the difference value between the input luminance value L (nl) (p) of the pixel position and the luminance level ⁇ corresponding to each block of the integral value interpolated at the pixel position is smaller.
  • a unimodal shape function with is appropriate. For example, a function as shown in the following equation can be used.
  • ⁇ _th is a constant value that determines the extent of the base of this function.
  • a large weight value is assigned to a block having a value close to the input luminance value L (nl) (p), and a small weight value is assigned to a block having a remote value. You can turn on.
  • the product-sum units 566 and 567 calculate the weight value for each block using the luminance weight function and the input luminance value, and then the weights interpolated at the pixel position and the values of all blocks of the weighted gain integral value are calculated for each weight.
  • the division unit 569 divides the weighted gain value calculated by the product-sum unit 566 by the reliability calculated by the product-sum unit 567 and outputs the result as a global gain value at the pixel position. .
  • the operations performed by the product-sum units 566 and 567 and the division unit 569 are as follows.
  • the product-sum unit 566 is an example of a first product-sum unit described in the claims.
  • the product-sum unit 567 is an example of a second product-sum unit described in the claims.
  • the division unit 569 is an example of a second division unit described in the claims.
  • the weighted gain of pixels having a value close to each block area and the reliability itself are integrated for each block. Therefore, as described above, by performing product-sum with weighting on a block having a luminance level close to the luminance value at the pixel position, an integration result of pixels having particularly close luminance values in the surrounding 4 ⁇ 4 block region is obtained. . Therefore, even if a wide area such as a surrounding 4 ⁇ 4 block area is integrated, the influence of the pixel value on another subject having different brightness is small, and the average gain value of the subject to which the pixel belongs can be calculated.
  • the interpolation unit 564 is an example of a first interpolation unit described in the claims.
  • the interpolation unit 563 is an example of a second interpolation unit described in the claims.
  • the product-sum unit 567 is an example of a first product-sum unit described in the claims.
  • the product-sum unit 566 is an example of a second product-sum unit described in the claims.
  • FIGS. 30 and 31 are diagrams illustrating an operation example of the smoothing processing unit 480 in the third embodiment of the present invention.
  • steps S961 to S967 are repeated for each pixel (loop L707).
  • the RGB value of the processing target image is acquired (step S961).
  • the gains FS R (p), FS B (p) and the reliability FT (p) of the corresponding pixel are acquired (step S962).
  • the luminance calculation unit 521 calculates the luminance value L (p) (step S963).
  • the luminance value L (p) is nonlinearly converted by the nonlinear converter 522, and a nonlinearly converted luminance value L (nl) (p) is output (step S964).
  • step S965 a process for calculating the block integral value is performed (step S965). Specifically, multiplication sections 511 and 512 multiply the gains FS R (p) and FS B (p) by the reliability FT (p). Also, the block integral value calculation units 531 and 532 update the gain block integral values for the R and B channels at the pixel position (step S966). Further, the block histogram calculation unit 533 updates the block integration value of the reliability itself corresponding to the block histogram at the pixel position (step S966). Then, the luminance value of the pixel is stored in a memory (not shown) (step S967).
  • steps S961 to S967 in the loop L707 When the processing of steps S961 to S967 in the loop L707 is completed, the processing for the next pixel position is repeated. When the processing for all the pixel positions is completed, the loop L707 is exited, and the block integral value and the block histogram for one frame are stored in the block integral value holding units 541 and 542 and the block histogram holding unit 543, respectively (step S968). .
  • the processing in steps S962 to S967 is inserted immediately after step S947 in FIG. 24, so that the loop L705 in FIG. 24 and the loop L707 in FIG. It can be configured as a process. Since the value of each pixel has already been read in step S941, step S961 can be omitted. In addition, regarding the reliability, by directly using the value selected in step S947, the storage of the reliability and the reading process in steps S948 and S962 can be omitted.
  • loop L708 the luminance value around the pixel is read from a memory (not shown). Further, the block integration value for the reliability around the pixel is read from the block histogram holding unit 543 (step S971). Then, the following processing is repeated for each channel (R and B channels) (loop L709).
  • the block integral value of the weighted gain for the channel is read from the block integral value holding unit 541 or 542 (step S972). Then, the phase compensation processing unit 551 or 552 calculates a luminance value corresponding to the pixel position of the channel on the mosaic image (step S973). In the weighted product-sum unit 561 or 562, the gain for the pixel channel is calculated by the weighted product-sum operation of the block integration value (step S974). Then, the gain application unit 571 or 572 applies the gain obtained by the weighted product sum to the channel (step S975).
  • step S976 here refers to step S919 in FIG. 12 and step S950 in FIG. 24, and the other processing can be omitted by storing the processing result in one of them.
  • steps S972 to S976 are completed in loop L709, the same processing is repeated for the next channel.
  • the process goes through the loop L709 and the same processing is repeated for the next pixel.
  • the loop L708 is exited, and the smoothing processing for one frame is completed.
  • FIG. 32 is a diagram illustrating an operation example of the block integration value calculation units 531 and 532 and the block histogram calculation unit 533 according to the third embodiment of the present invention.
  • steps S981 to S983 are performed for each pixel.
  • the luminance value and the weighted feature amount at the pixel position are acquired from the nonlinear conversion unit 522 and the multiplication units 511 and 512 (step S981).
  • the block selection unit 534 determines which of the n blocks includes the pixel position (step S982).
  • the weighted feature amount of the pixel is added (step S983).
  • FIG. 33 is a diagram illustrating an operation example of the weighted product-sum units 561 and 562 in the third embodiment of the present invention.
  • the luminance of the pixel position is acquired (step S991).
  • a weighted gain integral value at the pixel position is calculated for each division in the luminance direction by interpolation from the 4 ⁇ 4 block integral value information in the spatial direction with the same luminance (step S992).
  • an integrated value of the reliability of the pixel position corresponding to the surrounding 4 ⁇ 4 block histogram in the spatial direction with the same luminance is calculated for each division in the luminance direction by interpolation (step S993).
  • the product-sum unit 566 calculates a result of multiplying and summing the luminance weight value by the weighted gain integral value interpolated at the pixel position (step S994).
  • the product-sum unit 567 calculates a result of multiplying and summing the luminance weight value by the integrated value (block histogram) of the reliability itself interpolated at the pixel position (step S995).
  • the weighted gain integral value summed by the product-sum unit 566 is divided by the integral value of the reliability itself summed by the product-sum unit 567 (step S996).
  • the calculation result of the division unit 569 is output as a global gain value at the pixel position (step S997), and the weighted product-sum process for one pixel is completed.
  • the edge is obtained. It is possible to reduce the calculation amount of the conservative smoothing.
  • the weighted sum of products is performed in the order of performing the smoothing in the luminance direction after the spatial smoothing.
  • the order of the spatial smoothing may be performed after the smoothing in the luminance direction.
  • the calculation for each pixel can be reduced by holding the weighted gain, which has been smoothed in the luminance direction in advance, as a block integration value.
  • the gains of the R and B channels when the gain of the G channel is fixed to “1” are obtained.
  • the gain is also applied to the G channel when the luminance is fixed. There is a need. In that case, the method of the present embodiment also functions effectively for the G channel.
  • the illumination component conversion process may include, as another form, a process of comparing the input image after performing resolution conversion. Since the intermediate data in the illumination component conversion process is obtained by extracting the general illumination distribution and structure of the entire image, even if the intermediate data is calculated from an image reduced in advance, the information is not lost. The amount of calculation can be reduced. Further, the influence of the moving subject can be suppressed by comparing after the reduction. Furthermore, the introduction of a resolution conversion processing unit makes it possible to use a monitor image output to the LCD. As a result, when a monitor image is used as the reference mosaic image, an image with high color reproducibility can be generated without continuous shooting with flash emission and non-light emission, and it also contributes to memory saving. As a method of reducing the input image, a relatively simple method may be used, such as a simple average of pixels belonging to a region on the mosaic image of the processing target image corresponding to each pixel position of the reduced image.
  • the premise of the configuration of the imaging device and the image processing circuit 23 is the same as that of the third embodiment, and a description thereof will be omitted.
  • FIG. 34 is a diagram illustrating a configuration example of the illumination component conversion processing unit 120 according to the fourth 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, A channel gain application unit 260.
  • the channel gain calculation unit 250 is different in input / output from the channel gain calculation unit 250 of FIG. 15 and becomes a value after resolution conversion.
  • the illumination component conversion processing unit 120 further includes resolution conversion units 271 and 272.
  • the resolution converters 271 and 272 change the input image size.
  • a major purpose of resolution conversion is to suppress the influence of differences other than changes in the illumination environment due to a moving subject or the like by reducing the image.
  • Another object is to match the size of the input image between the reference image and the processing target image.
  • the monitor image output to the LCD generally has a smaller resolution than the image captured by the normal process. Therefore, the image sizes of the two images are different, and the above gain calculation cannot be used as it is. In order to solve this problem, it is effective to perform a comparison after performing resolution conversion to make the sizes of the reference image and the processing target image uniform.
  • the processing performed by the resolution conversion units 271 and 272 is to be enlarged or reduced is determined by the size relationship between the image size of the reference image and the processing target image.
  • the processing performed in the resolution conversion units 271 and 272 is an enlargement process
  • the enlargement process by the edge preserving smoothing filter process is effective.
  • the smoothing process proceeds even when the illumination environment is greatly different at the boundary of the object, so that color blur occurs at the boundary.
  • the processing performed by the resolution converters 271 and 272 is a reduction process, it is relatively simple, such as simple average, median, and thinning processing of pixels belonging to the block area on the original image corresponding to each pixel position of the reduced image. It is possible to use this method.
  • the resolution conversion processing in the resolution conversion units 271 and 272 can be performed simultaneously with the demosaic processing performed in the demosaic processing units 221 and 222, thereby reducing the amount of calculation. Further, the order of the resolution conversion processing in the resolution conversion units 271 and 272 and the demosaic processing performed in the demosaic processing units 221 and 222 may be switched, and in this case, the amount of calculation can be reduced.
  • FIG. 35 is a diagram illustrating a configuration example of the channel gain application unit 260 according to the fourth embodiment of the present invention.
  • the channel gain application unit 260 has the same configuration as that in the second embodiment described in FIG. However, the reduced image is used for the reliability generation, and the reduced reference images BR c (q), BG c (q), BB c (q), and the reduced processing target image BR s (q ), BG s (q), and BB s (q).
  • the smoothing processing unit 480 in addition to the processing target images R s (p), G s (p), and B s (p), the reduced processing target images BR s (q) and BG s (q) , BB s (q), reliability BFT (q) based on the reduced image, gain BFS R (q), BFS B (q) of the reduced image.
  • p and q represent each pixel.
  • FIG. 36 is a diagram illustrating a configuration example of the smoothing processing unit 480 in the fourth embodiment of the present invention.
  • the smoothing processing unit 480 has the same configuration as that of the third embodiment described with reference to FIG.
  • the image used for calculating the block integration value is a reduced image. That is, input to the multipliers 511 and 512 are the reduced image gains BFS R (q) and BFS B (q) and the reliability BFT (q) based on the reduced image. Also, the reduced processing target images BR s (q), BG s (q), and BB s (q) are input to the luminance calculation unit 523.
  • the size of the processing target image to be weighted product-sum remains the same. That is, the processing target images R s (p), G s (p), and B s (p) are input to the luminance calculation unit 521. Also, the processing target images R s (p) and B s (p) are input to the gain application units 571 and 572, respectively.
  • FIG. 37 is a diagram illustrating an operation example of the illumination component conversion processing unit 120 according to the fourth embodiment of the present invention.
  • This operation example is basically the same as that in the first embodiment described with reference to FIG.
  • the resolution conversion units 271 and 272 perform reduction processing of the reference image and the processing target image (steps S821 and S822).
  • the channel gain application unit 260 expands the gain according to the processing target image and applies it to each channel (step S818).
  • the reliability is set based on whether or not the pixel is blacked out, overexposed, or a moving subject, and the original pixel position of each channel is taken into account by an edge-preserving smoothing filter. A spatially smoothed gain is applied.
  • FIG. 38 is a diagram illustrating an operation example of the channel gain application unit 260 according to the fourth embodiment of the present invention.
  • This operation example is basically the same as that in the second embodiment described with reference to FIG. However, the difference is that the reliability is calculated based on the reduced image. For this reason, the processing of loop L714 corresponding to loop L705 is processing for each reduced pixel. Further, as the loop L702 and the loop L705 can be made a common loop, the processing corresponding to the loop L702 performed by the channel gain calculation unit 250 for the reduced image and the processing of the loop 714 are combined into a large loop processing. Can do.
  • the image used for calculating the block integration value is also a reduced image (step S841).
  • step S850 here is step S819 in FIG. 37, and the other processing can be omitted by storing the processing result in any one of them.
  • FIGS. 39 and 40 are diagrams illustrating an operation example of the smoothing processing unit 480 according to the fourth embodiment of the present invention.
  • This operation example is basically the same as that in the third embodiment described with reference to FIGS.
  • the image used for calculating the block integration value is a reduced image. That is, input to the multipliers 511 and 512 are the reduced image gains BFS R (q) and BFS B (q) and the reliability BFT (q) based on the reduced image. Also, the reduced processing target images BR s (q), BG s (q), and BB s (q) are input to the luminance calculation unit 523. Further, the size of the processing target image to be weighted product-sum remains the same.
  • the luminance calculation unit 521 calculates the luminance from the processing target images R s (p), G s (p), and B s (p) (step S872), and the nonlinear conversion unit 522 performs nonlinear conversion (step). S873).
  • a phase compensation process is performed on the non-linearly converted luminance (step S875).
  • the weighted product-sum units 561 and 562 calculate the gain for the pixel channel by the weighted product-sum operation of the block integration value (step S876), the block integration value and the distance between the pixel are determined as a mosaic of the processing target image before the reduction. It is important to consider the image resolution. Further, the processing in step S878 here refers to step S819 in FIG.
  • step S862 to S866 is inserted immediately after step S847 in FIG. 38, so that the loop L714 in FIG. 38 and the loop L715 in FIG. It can be configured as a process. Since the value of each pixel has already been read in step S841, step S861 can be omitted.
  • the storage and reading processing of reliability in steps S848 and S862 can be omitted by directly using the value selected in step S847.
  • the fourth embodiment of the present invention it is possible to reduce the overall calculation amount by using the reduced image and to suppress the influence of the moving subject.
  • illumination component conversion processing As another aspect of the illumination component conversion processing, another aspect as described below can be taken.
  • a single image captured by a digital camera has been used as a reference image and a processing target image.
  • Described below is an embodiment that includes a frame memory and generates a composite input image from a plurality of images, thereby supporting a scene other than flash light emission or non-light emission.
  • the premise of the configuration of the imaging device and the image processing circuit 23 is the same as that of the fourth embodiment, and a description thereof will be omitted.
  • FIG. 41 is a diagram illustrating a configuration example of the illumination component conversion processing unit 120 according to the fifth 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, A channel gain application unit 260.
  • the illumination component conversion processing unit 120 further includes a frame addition unit 280.
  • the frame adder 280 generates a composite input image from a plurality of images.
  • FIG. 42 is a diagram illustrating a configuration example of the frame addition unit 280 according to 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.
  • the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 hold images captured in the past and their addition results.
  • the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 hold images integrated in the time direction. Further, the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 have a high dynamic range (HDR) image with an accuracy of 16 bits for each channel in order to hold an accurate color balance in a wider intensity range. It is desirable to hold.
  • HDR high dynamic range
  • the addition unit 281 adds the image from the new reference mosaic image holding unit 213 and the image held in the reference mosaic image holding unit 283.
  • the adding unit 282 adds the image from the new processing target mosaic image holding unit 214 and the image held in the processing target mosaic image holding unit 284.
  • the control parameter determination unit 285 determines whether or not to perform a new imaging based on the image in the frame memory and the newly captured image, and the control parameter at the time of imaging. As this control parameter, it is desirable to employ a sufficiently high shutter speed so as not to cause camera shake or subject blur. In addition, the control parameter determination unit 285 can acquire an appropriate RGB color balance without saturation or blackout for all pixel positions from the exposure setting parameter when capturing the processing target image and the value of the processing target image. In this way, control is performed to perform continuous shooting while changing the exposure.
  • the control parameter determination unit 285 detects flicker from images held in the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284, and performs control to repeat imaging until the influence is eliminated.
  • control parameter determination unit 285 may detect blackout or saturation from the images held in the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284.
  • a wide dynamic range image can be generated by repeating the imaging while changing the exposure until the influence disappears.
  • addition units 281 and 282 perform addition after performing accurate alignment by block matching or the like, but it is also possible to combine with the resolution conversion processing of the fourth embodiment. As a result, it is possible to achieve a sufficient result even with a simple weighted average without performing alignment between the image held in the reference mosaic image holding unit 283 and the new image.
  • FIGS. 43 and 44 are diagrams showing an operation example 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, except that the frame addition is performed on the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 in the first half. Is different.
  • the reference mosaic image holding unit 283 and the processing target mosaic image holding unit 284 are hereinafter referred to as a frame memory.
  • control parameter determination unit 285 determines a control parameter related to imaging, and an initial image is captured according to the control parameter (step S881).
  • the image captured at this time may be a reference image and a processing target image, or one of them.
  • steps S882 to S885 are repeated for each pixel (loop L718).
  • the pixel value of the newly captured image is acquired (step S882).
  • the existing corresponding pixel value is acquired from the frame memory (step S883).
  • the new pixel value and the image in the frame memory are weighted and added (step S884).
  • the addition result is written back to the frame memory as a new frame memory image (step S885).
  • step S882 to S885 When the processing of steps S882 to S885 is completed, the processing for the next pixel is repeated. When the processes for all the pixels are completed, the process goes through the loop L718 to proceed to the next step. At that time, the control parameter determination unit 285 determines whether or not to perform a new image capture based on the image in the frame memory and the new captured image, and the control parameter at the time of image capture (step S886). When the control parameter determination unit 285 determines that additional imaging is necessary, the process returns to step S881 to perform new imaging. If the image in the frame memory is valid, the process proceeds to the next step. The subsequent processing is the same as that of the first embodiment described with reference to FIG.
  • the fifth embodiment of the present invention it is possible to deal with scenes other than flash light emission or non-light emission by providing a frame memory and generating a composite input image from a plurality of images.
  • a frame memory For example, in an image captured with a CMOS sensor using a CMOS sensor under fluorescent or mercury lamp illumination, areas with different illumination conditions may appear due to flicker, but such images are also supported. can do.
  • FIG. 45 is a diagram illustrating an example of processing functions of the image processing circuit 23 according to the sixth embodiment of the present invention.
  • This image processing circuit 23 is different from the first embodiment described with reference to FIG. 2 in that white balance processing is performed in the preceding stage of the illumination component conversion processing unit 120. That is, the white balance values estimated by the white balance processing units 131 and 132 are calculated and stored in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182, respectively. The stored white balance value is supplied to the illumination component conversion processing unit 120.
  • the processing in the color conversion gain calculation units 311 and 312 is expressed by the following equation.
  • the gain of the illumination component conversion processing unit 120 and the gains of the white balance processing units 131 and 132 can be handled simultaneously.
  • a value multiplied by WB c is set for the B holding unit 334.
  • the compensation value may be set as WB c .
  • the values stored in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182 are used to calculate the upper limit value, the lower limit value, and the compensation value.
  • the processing by the white balance calculation unit 230 is not necessary.
  • Other processes in the demosaic processing units 221 and 222 and the channel gain application unit 260 are the same as those in the first embodiment.
  • FIG. 46 is a diagram illustrating an example of processing functions of the image processing circuit 23 according to the seventh embodiment of the present invention.
  • the image processing circuit 23 not only gain calculation but also a mosaic image that has actually been subjected to white balance processing is input to the illumination component conversion processing unit.
  • the white balance processing units 131 and 132 calculate the white balance and store them in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182, respectively. This is an input to the unit 120.
  • the input subjected to the white balance processing in the seventh embodiment with respect to the input I in the first embodiment of the present invention is represented by the following equation.
  • the ratio and gain calculated in the color conversion gain calculation units 311 and 312 in the channel gain calculation unit 250 are expressed as follows, respectively.
  • the ratio Ko is multiplied by WB s / WB c and the gain S is multiplied by WB c / WB s .
  • the gain upper limit value R holding unit 323 or the gain upper limit value B holding unit 324, the gain lower limit value R holding unit 333, or the gain lower limit value B holding unit 334 is also WB c compared to the first embodiment.
  • a value multiplied by / WB s is set. As a result, it is effective to set the upper limit value and the lower limit value as follows.
  • the saturation compensation value may be set as WB c / WB s .
  • the values stored in the reference image white balance holding unit 181 and the processing target image white balance holding unit 182 are used to calculate the upper limit value, the lower limit value, and the compensation value.
  • the following method can be considered as another form which calculates
  • the expression of the ratio K of the two images subjected to the exposure compensation process in the image subjected to the white balance process can be written as the following Expression 41 by performing the exposure compensation process on Expression 37.
  • the ratio K (p) is 1 in the background area where the flash light does not reach, the white balance ratio can be obtained as the value of each channel of Formula 41 in such an area. Therefore, a threshold value is provided for KG, and WBc / WBs can be obtained as the average or the reciprocal of the median value of each channel value of K in the region where KG is close to 1.
  • processing by the white balance calculation unit 230 becomes unnecessary.
  • Processing in the demosaic processing units 221 and 222 is the same as that in the first embodiment. Further, the process in the channel gain application unit 260 is a process considering that the ratio Ko is multiplied by WB s / WB c compared to the first embodiment.
  • the major difference between the eighth embodiment and other embodiments is that data for three channels is already prepared for each pixel.
  • the operation of the white balance calculation unit 230 is also different.
  • the white balance calculation unit 230 holds the white balance value obtained in advance by the white balance processing unit 130 and stores it in the reference image white balance holding unit as a WBc value for the reference image.
  • WBs values obtained in advance by the white balance processing unit 130 are held and used.
  • a white balance value obtained by prior measurement for the flash light emitting unit 61 of FIG. 1 may be used.
  • the ratio of the white balance between the reference image and the processing target image may be obtained as the ratio of the two images after exposure compensation, as in Expression 41 of the seventh embodiment.
  • 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 signal intensity ratio K cannot be obtained correctly.
  • the input of the illumination component conversion process is performed after the inverse gamma correction process or the process is changed based on the gamma correction process.
  • FIG. 47 is a block diagram illustrating the configuration of the image processing circuit 23 that receives an image after the inverse gamma correction processing as an input.
  • FIG. 47 is a diagram showing an example of processing functions of the image processing circuit 23 in the 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. And an image white balance holding unit 184.
  • the input image of the image processing circuit 23 is an image that has already been decoded from the JPEG format and has three RGB channels for each pixel.
  • the reverse gamma correction processing is preferably reverse conversion of gamma correction processing when a JPEG format image is created.
  • simple reverse gamma correction processing may be used.
  • a simple process of the gamma correction process is as follows. Therefore, it can be understood that the correction processing represented by the following equation which is the inverse transformation equation of the above equation may be performed.
  • I white_level is an upper limit value of the input signal I for normalizing the input signal to a value of 0.0 to 1.0.
  • the processing for the image after inverse gamma correction conforms to the first embodiment of the present invention.
  • the calculation formulas for the gain upper limit value, gain lower limit value, saturation compensation value, and blackout compensation value in the gain calculation unit are the same as those in Expressions 39 and 40 in the seventh embodiment.
  • the processing in the channel gain application unit 260 is processing in consideration of the fact that the ratio Ko is multiplied by WBs / WBc with respect to the first embodiment, as in the seventh embodiment.
  • the color balance adjustment processing for each channel is performed on an image called RAW data having linear characteristics with respect to the spectral characteristics of the sensor and the color filters arranged on the surface, the color balance of the illumination components, and the intensity. desirable.
  • RAW data having linear characteristics with respect to the spectral characteristics of the sensor and the color filters arranged on the surface, the color balance of the illumination components, and the intensity. desirable.
  • the output to be obtained here is an image that has been subjected to the color conversion process and then undergoes the conversion f, and is expressed as follows: Can do. f (FS (p) ⁇ I s (p))
  • gain S (p) gain FS (p)
  • the gamma correction processing can be approximated to conversion by an exponential function shown in Formula 41 representing a simple gamma correction processing.
  • this conversion satisfies an expression representing an assumption regarding the conversion f. Therefore, the illumination component conversion processing shown in the embodiment of the present invention can be applied to the image after the gamma processing without being approximately inversely converted.
  • the gain upper limit value, the gain lower limit value, the saturation compensation value, and the blackout compensation value used in the channel gain calculation unit 250 are obtained by Equations 39 and 40 in the seventh embodiment of the inverse gamma correction process. It is effective to use a value obtained by multiplying each obtained power by ⁇ . Therefore, the blackout compensation value may be set to 1, the saturation compensation value may be set to (WB c / WB s ) ⁇ , and the gain upper limit value and gain lower limit value may be set according to the following equations.
  • the ratio gamKo between images in a gamma-corrected state is expressed by the following equation. Therefore, the ratio K after exposure correction due to the difference in the imaging environment is expressed by the following equation using gamKo.
  • Equation 41 By solving the mathematical expression (Equation 41) of the gamma correction process relating to gamI with respect to I and substituting it into each determination expression, it is possible to determine blackout, saturation, and moving subject when an image after gamma correction is input. Can be done.
  • the RGB value has already been applied with “non-linear transformation convex upward”, and therefore, the non-linear transformation is also applied to the luminance L expressed by the linear sum. Will be. Therefore, in the illumination component conversion processing using the image after gamma correction as an input image, the processing in the nonlinear conversion unit 522 (FIG. 26) can be omitted.
  • the output of the illumination component conversion processing unit 120 becomes a signal corresponding to the output result of the gamma correction processing unit 160 in FIG.
  • an image with high color reproducibility can be generated even when an image subjected to gamma correction processing is used as a reference image and a processing target image. .
  • the luminance is calculated from the RGB values according to the fixed coefficient and then the nonlinear conversion is performed.
  • the RGB values are calculated by performing a multiple regression analysis after nonlinear conversion.
  • FIG. 48 is a diagram illustrating an example of processing functions of the smoothing processing unit 480 according to the ninth embodiment of the present invention.
  • the processing function example of the smoothing processing unit 480 is obtained by replacing the luminance calculation unit 521 and the nonlinear conversion unit 522 in the third embodiment shown in FIG. It has.
  • the non-linear conversion unit 611 performs non-linear conversion on the intensity ratio K G (p) of the G channel and outputs a non-linear intensity ratio K G (nl) (p).
  • the non-linear conversion units 621 to 623 perform non-linear conversion on each of the RGB values R s (p), G s (p), and B s (p) of the processing target image I s (p) to obtain non-linear RGB values R s ( nl) (p), G s (nl) (p) and B s (nl) (p) are output.
  • these nonlinear conversion units 611 and 621 to 623 may apply “upwardly convex monotonic increasing characteristics” such as a power characteristic or logarithmic conversion using a ⁇ curve or an exponent smaller than 1, for example.
  • upwardly convex monotonic increasing characteristics such as a power characteristic or logarithmic conversion using a ⁇ curve or an exponent smaller than 1, for example.
  • the non-linear conversion is performed in order to improve the accuracy with respect to the linear model by changing the distribution of pixel values.
  • this non-linear transformation has an advantage that the correlation between the intensity ratio K G (p) and the gain becomes high, and the relationship between the two becomes easy to understand.
  • the intensity ratio K G (p) is used as the input of the nonlinear conversion unit 611.
  • K R (p), K B (p), 1 / K R (p ), 1 / K G (p), 1 / K B (p) may be used.
  • the color conversion gain itself that is, FS R (p) or FS B (p) may be used.
  • the luminance calculation unit 630 calculates the non-linearly converted luminance value L (nl) (p) from the outputs of the non-linear conversion units 611 and 621 to 623.
  • the luminance calculation unit 521 in the third embodiment calculates a linear sum of RGB values from fixed coefficients, but the luminance calculation unit 630 calculates a luminance value from the coefficient obtained according to the image.
  • the luminance calculation unit 630 performs multiple regression analysis on the outputs of the non-linear conversion units 611 and 621 to 623, and calculates a luminance value using the obtained multiple regression analysis parameters as coefficients.
  • the luminance calculation unit 630 includes a multiple regression analysis unit 631, a multiple regression analysis parameter storage unit 632, and a multiple regression prediction value calculation unit 633.
  • 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 multiple regression analysis parameter CC R that minimizes the value of the following formula, CC G, CC B, obtains the CC Offset.
  • CC R, CC G, CC B is partial regression coefficient
  • CC Offset is the intercept.
  • R s (nl) (p), G s (nl) (p), and B s (nl) (p) are explanatory variables
  • K G (nl) (p) is a target variable.
  • a regression analysis is performed. In this example, it is assumed that one set of multiple regression analysis parameters is obtained for the entire screen, but multiple regression analysis parameters may be obtained for each small region that is a part of the screen.
  • multiple regression analysis was performed using all RGB channels here, multiple regression analysis may be performed using only a specific channel, or multiple regression analysis may be performed with CC Offset fixed to 0. Good.
  • Multiple regression analysis parameter holding unit 632 is a memory that stores multiple regression analysis unit 631 multiple regression analysis parameter CC R obtained by, CC G, CC B, the CC Offset.
  • 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.
  • the multiple regression prediction value calculation unit 633 calculates the nonlinearly converted luminance value L (nl) (p) as the multiple regression prediction value according to the multiple regression analysis parameter held in the multiple regression analysis parameter holding unit 632. .
  • the multiple regression prediction value calculation unit 633 calculates a luminance value L (nl) (p) that is nonlinearly converted by the following equation.
  • L (nl) (p) CC R ⁇ R s (nl) (p) + CC G ⁇ G s (nl) (p) + CC B ⁇ B s (nl) (p) + CC Offset
  • the luminance value L (nl) (p) obtained by nonlinear conversion is obtained from only the pixel value of the processing target image and thus has a characteristic that it is not easily influenced by the moving subject. Further, since the luminance value L (nl) (p) subjected to nonlinear conversion has the same properties as those in the third embodiment, description on other configurations is omitted.
  • FIG. 49 is a diagram illustrating another processing function example of the smoothing processing unit 480 according to the ninth embodiment of the present invention.
  • Other processing function examples of the smoothing processing unit 480 are replaced with the nonlinear conversion units 612, 621 to 623, 641 to 64, instead of the luminance calculation unit 523 and the nonlinear conversion unit 524 in the fourth embodiment shown in FIG. 643 and a luminance calculation unit 630.
  • the fourth embodiment includes a process for comparing the input image after performing resolution conversion in the third embodiment, and also in the example of FIG. 48 and the example of FIG. 49. It has a similar relationship.
  • the non-linear conversion unit 612 performs non-linear conversion on the intensity ratio BK G (p) of the G channel of the reduced image and outputs a non-linear intensity ratio BK G (nl) (p).
  • the non-linear conversion units 621 to 623 perform non-linear conversion on the RGB values R s (p), G s (p), and B s (p) of the processing target image I s (p), thereby performing non-linear conversion.
  • the RGB values R s (nl) (p), G s (nl) (p), and B s (nl) (p) are output.
  • the nonlinear conversion units 641 to 643 nonlinearly convert each of the RGB values BR s (p), BG s (p), and BB s (p) of the reduced image to generate nonlinear RGB values BR s (nl) (p), BG s (nl) (p) and BB s (nl) (p) are output.
  • These nonlinear converters 612, 621 to 623, 641 to 643, like the nonlinear converter 522, have “upwardly convex monotone increasing characteristics” such as a power characteristic or logarithmic transformation with a ⁇ curve, an exponent smaller than 1, for example. It is useful to apply.
  • the luminance calculation unit 630 calculates the non-linearly converted luminance value L (nl) (p) from the outputs of the non-linear conversion units 611, 621 to 623, and 641 to 643.
  • the luminance calculation unit 630 calculates a luminance value from the coefficient obtained according to the reduced image.
  • the luminance calculation unit 630 includes a multiple regression analysis unit 634, a multiple regression analysis parameter storage unit 635, and multiple regression prediction value calculation units 633 and 636.
  • the multiple regression analysis unit 634 performs multiple regression analysis on the outputs of the nonlinear conversion units 612 and 641 to 643. Except for the point that the analysis object is based on the reduced image, it is the same as the multiple regression analysis unit 631 described in the example of FIG.
  • Multiple regression analysis parameter holding unit 635 is a memory that stores multiple regression analysis unit 634 multiple regression analysis parameter CC R obtained by, CC G, CC B, the CC Offset.
  • the multiple regression analysis parameters held in the multiple regression analysis parameter holding unit 635 are supplied to multiple regression prediction value calculation units 633 and 636.
  • the multiple regression prediction value calculation unit 633 calculates the non-linearly transformed luminance value L (nl) (p) as the multiple regression prediction value according to the multiple regression analysis parameter stored in the multiple regression analysis parameter storage unit 635.
  • the multiple regression prediction value calculation unit 636 uses the non-linearly transformed luminance value BL (nl) (p) of the reduced image as the multiple regression prediction value according to the multiple regression analysis parameter stored in the multiple regression analysis parameter storage unit 635. It is to calculate. In the multiple regression prediction value calculation units 633 and 636, the same multiple regression analysis parameters are used.
  • [Operation example] 50 and 51 are diagrams illustrating an operation example corresponding to the processing function example of FIG. 48 of the smoothing processing unit 480 according to the ninth embodiment of the present invention.
  • the same processes as those in FIG. 30 are denoted by the same reference numerals.
  • steps S751 to S753 are repeated for each pixel (loop L719).
  • the RGB value of the processing target image and the intensity ratio of the G channel are acquired (step S751).
  • These RGB values and intensity ratios are nonlinearly converted by the nonlinear converters 611 and 621 to 623 (step S752).
  • the RGB value and the intensity ratio subjected to nonlinear conversion are stored in a memory (not shown) (step S753).
  • the multiple regression analysis unit 631 uses R s (nl) (p), G s (nl) (p), and B s (nl) (p) as explanatory variables. , multiple regression analysis for the purpose variable is performed K G (nl) (p) (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).
  • steps S756 to S967 are repeated for each pixel (loop L720).
  • this loop L720 the RGB value after the nonlinear conversion processing of the processing target image is acquired (step S756).
  • the gains FS R (p), FS B (p) and the reliability FT (p) of the corresponding pixel are acquired (step S962).
  • the multiple regression analysis parameter held in the multiple regression analysis parameter holding unit 632 is acquired (step S757).
  • the multiple regression prediction value calculation unit 633 calculates a multiple regression prediction value as the non-linearly converted luminance value L (nl) (p) (step S758). Since the subsequent processing is the same as that described in FIG. 31, the description thereof is omitted here.
  • FIGS. 52 to 54 are diagrams illustrating an operation example corresponding to the processing function example of FIG. 49 of the smoothing processing unit 480 according to the ninth embodiment of the present invention.
  • This operation example is basically the same as the operation example corresponding to the processing function example of FIG. 48 described with reference to FIGS.
  • the image used for calculating the block integration value is a reduced image. That is, input to the multipliers 511 and 512 are the reduced image gains BFS R (q) and BFS B (q) and the reliability BFT (q) based on the reduced image.
  • non-linear transformation units 612 and 641 to 643 are inputted with the reduced image intensity ratio BK G (p), the reduced processing target images BR s (q), BG s (q), and BB s (q ). Further, the size of the processing target image to be weighted product-sum remains the same.
  • steps S761 to S763 are repeated for each pixel of the reduced image (loop L721). Since the processing contents of steps S761 to S763 are the same as the processing of steps S751 to S753 described above, description thereof is omitted here. Further, the subsequent processing contents of steps S764 and S765 are the same as those of the above-described steps S754 and S755, and thus description thereof will be omitted.
  • steps S766 to S866 are repeated for each pixel of the reduced image (loop L722).
  • the same processes as those in FIG. 39 are denoted by the same reference numerals. Since the processing contents of steps S766 to S866 in this loop L722 are the same as the processing of steps S756 to S966 described above, description thereof is omitted here.
  • the image to be weighted product-sum is not a reduced image but a processing target image. Therefore, in the loop L723, each process is repeated for each pixel of the processing target image.
  • the RGB value of the image to be processed and the block integral value of the weight itself are acquired (step S871), and the multiple regression analysis parameter held in the multiple regression analysis parameter holding unit 632 is acquired (step S771). ).
  • the RGB values are nonlinearly converted in the nonlinear converters 621 to 623 (step S772).
  • the multiple regression prediction value calculation unit 633 calculates the multiple regression prediction value as the luminance value L (nl) (p) subjected to nonlinear conversion (step S773).
  • the subsequent processing is the same as that described with reference to FIG. 40, and thus description thereof is omitted here.
  • FIG. 55 is a diagram illustrating a processing function example of the smoothing processing unit 480 according to the tenth embodiment of the present invention.
  • gains FS R (p) and FS B (p) are further input to the weighted product-sum units 561 and 562 in the third embodiment shown in FIG. is doing.
  • HSW B (r) are compared to calculate the weight for the weighted product sum.
  • FIG. 56 is a diagram illustrating a configuration example 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 division unit 651, a comparison unit 652, and multiplication units 653 and 654 in front of the interpolation units 563 and 564 in the third embodiment shown in FIG. It has the composition provided.
  • the division unit 651 uses the block histogram IFT (r) held in the block histogram holding unit 543 to coordinate the block integral values ISW R (r) and ISW B (r) held in the block integration value holding units 541 and 542 as coordinates r. Divide every time. Thereby, the average white balance at the coordinate r is calculated.
  • the block integration value and the block histogram are discretized with respect to the spatial position and luminance.
  • the coordinate r represents a three-dimensional coordinate (i, j, ⁇ ) of the spatial position i, j and the luminance ⁇ .
  • HSW R (r) and HSW B (r) calculated by the division unit 651 are obtained by the following equations.
  • HSW R (r) ISW R (r) / IFT (r)
  • HSW B (r) ISW B (r) / IFT (r)
  • the division unit 651 is an example of a first division unit described in the claims.
  • the comparison unit 652 calculates the gains FS R (p) and FS B (p) at the position p of the processing target image and the average gains HSW R (r) and HSW B (r) of the coordinates r of the block corresponding to the position p.
  • the weight ⁇ of the weighted product-sum is calculated.
  • the weight ⁇ indicates a value in the range of 1 to 0 according to the value of ⁇ Max (r) as shown in FIG.
  • ⁇ Max (r) means the larger one of absR and absB as in the following equation.
  • ABS is a function indicating an absolute value.
  • SWUNIT R and SWUNIT B are defined by the following equations.
  • SWUNIT R ABS (gain upper limit value R -gain lower limit value R )
  • SWUNIT B ABS (gain upper limit value B - gain lower limit value B)
  • the gain upper limit value and the gain lower limit value are the same as those shown in Equations 5 and 6.
  • 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 absolute value range of the difference is from 0 to “upper limit value ⁇ lower limit value”. Further, by this normalization, the difference between R and B can be compared and the larger one can be set to ⁇ Max (r).
  • ⁇ Max (r) is set to the larger one of absR and absB, and the weight ⁇ is obtained as a weight common to the R channel and the B channel.
  • the weights ⁇ R and ⁇ B may be obtained.
  • the weighted gain SW R (r) or SW B (r) of the block area is also calculated for each R channel and B channel.
  • the relationship between the weight ⁇ and ⁇ Max (r) is assumed as shown in FIG. 57, but the present invention is not limited to this, and the weight ⁇ is monotonous with respect to an increase in ⁇ Max (r). Any material having a decreasing characteristic may be used.
  • the multiplication unit 653 multiplies the block integration values ISW R (r) and ISW B (r) held in the block integration value holding units 541 and 542 by the weight ⁇ calculated by the comparison unit 652 for each coordinate r. It is.
  • the multiplication unit 654 multiplies the block histogram IFT (r) held in the block histogram holding unit 543 by the weight ⁇ calculated by the comparison unit 652 for each coordinate r.
  • 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.
  • the multiplier 653 is an example of a first multiplier described in the claims.
  • the multiplication unit 654 is an example of a second multiplication unit described in the claims.
  • the configuration subsequent to the interpolation units 563 and 564 is the same as that in FIG. 28, but the values obtained as follows are different by multiplying the weight ⁇ as described above.
  • the interpolation unit 563 interpolates the input from the multiplication unit 653 based on the value ⁇ (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.
  • the interpolation unit 564 interpolates the input from the multiplication unit 654 based on the value ⁇ (r, p) of the space weight function table held in the space weight function table holding unit 565. As a result, the following values are output. ⁇ (i, j, p) ⁇ ⁇ ( ⁇ Max (i, j, ⁇ )) ⁇ IFT (i, j, ⁇ )
  • IFT IFT
  • the product-sum unit 566 calculates a result obtained by multiplying the output of the interpolation unit 563 by the luminance weight value.
  • the luminance weight value is calculated using a table value ⁇ ( ⁇ , L (nl) (p)) stored in the luminance weight function table holding unit 568.
  • the product-sum unit 566 outputs the following values.
  • the product-sum unit 567 calculates a result obtained by multiplying the output of the interpolation unit 564 by the luminance weight value.
  • the luminance weight value is calculated using a table value ⁇ ( ⁇ , L (nl) (p)) stored in the luminance weight function table holding unit 568.
  • the product-sum unit 567 outputs the following values. ⁇ ( ⁇ ( ⁇ , L (nl) (p)) ⁇ ⁇ (i, j, p) ⁇ ⁇ ( ⁇ Max (i, j, ⁇ )) ⁇ IFT (i, j, ⁇ ))
  • the summation is performed for the spatial positions i and j and the luminance ⁇ .
  • the division unit 569 divides the output of the product-sum unit 566 by the output of the product-sum unit 567. That is, the division unit 569 outputs the following values.
  • the equation corresponding to Equation 25 is as follows.
  • the weight is calculated based on the spatial distance and the luminance difference in the third embodiment, whereas in the tenth embodiment, Further, the weight is calculated by adding the gain difference obtained for each pixel position. That is, in the tenth embodiment, the weight is calculated based on the spatial distance, the luminance difference, and the gain difference obtained for each pixel position, and the weighted average of surrounding pixels is calculated. To do. Thereby, a more appropriate smoothing process can be realized.
  • FIG. 58 is a diagram illustrating another processing function example of the smoothing processing unit 480 according to the tenth embodiment of the present invention.
  • Another processing function example of the smoothing processing unit 480 further includes resolution conversion units 661 and 662 in the fourth embodiment shown in FIG.
  • the fourth embodiment includes a process of comparing the input image after performing resolution conversion in the third embodiment, and also in the example of FIG. 55 and the example of FIG. It has a similar relationship.
  • the resolution conversion unit 661 enlarges the resolution of the gain BFS B (q) of the reduced image and converts it to a gain ITPBFS B (p) having the same resolution as the processing target image.
  • the resolution conversion unit 662 enlarges the resolution of the reduced image gain BFS R (q), and converts it to a gain ITPBFS R (p) having the same resolution as the processing target image.
  • the resolution conversion in these can be realized by simple linear interpolation, for example.
  • the gains ITPBFS R (p) and ITPBFS B (p) based on these reduced images are gains having higher frequency components than the block integration value and the block histogram, although the accuracy is deteriorated.
  • the gains ITPBFS R (p) and ITPBFS B (p) based on these reduced images are supplied to weighted product-sum units 561 and 562, respectively.
  • FIG. 59 is a diagram illustrating a configuration example of the weighted product-sum units 561 and 562 corresponding to the processing function example of FIG. 58 of the smoothing processing unit 480 in the tenth embodiment of the present invention.
  • Each of the weighted product-sum units 561 and 562 has a configuration including a division unit 671, a comparison unit 672, and multiplication units 673 and 674 in the preceding stage of the interpolation units 563 and 564, as in FIG.
  • the configuration example of the smoothing processing unit 480 is basically the same as the configuration example shown in FIG. The difference is that instead of the gains FS R (p) and FS B (p) input to the comparison unit 652 in FIG. 56, in this example, the gains ITPBFS R (p) and ITPBFS B (p ) Is input to the comparison unit 672. Since the other points are the same as in the example of FIG. 56, the description is omitted here.
  • FIG. 60 is a diagram illustrating an operation example corresponding to the processing function example of FIG. 55 of the smoothing processing unit 480 according to the tenth embodiment of the present invention.
  • the first half of the processing is the same as that in FIG. 30 in the third embodiment, and is omitted here.
  • steps S971 to S976 are repeated for each pixel (loop L724).
  • the processing itself of steps S971 to S976 is the same as that described with reference to FIG. The difference is that the repetition for each channel in FIG. 31 is omitted. This is because in the tenth embodiment, the values of the R channel and the B channel are handled simultaneously when calculating the weight. Since the other points are the same as those described with reference to FIG. 31, the description thereof is omitted here.
  • 61 and 62 are diagrams showing an operation example of the weighted product-sum units 561 and 562 in the tenth embodiment of the present invention.
  • the same processes as those in FIG. 33 are denoted by the same reference numerals.
  • the weighted gain integral value of the 4 ⁇ 4 block around the pixel is acquired from the block integral value holding units 541 and 542 (step S781). Further, the integrated value (block histogram) of the weight (reliability) of the 4 ⁇ 4 block around the pixel is acquired from the block histogram holding unit 543 (step S782). Then, the division unit 651 performs division processing on the weighted gain integral value by the integral value of the weight (reliability) itself, and calculates the average gain for each 4 ⁇ 4 block around the pixel (step S783).
  • gains FS R (p) and FS B (p) of the pixel are acquired (step S784).
  • the comparison unit 652 compares the gain of the pixel with the average gain for each 4 ⁇ 4 block around the pixel, and calculates a weight based on the gain distance for each block (step S785).
  • the multiplication units 653 and 654 multiply the weight based on the gain distance by the weighted gain integral value of the corresponding block and the integral value of the weight (reliability) itself (step S786).
  • step S991 the luminance value of the pixel is acquired (step S991), and the interpolation unit 563 performs interpolation of surrounding 4 ⁇ 4 blocks obtained by multiplying the weighted gain integral value at the pixel position by the weight according to the gain distance. (Step S787). Further, the interpolation unit 564 performs interpolation of surrounding 4 ⁇ 4 blocks obtained by multiplying the integral value of the weight (reliability) of the pixel position by a weight according to the gain distance (step S788). Since the process after step S994 is the same as that of FIG. 33, description here is abbreviate
  • step S784 instead of the gains FS R (p) and FS B (p) of the pixel, gains ITPBFS R (p) and ITPBFS B (p) based on the reduced image are acquired and used for comparison. .
  • FIG. 63 is a diagram illustrating an operation example of the smoothing processing unit 480 in the tenth embodiment of the present invention.
  • the first half of the processing is the same as that in FIG. 39 in the fourth embodiment, and is omitted here.
  • the same processes as those in FIG. 40 are denoted by the same reference numerals.
  • step S871 to S878 are repeated in the loop L725.
  • the contents of each process are the same as in FIG. 40, except that the process of step S791 is inserted between steps S873 and S874.
  • step S791 the gain at the pixel position is calculated by the interpolation processing of the interpolation units 563 and 564.
  • the repetition for each channel in FIG. 40 is omitted. This is because in the tenth embodiment, the values of the R channel and the B channel are handled simultaneously when calculating the weight. Since points other than these are the same as those described with reference to FIG. 40, description thereof is omitted here.
  • the embodiment of the present invention shows an example for embodying the present invention, and as clearly shown in the embodiment of the present invention, the matters in the embodiment of the present invention and the scope of claims There is a corresponding relationship with the invention-specific matters in. Similarly, the invention specific matter in the claims and the matter in the embodiment of the present invention having the same name as this have a corresponding relationship.
  • the present invention is not limited to the embodiments, and can be embodied by making various modifications to the embodiments without departing from the gist of the present invention.
  • the processing procedure described in the embodiment of the present invention may be regarded as a method having a series of these procedures, and a program for causing a computer to execute the series of procedures or a recording medium storing the program May be taken as
  • this recording medium for example, a CD (Compact Disc), an MD (MiniDisc), a DVD (Digital Versatile Disc), a memory card, a Blu-ray Disc (Blu-ray Disc (registered trademark)), or the like can be used.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

本発明は、照明環境が異なる複数枚画像から照明成分による影響を取り除き、色再現性の高い画像を生成することができる画像処理装置、画像処理方法およびプログラムに関する。 デモザイク処理部221は基準モザイク画像保持部111に保持された基準画像に対してデモザイク処理を施す。デモザイク処理部222は処理対象モザイク画像保持部112に保持された処理対象画像に対してデモザイク処理を施す。ホワイトバランス算出部230は基準画像に対するチャンネル毎のホワイトバランス値を算出する。チャンネルゲイン算出部250は、基準画像および処理対象画像のRGB値および基準画像のホワイトバランスから、照明成分変換のためのチャンネル毎のゲインを算出する。ゲイン算出の際には、黒つぶれや飽和等が考慮される。チャンネルゲイン適用部260は、チャンネルゲイン算出部250によって算出されたゲインを処理対象画像の各チャンネルに適用する。

Description

画像処理装置、画像処理方法およびプログラム
 本発明は、画像処理装置に関し、特に撮像された画像から色再現性の高い画像を生成する画像処理装置、および、これらにおける処理方法ならびに当該方法をコンピュータに実行させるプログラムに関する。
 照明環境の異なる複数枚の画像を用いた画像処理の代表的な例として、フラッシュを発光して撮像した画像の色再現性向上を目的としたフラッシュ発光および非発光の2枚の画像を用いたホワイトバランス処理がある。一般に、フラッシュの光と環境光は色温度が異なるために、フラッシュを発光した写真撮像ではフラッシュが当たった個所とそれ以外では照明の色バランスが異なる。そのため、領域毎に被写体にあたる光の色バランスが変化してしまい、従来のように画面に一様なホワイトバランスを施すゲイン処理では破綻が生じることがあった。これに対して、フラッシュ発光および非発光の2枚の画像から照明のフラッシュ成分と環境光成分を分離し、画素毎にホワイトバランスゲインを調整する試みがなされてきた(例えば、特許文献1参照。)。
特開2005-210485号公報(図1)
 従来の複数枚画像を用いた手法では、2枚画像の差分をとることによって照明成分を分離し、それぞれを単一照明環境下で撮像された画像のホワイトバランスの問題として処理し、合成することによって解決してきた。しかし、従来の手法には以下のように2つの大きな問題がある。
 第1の問題は、環境光の変化に対応できないという問題である。基準画像および処理対象画像の2枚の差分を単一照明の問題として扱うためには、2枚の画像の間でフラッシュ以外の照明成分が一定でなければならない。そのため、撮像時に日光が陰るなどの変化が生じた場合にはうまく対応できなくなるという問題がある。
 第2の問題は、動被写体への対応が困難であるという問題である。基準画像と処理対象画像の間で動いた被写体に属する画素では、分光反射率の異なる画素を比較することになり画像の差分による照明成分の分離が行えない。このため、従来の手法では、カメラの向きが変化した画像、動被写体が存在する画像などの組み合わせには対応できないという問題があった。複数枚画像の画像処理におけるこれらずれに対する問題には、三脚の使用やグローバルモーションベクター(Global Motion Vector)、ブロックマッチングによる位置合わせ等の解決手段が提案されて来た。 しかしながら、三脚を用いた場合には、カメラが動いてしまうことによるずれは解決できるが、動被写体には対応できない。 グローバルモーションベクターやブロックマッチングでは、一般にSAD(Sum of Absolute Difference)という2枚の画像の差分に基づいて動きが推測される。しかし、照明環境が異なる場合には差分が照明成分の変化によるものか動被写体によるものかを判断することができず、精度が落ちるという問題がある。
 本発明はこのような状況に鑑みてなされたものであり、照明環境が異なる複数枚画像から照明成分による影響を取り除き、色再現性の高い画像を生成することを目的とする。
 本発明は、上記課題を解決するためになされたものであり、その第1の側面は、異なる照明環境下で撮像された基準画像および処理対象画像から、各画素位置におけるチャンネル毎に照明成分を変換するためのゲインを算出するチャンネルゲイン算出部と、上記ゲインを上記処理対象画像に適用するためのチャンネルゲイン適用部とを具備する画像処理装置、画像処理方法およびプログラムである。これにより、異なる照明環境下で撮像された基準画像を利用して処理対象画像の各画素位置におけるチャンネル毎に照明成分を変換させるという作用をもたらす。
 また、この第1の側面において、上記チャンネルゲイン算出部は、上記処理対象画像の特定のチャンネルのゲインを固定して、上記処理対象画素の色バランスを上記基準画像と一致するように上記ゲインを算出してもよい。また、上記チャンネルゲイン算出部は、上記処理対象画像の輝度値を固定して、上記処理対象画素の色バランスを上記基準画像と一致するように上記ゲインを算出してもよい。
 また、この第1の側面において、上記チャンネルゲイン算出部は、所定の上限値を超える値が上記ゲインとして算出された場合には上記上限値を上記ゲインとし、または、所定の下限値を下回る値が上記ゲインとして算出された場合には上記下限値を上記ゲインとしてもよい。これにより、上限値および下限値の範囲を逸脱したゲインを除去するという作用をもたらす。
 また、この第1の側面において、上記チャンネルゲイン算出部は、上記基準画像の画素値から画素の飽和度を算出する飽和度算出部と、上記飽和度に応じて上記ゲインの補償処理を行う飽和補償部とを備えてもよい。これにより、飽和度に応じてゲインを補償させるという作用をもたらす。
 また、この第1の側面において、上記チャンネルゲイン算出部は、上記基準画像の画素値から画素の黒つぶれ度を算出する黒つぶれ度算出部と、上記黒つぶれ度に応じて上記ゲインの補償処理を行う黒つぶれ補償部とを備えてもよい。また、上記チャンネルゲイン算出部は、上記基準画像の画素値および上記基準画像と上記処理対象画像とのチャンネル間比率から画素の黒つぶれ度を算出する黒つぶれ度算出部と、上記黒つぶれ度に応じて上記ゲインの補償処理を行う黒つぶれ補償部とを備えてもよい。これにより、黒つぶれ度に応じてゲインを補償させるという作用をもたらす。
 また、この第1の側面において、上記基準画像および上記処理対象画像の撮像条件の違いを補償するために露出強度が等しくなるよう強度調整する露出補償部をさらに具備してもよい。これにより、撮像条件の違いを補償させるという作用をもたらす。
 また、この第1の側面において、上記チャンネルゲイン適用部は、上記基準画像の画素値から画素の飽和信頼度を算出する飽和信頼度算出部と、上記飽和信頼度に基づいて上記ゲインを空間平滑化した上で上記処理対象画素に対して適用する平滑化処理部とを備えてもよい。これにより、飽和信頼度に基づいて空間平滑化したゲインにより照明成分を変換させるという作用をもたらす。
 また、この第1の側面において、上記チャンネルゲイン適用部は、上記基準画像の画素値から画素の黒つぶれ信頼度を算出する黒つぶれ信頼度算出部と、上記黒つぶれ信頼度に基づいて上記ゲインを空間平滑化した上で上記処理対象画素に対して適用する平滑化処理部とを備えてもよい。また、この第1の側面において、上記チャンネルゲイン適用部は、上記基準画像の画素値および上記基準画像と上記処理対象画像とのチャンネル間比率から画素の黒つぶれ信頼度を算出する黒つぶれ信頼度算出部と、上記黒つぶれ信頼度に基づいて上記ゲインを空間平滑化した上で上記処理対象画素に対して適用する平滑化処理部とを備えてもよい。これにより、黒つぶれ信頼度に基づいて空間平滑化したゲインにより照明成分を変換させるという作用をもたらす。
 また、この第1の側面において、上記チャンネルゲイン適用部は、上記基準画像と上記処理対象画像の対応画素における特性値の変化から空間的に被写体が動いた画素か否かを判定して動被写体信頼度を算出する動被写体信頼度算出部と、上記動被写体信頼度に基づいて上記ゲインを空間平滑化した上で上記処理対象画素に対して適用する平滑化処理部とを備えてもよい。また、この第1の側面において、上記動被写体信頼度算出部は、上記基準画像と上記処理対象画像の対応画素の分光反射率の変化に応じて上記動被写体信頼度を算出する分光反射率変化量予測部を備えてもよい。これにより、動被写体信頼度に基づいて空間平滑化したゲインにより照明成分を変換させるという作用をもたらす。
 また、この第1の側面において、上記基準画像または上記処理対象画像の解像度を変換した上で上記チャンネルゲイン算出部に供給する解像度変換部をさらに具備してもよい。その際、この第1の側面において、上記解像度変換部は、画素の間引きによる縮小により上記解像度変換を行ってもよく、ブロック内の画素の平均に基づく縮小により上記解像度変換を行ってもよい。また、ブロック内の画素の中央値に基づく縮小により上記解像度変換を行ってもよい。また、エッジ保存型平滑化フィルタ処理により上記解像度変換を行ってもよい。これにより、基準画像と処理対象画像のサイズを合致させるという作用をもたらす。
 また、この第1の側面において、連続して撮像された画像を格納するためのフレームメモリと、上記連続撮像された画像を重み付けしながら加算して入力画像を作成する加算部と、上記連続撮像に使用する制御パラメータを決定して撮像の繰り返し制御を行う制御パラメータ決定部とをさらに具備してもよい。これにより、連続撮像された複数の画像から合成された画像を入力画像として利用させるという作用をもたらす。
 また、この第1の側面において、上記基準画像はフラッシュ発光無しで撮像された画像として、上記処理対象画像はフラッシュ発光有りで撮像された画像とした組合せを利用してもよい。
 また、この第1の側面において、上記チャンネルゲイン適用部は、上記処理対象画像の画素値から輝度を算出する輝度算出部と、画素間の輝度の差に基づいて前記ゲインを空間平滑化した上で上記処理対象画素に対して適用する平滑化処理部とを備えてもよい。この場合において、上記輝度算出部は、上記処理対象画像の画素値に対して予め設定された重みによる線形和として上記輝度を算出してもよく、また、上記基準画像と上記処理対象画像の対応画素の強度比を目的変量とし、上記処理対象画像の画素値を説明変量とした重回帰分析に基づいて前記輝度を算出してもよい。
 また、本発明の第2の側面は、空間軸方向および輝度軸方向に領域を複数に分割した各ブロックについて処理対象画像の画素の頻度値をブロックヒストグラムとして算出するブロックヒストグラム算出部と、上記各ブロックに属する特性値の積分値を算出するブロック積分値算出部と、ブロックヒストグラムとブロック積分値と当該画素位置の輝度値とから当該画素位置の大局ゲイン値を算出する加重積和部と、上記処理対象画像に上記大局ゲイン値を適用するゲイン適用部とを具備する画像処理装置である。これにより、異なる照明環境下で撮像された基準画像を利用して大局ゲイン値を求め、この大局ゲイン値を適用することにより処理対象画像の各画素位置におけるチャンネル毎に照明成分を変換させるという作用をもたらす。
 また、この第2の側面において、上記ブロック毎の特性値の積分値は、上記各ブロックに属する画素のチャンネル毎に照明成分を変換するためのゲインのチャンネル毎の総和であってもよく、上記各ブロックに属する画素の照明成分を変換するためのゲインのチャンネル毎の中央値にブロック内処理対象画像の画素の頻度値をかけたものであってもよい。
 また、この第2の側面において、上記加重積和部は、予め定義された空間軸方向の重み関数によって当該画素位置への上記ブロックヒストグラムの補間を行う第1の補間部と、予め定義された空間軸方向の重み関数によって当該画素位置への上記ブロック毎の特性値の補間を行う第2の補間部と、予め定義された輝度軸方向の重み関数によって上記補間されたブロックヒストグラムの荷重和を算出する第1の積和部と、予め定義された輝度軸方向の重み関数によって上記補間された特性値の荷重和を算出する第2の積和部と、上記第2の積和部の出力を上記第1の積和部の出力によって除算する除算部とを備えてもよい。また、この加重積和部における保管処理は、順序を入れ替えて、輝度方向の補間、空間方向の補間の順で行っても構わない。
 また、この第2の側面において、上記加重積和部は、上記ブロック毎の特性値を上記ブロックヒストグラムの値で除算することによってブロック位置毎の平均特性値を計算する除算部と、上記平均特性値と当該画素位置に関する特性値とを比較することによって重みを計算する比較部と、上記比較部において算出された重みを対応するブロック位置の上記ブロック毎の特性値に乗じる第1の乗算部と、上記比較部において算出された重みを対応するブロック位置の上記ブロックヒストグラムの値に乗じる第2の乗算部と、予め定義された空間軸方向の重み関数によって当該画素位置へ上記第1の乗算部の出力である重み付きブロックヒストグラムの補間を行う第1の補間部と、予め定義された予め定義された空間軸方向の重み関数によって当該画素位置への第2の乗算部の出力であるブロック毎の重み付き特性値の補間を行う第2の補間部と、予め定義された輝度軸方向の重み関数によって上記補間されたブロックヒストグラムの荷重和を算出する第1の積和部と、予め定義された輝度軸方向の重み関数によって上記補間された特性値の荷重和を算出する第2の積和部と、上記第2の積和部の出力を上記第1の積和部の出力によって除算する除算部とを備えてもよい。
 本発明によれば、照明環境が異なる複数枚画像から照明成分による影響を取り除き、色再現性の高い画像を生成することができるという優れた効果を奏し得る。
本発明の実施の形態における撮像装置の一例を示す図である。 本発明の第1の実施の形態における画像処理回路23の処理機能の一例を示す図である。 本発明の実施の形態において想定するモザイク画像の色配列の一例としてのベイヤー配列を示す図である。 本発明の実施の形態において想定するモザイク画像の色配列の一例としてのベイヤー配列におけるベイヤーセットを示す図である。 本発明の第1の実施の形態における照明成分変換処理部120の構成例を示す図である。 本発明の第1の実施の形態におけるチャンネルゲイン算出部250の構成例を示す図である。 本発明の第1の実施の形態における黒つぶれ度の一例を示す図である。 本発明の第1の実施の形態における黒つぶれ度の他の例を示す図である。 本発明の第1の実施の形態における飽和度の一例を示す図である。 本発明の実施の形態におけるチャンネルゲイン適用部260の第1の構成例を示す図である。 本発明の実施の形態における撮像装置の動作例を示す図である。 本発明の第1の実施の形態における照明成分変換処理手順の動作例を示す図である。 本発明の第1の実施の形態におけるチャンネルゲイン算出処理手順の動作例を示す図である。 本発明の第1の実施の形態におけるチャンネルゲイン適用処理手順の動作例を示す図である。 本発明の第2の実施の形態における照明成分変換処理部120の構成例を示す図である。 本発明の第2の実施の形態におけるチャンネルゲイン適用部260の構成例を示す図である。 本発明の第2の実施の形態における飽和信頼度の一例を示す図である。 本発明の第2の実施の形態における黒つぶれ信頼度の一例を示す図である。 本発明の第2の実施の形態における黒つぶれ信頼度の他の例を示す図である。 本発明の第2の実施の形態における動被写体信頼度算出部460の構成例を示す図である。 本発明の第2の実施の形態における比率逆転度の一例を示す図である。 本発明の第2の実施の形態における予測比率の一例を示す図である。 本発明の第2の実施の形態における分光反射率変化量の一例を示す図である。 本発明の第2の実施の形態におけるチャンネルゲイン適用部260の動作例を示す図である。 本発明の実施の形態における動被写体信頼度算出部460の動作例を示す図である。 本発明の第3の実施の形態における平滑化処理部480の処理機能例を示す図である。 本発明の第3の実施の形態におけるブロック積分値算出部531、532およびブロックヒストグラム算出部533の構成例を示す図である。 本発明の第3の実施の形態における加重積和部561および562の構成例を示す図である。 本発明の第3の実施の形態における輝度重み関数の形状の一例を示す図である。 本発明の第3の実施の形態における平滑化処理部480の動作例の前半を示す図である。 本発明の第3の実施の形態における平滑化処理部480の動作例の後半を示す図である。 本発明の第3の実施の形態におけるブロック積分値算出部531、532およびブロックヒストグラム算出部533の動作例を示す図である。 本発明の第3の実施の形態における加重積和部561および562の動作例を示す図である。 本発明の第4の実施の形態における照明成分変換処理部120の構成例を示す図である。 本発明の第4の実施の形態におけるチャンネルゲイン適用部260の構成例を示す図である。 本発明の第4の実施の形態における平滑化処理部480の構成例を示す図である。 本発明の第4の実施の形態における照明成分変換処理部120の動作例を示す図である。 本発明の第4の実施の形態におけるチャンネルゲイン適用部260の動作例を示す図である。 本発明の第4の実施の形態における平滑化処理部480の動作例の前半を示す図である。 本発明の第4の実施の形態における平滑化処理部480の動作例の後半を示す図である。 本発明の第5の実施の形態における照明成分変換処理部120の構成例を示す図である。 本発明の第5の実施の形態におけるフレーム加算部280の構成例を示す図である。 本発明の第5の実施の形態における照明成分変換処理部120の動作例の前半を示す図である。 本発明の第5の実施の形態における照明成分変換処理部120の動作例の後半を示す図である。 本発明の第6の実施の形態における画像処理回路23の処理機能の一例を示す図である。 本発明の第7の実施の形態における画像処理回路23の処理機能の一例を示す図である。 本発明の第8の実施の形態における画像処理回路23の処理機能の一例を示す図である。 本発明の第9の実施の形態における平滑化処理部480の処理機能例を示す図である。 本発明の第9の実施の形態における平滑化処理部480の他の処理機能例を示す図である。 本発明の第9の実施の形態における平滑化処理部480の図48の処理機能例に対応する動作例の前半を示す図である。 本発明の第9の実施の形態における平滑化処理部480の図48の処理機能例に対応する動作例の後半を示す図である。 本発明の第9の実施の形態における平滑化処理部480の図49の処理機能例に対応する動作例の1枚目を示す図である。 本発明の第9の実施の形態における平滑化処理部480の図49の処理機能例に対応する動作例の2枚目を示す図である。 本発明の第9の実施の形態における平滑化処理部480の図49の処理機能例に対応する動作例の3枚目を示す図である。 本発明の第10の実施の形態における平滑化処理部480の処理機能例を示す図である。 本発明の第10の実施の形態における加重積和部561および562の構成例を示す図である。 本発明の第10の実施の形態における加重積和の重みθの算出例を示す図である。 本発明の第10の実施の形態における平滑化処理部480の他の処理機能例を示す図である。 本発明の第10の実施の形態における平滑化処理部480の図58の処理機能例に対応する加重積和部561および562の構成例を示す図である。 本発明の第10の実施の形態における平滑化処理部480の図55の処理機能例に対応する動作例を示す図である。 本発明の第10の実施の形態における加重積和部561および562の動作例の前半を示す図である。 本発明の第10の実施の形態における加重積和部561および562の動作例の後半を示す図である。 本発明の第10の実施の形態における平滑化処理部480の動作例を示す図である。
 以下、本発明を実施するための形態(以下、実施の形態と称する)について説明する。説明は以下の順序により行う。
 1.第1の実施の形態(乗算によりゲイン適用を行う例)
 2.第2の実施の形態(重み付け平滑化によりゲイン適用を行う例)
 3.第3の実施の形態(ブロックヒストグラムを利用したエッジ保存型平滑化によりゲイン適用を行う例)
 4.第4の実施の形態(入力画像に対して解像度変換を行う例)
 5.第5の実施の形態(フレームメモリを利用して入力画像を合成する例)
 6.第6の実施の形態(ホワイトバランス処理を照明成分変換処理の前段で行う例)
 7.第7の実施の形態(ホワイトバランス処理された入力画像を用いる例)
 8.第8の実施の形態(ガンマ補正処理された入力画像を用いる例)
 9.第9の実施の形態(重回帰分析を利用して輝度を算出する例)
 10.第10の実施の形態(ゲインを利用して平滑化を行う例)
 <1.第1の実施の形態>
 [撮像装置の構成例]
 図1は、本発明の実施の形態における撮像装置の一例を示す図である。この撮像装置は、大別して光学系、信号処理系、記録系、表示系、および、制御系から構成される。
 光学系は、被写体の光画像を集光するレンズ11と、光画像の光量を調整する絞り12と、集光された光画像を光電変換して電気信号に変換する撮像素子13とから構成される。撮像素子13は、例えば、CCDイメージセンサやCMOSイメージセンサなどにより実現される。
 信号処理系は、サンプリング回路21と、A/D変換回路22と、画像処理回路23とから構成される。サンプリング回路21は、撮像素子13からの電気信号をサンプリングするものである。このサンプリング回路21は、例えば、相関2重サンプリング回路(CDS:Correlated Double Sampling)によって実現される。これにより、撮像素子13で発生するノイズが軽減される。A/D変換回路22は、サンプリング回路21から供給されるアナログ信号をディジタル信号に変換するものである。画像処理回路23は、A/D変換回路22から入力されるディジタル信号に所定の画像処理を施すものである。この画像処理回路23は、例えば、DSP(Digital Signal Processor)によって実現される。なお、この画像処理回路23により実行される処理の詳細については後述する。
 記録系は、画像信号を記憶するメモリ32と、画像処理回路23によって処理された画像信号を符号化してメモリ32に記録し、また、メモリ32から画像信号を読み出して復号し、画像処理回路23に供給する符号化/復号器31とから構成される。なお、メモリ32は、磁気ディスク、光ディスク、光磁気ディスク、または、半導体メモリ等であってよい。
 表示系は、画像処理回路23によって処理された画像信号を表示部42に出力する表示ドライバ41と、入力される画像信号に対応する画像を表示する表示部42とから構成される。表示部42は、例えば、LCD(Liquid Crystal Display)等により実現され、ファインダとしての機能も有する。
 制御系は、タイミング生成器51と、操作入力受付部52と、ドライバ53と、制御部54と、フラッシュ発光部61と、フラッシュ制御部62とから構成される。タイミング生成器51は、撮像素子13、サンプリング回路21、A/D変換回路22、および、画像処理回路23の動作タイミングを制御するものである。操作入力受付部52は、ユーザによるシャッタ操作やその他のコマンド入力を受け付けるものである。ドライバ53は、周辺機器を接続するためのドライバである。このドライバ53には、磁気ディスク、光ディスク、光磁気ディスク、または、半導体メモリ等が接続される。制御部54は、撮像装置全体を制御するものである。この制御部54は、これらに記憶されている制御用プログラムを、ドライバ53を介して読み出し、読み出した制御用プログラムや操作入力受付部52から入力されるユーザからのコマンド等に基づいて制御を行う。フラッシュ発光部61は、撮像の際に被写体に光を照らすためのものであり、ストロボと呼ばれることもある。フラッシュ制御部62は、フラッシュ発光部61を制御するものであり、ユーザからの指示や周囲の明るさ等に従ってフラッシュ発光部61を発光させる。
 画像処理回路23、符号化/復号器31、メモリ32、表示ドライバ41、タイミング生成器51、操作入力受付部52、制御部54、および、フラッシュ制御部62は、バス59を介して相互に接続されている。
 この撮像装置において、被写体の光学画像(入射光)は、レンズ11および絞り12を介して撮像素子13に入射され、撮像素子13によって光電変換されて電気信号となる。得られた電気信号は、サンプリング回路21によってノイズ成分が除去され、A/D変換回路22によってディジタル化された後、画像処理回路23が内蔵する(図示しない)画像メモリに一時格納される。
 なお、通常の状態では、タイミング生成器51による信号処理系に対する制御により、画像処理回路23の内蔵する画像メモリには、一定のフレームレートで絶えず画像信号が上書きされるようになされている。画像処理回路23の内蔵する画像メモリの画像信号は、表示ドライバ41を介して表示部42に出力され、対応する画像が表示部42に表示される。
 表示部42は、撮像装置のファインダとしての役割も担っている。ユーザが操作入力受付部52に含まれるシャッタボタンを押下した場合、制御部54は、タイミング生成器51に対して、シャッタボタンが押下された直後の画像信号を保持するように、すなわち、画像処理回路23の画像メモリに画像信号が上書きされないように、信号処理系を制御する。画像処理回路23の画像メモリに保持された画像データは、符号化/復号器31によって符号化されてメモリ32に記録される。以上のような撮像装置の動作によって、1枚の画像データの取込みが完了する。
 [画像処理回路23の処理機能例]
 図2は、本発明の第1の実施の形態における画像処理回路23の処理機能の一例を示す図である。画像処理回路23は、照明成分変換処理部120と、ホワイトバランス処理部130と、デモザイク処理部140と、階調補正処理部150と、ガンマ補正処理部160と、YC変換処理部170とを備える。この画像処理回路23は、A/D変換回路22によってデジタイズされたモザイク画像を入力画像として画像処理を施すものである。モザイク画像は、各画素にR、G、Bの何れかの色に対応する強度信号が格納されたものであり、その色配列は図3に示すようなベイヤー配列を想定している。なお、モザイク画像は、RAWデータと呼ばれることもある。また、各画素で格納する強度信号は、R、G、Bに限らず、C、M、Y、または、それ以外の色情報でも構わない。
 画像処理回路23は、入力部に基準モザイク画像保持部111および処理対象モザイク画像保持部112を備える。基準モザイク画像保持部111は、基準(criterion)となるモザイク画像(基準画像M)を保持するメモリである。処理対象モザイク画像保持部112は、処理対象(subject)となるモザイク画像(処理対象画像M)を保持するメモリである。本発明の実施の形態では、基準画像における色バランス(色の比率)を利用して処理対象画像の色バランスを調整することを想定する。
 照明成分変換処理部120は、基準画像における色の比率を利用して処理対象画像の照明成分を変換して、モザイク画像Mを生成するものである。すなわち、処理対象画像には、基準画像の色バランスと等しくなるようにチャンネル毎に適切な係数が掛けられて、単一の光源の色バランスに変換される。なお、この照明成分変換処理部120の構成については後述する。
 ホワイトバランス処理部130は、モザイク画像Mに対してホワイトバランス処理を施すものである。このホワイトバランス処理部130は、モザイク画像Mに対して、無彩色の被写体領域の色バランスが無彩色になるように、各画素強度の持つ色に応じて適切な係数を掛けるものである。このホワイトバランス処理を施されたモザイク画像Mは、デモザイク処理部140に供給される。
 デモザイク処理部140は、モザイク画像Mの各画素位置にR、G、Bの全てのチャネルの強度が揃うように補間処理(デモザイク処理)を行うものである。この補間処理の施されたデモザイク画像[R,G,Bは、R(Red:赤)、G(Green:緑)、B(Blue:青)の3つの色に対応する3つの画像(RGB画像)であり、階調補正処理部150に供給される。なお、行列Aは、行列Aの転置行列を意味する。
 階調補正処理部150は、デモザイク処理部140の出力の画像[R,G,Bにおける各画素に階調補正処理を施すものである。この階調補正処理の施された画像[R,G,Bは、ガンマ補正処理部160に供給される。
 ガンマ補正処理部160は、画像[R,G,Bに対してガンマ補正処理を施すものである。ガンマ補正処理は、表示部42において入力画像に忠実な表示を再現するための補正である。このガンマ補正処理部160の出力[R γ,G γ,B γは、YC変換処理部170に供給される。
 YC変換処理部170は、ガンマ補正された3チャネル画像[R γ,G γ,B γにYCマトリックス処理およびクロマ成分に対する帯域制限を行うことにより、輝度信号Yおよび色差信号C(Cr,Cb)を出力するものである。この輝度信号および色差信号は、それぞれY画像保持部191およびC画像保持部192に保持されて、画像処理回路23の後段の符号化/復号器31に供給される。
 なお、表示ドライバ41には、通常の場合、RGB信号が供給される。このRGB信号は、YC変換処理部170の出力である輝度信号および色差信号をRGB信号に変換したものである。
 [ベイヤー配列とベイヤーセット]
 図3は、本発明の実施の形態において想定するモザイク画像の色配列の一例としてのベイヤー配列を示す図である。このベイヤー配列では、Gの色の画素が市松状に配置され、それ以外の画素位置ではRの色の画素が水平方向および垂直方向に1画素おきの正方格子状に配置され、残りの画素位置にBの色の画素が水平方向および垂直方向に1画素おきの正方格子状に配置されている。
 図4は、本発明の実施の形態において想定するモザイク画像の色配列の一例としてのベイヤー配列におけるベイヤーセットを示す図である。本発明の実施の形態では、照明成分変換処理部120における照明成分の変換処理の際にモザイク画像の横2画素×縦2画素の4画素を単位として扱ってもよい。この4画素の集合をベイヤーセットと称する。具体的には、G、B、R、Gの4つの画素に接する位置601を中心として、それら4つの画素をまとめたものがベイヤーセット602となる。
 [照明成分変換処理部120の構成例]
 図5は、本発明の第1の実施の形態における照明成分変換処理部120の構成例を示す図である。照明成分変換処理部120は、デモザイク処理部221および222と、ホワイトバランス算出部230と、基準画像ホワイトバランス保持部240と、チャンネルゲイン算出部250と、チャンネルゲイン適用部260とを備える。
 デモザイク処理部221は、基準モザイク画像保持部111に保持された基準画像に対してデモザイク処理を施して、画素毎に強度や信頼度を求めるために必要なチャンネルが揃った基準画像のデモザイク画像I(p)を生成するものである。なお、pは各画素位置を表す。デモザイク処理部222は、処理対象モザイク画像保持部112に保持された処理対象画像に対してデモザイク処理を施して、画素毎に強度や信頼度を求めるために必要なチャンネルが揃った処理対象画像のデモザイク画像I(p)を生成するものである。なお、本発明の第1の実施の形態においては、強度を求めるためのGチャンネルが画素毎に求まっていればよい。
 デモザイク処理部221および222は、デモザイク処理を行う際、図4のベイヤーセット602を処理単位として位置601へデモザイクする簡易的な処理で構わない。このときのデモザイク方法は、RおよびBチャンネルの画素はそのまま使用し、Gチャンネルの画素は2つの画素の平均をとるような処理でよい。この場合は、縦横1/2に縮小され、3チャンネル揃った画像が作成される。また、デモザイク処理部221および222におけるデモザイク処理は、図2のデモザイク処理部140におけるデモザイク処理のように、より広い領域を参照して画素毎に行うものであってもよい。この場合は、縮小は行われず、デモザイクのみが行われることになる。また、画素毎にデモザイク処理を行った際にはデモザイク前の画素pとデモザイク後の画素pが等しくなり、モザイク画像Msからゲイン適用部への線は不要になる。
 ホワイトバランス算出部230は、基準モザイク画像保持部111に保持された基準画像に対してチャンネル毎のホワイトバランスゲインを算出するものである。このときのホワイトバランスの算出方法としては、グレイワールド仮説に基づき画面全体のRGB画素の平均値の比率を1:1:1にするようなゲインとして求めてもよい。また、別の算出法としては、処理対象モザイク画像保持部112に保持された処理対象画像とあわせて特開2006-67561号公報の第0071乃至0081段落に記載されているように最適化問題としてホワイトバランスを求めることも可能である。さらに、図2におけるホワイトバランス処理部130と同様の手法により設定しても構わない。また、ホワイトバランスは撮像前に事前に設定する形を取ることも可能である。設定する方法としては、カラーメータ等の別機器によって計測された色温度に基づいて、撮像時に撮像者が設定することが想定される。蛍光灯や曇天などシーンを設定することで、プリセットホワイトバランスを利用して設定することもできる。または、カスタムホワイトバランス(白セット)機能などを利用して白色物体を撮像することで設定するようにしてもよい。算出されたホワイトバランスは、基準画像ホワイトバランス保持部240に格納される。
 チャンネルゲイン算出部250は、基準画像および処理対象画像のR、G、Bの値、および、基準画像のホワイトバランスから、色バランス調整のためのチャンネル毎のゲインFS(p)を算出するものである。このゲインFS(p)は、処理対象画像の照明成分を変換するためのチャンネル毎のゲイン値である。このゲインは、後述するように、何れかのチャンネルを基準として、基準画像と処理対象画像との比を求めることにより得ることができる。例えば、Gチャンネルを基準とした場合、GチャンネルのゲインFS(p)は、「1」になる。このチャンネルゲイン算出部250によって算出されたゲインは、チャンネルゲイン適用部260に供給される。
 チャンネルゲイン適用部260は、チャンネルゲイン算出部250によって算出されたゲインを処理対象画像の各チャンネルに適用するものである。ゲイン適用の詳細については後述するが、最も単純な適用の態様としては、処理対象画像にゲインを乗算することが考えられる。このチャンネルゲイン適用部260によってゲイン適用されたモザイク画像Mは照明成分変換済モザイク画像保持部290に保持されて、後段のホワイトバランス処理部130に供給される。
 [チャンネルゲイン算出部250の構成例]
 図6は、本発明の第1の実施の形態におけるチャンネルゲイン算出部250の構成例を示す図である。このチャンネルゲイン算出部250は、色変換ゲイン算出部311および312を備えて、ゲインS(p)を算出する。
 本発明の実施の形態では、同一の被写体に対して異なる照明環境で撮像された2枚の画像(基準画像および処理対象画像)を用いて各画素のチャンネル毎にゲインを求め、適用することで、色再現性の高い画像を生成する。基準画像とは、すでに画素毎のホワイトバランスが求められており、または、従来手法等で容易に求めることができる画像である。一方、処理対象画像とは、基準画像とは色温度の異なる複数光源下で撮像された画像など、その画像単体からでは画素毎のホワイトバランスゲインの推定が困難である画像を想定している。これにより、基準画像のホワイトバランスを求めることで、間接的に処理対象画像のホワイトバランスを算出することが可能となり、複数光源下で撮像された画像に対するホワイトバランスの問題を解決することができる。具体的な組み合わせとしては、フラッシュを発光させずに撮像した画像と、フラッシュを発光させて撮像した画像との組合せが想定される。また、他の例として、蛍光灯の影響による帯状のノイズ(フリッカー)を有する画像と有しない画像との組合せや、複数光源が存在する環境下で光源が変化した画像の組合せ等が想定される。
 各画素でのセンサで計測される強度をI、照明強度をE、分光反射率をρとすると、次式の関係により近似することができる。
   I(p)=E(p)・ρ(p)
ただし、
Figure JPOXMLDOC01-appb-M000001
である。ここで基準画像の強度をI、処理対象画像の強度をIとして2枚の画像の比をとると、チャンネル毎に分光反射率ρの影響を近似的に打ち消すことができ、次式のように分光反射率に依存しない照明成分の比率Koを求めることができる。
 2枚の画像の比較に際しては、撮像条件を補正し、露出条件を揃えることによって、Koの値を正規化し、Koを純粋な照明色バランスの比とすることができる。このKoの値で処理対象画素Iを除算することによって、処理対象画素の照明成分を基準画像の照明の色バランスに写像することができる。ただし、単純にKoで除算したのでは、色バランスとともに、信号強度に対しても基準画像の強度に揃えてしまうことになり、フラッシュによる強度の改善効果が失われてしまう。そこで、照明強度を維持するために、強度変化を打ち消す補正を加え、ゲインSを次式のように表すことができる。
Figure JPOXMLDOC01-appb-M000003
ここで、KIは強度の定義に応じて画素毎に決まる値であり、本発明の実施の形態では、一般的なホワイトバランスのゲインに倣って、Gチャンネルの値を固定するために、次の関係を用いる。
   KI(p)=Ko(p)=G(p)/G(p)
すなわち、
Figure JPOXMLDOC01-appb-M000004
となる。色変換ゲイン算出部311および312は、上式により、それぞれゲインS(p)およびS(p)を算出する。なお、本発明の実施の形態ではGチャンネルの値を固定することを前提としたため、ゲインS(p)は常に「1」となる。なお、Gチャンネルの値を固定にしたのは、Gチャンネルの信号が最も画素数が多く、また、感度が高いため、信頼性が高いと考えられるからである。
 なお、本発明の実施の形態では、画像間の同チャンネルの比率Koを経由してゲインSを算出しているが、同様の処理を、演算順序を変えて実現しても構わない。一般に、除算処理は演算コストが高い処理であるため、演算量削減のために、逆数ルックアップテーブルによる処理や、対数に変換したうえで減算するなどの手法を用いることが望ましい。また、KIの値としては画素毎の輝度値など、Gチャンネル以外の比率も使えることはいうまでもない。
 このようにして得られたゲインをチャンネルゲイン適用部260において各画素に乗じることにより、基準画像の色バランスで、照明強度が処理対象画像に等しい画像を得ることができる。本発明の実施の形態による手法では光源の分離は行わず、処理対象画像の合成光を一つの光源と見て基準画像の照明の色バランスに写像する。このため、2枚の画像の差分が複数光源から構成されていても正常に動作する。
 ただし、上式では基準画像の色バランスが正しいことが前提となっているが、各画素のチャンネルが飽和または黒つぶれを生じている場合には、基準画素の色バランス自体が正しくないことになる。また、動被写体に相当する画素でも、比率Koが正しく求まらずゲインSが非常に大きい値または非常に小さい値となることがある。そのため、照明成分変換処理部120は、さらに、上限値クリッピング部321および322と、下限値クリッピング部331および332とを備える。これにより、ゲインの値に上限値および下限値を設定してクリッピング処理を行って、極端なアーチファクトを抑制する。また、照明成分変換処理部120は、さらに、黒つぶれ補償部341および342と、黒つぶれ度算出部345と、飽和補償部351および352と、飽和度算出部355とを備える。これにより、黒つぶれや飽和に対する基準値を与え、ゲインSの有効性を判定し、その度合いに応じて、黒つぶれや飽和時特有の方策で定めた補償値との加重平均をゲインとすることで、大きな破綻をしないゲインを求める。
 上限値クリッピング部321および322は、ゲインS(p)またはS(p)がその上限値を超えている場合に、上限値になるようクリッピング処理を行うものである。下限値クリッピング部331および332は、ゲインS(p)またはS(p)がその下限値を下回っている場合に、下限値になるようクリッピング処理を行うものである。ゲイン上限値は、ゲイン上限値R保持部323またはゲイン上限値B保持部324に予め設定することができる。また、ゲイン下限値は、ゲイン下限値R保持部333またはゲイン下限値B保持部334に予め設定することができる。ゲイン上限値およびゲイン下限値は、外部から設定されてもよく、また、内部で算出された上で設定されてもよい。ゲイン上限値およびゲイン下限値を算出する際には、次式を用いることができる。
Figure JPOXMLDOC01-appb-M000005
Figure JPOXMLDOC01-appb-M000006
 上式において、WBは基準画像に対するホワイトバランスであり、WBは処理対象画像に対するホワイトバランスである。これにより、後段のホワイトバランス処理部130におけるゲインと合わせて、各画素にかかるゲインが、チャンネルに応じた基準画像のホワイトバランスと処理対象画像のホワイトバランスの間に収まり、大きな破綻を防ぐことができる。ここで、WBとしては、ホワイトバランス算出部230で算出された値を用いることができる。また、WBとしては、図1のフラッシュ発光部61に対して事前に測定することにより求められたホワイトバランス値を用いることができ、また、WBと同様の手法で処理対象画像から求められた値を用いてもよい。
 上限値クリッピング部321および322によってクリッピング処理されたゲインSmaxcR(p)およびSmaxcB(p)は、下限値クリッピング部331および332に供給される。また、下限値クリッピング部331および332によってクリッピング処理されたゲインSmincR(p)およびSmincB(p)は、黒つぶれ補償部341および342に供給される。
 黒つぶれ度算出部345は、基準画像または処理対象画像の特定のチャンネルの値に基づいて、黒つぶれを生じている度合いを示す黒つぶれ度を算出するものである。ここでは、特定のチャンネルとして、Gチャンネルを想定する。一般に、画像センサにおいて黒つぶれ領域では、センサの特性に線形性がなくなる。さらに完全に黒つぶれし、画素値が0になってしまったチャンネルに関しては、比率Koが正しく求まらない。そこで、画素値が非常に小さい画素は、別の方法でゲインを算出する必要がある。処理対象画像の当該画素が暗い時には間違ったゲインを算出して色バランスを適用しても目立たないが、当該画素がフラッシュにより十分な輝度を持った時には色バランスの破綻が大きく目立つ。このことから、黒つぶれ度に求められる特性は、基準画像が非常に小さな値では大きな値を取るとともに、フラッシュにより処理対象画像が十分に明るくなった時に大きな値を示すことが望ましい。
 そこで、黒つぶれ度PGB(p)は、図7および次式のように、0からある閾値となるGcの値まで急激に減少し、閾値以降は0となるような値を用いることが有効である。
Figure JPOXMLDOC01-appb-M000007
ここでGwhite_levelは、Gの上限値である。この式は、基準画像の画素値から黒つぶれ度を算出するものである。
 また、フラッシュが当たることで明るくなったことをより明確にするために、図8および次式により黒つぶれ度PGB(p)を設定してもよい。この式は、基準画像の画素値および基準画像と処理対象画像とのチャンネル間比率から黒つぶれ度を算出するものである。
Figure JPOXMLDOC01-appb-M000008
ここでexpCVは基準画像と処理対象画像の絞り、シャッタースピード、および、センサに対するISO感度設定の違いに起因する露出の相違を補正するための係数である。また、簡易的には、Exif情報に基づく次式によりexpCVを設定してもよい。ただし、Fは絞りを表すF値、tはシャッタースピード、ISOはISO感度である。それぞれの添字cは基準画像を意味し、添字sは処理対象画像を意味する。
Figure JPOXMLDOC01-appb-M000009
 後者の黒つぶれ度では、0から露出を合わせたG・expCVの値まで急激に減少し、G・expCV以降は0となっている。単調減少性から、基準画像のGの強度Gが小さく黒つぶれしている時に、大きな値を持つ。さらに、0からGs・expCVまで下に凸の属性を持つことで、露出調整後の基準画像と処理対象画像の比率が大きい時、すなわちフラッシュの寄与率が大きい時に、大きな値をとる。このような特性を持つ重みであれば、重みの算出方法は上述の式に限定されるものではない。
 黒つぶれ補償値R保持部343および黒つぶれ補償値B保持部344は、黒つぶれを補償する際の基準となる黒つぶれ補償値を保持するものである。この黒つぶれ補償値は、処理対象画素の照明成分がほぼフラッシュによるものであると考えて、WBs/WBcとすることが有効である。このときのWBc、WBsは、上限値および下限値算出に用いられたホワイトバランスと同様の値を使用することができる。またここでのWBsは、特許第3889017号公報に記載された二重ホワイトバランス補正により求められたホワイトバランス値を用いてもよい。
 黒つぶれ補償部341および342は、ゲインSminc(SmincR(p)およびSmincB(p))を黒つぶれ補償値R保持部343および黒つぶれ補償値B保持部344に保持される黒つぶれ補償値に近づける処理を行うものである。具体的には、黒つぶれ補償部341および342は、黒つぶれ度PGB(p)を重みとしたSmincと黒つぶれ補償値との案分処理(加重平均)により、ゲインSblacR(p)およびSblacB(p)を生成する。
 飽和度算出部355は、基準画像のGチャンネルの値に基づいて、基準画像が飽和(白飛び)している度合いを示す飽和度を算出するものである。一般に、画像センサの飽和領域においては、センサの特性に線形性がなくなる。そして、さらに完全に飽和し、値が上限値に至ってしまったチャンネルに関しては、比率Koが正しく求まらない。そこで、画素値が非常に大きな画素については、別な方法でゲインを算出する必要がある。飽和度PGS(p)は、図9のような特性を持つ値が有効であると考えられる。すなわち、ある閾値の値まで飽和度は0であり、基準画像のGの強度Gが閾値を超えた領域において急激に飽和度が大きくなる。基準画素が飽和している場合には、処理対象画素においても照明成分のうち環境光成分が十分な大きさを有することが期待される。
 飽和補償値R保持部353および飽和補償値B保持部354は、飽和を補償する際の基準となる飽和補償値を保持するものである。この飽和補償値は「1」とすることが有効であると考えられる。
 飽和補償部351および352は、ゲインSblac(SblacR(p)およびSblacB(p))を飽和補償値R保持部353および飽和補償値B保持部354に保持された飽和補償値に近づける処理を行うものである。具体的には、飽和補償部351および352は、飽和度PGS(p)を重みとしたゲインSblacと飽和補償値との案分処理(加重平均)により、ゲインFS(p)およびFS(p)を生成する。
 なお、上述の黒つぶれ度算出部345および飽和度算出部355では、Gチャンネルを用いて黒つぶれ度や飽和度の判定を行ったが、これはGチャンネルに限定されるものではない。R、Bチャンネル、またはそれらの最大最小、線形和、輝度値などによる判定も有効である。
 チャンネルゲイン算出部250では、色変換ゲイン算出部311、312で求めるゲインにおける強度、黒つぶれ度算出部345における黒つぶれ度判定、飽和度算出部355における飽和度判定においてGチャンネルを用いたため、モザイク画像上における元々のチャンネルに加えて画素毎にGチャンネルの値を持つことが必要となるが、それ以外のチャンネルに関しては必ずしも必要ではない。また、この画素毎に必要になるチャンネルは強度の基準とするチャネルを変化させることに伴い変化する。
 [チャンネルゲイン適用部260の第1の構成例]
 図10は、本発明の実施の形態におけるチャンネルゲイン適用部260の第1の構成例を示す図である。このチャンネルゲイン適用部260の第1の構成例は、乗算部261および262を備える。乗算部261は、デモザイク処理部222からの処理対象画像I(p)のR(p)とチャンネルゲイン算出部250からのゲインFS(p)とを乗算するものである。乗算部262は、デモザイク処理部222からの処理対象画像I(p)のB(p)とチャンネルゲイン算出部250からのゲインFS(p)とを乗算するものである。両者の処理を式に表すと、次式のようになる。
   R(p)=FS(p)×R(p)
   B(p)=FS(p)×B(p)
 これらR(p)およびB(p)は、それぞれモザイク画像MのRチャンネルおよびBチャンネルを構成する。また、本発明の実施の形態ではGチャンネルに対するゲインを1に固定しているため、照明成分変換処理の前後でGチャンネルに値に変化がない。そのため、処理対象画像のモザイク画像MのGの画素を、それぞれモザイク画像M上の対応する位置のGとして読み出して格納する。ゲイン算出時に保持する信号の強度によってGチャンネルに対してもゲインの適用が必要になる。その際には、チャンネルゲイン算出部250において、R、Bチャンネルに準じた形でGチャンネル用のゲインを算出するとともに、チャンネルゲイン適用部260においてゲインを適用する。
 なお、このチャンネルゲイン適用部260の第1の構成例においては、デモザイク処理部221からの基準画像I(p)の入力は不要になる。
 [動作例]
 図11は、本発明の実施の形態における撮像装置の動作例を示す図である。まず、フラッシュ発光部61を発光させずに撮像が行われ(ステップS901)、基準画像のモザイク画像Mとして基準モザイク画像保持部111に格納される(ステップS902)。次に、フラッシュ発光部61を発光させた撮像が行われ(ステップS903)、処理対象画像のモザイク画像Mとして処理対象モザイク画像保持部112に格納される(ステップS904)。
 その後、画像処理回路23の照明成分変換処理部120が、撮像された2枚の画像に基づいて処理対象画像の色バランスを調整し、照明成分を単一の光源の色バランスに変換する(ステップS910)。そして、ホワイトバランス処理部130がモザイク画像の色バランスを調整する(ステップS905)。次に、デモザイク処理部140がモザイク画像から各画素にRGBの情報が揃ったRGB画像を生成する(ステップS906)。次に、階調補正処理部150がRGB画像に対して階調補正処理を行う(ステップS907)。次に、ガンマ補正処理部160が階調補正された画像に対してガンマ補正処理を施す(ステップS908)。次に、YC変換処理部170がガンマ補正されたRGB画像をYC画像に変換する(ステップS909)。変換されたYC画像は、LCDへの表示または記録媒体への保存のために出力される。以上で1フレーム分の画像処理部の動作が終了する。後続のフレームの入力がなければ、画像処理部の動作は終了する。なお、フラッシュ発光部61の発光の有無については、先に発光有りの画像を撮像するようにして、撮像順序を逆にしてもよい。
 図12は、本発明の第1の実施の形態における照明成分変換処理手順(ステップS910)の動作例を示す図である。まず、基準画像が読み出され(ステップS911)、この基準画像に対するチャンネル毎のホワイトバランスが算出される(ステップS912)。算出されたホワイトバランスは、基準画像ホワイトバランス保持部240に保持される(ステップS913)。以降、以下のステップにおいて、画素毎の処理が画面全体に対して進められる。
 次に、処理対象画像が読み出される(ステップS914)。これら読み出された基準画像および処理対象画像は、デモザイク処理部221および222においてそれぞれデモザイク処理が施される(ステップS915およびS916)。この際、デモザイク処理の順序は問わない。そして、チャンネルゲイン算出部250において、基準画像および処理対象画像のR、G、Bの値から色バランス調整のためのチャンネル毎のゲインが算出される(ステップS917)。この算出されたゲインは、チャンネルゲイン適用部260において、処理対象画像の各チャンネルに適用される(ステップS918)。このようにして処理された処理対象画像は、照明成分変換済モザイク画像保持部290に保持される(ステップS919)。
 ステップS911乃至S919の処理が終了すると、1フレーム分の照明成分変換処理を終了する。
 図13は、本発明の第1の実施の形態におけるチャンネルゲイン算出処理手順(ステップS917)の動作例を示す図である。まず、ゲイン上限値R保持部323、ゲイン上限値B保持部324、ゲイン下限値R保持部333およびゲイン下限値B保持部334に、それぞれゲイン上限値または下限値が設定される(ステップS921)。また、黒つぶれ補償値R保持部343および黒つぶれ補償値B保持部344に黒つぶれ補償値が設定され、飽和補償値R保持部353および飽和補償値B保持部354に飽和補償値が設定される(ステップS922)。そして、以下の処理が各画素を対象として繰り返される(ループL702)。
 ループL702において、処理対象画像の画素および基準画像の画素が取得される(ステップS923)。そして、黒つぶれ度算出部345において黒つぶれ度が算出され(ステップS924)、飽和度算出部355において飽和度が算出される(ステップS925)。そして、さらに以下の処理が各チャンネル(RチャンネルおよびBチャンネル)を対象として繰り返される(ループL703)。
 ループL703において、色変換ゲイン算出部311および312により色変換ゲインが算出される(ステップS926)。このとき、ゲイン上限値B保持部324またはゲイン上限値R保持部323に保持されたゲイン上限値を超えている場合には(ステップS927)、ゲイン上限値によるクリッピング処理が行われる(ステップS928)。ゲイン下限値R保持部333またはゲイン下限値B保持部334に保持されたゲイン下限値を下回っている場合には(ステップS929)、ゲイン下限値によるクリッピング処理が行われる(ステップS931)。これらクリッピング処理は、下限値、上限値の順でも構わない。また、黒つぶれ補償部341または342において、黒つぶれ度に応じた黒つぶれ補償が行われる(ステップS932)。また、飽和補償部351または352において、飽和度に応じた飽和度補償が行われる(ステップS933)。このようにして得られたゲインは、(図示しない)メモリに格納される(ステップS934)。
 ループL703におけるステップS926乃至S934の処理が終了すると、次のチャンネルに関して同様の処理が繰り返される。全てのチャンネルに対する処理が終了すると、ループL703を抜けて次の画素に対する処理が繰り返される。全ての画素に対する処理が終了すると、ループL702を抜けて、1フレーム分のチャンネルゲイン算出処理を終了する。なお、本発明の第1の実施の形態においては、ステップS923とステップS924の間に図12におけるステップS915、ステップS916で行われるデモザイク処理を画素ごとの処理として挿入することが可能である。これにより、図12におけるステップS914乃至ステップS916の処理をループL702内にて併せて行うことができる。
 図14は、本発明の第1の実施の形態におけるチャンネルゲイン適用処理手順(ステップS918)の動作例を示す図である。ここでは、以下の処理が各画素を対象として繰り返される(ループL704)。
 ループL704において、処理対象画像のRGB値(R(p)およびB(p))およびゲイン(FS(p)およびFS(p))が取得される(ステップS937)。これらRGB値とゲインはチャンネル毎に乗算部261および262によって乗算される(ステップS938)。この乗算結果は、ゲイン適用されたモザイク画像Mの画素値としてチャンネル毎に照明成分変換済モザイク画像保持部290の処理対象画像のモザイク画像M上の元画素位置に応じた位置に保持される(ステップS939)。また、ここでいうステップS939の処理は、図12におけるステップS919のことであり、いずれかで処理結果を格納することによって他の処理を省略することができる。
 全ての画素における処理が終了すると、ループL704を抜けて、1フレーム分のチャンネルゲイン適用処理を終了する。なお、本発明の第1の実施の形態においては、ステップS938乃至S939の処理を図13におけるステップS933の直後に挿入することで、図13におけるループL703と図14におけるループL704とを共通のループ処理として構成することができる。また、このとき、ステップS934およびS937は省略される。
 このように、本発明の第1の実施の形態によれば、基準画像の色バランスになるように画素毎のゲインを求めて、これを乗算部261および262によって処理対象画像の各画素に適用することにより、色再現性の高い画像を生成することができる。また、ゲイン算出の際、上限値または下限値の範囲外になった場合には、上限値クリッピング部321、322、下限値クリッピング部331および332においてクリッピング処理を行うことにより、極端なアーチファクトを抑制することができる。また、ゲイン算出の際、黒つぶれや飽和を生じている場合には、黒つぶれ補償部341、342、飽和補償部351および352において補償値との加重平均をゲインとすることで、大きな破綻をしないゲインを得ることができる。
 <2.第2の実施の形態>
 上述の第1の実施の形態においては、乗算部261および262における単純な乗算によりゲイン適用を行った。しかしながら、実際のゲイン適用の際には画素の座標が微妙にずれることがあり、このままでは外乱に対して十分に対応できない場合も生じ得る。そこで、以下では各画素の信頼度に応じて周囲の画素から平滑化を行うことにより、ロバストなゲイン適用を行う例について説明する。なお、前提となる撮像装置および画像処理回路23の構成については第1の実施の形態と同様であるため、説明を省略する。
 [照明成分変換処理部120の構成例]
 図15は、本発明の第2の実施の形態における照明成分変換処理部120の構成例を示す図である。この照明成分変換処理部120の構成例は、デモザイク処理部221からの出力がチャンネルゲイン適用部260に入力されている点において、図5により説明した第1の構成例と異なり、この点以外は第1の構成例と同様の構成となっている。したがって、他の構成については説明を省略する。
 [チャンネルゲイン適用部260の構成例]
 図16は、本発明の第2の実施の形態におけるチャンネルゲイン適用部260の構成例を示す図である。このチャンネルゲイン適用部260の構成例は、除算部421乃至423と、露出補償部431乃至433と、飽和信頼度算出部440と、黒つぶれ信頼度算出部450と、動被写体信頼度算出部460と、信頼度選択部470と、平滑化処理部480とを備える。
 除算部421乃至423は、基準画像と処理対象画像との間の各画素のチャンネル毎の比率Koを生成するものである。一般に、除算は演算コストが高い処理である。したがって、この除算は、演算量削減のために逆数ルックアップテーブルによる処理や、対数に変換した上で減算するなどの手法により実現することが望ましい。
 露出補償部431乃至433は、2枚の画像の撮像条件の違いを補償するための処理を行うものである。この露出補償処理によって、基準画像と処理対象画像内の照明環境が等しく静態した領域での露出強度が等しくなるよう強度調整される。一般に、デジタルカメラの撮像では、等しい照明環境下で同一被写体を撮像しても、絞り、シャッタースピード、センサに対するISO感度設定などに依存して、センサで観測される信号強度が異なる。この露出補償処理は、同条件で撮像された被写体が同じ強度となるようにゲインを調整する処理である。
 この露出補償処理は、簡易的には、Exif情報の各パラメータから計算される露出補償値expCVを比率Koに乗じることで実現される。これにより、補償後の比率Kが得られる。
   K(p)=Ko(p)×expCV
   K(p)=Ko(p)×expCV
   K(p)=Ko(p)×expCV
なお、この露出補償処理は、後段の条件判定において露出補償値分のずれを考慮することで省略することができる。
 飽和信頼度算出部440は、基準画像の信頼度を飽和度の観点から算出するものである。一般に、画像センサにおいて、飽和領域ではセンサの線形特性が成り立たなくなる。さらに完全に飽和し、値が上限値でクリップされたチャンネルに関しては、ゲインを正しく求めることは困難である。そこで、平滑化処理の際に、飽和した画素の重みを下げ、より信頼度の高い周辺画素の情報によってその画素の値を求めることが有効と考えられる。したがって、飽和信頼度ST(p)は、図17で表されるように、ある基準画像の強度Gcが閾値までは1であり、ある閾値を越えたところで強度の上昇とともに急激にその値が下がるような特性が有効と考えられる。また、本手法は処理対象画像の飽和信頼度算出法として用いることもできる。その場合には、Gcに代えてGsが用いられる。
 黒つぶれ信頼度算出部450は、基準画像の信頼度を黒つぶれ度の観点から算出するものである。一般に、画像センサにおいて、黒つぶれ領域ではセンサの特性に線形性が成り立たなくなる。さらに完全に黒つぶれし、値が下限値でクリッピングされたチャンネルでは、ゲインを正しく求めることは困難である。また、そのような破綻は処理対象画像の強度が大きな時に目立つ。そこで、基準画像の画素値が非常に小さい値であり、かつ、処理対象画像の画素値が十分大きな値である画素に対して、平滑化処理の際に重みを下げ、より信頼度の高い周辺画素の情報によってその画素の値を求めることが有効と考えられる。したがって、黒つぶれ信頼度BT(p)は、図18により表される次式のような特性を有する値が有効と考えられる。この式は、基準画像の画素値から黒つぶれ度を算出するものである。また、本手法は処理対象画像の黒つぶれ信頼度算出法として用いることもできる。その場合には、Gcに代えてGsが用いられる。
Figure JPOXMLDOC01-appb-M000010
 また、この黒つぶれ信頼度BT(p)は、図19により表される次式のような特性を有する値であってもよい。この式は、基準画像の画素値および基準画像と処理対象画像とのチャンネル間比率から黒つぶれ度を算出するものである。
Figure JPOXMLDOC01-appb-M000011
 なお、上述の飽和信頼度算出部440および黒つぶれ信頼度算出部450では、Gチャンネルを用いて黒つぶれ度や飽和度の判定を行ったが、これはGチャンネルに限定されるものではない。R、Bチャンネル、またはそれらの最大最小、線形和、輝度値などによる判定も有効である。
 動被写体信頼度算出部460は、基準画像の信頼度を動被写体か否かの観点から算出するものである。この動被写体信頼度算出部460は、フラッシュ非発光および発光の何れの画像でも判別可能な被写体の特性値に注目して、各画素が動被写体かどうかを判定して、動被写体信頼度MT(p)を算出する。そのような特性値としては、例えば、被写体の分光反射率が考えられる。一般に、動被写体では画素の比較が正しく行えないために、ゲインを正しく求めることは困難である。そのような画素では、平滑化処理の際に重みを下げ、より信頼度の高い周辺画素の情報によってその画素の値を求めることが有効と考えられる。
 信頼度選択部470は、飽和信頼度ST(p)、黒つぶれ信頼度BT(p)および動被写体信頼度MT(p)のうち最も信頼度の低いものを選択するものである。これにより、最も疑わしいと判断された信頼度FT(p)が選択されることになる。また、この選択の際には、飽和信頼度ST(p)、黒つぶれ信頼度BT(p)および動被写体信頼度MT(p)の線形和としての信頼度を算出してもよい。
 平滑化処理部480は、このようにして得られた信頼度FT(p)に基づいて平滑化しながら、処理対象画像のRGB値(R(p)およびB(p))に対してゲインFS(p)およびFS(p)を適用する。平滑化処理部480の第1の処理機能例として、領域αにおいて重み付け平滑化を行う場合には次式により実現される。
Figure JPOXMLDOC01-appb-M000012
 このようにしてゲイン適用されたモザイク画像Mは照明成分変換済モザイク画像保持部290に保持される。なお、平滑化処理の他の例については後述する。
 [動被写体信頼度算出部460の構成例]
 図20は、本発明の第2の実施の形態における動被写体信頼度算出部460の構成例を示す図である。この動被写体信頼度算出部460は、比率逆転度算出部461と、比率予測部462と、分光反射率変化量予測部463と、環境光スペクトル色バランス値保持部464と、フラッシュ光スペクトル色バランス値保持部465と、最小値選択部466とを備える。
 環境光スペクトル色バランス値保持部464に保持される環境光スペクトル色バランス値は、基準画像における環境光のスペクトルに対して、無彩色の物体の信号強度が無彩色、すなわちR:G:B=1:1:1となるようなチャンネルごとのゲインである。近似的には、基準画像に対するホワイトバランスWBを用いることができる。一般的には、ホワイトバランスの値としては、絵作りを考慮して無彩色の物体に対して多少の色味を残すゲインが設定されるが、この環境光スペクトル色バランス値は完全にR:G:B=1:1:1とするようなゲインが望ましい。ここでは両者を区別するために、特にWBpcと表記する。
 フラッシュ光スペクトル色バランス値保持部465に保持されるフラッシュ光スペクトル色バランス値は、フラッシュ発光部61によるフラッシュ光のスペクトルに対して、無彩色の物体の信号強度が無彩色となるようなチャンネルごとのゲインである。近似的には、処理対象画像に対するホワイトバランスWBを用いることができる。一般的には、ホワイトバランスの値としては、絵作りを考慮して無彩色の物体に対して多少の色味を残すゲインが設定されるが、このフラッシュ光スペクトル色バランス値は完全にR:G:B=1:1:1とするようなゲインが望ましい。ここでは両者を区別するために特にWBpfと表記する。なお、これらスペクトルに対する色バランス値は撮像装置の内部で計算することによって設定してもよく、また、撮像装置の外部から設定してもよい。環境光についても同様である。
 比率逆転度算出部461は、動被写体信頼度を画素値の変化方向の観点から算出するものである。この比率逆転度算出部461は、画像全体の照明成分変化方向に対して画素値の変化の方向が逆転していることを検出することで、その画素が動被写体であると判断する。フラッシュ発光/非発光の例において、連写された基準画像と処理対象画像において、環境光に変化がないと仮定すると、露出補償部431乃至433により補償された画像では、フラッシュが照射された領域では補償後の比率Kは「1」より大きくなるはずである。また、フラッシュが当たらなかった領域では補償後の比率Kは「1」と等しくなるはずである。したがって、補償後の比率Kが「1」より小さくなる領域では物体が移動したために信号強度が落ちたと推測できるため、図21に示される特性を持たせた関数により比率逆転度MTRK(p)を決定することができる。すなわち、logKが負であって、絶対値が大きくなればなるほどその値が0に近づく特性を有する比率逆転度MTRK(p)が有効と考えられる。
 比率予測部462は、動被写体信頼度を比率Kの予測値の観点から算出するものである。この比率予測部462は、補償後の比率Kの値を予測し、実測値とのずれを計測することによって、動被写体であることを判定する。フラッシュ画像である処理対象画像の照明成分Eは、処理対象画像の照明成分のうち環境光によるものE”とフラッシュ光のみによるものE”pfとの加算によって表される。
   E(p)=E”(p)+E”pf(p)
したがって、比率Koは次式により表される。
Figure JPOXMLDOC01-appb-M000013
 また、照明のスペクトルから求まるホワイトバランスゲインは、分光反射率が無彩色の対象、すなわちρ:ρ:ρ=1:1:1となる対象で、チャンネル強度がR:G:B=1:1:1となるよう色バランスを調整するゲインである。したがって、次式の関係が成り立つ。
Figure JPOXMLDOC01-appb-M000014
 上2式より、RおよびBチャンネルの比率の予測値eKおよびeKは次式のように表すことができる。
Figure JPOXMLDOC01-appb-M000015
 ここで、予測値eKと実測値Kが大きく異なるのは、分光反射率ρが変化し、約分できなかったことが原因と考えられる。これにより、差分絶対値、ΔK=|K-eK|が大きな画素は動被写体であると判断して、図22のような特性を有する予測比率MTEK(p)を設定する。すなわち、ΔK=|K-eK|の値が大きいほど分光反射率ρの変化による影響が大きいとして、平滑化処理の際の重みを小さくしている。なお、この図22における予測比率とは、予測された比率と実際の値の誤差に伴う信頼度を意味する。
 分光反射率変化量予測部463は、動被写体信頼度を分光反射率変化量の予測値の観点から算出するものである。この分光反射率変化量予測部463は、比率予測部462と同様に、Gチャンネルの値に基づいてRおよびBチャンネルの強度比率Kの値を推定する。基準画像と処理対象画像の間で環境光の照明強度がE’に変化したとすると、上述のRおよびBチャンネルの比率の予測値eKおよびeKの式は、次式のように書き換えることができる。
Figure JPOXMLDOC01-appb-M000016
したがって、R、G、Bの比率は次式により近似することができる。
Figure JPOXMLDOC01-appb-M000017
この式は以下の3点が同一直線上に存在することを意味する。
Figure JPOXMLDOC01-appb-M000018
もし、これら3点が同一直線上にない場合には、上述のRおよびBチャンネルの比率の予測値eKおよびeKの式の導出過程においてρがキャンセルできなかったと考えられるため、やはり動被写体と判定することができる。3点が同一直線状にあるか否かは、3点のなす角度θなどにより判定が可能である。したがって、分光反射率変化量MTVR(p)は、θの関数として図23のような特性を持つことが望ましい。すなわち、一直線上並んだ際に、空間平滑化における重みが「1」に近づき、角度θが直角の時に「0」となる。なお、この図23における分光反射率変化量は、分光反射率の変化に伴う信頼度を意味する。
 最小値選択部466は、比率逆転度算出部461、比率予測部462、および、分光反射率変化量予測部463において求められた値の中から最小値を選択して最終的な動被写体信頼度MT(P)として出力するものである。なお、本発明の実施の形態では、比率逆転度算出部461、比率予測部462、および、分光反射率変化量予測部463の全てを用いたが、一部のみを単独でまたは組み合わせて用いてもよい。
 [動作例]
 図24は、本発明の第2の実施の形態におけるチャンネルゲイン適用部260の動作例を示す図である。ここでは、以下の処理が各画素を対象として繰り返される(ループL705)。
 ループL705において、基準画像および処理対象画像のRGB値(Rc(p)、Gc(p)およびBc(p)、Rs(p)、Gs(p)およびBs(p))が取得される(ステップS941)。除算部421乃至423において、基準画像および処理対象画像のRGB値の比率Ko(p)が算出される(ステップS942)。また、露出補償部431乃至433において撮像時の設定による露出の補償処理が行われる(ステップS943)。これにより、照明環境の変化のない静止被写体では比率が「1」となる。
 次に、飽和信頼度算出部440において、飽和信頼度ST(p)が算出される(ステップS944)。黒つぶれ信頼度算出部450において、黒つぶれ信頼度BT(p)が算出される(ステップS945)。また、動被写体信頼度算出部460において、動被写体信頼度MT(p)が算出される(ステップS946)。そして、信頼度選択部470によって、飽和信頼度ST(p)、黒つぶれ信頼度BT(p)および動被写体信頼度MT(p)のうち最も信頼度の低いものが選択される(ステップS947)。こうして得られた信頼度は(図示しない)メモリに格納される(ステップS948)。全ての画素における処理が終了すると、ループL705を抜ける。この本発明の第2の実施の形態においては、ステップS942乃至S948の処理を図13におけるループL703を抜けた直後に挿入することで、図13におけるループL702と図24におけるループL705とを共通のループ処理として構成することができる。すでにステップS923で各画素の値を読み込んでいるため、ステップS941を省略することができる。
 次に、平滑化処理部480において、平滑化処理が画素毎に行われる(ステップS949)。このようにしてゲインが適用された画素値は照明成分変換済モザイク画像保持部290に保持される(ステップS950)。また、ここでいうステップS950の処理は図12におけるステップS919のことであり、いずれかで処理結果を格納することで他の処理を省略することができる。全ての画素における処理が終了すると、1フレーム分のチャンネルゲイン適用処理を終了する。
 図25は、本発明の実施の形態における動被写体信頼度算出部460の動作例を示す図である。ここでは、以下の処理が各画素を対象として行われる。
 まず、露出補償部431乃至433から比率Kが取得される(ステップS951)。また、環境光スペクトル色バランス値保持部464から基準画像における環境光の色バランスが取得され、フラッシュ光スペクトル色バランス値保持部465からフラッシュ光の色バランスが取得される(ステップS951)。
 そして、比率逆転度算出部461において、画像全体の強度の変化の方向と画素の強度の向きの逆転が判定され、その度合いに応じて比率逆転度が算出される(ステップS952)。また、比率予測部462において、比率Kの実測値と推定値の乖離の度合いから動被写体か否が判定され、予測比率が決定される(ステップS953)。比率予測時には分光反射率ρが分母分子でキャンセルすることを仮定しているため、予測との乖離は分光反射率の変化を検知したことになり、動被写体だと判定している。また、分光反射率変化量予測部463において、色バランスの予測値と実測値とのずれから分光反射率変化量が予測される(ステップS954)。そして、最小値選択部466において、比率逆転度算出部461、比率予測部462、および、分光反射率変化量予測部463において求められた値の中から最小値が選択される(ステップS955)。この選択された値は、最終的な動被写体信頼度MT(P)として出力される。
 このように、本発明の第2の実施の形態によれば、黒つぶれ、飽和、または、動被写体の観点から各画素に対する信頼度を判定し、平滑化の際に信頼度の低い画素の重みを下げて、周辺画素の情報を利用することができ、ロバストなゲイン適用を行うことができる。
 この第2の実施の形態では、平滑化処理の際に単純な重み付け平滑化を行う例について説明したが、エッジ保存型平滑化を適用することもできる。エッジ保存平滑化とは、画像中の物体境界などの顕著な段差は残しつつ、階調を平滑化する非線形フィルタ処理である。視認性に影響する物体輪郭を保存しながら微細な変動を除去するため、古くからノイズリダクション処理に用いられている。このエッジ保存平滑化処理は、物体内のテクスチャの微細な輝度変動と物体輪郭の顕著な輝度段差とを分離できる性質を利用して、テクスチャに代表されるディテール成分以外の輝度差を圧縮する階調補正処理にも用いられている。
 そのようなエッジ保存平滑化処理の中で、近年バイラテラルフィルタと呼ばれる技術がよく利用されている。一般に、画像の輝度I(p)に対するバイラテラルフィルタBLF(p)は、次式のように、空間方向の重み関数ω(p-pc)と輝度値方向の重み関数φ(I(p)-I(pc))の2つで重み付けした中心画素位置pcの周囲の画素値I(p)を加算する。
Figure JPOXMLDOC01-appb-M000019
上式において、右辺の分母は重み値の正規化係数を示す。
 上式に示されるように、バイラテラルフィルタでは局所領域中の各画素に対する重み付けが中心画素の輝度値に依存して変わる。そのため、画素毎に重み値を算出しなおす必要があるため、通常の線形なFIRフィルタなどに比べて演算量がはるかに大きくなるという問題がある。また、バイラテラルフィルタの応用技術として、ジョイントバイラテラルフィルタまたはクロスバイラテラルフィルタと呼ばれる技術が提案されている。バイラテラルフィルタでは局所領域中の各画素に対する重み付けがフィルタ処理対象である中心画素の輝度値に依存して変わったのに対して、ジョイントバイラテラルフィルタでは重み計算に用いる特性値とフィルタ処理対象の特性値が異なる。ジョイントバイラテラルフィルタJBLF(p)による式は次式のようになる。
Figure JPOXMLDOC01-appb-M000020
 上式は、空間方向の重み関数ω(p-pc)と輝度値方向の重み関数φ(I(p)-I(pc))の2つで重み付けした中心画素位置pcの周囲の画素値S(p)を加算する演算を表している。例えば、非常にS/N特性の悪い信号Sに対して相関が高く、S/N比の高い信号Iがあった時に、I信号に応じた重み付けを行うことによって、S/N比の良いエッジ保存型のフィルタ処理が可能になる。
 また、ジョイントバイラテラルフィルタにおいて、バイラテラルフィルタと同様に、局所領域中の各画素に対する重み付けが中心画素の輝度値に依存して変わる。そのため、画素毎に重み値を算出しなおす必要があるため、通常の線形なFIRフィルタなどに比べて演算量がはるかに大きいという問題がある。
 そこで、以下の第3の実施の形態では、ブロックヒストグラムを利用することにより、エッジ保存型平滑化の演算量を減少させる手法を提案する。
 <3.第3の実施の形態>
 本発明の第3の実施の形態では、空間軸および輝度軸にて複数に分割した各ブロックで画素頻度値および定義されたある特性値を算出した後、各画素位置と各ブロック間の距離で定義される重みに基づいて、ブロック毎の特性値を重みつき加算する。特性値としては、ブロック毎の内部に含まれる画素のゲインの積分値(総和)や、内部に含まれる画素のゲインの中央値に内部に含まれる画素の画素数を乗じたものなどを用いることができる。この演算を数式で表すと次式のようになる。
Figure JPOXMLDOC01-appb-M000021
ここで、i,jは空間軸方向のブロックのインデックスである。また、λはブロックに該当する輝度範囲の中央値である。 I(pc)は座標位置pcにおける輝度の値である。S(i,j,λ)はブロック(i,j,λ)のゲインの積分値である。H(i,j,λ)はブロックヒストグラムの値である。上式はジョイントバイラテラルフィルタの空間軸の重み関数ωと輝度軸の重み関数φをブロックの分割に沿って階段上に離散化したものに相当するため、エッジ保存平滑化の効果がある。さらに、ブロックヒストグラムおよびブロック積分値を算出するコストを差し引いても、ブロック毎の加重積和は画素毎の加重積和に比べればはるかに演算量を小さくすることができる。この効果は、エッジ保存平滑化のオペレータサイズが巨大であるほど大きい。
 さらに本発明の第3の実施の形態では、上記重みに加えて画素位置毎に定まる重みτ(p)を導入したエッジ保存型平滑化処理を提案する。ブロックヒストグラムおよびブロック内部の特性値の重み付き積分は以下のように表される。
Figure JPOXMLDOC01-appb-M000022
Figure JPOXMLDOC01-appb-M000023
ここで、ISW(i,j,λ)はブロック(i,j,λ)内部の重み付きゲイン積分値、IFT(i,j,λ)はブロック(i,j,λ)内の重み付き頻度値、すなわち重み自身の積分値である。これを前式に適用すると、次式を得る。
Figure JPOXMLDOC01-appb-M000024
この演算は、次式で表現される重み付きジョイントバイラテラルフィルタの空間軸の重み関数ωと輝度軸の重み関数φをブロックの分割に沿って階段上に離散化したものに相当する。
Figure JPOXMLDOC01-appb-M000025
したがって、エッジ保存平滑化の効果がある。さらに、ブロック積分値を算出するコストを差し引いても、ブロック毎の加重積和は画素毎の加重積和に比べればはるかに演算量が小さくできる。この効果は、エッジ保存平滑化のオペレータサイズが巨大であるほど大きい。
 さらに、本発明の第3の実施の形態では、演算量を減らす手法を提供する。すなわち、ブロックヒストグラムおよびブロック毎のゲイン積分値に対して、あらかじめ輝度軸方向の重み関数を畳み込む演算を行い、その結果を保持しておく。この場合、ブロックヒストグラムへの畳み込み演算は次式のようになる。
Figure JPOXMLDOC01-appb-M000026
また、ブロック積分値への畳み込み演算は次式のようになる。
Figure JPOXMLDOC01-appb-M000027
画素毎の加重積和演算では、すでに輝度重み関数が畳み込まれたブロックヒストグラムおよび重み付きゲイン積分値を空間方向に補間した結果を、除算するだけでよい。この演算は、次式のようになる。
Figure JPOXMLDOC01-appb-M000028
この効果は、元の画像サイズに比べてブロック分割数が粗い場合、すなわち画像中の広い範囲をみて平滑化処理を行う場合ほど大きい。
 さらに、本発明の第3の実施の形態では、上述のブロックヒストグラム、ブロック毎のゲイン積分値、または、それらを輝度軸重み関数で畳み込んだものをメモリに格納する。これにより、次に入力されるフレームにおけるエッジ保存平滑化処理に利用する手法を提供する。すなわち、入力が動画データである場合は全画素を2回スキャンすることなく、巨大なエッジ保存平滑化を少ないワーキングメモリで実行することが可能となる。
 さらに、本発明の第3の実施の形態では、上述のブロックヒストグラム、ブロック毎のゲイン積分値、または、それらを輝度軸重み関数で畳み込んだものを算出する処理の前に入力画像を縮小する処理を行う。これにより、ブロックヒストグラム、ブロック毎のゲイン積分値、または、それらを輝度軸重み関数で畳み込んだものを算出する演算量およびメモリ量を削減する。
 なお、この第3の実施の形態においては、前提となる撮像装置、画像処理回路23および照明成分変換処理部120の構成については第2の実施の形態と同様であるため、説明を省略する。
 [平滑化処理部480の処理機能例]
 図26は、本発明の第3の実施の形態における平滑化処理部480の処理機能例を示す図である。この平滑化処理部480の処理機能例は、乗算部511および512と、輝度算出部521と、非線形変換部522とを備えている。また、この平滑化処理部480の第2の処理機能例は、ブロック積分値算出部531および532と、ブロックヒストグラム算出部533と、ブロック積分値保持部541および542と、ブロックヒストグラム保持部543とを備えている。また、この平滑化処理部480の第2の処理機能例は、位相補償処理部551および552と、加重積和部561および562と、ゲイン適用部571および572とをさらに備えている。
 輝度算出部521は、処理対象画像のRGB値から輝度値L(p)を算出するものである。この輝度算出部521は、例えば、RGB値に対して予め設定された係数(重み)によってRGB値の線形和を演算することにより、輝度値を算出するものでよい。また、この輝度算出部521は、例えば、RGB値の中から最大値を求めるような処理により、輝度値を生成してもよい。
 非線形変換部522は、輝度算出部521により算出された輝度値を非線形変換して、非線形変換輝度値L(nl)(p)を出力するものである。この非線形変換部522は、例えば、γカーブ、1より小さい指数によるべき乗特性や対数変換などの「上に凸の単調増加特性」を適用することが有用である。
 乗算部511および512は、チャンネル毎のゲインFS(p)に対して当該画素の信頼度FT(p)を乗じることにより、チャンネル毎の重み付きゲインSW(p)を生成するものである。
 ブロック積分値算出部531および532は、画像を空間軸方向および輝度軸方向に複数のブロックに分割して、各ブロックに属する特性値の積分値を算出するものである。ここにいう特性値とは、信頼度FT(p)により重み付けられたRおよびBチャンネルの重み付きゲインSW(p)およびSW(p)である。このブロック積分値算出部531および532により算出された積分値は、ブロック積分値保持部541または542に格納される。すなわち、ブロック積分値保持部541は、Rチャンネルの重み付きゲインISW(r)を保持する。ブロック積分値保持部542は、Bチャンネルの重み付きゲインISW(r)を保持する。
 ブロックヒストグラム算出部533は、上記分割された各ブロックに属する信頼度FT(p)を積分して、画素の頻度値をブロックヒストグラムとして算出するものである。このブロックヒストグラム算出部533により算出されたブロックヒストグラムIFT(r)は、ブロックヒストグラム保持部543に格納される。以下では、ブロック積分値保持部541、542、および、ブロックヒストグラム保持部543に保持された情報を中間データとも称する。
 位相補償処理部551および552は、当該画素の各チャンネルが対応する処理対象画像のモザイク画像上の位置に応じた輝度値を算出するものである。簡易デモザイクでは、ベイヤーセット602毎に位置601に輝度値が求まっている。この位相補償処理部551および552による処理は、モザイク画像上の各画素位置に対する近傍4つの輝度値からの線形補間処理によって実現することができる。簡易デモザイクではなく画素毎にデモザイクした場合には、輝度算出部521および非線形変換部522により処理対象画像のモザイク画像の画素毎に輝度が求まっているため、この位相補償処理を省略することができる。
 加重積和部561および562は、ブロックヒストグラムとブロック積分値と当該画素位置の輝度値とから当該画素位置の大局ゲイン値を算出するものである。大局ゲイン値とは、当該画素位置が属する物体領域の平均ゲインに相当する情報である。加重積和部561は大局ゲイン値SWlR(p)をゲイン適用部571に供給し、加重積和部562は大局ゲイン値SWlB(p)をゲイン適用部572に供給する。
 ゲイン適用部571および572は、加重積和部561および562により算出されたゲインを各チャンネル値に適用するものである。このゲイン適用部571および572における処理は、一般的には乗算により実現することができる。すなわち、ゲイン適用部571および572は、それぞれ次式のような演算を行う。
   R(p)=R(p)×SWlR(p)
   B(p)=B(p)×SWlB(p)
なお、加重積和部561、562、ゲイン適用部571、572は、請求の範囲に記載の平滑化処理部の一例である。
 [ブロック積分値算出部531、532およびブロックヒストグラム算出部533の構成例]
 図27は、本発明の第3の実施の形態におけるブロック積分値算出部531、532およびブロックヒストグラム算出部533の構成例を示す図である。このブロック積分値算出部531、532およびブロックヒストグラム算出部533の各々は、ブロック選択部534と、n個の積分器535-1乃至nとを備えている。ここで、画像の幅方向のブロック分割数をW、画像の高さ方向のブロック分割数をH、画像の輝度方向のブロック分割数をDとすると、ブロック数nはW×H×Dとなる。
 ブロック選択部534は、入力される各画素の重み付き特徴量を、画素位置と輝度値によってn個のブロックの何れかに分類するものである。ここでいう重み付き特徴量とは、信頼度FT(p)により重み付けされたR、Bチャンネル用のゲインSW(p)、SW(p)または信頼度FT(p)である。
 積分器535-1乃至nは、分類された重み付き特徴量を加算するものである。この積分器535-1乃至nの各々は加算部536およびレジスタ537を保持する。加算部536は、分類された重み付き特徴量とレジスタ537に保持された値とを加算するものである。レジスタ537は加算部536の出力を保持するものである。1フレーム分の画素を処理した後、全ブロックの積分器535-1乃至nの値がブロック積分値保持部538に格納される。ここで、ブロック積分値保持部538は、ブロック積分値保持部541、542またはブロックヒストグラム保持部543に相当する。
 [加重積和部561および562の構成例]
 図28は、本発明の第3の実施の形態における加重積和部561および562の構成例を示す図である。この加重積和部561および562の各々は、補間部563および564と、空間重み関数テーブル保持部565と、積和部566および567と、輝度重み関数テーブル保持部568と、除算部569とを備える。
 補間部563および564は、入力された輝度値の画素位置に対応する重み付き特徴量を補間するものである。すなわち、補間部563は、当該画素位置の空間方向近傍4x4ブロック領域の重み付きゲインSW(r)またはSW(r)のブロック積分値ISW(r)またはISW(r)を補間する。補間部564は、当該画素位置の空間方向近傍4x4ブロック領域の信頼度FT(p)自身のブロック積分値IFT(r)を補間する。その際の補間係数には、例えば、3次B-spline関数などが適している。このB-Spline関数値を空間重み関数テーブルとして、空間重み関数テーブル保持部565に保持しておいて、近傍のブロック位置と当該画素位置の相対位置関係に基づいて必要な係数を取り出せるようにすることができる。補間部563および564が行う演算は、次式のようになる。
Figure JPOXMLDOC01-appb-M000029
Figure JPOXMLDOC01-appb-M000030
ここで、i,jは近傍4x4ブロックを示すインデックスである。λはヒストグラムの各ブロックに該当する輝度レベルの中央値である。B_i,jはインデックスi,jに該当するブロックに対するB-Spline補間係数である。ISW(i,j,λ)、ISW(i,j,λ)は、(i,j,λ)に該当するブロックの重み付きゲインSW(p)またはSW(p)のブロック積分値である。IFT(i,j,λ)は、(i,j,λ)に該当するブロックの信頼度FT(p)自身に対する積分値(ブロックヒストグラム)である。なお、補間部563は、請求の範囲に記載の第1の補間部の一例である。また、補間部564は、請求の範囲に記載の第2の補間部の一例である。
 積和部566および567は、当該画素位置に対応する重み付き積分値に対して、輝度加重値を積和した結果を算出するものである。輝度加重値は、輝度重み関数テーブル保持部568に格納されたテーブルを用いて算出される。図29は、輝度重み関数テーブル保持部568に格納された輝度重み関数の形状の一例を示す図である。輝度重み関数は、入力された当該画素位置の輝度値L(nl)(p)と、当該画素位置に補間された積分値の各ブロックに相当する輝度レベルλとの差分値が小さいほど大きな値を持つ単峰性形状の関数が適切である。例えば、次式に示されるような関数を用いることができる。
Figure JPOXMLDOC01-appb-M000031
ここで、σ_thは、この関数の裾野の広がりの大きさを決める定数値である。このような輝度重み関数を用いることによって、入力された輝度値L(nl)(p)に近い値を持つブロックに対して大きな重み値をつけ、離れた値を持つブロックに対して小さな重み値をつけることができる。積和部566および567は、各ブロックへの重み値を輝度重み関数と入力輝度値により算出した後、当該画素位置に補間された重み自身および重み付きゲイン積分値の全ブロックの値を各重みによって加重和する。除算部569は、積和部566によって算出された重み付きゲイン値を、積和部567によって算出された信頼度で除算して、その結果を当該画素位置の大局ゲイン値として出力するものである。積和部566、567および除算部569が行う演算は次式のようになる。
Figure JPOXMLDOC01-appb-M000032
なお、積和部566は、請求の範囲に記載の第1の積和部の一例である。また、積和部567は、請求の範囲に記載の第2の積和部の一例である。また、除算部569は、請求の範囲に記載の第2の除算部の一例である。
 ブロック積分値には、ブロック領域毎に近い値を有する画素の重み付きゲインおよび信頼度自身がブロック毎に積分されている。したがって、上記のように当該画素位置の輝度値に近い輝度レベルのブロックに重みをおいた積和を行うことによって、周囲4x4ブロック領域の中でも特に近い輝度値の画素の積分結果を得ることになる。したがって、周囲4x4ブロック領域のように広範囲な領域を積分しても異なる明るさの別の被写体にかかる画素値の影響は少なく、当該画素が属する被写体の平均ゲイン値を算出することができる。
 なお、補間部564は、請求の範囲に記載の第1の補間部の一例である。また、補間部563は、請求の範囲に記載の第2の補間部の一例である。また、積和部567は、請求の範囲に記載の第1の積和部の一例である。また、積和部566は、請求の範囲に記載の第2の積和部の一例である。
 [動作例]
 図30および31は、本発明の第3の実施の形態における平滑化処理部480の動作例を示す図である。
 ここでは、まず、ステップS961乃至S967の処理が各画素を対象として繰り返される(ループL707)。このループL707において、処理対象画像のRGB値が取得される(ステップS961)。また、対応画素のゲインFS(p)、FS(p)および信頼度FT(p)が取得される(ステップS962)。そして、輝度算出部521において、輝度値L(p)が算出される(ステップS963)。この輝度値L(p)は、非線形変換部522において非線形変換されて、非線形変換輝度値L(nl)(p)が出力される(ステップS964)。
 そして、ブロック積分値算出のための処理が行われる(ステップS965)。具体的には、乗算部511および512において、ゲインFS(p)およびFS(p)と信頼度FT(p)との乗算が行われる。また、ブロック積分値算出部531および532において、当該画素位置におけるR、Bチャンネルに対するゲインのブロック積分値が更新される(ステップS966)。また、ブロックヒストグラム算出部533において、当該画素位置におけるブロックヒストグラムに相当する信頼度自身のブロック積分値が更新される(ステップS966)。そして、当該画素の輝度値が(図示しない)メモリに格納される(ステップS967)。
 ループL707のステップS961乃至S967の処理が終了すると、次の画素位置に対する処理が繰り返される。全ての画素位置に対する処理が終了すると、ループL707を抜けて、1フレーム分のブロック積分値およびブロックヒストグラムがそれぞれブロック積分値保持部541、542およびブロックヒストグラム保持部543に格納される(ステップS968)。また、本発明の第3の実施の形態においては、ステップS962乃至S967の処理を図24におけるステップS947の直後に挿入することで、図24におけるループL705と図30におけるループL707とを共通のループ処理として構成することができる。すでにステップS941で各画素の値を読み込んでいるためステップS961は省略することができる。また、信頼度に関しても、ステップS947において選択された値を直接使うことによって、ステップS948およびS962における信頼度の格納や、読出し処理を省略することができる。
 次に、以下の処理が各画素を対象として繰り返される(ループL708)。このループL708において、当該画素周囲の輝度値をメモリ(図示しない)から読み出す。また、当該画素周囲の信頼度自身に対するブロック積分値がブロックヒストグラム保持部543から読み出される(ステップS971)。そして、以下の処理が各チャンネル(RおよびBチャンネル)を対象として繰り返される(ループL709)。
 ループL709において、当該チャンネルに対する重み付きゲインのブロック積分値がブロック積分値保持部541または542から読み出される(ステップS972)。そして、位相補償処理部551または552において、モザイク画像上の当該チャンネルの画素位置に応じた輝度値が算出される(ステップS973)。また、加重積和部561または562において、当該画素チャンネルに対するゲインがブロック積分値の加重積和演算によって算出される(ステップS974)。そして、ゲイン適用部571または572において、加重積和により求められたゲインが当該チャンネルに適用される(ステップS975)。このようにしてゲイン適用された画素値はチャンネル毎に照明成分変換済モザイク画像保持部290の当該画素位置に格納される(ステップS976)。また、ここでいうステップS976の処理は図12におけるステップS919および図24におけるステップS950のことであり、いずれかで処理結果を格納することで他の処理を省略することができる。
 ループL709においてステップS972乃至S976の処理が終了すると、次のチャンネルに対して同様の処理が繰り返される。全てのチャンネルに対する処理が終了すると、ループL709を抜けて、次の画素に対して同様の処理が繰り返される。全ての画素位置に対する処理が終了すると、ループL708を抜けて、1フレーム分の平滑化処理が終了する。
 図32は、本発明の第3の実施の形態におけるブロック積分値算出部531、532およびブロックヒストグラム算出部533の動作例を示す図である。
 ここでは、ステップS981乃至S983の処理が各画素を対象として行われる。まず、当該画素位置の輝度値および重み付き特徴量が非線形変換部522、乗算部511および512から取得される(ステップS981)。そして、ブロック選択部534によってn個のブロックの中から当該画素位置が含まれるブロックが何れであるかが判別される(ステップS982)。そして、該当する積分器535-1乃至nにおいて、当該画素の重み付き特徴量が加算される(ステップS983)。
 図33は、本発明の第3の実施の形態における加重積和部561および562の動作例を示す図である。
 まず、当該画素位置の輝度が取得される(ステップS991)。そして、補間部563において、輝度の等しい空間方向の周囲4x4のブロック積分値情報から当該画素位置の重み付きゲイン積分値が補間によって輝度方向の分割毎に算出される(ステップS992)。また、補間部564において、輝度の等しい空間方向の周囲4x4のブロックヒストグラムに相当する当該画素位置の信頼度自身の積分値が補間によって輝度方向の分割毎に算出される(ステップS993)。
 次に、積和部566において、当該画素位置に補間された重み付きゲイン積分値に輝度加重値を積和した結果が算出される(ステップS994)。また、積和部567において、当該画素位置に補間された信頼度自身の積分値(ブロックヒストグラム)に輝度加重値を積和した結果が算出される(ステップS995)。
 次に、除算部569において、積和部566によって積和された重み付きゲイン積分値が積和部567によって積和された信頼度自身の積分値により除算される(ステップS996)。そして、除算部569の算出結果は、当該画素位置の大局ゲイン値として出力され(ステップS997)、1画素に対する加重積和処理が終了する。
 このように、本発明の第3の実施の形態によれば、ブロック領域毎に近い値を有する画素の重み付きゲインおよび信頼度自身をブロック毎に積分したブロック積分値を利用することにより、エッジ保存型平滑化の演算量を減少させることができる。また、本発明の実施の形態では、加重積和の順序として空間平滑化の次に輝度方向の平滑化を行う順番で行ったが、輝度方向平滑化の次に空間平滑化の順番でも構わない。また、数26から数28で示したように、あらかじめ輝度方向の平滑化を済ませた重み付きゲインをブロック積分値として保持しておくことで画素ごとの演算を減らすこともできる。
 なお、上述の実施の形態ではGチャンネルのゲインを「1」に固定した時のR、Bチャンネルのゲインを求めているが、輝度を固定した時などのゲインではGチャンネルについてもゲインを適用する必要がある。その際には、Gチャンネルに対しても本実施の形態の手法が有効に機能する。
 <4.第4の実施の形態>
 本発明の範疇で、照明成分変換処理は、別の形態として、入力画像に対して解像度変換した上で比較する処理を備えることができる。照明成分変換処理における中間データは画像全体の大局的な照明分布や構造などを抽出したものであるため、事前に縮小された画像から中間データを算出してもそれらの情報が損なわれることがなく、演算量を減らすことができる。また、縮小した後に比較することにより、動被写体の影響を抑えることができる。さらに、解像度変換処理部導入により、LCDに向けて出力しているモニタ画像などが使用可能となる。その結果、基準モザイク画像としてモニタ画像を使用した際には、フラッシュ発光、非発光の連写撮影することなく色再現性の高い画像を生成することができるとともに、メモリの節約にも寄与する。入力画像を縮小する方法としては、縮小画像の各画素位置に対応する処理対象画像のモザイク画像上の領域に属する画素の単純平均のように、比較的簡単な方法でよい。
 なお、この第4の実施の形態においては、前提となる撮像装置および画像処理回路23の構成については第3の実施の形態と同様であるため、説明を省略する。
 [照明成分変換処理部120の構成例]
 図34は、本発明の第4の実施の形態における照明成分変換処理部120の構成例を示す図である。この照明成分変換処理部120は、第3の実施の形態と同様に、デモザイク処理部221および222と、ホワイトバランス算出部230と、基準画像ホワイトバランス保持部240と、チャンネルゲイン算出部250と、チャンネルゲイン適用部260とを備える。この例において、チャンネルゲイン算出部250は、図15のチャンネルゲイン算出部250とは入出力が異なり、解像度変換後の値になるが、それ以外は同様の操作が行われる。この照明成分変換処理部120は、さらに、解像度変換部271および272を備える。
 解像度変換部271および272は、入力画像サイズの変更を行うものである。解像度変換の大きな目的は、画像を縮小することにより、動被写体などによる照明環境の変化以外の差分の影響を抑制することである。別の目的としては、入力画像のサイズを基準画像と処理対象画像との間で合致させることがあげられる。LCDに出力されるモニタ画像は、通常処理で撮像された画像よりも解像度が小さいことが一般的である。そのため、2枚の画像サイズが異なり、上述のゲイン算出をそのまま使用することができない。この問題を解決するためには、基準画像と処理対象画像のサイズを揃えるための解像度変換をした上で比較する手法が有効である。その際、解像度変換部271および272で行われる処理が拡大縮小の何れになるかは、基準画像および処理対象画像の画像サイズの大小関係により決定される。解像度変換部271および272で行われる処理が拡大処理の時には、エッジ保存型平滑化フィルタ処理による拡大処理が有効である。通常の平滑化処理では物体の境界において照明環境が大きく異なる場合にも平滑化処理が進むために、境界で色のにじみが発生してしまう。解像度変換部271および272で行われる処理が縮小処理の時には、縮小画像の各画素位置に対応する原画像上のブロック領域に属する画素の単純平均、中央値、間引き処理のように、比較的簡単な方法でよい。また、解像度変換部271および272における解像度変換処理は、デモザイク処理部221および222で行われるデモザイク処理と同時に行うことによって演算量を削減することができる。また、解像度変換部271および272における解像度変換処理と、デモザイク処理部221および222で行われるデモザイク処理との順序を入れ替えてもよく、その場合にも演算量を削減することができる。
 [チャンネルゲイン適用部260の構成例]
 図35は、本発明の第4の実施の形態におけるチャンネルゲイン適用部260の構成例を示す図である。このチャンネルゲイン適用部260は、図16において説明した第2の実施の形態におけるものと同様の構成を備える。ただし、信頼度生成の際には縮小画像が用いられ、それぞれ縮小された基準画像BR(q)、BG(q)、BB(q)、および縮小された処理対象画像BR(q)、BG(q)、BB(q)が入力される。また、平滑化処理部480においては、処理対象画像R(p)、G(p)、B(p)の他、縮小された処理対象画像BR(q)、BG(q)、BB(q)、縮小画像に基づく信頼度BFT(q)、縮小画像のゲインBFS(q)、BFS(q)が入力される。ここで、pおよびqは各画素を表す。
 [平滑化処理部480の構成例]
 図36は、本発明の第4の実施の形態における平滑化処理部480の構成例を示す図である。この平滑化処理部480は、図26により説明した第3の実施の形態のものと同様の構成を備えている。ただし、ブロック積分値の算出のために用いられる画像は縮小画像となっている。すなわち、乗算部511および512に入力されるのは、縮小画像のゲインBFS(q)、BFS(q)および縮小画像に基づく信頼度BFT(q)である。また、輝度算出部523に入力されるのは、縮小された処理対象画像BR(q)、BG(q)、BB(q)である。
 一方、加重積和される処理対象画像のサイズはそのままである。すなわち、輝度算出部521に入力されるのは、処理対象画像R(p)、G(p)、B(p)である。また、ゲイン適用部571および572に入力されるのは、それぞれ処理対象画像R(p)、B(p)である。
 [動作例]
 図37は、本発明の第4の実施の形態における照明成分変換処理部120の動作例を示す図である。この動作例は、図12により説明した第1の実施の形態におけるものと基本的には同様である。ただし、解像度変換部271および272において、基準画像および処理対象画像の縮小処理が行われる(ステップS821およびS822)。また、チャンネルゲイン適用部260において、処理対象画像に合わせてゲインが拡大されて、各チャンネルに適用される(ステップS818)。この時、当該画素が、黒つぶれ、白とびしていないか、動被写体か否かの判定から信頼度が設定され、エッジ保存型の平滑化フィルタにより各チャンネルの元の画素位置を考慮して空間平滑化したゲインが適用される。
 図38は、本発明の第4の実施の形態におけるチャンネルゲイン適用部260の動作例を示す図である。この動作例は、図24により説明した第2の実施の形態におけるものと基本的には同様である。ただし、縮小画像に基づいて信頼度の算出を行う点が異なる。そのため、ループL705に相当するループL714の処理が縮小画素毎の処理となる。また、ループL702とループL705を共通のループにすることができたように、縮小画像に対するチャンネルゲイン算出部250で行うループL702に相当する処理とループ714の処理はあわせて大きなループ処理にすることができる。また、ブロック積分値の算出のために用いられる画像も縮小画像となっている(ステップS841)。すなわち、乗算部511および512に入力されるのは、縮小画像のゲインBFS(q)、BFS(q)および縮小画像に基づく信頼度BFT(q)である。また、輝度算出部523に入力されるのは、縮小された処理対象画像BR(q)、BG(q)、BB(q)である。また、ここでいうステップS850の処理は図37におけるステップS819のことであり、いずれかで処理結果を格納することで他の処理を省略することができる。
 この平滑化では各画素における当該チャンネルの処理対象画像のモザイク画像上での画素位置に応じた平滑化が望ましく、その結果、処理対象画像のモザイク画像のサイズに合わせて拡大しながら適用する処理となる。この際、エッジ保存型平滑化処理と拡大処理は別々に行うことができるが、演算量削減等の観点から同時に行うことが望ましい。
 図39および40は、本発明の第4の実施の形態における平滑化処理部480の動作例を示す図である。この動作例は、図30および31により説明した第3の実施の形態におけるものと基本的には同様である。ただし、ブロック積分値の算出のために用いられる画像は縮小画像となっている。すなわち、乗算部511および512に入力されるのは、縮小画像のゲインBFS(q)、BFS(q)および縮小画像に基づく信頼度BFT(q)である。また、輝度算出部523に入力されるのは、縮小された処理対象画像BR(q)、BG(q)、BB(q)である。また、加重積和される処理対象画像のサイズはそのままである。そのため、輝度算出部521において、処理対象画像R(p)、G(p)、B(p)から輝度が算出され(ステップS872)、非線形変換部522において非線形変換が行われる(ステップS873)。この非線形変換された輝度に対して、位相補償処理が行われる(ステップS875)。また、加重積和部561および562において当該画素チャンネルに対するゲインをブロック積分値の加重積和演算により算出する際(ステップS876)、ブロック積分値と当該画素の距離を縮小前の処理対象画像のモザイク画像の解像度で考えることが重要である。また、ここでいうステップS878の処理は図37におけるステップS819、図38におけるステップS850のことであり、いずれかで処理結果を格納することで他の処理を省略することができる。また、本発明の第4の実施の形態においては、ステップS862乃至S866の処理を図38におけるステップS847の直後に挿入することで、図38におけるループL714と図39におけるループL715とを共通のループ処理として構成することができる。すでにステップS841で各画素の値を読み込んでいるため、ステップS861を省略することができる。また、信頼度に関しても、ステップS847にて選択された値を直接使うことでステップS848およびS862における信頼度の格納や読出し処理を省略することができる。
 このように、本発明の第4の実施の形態によれば、縮小画像を用いることにより全体的な演算量を減少させるとともに、動被写体による影響を抑制することができる。
 <5.第5の実施の形態>
 また、照明成分変換処理の他の態様として、以下に説明するような別の態様をとることも可能である。ここまでに説明した照明成分変換処理では、デジタルカメラによって撮像された単独の画像を基準画像および処理対象画像としてきた。以下に説明するのは、フレームメモリを備え、複数の画像から合成入力画像を生成することにより、フラッシュ発光または非発光以外のシーンにも対応する実施の形態である。
 なお、この第5の実施の形態においては、前提となる撮像装置および画像処理回路23の構成については第4の実施の形態と同様であるため、説明を省略する。
 [照明成分変換処理部120の構成例]
 図41は、本発明の第5の実施の形態における照明成分変換処理部120の構成例を示す図である。この照明成分変換処理部120は、第4の実施の形態と同様に、デモザイク処理部221および222と、ホワイトバランス算出部230と、基準画像ホワイトバランス保持部240と、チャンネルゲイン算出部250と、チャンネルゲイン適用部260とを備える。この照明成分変換処理部120は、さらに、フレーム加算部280を備える。このフレーム加算部280は、複数の画像から合成入力画像を生成するものである。
 [フレーム加算部280の構成例]
 図42は、本発明の第5の実施の形態におけるフレーム加算部280の構成例を示す図である。このフレーム加算部280は、加算部281および282と、基準モザイク画像保持部283と、処理対象モザイク画像保持部284と、制御パラメータ決定部285とを備える。
 基準モザイク画像保持部283および処理対象モザイク画像保持部284は、過去に撮像された画像、および、それらの加算結果を保持するものである。これら基準モザイク画像保持部283および処理対象モザイク画像保持部284には、時間方向に積分された画像が保持されていく。また、これら基準モザイク画像保持部283および処理対象モザイク画像保持部284には、より広い強度範囲で正確な色バランスを保持するために、各チャンネル16ビット等の精度による高ダイナミックレンジ(HDR)画像を保持することが望ましい。
 加算部281は、新規基準モザイク画像保持部213からの画像と基準モザイク画像保持部283に保持された画像を加算するものである。加算部282は、新規処理対象モザイク画像保持部214からの画像と処理対象モザイク画像保持部284に保持された画像を加算するものである。
 制御パラメータ決定部285は、フレームメモリ内の画像および新規撮像画像によって新規撮像を行うか否か、ならびに、撮像時の制御パラメータを決定するものである。この制御パラメータとしては、手ブレや被写体ブレが生じないように十分高速なシャッタ速度が採用されることが望ましい。また、この制御パラメータ決定部285は、処理対象画像を撮像する際の露出設定パラメータや処理対象画像の値から、全画素位置に対して、飽和や黒つぶれのない適切なRGB色バランスを取得できるように露出を変化させながら連写を行うよう制御する。
 また、この制御パラメータ決定部285は、基準モザイク画像保持部283および処理対象モザイク画像保持部284に保持された画像から、フリッカーを検出し、その影響がなくなるまで撮像を繰り返す制御を行う。
 また別の制御方法として、制御パラメータ決定部285において、基準モザイク画像保持部283および処理対象モザイク画像保持部284に保持された画像から、黒つぶれまたは飽和を検出してもよい。そして、その影響がなくなるまで露出を変化させながら撮像を繰り返すことにより、広ダイナミックレンジ画像を生成することができる。
 なお、加算部281および282では、ブロックマッチングなどにより正確な位置合わせを行った上で加算することが望ましいが、第4の実施の形態の解像度変換処理と組み合わせることも可能である。これにより、基準モザイク画像保持部283に保持された画像と新規画像との間の位置合わせをすることなく、単純な重み付き加算平均でも十分な成果をあげることができるようになる。
 [動作例]
 図43および44は、本発明の第5の実施の形態における照明成分変換処理部120の動作例を示す図である。この照明成分変換処理部120の後半は図12により説明した第1の実施の形態と同様であるが、前半において基準モザイク画像保持部283および処理対象モザイク画像保持部284に対するフレーム加算を行う点が異なっている。なお、基準モザイク画像保持部283および処理対象モザイク画像保持部284を、以下ではフレームメモリと称する。
 まず、制御パラメータ決定部285において、撮像に関する制御パラメータが決定され、この制御パラメータに従って最初の画像が撮像される(ステップS881)。この時に撮像される画像は、基準画像および処理対象画像、または、その何れか一方でも構わない。
 次に、各画素に対してステップS882乃至S885の処理が繰り返される(ループL718)。ループL718において、新規に撮像された画像の当該画素値が取得される(ステップS882)。また、フレームメモリから既存の対応する画素値が取得される(ステップS883)。そして、加算部281および282において、新規画素値とフレームメモリ内の画像が加重加算される(ステップS884)。この加算結果は、新規フレームメモリ画像としてフレームメモリに書き戻される(ステップS885)。
 ステップS882乃至S885の処理が終了すると、次の画素に対する処理が繰り返される。全ての画素に対する処理が終了すると、ループL718を抜けて、次のステップの処理に移る。その際、制御パラメータ決定部285において、フレームメモリ内の画像および新規撮像画像によって新規撮像を行うか否か、ならびに、撮像時の制御パラメータが決定される(ステップS886)。制御パラメータ決定部285において、追加の撮像が必要と判断された際には、ステップS881に戻って新規の撮像が行われる。フレームメモリ内の画像が有効な場合には次のステップに移る。以降の処理は、図12により説明した第1の実施の形態と同様である。
 このように、本発明の第5の実施の形態によれば、フレームメモリを備え、複数の画像から合成入力画像を生成することにより、フラッシュ発光または非発光以外のシーンにも対応することができる。例えば、蛍光灯や水銀灯照明下においてCMOSセンサを用いて短時間露光で撮像された画像では、フリッカーの影響により、部分的に照明条件の異なる領域が出てしまうが、そのような画像についても対応することができる。
 なお、この第5の実施の形態は、第4の実施の形態と組み合わせて利用することが有効である。
 <6.第6の実施の形態>
 [画像処理回路23の処理機能例]
 図45は、本発明の第6の実施の形態における画像処理回路23の処理機能の一例を示す図である。この画像処理回路23は、図2により説明した第1の実施の形態のものと比べて、ホワイトバランス処理を照明成分変換処理部120の前段で行う点で異なる。すなわち、ホワイトバランス処理部131および132において推定されたホワイトバランス値を算出し、それぞれ基準画像ホワイトバランス保持部181および処理対象画像ホワイトバランス保持部182に格納される。そして、この格納されたホワイトバランス値は照明成分変換処理部120に供給される。
 この第6の実施の形態では、色変換ゲイン算出部311および312における処理は、次式のようになる。
Figure JPOXMLDOC01-appb-M000033
 これにより、照明成分変換処理部120のゲインとホワイトバランス処理部131および132のゲインを同時に扱うことが可能になる。この場合、第1の実施の形態に対してゲインSがWB倍されているため、ゲイン上限値R保持部323またはゲイン上限値B保持部324、ゲイン下限値R保持部333またはゲイン下限値B保持部334に関してもWB倍した値を設定することになる。その結果、上限値、下限値は次式であらわされる値にすると有効である。
Figure JPOXMLDOC01-appb-M000034
Figure JPOXMLDOC01-appb-M000035
 また、黒つぶれ補償値R保持部343および黒つぶれ補償値B保持部344、飽和補償値R保持部353および飽和補償値B保持部354についても同様であり、黒つぶれ補償値はWB、飽和補償値はWBと設定すればよい。また、これら上限値、下限値、補償値の計算には基準画像ホワイトバランス保持部181および処理対象画像ホワイトバランス保持部182に格納された値が用いられる。
 また、このとき、ホワイトバランス算出部230による処理は不要になる。これ以外のデモザイク処理部221および222やチャンネルゲイン適用部260における処理は、第1の実施の形態と同様である。
 <7.第7の実施の形態>
 [画像処理回路23の処理機能例]
 図46は、本発明の第7の実施の形態における画像処理回路23の処理機能の一例を示す図である。この画像処理回路23では、ゲイン算出だけでなく実際にホワイトバランス処理まで行ったモザイク画像を照明成分変換処理部の入力としている。ここでは、ホワイトバランス処理部131および132がホワイトバランスを算出し、それぞれ基準画像ホワイトバランス保持部181および処理対象画像ホワイトバランス保持部182に格納するとともに、ホワイトバランス処理済みの画像を照明成分変換処理部120に対する入力としている。
 本発明の第1の実施の形態の入力Iに対して、この第7の実施の形態におけるホワイトバランス処理がされた入力は、次式のようになる。
Figure JPOXMLDOC01-appb-M000036
 これにより、チャンネルゲイン算出部250内の色変換ゲイン算出部311および312において算出される比率およびゲインはそれぞれ以下のように表現される。
Figure JPOXMLDOC01-appb-M000037
Figure JPOXMLDOC01-appb-M000038
 ここで、比率KoはWB/WB倍されており、ゲインSはWB/WB倍されている。このことを考慮すると、ゲイン上限値R保持部323またはゲイン上限値B保持部324、ゲイン下限値R保持部333またはゲイン下限値B保持部334に関しても第1の実施の形態に対してWB/WB倍した値を設定することになる。その結果、上限値および下限値は以下のように設定することが有効である。
Figure JPOXMLDOC01-appb-M000039
Figure JPOXMLDOC01-appb-M000040
 また、黒つぶれ補償値R保持部343および黒つぶれ補償値B保持部344、飽和補償値R保持部353および飽和補償値B保持部354についても同様であり、黒つぶれ補償値は「1」、飽和補償値はWB/WBと設定すればよい。また、これら上限値、下限値、補償値の計算には、基準画像ホワイトバランス保持部181および処理対象画像ホワイトバランス保持部182に格納された値が用いられる。
 また、これら上限値、下限値、補償値を求める別の形態として以下の手法が考えられる。すなわち、WBc/WBsの値を基準画像ホワイトバランス保持部181および処理対象画像ホワイトバランス保持部182に格納された値を使わず、ホワイトバランス処理がなされた基準画像、処理対象画像から直接求めてもよい。ホワイトバランス処理がなされた画像において露出補償処理がされた2枚の画像の比率Kの式は、数37に対して露出補償処理を行い数41のように書ける。ここで、フラッシュ光が届かない背景領域では比率K(p)は1であることから、そのような領域では数41の各チャンネルの値としてホワイトバランスの比率を求めることができる。したがって、KGに対して閾値を設け、KGが1に近い領域のKの各チャンネルの値の平均または中央値の逆数として、WBc/WBsを求めることができる。
Figure JPOXMLDOC01-appb-M000041
 また、このとき、ホワイトバランス算出部230による処理は不要になる。デモザイク処理部221および222における処理は第1の実施の形態と同様である。また、チャンネルゲイン適用部260における処理は、第1の実施の形態に対して比率KoがWB/WB倍されていることに考慮した処理になる。
 <8.第8の実施の形態>
 本発明の第8の実施の形態では、RAWデータに対して何らかの変換処理が加えられた2枚の画像を想定する。例えば、図2の撮像装置の画像処理回路23におけるホワイトバランス処理部130乃至YC変換処理部170に相当する処理がなされた2枚の画像を想定する。画像フォーマットとしては、例えば、JPEG(Joint Photographic Experts Group)形式を想定する。また、入力画像は画素毎に3チャンネル揃っており、それぞれの画像に対して既にホワイトバランス処理がなされていることを想定する。すなわち、第7の実施の形態と同様に、第8の実施の形態ではホワイトバランス処理済みの画像を入力画像とすることができる。
 第8の実施の形態と他の実施の形態の大きな違いは、既に画素毎に3チャンネル分のデータがそろっている点である。これにより、図5における基準画像に対するデモザイク処理部221、処理対象画像に対するデモザイク処理部222が不要となり素通しになる。また、ホワイトバランス算出部230の動作も異なる。ホワイトバランス算出部230においては、事前にホワイトバランス処理部130で求めたホワイトバランス値を保持しておき、基準画像に対するWBcの値として基準画像ホワイトバランス保持部に格納するものとする。WBsに関しても、事前にホワイトバランス処理部130で求めた値を保持しておいて使用するものとする。また、WBs設定の他の形態としては図1のフラッシュ発光部61に対する事前測定により求められたホワイトバランス値を用いてもよい。また、第7の実施例の数41のように露出補償後の2枚の画像の比率として基準画像と処理対象画像のホワイトバランスの比率を求めてもよい。また、別の違いとしては、入力画像に対して既に図2のガンマ補正処理部160に相当する非線形処理が加わっており、信号の強度比Kが正しく求まらない点である。そのため、第8の実施の形態では、逆ガンマ補正処理をした後に照明成分変換処理の入力とするか、ガンマ補正処理を前提とした処理の変更が望まれる。逆ガンマ補正処理後の画像を入力とした画像処理回路23の構成を説明するブロックダイアグラムが図47である。
 [画像処理回路23の処理機能例]
 図47は、本発明の第8の実施の形態における画像処理回路23の処理機能の一例を示す図である。この画像処理回路23は、逆ガンマ補正処理部133および134と、照明成分変換処理部120と、ガンマ補正処理部160と、YC変換処理部170と、基準画像ホワイトバランス保持部183と、処理対象画像ホワイトバランス保持部184とを備える。
 この画像処理回路23の入力画像は、既にJPEG形式からデコードされ、画素毎にRGBの3チャンネル揃った画像である。逆ガンマ補正処理は、JPEG形式の画像を作成した時のガンマ補正処理の逆変換が望ましいが、正確な逆変換を知ることができない場合には、簡易的な逆ガンマ補正処理で構わない。ガンマ補正処理の簡易処理は、次式のようになる。
Figure JPOXMLDOC01-appb-M000042
したがって、上式の逆変換式である次式により表される補正処理を行えばよいことが分かる。
Figure JPOXMLDOC01-appb-M000043
ここで、Iwhite_levelは入力信号を0.0乃至1.0の値に正規化するための入力信号Iの上限値である。逆ガンマ補正後の画像に対する処理は本発明の第1の実施の形態に準じる。また、ゲイン算出部におけるゲイン上限値、ゲイン下限値、飽和補償値、黒つぶれ補償値の算出式は、第7の実施の形態の数39および数40に準じる。また、チャンネルゲイン適用部260における処理は、第7の実施例同様、第1の実施の形態に対して比率KoがWBs/WBc倍されていることに考慮した処理になる。
 また、照明成分変換処理後は、再びガンマ補正する必要があるが、この変換はJPEG形式の画像を作成した時のガンマ補正処理とは独立に、逆ガンマ補正処理部133および134の逆変換とすることが望ましい。
 次に、図47の機能例において逆ガンマ処補正処理部133、134およびガンマ補正処理部160を省略した場合の処理について説明する。一般に各チャンネルに対する色バランス調整処理は、センサおよびその表面に配されたカラーフィルタの分光特性、照明成分の色バランス、および、強度に対して線形な特性を持つRAWデータと呼ばれる画像で行うことが望ましい。このRAWデータに対して変換fを行った画像において照明成分変換処理することを考える。
 上述のように色バランスの調整をRAWデータの段階で行うこととすると、ここで得ようとする出力は色変換処理を行った後に変換fを行った画像であるため、以下のように表すことができる。
  f(FS(p)・I(p))
ここで、説明を簡単にするために、図6における上限値クリッピング部、下限値クリッピング部、黒つぶれ補償部、飽和補償部を省略し、ゲインS(p)=ゲインFS(p)とすると、以下のようになる。
  f(S(p)・I(p))
一方、変換f後の画像を照明成分変換処理部120への入力として色変換ゲイン算出部311および312で得られるゲインをtS(p)とすると、ゲイン適用後の画像は以下のようになる。
  tS(p)・f(I(p))
ここで求めるべきなのは、上2式の結果を一致させるtS(p)である。したがって、次式が得られる。
  f(S(p)・I(p)=tS(p)・f(I(p))
  tS(p)=(f(S(p)・I(p))/f(I(p))
 ここで、変換fに対して、乗算および除算と変換fの演算順序が交換可能であると仮定する。すなわち、次式が成立するものとする。
  f(I(p)・J(p))=f(I(p))・f(J(p))
  f(1/I(p))=1/f(I(p))
この仮定を用いると、変換後の画像に対して数4と同様の処理を行うことで、次式のように対応する色変換ゲインtFS(p)が求まることがわかる。
Figure JPOXMLDOC01-appb-M000044
すなわち、RAWデータに対して上式の性質を有する変換fを施した画像に対しても、逆変換処理することなく本発明の実施の形態による色変換ゲイン算出法が有効であることが示された。
 ガンマ補正処理は簡易的なガンマ補正処理を表す数41に示す指数関数による変換に近似することができる。また、この変換は、変換fに関する仮定を表す式を満たす。したがって、ガンマ処理後の画像は、近似的に逆変換することなく、本発明の実施の形態において示された照明成分変換処理を適用することが可能である。また、このとき、チャンネルゲイン算出部250で用いられるゲイン上限値、ゲイン下限値、飽和補償値、黒つぶれ補償値は、逆ガンマ補正処理の第7の実施の形態の数39および数40で求められたそれぞれをγ乗した値を用いることが有効である。したがって、黒つぶれ補償値は1、飽和補償値は(WB/WBγと設定すればよく、ゲイン上限値およびゲイン下限値は次式により設定すればよい。
Figure JPOXMLDOC01-appb-M000045
Figure JPOXMLDOC01-appb-M000046
 ガンマ処理されたままの画像を入力画像とした場合、ガンマ補正された状態での画像間の比率gamKoは、次式のようになる。
Figure JPOXMLDOC01-appb-M000047
したがって、撮像環境の違いによる露出補正後の比率KはgamKoを用いて次式のように表される。
Figure JPOXMLDOC01-appb-M000048
 gamIに関するガンマ補正処理の簡易処理の数式(数41)をIについて解いて、各判定式に代入することにより、ガンマ補正後の画像を入力とした際の黒つぶれ、飽和、動被写体の判定を行うことが可能となる。また、ガンマ補正後の画像を入力とした際にはRGB値は「上に凸の非線形変換」がすでに適用されているため、その線形和などで表現される輝度Lについても非線形変換が施されていることになる。したがって、ガンマ補正後の画像を入力画像とした照明成分変換処理では、非線形変換部522(図26)における処理を省略することができる。最終的に照明成分変換処理部120の出力は、図2におけるガンマ補正処理部160の出力結果に相当する信号となる。
 このように、本発明の第8の実施の形態によれば、ガンマ補正処理された画像を基準画像および処理対象画像とした場合であっても、色再現性の高い画像を生成することができる。
 <9.第9の実施の形態>
 上述の第3または第4の実施の形態ではエッジ保存平滑化の際に、RGB値から固定係数に従って輝度を算出してから非線形変換を行っているが、本発明の第9の実施の形態ではRGB値を非線形変換した後に重回帰分析を施すことによって算出することを想定する。
 [平滑化処理部480の処理機能例]
 図48は、本発明の第9の実施の形態における平滑化処理部480の処理機能例を示す図である。この平滑化処理部480の処理機能例は、図26に示した第3の実施の形態における輝度算出部521および非線形変換部522に代えて、非線形変換部611、621乃至623および輝度算出部630を備えている。
 非線形変換部611は、Gチャンネルの強度比K(p)を非線形変換して、非線形強度比K (nl)(p)を出力するものである。非線形変換部621乃至623は、処理対象画像I(p)のRGB値R(p)、G(p)およびB(p)の各々を非線形変換して、非線形RGB値R (nl)(p)、G (nl)(p)およびB (nl)(p)を出力するものである。これら非線形変換部611、621乃至623は、非線形変換部522と同様に、例えば、γカーブ、1より小さい指数によるべき乗特性や対数変換などの「上に凸の単調増加特性」を適用することが有用である。ここで、非線形変換を行うのは、画素値の分布を変更して直線モデルに対する精度を向上させるためである。また、この非線形変換により強度比K(p)とゲインとの相関が高くなり、両者の関係がわかり易くなるという利点がある。なお、この実施の形態では、非線形変換部611の入力として強度比K(p)を用いているが、これに代えてK(p)、K(p)、1/K(p)、1/K(p)、1/K(p)を用いるようにしてもよい。また、色変換ゲインそのもの、すなわちFS(p)やFS(p)を用いるようにしてもよい。
 輝度算出部630は、非線形変換部611、621乃至623の出力から、非線形変換された輝度値L(nl)(p)を算出するものである。第3の実施の形態における輝度算出部521は固定係数からRGB値の線形和を演算していたが、この輝度算出部630は画像に応じて求められた係数から輝度値を算出する。その一例として、輝度算出部630は、非線形変換部611、621乃至623の出力に対して重回帰分析を行い、得られた重回帰分析パラメータを係数として輝度値を算出する。なお、ここでは非線形変換された値から算出するため厳密な意味では輝度値と異なるが、第3の実施の形態と同様に最終的には非線形変換された輝度値L(nl)(p)を算出することを目的としているため、広義の輝度値として取り扱う。この輝度算出部630は、重回帰分析部631と、重回帰分析パラメータ保持部632と、重回帰予測値算出部633とを備える。
 重回帰分析部631は、非線形変換部611、621乃至623の出力に対して重回帰分析を行うものである。この重回帰分析部631は、次式の値を最小とするような重回帰分析パラメータCC、CC、CC、CCOffsetを求める。ここで、CC、CC、CCは偏回帰係数であり、CCOffsetは切片である。
  Σ(K (nl)(p)-(CC・R (nl)(p)+CC・G (nl)(p)+
             CC・B (nl)(p)+CCOffset))2
すなわち、ここでは、R (nl)(p)、G (nl)(p)およびB (nl)(p)を説明変量とし、K (nl)(p)を目的変量とした重回帰分析が行われる。なお、この例では1画面全体に対して1組の重回帰分析パラメータを求めることを想定しているが、画面の一部である小領域毎に重回帰分析パラメータを求めるようにしてもよい。また、ここではRGB全てのチャンネルを用いて重回帰分析を行ったが、特定のチャンネルのみを用いて重回帰分析を行ってもよく、CCOffsetを0に固定して重回帰分析を行ってもよい。
 重回帰分析パラメータ保持部632は、重回帰分析部631によって求められた重回帰分析パラメータCC、CC、CC、CCOffsetを保持するメモリである。この重回帰分析パラメータ保持部632に保持された重回帰分析パラメータは、重回帰予測値算出部633に供給される。
 重回帰予測値算出部633は、重回帰分析パラメータ保持部632に保持された重回帰分析パラメータに従って、非線形変換された輝度値L(nl)(p)を重回帰予測値として算出するものである。この重回帰予測値算出部633は、次式により非線形変換された輝度値L(nl)(p)を算出する。
  L(nl)(p)=CC・R (nl)(p)+CC・G (nl)(p)+
             CC・B (nl)(p)+CCOffset
 このようにして求められた、非線形変換された輝度値L(nl)(p)は、処理対象画像の画素値のみから求まるために動被写体の影響を受け難いという特性を持つ。また、この非線形変換された輝度値L(nl)(p)は、第3の形態の場合と同様の性質を有するため、他の構成に関する説明は省略する。
 [平滑化処理部480の他の処理機能例]
 図49は、本発明の第9の実施の形態における平滑化処理部480の他の処理機能例を示す図である。この平滑化処理部480の他の処理機能例は、図36に示した第4の実施の形態における輝度算出部523および非線形変換部524に代えて、非線形変換部612、621乃至623、641乃至643および輝度算出部630を備えている。上述の通り、第4の実施の形態は、第3の実施の形態において入力画像に対して解像度変換した上で比較する処理を備えたものであり、図48の例と図49の例においても同様の関係を有している。
 非線形変換部612は、縮小画像のGチャンネルの強度比BK(p)を非線形変換して、非線形強度比BK (nl)(p)を出力するものである。非線形変換部621乃至623は、上述のように、処理対象画像I(p)のRGB値R(p)、G(p)およびB(p)の各々を非線形変換して、非線形RGB値R (nl)(p)、G (nl)(p)およびB (nl)(p)を出力するものである。非線形変換部641乃至643は、縮小画像のRGB値BR(p)、BG(p)およびBB(p)の各々を非線形変換して、非線形RGB値BR (nl)(p)、BG (nl)(p)およびBB (nl)(p)を出力するものである。これら非線形変換部612、621乃至623、641乃至643は、非線形変換部522と同様に、例えば、γカーブ、1より小さい指数によるべき乗特性や対数変換などの「上に凸の単調増加特性」を適用することが有用である。
 輝度算出部630は、非線形変換部611、621乃至623、641乃至643の出力から、非線形変換された輝度値L(nl)(p)を算出するものである。この輝度算出部630は、縮小画像に応じて求められた係数から輝度値を算出する。この輝度算出部630は、重回帰分析部634と、重回帰分析パラメータ保持部635と、重回帰予測値算出部633および636とを備える。
 重回帰分析部634は、非線形変換部612、641乃至643の出力に対して重回帰分析を行うものである。分析対象が縮小画像に基づくものである点を除き、図48の例により説明した重回帰分析部631と同様である。
 重回帰分析パラメータ保持部635は、重回帰分析部634によって求められた重回帰分析パラメータCC、CC、CC、CCOffsetを保持するメモリである。この重回帰分析パラメータ保持部635に保持された重回帰分析パラメータは、重回帰予測値算出部633および636に供給される。
 重回帰予測値算出部633は、重回帰分析パラメータ保持部635に保持された重回帰分析パラメータに従って、非線形変換された輝度値L(nl)(p)を重回帰予測値として算出するものである。また、重回帰予測値算出部636は、重回帰分析パラメータ保持部635に保持された重回帰分析パラメータに従って、縮小画像の非線形変換された輝度値BL(nl)(p)を重回帰予測値として算出するものである。重回帰予測値算出部633および636において、重回帰分析パラメータは同じものが利用される。
 [動作例]
 図50および51は、本発明の第9の実施の形態における平滑化処理部480の図48の処理機能例に対応する動作例を示す図である。なお、ここでは、図30と同じ処理については同じ参照符号を付している。
 ここでは、まず、ステップS751乃至S753の処理が各画素を対象として繰り返される(ループL719)。このループL719において、処理対象画像のRGB値およびGチャンネルの強度比が取得される(ステップS751)。これらRGB値および強度比は、非線形変換部611、621乃至623において非線形変換される(ステップS752)。非線形変換されたRGB値および強度比は、(図示しない)メモリに格納される(ステップS753)。
 各画素に対して非線形変換処理が行われると、重回帰分析部631において、R (nl)(p)、G (nl)(p)およびB (nl)(p)を説明変量とし、K (nl)(p)を目的変量とした重回帰分析が行われる(ステップS754)。その結果、重回帰分析により得られた重回帰分析パラメータが重回帰分析パラメータ保持部632に保持される(ステップS755)。
 重回帰分析によって重回帰分析パラメータが得られると、ステップS756乃至S967の処理が各画素を対象として繰り返される(ループL720)。このループL720において、処理対象画像の非線形変換処理後のRGB値が取得される(ステップS756)。また、対応画素のゲインFS(p)、FS(p)および信頼度FT(p)が取得される(ステップS962)。さらに、重回帰分析パラメータ保持部632に保持された重回帰分析パラメータが取得される(ステップS757)。そして、重回帰予測値算出部633において、非線形変換された輝度値L(nl)(p)として重回帰予測値が算出される(ステップS758)。以降の処理については、図31において説明したものと同様であるため、ここでの説明は省略する。
 図52乃至54は、本発明の第9の実施の形態における平滑化処理部480の図49の処理機能例に対応する動作例を示す図である。この動作例は、図50および51により説明した図48の処理機能例に対応する動作例と基本的には同様である。ただし、ブロック積分値の算出のために用いられる画像は縮小画像となっている。すなわち、乗算部511および512に入力されるのは、縮小画像のゲインBFS(q)、BFS(q)および縮小画像に基づく信頼度BFT(q)である。また、非線形変換部612、641乃至643に入力されるのは、縮小画像の強度比BK(p)、縮小された処理対象画像BR(q)、BG(q)、BB(q)である。また、加重積和される処理対象画像のサイズはそのままである。
 ここでは、まず、ステップS761乃至S763の処理が縮小画像の各画素を対象として繰り返される(ループL721)。ステップS761乃至S763の処理内容は、上述のステップS751乃至S753の処理と同様であるため、ここでの説明は省略する。また、これに続くステップS764およびS765の処理内容は、上述のステップS754およびS755の処理と同様であるため、これらについても説明は省略する。
 重回帰分析によって重回帰分析パラメータが得られると、ステップS766乃至S866の処理が縮小画像の各画素を対象として繰り返される(ループL722)。なお、ここでは、図39と同じ処理については同じ参照符号を付している。このループL722におけるステップS766乃至S866の処理内容は、上述のステップS756乃至S966の処理と同様であるため、ここでの説明は省略する。
 一方、加重積和される画像は、縮小画像ではなく処理対象画像となる。したがって、ループL723では、各処理は処理対象画像の各画素を対象として繰り返される。このループL723において、処理対象画像のRGB値および重み自身のブロック積分値が取得され(ステップS871)、さらに、重回帰分析パラメータ保持部632に保持された重回帰分析パラメータが取得される(ステップS771)。RGB値は、非線形変換部621乃至623において非線形変換される(ステップS772)。そして、重回帰予測値算出部633において、非線形変換された輝度値L(nl)(p)として重回帰予測値が算出される(ステップS773)。以降の処理については、図40において説明したものと同様であるため、ここでの説明は省略する。
 このように、本発明の第9の実施の形態によれば、ブロック積分値を利用したエッジ保存型平滑化を行う際に、画像に応じた輝度により輝度方向の平滑化を行うことができる。
 <10.第10の実施の形態>
 上述の第3または第4の実施の形態ではエッジ保存平滑化の際に、位置と輝度の周囲のヒストグラムから平滑化を行っているが、本発明の第10の実施の形態では粗いゲインそのものも加重積和に利用して平滑化を行うことを想定する。
 [平滑化処理部480の処理機能例]
 図55は、本発明の第10の実施の形態における平滑化処理部480の処理機能例を示す図である。この平滑化処理部480の処理機能例は、図26に示した第3の実施の形態における加重積和部561および562に対して、さらにゲインFS(p)およびFS(p)を入力している。加重積和部561および562では、位置pのゲインFS(p)およびFS(p)と位置pおよび輝度値L(nl)(p)に対応する座標rの平均ゲインHSW(r)およびHSW(r)とを比較することにより、加重積和のための重みが計算される。
 [加重積和部561および562の構成例]
 図56は、本発明の第10の実施の形態における加重積和部561および562の構成例を示す図である。この加重積和部561および562の各々は、図28に示した第3の実施の形態における補間部563および564の前段に、除算部651と、比較部652と、乗算部653および654とを備えた構成を有する。
 除算部651は、ブロック積分値保持部541および542に保持されたブロック積分値ISW(r)およびISW(r)をブロックヒストグラム保持部543に保持されたブロックヒストグラムIFT(r)によって座標r毎に除算するものである。これにより、座標rでの平均ホワイトバランスが算出される。なお、ブロック積分値およびブロックヒストグラムは、空間的な位置、輝度に対して離散化されている。座標rは空間的な位置i,jおよび輝度λの3次元座標(i,j,λ)を表すものとする。この除算部651により算出されるHSW(r)およびHSW(r)は、次式により得られる。
  HSW(r)=ISW(r)/IFT(r)
  HSW(r)=ISW(r)/IFT(r)
なお、除算部651は、請求の範囲に記載の第1の除算部の一例である。
 比較部652は、処理対象画像の位置pにおけるゲインFS(p)およびFS(p)と位置pに対応するブロックの座標rの平均ゲインHSW(r)およびHSW(r)とを比較することにより、加重積和の重みθを計算する。この重みθは、図57のように△Max(r)の値に応じて1から0の範囲の値を示す。△Max(r)は次式のように、absRおよびabsBの何れか大きい方を意味する。なお、ABSは絶対値を示す関数である。
  △Max(r)=max(absR,absB)
  absR=ABS(FS(p)-HSW(r))/SWUNIT
  absB=ABS(FS(p)-HSW(r))/SWUNIT
 ここで、SWUNITおよびSWUNITは、次式により定義される。
  SWUNIT=ABS(ゲイン上限値-ゲイン下限値
  SWUNIT=ABS(ゲイン上限値-ゲイン下限値
ゲイン上限値およびゲイン下限値は、数5および数6に示したものと同様である。SWUNITにより平均ゲインの差を割ることにより、ゲインと平均ゲインの差が0.0から1.0の範囲に正規化されることになる。各画素のゲインは上限値および下限値によってクリップされているため、差の絶対値の範囲は0から「上限値-下限値」となる。また、この正規化により、RとBの差を比較して大きい方を△Max(r)とすることが可能となる。
 なお、ここでは△Max(r)をabsRおよびabsBの何れか大きい方とし、RチャンネルおよびBチャンネル共通の重みとして重みθを求めたが、absRおよびabsBを個別に扱い、RチャンネルおよびBチャンネル独立の重みθおよびθを求めてもよい。この場合、ブロック領域の重み付きゲインSW(r)またはSW(r)もRチャンネルおよびBチャンネル毎に計算される。
 また、この例では、重みθと△Max(r)との関係を図57のように想定したが、これに限定されるものではなく、△Max(r)の増加に対して重みθが単調減少する特性を有するものであればよい。
 乗算部653は、ブロック積分値保持部541および542に保持されたブロック積分値ISW(r)およびISW(r)と比較部652によって算出された重みθとを座標r毎に乗算するものである。また、乗算部654は、ブロックヒストグラム保持部543に保持されたブロックヒストグラムIFT(r)と比較部652によって算出された重みθとを座標r毎に乗算するものである。乗算部653による乗算結果は補間部563に供給され、乗算部654による乗算結果は補間部564に供給される。なお、乗算部653は、請求の範囲に記載の第1の乗算部の一例である。また、乗算部654は、請求の範囲に記載の第2の乗算部の一例である。
 補間部563および564以降の構成は図28と同様であるが、上述のように重みθが乗算されることにより、以下のように得られる値が異なる。まず、補間部563は、空間重み関数テーブル保持部565に保持された空間重み関数テーブルの値ω(r,p)によって、乗算部653からの入力を補間する。これにより、補間部563は以下の値を出力する。
  Σω(i,j,p)・θ(△Max(i,j,λ))・ISW(i,j,λ)
  Σω(i,j,p)・θ(△Max(i,j,λ))・ISW(i,j,λ)
ここでは、座標rを、空間的な位置i,jおよび輝度λの3次元座標(i,j,λ)に展開している。また、演算Σについては、ここでは空間的な位置i,jについて総和を行うものとする。
 補間部564は、空間重み関数テーブル保持部565に保持された空間重み関数テーブルの値ω(r,p)によって、乗算部654からの入力を補間する。これにより、以下の値を出力する。
  Σω(i,j,p)・θ(△Max(i,j,λ))・IFT(i,j,λ)
演算Σについては、ここでは空間的な位置i,jについて総和を行うものとする。
 積和部566は、補間部563の出力に対して輝度加重値を積和した結果を算出する。輝度加重値は、輝度重み関数テーブル保持部568に格納されたテーブルの値ψ(λ,L(nl)(p))を用いて算出される。この積和部566は以下の値を出力する。
  Σ(ψ(λ,L(nl)(p))・ω(i,j,p)・
    θ(△Max(i,j,λ))・ISW(i,j,λ))
  Σ(ψ(λ,L(nl)(p))・ω(i,j,p)・
    θ(△Max(i,j,λ))・ISW(i,j,λ))
演算Σについては、ここでは空間的な位置i,jおよび輝度λについて総和を行うものとする。
 積和部567は、補間部564の出力に対して輝度加重値を積和した結果を算出する。輝度加重値は、輝度重み関数テーブル保持部568に格納されたテーブルの値ψ(λ,L(nl)(p))を用いて算出される。この積和部567は以下の値を出力する。
  Σ(ψ(λ,L(nl)(p))・ω(i,j,p)・
    θ(△Max(i,j,λ))・IFT(i,j,λ))
演算Σについては、ここでは空間的な位置i,jおよび輝度λについて総和を行うものとする。
 除算部569は、積和部566の出力を積和部567の出力により除算する。すなわち、この除算部569は以下の値を出力する。
Figure JPOXMLDOC01-appb-M000049
 ここで、第3の実施の形態と比較すると、この第10の実施の形態において、数25に対応する式は以下のようになる。
Figure JPOXMLDOC01-appb-M000050
これを離散化して近似すると、数24に対応する以下の式になる。
Figure JPOXMLDOC01-appb-M000051
すなわち、周囲の画素の重み付き加算平均計算を行う際、第3の実施の形態では空間的な距離および輝度差に基づいて重みを計算していたのに対し、この第10の実施の形態ではさらに画素位置毎に求められたゲインの差を加えて重みを計算する。つまり、この第10の実施の形態では、空間的な距離、輝度差、および、画素位置毎に求められたゲインの差に基づいて重みを計算して、周囲の画素の重み付き加算平均を計算する。これにより、より適切な平滑化処理を実現することができる。
 [平滑化処理部480の他の処理機能例]
 図58は、本発明の第10の実施の形態における平滑化処理部480の他の処理機能例を示す図である。この平滑化処理部480の他の処理機能例は、図36に示した第4の実施の形態においてさらに解像度変換部661および662を備えている。上述の通り、第4の実施の形態は、第3の実施の形態において入力画像に対して解像度変換した上で比較する処理を備えたものであり、図55の例と図58の例においても同様の関係を有している。
 解像度変換部661は、縮小画像のゲインBFS(q)の解像度を拡大して、処理対象画像と同じ解像度のゲインITPBFS(p)に変換する。解像度変換部662は、縮小画像のゲインBFS(q)の解像度を拡大して、処理対象画像と同じ解像度のゲインITPBFS(p)に変換する。これらにおける解像度変換は、例えば単純な線形補間により実現することができる。これら縮小画像に基づくゲインITPBFS(p)およびITPBFS(p)は、精度は悪くなるが、ブロック積分値およびブロックヒストグラムに比べて高周波の成分を持ったゲインになる。これら縮小画像に基づくゲインITPBFS(p)およびITPBFS(p)は、それぞれ加重積和部561および562に供給される。
 [加重積和部561および562の構成例]
 図59は、本発明の第10の実施の形態における平滑化処理部480の図58の処理機能例に対応する加重積和部561および562の構成例を示す図である。この加重積和部561および562の各々は、図56と同様に、補間部563および564の前段に、除算部671と、比較部672と、乗算部673および674とを備えた構成を有する。
 この平滑化処理部480の構成例は、基本的には図56に示した構成例と同様である。相違するのは、図56では比較部652に入力されていたゲインFS(p)およびFS(p)に代えて、この例では縮小画像に基づくゲインITPBFS(p)およびITPBFS(p)が比較部672に入力される点である。これ以外の点は図56の例と同様であるため、ここでは説明を省略する。
 [動作例]
 図60は、本発明の第10の実施の形態における平滑化処理部480の図55の処理機能例に対応する動作例を示す図である。なお、前半の処理は第3の実施の形態における図30と同様であるため、ここでは省略している。
 ここでは、図30の処理に続いて、ステップS971乃至S976の処理が各画素を対象として繰り返される(ループL724)。ステップS971乃至S976の処理自体は、図31により説明したものと同様である。相違するのは、図31におけるチャンネル毎の繰り返しを省いている点である。これは、この第10の実施の形態においては、重み計算時にRチャンネルおよびBチャンネルの値を同時に扱っているためである。これ以外の点は図31により説明したものと同様であるため、ここでの説明は省略する。
 図61および62は、本発明の第10の実施の形態における加重積和部561および562の動作例を示す図である。なお、ここでは、図33と同じ処理については同じ参照符号を付している。
 まず、当該画素周囲4×4ブロックの重み付きゲイン積分値がブロック積分値保持部541および542から取得される(ステップS781)。また、当該画素周囲4×4ブロックの重み(信頼度)自身の積分値(ブロックヒストグラム)がブロックヒストグラム保持部543から取得される(ステップS782)。そして、除算部651において、重み付きゲイン積分値に対して重み(信頼度)自身の積分値による除算処理が行われ、当該画素周囲4×4ブロック毎の平均ゲインが算出される(ステップS783)。
 続いて、当該画素のゲインFS(p)およびFS(p)が取得される(ステップS784)。そして、比較部652において、当該画素のゲインと当該画素周囲4×4ブロック毎の平均ゲインとの比較が行われ、ブロック毎にゲイン距離に基づいた重みが算出される(ステップS785)。また、乗算部653および654において、ゲイン距離に基づく重みが、対応するブロックの重み付きゲイン積分値および重み(信頼度)自身の積分値に乗じられる(ステップS786)。
 そして、当該画素の輝度値が取得され(ステップS991)、当該画素位置の重み付きゲイン積分値に対してゲイン距離に応じた重みを乗じた周囲4×4ブロックの補間が補間部563において行われる(ステップS787)。また、当該画素位置の重み(信頼度)自身の積分値に対してゲイン距離に応じた重みを乗じた周囲4×4ブロックの補間が補間部564において行われる(ステップS788)。ステップS994以降の処理は図33と同様であるため、ここでの説明は省略する。
 なお、この図61および62では図56の構成を前提に説明したが、図59の構成においても加重積和処理としては同様の処理が行われるため、ここでの説明は省略する。ただし、ステップS784で、当該画素のゲインFS(p)およびFS(p)に代えて、縮小画像に基づくゲインITPBFS(p)およびITPBFS(p)が取得されて、比較に用いられる。
 図63は、本発明の第10の実施の形態における平滑化処理部480の動作例を示す図である。なお、前半の処理は第4の実施の形態における図39と同様であるため、ここでは省略している。また、ここでは、図40と同じ処理については同じ参照符号を付している。
 ブロック積分値およびブロックヒストグラムが更新された後、ループL725においてステップS871乃至S878の処理が繰り返される。各処理の内容は図40と同様であるが、ステップS873とS874との間にステップS791の処理が挿入される点が異なっている。このステップS791では、当該画素位置のゲインが補間部563および564の補間処理により算出される。また、図40におけるチャンネル毎の繰り返しを省いている点も相違する。これは、この第10の実施の形態においては、重み計算時にRチャンネルおよびBチャンネルの値を同時に扱っているためである。これら以外の点は図40により説明したものと同様であるため、ここでの説明は省略する。
 このように、本発明の第10の実施の形態によれば、平滑化の際の加重積和に際して、位置と輝度の周囲のヒストグラムのみならず粗いゲインそのものを利用することにより、色再現性のより高い画像を生成することができる。
 なお、本発明の実施の形態は本発明を具現化するための一例を示したものであり、本発明の実施の形態において明示したように、本発明の実施の形態における事項と、請求の範囲における発明特定事項とはそれぞれ対応関係を有する。同様に、請求の範囲における発明特定事項と、これと同一名称を付した本発明の実施の形態における事項とはそれぞれ対応関係を有する。ただし、本発明は実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において実施の形態に種々の変形を施すことにより具現化することができる。
 また、本発明の実施の形態において説明した処理手順は、これら一連の手順を有する方法として捉えてもよく、また、これら一連の手順をコンピュータに実行させるためのプログラム乃至そのプログラムを記憶する記録媒体として捉えてもよい。この記録媒体として、例えば、CD(Compact Disc)、MD(MiniDisc)、DVD(Digital Versatile Disk)、メモリカード、ブルーレイディスク(Blu-ray Disc(登録商標))等を用いることができる。
 11 レンズ
 12 絞り
 13 撮像素子
 21 サンプリング回路
 22 A/D変換回路
 23 画像処理回路
 31 符号化/復号器
 32 メモリ
 41 表示ドライバ
 42 表示部
 51 タイミング生成器
 52 操作入力受付部
 53 ドライバ
 54 制御部
 59 バス
 61 フラッシュ発光部
 62 フラッシュ制御部
 111 基準モザイク画像保持部
 112 処理対象モザイク画像保持部
 120 照明成分変換処理部
 130、131 ホワイトバランス処理部
 133 逆ガンマ補正処理部
 140 デモザイク処理部
 150 階調補正処理部
 160 ガンマ補正処理部
 170 YC変換処理部
 181、183 基準画像ホワイトバランス保持部
 182、184 処理対象画像ホワイトバランス保持部
 191 Y画像保持部
 192 C画像保持部
 213 新規基準モザイク画像保持部
 214 新規処理対象モザイク画像保持部
 221、222 デモザイク処理部
 230 ホワイトバランス算出部
 240 基準画像ホワイトバランス保持部
 250 チャンネルゲイン算出部
 260 チャンネルゲイン適用部
 261、262 乗算部
 271 解像度変換部
 280 フレーム加算部
 281、282 加算部
 283 基準モザイク画像保持部
 284 処理対象モザイク画像保持部
 285 制御パラメータ決定部
 290 照明成分変換済モザイク画像保持部
 311、312 色変換ゲイン算出部
 321、322 上限値クリッピング部
 323 ゲイン上限値R保持部
 324 ゲイン上限値B保持部
 331、332 下限値クリッピング部
 333 ゲイン下限値R保持部
 334 ゲイン下限値B保持部
 341、342 黒つぶれ補償部
 343 黒つぶれ補償値R保持部
 344 黒つぶれ補償値B保持部
 345 黒つぶれ度算出部
 351、352 飽和補償部
 353 飽和補償値R保持部
 354 飽和補償値B保持部
 355 飽和度算出部
 421~423 除算部
 431~433 露出補償部
 440 飽和信頼度算出部
 450 黒つぶれ信頼度算出部
 460 動被写体信頼度算出部
 461 比率逆転度算出部
 462 比率予測部
 463 分光反射率変化量予測部
 464 環境光スペクトル色バランス値保持部
 465 フラッシュ光スペクトル色バランス値保持部
 466 最小値選択部
 470 信頼度選択部
 480 平滑化処理部
 511 乗算部
 521、523、630 輝度算出部
 522、611、612、621乃至623、641乃至643 非線形変換部
 531 ブロック積分値算出部
 533 ブロックヒストグラム算出部
 534 ブロック選択部
 535 積分器
 536 加算部
 537 レジスタ
 538 ブロック積分値保持部
 541、542 ブロック積分値保持部
 543 ブロックヒストグラム保持部
 551 位相補償処理部
 561、562 加重積和部
 563、564 補間部
 565 空間重み関数テーブル保持部
 566、567 積和部
 568 輝度重み関数テーブル保持部
 569 除算部
 571、572 ゲイン適用部
 631、634 重回帰分析部
 632、635 重回帰分析パラメータ保持部
 633、636 重回帰予測値算出部
 651、671 除算部
 652、672 比較部
 653、654、673、674 乗算部
 661、662 解像度変換部

Claims (34)

  1.  異なる照明環境下で撮像された基準画像および処理対象画像から、各画素位置におけるチャンネル毎に照明成分を変換するためのゲインを算出するチャンネルゲイン算出部と、
     前記ゲインを前記処理対象画像に適用するためのチャンネルゲイン適用部と
    を具備する画像処理装置。
  2.  前記チャンネルゲイン算出部は、前記処理対象画像の特定のチャンネルのゲインを固定して、前記処理対象画素の色バランスを前記基準画像と一致するように前記ゲインを算出する請求項1記載の画像処理装置。
  3.  前記チャンネルゲイン算出部は、前記処理対象画像の輝度値を固定して、前記処理対象画素の色バランスを前記基準画像と一致するように前記ゲインを算出する請求項1記載の画像処理装置。
  4.  前記チャンネルゲイン算出部は、所定の上限値を超える値が前記ゲインとして算出された場合には前記上限値を前記ゲインとし、または、所定の下限値を下回る値が前記ゲインとして算出された場合には前記下限値を前記ゲインとする請求項1記載の画像処理装置。
  5.  前記チャンネルゲイン算出部は、
     前記基準画像の画素値から画素の飽和度を算出する飽和度算出部と、
     前記飽和度に応じて前記ゲインの補償処理を行う飽和補償部と
    を備える請求項1記載の画像処理装置。
  6.  前記チャンネルゲイン算出部は、
     前記基準画像の画素値から画素の黒つぶれ度を算出する黒つぶれ度算出部と、
     前記黒つぶれ度に応じて前記ゲインの補償処理を行う黒つぶれ補償部と
    を備える請求項1記載の画像処理装置。
  7.  前記チャンネルゲイン算出部は、
     前記基準画像の画素値および前記基準画像と前記処理対象画像とのチャンネル間比率から画素の黒つぶれ度を算出する黒つぶれ度算出部と、
     前記黒つぶれ度に応じて前記ゲインの補償処理を行う黒つぶれ補償部と
    を備える請求項1記載の画像処理装置。
  8.  前記基準画像および前記処理対象画像の撮像条件の違いを補償するために露出強度が等しくなるよう強度調整する露出補償部をさらに具備する請求項1記載の画像処理装置。
  9.  前記チャンネルゲイン適用部は、
     前記基準画像の画素値から画素の飽和信頼度を算出する飽和信頼度算出部と、
     前記飽和信頼度に基づいて前記ゲインを空間平滑化した上で前記処理対象画素に対して適用する平滑化処理部と
    を備える請求項1記載の画像処理装置。
  10.  前記チャンネルゲイン適用部は、
     前記基準画像の画素値から画素の黒つぶれ信頼度を算出する黒つぶれ信頼度算出部と、
     前記黒つぶれ信頼度に基づいて前記ゲインを空間平滑化した上で前記処理対象画素に対して適用する平滑化処理部と
    を備える請求項1記載の画像処理装置。
  11.  前記チャンネルゲイン適用部は、
     前記基準画像の画素値および前記基準画像と前記処理対象画像とのチャンネル間比率から画素の黒つぶれ信頼度を算出する黒つぶれ信頼度算出部と、
     前記黒つぶれ信頼度に基づいて前記ゲインを空間平滑化した上で前記処理対象画素に対して適用する平滑化処理部と
    を備える請求項1記載の画像処理装置。
  12.  前記チャンネルゲイン適用部は、
     前記基準画像と前記処理対象画像の対応画素における特性値の変化から空間的に被写体が動いた画素か否かを判定して動被写体信頼度を算出する動被写体信頼度算出部と、
     前記動被写体信頼度に基づいて前記ゲインを空間平滑化した上で前記処理対象画素に対して適用する平滑化処理部と
    を備える請求項1記載の画像処理装置。
  13.  前記動被写体信頼度算出部は、
     前記処理対象画像の画素の信号強度の変化が基準画像および処理対象画像全体の照明成分の変化の方向と逆転しているか否かに応じて前記動被写体信頼度を算出する比率逆転度算出部を備える
    請求項12記載の画像処理装置。
  14.  前記動被写体信頼度算出部は、
     前記基準画像と前記処理対象画像の対応画素の分光反射率の変化に応じて前記動被写体信頼度を算出する分光反射率変化量予測部を備える
    請求項12記載の画像処理装置。
  15.  前記基準画像または前記処理対象画像の解像度を変換した上で前記チャンネルゲイン算出部に供給する解像度変換部をさらに具備する請求項1記載の画像処理装置。
  16.  前記解像度変換部は、画素の間引きによる縮小により前記解像度変換を行う請求項15記載の画像処理装置。
  17.  前記解像度変換部は、ブロック内の画素の平均に基づく縮小により前記解像度変換を行う請求項15記載の画像処理装置。
  18.  前記解像度変換部は、ブロック内の画素の中央値に基づく縮小により前記解像度変換を行う請求項15記載の画像処理装置。
  19.  前記解像度変換部は、エッジ保存型平滑化フィルタ処理により前記解像度変換を行う請求項15記載の画像処理装置。
  20.  前記解像度変換部は、前記基準画像と前記処理対象画像のサイズを合致させるように前記解像度変換を行う請求項15記載の画像処理装置。
  21.  連続して撮像された画像を格納するためのフレームメモリと、
     前記連続撮像された画像を重み付けしながら加算して入力画像を作成する加算部と、
     前記連続撮像に使用する制御パラメータを決定して撮像の繰り返し制御を行う制御パラメータ決定部と
    をさらに具備する請求項1記載の画像処理装置。
  22.  前記基準画像はフラッシュ発光無しで撮像された画像であり、
     前記処理対象画像はフラッシュ発光有りで撮像された画像である
    請求項1記載の画像処理装置。
  23.  前記チャンネルゲイン適用部は、
     前記処理対象画像の画素値から輝度を算出する輝度算出部と、
     画素間の輝度の差に基づいて前記ゲインを空間平滑化した上で前記処理対象画素に対して適用する平滑化処理部とを備える
    請求項1記載の画像処理装置。
  24.  前記輝度算出部は、前記処理対象画像の画素値に対して予め設定された重みによる線形和として前記輝度を算出する
    請求項23記載の画像処理装置。
  25.  前記輝度算出部は、前記基準画像と前記処理対象画像の対応画素の強度比を目的変量とし、前記処理対象画像の画素値を説明変量とした重回帰分析に基づいて前記輝度を算出する
    請求項23記載の画像処理装置。
  26.  空間軸方向および輝度軸方向に領域を複数に分割した各ブロックについて処理対象画像の画素の頻度値をブロックヒストグラムとして算出するブロックヒストグラム算出部と、
     前記各ブロックに属する特性値の積分値を算出するブロック積分値算出部と、
     ブロックヒストグラムとブロック積分値と当該画素位置の輝度値とから当該画素位置の大局ゲイン値を算出する加重積和部と、
     前記処理対象画像に前記大局ゲイン値を適用するゲイン適用部と
    を具備する画像処理装置。
  27.  前記ブロック毎の特性値の積分値は、前記各ブロックに属する画素のチャンネル毎に照明成分を変換するためのゲインのチャンネル毎の総和である請求項26記載の画像処理装置。
  28.  前記ブロック毎の特性値の積分値は、前記各ブロックに属する画素の照明成分を変換するためのゲインのチャンネル毎の中央値にブロック内処理対象画像の画素の頻度値をかけたものである請求項26記載の画像処理装置。
  29.  前記加重積和部は、
     予め定義された空間軸方向の重み関数によって当該画素位置への前記ブロックヒストグラムの補間を行う第1の補間部と、
     予め定義された空間軸方向の重み関数によって当該画素位置への前記ブロック毎の特性値の補間を行う第2の補間部と、
     予め定義された輝度軸方向の重み関数によって前記補間されたブロックヒストグラムの荷重和を算出する第1の積和部と、
     予め定義された輝度軸方向の重み関数によって前記補間された特性値の荷重和を算出する第2の積和部と、
     前記第2の積和部の出力を前記第1の積和部の出力によって除算する除算部と
    を備える請求項26記載の画像処理装置。
  30.  前記加重積和部は、
     前記ブロック毎の特性値を前記ブロックヒストグラムの値で除算することによってブロック位置毎の平均特性値を計算する第1の除算部と、
     前記平均特性値と当該画素位置に関する特性値とを比較することによって重みを計算する比較部と、
     前記比較部において算出された重みを対応するブロック位置の前記ブロック毎の特性値に乗じる第1の乗算部と、
     前記比較部において算出された重みを対応するブロック位置の前記ブロックヒストグラムの値に乗じる第2の乗算部と、
     予め定義された空間軸方向の重み関数によって当該画素位置へ前記第1の乗算部の出力である重み付きブロックヒストグラムの補間を行う第1の補間部と、
     予め定義された予め定義された空間軸方向の重み関数によって当該画素位置への第2の乗算部の出力であるブロック毎の重み付き特性値の補間を行う第2の補間部と、
     予め定義された輝度軸方向の重み関数によって前記補間されたブロックヒストグラムの荷重和を算出する第1の積和部と、
     予め定義された輝度軸方向の重み関数によって前記補間された特性値の荷重和を算出する第2の積和部と、
     前記第2の積和部の出力を前記第1の積和部の出力によって除算する第2の除算部とを備える
    請求項26記載の画像処理装置。
  31.  異なる照明環境下で撮像された基準画像および処理対象画像から、各画素位置におけるチャンネル毎に照明成分を変換するためのゲインを算出するチャンネルゲイン算出手順と、
     前記ゲインを前記処理対象画像に適用するためのチャンネルゲイン適用手順と 
    を具備する画像処理方法。
  32.  空間軸方向および輝度軸方向に領域を複数に分割した各ブロックについて処理対象画像の画素の頻度値をブロックヒストグラムとして算出するブロックヒストグラム算出手順と、
     前記各ブロックに属する特性値の積分値を算出するブロック積分値算出手順と、
     ブロックヒストグラムとブロック積分値と当該画素位置の輝度値とから当該画素位置の大局ゲイン値を算出する加重積和手順と、
     前記処理対象画像に前記大局ゲイン値を適用するゲイン適用手順と
    を具備する画像処理方法。
  33.  異なる照明環境下で撮像された基準画像および処理対象画像から、各画素位置におけるチャンネル毎に照明成分を変換するためのゲインを算出するチャンネルゲイン算出手順と、
     前記ゲインを前記処理対象画像に適用するためのチャンネルゲイン適用手順と 
    をコンピュータに実行させるプログラム。
  34.  空間軸方向および輝度軸方向に領域を複数に分割した各ブロックについて処理対象画像の画素の頻度値をブロックヒストグラムとして算出するブロックヒストグラム算出手順と、
     前記各ブロックに属する特性値の積分値を算出するブロック積分値算出手順と、
     ブロックヒストグラムとブロック積分値と当該画素位置の輝度値とから当該画素位置の大局ゲイン値を算出する加重積和手順と、
     前記処理対象画像に前記大局ゲイン値を適用するゲイン適用手順と
    をコンピュータに実行させるプログラム。
PCT/JP2010/061513 2009-07-07 2010-07-07 画像処理装置、画像処理方法およびプログラム WO2011004832A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201080002486.2A CN102138329B (zh) 2009-07-07 2010-07-07 图像处理设备和图像处理方法
EP10797143.4A EP2453658A4 (en) 2009-07-07 2010-07-07 IMAGE PROCESSING DEVICE, IMAGE PROCESSING PROCESS AND CORRESPONDING PROGRAM
US13/060,904 US8659675B2 (en) 2009-07-07 2010-07-07 Image processing apparatus, image processing method, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009160954 2009-07-07
JP2009-160954 2009-07-07

Publications (1)

Publication Number Publication Date
WO2011004832A1 true WO2011004832A1 (ja) 2011-01-13

Family

ID=43429256

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/061513 WO2011004832A1 (ja) 2009-07-07 2010-07-07 画像処理装置、画像処理方法およびプログラム

Country Status (6)

Country Link
US (1) US8659675B2 (ja)
EP (1) EP2453658A4 (ja)
JP (1) JP5589585B2 (ja)
KR (1) KR20120039499A (ja)
CN (1) CN102138329B (ja)
WO (1) WO2011004832A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209246A (zh) * 2011-05-23 2011-10-05 北京工业大学 一种实时视频白平衡处理系统
CN106416216A (zh) * 2014-05-16 2017-02-15 松下知识产权经营株式会社 变换方法及变换装置

Families Citing this family (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4935925B1 (ja) * 2010-11-04 2012-05-23 カシオ計算機株式会社 撮像装置、ホワイトバランス調整方法及びホワイトバランス調整プログラム
US8988740B2 (en) * 2011-01-04 2015-03-24 Piqx Imaging Pte Ltd Scanning method and apparatus
JP2012216888A (ja) * 2011-03-31 2012-11-08 Sony Corp 画像理装置および方法、並びにプログラム
JP5743696B2 (ja) * 2011-05-06 2015-07-01 キヤノン株式会社 画像処理装置、画像処理方法及びプログラム
KR101248808B1 (ko) * 2011-06-03 2013-04-01 주식회사 동부하이텍 경계 영역의 잡음 제거 장치 및 방법
JP5895734B2 (ja) * 2011-09-05 2016-03-30 コニカミノルタ株式会社 画像処理装置及び画像処理方法
CN103975585B (zh) * 2011-12-16 2016-10-12 本田技研工业株式会社 图像处理装置
TWI516133B (zh) * 2012-01-18 2016-01-01 聯詠科技股份有限公司 影像處理裝置及方法
WO2013129646A1 (ja) * 2012-03-01 2013-09-06 株式会社ニコン A/d変換回路、及び固体撮像装置
JP2013229677A (ja) * 2012-04-24 2013-11-07 Olympus Corp 画像処理プログラム及び画像処理装置
JP6045894B2 (ja) 2012-11-30 2016-12-14 ハンファテクウィン株式会社Hanwha Techwin Co.,Ltd. 画像処理装置および画像処理方法
KR101871945B1 (ko) * 2013-01-17 2018-08-02 한화에어로스페이스 주식회사 영상 처리 장치 및 방법
JP6265625B2 (ja) * 2013-05-13 2018-01-24 キヤノン株式会社 画像処理装置及び画像処理方法
US9042643B2 (en) * 2013-06-20 2015-05-26 Himax Imaging Limited Method for demosaicking
CN103402102B (zh) * 2013-07-17 2015-12-09 广东欧珀移动通信有限公司 双摄像头摄像系统及其白平衡调节的方法与装置
JP2015070529A (ja) * 2013-09-30 2015-04-13 株式会社リコー 画像処理装置、撮像装置および画像処理方法
JP2015154307A (ja) 2014-02-17 2015-08-24 ソニー株式会社 画像処理装置、画像処理方法、およびプログラム
WO2015188359A1 (zh) * 2014-06-12 2015-12-17 深圳市大疆创新科技有限公司 一种图片处理方法、装置
US9727947B2 (en) 2015-03-23 2017-08-08 Microsoft Technology Licensing, Llc Downscaling a digital raw image frame
CN105376498A (zh) * 2015-10-16 2016-03-02 凌云光技术集团有限责任公司 一种扩展相机动态范围的图像处理方法及系统
KR20170048972A (ko) * 2015-10-27 2017-05-10 삼성전자주식회사 영상을 생성하는 방법 및 장치
JP2017099616A (ja) * 2015-12-01 2017-06-08 ソニー株式会社 手術用制御装置、手術用制御方法、およびプログラム、並びに手術システム
US10070111B2 (en) * 2015-12-22 2018-09-04 Adobe Systems Incorporated Local white balance under mixed illumination using flash photography
KR102512828B1 (ko) 2016-01-22 2023-03-22 삼성전자주식회사 이벤트 신호 처리 방법 및 장치
JP2018036102A (ja) 2016-08-30 2018-03-08 ソニーセミコンダクタソリューションズ株式会社 測距装置、および、測距装置の制御方法
KR102601853B1 (ko) * 2016-11-30 2023-11-13 엘지디스플레이 주식회사 표시장치 및 그의 영상 처리방법
JP6778602B2 (ja) * 2016-12-14 2020-11-04 三星電子株式会社Samsung Electronics Co.,Ltd. 撮像装置、画像データ生成方法および画像データ生成プログラム
US10943100B2 (en) 2017-01-19 2021-03-09 Mindmaze Holding Sa Systems, methods, devices and apparatuses for detecting facial expression
EP3571627A2 (en) 2017-01-19 2019-11-27 Mindmaze Holding S.A. Systems, methods, apparatuses and devices for detecting facial expression and for tracking movement and location including for at least one of a virtual and augmented reality system
WO2018146558A2 (en) 2017-02-07 2018-08-16 Mindmaze Holding Sa Systems, methods and apparatuses for stereo vision and tracking
CN107820069B (zh) * 2017-11-16 2020-10-27 安徽亿联智能有限公司 一种视频监控设备isp调试方法
TWI680675B (zh) * 2017-12-29 2019-12-21 聯發科技股份有限公司 影像處理裝置與相關的影像處理方法
CN110933348A (zh) * 2019-05-05 2020-03-27 唐山明天科技有限公司 一种采用动态压缩比的数字录像方法及装置
JP7467247B2 (ja) 2020-06-11 2024-04-15 キヤノン株式会社 画像処理装置、画像処理方法及びプログラム
WO2022038652A1 (ja) 2020-08-17 2022-02-24 シャープNecディスプレイソリューションズ株式会社 表示データ処理装置、画像表示システム及び表示データ処理方法
CN112288721B (zh) * 2020-10-29 2022-03-01 四川九洲电器集团有限责任公司 一种用于目标检测的马赛克多光谱图像生成方法
WO2022103427A1 (en) * 2020-11-12 2022-05-19 Innopeak Technology, Inc. Color correction of image fusion in radiance domain
US11653105B2 (en) * 2020-12-02 2023-05-16 Texas Instmments Incorporated Intensity separated local white balance correction
KR20220140369A (ko) * 2021-04-09 2022-10-18 에스케이하이닉스 주식회사 이미지 센싱 장치 및 그 동작 방법
WO2023115560A1 (zh) * 2021-12-24 2023-06-29 深圳市大疆创新科技有限公司 图像处理方法、装置及存储介质
CN114466477A (zh) * 2021-12-31 2022-05-10 珠海雷特科技股份有限公司 多通道光源的恒流调光方法、计算机装置及计算机可读存储介质
KR20230160096A (ko) * 2022-05-16 2023-11-23 주식회사 실리콘아츠 에지 선명도의 조정이 가능한 초해상화 이미지 생성 장치 및 방법
TWI787134B (zh) * 2022-05-26 2022-12-11 國立臺灣大學 一種用於快速雜訊抑制對比度增強的資料處理方法及包含其的影像採集和處理系統

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005102116A (ja) * 2003-09-04 2005-04-14 Sony Corp 画像処理方法、および画像処理装置、並びにコンピュータ・プログラム
JP2005210485A (ja) 2004-01-23 2005-08-04 Sony Corp 画像処理方法、および画像処理装置、並びにコンピュータ・プログラム
JP2005347935A (ja) * 2004-06-01 2005-12-15 Sony Corp 画像処理装置、および画像処理方法、並びにコンピュータ・プログラム
JP2006067561A (ja) 2004-07-06 2006-03-09 Microsoft Corp フラッシュあり/フラッシュなしの拡張を用いるデジタル写真
JP3889017B2 (ja) 2003-10-30 2007-03-07 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. 取り込まれた画像を補正するシステム及び方法
JP2007129622A (ja) * 2005-11-07 2007-05-24 Konica Minolta Holdings Inc 撮像装置、画像処理装置、画像処理方法及び画像処理プログラム

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3540485B2 (ja) * 1995-04-13 2004-07-07 株式会社リコー 電子スチルカメラ
KR100384269B1 (ko) * 1999-03-24 2003-05-16 마쯔시다덴기산교 가부시키가이샤 화상처리장치 및 처리방법
US20020118967A1 (en) * 2000-12-22 2002-08-29 Funston David L. Color correcting flash apparatus, camera, and method
JP2004096506A (ja) * 2002-08-30 2004-03-25 Konica Minolta Holdings Inc 画像形成方法、画像処理装置及び画像記録装置
US7428997B2 (en) * 2003-07-29 2008-09-30 Microvision, Inc. Method and apparatus for illuminating a field-of-view and capturing an image
JP2005064853A (ja) * 2003-08-12 2005-03-10 Minolta Co Ltd 撮像装置、プログラム、および色バランス補正方法
JP4740602B2 (ja) * 2005-01-19 2011-08-03 イーストマン コダック カンパニー オートホワイトバランス装置及びホワイトバランス調整方法
JP5049490B2 (ja) * 2005-12-19 2012-10-17 イーストマン コダック カンパニー デジタルカメラ、ゲイン算出装置
US7903168B2 (en) * 2006-04-06 2011-03-08 Eastman Kodak Company Camera and method with additional evaluation image capture based on scene brightness changes
US7698351B1 (en) * 2006-04-28 2010-04-13 Netapp, Inc. GUI architecture for namespace and storage management
US7893975B2 (en) * 2006-10-13 2011-02-22 Apple Inc. System and method for processing images using predetermined tone reproduction curves
TW200820797A (en) * 2006-10-23 2008-05-01 Benq Corp Photographing methods and systems, and machine readable medium thereof
JP2009130630A (ja) * 2007-11-22 2009-06-11 Canon Inc 色処理装置およびその方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005102116A (ja) * 2003-09-04 2005-04-14 Sony Corp 画像処理方法、および画像処理装置、並びにコンピュータ・プログラム
JP3889017B2 (ja) 2003-10-30 2007-03-07 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. 取り込まれた画像を補正するシステム及び方法
JP2005210485A (ja) 2004-01-23 2005-08-04 Sony Corp 画像処理方法、および画像処理装置、並びにコンピュータ・プログラム
JP2005347935A (ja) * 2004-06-01 2005-12-15 Sony Corp 画像処理装置、および画像処理方法、並びにコンピュータ・プログラム
JP2006067561A (ja) 2004-07-06 2006-03-09 Microsoft Corp フラッシュあり/フラッシュなしの拡張を用いるデジタル写真
JP2007129622A (ja) * 2005-11-07 2007-05-24 Konica Minolta Holdings Inc 撮像装置、画像処理装置、画像処理方法及び画像処理プログラム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2453658A4

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209246A (zh) * 2011-05-23 2011-10-05 北京工业大学 一种实时视频白平衡处理系统
CN106416216A (zh) * 2014-05-16 2017-02-15 松下知识产权经营株式会社 变换方法及变换装置
CN106416216B (zh) * 2014-05-16 2019-07-12 松下知识产权经营株式会社 变换方法及变换装置
CN110278345A (zh) * 2014-05-16 2019-09-24 松下知识产权经营株式会社 变换方法、变换装置以及图像显示装置
CN110278345B (zh) * 2014-05-16 2022-08-02 松下知识产权经营株式会社 变换方法、变换装置以及图像显示装置

Also Published As

Publication number Publication date
EP2453658A1 (en) 2012-05-16
EP2453658A4 (en) 2013-06-12
US20120274798A1 (en) 2012-11-01
KR20120039499A (ko) 2012-04-25
JP2011035894A (ja) 2011-02-17
CN102138329B (zh) 2014-03-12
CN102138329A (zh) 2011-07-27
JP5589585B2 (ja) 2014-09-17
US8659675B2 (en) 2014-02-25

Similar Documents

Publication Publication Date Title
JP5589585B2 (ja) 画像処理装置、画像処理方法およびプログラム
US8526729B2 (en) Image processing apparatus and method, and program
US8493473B2 (en) System and method for RAW image processing
US7893975B2 (en) System and method for processing images using predetermined tone reproduction curves
US9767544B2 (en) Scene adaptive brightness/contrast enhancement
US7835569B2 (en) System and method for raw image processing using conversion matrix interpolated from predetermined camera characterization matrices
US7738699B2 (en) Image processing apparatus
JP5254466B2 (ja) ハイダイナミックレンジイメージ合成
JP5597717B2 (ja) 撮像素子における欠陥画素の検出及び補正のためのシステム及び方法
US8582923B2 (en) Image processing apparatus, image processsing method, and program
US8305487B2 (en) Method and apparatus for controlling multiple exposures
JP4678218B2 (ja) 撮像装置及び画像処理方法
JP4946581B2 (ja) 画像処理装置
JP2013509093A (ja) 重み付け勾配を利用した画像データのデモザイク処理のためのシステム及び方法
KR20180048627A (ko) 역 톤 매핑을 위한 방법 및 장치
WO2015119271A1 (ja) 画像処理装置、撮像装置、画像処理方法、コンピュータにより処理可能な一時的でない記憶媒体
US20200228770A1 (en) Lens rolloff assisted auto white balance
JP5315125B2 (ja) 画像処理装置、撮像装置、および合成画像の生成方法
JP2018133658A (ja) 画像処理装置、制御方法およびプログラム

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080002486.2

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 2010797143

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 211483

Country of ref document: IL

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10797143

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20117005169

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 13060904

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE