JP4905513B2 - Image processing method, image processing apparatus, and computer program - Google Patents

Image processing method, image processing apparatus, and computer program Download PDF

Info

Publication number
JP4905513B2
JP4905513B2 JP2009165927A JP2009165927A JP4905513B2 JP 4905513 B2 JP4905513 B2 JP 4905513B2 JP 2009165927 A JP2009165927 A JP 2009165927A JP 2009165927 A JP2009165927 A JP 2009165927A JP 4905513 B2 JP4905513 B2 JP 4905513B2
Authority
JP
Japan
Prior art keywords
image
correction
flash
white balance
adjustment
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
JP2009165927A
Other languages
Japanese (ja)
Other versions
JP2009296608A (en
Inventor
類 山田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2009165927A priority Critical patent/JP4905513B2/en
Publication of JP2009296608A publication Critical patent/JP2009296608A/en
Application granted granted Critical
Publication of JP4905513B2 publication Critical patent/JP4905513B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Indication In Cameras, And Counting Of Exposures (AREA)
  • Adjustment Of Camera Lenses (AREA)
  • Studio Devices (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To generate a high-quality image through virtual adjustment processing of flash light intensity in image correction, based on images photographed with or without emitting flash light. <P>SOLUTION: A flash component image is calculated, on the basis of a first image photographed without emitting a flash light and a second image photographed with emitting the flash light, and an intensity adjustment flash component image generated by carrying out an intensity adjustment of the flash component image is applied to generate a final adjustment image. The present configuration makes it possible to generate a high-quality image, with which saturation pixels, namely, white-out is reduced in an image of non-linear transformation, such as gamma correction. <P>COPYRIGHT: (C)2010,JPO&amp;INPIT

Description

本発明は、画像処理方法、および画像処理装置、並びにコンピュータ・プログラムに関する。さらに詳細には、フラッシュ光を発光して撮影した画像と、発光させずに撮影した画像とを用いた画素値補正処理を実行するとともに最適なフラッシュ強度を推定し、推定結果に基づいた補正を行なうことで高品質な画像の生成を可能とした画像処理方法、および画像処理装置、並びにコンピュータ・プログラムに関する。   The present invention relates to an image processing method, an image processing apparatus, and a computer program. More specifically, a pixel value correction process using an image shot with flash light and an image shot without flash is executed, the optimal flash intensity is estimated, and correction based on the estimation result is performed. The present invention relates to an image processing method, an image processing apparatus, and a computer program that can generate a high-quality image.

フラッシュ(electrical flash,strobe)は、カメラ撮影時に補助光源として用いられる。近年DSC(Digital Still Camera)が急速に普及しているが、DSCにおいても、しばしば、フラッシュ撮影が行われる。フラッシュを使うことにより、フィルインライト(人物の顔に影がきつく出過ぎるときなどに影を弱める技法)、逆光補正(太陽を背にした人物を撮る場合などに顔が黒くつぶれるのを防ぐ技法)、キャッチライト(眼の瞳にきらりと光る「光の点」を入れ、瞳を美しく撮影する技法)、あるいは日中シンクロ(デイライトシンクロ、昼間や夕方に補助光線として使うテクニック)等、様々な写真撮影を行うことができる。一方で、フラッシュ撮影を行うと、色バランスが崩れたり、白飛びが生じたりする場合がある。本発明は、このようなフラッシュ撮影で生じる良くない現象を補正可能な適切な手段を提供することを1つの目的とする。   A flash (electric flash, strobe) is used as an auxiliary light source during camera photography. In recent years, DSC (Digital Still Camera) is rapidly spreading, but flash photography is often performed also in DSC. By using a flash, fill-in light (a technique that weakens the shadow when the shadow of a person's face is too hard), backlight correction (a technique that prevents the face from being blackened when shooting a person with the sun behind), A variety of photos such as catchlight (a technique that shoots the eyes beautifully by putting a "spot of light" that shines in the eyes of the eyes), or daytime synchro (daylight sync, a technique used as an auxiliary beam in the daytime and evening) Shooting can be performed. On the other hand, when flash photography is performed, color balance may be lost or whiteout may occur. An object of the present invention is to provide an appropriate means capable of correcting such a bad phenomenon caused by flash photography.

一般的に、デジタルカメラでは、白い被写体が白く撮影されるようにホワイトバランス(WB)調整が行われる。例えば自然光、照明光、フラッシュ(ストロボ)等の被写体に対して照射される光の色温度が高くブルー(B)の光が強い光成分環境で撮影する場合は、ブルーの光に対する感度を抑制し、レッド(R)の光に対する感度を相対的に高くし、逆に被写体に対して照射される光の色温度が低くレッド(R)の光が強い光成分環境で撮影する場合は、レッドの光に対する感度を抑制し、ブルー(B)の光に対する感度を相対的に高くするなどのホワイトバランス調整が行われる。   Generally, in a digital camera, white balance (WB) adjustment is performed so that a white subject is photographed white. For example, when shooting in a light component environment where the color temperature of the light irradiated to the subject, such as natural light, illumination light, or flash (strobe) is high and blue (B) is strong, the sensitivity to blue light is suppressed. When shooting in a light component environment where the sensitivity to light of red (R) is relatively high and the color temperature of light irradiated to the subject is low and the light of red (R) is strong, White balance adjustment such as suppressing sensitivity to light and relatively increasing sensitivity to blue (B) light is performed.

ホワイトバランス調整は、通常、撮影時に用いる光源に応じた調整パラメータを設定した調整処理が実行される。例えばフラッシュ撮影を行う場合は、適用するフラッシュ光の持つ光成分に応じたパラメータに従ってホワイトバランス調整が行われる。   In the white balance adjustment, an adjustment process in which an adjustment parameter corresponding to a light source used at the time of shooting is set is usually executed. For example, when flash photography is performed, white balance adjustment is performed according to parameters according to the light component of the flash light to be applied.

しかし、フラッシュ光以外の外光がある状態で、フラッシュ撮影を行うと、フラッシュ光、外光の2種類の光が被写体に照射されてその反射光がカメラの撮像素子に到達し、撮影が行われることになる。このような撮影が行われる場合、ホワイトバランス調整をフラッシュ光に合わせて実施すると、フラッシュ光が多く当たっている被写体部分は自然な色に調整されるが、フラッシュ光が届かず外光のみの反射光として撮影される領域、例えば背景画像領域などは、フラッシュ光の光成分に合わせたパラメータ設定に従ったホワイトバランス調整を行ってしまうと、適切なホワイトバランス調整が実行されず不自然な色を持つ領域として出力されることになる。   However, if flash photography is performed in the presence of external light other than flash light, the subject is irradiated with two types of light, flash light and external light, and the reflected light reaches the image sensor of the camera, and photography is performed. It will be. When such shooting is performed, if white balance adjustment is performed according to the flash light, the subject area that is exposed to the flash light is adjusted to a natural color, but the flash light does not reach and only the external light is reflected. If the white balance adjustment according to the parameter setting according to the light component of the flash light is performed on the area captured as light, for example, the background image area, the appropriate white balance adjustment is not performed and an unnatural color is displayed. It will be output as the area you have.

逆に、背景部分にあわせたホワイトバランス調整、すなわち外光のみによって撮影されたものとして、撮影画像全体のホワイトバランス調整を実行するとフラッシュ光の多くあたった部分が不自然な色に調整されることになる。   On the other hand, if the white balance adjustment according to the background, that is, the image was shot only with outside light, the white balance adjustment of the entire shot image will be performed, and the part that is exposed to a lot of flash light will be adjusted to an unnatural color. become.

このような問題に対処するための構成がいくつか提案されている。例えば特許文献1は、フラッシュを発光せず撮影した画像と、フラッシュを発光させた撮影画像を取得し、この撮影された2つの画像をブロックに分割し、各ブロック毎に輝度値の比較を行い、輝度値の比較結果に基づいて、フラッシュを発光して撮影した画像について各ブロック毎に異なるホワイトバランス調整を行う構成を示している。   Several configurations for dealing with such problems have been proposed. For example, Patent Document 1 acquires an image shot without flash and a shot image with flash emitted, divides the two shot images into blocks, and compares brightness values for each block. FIG. 3 shows a configuration in which different white balance adjustment is performed for each block on an image captured by emitting a flash based on a comparison result of luminance values.

ホワイトバランス調整は、各ブロック毎にフラッシュ光に合わせたホワイトバランス調整、またはフラッシュ光と外光の中間にあわせたホワイトバランス調整、または外光にあわせたホワイトバランス調整のいづれかを選択して実行する。しかし、このような構成では、処理をブロック単位で行うことが必要となり、ブロック歪みを生ずる問題や被写体が動いた場合などには正しい処理ができない問題などがある。   White balance adjustment is performed by selecting either white balance adjustment according to the flash light, white balance adjustment between the flash light and external light, or white balance adjustment according to the external light for each block. . However, in such a configuration, it is necessary to perform processing in units of blocks, and there are problems such as block distortion, and problems that cannot be performed correctly when the subject moves.

また、特許文献2には、以下の処理構成を開示している。すなわち、まず絞りを開放し露出時間を短くした上でフラッシュを発光させて撮影し、その後、本来意図した露光条件でフラッシュを発光せずに撮影を行う。ここで、前者を第1画像、後者を第2画像とする。さらに第1画像において所定のレベル以上の画素を主要被写体領域、それ以外を背景領域として登録する。その後、第1画像をフラッシュに合わせてホワイトバランス調整、第2画像を外光に合わせてホワイトバランス調整し、第1画像の主要被写体領域と第2画像の背景領域を組み合わせて最終的な記録画像とする構成である。   Patent Document 2 discloses the following processing configuration. That is, first, the aperture is opened and the exposure time is shortened, and the flash is emitted to take a picture. Thereafter, the picture is taken without the flash being emitted under the originally intended exposure conditions. Here, the former is a first image and the latter is a second image. Further, in the first image, a pixel having a predetermined level or higher is registered as a main subject area, and the other is registered as a background area. After that, the first image is adjusted to the white balance according to the flash, the second image is adjusted to the white balance according to the outside light, and the final recorded image is obtained by combining the main subject area of the first image and the background area of the second image. The configuration is as follows.

しかし、本構成では、外光とフラッシュ光の両方が当たった被写体のホワイトバランス調整は正しく行うことができない。   However, with this configuration, white balance adjustment cannot be performed correctly for a subject that has been exposed to both external light and flash light.

また、特許文献3は、上述の特許文献2の構成に加えて、像ぶれ検出手段を付加した構成を開示している。ぶれがあると判断された場合は、前述の第1画像をそのまま記録画像とし、第1画像と第2画像の組み合わせ処理を実行しない構成としている。従ってぶれが検出された場合は、フラッシュ光と外光の色温度の違いに起因する不自然さが解消されないことになる。   Patent Document 3 discloses a configuration in which image blur detection means is added to the configuration of Patent Document 2 described above. When it is determined that there is blurring, the first image is used as a recorded image as it is, and the combination processing of the first image and the second image is not executed. Therefore, when blur is detected, unnaturalness caused by the difference in color temperature between the flash light and the external light cannot be resolved.

さらに、特許文献4は、フラッシュを発光させて撮影した画像と、フラッシュ発光なしで撮影した画像の対応画素の輝度値を割り算し、フラッシュ光の寄与率を求め、この寄与率に基づき、フラッシュを発光させて撮影した画像に対してホワイトバランス調整を行う構成を開示している。   Further, Patent Document 4 divides the luminance value of the corresponding pixel of the image shot with the flash emitted and the image shot without the flash emission to determine the contribution rate of the flash light, and based on this contribution rate, A configuration is disclosed in which white balance adjustment is performed on an image shot with light emission.

しかし、本構成では、フラッシュ光、外光からの反射光が混合され撮像された画像に対し、フラッシュの寄与率に基づきフラッシュ光と外光用のホワイトバランスパラメータを、単純に補間し、最終的な画像を生成する。しかし、物理的な光の反射モデルを考慮した場合、フラッシュ光による成分と外光による成分は独立に処理されるべきであり、フラッシュ光、外光からの反射光が混合され撮像された画像を処理するだけでは、最適な結果画像を生成することは出来ない。   However, in this configuration, the white balance parameter for flash light and external light is simply interpolated based on the contribution ratio of the flash light and the image captured by mixing the reflected light from the flash light and external light, and finally A simple image. However, when considering the physical light reflection model, the component due to flash light and the component due to external light should be processed independently. An optimum result image cannot be generated only by processing.

特開平8−51632号公報JP-A-8-51632 特開2000−308068号公報JP 2000-308068 A 特開2000−307940号公報JP 2000-307940 A 特開平8−340542号公報JP-A-8-340542

本発明は、上述の従来技術の問題点に鑑みてなされたものであり、外光とフラッシュ光が混在する環境下で撮影した画像の最適なホワイトバランス調整を可能とし、また、フラッシュ光の強度が強すぎたり、あるいは弱すぎたりといった場合に最適なフラッシュ光の強度を推定して、推定した最適なフラッシュ光強度に対応した調整画像に基づく補正を行なうことで、高品質な画像を生成することを可能とした画像処理方法、および画像処理装置、並びにコンピュータ・プログラムを提供することを目的とする。   The present invention has been made in view of the above-described problems of the prior art, and enables an optimal white balance adjustment of an image taken in an environment where external light and flash light are mixed, and the intensity of the flash light. If the light intensity is too strong or too weak, the optimal flash light intensity is estimated, and correction based on the adjusted image corresponding to the estimated optimal flash light intensity is performed to generate a high-quality image. It is an object of the present invention to provide an image processing method, an image processing apparatus, and a computer program that enable this.

本発明の第1の側面は、
フラッシュを発光させずに撮影した第1の画像と、フラッシュを発光させて撮影した第2の画像とに基づいてフラッシュ成分画像を算出するフラッシュ成分画像算出ステップと、
前記フラッシュ成分画像の強度調整値を算出する強度調整値算出ステップと、
前記強度調整値を適用して、強度調整フラッシュ成分画像を算出する強度調整フラッシュ成分画像算出ステップと、
前記第1の画像と前記強度調整フラッシュ成分画像とに基づいて最終調整画像を生成する最終調整画像生成ステップと、
前記第1の画像と、フラッシュを発光させずに撮影した第3の画像とに基づく動き検出を実行する動き検出ステップと、
前記動き検出ステップにおいて検出した動き部分の領域の大きさに応じて補正可否を判定する補正可否判定ステップと、
前記補正可否判定ステップにおいて補正可能と判定した場合は、前記動き検出ステップにおいて検出した動き部分の画素値補正を実行し、前記補正可否判定ステップにおいて補正不可能と判定した場合は、前記フラッシュを発光させて撮影した第2の画像の画素値補正を実行するホワイトバランス調整ステップと、
を有することを特徴とする画像処理方法にある。
The first aspect of the present invention is:
A flash component image calculating step for calculating a flash component image based on a first image captured without flashing and a second image captured with flash firing;
An intensity adjustment value calculating step for calculating an intensity adjustment value of the flash component image;
Applying the intensity adjustment value to calculate an intensity adjustment flash component image to calculate an intensity adjustment flash component image; and
A final adjusted image generating step for generating a final adjusted image based on the first image and the intensity adjusted flash component image;
A motion detection step of performing motion detection based on the first image and a third image taken without flashing;
A correction propriety determination step for determining whether correction is possible or not according to the size of the region of the motion part detected in the motion detection step;
If it is determined that correction is possible in the correction possibility determination step, the pixel value correction of the motion part detected in the motion detection step is executed, and if it is determined that correction is impossible in the correction possibility determination step, the flash is emitted. A white balance adjustment step of performing pixel value correction of the second image captured
An image processing method characterized by comprising:

さらに、本発明の画像処理方法の一実施態様において、前記フラッシュ成分画像算出ステップは、前記第1の画像と第2の画像との差分画像データを算出するステップと、前記差分画像データに対して、フラッシュ光成分に対応するパラメータに基づくホワイトバランス調整処理を実行するステップとを含み、前記強度調整値算出ステップは、前記ホワイトバランス調整処理のなされたフラッシュ成分画像の強度調整値を算出するステップであることを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the flash component image calculating step includes a step of calculating difference image data between the first image and the second image, and for the difference image data Executing a white balance adjustment process based on a parameter corresponding to the flash light component, and the intensity adjustment value calculating step is a step of calculating an intensity adjustment value of the flash component image subjected to the white balance adjustment process. It is characterized by being.

さらに、本発明の画像処理方法の一実施態様において、前記最終調整画像生成ステップは、
(a)前記第1の画像について、外光成分に対応するパラメータに基づくホワイトバランス調整処理を実行したホワイトバランス調整済みの第1の画像と、
(b)フラッシュ光成分に対応するパラメータに基づくホワイトバランス調整処理を実行したフラッシュ成分画像に対して強度調整を実行した強度調整フラッシュ成分画像と、
上記(a)および(b)の2画像に基づいて最終調整画像の生成処理を実行するステップであることを特徴とする。
Furthermore, in one embodiment of the image processing method of the present invention, the final adjusted image generation step includes:
(A) For the first image, a white balance adjusted first image that has been subjected to white balance adjustment processing based on a parameter corresponding to an external light component;
(B) an intensity-adjusted flash component image obtained by performing intensity adjustment on a flash component image obtained by performing white balance adjustment processing based on a parameter corresponding to the flash light component;
It is a step of executing a final adjusted image generation process based on the two images (a) and (b).

さらに、本発明の画像処理方法の一実施態様において、前記強度調整値算出ステップは、外光成分対応パラメータに基づくホワイトバランス調整処理を実行した前記第1の画像と、フラッシュ光成分対応パラメータに基づくホワイトバランス調整処理を実行したフラッシュ成分画像との合成画像に基づいて生成する非線形変換処理画像中の飽和画素値を持つ画素数を抑制する調整値として前記強度調整値を算出することを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the intensity adjustment value calculation step is based on the first image that has been subjected to white balance adjustment processing based on the external light component correspondence parameter and the flash light component correspondence parameter. The intensity adjustment value is calculated as an adjustment value for suppressing the number of pixels having a saturated pixel value in a non-linear conversion processing image generated based on a composite image with a flash component image subjected to white balance adjustment processing. .

さらに、本発明の画像処理方法の一実施態様において、前記非線形変換処理は、ガンマ補正であり、前記強度調整値算出ステップは、ガンマ補正画像中の飽和画素値を持つ画素数を抑制する調整値として前記強度調整値を算出することを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the nonlinear conversion processing is gamma correction, and the intensity adjustment value calculation step includes an adjustment value that suppresses the number of pixels having a saturated pixel value in the gamma correction image. The intensity adjustment value is calculated as follows.

さらに、本発明の画像処理方法の一実施態様において、前記画像処理方法は、さらに、フラッシュの発光を制御して、前記第1の画像と、前記第2の画像を含む複数画像の撮影を実行する撮影ステップを有することを特徴とする。   Furthermore, in an embodiment of the image processing method of the present invention, the image processing method further controls the flash emission to execute shooting of a plurality of images including the first image and the second image. And a photographing step.

さらに、本発明の第2の側面は、
画像処理装置であり、
フラッシュを発光させずに撮影した第1の画像と、フラッシュを発光させて撮影した第2の画像とに基づいてフラッシュ成分画像を算出するフラッシュ成分画像算出部と、
前記フラッシュ成分画像の強度調整値を算出する強度調整値算出部と、
前記強度調整値を適用して、強度調整フラッシュ成分画像を算出する強度調整フラッシュ成分画像算出部と、
前記第1の画像と、フラッシュを発光させずに撮影した第3の画像とに基づく動き検出を実行する動き検出部と、
前記動き検出部において検出した動き部分の領域の大きさに応じて補正可否を判定する補正可否判定部と、
前記補正可否判定部が補正可能と判定した場合は、前記動き検出部が検出した動き部分の画素値補正を実行し、前記補正可否判定部が補正不可能と判定した場合は、前記フラッシュを発光させて撮影した第2の画像に対する画素値補正を実行するホワイトバランス調整部と、
を有することを特徴とする画像処理装置にある。
Furthermore, the second aspect of the present invention provides
An image processing device,
A flash component image calculating unit that calculates a flash component image based on a first image captured without the flash being emitted and a second image captured with the flash being emitted;
An intensity adjustment value calculation unit for calculating an intensity adjustment value of the flash component image;
Applying the intensity adjustment value to calculate an intensity adjustment flash component image, an intensity adjustment flash component image calculation unit;
A motion detection unit that performs motion detection based on the first image and a third image captured without flashing;
A correction propriety determination unit that determines whether correction is possible according to the size of the region of the motion part detected by the motion detection unit;
When the correction availability determination unit determines that correction is possible, the pixel value correction of the motion part detected by the motion detection unit is performed, and when the correction availability determination unit determines that correction is not possible, the flash is emitted. A white balance adjustment unit that performs pixel value correction on the second image that has been captured,
An image processing apparatus characterized by comprising:

さらに、本発明の画像処理装置の一実施態様において、前記フラッシュ成分画像算出部は、前記第1の画像と第2の画像との差分画像データを算出する差分画像算出部と、前記差分画像データに対して、フラッシュ光成分に対応するパラメータに基づくホワイトバランス調整処理を実行するホワイトバランス調整部とを含み、前記強度調整値算出部は、前記ホワイトバランス調整処理のなされたフラッシュ成分画像の強度調整値を算出する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the flash component image calculation unit includes a difference image calculation unit that calculates difference image data between the first image and the second image, and the difference image data. A white balance adjustment unit that executes a white balance adjustment process based on a parameter corresponding to the flash light component, and the intensity adjustment value calculation unit adjusts the intensity of the flash component image that has been subjected to the white balance adjustment process. It is the structure which calculates a value, It is characterized by the above-mentioned.

さらに、本発明の画像処理装置の一実施態様において、前記最終調整画像生成部は、
(a)前記第1の画像について、外光成分に対応するパラメータに基づくホワイトバランス調整処理を実行したホワイトバランス調整済みの第1の画像と、
(b)フラッシュ光成分に対応するパラメータに基づくホワイトバランス調整処理を実行したフラッシュ成分画像に対して強度調整を実行した強度調整フラッシュ成分画像と、
上記(a)および(b)の2画像に基づいて最終調整画像の生成処理を実行する構成であることを特徴とする。
Furthermore, in one embodiment of the image processing apparatus of the present invention, the final adjusted image generation unit includes:
(A) For the first image, a white balance adjusted first image that has been subjected to white balance adjustment processing based on a parameter corresponding to an external light component;
(B) an intensity-adjusted flash component image obtained by performing intensity adjustment on a flash component image obtained by performing white balance adjustment processing based on a parameter corresponding to the flash light component;
The present invention is characterized in that the final adjusted image generation processing is executed based on the two images (a) and (b).

さらに、本発明の画像処理装置の一実施態様において、前記強度調整値算出部は、外光成分対応パラメータに基づくホワイトバランス調整処理を実行した前記第1の画像と、フラッシュ光成分対応パラメータに基づくホワイトバランス調整処理を実行したフラッシュ成分画像との合成画像に基づいて生成する非線形変換処理画像中の飽和画素値を持つ画素数を抑制する調整値として前記強度調整値を算出する構成であることを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the intensity adjustment value calculation unit is based on the first image on which the white balance adjustment processing based on the external light component correspondence parameter is executed and the flash light component correspondence parameter. The intensity adjustment value is calculated as an adjustment value for suppressing the number of pixels having a saturated pixel value in a nonlinear conversion processed image generated based on a composite image with a flash component image subjected to white balance adjustment processing. Features.

さらに、本発明の画像処理装置の一実施態様において、前記非線形変換処理は、ガンマ補正であり、前記強度調整値算出部は、ガンマ補正画像中の飽和画素値を持つ画素数を抑制する調整値として前記強度調整値を算出する構成であることを特徴とする。   Furthermore, in one embodiment of the image processing apparatus of the present invention, the nonlinear conversion processing is gamma correction, and the intensity adjustment value calculation unit adjusts the number of pixels having a saturated pixel value in the gamma corrected image. The intensity adjustment value is calculated as follows.

さらに、本発明の画像処理装置の一実施態様において、前記画像処理装置は、さらに、フラッシュの発光を制御して、前記第1の画像と、前記第2の画像を含む複数画像の撮影を実行する撮像部を有することを特徴とする。   Furthermore, in an embodiment of the image processing apparatus of the present invention, the image processing apparatus further controls the flash emission to capture a plurality of images including the first image and the second image. It has the imaging part which performs.

さらに、本発明の第3の側面は、
フラッシュを発光させずに撮影した第1の画像と、フラッシュを発光させて撮影した第2の画像とに基づいてフラッシュ成分画像を算出するフラッシュ成分画像算出ステップと、
前記フラッシュ成分画像の強度調整値を算出する強度調整値算出ステップと、
前記強度調整値を適用して、強度調整フラッシュ成分画像を算出する強度調整フラッシュ成分画像算出ステップと、
前記第1の画像と前記強度調整フラッシュ成分画像とに基づいて最終調整画像を生成する最終調整画像生成ステップと、
前記第1の画像と、フラッシュを発光させずに撮影した第3の画像とに基づく動き検出を実行する動き検出ステップと、
前記動き検出ステップにおいて検出した動き部分の領域の大きさに応じて補正可否を判定する補正可否判定ステップと、
前記補正可否判定ステップにおいて補正可能と判定した場合は、前記動き検出ステップにおいて検出した動き部分の画素値補正を実行し、前記補正可否判定ステップにおいて補正不可能と判定した場合は、前記フラッシュを発光させて撮影した第2の画像の画素値補正を実行するホワイトバランス調整ステップと、
を有することを特徴とするコンピュータ・プログラムにある。
Furthermore, the third aspect of the present invention provides
A flash component image calculating step for calculating a flash component image based on a first image captured without flashing and a second image captured with flash firing;
An intensity adjustment value calculating step for calculating an intensity adjustment value of the flash component image;
Applying the intensity adjustment value to calculate an intensity adjustment flash component image to calculate an intensity adjustment flash component image; and
A final adjusted image generating step for generating a final adjusted image based on the first image and the intensity adjusted flash component image;
A motion detection step of performing motion detection based on the first image and a third image taken without flashing;
A correction propriety determination step for determining whether correction is possible or not according to the size of the region of the motion part detected in the motion detection step;
If it is determined that correction is possible in the correction possibility determination step, the pixel value correction of the motion part detected in the motion detection step is executed, and if it is determined that correction is impossible in the correction possibility determination step, the flash is emitted. A white balance adjustment step of performing pixel value correction of the second image captured
There is a computer program characterized by comprising:

なお、本発明のコンピュータ・プログラムは、例えば、様々なプログラム・コードを実行可能な汎用コンピュータ・システムに対して、コンピュータ可読な形式で提供する記憶媒体、通信媒体、例えば、CDやFD、MOなどの記憶媒体、あるいは、ネットワークなどの通信媒体によって提供可能なコンピュータ・プログラムである。このようなプログラムをコンピュータ可読な形式で提供することにより、コンピュータ・システム上でプログラムに応じた処理が実現される。   The computer program of the present invention is, for example, a storage medium or communication medium provided in a computer-readable format to a general-purpose computer system capable of executing various program codes, such as a CD, FD, MO, etc. Or a computer program that can be provided by a communication medium such as a network. By providing such a program in a computer-readable format, processing corresponding to the program is realized on the computer system.

本発明のさらに他の目的、特徴や利点は、後述する本発明の実施例や添付する図面に基づく、より詳細な説明によって明らかになるであろう。なお、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。   Other objects, features, and advantages of the present invention will become apparent from a more detailed description based on embodiments of the present invention described later and the accompanying drawings. In this specification, the system is a logical set configuration of a plurality of devices, and is not limited to one in which the devices of each configuration are in the same casing.

本発明の構成によれば、フラッシュを発光させずに撮影した第1の画像と、フラッシュを発光させて撮影した第2の画像とに基づいてフラッシュ成分画像を算出し、該フラッシュ成分画像の強度調整を実行して生成した強度調整フラッシュ成分画像を適用して最終調整画像を生成する構成としたので、出力画像を生成する際に実行されるガンマ補正などの非線形変換処理後の画像における飽和画素値を持つ画素、すなわち白とびを削減した高品質な画像を生成することが可能となる。   According to the configuration of the present invention, the flash component image is calculated based on the first image captured without the flash and the second image captured with the flash, and the intensity of the flash component image is calculated. Saturated pixels in the image after nonlinear conversion processing such as gamma correction executed when generating the output image because the final adjusted image is generated by applying the intensity adjusted flash component image generated by executing adjustment It is possible to generate a high-quality image in which pixels having values, that is, overexposure are reduced.

さらに、本発明の構成によれば、フラッシュを発光させずに撮影した第1の画像について、外光成分に対応するパラメータに基づくホワイトバランス調整処理を実行してホワイトバランス調整済みの第1の画像を生成し、さらに、フラッシュ成分画像に対してフラッシュ光成分に対応するパラメータに基づくホワイトバランス調整処理を実行したフラッシュ成分画像を強度調整して、これらの画像に基づいて、最終調整画像を生成する構成としたので、個々の画像に対応するパラメータを用いた最適なホワイトバランス調整が実行される。   Further, according to the configuration of the present invention, the first image that has been subjected to the white balance adjustment by executing the white balance adjustment process based on the parameter corresponding to the external light component is performed on the first image that is taken without emitting the flash. Further, the intensity of the flash component image that has been subjected to the white balance adjustment process based on the parameter corresponding to the flash light component is adjusted for the flash component image, and the final adjusted image is generated based on these images. Since it is configured, optimal white balance adjustment using parameters corresponding to individual images is executed.

本発明の画像処理装置の構成を示す図である。It is a figure which shows the structure of the image processing apparatus of this invention. 本発明の画像処理方法の手順を説明するフローチャートである。It is a flowchart explaining the procedure of the image processing method of this invention. 本発明の画像処理方法における複数の画像データに基づくホワイトバランス調整処理の手順を説明するフローチャートである。It is a flowchart explaining the procedure of the white balance adjustment process based on several image data in the image processing method of this invention. 本発明の画像処理方法における強度調整フラッシュ成分画像の生成処理手順を説明するフローチャートである。It is a flowchart explaining the production | generation processing procedure of the intensity | strength adjustment flash component image in the image processing method of this invention. 本発明の画像処理における強度調整フラッシュ成分画像の生成処理の詳細について説明する図である。It is a figure explaining the detail of the production | generation process of the intensity | strength adjustment flash component image in the image processing of this invention. 本発明の画像処理における強度調整フラッシュ成分画像の生成処理の詳細について説明する図である。It is a figure explaining the detail of the production | generation process of the intensity | strength adjustment flash component image in the image processing of this invention. 本発明の画像処理における強度調整フラッシュ成分画像の生成処理の詳細について説明する図である。It is a figure explaining the detail of the production | generation process of the intensity | strength adjustment flash component image in the image processing of this invention. 本発明の画像処理における複数の画像データに基づく画素値調整処理を実行する機構を説明する図である。It is a figure explaining the mechanism which performs pixel value adjustment processing based on a plurality of image data in image processing of the present invention.

以下、図面を参照しながら、本発明の詳細について説明する。図1は、本発明に係る画像処理装置の一構成例を示すものであり、撮像部を備えた画像処理装置例を示している。   Hereinafter, the details of the present invention will be described with reference to the drawings. FIG. 1 shows a configuration example of an image processing apparatus according to the present invention, and shows an example of an image processing apparatus provided with an imaging unit.

図1に示す画像処理装置は、レンズ101、絞り102、固体撮像素子103、相関2重サンプリング回路104、A/Dコンバータ105、DSPブロック106、タイミングジェネレータ107、D/Aコンバータ108、ビデオエンコーダ109、ビデオモニタ110、コーデック(CODEC)111、メモリ112、CPU113、入力デバイス114、フラッシュ制御装置115、フラッシュ発光装置116から構成される。   An image processing apparatus shown in FIG. 1 includes a lens 101, a diaphragm 102, a solid-state image sensor 103, a correlated double sampling circuit 104, an A / D converter 105, a DSP block 106, a timing generator 107, a D / A converter 108, and a video encoder 109. , A video monitor 110, a codec (CODEC) 111, a memory 112, a CPU 113, an input device 114, a flash controller 115, and a flash light emitting device 116.

入力デバイス114はカメラ本体にある録画ボタンなどの操作ボタン類を含む。また、DSPブロック106は信号処理用プロセッサと画像用RAMを持つブロックで、信号処理用プロセッサが画像用RAMに格納された画像データに対してあらかじめプログラムされた画像処理をおこなうことができるようになっている。以下DSPブロックを単にDSPと呼ぶ。   The input device 114 includes operation buttons such as a recording button on the camera body. The DSP block 106 is a block having a signal processing processor and an image RAM. The signal processing processor can perform pre-programmed image processing on image data stored in the image RAM. ing. Hereinafter, the DSP block is simply referred to as a DSP.

本実施例の全体的な動作を以下に説明する。
光学系を通過して固体撮像素子103に到達した入射光は、まず撮像面上の各受光素子に到達し、受光素子での光電変換によって電気信号に変換され、相関2重サンプリング回路104によってノイズ除去され、A/Dコンバータ105によってデジタル信号に変換された後、デジタル信号処理部(DSP)106中の画像メモリに一時格納される。なお、必要があれば、撮影の際に、フラッシュ制御装置115を介して、フラッシュ発光装置116を発光させることができる。
The overall operation of this embodiment will be described below.
Incident light that has passed through the optical system and reached the solid-state image sensor 103 first reaches each light receiving element on the imaging surface, is converted into an electrical signal by photoelectric conversion at the light receiving element, and is subjected to noise by the correlated double sampling circuit 104. After being removed and converted into a digital signal by the A / D converter 105, it is temporarily stored in an image memory in the digital signal processing unit (DSP) 106. If necessary, the flash light emitting device 116 can be caused to emit light via the flash control device 115 during photographing.

撮像中の状態においては、一定のフレームレートによる画像取り込みを維持するようにタイミングジェネレータ107が信号処理系を制御する。デジタル信号処理部(DSP)106へも一定のレートで画素のストリームが送られ、そこで適切な画像処理がおこなわれた後、画像データはD/Aコンバータ108もしくはコーデック(CODEC)111あるいはその両方に送られる。D/Aコンバータ108はデジタル信号処理部(DSP)106から送られる画像データをアナログ信号に変換し、それをビデオエンコーダ109がビデオ信号に変換し、そのビデオ信号をビデオモニタ110でモニタできるようになっていて、このビデオモニタ110は本実施例においてカメラのファインダの役割を担っている。また、コーデック(CODEC)111はデジタル信号処理部(DSP)106から送られる画像データに対する符号化をおこない、符号化された画像データはメモリ112に記録される。ここで、メモリ112は半導体、磁気記録媒体、光磁気記録媒体、光記録媒体などを用いた記録装置などであってよい。   In the state during imaging, the timing generator 107 controls the signal processing system so as to maintain image capture at a constant frame rate. A stream of pixels is also sent to the digital signal processing unit (DSP) 106 at a constant rate, and after appropriate image processing is performed there, the image data is sent to the D / A converter 108 and / or the codec (CODEC) 111 or both. Sent. The D / A converter 108 converts the image data sent from the digital signal processing unit (DSP) 106 into an analog signal, which is converted into a video signal by the video encoder 109 so that the video signal can be monitored by the video monitor 110. In this embodiment, the video monitor 110 serves as a camera finder. The codec (CODEC) 111 encodes image data sent from the digital signal processing unit (DSP) 106, and the encoded image data is recorded in the memory 112. Here, the memory 112 may be a recording device using a semiconductor, a magnetic recording medium, a magneto-optical recording medium, an optical recording medium, or the like.

以上が本実施例のデジタルビデオカメラのシステム全体の説明である。撮影画像の画像補正処理は、主にデジタル信号処理部(DSP)106において実行される。以下、この画像処理の詳細について説明する。   The above is the description of the entire system of the digital video camera of this embodiment. The image correction processing of the captured image is mainly executed in the digital signal processing unit (DSP) 106. Details of the image processing will be described below.

画像処理は、デジタル信号処理部(DSP)106に入力された画像信号ストリームに対して、所定のプログラムコードに記述された処理を順次実行することで行なわれる。以降の説明では、プログラム中の各処理の実行シーケンスについて、フローチャートを参照して説明する。なお、本発明は以下において説明するプログラム処理形態に限らず、以下に説明する処理シーケンスを実行する機能を持つハードウェア構成によって実現することも可能である。   The image processing is performed by sequentially executing processing described in a predetermined program code on the image signal stream input to the digital signal processing unit (DSP) 106. In the following description, the execution sequence of each process in the program will be described with reference to flowcharts. The present invention is not limited to the program processing mode described below, but can be realized by a hardware configuration having a function of executing a processing sequence described below.

図2はデジタル信号処理部(DSP)106内部において、入力された画像信号のストリームに対して実行するホワイトバランス(WB)調整処理を含む画素値補正処理の手順を説明するフローチャートである。   FIG. 2 is a flowchart for explaining the procedure of pixel value correction processing including white balance (WB) adjustment processing executed on the stream of the input image signal in the digital signal processing unit (DSP) 106.

ステップS101では、事前に設定された絞り、シャッタースピードを用いて、フラッシュ発光なしで撮影し、ステップS102でこのフラッシュ発光なし撮影画像を画像データIとしてメモリに格納する。ステップS103では、ステップS101と同様に事前に設定された絞り、シャッタースピードを用いて、フラッシュ発光を行って撮影し、ステップS104でこのフラッシュ発光あり撮影画像を画像データIとしてメモリに格納する。 In step S101, the diaphragm is set in advance, using a shutter speed, and taken without flash, and stores the no flash captured image as image data I 1 on the memory in step S102. In step S103, the diaphragm is set in advance as in step S101, by using the shutter speed, photographed and flash emission, stores this flash has photographed image in step S104 as image data I 2 in the memory.

次にステップS105では、ステップS101と同様に事前に設定された絞り、シャッタースピードを用いて、フラッシュ発光なしで、再度撮影し、ステップS106でこのフラッシュ発光なし撮影画像を画像データIとしてメモリに格納する。 In step S105, the diaphragm is set in advance as in step S101, by using the shutter speed, without flash, and photographing again, the memory of this no flash captured image as image data I 3 at step S106 Store.

なお、ステップS101,S103,S105の撮影は、連続した撮影、例えば約1/100秒間隔の連続撮影として実行される。それぞれの撮影ステップから得られた複数の画像を用いて、ホワイトバランス(WB)の調整処理等の画素値補正を行い、最終的な画素値補正画像としての最終調整画像を生成する。   Note that the photographing in steps S101, S103, and S105 is executed as continuous photographing, for example, continuous photographing at intervals of about 1/100 seconds. Using a plurality of images obtained from each photographing step, pixel value correction such as white balance (WB) adjustment processing is performed to generate a final adjusted image as a final pixel value corrected image.

また、ステップS102、S104、S106においてメモリに格納される画像データI、I、Iは手ぶれ補正が行われた画像とする。すなわち、3枚の画像I、I、Iの撮影時に手ぶれがおきている場合には、それらをあらかじめ補正してからメモリに格納する。すなわち、撮影画像が手ぶれの発生画像である場合には、ステップS101とS102の間、ステップS103とS104の間、およびステップS105とS106の間において、手ぶれの補正を実行し補正後の画像をメモリに格納する。したがってメモリに格納される画像データI、I、Iは三脚にカメラを固定した状態で連続撮影したかのような画像となる。 In addition, the image data I 1 , I 2 , and I 3 stored in the memory in steps S102, S104, and S106 are images subjected to camera shake correction. That is, if camera shake occurs during the shooting of the three images I 1 , I 2 , and I 3 , they are corrected in advance and stored in the memory. That is, when the captured image is a camera shake occurrence image, camera shake correction is performed between steps S101 and S102, steps S103 and S104, and steps S105 and S106, and the corrected image is stored in the memory. To store. Therefore, the image data I 1 , I 2 , and I 3 stored in the memory are images as if they were taken continuously with the camera fixed to a tripod.

なお手ぶれの補正処理は、従来から知られた処理が適用可能である。例えば、加速度センサを用いてずれを検出し、レンズをずらす方法、または目的の解像度より大きい解像度の画像を撮像素子を用いて撮影してずれが生じないように適切な部分を読み出す方法、さらにはセンサを用いず画像処理だけで手ぶれを補正する方法など、従来から広く用いられている方法が適用される。   Note that a conventionally known process can be applied to the camera shake correction process. For example, a method of detecting a shift using an acceleration sensor and shifting a lens, or a method of reading an image with a resolution larger than a target resolution using an image sensor and reading an appropriate part so that the shift does not occur, Conventionally used methods such as a method of correcting camera shake only by image processing without using a sensor are applied.

次にステップS107において、ステップS101、S103、S105の3枚の画像の撮影の間に、被写体自体の動きに起因する像ぶれがあったか否かを検出する。この被写体自体の動きに起因する像ぶれがあったか否かの検出処理は、3枚の画像から2つの画像を比較して行われる。たとえば、画像Iと画像Iを用いて、動き部分を検出することができる。一例として、画像Iと画像Iの各画素に関して差分をとり、ある閾値以上である場合は、動きがあった部分として登録するという方法がある。被写体自体の動きに起因する像ぶれがなかったと判定した場合(ステップS108:No)は、ステップS112に進む。動きが検出された場合(ステップS108:Yes)は、ステップS109に進む。 Next, in step S107, it is detected whether or not there is an image blur due to the movement of the subject itself during the photographing of the three images in steps S101, S103, and S105. The process for detecting whether there is an image blur due to the movement of the subject itself is performed by comparing two images from three images. For example, the moving part can be detected using the images I 1 and I 3 . As an example, there is a method of taking a difference with respect to each pixel of the image I 1 and the image I 3 and registering it as a portion where there is a motion when the difference is equal to or greater than a certain threshold value. If it is determined that there is no image blur due to the movement of the subject itself (step S108: No), the process proceeds to step S112. If a motion is detected (step S108: Yes), the process proceeds to step S109.

ステップS109において、ステップS107で検出された動き部分に関して、適切なホワイトバランス(WB)調整を行うための補正処理が可能かどうか判定を行う。この判定処理はたとえば、ステップS107において動き部分として登録された画素数の画像全体の画素数に対する比率に基づいて行う方法が適用される。例えば、動き部分として登録された画素数の画像全体の画素数に対する比率[ratioA]が、予め定めたある一定の閾値[Threshold]以上である場合には補正が不可能と判定し、閾値未満である場合には補正可能と判定する。   In step S109, it is determined whether correction processing for performing appropriate white balance (WB) adjustment is possible for the moving portion detected in step S107. For example, a method of applying this determination processing based on the ratio of the number of pixels registered as a moving part in step S107 to the number of pixels of the entire image is applied. For example, when the ratio [ratio A] of the number of pixels registered as a moving part to the number of pixels of the entire image is equal to or larger than a predetermined threshold [Threshold], it is determined that correction is impossible and the ratio is less than the threshold. If there is, it is determined that correction is possible.

ステップS109で、補正不可能であると判定された場合、ステップS113に進み、補正可能であると判定された場合は、ステップS110に進む。   If it is determined in step S109 that correction is not possible, the process proceeds to step S113. If it is determined that correction is possible, the process proceeds to step S110.

ステップS113においては、フラッシュ発光ありの撮影画像データIに対して、ホワイトバランス(WB)調整を行い、出力画像Rを生成し、処理を終了する。ホワイトバランス調整に使用するパラメータ値としては、外光成分にあわせて設定されたパラメータ、フラッシュ光成分にあわせて設定されたパラメータ、または、外光とフラッシュ光の中間成分に基づいて設定されるパラメータのいずれかであり、これらのパラメータを設定したホワイトバランス(WB)調整を実行する。なお、このホワイトバランス調整法は、従来から行われている方法であり、その詳細説明は省略する。なお、適用するパラメータは、3×3行列によって示されるパラメータであり、各画素の色を構成する色成分の変換に適用する行列である。3×3行列は、対角成分以外を0として設定した行列が適用される。 In step S113, with respect to captured image data I 2 of there flash performs white balance (WB) adjustment, and generates an output image R, the process ends. Parameter values used for white balance adjustment include parameters set according to external light components, parameters set according to flash light components, or parameters set based on intermediate components between external light and flash light The white balance (WB) adjustment in which these parameters are set is executed. This white balance adjustment method is a conventional method and will not be described in detail. The parameter to be applied is a parameter indicated by a 3 × 3 matrix, and is a matrix to be applied to the conversion of the color component constituting the color of each pixel. As the 3 × 3 matrix, a matrix in which the components other than the diagonal components are set to 0 is applied.

ステップS110では、複数画像データに基づくホワイトバランス調整処理を含む画素値補正が実行される。なお、ステップS110では、ステップS107の動き部分検出処理において検出された動き部分を除く画素の画素値の補正のみが実行され、動き部分の画素値補正処理は、ステップS111において実行する。あるいは、ステップS110ですべての画素についてホワイトバランス調整処理を含む画素値補正を実行し、ステップS111において、動き部分画素についてのみ、再度補正を実行してもよい。   In step S110, pixel value correction including white balance adjustment processing based on a plurality of image data is executed. In step S110, only the correction of the pixel values of the pixels excluding the motion part detected in the motion part detection process of step S107 is executed, and the pixel value correction process of the motion part is executed in step S111. Alternatively, pixel value correction including white balance adjustment processing may be executed for all pixels in step S110, and correction may be executed again for only the moving partial pixels in step S111.

なお、ステップS111において実行する動き部分の画素値補正処理は、例えば、放射規定関数(Radial Basis Function)を適用した処理や、平滑化フィルタを適用した処理などによって実行される。なお、これらの処理の詳細については、本発明と同一出願人の特許出願である特願2003−312630に記載されている。   In addition, the pixel value correction process of the motion part performed in step S111 is performed by, for example, a process applying a radiation definition function (Radial Basis Function) or a process applying a smoothing filter. Details of these processes are described in Japanese Patent Application No. 2003-31630, which is a patent application of the same applicant as the present invention.

次に、ステップS110およびステップS112における複数画像データに基づくホワイトバランス(WB)調整処理について説明する。ステップS110およびステップS112における処理は、同一の処理である。すなわち、ステップS112では、ステップS107の動き部分検出処理において動きが検出されなかった場合に画像すべてに対して画素値補正が実行され、ステップS110では、ステップS107の動き部分検出処理において検出された動き部分を除く画素の画素値補正、あるいはすべての画素に対する画素値補正が同一の処理シーケンスによって実行される。この処理の詳細について、図3を参照して説明する。   Next, white balance (WB) adjustment processing based on a plurality of image data in step S110 and step S112 will be described. The processes in step S110 and step S112 are the same process. That is, in step S112, when no motion is detected in the motion part detection process in step S107, pixel value correction is executed for all the images. In step S110, the motion detected in the motion part detection process in step S107. The pixel value correction of the pixels excluding the portion or the pixel value correction for all the pixels is executed by the same processing sequence. Details of this processing will be described with reference to FIG.

ステップS201おいて、フラッシュ光あり撮影画像データIの成分とフラッシュ光なし撮影画像Iの画素の各色成分(例えばRGB各チャンネル毎)の差をとり、差分画像F=I−Iを、フラッシュ成分画像として生成してメモリに格納する。フラッシュ光なしの撮影を行ったステップS101とフラッシュ光ありの撮影を行ったステップS103の間に、被写体が動かなかったとすれば、差分画像F=I−Iは、外光がまったく無い状態でフラッシュ光のみを照射しフラッシュ光のみが被写体に反射して、カメラの固体撮像素子に入射し撮像される画像、すなわちフラッシュ成分画像と等価なものとなる。 Step S201 Oite, taking the difference of each color component of the pixel flashlight has photographed image component data I 2 and the flash light without captured image I 1 (e.g., each of the RGB channels), the difference image F = I 2 -I 1 The flash component image is generated and stored in the memory. If the subject does not move between step S101 in which shooting is performed without flash light and step S103 in which shooting is performed with flash light, the difference image F = I 2 −I 1 is in a state where there is no external light. Thus, only the flash light is irradiated, and only the flash light is reflected on the subject, and is incident on the solid-state image sensor of the camera, that is, an image equivalent to a captured image, that is, a flash component image.

次にステップS202において、差分画像Fに対して、フラッシュ光の色温度にあわせたホワイトバランス(WB)調整を実行する。すなわち、フラッシュ成分画像である差分画像データFをフラッシュ光成分に合わせて設定したパラメータに基づいてホワイトバランス(WB)調整を実行する。さらにフラッシュ光が明るすぎるまたは暗すぎる場合に、画像の明るさが最適になるようにレベル調整し、補正されたフラッシュ成分画像としての補正差分画像F'を生成する。   Next, in step S202, white balance (WB) adjustment according to the color temperature of the flash light is performed on the difference image F. That is, the white balance (WB) adjustment is executed based on the parameter set for the difference image data F, which is a flash component image, according to the flash light component. Further, when the flash light is too bright or too dark, the level is adjusted so that the brightness of the image is optimal, and a corrected difference image F ′ as a corrected flash component image is generated.

次にステップS203において、フラッシュ光なし撮影画像データIに対して、外光に合わせたホワイトバランス(WB)調整を実行する。すなわち、フラッシュ光なし撮影画像データIを外光成分に対応するパラメータに基づいてホワイトバランス(WB)調整を実行し、補正画像I'を生成する。 In step S203, the flash light without captured image data I 1, executes the white balance (WB) adjustment matched to ambient light. That is, the white balance (WB) adjustment is performed on the photographed image data I 1 without flash light based on the parameter corresponding to the external light component, and the corrected image I 1 ′ is generated.

これは、従来から広く知られているホワイトバランス(WB)調整によって実行される。例えば、特開2001−78202に述べられている技術を適用可能である。特開2001−78202では、フラッシュ発光ありで撮影した画像Iとフラッシュなしで撮影した画像Iの差分画像Fと既知のフラッシュの分光特性から、物体色成分データおよび外光の分光分布を照明成分データとして求める。この照明成分データを用いて、フラッシュ光なし撮影画像Iのホワイトバランス(WB)調整を実行して、補正画像I'を生成する。 This is performed by white balance (WB) adjustment that has been widely known. For example, the technique described in JP-A-2001-78202 can be applied. In Japanese Patent Application Laid-Open No. 2001-78202, the object color component data and the spectral distribution of external light are illuminated from the difference image F between the image I 2 captured with flash emission and the image I 1 captured without flash and the known flash spectral characteristics. Calculated as component data. With this illumination component data, by executing the white balance (WB) adjustment of the flashlight without captured image I 1, to generate a corrected image I '.

次にステップS204において、さらにフラッシュ光が明るすぎるまたは暗すぎる場合に、最終の結果画像の明るさを最適にするように補正されたフラッシュ成分画像である補正差分画像F'の強度(ゲイン)を調整し、ゲイン調整差分画像としての強度調整フラッシュ成分画像F"を生成する。   Next, in step S204, when the flash light is too bright or too dark, the intensity (gain) of the corrected difference image F ′ that is the flash component image corrected to optimize the brightness of the final result image is set. The intensity adjustment flash component image F ″ as the gain adjustment difference image is generated by adjusting.

強度調整フラッシュ成分画像F"の生成処理の概要は、以下の通りである。すなわち、補正差分画像F'と補正画像I'とこれらの画像の画素値に基づくヒストグラムなどの統計量と、合成画像[F'+I']にガンマ補正など非線形変換を施した画像に関する統計量を用いて、補正差分画像F'の最適なゲインを求め、明るさを調節したゲイン調整差分画像としての強度調整フラッシュ成分画像F"を生成するものである。 The outline of the generation process of the intensity adjustment flash component image F ″ is as follows. That is, the corrected difference image F ′, the corrected image I 1 ′, and statistics such as a histogram based on the pixel values of these images, and the synthesis Using the statistics about the image [F ′ + I 1 ′] that has undergone nonlinear transformation such as gamma correction, the optimum gain of the corrected difference image F ′ is obtained, and the intensity adjustment as a gain adjustment difference image with adjusted brightness The flash component image F ″ is generated.

以下、ステップS204において実行する強度調整フラッシュ成分画像F"(ゲイン調整差分画像)の生成処理の詳細について、図4に示すフローを参照して説明する。   Hereinafter, details of the process of generating the intensity adjustment flash component image F ″ (gain adjustment difference image) executed in step S204 will be described with reference to the flow shown in FIG.

まず、ステップS301において、ホワイトバランス調整のなされたフラッシュ成分画像である補正差分画像F'に基づいて、ある程度の光量のフラッシュ光が当たっている物体が撮像されていると考えられる画像中の部分を表すフラッシュマスクMを求める。フラッシュマスクMを求める具体的方法の一例を、以下に説明する。 First, in step S301, based on the corrected difference image F ′, which is a flash component image that has been subjected to white balance adjustment, a portion in the image that is considered to be captured of an object that is exposed to a certain amount of flash light. A flash mask M f to be represented is obtained. An example of a specific method for obtaining the flash mask Mf will be described below.

まず、補正差分画像F'について、輝度があらかじめ定めたある閾値(Th1)以上である画素を検出する。閾値(Th1)以上の輝度値を持つ抽出画素の輝度の平均値を算出する。補正差分画像F'を構成する画素各々の輝度が、算出した平均値以上である場合は、フラッシュ光が比較的大きく、外光とフラッシュ光を合成した最終画像への影響が大きい部分であると言える。   First, with respect to the corrected difference image F ′, pixels whose luminance is equal to or higher than a predetermined threshold (Th1) are detected. The average value of the brightness of the extracted pixels having the brightness value equal to or greater than the threshold (Th1) is calculated. When the luminance of each pixel constituting the corrected difference image F ′ is equal to or greater than the calculated average value, the flash light is relatively large, and is a portion having a large influence on the final image obtained by combining the external light and the flash light. I can say that.

なお、図2を参照して説明したステップS107において検出した被写体自体の動き部分に相当する画素に関しては、動きがフラッシュ成分として現れている可能性があるので、フラッシュマスク設定対象画素からは除外する。動き部分の画素値補正処理は、図の処理フローにおけるステップS111において実行する。   Note that the pixel corresponding to the moving part of the subject itself detected in step S107 described with reference to FIG. 2 is excluded from the flash mask setting target pixels because the movement may appear as a flash component. . The pixel value correction process of the moving part is executed in step S111 in the processing flow in the figure.

すなわち、
(a)補正差分画像F'について、輝度があらかじめ定めたある閾値以上である画素
(b)被写体自体の動き部分に相当しない画素
(a),(b)の2つの条件に該当する画素領域によって構成されるマスクをフラッシュマスクMとして生成する。
That is,
(A) For the corrected difference image F ′, a pixel whose luminance is equal to or higher than a predetermined threshold value (b) A pixel that does not correspond to the moving part of the subject itself (a), a pixel region that satisfies the two conditions of (b) A mask to be configured is generated as a flash mask Mf .

ステップS302以下では、上記(a),(b)両条件を満足する画素から構成されるフラッシュマスクM部分の画像の解析処理を実行し、最適な補正差分画像F'のゲインgを算出して、ゲイン調整差分画像としての、
F"=gF'
を求める。
In step S302 and subsequent steps, an analysis process is performed on the image of the flash mask M f portion composed of pixels satisfying both the above conditions (a) and (b), and the optimum gain g of the corrected difference image F ′ is calculated. As a gain adjustment difference image,
F "= gF '
Ask for.

ステップS302以下の処理について、図5、図6、および図7を参照して説明する。ステップS302では、補正差分画像F'と、補正画像I'のフラッシュマスクM部分の輝度平均値を算出する。 The processing after step S302 will be described with reference to FIGS. 5, 6, and 7. FIG. In step S302, the average brightness value of the corrected difference image F ′ and the flash mask M f portion of the corrected image I 1 ′ is calculated.

図5(1)は、補正画像I'のフラッシュマスクM部分の輝度(画素値)の度数分布図としてのヒストグラムを示している。横軸が画素値、縦軸が度数を示している。画素値は、例えば0(min)〜255(max)の輝度値を示している。なお、ここでは説明を簡潔にするため、1つのヒストグラムを適用して説明するが、RGBカラー画像の場合は、各画素の各チャンネル、例えばRGB各チャンネルのヒストグラムをそれぞれ生成して、各チャネル毎に以下に説明する処理を実行する。 FIG. 5A shows a histogram as a frequency distribution diagram of the luminance (pixel value) of the flash mask M f portion of the corrected image I 1 ′. The horizontal axis indicates the pixel value, and the vertical axis indicates the frequency. The pixel value indicates a luminance value of, for example, 0 (min) to 255 (max). Note that, for the sake of brevity, a description will be given by applying one histogram. However, in the case of an RGB color image, a histogram of each channel of each pixel, for example, each channel of RGB is generated, and each channel is generated. The processing described below is executed.

補正画像I'のフラッシュマスクM部分を構成する画素の輝度(画素値)は、最小値(min)、例えば画素値=0から最大値(max)、例えば画素値=255の間に分布しており、補正画像I'のフラッシュマスクM部分の輝度値の平均値(avgと呼ぶ)を平均値(avg)として示している画素値である。 The luminance (pixel value) of the pixels constituting the flash mask M f portion of the corrected image I 1 ′ is distributed between a minimum value (min), for example, a pixel value = 0 to a maximum value (max), for example, a pixel value = 255. and has a pixel value represents an average value of the luminance value (avg 1 hereinafter) as the average value (avg 1) of the flash mask M f part of the corrected image I 1 '.

図5(2)は、補正差分画像F'のフラッシュマスクM部分の輝度(画素値)の度数分布図としてのヒストグラムを示している。補正差分画像F'のフラッシュマスクM部分を構成する画素の輝度(画素値)は補正差分画像F'のフラッシュマスクM部分の輝度値の平均値(avgと呼ぶ)は、平均値(avg)として示している画素値となる。 FIG. 5 (2) shows a histogram as a frequency distribution diagram of the luminance (pixel value) of the flash mask Mf portion of the corrected difference image F ′. The luminance (pixel value) of the pixels constituting the flash mask M f portion of the correction difference image F ′ is the average value (referred to as avg F ) of the luminance value of the flash mask M f portion of the correction difference image F ′. avg F ).

図4に示すフローのステップS302においては、図5(1)と(2)に示すヒストグラムを生成して、それぞれのヒストグラムにおける平均値、すなわち、
補正画像I'のフラッシュマスクM部分の輝度(画素値)の平均値[avg
補正差分画像F'のフラッシュマスクM部分の輝度(画素値)の平均値[avg
を算出する。
In step S302 of the flow shown in FIG. 4, the histograms shown in FIGS. 5 (1) and (2) are generated, and the average value in each histogram, that is,
Average value [avg 1 ] of luminance (pixel value) of the flash mask M f portion of the corrected image I 1
Average value [avg F ] of the luminance (pixel value) of the flash mask M f portion of the corrected difference image F ′
Is calculated.

次にステップS303において、補正画像I'と、補正差分画像F'の合成画像Rtmp=I'+F'を生成する。これは、補正画像I'の各画素の画素値に対して補正差分画像F'の対応画素の画素値を加算して生成する。 In step S303, a composite image R tmp = I 1 ′ + F ′ of the corrected image I 1 ′ and the corrected differential image F ′ is generated. This is generated by adding the pixel value of the corresponding pixel of the corrected difference image F ′ to the pixel value of each pixel of the corrected image I 1 ′.

図5(3)に示すヒストグラムは、補正画像I'と、補正差分画像F'の合成画像Rtmp=I'+F'のフラッシュマスクM部分の輝度(画素値)の度数分布図としてのヒストグラムを示している。合成画像Rtmp=I'+F'のフラッシュマスクM部分を構成する画素の輝度(画素値)は全体的に最大画素値(max)側にずれたヒストグラムとして設定され、合成画像Rtmp=I'+F'のフラッシュマスクM部分の輝度値の平均値は、平均値(avg1+F)として示している画素値となる。 The histogram shown in FIG. 5 (3) is a frequency distribution diagram of the luminance (pixel value) of the flash mask M f portion of the corrected image I 1 ′ and the composite image R tmp = I 1 ′ + F ′ of the corrected difference image F ′. The histogram of is shown. The brightness (pixel value) of the pixels constituting the flash mask M f portion of the composite image R tmp = I 1 '+ F' is set as a histogram that is shifted to the maximum pixel value (max) side as a whole, and the composite image R tmp = The average value of the luminance values of the flash mask M f portion of I 1 '+ F' is the pixel value shown as the average value (avg 1 + F ).

固体撮像素子から出力される画像を構成する各画素の輝度は、固体撮像素子に入射する光の量と線形の関係にある。一方、一般的なデジタルスチルカメラなどが最終画像として出力する画像は、固体撮像素子から出力される画像に対し、ガンマ補正などの非線形変換を施したものである。ガンマ補正は、画像の明るさや色の彩度を正しく表示するための補正処理であり、デジタルスチルカメラが撮像して得た画素値を、そのまま出力すると、人の目によって観察された場合に、不自然になる場合がある。これを解決するため、入力画素値と出力画素値とを所定のγ曲線を用いて非線形変換処理を施す、これをガンマ補正とよぶ。   The luminance of each pixel constituting the image output from the solid-state image sensor has a linear relationship with the amount of light incident on the solid-state image sensor. On the other hand, an image output as a final image by a general digital still camera or the like is obtained by performing nonlinear conversion such as gamma correction on an image output from a solid-state imaging device. Gamma correction is a correction process for correctly displaying the brightness and color saturation of an image, and when the pixel value obtained by imaging with a digital still camera is output as it is, when it is observed by the human eye, May become unnatural. In order to solve this, the input pixel value and the output pixel value are subjected to nonlinear conversion processing using a predetermined γ curve, which is called gamma correction.

ここでは、この非線形変換をTと標記する。ステップS304において、補正画像I'と、補正差分画像F'の合成画像Rtmp=I'+F'について、非線形変換Tを施した画像を、
非線形変換画像Rtmp'=T(F'+I')
を生成する。
Here, this nonlinear transformation is denoted as T. In step S304, an image obtained by performing nonlinear transformation T on the composite image R tmp = I 1 ′ + F ′ of the corrected image I 1 ′ and the corrected differential image F ′
Nonlinear transformation image R tmp '= T (F ′ + I 1 ′)
Is generated.

ここで、非線形変換画像Rtmp'=T(F'+I')は、合成画像Rtmp=(F'+I')の各画素の各チャンネル、例えばRGB各チャンネルの画素値に対しそれぞれ非線形変換Tを施して得られる非線形変換画像をあらわす。 Here, the non-linear conversion image R tmp ′ = T (F ′ + I 1 ′) is non-linear with respect to each channel of each pixel of the composite image R tmp = (F ′ + I 1 ′), for example, the pixel value of each RGB channel. A nonlinear transformed image obtained by applying transformation T is shown.

図6は、図5(3)に示す補正画像I'と、補正差分画像F'の合成画像(F'+I')の各画素の各チャンネルの画素値に対しそれぞれ非線形変換Tを施して得られる非線形変換画像T(F'+I')についてのフラッシュマスクM部分の輝度(画素値)の度数分布図としてのヒストグラムを示している。線形変換画像T(F'+I')のフラッシュマスクM部分を構成する画素の輝度(画素値)は全体的に最大画素値(max)側にずれたヒストグラムとして設定される。 FIG. 6 shows a nonlinear transformation T applied to the pixel value of each channel of each pixel of the corrected image I 1 ′ and the combined image (F ′ + I 1 ′) of the corrected difference image F ′ shown in FIG. 8 shows a histogram as a frequency distribution diagram of the luminance (pixel value) of the flash mask M f part for the nonlinear transformed image T (F ′ + I 1 ′) obtained in this way. The luminance (pixel value) of the pixels constituting the flash mask M f portion of the linearly transformed image T (F ′ + I 1 ′) is set as a histogram that is shifted to the maximum pixel value (max) side as a whole.

ステップS305において、図6に示すヒストグラムから標準偏差を算出する。線形変換画像T(F'+I')のフラッシュマスクM部分を構成する画素の画素値平均値は、図6に示すように、[avgrslt]である。また、標準偏差は[stdrslt]として求められる。 In step S305, the standard deviation is calculated from the histogram shown in FIG. As shown in FIG. 6, the average pixel value of the pixels constituting the flash mask M f portion of the linearly transformed image T (F ′ + I 1 ′) is [avg rslt ]. The standard deviation is obtained as [std rslt ].

図6に示すように、線形変換画像T(F'+I')のフラッシュマスクM部分を構成する画素の画素値によって構成されるヒストグラムは、最大値(max)、例えば画素値=255付近に多くの画素が分布しており、白とびが起きていることが分かる。白とび画素は、図6に示す白とび部分201に存在すべき画素である。すなわち、ガンマ補正によって多くの画素の画素値が最大値(最大輝度値)に設定、すなわち飽和画素値に設定されてしまっている。この状態は、本来の画素レベルの差異を表現できないいわゆる白とびと呼ばれる。 As shown in FIG. 6, the histogram formed by the pixel values of the pixels constituting the flash mask M f portion of the linearly transformed image T (F ′ + I 1 ′) has a maximum value (max), for example, near pixel value = 255. It can be seen that a large number of pixels are distributed in the area and whiteout occurs. The overexposed pixel is a pixel that should exist in the overexposed portion 201 shown in FIG. That is, the pixel values of many pixels are set to the maximum value (maximum luminance value), that is, the saturated pixel value by gamma correction. This state is called so-called overexposure that cannot express the original pixel level difference.

理想的な画像は、十分に明るく、かつ白とびが起きていない画像である。ガンマ補正によって、図6に示すような飽和画素値を多く持つ画像は、理想的な画像としての特徴を備えていないものである。   An ideal image is an image that is sufficiently bright and does not cause overexposure. An image having many saturated pixel values as shown in FIG. 6 due to gamma correction does not have an ideal image feature.

従って、本発明においては、外光成分対応パラメータに基づくホワイトバランス調整処理を実行した補正画像I'と、フラッシュ光成分対応パラメータに基づくホワイトバランス調整処理を実行したフラッシュ成分画像である補正差分画像F'との合成画像に基づいて生成する非線形変換処理画像中の飽和画素値を持つ画素数を抑制する調整値として強度調整値、すなわちゲイン(g)を算出し、このゲインを適用して、補正差分画像F'を補正して強度調整フラッシュ成分画像を生成する。 Therefore, in the present invention, the corrected image I 1 ′ that has been subjected to the white balance adjustment process based on the external light component corresponding parameter, and the corrected difference image that is the flash component image that has been subjected to the white balance adjustment process based on the flash light component corresponding parameter An intensity adjustment value, that is, a gain (g) is calculated as an adjustment value for suppressing the number of pixels having a saturated pixel value in the nonlinear transformation processing image generated based on the composite image with F ′, and this gain is applied, The correction difference image F ′ is corrected to generate an intensity adjustment flash component image.

このように、本発明においては、補正差分画像F'のゲイン(gと呼ぶ)を調節することにより仮想的にフラッシュ光の強度を調節した上で、最終的な結果画像(最終調整画像)を生成する。   Thus, in the present invention, the final result image (final adjustment image) is adjusted after virtually adjusting the intensity of the flash light by adjusting the gain (referred to as g) of the correction difference image F ′. Generate.

ステップS306において、明るくかつ白とびが起きていない画像を最終調整画像として生成するため、
図5(1)に示す補正画像I'のフラッシュマスクM部分の輝度値の平均値(avg)、
図5(2)に示す補正差分画像F'のフラッシュマスクM部分の輝度値の平均値(avg)、さらに、
図6に示す線形変換画像T(F'+I')のフラッシュマスクM部分を構成する画素の画素値ヒストグラムにおける標準偏差[stdrslt
などを用いて、最適な補正差分画像F'のゲインgを算出し、ステップS307において、ゲインgを補正差分画像F'の各画素の各チャンネルの値に乗算し、強度調整フラッシュ成分画像F"を求める。すなわち、
F"=gF'
として強度調整フラッシュ成分画像F"を求める。
In step S306, in order to generate a bright and non-overexposed image as a final adjusted image,
The average value (avg 1 ) of the luminance values of the flash mask M f portion of the corrected image I 1 ′ shown in FIG.
The average value (avg F ) of the luminance values of the flash mask M f portion of the correction difference image F ′ shown in FIG.
Standard deviation [std rslt ] in the pixel value histogram of the pixels constituting the flash mask M f portion of the linearly transformed image T (F ′ + I 1 ′) shown in FIG.
Is used to calculate the gain g of the optimum correction difference image F ′, and in step S307, the gain g is multiplied by the value of each channel of each pixel of the correction difference image F ′ to obtain the intensity adjustment flash component image F ″. That is,
F "= gF '
As a result, an intensity adjustment flash component image F ″ is obtained.

一般的に、測定画素値が正規分布に従い分布している場合は、「平均値」±「標準偏差」の範囲に測定画素の約68%、「平均値」±「標準偏差の2倍」の範囲に測定画素の約95%が存在する。画素値分布が厳密に正規分布に従わない場合も、似たような傾向があると考えられる。   In general, when the measurement pixel values are distributed according to a normal distribution, about 68% of the measurement pixels in the range of “average value” ± “standard deviation” and “average value” ± “twice the standard deviation”. There are about 95% of the measured pixels in the range. A similar tendency can be considered when the pixel value distribution does not strictly follow the normal distribution.

従って、図6に示す線形変換画像T(F'+I')のフラッシュマスクM部分を構成する画素の画素値ヒストグラムのように、多くの白とびが発生する場合、フラッシュマスクM部分の輝度の[平均値]+[標準偏差]、すなわち、図6に示す点[A]が画素値最大値(max)より大きくなることが多い。 Therefore, when many overexposures occur as in the pixel value histogram of the pixels constituting the flash mask M f portion of the linearly transformed image T (F ′ + I 1 ′) shown in FIG. 6, the flash mask M f portion The luminance [average value] + [standard deviation], that is, the point [A] shown in FIG. 6 is often larger than the maximum pixel value (max).

そこで、ステップS306における補正差分画像F'に対するゲインgの算出処理においては、線形変換画像T(F'+I')のフラッシュマスクM部分を構成する画素の画素値ヒストグラムから求められる「平均値」±「標準偏差のk倍」(kはあらかじめ定められた固定のスカラー値、例えば1,1.5,2など)の範囲が、
画素値最大値(max)より大きな範囲を取らない、かつ
十分明るいよう
範囲に設定されるようにゲインgを設定する。
Therefore, in the process of calculating the gain g for the corrected difference image F ′ in step S306, the “average value” obtained from the pixel value histogram of the pixels constituting the flash mask M f portion of the linearly transformed image T (F ′ + I 1 ′). "±" k times the standard deviation "(where k is a predetermined fixed scalar value, such as 1, 1.5, 2, etc.)
The gain g is set so that it does not take a range larger than the maximum pixel value (max) and is set to be sufficiently bright.

白とびのない、あるいは少ない理想的な画像のヒストグラムとしては、例えば図7に示すようなヒストグラムが考えられる。   For example, a histogram as shown in FIG. 7 can be considered as an ideal image histogram with little or no overexposure.

ゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分の輝度のヒストグラムを図7に示すようなヒストグラムとして設定し、このゲイン調整非線形変換画像を元に最終出力画像を生成すれば、十分に明るく、かつ白とびが起きていない理想的な画像を得ることができる。 A luminance histogram of the flash mask Mf portion of the gain adjustment nonlinear conversion image T (gF ′ + I 1 ′) is set as a histogram as shown in FIG. 7, and a final output image is generated based on the gain adjustment nonlinear conversion image. Thus, it is possible to obtain an ideal image that is sufficiently bright and does not cause overexposure.

図7に示すヒストグラムの平均値は、図7に示すように、[avg'rslt]、標準偏差を[std'rslt]である。 The average value of the histogram shown in FIG. 7 is [avg ′ rslt ] and the standard deviation is [std ′ rslt ] as shown in FIG. 7.

ここで、[平均値]+[標準偏差]によって示される点[A]は、図7に示す最大値(max)よりも小さく、かつ平均値[avg'rslt]は十分に明るい画素値となっている。例えば中間画素値[(min+max)/2]より大である十分な画素レベル(輝度値)を持つ値となっている。 Here, the point [A] indicated by [average value] + [standard deviation] is smaller than the maximum value (max) shown in FIG. 7, and the average value [avg ′ rslt ] is a sufficiently bright pixel value. ing. For example, it is a value having a sufficient pixel level (luminance value) that is larger than the intermediate pixel value [(min + max) / 2].

ここで、図7に示すようなヒストグラムをゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分の輝度ヒストグラムであるとする。 Here, it is assumed that the histogram as shown in FIG. 7 is a luminance histogram of the flash mask Mf portion of the gain adjustment nonlinear conversion image T (gF ′ + I 1 ′).

本実施例では、ゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分は白とびが少なくかつ十分明るい画像とするために、ゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分の輝度ヒストグラム(図7)の平均値[avg'rslt]が、輝度最大値(max)から標準偏差[std'rslt]のk倍を除算した値と同等となるようにゲインgを調整する。 In this embodiment, in a flash mask M f portion of the gain adjustment nonlinear transformation image T (gF '+ I 1' ) is that overexposure is to reduce and sufficient bright image, gain adjustment nonlinear transformation image T (gF '+ I 1' The average value [avg ′ rslt ] of the luminance histogram (FIG. 7) of the flash mask M f portion of) is equivalent to the value obtained by dividing k times the standard deviation [std ′ rslt ] from the maximum luminance value (max). Adjust the gain g.

このようなゲインgを適用して生成したゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分は白とびが少なくかつ十分明るい画像となる。 The flash mask M f portion of the gain-adjusted nonlinear conversion image T (gF ′ + I 1 ′) generated by applying such a gain g is a sufficiently bright image with little overexposure.

このような最適な結果画像を生成するゲインgが算出された場合、ゲインgが極端に大きいまたは小さい値ではない場合は、非線形変換画像T(F'+I')と、ゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分の輝度の標準偏差は大きな差が無いと考えられるので、図7に示すヒストグラム、すなわち、ゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分の輝度ヒストグラムにおける標準偏差[std'rslt]は、図6に示すヒストグラム、すなわち、ゲイン調整前の非線形変換画像T(F'+I')のフラッシュマスクM部分の輝度ヒストグラムにおける標準偏差[stdrslt]と同じ大きさであると仮定する。すなわち、
std'rslt=stdrslt
である。
When the gain g for generating such an optimal result image is calculated, if the gain g is not extremely large or small, the nonlinear transformed image T (F ′ + I 1 ′) and the gain adjusted nonlinear transformed image Since it is considered that the standard deviation of the luminance of the flash mask M f portion of T (gF ′ + I 1 ′) is not significantly different, the histogram shown in FIG. 7, that is, the gain-adjusted nonlinear transformation image T (gF ′ + I 1 ′) standard deviation in the luminance histogram of the flash mask M f moiety [std 'rslt] is a histogram shown in FIG. 6, that is, the gain adjustment before the nonlinear transformation image T (F' brightness of the flash mask M f portion of the + I 1 ') Assume that it is the same size as the standard deviation [std rslt ] in the histogram. That is,
std ' rslt = std rslt
It is.

また、図5(1)に示す補正画像I'のヒストグラムの平均値[avg]と、ゲインgを施した補正差分画像F'のフラッシュマスクM部分の輝度の平均値[g×avg]との加算値[avg+g×avg]に対して非線形変換Tを施して算出するスカラー値、
T(avg+g×avg
は、最終的なゲイン調整非線形変換画像T(gF'+I')のフラッシュマスクM部分の輝度の平均値[avg'rslt](図7参照)と同等になると仮定する。すなわち、
avg'rslt=T(avg+g×avg
と仮定する。
The average value [avg 1 ] of the histogram of the corrected image I 1 ′ shown in FIG. 5A and the average value [g × avg] of the luminance of the flash mask M f portion of the corrected differential image F ′ subjected to the gain g. F ]] and a scalar value calculated by performing nonlinear transformation T on the added value [avg 1 + g × avg F ],
T (avg 1 + g × avg F )
Is equivalent to the average value [avg ′ rslt ] (see FIG. 7) of the luminance of the flash mask M f portion of the final gain-adjusted nonlinear transformed image T (gF ′ + I 1 ′). That is,
avg ′ rslt = T (avg 1 + g × avg F )
Assume that

すなわち、求めたい最終のゲイン調整非線形変換画像T(gF'+I')の平均値[avg'rslt]は、T(avg+g×avg)と等しくなる。そして、この値が、(max−k×stdrslt)と同じ値になれば、図7に示すヒストグラムに対応する画像が設定され、結果として白とびが少なくかつ十分明るい画像に対応するヒストグラムとなる。 That is, the average value [avg ′ rslt ] of the final gain-adjusted nonlinear transformation image T (gF ′ + I 1 ′) to be obtained is equal to T (avg 1 + g × avg F ). When this value becomes the same value as (max−k × std rslt ), an image corresponding to the histogram shown in FIG. 7 is set, and as a result, a histogram corresponding to a sufficiently bright image with little overexposure is obtained. .

すなわち、
T(avg+g×avg)=max−k×stdrslt・・・(式1)
That is,
T (avg 1 + g × avg F ) = max−k × std rslt (Formula 1)

上記(式1)を満足するゲイン[g]を算出すればよい。ゲイン[g]の算出式は、上記(式1)を変形した下記の(式2)を適用する。
g={T−1(max−k×stdrslt)−avg}÷avg・・・(式2)
ここで、T−1は、非線形変換Tの逆変換を表している。
A gain [g] that satisfies the above (Equation 1) may be calculated. As a formula for calculating the gain [g], the following (formula 2) obtained by modifying the above (formula 1) is applied.
g = {T −1 (max−k × std rslt ) −avg 1 } ÷ avg F (Expression 2)
Here, T −1 represents the inverse transformation of the nonlinear transformation T.

図4に示すフローのステップS306においては、上記(式2)に基づいて、フラッシュ成分画像(補正差分画像F')の強度調整値としてのゲインgを算出する。上記(式2)から理解されるように、
ゲイン[g]は、
a)図5(1)に示す補正画像I'のフラッシュマスクM部分の輝度値の平均値(avg)、
b)図5(2)に示す補正差分画像F'のフラッシュマスクM部分の輝度値の平均値(avg)、さらに、
c)図6に示す非線形変換画像T(F'+I')のフラッシュマスクM部分を構成する画素の画素値ヒストグラムにおける標準偏差[stdrslt
d)固定のスカラー値[k]
の各値に基づいても算出される。
なお、固定のスカラー値[k]は、k=1あるいはk=1.5などの固定値であり、予め設定される値である。
In step S306 of the flow shown in FIG. 4, a gain g as an intensity adjustment value of the flash component image (corrected difference image F ′) is calculated based on the above (Equation 2). As understood from the above (Formula 2),
Gain [g] is
a) Average luminance value (avg 1 ) of the flash mask M f portion of the corrected image I 1 ′ shown in FIG.
b) Average value (avg F ) of the luminance values of the flash mask M f portion of the correction difference image F ′ shown in FIG.
c) Standard deviation [std rslt ] in the pixel value histogram of the pixels constituting the flash mask M f portion of the nonlinear transformed image T (F ′ + I 1 ′) shown in FIG.
d) Fixed scalar value [k]
It is also calculated based on each value.
The fixed scalar value [k] is a fixed value such as k = 1 or k = 1.5, and is a preset value.

ステップS307において、補正差分画像F'の各画素の各チャンネルの値をgで乗算して強度調整フラッシュ成分画像F"を、
F"=gF'
として算出し、この強度調整フラッシュ成分画像F"を、最終調整画像の生成に適用するフラッシュ成分画像として設定する。
In step S307, the intensity-adjusted flash component image F ″ is obtained by multiplying the value of each channel of each pixel of the corrected difference image F ′ by g.
F "= gF '
This intensity adjustment flash component image F ″ is set as a flash component image to be applied to the generation of the final adjustment image.

以上の処理が、図3に示すステップS204の処理である。なおここでは、ゲインgを自動で算出する方法を述べたが、ゲインgはユーザが自由に設定して、好みのフラッシュの強さに調節することも可能である。   The above process is the process of step S204 shown in FIG. Although the method for automatically calculating the gain g has been described here, the user can freely set the gain g and adjust it to the desired flash intensity.

ステップS204が終了した後、次にステップS205において、フラッシュ成分画像として設定した強度調整フラッシュ成分画像F"と画像I'を合成し、最終調整画像としてのホワイトバランス調整画像Rを生成する。すなわち、
R=I'+F"
として、ホワイトバランス調整画像Rを生成する。
After step S204 is completed, in step S205, the intensity adjustment flash component image F ″ set as the flash component image and the image I 1 ′ are combined to generate a white balance adjustment image R as the final adjustment image. ,
R = I 1 '+ F "
As a result, a white balance adjustment image R is generated.

以上の処理が、図2に示すステップS112とステップS110における処理の詳細である。   The above process is the detail of the process in step S112 and step S110 shown in FIG.

ステップS107において、動き部分が検出されなかった場合は、ステップS112において上述の処理よって取得した強度調整フラッシュ成分画像F"と画像I'の合成によるホワイトバランス調整画像R、すなわち、
R=I'+F"
が最終的な調整画像とされる。なお、この後最終調整画像Rに対してガンマ補正等の非線形変換処理がなされて出力される。
If no moving part is detected in step S107, the white balance adjustment image R obtained by synthesizing the intensity adjustment flash component image F ″ acquired in step S112 and the image I 1 ′ in step S112, that is,
R = I 1 '+ F "
Is the final adjusted image. After this, the final adjusted image R is subjected to nonlinear conversion processing such as gamma correction and output.

なお、ステップS107において、動き部分が検出された場合は、ステップS110において上述の処理よって取得したホワイトバランス調整画像R、すなわち、
R=I'+F"
を取得した後、ステップS111において、動き部分の画素値補正を実行する。ステップS111における動き部分の画素値補正は、前述したように、本発明と同一出願人の特許出願である特願2003−312630に記載されている放射規定関数(Radial Basis Function)を適用した処理や、平滑化フィルタを適用した処理などによって実行される。
In addition, when a moving part is detected in step S107, the white balance adjustment image R acquired by the above-described process in step S110, that is,
R = I 1 '+ F "
In step S111, the pixel value correction of the moving part is executed. As described above, the correction of the pixel value of the moving part in step S111 is performed by applying a radiation defining function (Radial Basis Function) described in Japanese Patent Application No. 2003-31630, which is a patent application of the same applicant as the present invention. The process is executed by applying a smoothing filter.

ステップS107において、動き部分が検出された場合はステップS111において、動き部分の画素値補正がなされた画像が、最終的な調整画像とされる。   If a moving part is detected in step S107, the image in which the pixel value of the moving part is corrected is determined as a final adjusted image in step S111.

なお、ステップ110における画素値補正においては、動き部分の画素であるか動き部分以外の画素であるかの区別を行なうことなく、画像構成画素、すべてについての補正を実行し、ステップ110におけるホワイトバランス調整画像R、すなわち、
R=I'+F"
の生成の後、ステップ111において、ステップ107で検出した動き部分の画素値のみを対象とした例外補正処理を実行して、画像Rを修正する構成としてもよい。具体的には、動きが検出された部分のフラッシュ発光あり画像Iの画素値を入力として、画像Rにおける動きが無かった部分の画素値を参照して、最終的な画像を合成する方法などが適用可能である。
In the pixel value correction in step 110, correction is performed on all the image constituent pixels without distinguishing whether the pixel is a moving part pixel or a non-moving part pixel, and the white balance in step 110 is performed. Adjustment image R, that is,
R = I 1 '+ F "
In step 111, the image R may be corrected by executing exception correction processing for only the pixel value of the motion portion detected in step 107 after the generation of the image. Specifically, a method of synthesizing a final image by referring to the pixel value of the portion of the image R where there is no motion, using the pixel value of the image I 2 with flash emission of the portion where the motion is detected as an input, etc. Is applicable.

図8は、本実施例に従った処理を実行するデジタル信号処理部(DSP)(図1のDSP106に相当)の機能構成を示すブロック図である。   FIG. 8 is a block diagram showing a functional configuration of a digital signal processing unit (DSP) (corresponding to the DSP 106 in FIG. 1) that executes processing according to the present embodiment.

図2に示すフローチャートと対比しながら、図8に示すデジタル信号処理部(DSP)における処理について説明する。   Processing in the digital signal processing unit (DSP) shown in FIG. 8 will be described in comparison with the flowchart shown in FIG.

図2のステップS101〜106において、撮影されたフラッシユなし画像I、フラッシユあり画像I、およびフラッシユなし画像Iは、それぞれフレームメモリ301,302,303に格納される。なお、画像格納用のフレームメモリとしてはデジタル信号処理部(DSP)内に構成したメモリを適用してもバス接続されたメモリ(図1のメモリ112)を適用してもよい。 In steps S101 to S106 in FIG. 2, the photographed non-flashing image I 1 , the flashing image I 2 , and the non-flashing image I 3 are stored in the frame memories 301, 302, and 303, respectively. As a frame memory for storing images, a memory configured in a digital signal processing unit (DSP) may be applied, or a bus-connected memory (memory 112 in FIG. 1) may be applied.

ステップS107の動き検出処理は、動き検出部309において実行される。動き検出処理は、フラッシユなし画像Iと、フラッシユなし画像Iに基づく差分データによる検出処理として実行する。 The motion detection process in step S107 is executed in the motion detection unit 309. The motion detection process is executed as a detection process using difference data based on the non-flashing image I 1 and the non-flashing image I 3 .

ステップS110と、ステップS112で実行する複数画像データに基づくホワイトバランス調整処理は、先に図3、図4を参照して説明した処理である。   The white balance adjustment process based on the multiple image data executed in step S110 and step S112 is the process described above with reference to FIGS.

まず、フラッシユなし画像Iと、フラッシユあり画像Iに基づいて、フラッシュ成分画像産出部330に構成された差分画像算出部304において差分画像データF=I−Iを求める(図3,S201)。次に、差分画像データF=I−I、すなわちフラッシユ光のみの照射条件で撮影した画像に相当する差分画像Fに対して、ホワイトバランス調整部307でフラッシュ光の成分に基づいて設定されるパラメータに従ったホワイトバランス調整処理を実行して補正されたフラッシュ成分画像としての補正差分画像F'を求める(図3,S202)。 First, a flashed no image I 1, on the basis of the flashed image existed I 2, obtains the difference image data F = I 2 -I 1 in the difference image calculating unit 304 that is configured in the flash-component image output unit 330 (FIG. 3, S201). Next, the difference image data F = I 2 −I 1 , that is, the difference image F corresponding to the image photographed under the irradiation condition of only the flash light, is set by the white balance adjustment unit 307 based on the flash light component. The correction difference image F ′ as the flash component image corrected by executing the white balance adjustment process according to the parameters is obtained (FIG. 3, S202).

さらに、外光成分推定部306で推定した外光成分の推定値に基づいて設定されるパラメータに従ったホワイトバランス調整処理をフラッシユなし画像Iに対してホワイトバランス調整部305で実行する(図3,S203)。 Further, the white balance adjustment unit 305 executes the white balance adjustment process according to the parameter set based on the estimated value of the external light component estimated by the external light component estimation unit 306 for the non-flash image I 1 (see FIG. 3, S203).

さらに、強度調整値(ゲイン)算出部321において、補正差分画像F'について白とびの無い、または少ない画像とするための強度調整値としてのゲイン[g]を算出して、強度調整フラッシュ成分画像算出部322において、強度調整フラッシュ成分画像F"=gF'を算出する。この処理は、図3のステップS203の処理、すなわち、図4に示すフローに従った処理である。   Further, the intensity adjustment value (gain) calculation unit 321 calculates a gain [g] as an intensity adjustment value for making the correction difference image F ′ an image with no or less overexposure, and the intensity adjustment flash component image. The calculation unit 322 calculates the intensity adjustment flash component image F ″ = gF ′. This process is the process of step S203 in FIG. 3, that is, the process according to the flow shown in FIG.

さらに、最終調整画像算出部(画素値加算部)308において、ホワイトバランス調整部305から出力される補正画像I'と、強度調整フラッシュ成分画像算出部322から出力される強度調整フラッシュ成分画像F"の画素値を加算する(図3,S205)。 Further, in the final adjustment image calculation unit (pixel value addition unit) 308, the corrected image I 1 ′ output from the white balance adjustment unit 305 and the intensity adjustment flash component image F output from the intensity adjustment flash component image calculation unit 322. The pixel values of “are added (FIG. 3, S205).

撮影画像に動き部分が含まれない場合は、動き部分補正画素値算出部310において処理を実行することなく、画素値加算部308において加算した画素値を持つ画像データがホワイトバランス調整画像として出力切り替え部312を介して出力される。出力先はデジタルアナログ変換を実行するD/A変換器108(図1参照)や、符号化処理を実行するコーデック111などである。   When the captured image does not include a moving part, the image data having the pixel value added by the pixel value adding unit 308 is output as a white balance adjustment image without executing processing in the moving part correction pixel value calculating unit 310 The data is output via the unit 312. The output destination is a D / A converter 108 (see FIG. 1) that performs digital-analog conversion, a codec 111 that performs encoding processing, and the like.

一方、動き検出部309においてフラッシユなし画像Iと、フラッシユなし画像Iに基づく差分データによる動き検出の結果、被写体自身の動き領域が検出された場合は、さらに、動き部分補正画素地算出部310において、放射規定関数(Radial Basis Function)を適用した処理や、平滑化フィルタを適用した処理などにより、動きあり部分の画素値の補正(変換)がなされ、動きあり部分が、補正画素値によって置き換えられた画素値データを持つ画像が出力切り替え部312を介して出力される。 On the other hand, when the motion detection unit 309 detects the motion region of the subject itself as a result of motion detection based on the difference data based on the non-flashing image I 1 and the non-flashing image I 3 , the motion partial correction pixel location calculation unit In 310, the pixel value of the portion with motion is corrected (transformed) by processing using a radial basis function, processing using a smoothing filter, and the like, and the portion with motion is corrected by the corrected pixel value. An image having the replaced pixel value data is output via the output switching unit 312.

ホワイトバランス調整部311は、図2の処理フローにおけるステップS113の処理を実行する。すなわち、動き検出部309において動き領域が検出されたものの、動き領域の画像全体に占める割合が高いなど、補正不可能と判断された場合に、フラッシユあり画像Iを入力し、予め定めたパラメータに従ったホワイトバランス調整を実行し、これを出力切り替え部312を介して出力する。 The white balance adjustment unit 311 executes step S113 in the processing flow of FIG. That is, although the motion area by the motion detector 309 is detected, such as a high percentage of the total image of the motion area, if it is determined that uncorrectable, enter the flashed there image I 2, a predetermined parameter The white balance adjustment according to the above is executed, and this is output via the output switching unit 312.

なお、図8に示す構成は、機能を説明するために各処理部を区別して示してあるが、実際の処理としては、上述した各処理フローに従った処理を実行するプログラムに従って、DSP内のプロセッサによって実行可能である。   In the configuration shown in FIG. 8, each processing unit is shown separately in order to explain the function. However, as an actual process, a program in the DSP is executed according to a program that executes a process according to each process flow described above. It can be executed by the processor.

以上、特定の実施例を参照しながら、本発明について詳解してきた。しかしながら、本発明の要旨を逸脱しない範囲で当業者が該実施例の修正や代用を成し得ることは自明である。すなわち、例示という形態で本発明を開示してきたのであり、限定的に解釈されるべきではない。本発明の要旨を判断するためには、冒頭に記載した特許請求の範囲の欄を参酌すべきである。なお、上述した実施例では、被写体が暗い場合に発光する照明装置としてフラッシュという用語を用いて説明したが、このほかに、ストロボと呼ばれることもあり、フラッシュに限定されるわけではなく、一般的に被写体が暗い場合に発光する照明装置において本発明は適用される。   The present invention has been described in detail above with reference to specific embodiments. However, it is obvious that those skilled in the art can make modifications and substitutions of the embodiments without departing from the gist of the present invention. In other words, the present invention has been disclosed in the form of exemplification, and should not be interpreted in a limited manner. In order to determine the gist of the present invention, the claims section described at the beginning should be considered. In the above-described embodiment, the term “flash” is used as an illumination device that emits light when the subject is dark. However, the term “flash” may also be used instead of the flash. The present invention is applied to an illumination device that emits light when the subject is dark.

また、明細書中において説明した一連の処理はハードウェア、またはソフトウェア、あるいは両者の複合構成によって実行することが可能である。ソフトウェアによる処理を実行する場合は、処理シーケンスを記録したプログラムを、専用のハードウェアに組み込まれたコンピュータ内のメモリにインストールして実行させるか、あるいは、各種処理が実行可能な汎用コンピュータにプログラムをインストールして実行させることが可能である。
例えば、プログラムは記録媒体としてのハードディスクやROM(Read Only Memory)に予め記録しておくことができる。あるいは、プログラムはフレキシブルディスク、CD−ROM(Compact Disc Read Only Memory),MO(Magneto optical)ディスク,DVD(Digital Versatile Disc)、磁気ディスク、半導体メモリなどのリムーバブル記録媒体に、一時的あるいは永続的に格納(記録)しておくことができる。このようなリムーバブル記録媒体は、いわゆるパッケージソフトウエアとして提供することができる。
The series of processing described in the specification can be executed by hardware, software, or a combined configuration of both. When executing processing by software, the program recording the processing sequence is installed in a memory in a computer incorporated in dedicated hardware and executed, or the program is executed on a general-purpose computer capable of executing various processing. It can be installed and run.
For example, the program can be recorded in advance on a hard disk or ROM (Read Only Memory) as a recording medium. Alternatively, the program is temporarily or permanently stored on a removable recording medium such as a flexible disk, a CD-ROM (Compact Disc Read Only Memory), an MO (Magneto optical) disk, a DVD (Digital Versatile Disc), a magnetic disk, or a semiconductor memory. It can be stored (recorded). Such a removable recording medium can be provided as so-called package software.

なお、プログラムは、上述したようなリムーバブル記録媒体からコンピュータにインストールする他、ダウンロードサイトから、コンピュータに無線転送したり、LAN(Local Area Network)、インターネットといったネットワークを介して、コンピュータに有線で転送し、コンピュータでは、そのようにして転送されてくるプログラムを受信し、内蔵するハードディスク等の記録媒体にインストールすることができる。
なお、明細書に記載された各種の処理は、記載に従って時系列に実行されるのみならず、処理を実行する装置の処理能力あるいは必要に応じて並列的にあるいは個別に実行されてもよい。また、本明細書においてシステムとは、複数の装置の論理的集合構成であり、各構成の装置が同一筐体内にあるものには限らない。
The program is installed on the computer from the removable recording medium as described above, or is wirelessly transferred from the download site to the computer, or is wired to the computer via a network such as a LAN (Local Area Network) or the Internet. The computer can receive the program transferred in this manner and install it on a recording medium such as a built-in hard disk.
Note that the various processes described in the specification are not only executed in time series according to the description, but may be executed in parallel or individually according to the processing capability of the apparatus that executes the processes or as necessary. Further, in this specification, the system is a logical set configuration of a plurality of devices, and the devices of each configuration are not limited to being in the same casing.

以上、説明したように、本発明の構成によれば、フラッシュを発光させずに撮影した第1の画像と、フラッシュを発光させて撮影した第2の画像とに基づいてフラッシュ成分画像を算出し、該フラッシュ成分画像の強度調整を実行して生成した強度調整フラッシュ成分画像を適用して最終調整画像を生成する構成としたので、出力画像を生成する際に実行されるガンマ補正などの非線形変換処理後の画像における飽和画素値を持つ画素、すなわち白とびを削減した高品質な画像を生成することが可能となり、例えばデジタルカメラにおいて撮影された画像の補正処理に適用することができる。   As described above, according to the configuration of the present invention, the flash component image is calculated based on the first image captured without the flash and the second image captured with the flash. Since the final adjustment image is generated by applying the intensity adjustment flash component image generated by executing the intensity adjustment of the flash component image, nonlinear conversion such as gamma correction executed when generating the output image It is possible to generate a pixel having a saturated pixel value in the processed image, that is, a high-quality image with reduced overexposure, and can be applied to, for example, correction processing of an image shot with a digital camera.

さらに、本発明の構成によれば、フラッシュを発光させずに撮影した第1の画像について、外光成分に対応するパラメータに基づくホワイトバランス調整処理を実行してホワイトバランス調整済みの第1の画像を生成し、さらに、フラッシュ成分画像に対してフラッシュ光成分に対応するパラメータに基づくホワイトバランス調整処理を実行したフラッシュ成分画像を強度調整して、これらの画像に基づいて、最終調整画像を生成する構成としたので、個々の画像に対応するパラメータを用いた最適なホワイトバランス調整が実行され、例えばデジタルカメラにおいて撮影された画像の補正処理に適用することができる。   Further, according to the configuration of the present invention, the first image that has been subjected to the white balance adjustment by executing the white balance adjustment process based on the parameter corresponding to the external light component is performed on the first image that is taken without emitting the flash. Further, the intensity of the flash component image that has been subjected to the white balance adjustment process based on the parameter corresponding to the flash light component is adjusted for the flash component image, and the final adjusted image is generated based on these images. Since it is configured, optimal white balance adjustment using parameters corresponding to individual images is executed, and can be applied, for example, to correction processing of images taken with a digital camera.

101 レンズ
102 絞り
103 固体撮像素子
104 相関2重サンプリング回路
105 A/Dコンバータ
106 DSPブロック
107 タイミングジェネレータ
108 D/Aコンバータ
109 ビデオエンコーダ
110 ビデオモニタ
111 コーデック(CODEC)
112 メモリ
113 CPU
114 入力デバイス
115 フラッシュ制御装置
116 フラッシュ発光装置
301,302,303 フレームメモリ
304 差分画像算出部
305 ホワイトバランス調整部
306 外光成分推定部
307 ホワイトバランス調整部
308 画素値加算部
309 動き検出部
310 動き部分補正画素値算出部
311 ホワイトバランス調整部
312 出力切り替え部
321 強度調整値(ゲイン)算出部
322 強度調整フラッシュ成分画像算出部
330 フラッシュ成分画像算出部
DESCRIPTION OF SYMBOLS 101 Lens 102 Diaphragm 103 Solid-state image sensor 104 Correlated double sampling circuit 105 A / D converter 106 DSP block 107 Timing generator 108 D / A converter 109 Video encoder 110 Video monitor 111 Codec (CODEC)
112 memory 113 CPU
114 Input device 115 Flash control device 116 Flash light emitting device 301, 302, 303 Frame memory 304 Difference image calculation unit 305 White balance adjustment unit 306 Ambient light component estimation unit 307 White balance adjustment unit 308 Pixel value addition unit 309 Motion detection unit 310 Motion Partial correction pixel value calculation unit 311 White balance adjustment unit 312 Output switching unit 321 Intensity adjustment value (gain) calculation unit 322 Intensity adjustment flash component image calculation unit 330 Flash component image calculation unit

Claims (6)

画像処理装置において実行する画像処理方法であり、
連続撮影画像であるフラッシュ発光なし撮影画像である第1画像I と、フラッシュ発光あり撮影画像である第2画像I と、フラッシュ発光なし撮影画像である第3画像I を入力し、
前記第1画像I と、前記第3画像I とに基づく動き検出処理を実行し、
前記動き検出処理において、動き部分ありと判定され、かつ動き部分領域の大きさに応じた補正可否判定処理において補正不可と判定した場合は、前記第2画像I に対するホワイトバランス調整処理を実行してホワイトバランス調整画像Rを生成し、
前記動き検出処理において、動き部分なしとの判定がなされた場合、または、
動き部分ありと判定され、かつ動き部分領域の大きさに応じた補正可否判定処理において補正可と判定した場合は、
前記第1画像I と、前記第2画像I との差分画像Fを算出し、
前記差分画像Fに対して、フラッシュ光成分対応パラメータに基づくホワイトバランス調整処理を実行した差分補正画像F’を生成し、
前記第1画像に対して、外光成分対応パラメータに基づくホワイトバランス調整処理を実行した第1補正画像I ’を生成し、
前記差分補正画像F’と、前記第1補正画像I ’との合成画像R tmp に基づいて生成する非線形変換処理画像中の飽和画素数を抑制する調整値として、前記差分補正画像F’の強度調整値gを算出し、
前記差分補正画像F’に対して、前記強度調整値gを適用した強度調整により、強度調整差分補正画像F”を生成し、
前記第1補正画像I ’と、前記強度調整差分補正画像F”との合成処理によってホワイトバランス調整画像Rを生成する処理を実行することを特徴とする画像処理方法。
An image processing method executed in an image processing apparatus,
A first image I 1 that is a continuously shot image and a captured image without flash emission , a second image I 2 that is a captured image with flash emission, and a third image I 3 that is a captured image without flash emission are input.
And the first image I 1, performs motion detection processing based on said third image I 3,
In the motion detection process, when it is determined that there is a motion part and it is determined that correction is not possible in the correction possibility determination process according to the size of the motion part area, a white balance adjustment process is performed on the second image I 2 . To generate a white balance adjustment image R,
In the motion detection process, when it is determined that there is no moving part, or
When it is determined that there is a moving part and it is determined that correction is possible in the correction possibility determination process according to the size of the moving part area,
Calculating a difference image F between the first image I 1 and the second image I 2 ;
For the difference image F, a difference correction image F ′ obtained by performing white balance adjustment processing based on the flash light component correspondence parameter is generated,
Generating a first corrected image I 1 ′ obtained by executing white balance adjustment processing based on the external light component corresponding parameter for the first image ;
As an adjustment value for suppressing the number of saturated pixels in the nonlinear transformation processed image generated based on the composite image R tmp of the difference correction image F ′ and the first correction image I 1 ′, the difference correction image F ′ Calculate the strength adjustment value g,
An intensity adjustment difference correction image F ″ is generated by intensity adjustment applying the intensity adjustment value g to the difference correction image F ′,
An image processing method, comprising: executing a process of generating a white balance adjustment image R by a synthesis process of the first correction image I 1 ′ and the intensity adjustment difference correction image F ″ .
前記非線形変換処理は、ガンマ補正であり、
前記強度調整値gは、ガンマ補正画像中の飽和画素値を持つ画素数を抑制する強度調整値であることを特徴とする請求項1に記載の画像処理方法。
The nonlinear conversion process is a gamma correction,
The image processing method according to claim 1, wherein the intensity adjustment value g is an intensity adjustment value that suppresses the number of pixels having a saturated pixel value in a gamma corrected image .
画像処理装置であり、
連続撮影画像であるフラッシュ発光なし撮影画像である第1画像I と、フラッシュ発光あり撮影画像である第2画像I と、フラッシュ発光なし撮影画像である第3画像I を入力し、
前記第1画像I と、前記第3画像I とに基づく動き検出処理を実行し、
前記動き検出処理において、動き部分ありと判定され、かつ動き部分領域の大きさに応じた補正可否判定処理において補正不可と判定した場合は、前記第2画像I に対するホワイトバランス調整処理を実行してホワイトバランス調整画像Rを生成し、
前記動き検出処理において、動き部分なしとの判定がなされた場合、または、
動き部分ありと判定され、かつ動き部分領域の大きさに応じた補正可否判定処理において補正可と判定した場合は、
前記第1画像I と、前記第2画像I との差分画像Fを算出し、
前記差分画像Fに対して、フラッシュ光成分対応パラメータに基づくホワイトバランス調整処理を実行した差分補正画像F’を生成し、
前記第1画像に対して、外光成分対応パラメータに基づくホワイトバランス調整処理を実行した第1補正画像I ’を生成し、
前記差分補正画像F’と、前記第1補正画像I ’との合成画像R tmp に基づいて生成する非線形変換処理画像中の飽和画素数を抑制する調整値として、前記差分補正画像F’の強度調整値gを算出し、
前記差分補正画像F’に対して、前記強度調整値gを適用した強度調整により、強度調整差分補正画像F”を生成し、
前記第1補正画像I ’と、前記強度調整差分補正画像F”との合成処理によってホワイトバランス調整画像Rを生成する処理を実行することを特徴とする画像処理装置。
An image processing device,
A first image I 1 that is a continuously shot image and a captured image without flash emission , a second image I 2 that is a captured image with flash emission, and a third image I 3 that is a captured image without flash emission are input.
And the first image I 1, performs motion detection processing based on said third image I 3,
In the motion detection process, when it is determined that there is a motion part and it is determined that correction is not possible in the correction possibility determination process according to the size of the motion part area, a white balance adjustment process is performed on the second image I 2 . To generate a white balance adjustment image R,
In the motion detection process, when it is determined that there is no moving part, or
When it is determined that there is a moving part and it is determined that correction is possible in the correction possibility determination process according to the size of the moving part area,
Calculating a difference image F between the first image I 1 and the second image I 2 ;
For the difference image F, a difference correction image F ′ obtained by performing white balance adjustment processing based on the flash light component correspondence parameter is generated,
Generating a first corrected image I 1 ′ obtained by executing white balance adjustment processing based on the external light component corresponding parameter for the first image ;
As an adjustment value for suppressing the number of saturated pixels in the nonlinear transformation processed image generated based on the composite image R tmp of the difference correction image F ′ and the first correction image I 1 ′, the difference correction image F ′ Calculate the strength adjustment value g,
An intensity adjustment difference correction image F ″ is generated by intensity adjustment applying the intensity adjustment value g to the difference correction image F ′,
An image processing apparatus that executes a process of generating a white balance adjustment image R by a synthesis process of the first correction image I 1 ′ and the intensity adjustment difference correction image F ″ .
前記非線形変換処理は、ガンマ補正であり、
前記強度調整値gは、ガンマ補正画像中の飽和画素値を持つ画素数を抑制する強度調整値であることを特徴とする請求項に記載の画像処理装置。
The nonlinear conversion process is a gamma correction,
The image processing apparatus according to claim 3 , wherein the intensity adjustment value g is an intensity adjustment value that suppresses the number of pixels having a saturated pixel value in a gamma corrected image .
前記画像処理装置は、さらに、
フラッシュの発光を制御して、前記第1画像I と、前記第2画像I を含む複数画像の撮影を実行する撮像部を有することを特徴とする請求項に記載の画像処理装置。
The image processing apparatus further includes:
4. The image processing apparatus according to claim 3 , further comprising: an imaging unit that controls flash emission to capture a plurality of images including the first image I 1 and the second image I 2. 5 .
画像処理装置において画像処理を実行させるコンピュータ・プログラムであり、
連続撮影画像であるフラッシュ発光なし撮影画像である第1画像I と、フラッシュ発光あり撮影画像である第2画像I と、フラッシュ発光なし撮影画像である第3画像I を入力する処理と、
前記第1画像I と、前記第3画像I とに基づく動き検出処理と、
前記動き検出処理において、動き部分ありと判定され、かつ動き部分領域の大きさに応じた補正可否判定処理において補正不可と判定した場合は、前記第2画像I に対するホワイトバランス調整処理を実行してホワイトバランス調整画像Rを生成する処理と、
前記動き検出処理において、動き部分なしとの判定がなされた場合、または、
動き部分ありと判定され、かつ動き部分領域の大きさに応じた補正可否判定処理において補正可と判定した場合は、
前記第1画像I と、前記第2画像I との差分画像Fを算出する処理、
前記差分画像Fに対して、フラッシュ光成分対応パラメータに基づくホワイトバランス調整処理を実行した差分補正画像F’を生成する処理、
前記第1画像に対して、外光成分対応パラメータに基づくホワイトバランス調整処理を実行した第1補正画像I ’を生成する処理、
前記差分補正画像F’と、前記第1補正画像I ’との合成画像R tmp に基づいて生成する非線形変換処理画像中の飽和画素数を抑制する調整値として、前記差分補正画像F’の強度調整値gを算出する処理、
前記差分補正画像F’に対して、前記強度調整値gを適用した強度調整により、強度調整差分補正画像F”を生成する処理、
前記第1補正画像I ’と、前記強度調整差分補正画像F”との合成処理によってホワイトバランス調整画像Rを生成する処理を実行させることを特徴とするコンピュータ・プログラム。
A computer program for executing image processing in an image processing apparatus;
A process of inputting a first image I 1 that is a continuously shot image that is a captured image without flash emission , a second image I 2 that is a captured image with flash emission, and a third image I 3 that is a captured image without flash emission; ,
A motion detection process based on the first image I 1 and the third image I 3 ;
In the motion detection process, when it is determined that there is a motion part and it is determined that correction is not possible in the correction possibility determination process according to the size of the motion part area, a white balance adjustment process is performed on the second image I 2 . Processing to generate the white balance adjustment image R,
In the motion detection process, when it is determined that there is no moving part, or
When it is determined that there is a moving part and it is determined that correction is possible in the correction possibility determination process according to the size of the moving part area,
A process of calculating a difference image F between the first image I 1 and the second image I 2 ;
A process for generating a difference-corrected image F ′ obtained by executing a white balance adjustment process based on the flash light component correspondence parameter for the difference image F;
Processing for generating a first corrected image I 1 ′ in which white balance adjustment processing based on an external light component corresponding parameter is performed on the first image ;
As an adjustment value for suppressing the number of saturated pixels in the nonlinear transformation processed image generated based on the composite image R tmp of the difference correction image F ′ and the first correction image I 1 ′, the difference correction image F ′ Processing for calculating the intensity adjustment value g;
A process of generating an intensity adjustment difference correction image F ″ by intensity adjustment applying the intensity adjustment value g to the difference correction image F ′;
A computer program for executing a process of generating a white balance adjustment image R by a synthesis process of the first correction image I 1 ′ and the intensity adjustment difference correction image F ″ .
JP2009165927A 2009-07-14 2009-07-14 Image processing method, image processing apparatus, and computer program Expired - Fee Related JP4905513B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009165927A JP4905513B2 (en) 2009-07-14 2009-07-14 Image processing method, image processing apparatus, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009165927A JP4905513B2 (en) 2009-07-14 2009-07-14 Image processing method, image processing apparatus, and computer program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2004015789A Division JP4379129B2 (en) 2004-01-23 2004-01-23 Image processing method, image processing apparatus, and computer program

Publications (2)

Publication Number Publication Date
JP2009296608A JP2009296608A (en) 2009-12-17
JP4905513B2 true JP4905513B2 (en) 2012-03-28

Family

ID=41544264

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009165927A Expired - Fee Related JP4905513B2 (en) 2009-07-14 2009-07-14 Image processing method, image processing apparatus, and computer program

Country Status (1)

Country Link
JP (1) JP4905513B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5615012B2 (en) * 2010-03-29 2014-10-29 富士フイルム株式会社 White balance stable adjustment device and control method thereof, program for white balance stable adjustment
JP6218496B2 (en) * 2013-08-21 2017-10-25 キヤノン株式会社 Imaging apparatus and imaging method
JP6370146B2 (en) * 2014-07-28 2018-08-08 キヤノン株式会社 Image processing apparatus and control method thereof
JP6823942B2 (en) * 2016-05-02 2021-02-03 株式会社モルフォ Image synthesizer, image synthesizer, image synthesizer program and storage medium
WO2019087299A1 (en) 2017-10-31 2019-05-09 株式会社モルフォ Image combination device, image combination method, image combination program, and storage medium
CN115002320B (en) * 2022-05-27 2023-04-18 北京理工大学 Light intensity adjusting method, device and system based on visual detection and processing equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0974516A (en) * 1995-09-06 1997-03-18 Sharp Corp Image input device
JP3674297B2 (en) * 1997-03-14 2005-07-20 セイコーエプソン株式会社 DYNAMIC RANGE ADJUSTING METHOD FOR LIQUID CRYSTAL DISPLAY DEVICE, LIQUID CRYSTAL DISPLAY DEVICE AND ELECTRONIC DEVICE
JP2003296720A (en) * 2002-04-02 2003-10-17 Nikon Corp Image processor and image processing method

Also Published As

Publication number Publication date
JP2009296608A (en) 2009-12-17

Similar Documents

Publication Publication Date Title
JP4379129B2 (en) Image processing method, image processing apparatus, and computer program
KR101032165B1 (en) Image processing method, image processing apparatus, and computer readable recording medium
KR101609556B1 (en) Imaging apparatus and control method
JP5141733B2 (en) Imaging apparatus, imaging method, and program
JP4407514B2 (en) Imaging data processing method, imaging data processing apparatus, and computer program
JP5787648B2 (en) Image processing apparatus and image processing apparatus control method
JP6423625B2 (en) Image processing apparatus and image processing method
US10861136B2 (en) Image processing apparatus, image processing method, and storage medium
JP4905513B2 (en) Image processing method, image processing apparatus, and computer program
JP2011128536A (en) Imaging apparatus and control method therefor
JP5804856B2 (en) Image processing apparatus, image processing method, and program
JP2010263423A (en) Method and device for processing image
JP6025472B2 (en) Image processing apparatus and image processing method
JP2010193002A (en) Imaging apparatus, image processing method and program
JP5713643B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
JP2002369075A (en) Image pickup unit, picture processor, image pickup program and picture processing program
JP5932392B2 (en) Image processing apparatus and image processing method
JP5765599B2 (en) Imaging apparatus, image processing method, and program
JP4389671B2 (en) Image processing apparatus, image processing method, and computer program
JP6272006B2 (en) Imaging apparatus, image processing method, and program
JP2011155422A (en) Imaging apparatus, image processing method and program
JP2010172013A (en) Electronic camera, and image processing program
JP2016005105A (en) Imaging apparatus
JP2020088802A (en) Imaging apparatus and control method therefor, program, storage medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110920

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111018

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111122

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20111213

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111226

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150120

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150120

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees