JP5854716B2 - Image processing apparatus, image processing method, and program - Google Patents

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

Info

Publication number
JP5854716B2
JP5854716B2 JP2011195401A JP2011195401A JP5854716B2 JP 5854716 B2 JP5854716 B2 JP 5854716B2 JP 2011195401 A JP2011195401 A JP 2011195401A JP 2011195401 A JP2011195401 A JP 2011195401A JP 5854716 B2 JP5854716 B2 JP 5854716B2
Authority
JP
Japan
Prior art keywords
image data
correction value
white balance
calculating
balance correction
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
JP2011195401A
Other languages
Japanese (ja)
Other versions
JP2013058869A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2011195401A priority Critical patent/JP5854716B2/en
Publication of JP2013058869A publication Critical patent/JP2013058869A/en
Application granted granted Critical
Publication of JP5854716B2 publication Critical patent/JP5854716B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像データに対するホワイトバランス制御技術に関するものである。   The present invention relates to a white balance control technique for image data.

デジタルカメラやデジタルビデオカメラ等の、撮像素子を用いる撮像装置においては、撮影によって得られた画像データの色調を調整するホワイトバランス制御機能を備えている。ホワイトバランス制御には、マニュアルホワイトバランス制御とオートホワイトバランス制御とがある。マニュアルホワイトバランス制御は、予め白色被写体を撮像してホワイトバランス係数を算出しておき、算出したホワイトバランス係数を画面全体に適用する制御である。オートホワイトバランス制御は、撮影した画像データから白色と思われる部分を自動検出し、画面全体の各色成分の平均値からホワイトバランス係数を算出し、算出したホワイトバランス係数を画面全体に適用する制御である。   An imaging apparatus using an imaging element such as a digital camera or a digital video camera has a white balance control function for adjusting the color tone of image data obtained by shooting. White balance control includes manual white balance control and automatic white balance control. Manual white balance control is control in which a white subject is imaged in advance and a white balance coefficient is calculated, and the calculated white balance coefficient is applied to the entire screen. Auto white balance control is a control that automatically detects white parts from captured image data, calculates the white balance coefficient from the average value of each color component on the entire screen, and applies the calculated white balance coefficient to the entire screen. is there.

従来のオートホワイトバランス制御においては、ストロボ発光シーンにおいて画像データ内にストロボ光とは異なる光源が存在する場合、上記のように算出されたホワイトバランス係数を画面全体に適用してホワイトバランス制御を行う。そのため、各光源をともに適正な色味とするホワイトバランス制御を行うことが困難であった。例えば、ストロボ発光シーンで環境光に電球色光源のような低色温度光源が存在する場合、ストロボ光が高色温度光源であるため、ストロボ光にホワイトバランスを合わせると低色温度光源にホワイトバランスが合わなくなってしまう。一方、低色温度光源にホワイトバランスを合わせた場合には、ストロボ光にホワイトバランスが合わなくなってしまう。また、両方の光源の中間にホワイトバランスを合わせてホワイトバランス制御を行ったとしても、両方の光源にホワイトバランスが合わず、ストロボ光で照射されている領域は青みを帯び、低色温度光源で照射されている領域は赤味を帯びるような色味となってしまう。   In conventional auto white balance control, when a light source different from strobe light exists in image data in a strobe lighting scene, white balance control is performed by applying the white balance coefficient calculated as described above to the entire screen. . For this reason, it is difficult to perform white balance control in which each light source has an appropriate color. For example, if there is a low color temperature light source such as a light bulb color light source in the ambient light in a strobe lighting scene, the strobe light is a high color temperature light source. Will not fit. On the other hand, when the white balance is matched with the low color temperature light source, the white balance is not matched with the strobe light. Even if white balance control is performed by adjusting the white balance in the middle of both light sources, the white balance does not match both light sources, the area illuminated by the strobe light is bluish, and the low color temperature light source is used. The irradiated area has a reddish color.

これに対し、特許文献1には次のような技術が開示されている。即ち、特許文献1に開示される技術は、ストロボ発光時に撮影された画像データとストロボ非発光時に撮影された画像データとを、任意の被写体領域毎に比較してデータの比を求め、その比の値によりストロボ光の寄与度を判定する。そして、判定した寄与度に応じて被写体領域毎にホワイトバランス制御値を選択して、ホワイトバランス制御を行う。   In contrast, Patent Document 1 discloses the following technique. That is, the technique disclosed in Patent Document 1 compares the image data captured when the flash is fired with the image data captured when the flash is not flashed for each subject area to obtain a data ratio. The contribution of strobe light is determined based on the value of. Then, a white balance control value is selected for each subject area according to the determined contribution, and white balance control is performed.

特許第3540485号公報Japanese Patent No. 3540485

従来の自動露出制御(AE)では、被写体輝度を測光して適正露出となるように露出制御を行っている。被写体輝度を正しく測光するためには光源の色味を補正する必要がある。しかし、露出の決定は撮影前であり、光源の色温度の決定は撮影後に実行することから、AEによって測光する時点では撮影された画像データの色温度を取得することができない。従って、測光では仮に太陽光の色温度のホワイトバランス係数を用いて輝度を算出して露出制御を行う。その後、静止画撮影後に光源の色温度を正確に求め、測光時に仮に用いた太陽光のホワイトバランス係数との差分を、輝度補正係数として算出している。   In conventional automatic exposure control (AE), exposure control is performed so that the subject brightness is measured and an appropriate exposure is obtained. In order to measure the subject brightness correctly, it is necessary to correct the color of the light source. However, since the exposure is determined before photographing and the color temperature of the light source is determined after photographing, the color temperature of the photographed image data cannot be obtained at the time of photometry by AE. Therefore, in photometry, exposure control is performed by calculating the luminance using the white balance coefficient of the color temperature of sunlight. Thereafter, the color temperature of the light source is accurately obtained after still image shooting, and the difference from the white balance coefficient of sunlight temporarily used during photometry is calculated as a luminance correction coefficient.

このような色温度の変動による輝度補正を特に色温度補正と呼んでいる。従来は、撮影された画像データに対して画面全体に1つのホワイトバランス係数を適用していたが、領域毎に異なるホワイトバランス係数を適用する場合は色温度補正係数を一意に求めることができないという問題があった。   Luminance correction based on such variations in color temperature is particularly called color temperature correction. Conventionally, one white balance coefficient is applied to the entire screen for captured image data. However, when a different white balance coefficient is applied to each region, the color temperature correction coefficient cannot be uniquely obtained. There was a problem.

図9は、色温度と輝度との関係を示す図であり、測光時に用いられる太陽光の色温度が5200Kであるとき、光源の色温度が変わることで輝度が変動する様子を示している。映像信号RGBから輝度Yを算出する際には、輝度構成比としてR:G:B=3:6:1という比率をもって算出しており、光源の色温度を正しく補正しなければ正確な輝度を求めることができない。電球等の低色温度光源下とストロボ光等の高色温度光源下とでは、正しく光源色を補正しないと輝度が大きく異なるわけであるが、室内等において低色温度光源下でストロボ撮影を行うのは一般的な撮影シーンである。そのため、複数光源下における最適な輝度補正が必要とされていた。   FIG. 9 is a diagram showing the relationship between the color temperature and the luminance. When the color temperature of sunlight used for photometry is 5200K, the luminance changes as the color temperature of the light source changes. When calculating the luminance Y from the video signal RGB, the luminance composition ratio is calculated as a ratio of R: G: B = 3: 6: 1. If the color temperature of the light source is not corrected correctly, an accurate luminance is obtained. I can't ask for it. If the light source color is not corrected correctly, the brightness will be greatly different between a low color temperature light source such as a light bulb and a high color temperature light source such as strobe light. Is a general shooting scene. Therefore, optimum brightness correction under a plurality of light sources has been required.

そこで、本発明の目的は、露出制御のための測光時と撮影時との色温度の変動に伴う輝度成分の補正をより正確に行うことにある。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to more accurately correct a luminance component accompanying a change in color temperature between photometry for exposure control and photographing.

本発明の画像処理装置は、ストロボ発光時に撮影された画像データに基づいて第1のホワイトバランス補正値を算出するとともに、ストロボ非発光時に撮影された画像データに基づいて第2のホワイトバランス補正値を算出する補正値算出手段と、前記第1のホワイトバランス補正値に基づいて、前記ストロボ発光時に撮影された画像データから第1の画像データを現像するとともに、前記第2のホワイトバランス補正値に基づいて、前記ストロボ非発光時に撮影された画像データから第2の画像データを現像する現像手段と、前記ストロボ非発光時に撮影された画像データの輝度値と前記ストロボ発光時に撮影された画像データの輝度値とに基づいて、外光の輝度成分とストロボ光の輝度成分とを算出する成分算出手段と、前記外光の輝度成分と前記ストロボ光の輝度成分とに基づいて、前記第1の画像データと前記第2の画像データとの合成比率を算出する合成比率算出手段と、前記合成比率算出手段により算出された前記合成比率に基づいて、前記第1のホワイトバランス補正値と前記第2のホワイトバランス補正値とを混合する混合手段と、露出制御のための測光手段による測光時に撮影環境の光源色を補正するために使用されるホワイトバランス補正値と、前記混合手段により生成されたホワイトバランス補正値とに基づいて、色温度補正係数を算出する補正係数算出手段と、前記合成比率算出手段により算出された前記合成比率に従って、前記第1の画像データと前記第2の画像データとを合成して第3の画像データを生成する合成手段と、前記補正係数算出手段により算出された前記色温度補正係数を用いて、前記合成手段により生成された前記第3の画像データの輝度成分を補正する補正手段とを有することを特徴とする。   The image processing apparatus according to the present invention calculates a first white balance correction value based on image data captured when the flash is fired, and a second white balance correction value based on image data captured when the flash is not flashing. Based on the first white balance correction value and the correction value calculation means for calculating the first image data from the image data photographed during the flash emission, and the second white balance correction value. A developing means for developing the second image data from the image data photographed when the flash is not emitted, the luminance value of the image data photographed when the flash is not emitted, and the image data captured when the flash is emitted. Component calculating means for calculating a luminance component of external light and a luminance component of strobe light based on the luminance value, and the luminance of the external light A composite ratio calculating means for calculating a composite ratio between the first image data and the second image data based on the minute and the luminance component of the strobe light; and the composite calculated by the composite ratio calculating means Based on the ratio, for correcting the light source color of the shooting environment at the time of photometry by the mixing means for mixing the first white balance correction value and the second white balance correction value and the photometry means for exposure control Correction coefficient calculation means for calculating a color temperature correction coefficient based on the white balance correction value used and the white balance correction value generated by the mixing means, and the composition ratio calculated by the composition ratio calculation means The first image data and the second image data are combined to generate third image data, and the correction coefficient calculation unit Using the calculated the color temperature correction coefficient, and having a correction means for correcting the luminance component of the third image data generated by the synthesizing means.

本発明によれば、露出制御のための測光時と撮影時との色温度の変動に伴う輝度成分の補正をより正確に行うことが可能となる。   According to the present invention, it is possible to more accurately correct the luminance component accompanying the variation in the color temperature between the photometry for exposure control and the shooting.

本発明の実施形態に係る撮像装置の構成を示す図である。It is a figure which shows the structure of the imaging device which concerns on embodiment of this invention. ストロボ発光時の第1のWB補正値の算出処理を示すフローチャートである。It is a flowchart which shows the calculation process of the 1st WB correction value at the time of strobe light emission. 白検出の際に使用されるグラフを示す図である。It is a figure which shows the graph used in the case of white detection. 撮影制御を時系列に並べて示した図である。It is the figure which showed photographing control side by side in time series. 静止画撮影駆動モードにおけるWB補正値とEVF撮影駆動モードにおけるWB補正値とを示す図である。It is a figure which shows the WB correction value in still image photography drive mode, and the WB correction value in EVF photography drive mode. シーンの雰囲気を考慮して色味を残すように第2のWB補正値を算出する方法を説明するための図である。It is a figure for demonstrating the method to calculate a 2nd WB correction value so that a color may be left in consideration of the atmosphere of a scene. 画像データの合成処理を示すフローチャートである。It is a flowchart which shows the synthetic | combination process of image data. 照射比率を算出するための被写体領域の切り出しについて説明するための図である。It is a figure for demonstrating extraction of the to-be-photographed area | region for calculating an irradiation ratio. 色温度と輝度との関係を示す図である。It is a figure which shows the relationship between color temperature and a brightness | luminance.

以下、本発明を適用した好適な実施形態を、添付図面を参照しながら詳細に説明する。   DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments to which the invention is applied will be described in detail with reference to the accompanying drawings.

図1は、本発明の実施形態に係る撮像装置の構成を示す図である。なお、本実施形態に係る撮像装置は、画像処理装置の適用例となる構成である。図1において、101は、CCDやCMOS等で構成される固体撮像素子であり、その表面は例えばベイヤー配列のようなRGBカラーフィルタにより覆われ、カラー撮影が可能な構成となっている。   FIG. 1 is a diagram illustrating a configuration of an imaging apparatus according to an embodiment of the present invention. Note that the imaging apparatus according to the present embodiment has a configuration as an application example of the image processing apparatus. In FIG. 1, reference numeral 101 denotes a solid-state imaging device composed of a CCD, a CMOS, or the like, and its surface is covered with, for example, an RGB color filter such as a Bayer array so that color photography can be performed.

CPU114は、画像データ全体が明るくなるようなシャッタ速度、絞り値を計算するとともに、合焦領域内にある被写体に合焦するようにフォーカスレンズの駆動量を計算する。CPU114によって計算された露出値(シャッタ速度、絞り値)及びフォーカスレンズの駆動量は制御回路113に出力され、各値に基づいてそれぞれ制御される。103はホワイトバランス(以下、WB)制御回路であり、メモリ102に記憶された画像データに基づいてWB補正値を算出し、算出したWB補正値を用いて、メモリ102に記憶された画像データに対してWB補正を行う。なお、このWB制御回路103によるWB補正値の算出方法の詳細については後述する。   The CPU 114 calculates a shutter speed and an aperture value that brighten the entire image data, and calculates a driving amount of the focus lens so as to focus on a subject in the focus area. The exposure value (shutter speed, aperture value) and the driving amount of the focus lens calculated by the CPU 114 are output to the control circuit 113 and controlled based on each value. A white balance (hereinafter referred to as WB) control circuit 103 calculates a WB correction value based on the image data stored in the memory 102, and uses the calculated WB correction value to convert the image data stored in the memory 102 into image data. On the other hand, WB correction is performed. The details of the WB correction value calculation method by the WB control circuit 103 will be described later.

104は、WB制御回路103によりWB補正された画像データが最適な色で再現されるように色ゲインをかけて色差信号R−Y、B−Yに変換する色マトリックス回路である。105は、色差信号R−Y、B−Yの帯域を制限するローパスフィルタ(LPF)回路である。106は、LPF回路105で帯域制限された画像データのうち、飽和部分の偽色信号を抑圧するCSUP(Chroma Supress)回路である。一方、WB制御回路103によりWB補正された画像データは、輝度信号(Y)生成回路111にも出力されて輝度信号Yが生成され、エッジ強調回路112は、生成された輝度信号Yに対してエッジ強調処理を施す。   A color matrix circuit 104 converts the color difference signals RY and BY by applying a color gain so that the image data corrected by the WB by the WB control circuit 103 is reproduced with an optimum color. Reference numeral 105 denotes a low-pass filter (LPF) circuit that limits the bands of the color difference signals RY and BY. Reference numeral 106 denotes a CSUP (Chroma Supress) circuit that suppresses a false color signal in a saturated portion of the image data band-limited by the LPF circuit 105. On the other hand, the image data subjected to the WB correction by the WB control circuit 103 is also output to the luminance signal (Y) generation circuit 111 to generate the luminance signal Y, and the edge enhancement circuit 112 outputs the generated luminance signal Y to the luminance signal Y. Apply edge enhancement.

CSUP回路106から出力される色差信号R−Y、B−Yと、エッジ強調回路112から出力される輝度信号Yとは、RGB変換回路107にてRGB信号に変換され、ガンマ(γ)補正回路108にて階調補正が施される。階調補正が施されたRGB信号は、色輝度変換回路109においてYUV信号に変換され、さらにJPEG圧縮回路110にて圧縮されて、外部記録媒体又は内部記録媒体に画像データとして記録される。   The color difference signals RY and BY output from the CSUP circuit 106 and the luminance signal Y output from the edge enhancement circuit 112 are converted into RGB signals by the RGB conversion circuit 107, and a gamma (γ) correction circuit. At 108, gradation correction is performed. The RGB signal subjected to the gradation correction is converted into a YUV signal by the color luminance conversion circuit 109, further compressed by the JPEG compression circuit 110, and recorded as image data on an external recording medium or an internal recording medium.

次に、WB制御回路103におけるWB補正値の算出方法について詳細に説明する。先ず、図2のフローチャートを参照しながら、本露光時(ストロボ発光時)のWB補正値である第1のWB補正値(第1のホワイトバランス補正値)の算出処理について説明する。なお、第1のWB補正値は、ストロボ発光時に撮影された画像データ(以下、ストロボ発光時画像データ)に基づいて算出される補正値である。   Next, a method for calculating the WB correction value in the WB control circuit 103 will be described in detail. First, a calculation process of a first WB correction value (first white balance correction value) that is a WB correction value at the time of main exposure (during strobe light emission) will be described with reference to the flowchart of FIG. Note that the first WB correction value is a correction value calculated based on image data captured during flash emission (hereinafter, image data during flash emission).

ステップS201において、WB制御回路103は、メモリ102に記憶されたストロボ発光時画像データを読み出し、当該ストロボ発光時画像データを任意のm個のブロックに分割する。ステップS202において、WB制御回路103は、ブロック(1〜m)毎に、画素値を色毎に加算平均して色平均値(R[i],G[i],B[i])を算出し、次の式を用いて色評価値(Cx[i],Cy[i])を算出する。
Cx[i]=(R[i]−B[i])/Y[i]×1024
Cy[i]=(R[i]+B[i]−2G[i])/Y[i]×1024
但し、Y[i]=(R[i]+2G[i]+B[i])/4
In step S <b> 201, the WB control circuit 103 reads the strobe flashing image data stored in the memory 102 and divides the strobe flashing image data into arbitrary m blocks. In step S202, the WB control circuit 103 calculates a color average value (R [i], G [i], B [i]) by averaging pixel values for each color for each block (1 to m). Then, a color evaluation value (Cx [i], Cy [i]) is calculated using the following formula.
Cx [i] = (R [i] −B [i]) / Y [i] × 1024
Cy [i] = (R [i] + B [i] -2G [i]) / Y [i] × 1024
However, Y [i] = (R [i] + 2G [i] + B [i]) / 4

WB制御回路103は、図3に示すような座標軸を持つグラフを用いて白検出を行う。x座標(Cx)の負方向が高色温度被写体の白を撮影したときの色評価値を表し、正方向が低色温度被写体の色を撮影したときの色評価値を表す。また、y座標(Cy)は光源の緑成分の度合いを意味しており、負方向になるにつれGreen成分が大きくなり、つまり蛍光灯であることを示している。   The WB control circuit 103 performs white detection using a graph having coordinate axes as shown in FIG. The negative direction of the x coordinate (Cx) represents a color evaluation value when white of a high color temperature subject is photographed, and the positive direction represents a color evaluation value when a color of a low color temperature subject is photographed. The y-coordinate (Cy) means the degree of the green component of the light source, and the green component increases as it goes in the negative direction, that is, it indicates a fluorescent lamp.

ステップS203において、WB制御回路103は、ステップS202で算出したi番目のブロックの色評価値(Cx[i],Cy[i])が、図3に示す予め設定される白検出範囲301に含まれるか否かを判定する。白検出範囲301は、ストロボ光が既知の光源であるために検出範囲が限定されている。i番目のブロックの色評価値(Cx[i],Cy[i])が予め設定される白検出範囲301に含まれる場合、処理はステップS204に移行する。一方、i番目のブロックの色評価値(Cx[i],Cy[i])が予め設定される白検出範囲301に含まれない場合、処理はステップS204をスキップして、ステップS205に移行する。   In step S203, the WB control circuit 103 includes the color evaluation values (Cx [i], Cy [i]) of the i-th block calculated in step S202 in the preset white detection range 301 shown in FIG. It is determined whether or not. The white detection range 301 is limited because the strobe light is a known light source. When the color evaluation value (Cx [i], Cy [i]) of the i-th block is included in the preset white detection range 301, the process proceeds to step S204. On the other hand, when the color evaluation value (Cx [i], Cy [i]) of the i-th block is not included in the preset white detection range 301, the process skips step S204 and proceeds to step S205. .

ステップS204において、WB制御回路103は、i番目のブロックが白色であると判定して、当該ブロックの色平均値(R[i],G[i],B[i])を積分する。なお、ステップS203及びS204の処理は、次の式によって表すことができる。   In step S204, the WB control circuit 103 determines that the i-th block is white, and integrates the color average values (R [i], G [i], B [i]) of the block. Note that the processing of steps S203 and S204 can be expressed by the following equation.

Figure 0005854716
Figure 0005854716

ここで、上記式において、色評価値(Cx[i],Cy[i])が白検出範囲301に含まれる場合にはSw[i]を1とし、色評価値(Cx[i],Cy[i])が白検出範囲301に含まれない場合にはSw[i]を0とする。これにより、ステップS203、S204において、色平均値(R[i],G[i],B[i])を積分するか、積分しないかを実質的に行っている。   Here, in the above formula, when the color evaluation value (Cx [i], Cy [i]) is included in the white detection range 301, Sw [i] is set to 1, and the color evaluation value (Cx [i], Cy If [i]) is not included in the white detection range 301, Sw [i] is set to 0. Thereby, in steps S203 and S204, the color average values (R [i], G [i], B [i]) are substantially integrated or not integrated.

ステップS205において、WB制御回路103は、全てのブロックについて上記処理を行ったか否かを判定する。未処理のブロックが存在する場合、処理はステップS202に戻って上記式を繰り返す。一方、全てのブロックについて処理を行った場合、処理はステップS206に移行する。   In step S205, the WB control circuit 103 determines whether the above processing has been performed for all blocks. If there is an unprocessed block, the process returns to step S202 to repeat the above formula. On the other hand, when the process has been performed for all blocks, the process proceeds to step S206.

ステップS206において、WB制御回路103は、得られた色平均値の積分値(SumR1、SumG1、SumB1)から、次の式を用いて、第1のWB補正値(WBCol_R1、WBCol_G1、WBCol_B1)を算出する。
WBCol_R1=SumY1×1024/SumR1
WBCol_G1=SumY1×1024/SumG1
WBCol_B1=SumY1×1024/SumB1
但し、SumY1=(SumR1+2×SumG1+SumB1)/4
なお、第1のWB補正値としてストロボ光のWB補正値を既知のものとして予め設定してもよい。
In step S206, the WB control circuit 103 calculates the first WB correction values (WBCol_R1, WBCol_G1, WBCol_B1) from the obtained integrated values (SumR1, SumG1, SumB1) of the average color values using the following equation. To do.
WBCol_R1 = SumY1 × 1024 / SumR1
WBCol_G1 = SumY1 × 1024 / SumG1
WBCol_B1 = SumY1 × 1024 / SumB1
However, SumY1 = (SumR1 + 2 × SumG1 + SumB1) / 4
The strobe light WB correction value may be set in advance as a known WB correction value.

次に、ストロボ非発光時のWB補正値である第2のWB補正値(第2のホワイトバランス補正値)の算出処理について説明する。なお、第2のWB補正値は、ストロボ非発光時に撮影された画像データ(以下、ストロボ非発光時画像データ)に基づいて算出される補正値である。図4は、撮影制御を時系列に並べて示した図である。図4に示すように、SW1の押下前には、ライブビュー画像データが定期的に撮影され、SW1の押下時には、AFロックとAEロックとが行われる。SW2の押下後には、テスト発光と本露光とが行われるが、テスト発光前の「外光」と表記されている時間に露光され、撮影された画像データを、ここではストロボ非発光時画像データとする。なお、ストロボ非発光時画像データとしては、本露光後に露光され、撮影された撮影画像データを用いてもよい。   Next, a calculation process of a second WB correction value (second white balance correction value) that is a WB correction value when the flash is not emitted will be described. Note that the second WB correction value is a correction value calculated based on image data captured when the flash is not flashing (hereinafter, image data when the flash is not flashing). FIG. 4 is a diagram showing the imaging control arranged in time series. As shown in FIG. 4, before SW1 is pressed, live view image data is periodically taken, and when SW1 is pressed, AF lock and AE lock are performed. After pressing SW2, test light emission and main exposure are performed, but the image data exposed and photographed at the time indicated as “external light” before the test light emission, here, image data when no flash is emitted And As the image data when the flash is not emitted, captured image data that has been exposed and photographed after the main exposure may be used.

第2のWB補正値の算出処理は、上述した第1のWB補正値の算出処理と同様の方法によって行われる。但し、第1のWB補正値の算出処理とは、図3の302に示すような外光用の白検出範囲で処理する点で異なる。これはストロボ光が既知の光源であるのに対し、外光は既知の光源ではないため、ストロボ発光時の白検出範囲301のように限定できないからである。外光用の白検出範囲302は、予め異なる光源下で白を撮影し、算出した色評価値をプロットしたものである。この白検出範囲302は撮影駆動モードによって別設定できるものとする。第2のWB補正値は、撮像駆動モードが異なる場合にも適応でき、例えば、過去に算出されたEVF(Electronic View Finder)撮影駆動モードのWB補正値を使用することができる。但し、撮影駆動モードにより分光差分が生じる場合、WB補正回路103はWB補正値を補正する。図5は、静止画撮影駆動モードにおけるWB補正値とEVF撮影駆動モードにおけるWB補正値とを示す図である。過去に撮影されたEVF撮影駆動モードのWB補正値を用いて、静止画撮影駆動モードのWB補正値を算出する場合、図5に示すように、WB制御回路103は、EVF撮影駆動モードのWB補正値(EvfCx,EvfCy)501をΔCx、ΔCyだけ補正する。これにより、静止画撮影駆動モードのWB補正値(CapCx,CapCy)502が算出される。   The calculation process of the second WB correction value is performed by the same method as the calculation process of the first WB correction value described above. However, the calculation processing of the first WB correction value is different in that the processing is performed in a white detection range for external light as indicated by 302 in FIG. This is because strobe light is a known light source, whereas external light is not a known light source, and thus cannot be limited as in the white detection range 301 during strobe light emission. The white detection range 302 for external light is obtained by photographing white under a different light source in advance and plotting the calculated color evaluation values. The white detection range 302 can be set separately depending on the shooting drive mode. The second WB correction value can be applied even when the imaging drive mode is different. For example, the WB correction value of the EVF (Electronic View Finder) imaging drive mode calculated in the past can be used. However, when a spectral difference occurs due to the photographing drive mode, the WB correction circuit 103 corrects the WB correction value. FIG. 5 is a diagram illustrating a WB correction value in the still image shooting driving mode and a WB correction value in the EVF shooting driving mode. When calculating the WB correction value of the still image shooting drive mode using the WB correction value of the EVF shooting drive mode shot in the past, as shown in FIG. 5, the WB control circuit 103 uses the WB of the EVF shooting drive mode. Correction values (EvfCx, EvfCy) 501 are corrected by ΔCx and ΔCy. Thereby, the WB correction value (CapCx, CapCy) 502 in the still image shooting driving mode is calculated.

ここでは、背景が電球色光源のような低色温度光源の場合に、シーンの雰囲気を考慮して色味を残すように第2のWB補正値を算出してもよい。例えば図6に示すように、第2のWB補正値の色温度が低い場合(例えば、入力のT1)、色味を残すように制御することにより(例えば、出力のT´1)、電球色光源の赤味を残すような画像データを生成することができる。なお、上述した第1のWB補正値や第2のWB補正値の算出処理は、補正値算出手段の処理例である。   Here, when the background is a low color temperature light source such as a light bulb color light source, the second WB correction value may be calculated so as to leave the color in consideration of the atmosphere of the scene. For example, as shown in FIG. 6, when the color temperature of the second WB correction value is low (for example, input T1), by controlling to leave the color (for example, output T'1), the light bulb color Image data that retains the redness of the light source can be generated. Note that the above-described calculation processing of the first WB correction value and the second WB correction value is a processing example of the correction value calculation means.

次に、図7のフローチャートを参照しながら、画像データの合成処理について説明する。ステップS700において、WB制御回路103は、上記第1のWB補正値を用いてストロボ発光時画像データから画像データYuv1を現像する。ステップS701において、WB制御回路103は、上記第2のWB補正値を用いてストロボ非発光時画像データから画像データYuv2を現像する。ステップS702において、WB制御回路103は、ストロボ発光時画像データ、ストロボ非発光時画像データ、画像データYuv1、画像データYuv2をそれぞれn個のブロックに分割する。なお、画像データYuv1は第1の画像データの例であり、画像データYuv2は第2の画像データの例である。   Next, image data combining processing will be described with reference to the flowchart of FIG. In step S700, the WB control circuit 103 develops the image data Yuv1 from the image data during strobe light emission using the first WB correction value. In step S701, the WB control circuit 103 develops the image data Yuv2 from the non-flash image data using the second WB correction value. In step S702, the WB control circuit 103 divides the image data at the time of flash emission, the image data at the time of non-flash emission, image data Yuv1, and image data Yuv2 into n blocks. Note that the image data Yuv1 is an example of first image data, and the image data Yuv2 is an example of second image data.

ステップS703において、WB制御回路103は、ストロボ非発光時画像データのブロック(1〜n)毎に、画素値を色毎に加算平均して色平均値(R2[i],G2[i],B2[i])を算出し、各ブロックの輝度値a[i]を算出する。各ブロックの輝度値a[i]の算出式は次の式に示す通りである。ここで、算出された各ブロックの輝度値a[i]を、各ブロックの外光の輝度成分(以下、外光成分)とする。   In step S703, the WB control circuit 103 adds and averages the pixel values for each color for each block (1 to n) of the image data when the flash is not emitted, and calculates the color average values (R2 [i], G2 [i], B2 [i]) is calculated, and the luminance value a [i] of each block is calculated. The formula for calculating the luminance value a [i] of each block is as shown in the following formula. Here, the calculated luminance value a [i] of each block is used as a luminance component of external light (hereinafter referred to as external light component) of each block.

Figure 0005854716
Figure 0005854716

ステップS704において、WB制御回路103は、ストロボ非発光時画像データから各ブロックの輝度値a[i]を算出する処理と同様に、ストロボ発光時画像データのブロック(1〜n)毎に、画素値を色毎に加算平均して色平均値(R1[i],G1[i],B1[i])を算出し、各ブロックの輝度値b[i]を算出する。WB制御回路103は、次の式に示すように、算出した各ブロックの輝度値b[i]から、対応するストロボ非発光時画像データの各ブロックの輝度値a[i]を引くことにより、ブロック毎のストロボ光の輝度成分(以下、ストロボ成分)c[i]を算出する。
c[i]=b[i]−a[i]
なお、ステップS703、S704は、成分算出手段の処理例である。
In step S <b> 704, the WB control circuit 103 performs pixel processing for each block (1 to n) of image data during strobe light emission, similarly to the process of calculating the luminance value a [i] of each block from the image data during strobe non-light emission. The color average values (R1 [i], G1 [i], B1 [i]) are calculated by averaging the values for each color, and the luminance value b [i] of each block is calculated. As shown in the following equation, the WB control circuit 103 subtracts the luminance value a [i] of each block of the corresponding strobe non-flash image data from the calculated luminance value b [i] of each block. The luminance component (hereinafter, strobe component) c [i] of the strobe light for each block is calculated.
c [i] = b [i] -a [i]
Steps S703 and S704 are processing examples of the component calculation unit.

ステップS705において、WB制御回路103は、次の式により、それぞれ対応するブロック毎のストロボ成分c[i]と外光成分a[i]との比率を基に、画像データYuv1と画像データYuv2とを合成する際のブロック毎のMix率α[i]を算出する。
α[i]=c[i]/(a[i]+c[i])
なお、ステップS705は、合成比率算出手段の処理例である。
In step S705, the WB control circuit 103 calculates the image data Yuv1 and the image data Yuv2 based on the ratio of the strobe component c [i] and the external light component a [i] for each corresponding block according to the following equations. The mix rate α [i] is calculated for each block when combining.
α [i] = c [i] / (a [i] + c [i])
Note that step S705 is a processing example of the composition ratio calculation unit.

ステップS706において、WB制御回路103は、ステップS705で求めたブロック毎のMix率α[i]の和である画面全体のMix率Sumαを次の式によって求める。   In step S706, the WB control circuit 103 obtains the mix rate Sumα of the entire screen, which is the sum of the mix rate α [i] for each block obtained in step S705, by the following equation.

Figure 0005854716
Figure 0005854716

ステップS707において、WB制御回路103は、Sumαの値に応じて、上記第1のWB補正値と上記第2のWB補正値とを混合する。ここで、Sumαはブロック毎のMix率の和であり、Mix率α[i]はストロボ成分の割合を示すものであるため、Sumαを求めることで画面全体に占めるストロボ成分と外光成分との比率を取得することができる。WB制御回路103は、このストロボ成分と外光成分との比率を混合比率として用いて第1のWB補正値と第2のWB補正値とを混合することにより、画面全体のWB補正値を決定する。WB制御回路103は、ここで求めたWB補正値をMix後WB補正値として記憶しておく。   In step S707, the WB control circuit 103 mixes the first WB correction value and the second WB correction value according to the value of Sumα. Here, Sumα is the sum of the Mix rate for each block, and the Mix rate α [i] indicates the ratio of the strobe component. Therefore, by calculating Sumα, the strobe component and the external light component occupy the entire screen. A ratio can be obtained. The WB control circuit 103 determines the WB correction value for the entire screen by mixing the first WB correction value and the second WB correction value using the ratio of the strobe component and the external light component as a mixing ratio. To do. The WB control circuit 103 stores the WB correction value obtained here as a post-Mix WB correction value.

なお、別の方法としてSumαを用いずにMix後WB補正値を求める方法についても説明しておく。WB制御回路103は、図3の白検出範囲302で示した白検出範囲を被写体領域に適用し、被写体領域の色温度を検出する。そしてWB制御回路103は、被写体領域の色温度をMix後WB補正値として用いる。   As another method, a method for obtaining a post-Mix WB correction value without using Sumα will be described. The WB control circuit 103 applies the white detection range indicated by the white detection range 302 in FIG. 3 to the subject area, and detects the color temperature of the subject area. The WB control circuit 103 uses the color temperature of the subject area as a post-Mix WB correction value.

ステップS708において、WB制御回路103は、色温度補正係数を算出する。AEでは被写体輝度を測光して適正露出となるように露出制御を行っている。被写体輝度を正しく測光するためには光源の色味を補正する必要がある。しかし、露出の決定は撮影前であり、光源の色温度の決定は撮影後に実行することから、AEによって測光する時点では撮影された画像データの色温度を取得することができない。従って、測光では仮に太陽光の色温度のWB係数を用いて輝度を算出して露出制御される。その後、WB制御回路103は、静止画撮影後に光源の色温度を正確に求め、測光時に仮に用いた、撮影環境の光源色を補正するための太陽光のWB係数との差分を、輝度補正係数として算出している。色温度補正とは色温度の変動による輝度補正のことを指し、色温度補正係数は色温度の変動による輝度補正係数のことである。WB制御回路103は、ステップS707で求めたMix後WB補正値と測光時に用いた太陽光のWB補正値とに基づいて色温度補正係数kを次の式によって算出する。
色温度補正係数k=Mix後WB補正値/太陽光のWB補正値
なお、ステップS708は、補正係数算出手段の処理例である。
In step S708, the WB control circuit 103 calculates a color temperature correction coefficient. In AE, exposure control is performed so that the subject brightness is measured and an appropriate exposure is obtained. In order to measure the subject brightness correctly, it is necessary to correct the color of the light source. However, since the exposure is determined before photographing and the color temperature of the light source is determined after photographing, the color temperature of the photographed image data cannot be obtained at the time of photometry by AE. Therefore, in photometry, exposure is controlled by calculating brightness using the WB coefficient of the color temperature of sunlight. After that, the WB control circuit 103 accurately obtains the color temperature of the light source after still image shooting, and calculates the difference from the WB coefficient of sunlight for correcting the light source color of the shooting environment temporarily used during metering, as a luminance correction coefficient. It is calculated as Color temperature correction refers to luminance correction due to variation in color temperature, and color temperature correction coefficient refers to a luminance correction coefficient due to variation in color temperature. The WB control circuit 103 calculates the color temperature correction coefficient k by the following equation based on the post-Mix WB correction value obtained in step S707 and the sunlight WB correction value used during photometry.
Color temperature correction coefficient k = After-mix WB correction value / sunlight WB correction value Note that step S708 is a processing example of the correction coefficient calculation means.

ステップS709において、WB制御回路103は、ブロック毎のMix率α[i]を用いて画像データYuv1と画像データYuv2とを合成し、合成画像データYuv3を生成する。合成画像データYuv3における色評価値(Y3[i],u3[i],v3[i])は、画像データYuv1における色評価値(Y1[i],u1[i],v1[i])と、画像データYuv2における色評価値(Y2[i],u2[i],v2[i])とを用いて、次の式のように算出される。   In step S709, the WB control circuit 103 synthesizes the image data Yuv1 and the image data Yuv2 using the mix rate α [i] for each block, and generates composite image data Yuv3. The color evaluation values (Y3 [i], u3 [i], v3 [i]) in the composite image data Yuv3 are the same as the color evaluation values (Y1 [i], u1 [i], v1 [i]) in the image data Yuv1. The color evaluation values (Y2 [i], u2 [i], v2 [i]) in the image data Yuv2 are used to calculate the following equation.

Figure 0005854716
Figure 0005854716

ここで、ブロック境界部分の色味ずれを緩和するため、ステップS705で画素補間処理を行うことによりブロック毎のMix率α[i]から画素毎のMix率α´[j]を算出してもよい。例えば、WB制御回路103は、画素補間処理としてバイリニア補間を用い、ブロック毎のMix率α[i]から画素毎のMix率α´[j]を算出する。このとき、ステップS709において、WB制御回路103は、画素毎のMix率α´[j]を用いて、画像データYuv1と画像データYuv2とを合成し、合成画像データYuv3を生成する。なお、合成画像データYuv3は第3の画像データの例である。   Here, in order to alleviate the color shift at the block boundary portion, the pixel interpolation process is performed in step S705 to calculate the pixel-to-pixel Mix rate α ′ [j] from the block-specific Mix rate α [i]. Good. For example, the WB control circuit 103 uses bilinear interpolation as the pixel interpolation process, and calculates the Mix rate α ′ [j] for each pixel from the Mix rate α [i] for each block. At this time, in step S709, the WB control circuit 103 synthesizes the image data Yuv1 and the image data Yuv2 using the mix rate α ′ [j] for each pixel, and generates composite image data Yuv3. Note that the composite image data Yuv3 is an example of third image data.

合成画像データYuv3における色評価値(Y3[j],u3[j],v3[j])は、画像データYuv1における色評価値(Y1[j],u1[j],v1[j])と、画像データYuv2における色評価値(Y2[j],u2[j],v2[j])とを用いて、次の式のように算出される。   The color evaluation values (Y3 [j], u3 [j], v3 [j]) in the composite image data Yuv3 are the same as the color evaluation values (Y1 [j], u1 [j], v1 [j]) in the image data Yuv1. The color evaluation values (Y2 [j], u2 [j], v2 [j]) in the image data Yuv2 are used to calculate the following equation.

Figure 0005854716
Figure 0005854716

また、ステップS709においては、ストロボ発光時画像データにおける各ブロックの輝度に応じて、ブロック毎に画像合成処理を行うか行わないかを判定することにより、処理を可変にしてもよい。即ち、当該ブロックの輝度が低い場合や高い場合、当該ブロックに対して合成処理を行わず、後述する通常のホワイトバランス制御によって算出されるWB補正値を用いて画像データの現像処理が行われる。一方、当該ブロックの輝度がそれ以外の場合、上述した画像データの合成処理と同様の処理が行われる。   Further, in step S709, the processing may be made variable by determining whether or not to perform the image composition processing for each block according to the luminance of each block in the image data at the time of flash emission. That is, when the brightness of the block is low or high, the image data is developed using a WB correction value calculated by normal white balance control, which will be described later, without performing synthesis processing for the block. On the other hand, when the luminance of the block is other than that, the same processing as the above-described image data synthesis processing is performed.

さらにステップS709においては、WB制御回路103は、次の式に示すように、ステップS708で算出した色温度補正係数kを輝度成分Y3にのみ適用して輝度補正を行う。   Furthermore, in step S709, the WB control circuit 103 performs luminance correction by applying the color temperature correction coefficient k calculated in step S708 only to the luminance component Y3 as shown in the following equation.

Figure 0005854716
Figure 0005854716

次に、通常のホワイトバランス制御方法について詳細に説明する。先ず、WB制御回路103は、上述したWB補正値の算出処理と同様に、第1、第2のWB補正値を算出する。次に、WB制御回路103は、第1、第2のWB補正値のMix(加重加算)処理を行う。Mix(加重加算)処理では、被写体に照射されている外光とストロボ光の照射比率によって加重加算が行われる。   Next, a normal white balance control method will be described in detail. First, the WB control circuit 103 calculates the first and second WB correction values in the same manner as the WB correction value calculation process described above. Next, the WB control circuit 103 performs Mix (weighted addition) processing of the first and second WB correction values. In the Mix (weighted addition) process, weighted addition is performed according to the irradiation ratio of the external light and strobe light applied to the subject.

ここで、図8を参照しながら、照射比率を演算するための被写体領域の切り出しについて説明する。WB制御回路103は、テスト発光する前に撮影された画像データ801を取得し、このテスト発光前に撮影された画像データ801からm×nのマトリックスで構成される輝度ブロックa802を算出する。次に、テスト発光する前と同じ条件でストロボのテスト発光が行われることにより、WB制御回路103は、テスト発光時に撮影された画像データ803を取得し、同様にm×nのマトリックスで構成される輝度ブロックb804を取得する。これら、輝度ブロックa802及び輝度ブロックb804は、撮像装置に備えられるRAM等に一時的に格納される。なお、テスト発光前に撮影された画像データ801の背景画像とテスト発光時に撮影された画像データ803の背景画像とは略変化がないものとする。従って、この2つの輝度ブロックa802と輝度ブロックb804との差分データは、ストロボのテスト発光時における被写体領域の反射光となり、当該差分データより被写体位置情報c805を取得することができる。   Here, with reference to FIG. 8, the extraction of the subject area for calculating the irradiation ratio will be described. The WB control circuit 103 acquires image data 801 photographed before the test light emission, and calculates a luminance block a 802 composed of an m × n matrix from the image data 801 photographed before the test light emission. Next, by performing the test light emission of the strobe under the same conditions as before the test light emission, the WB control circuit 103 acquires the image data 803 photographed at the time of the test light emission, and is similarly configured by an m × n matrix. Luminance block b804 to be acquired. The luminance block a802 and the luminance block b804 are temporarily stored in a RAM or the like provided in the imaging device. It is assumed that the background image of the image data 801 photographed before the test light emission and the background image of the image data 803 photographed during the test light emission are not substantially changed. Therefore, the difference data between the two luminance blocks a802 and b804 becomes reflected light of the subject area during the strobe test light emission, and the subject position information c805 can be acquired from the difference data.

WB制御回路103は、このように算出された被写体位置情報c805から値が1の被写体位置ブロックを取得し、取得した被写体位置ブロックにおけるストロボ発光時の輝度値Y1とストロボ非発光時の輝度値Y2とを算出する。ここでストロボ発光時とストロボ非発光時との露光条件が異なる場合、WB制御回路103は、露光条件を揃えてY1、Y2を算出する。WB制御回路103は、このように算出したY1、Y2の比を被写体に照射された光量比として、第1のWB補正値、第2のWB補正値を用いて光量比によるMix処理(加重加算)を行う。そして、WB制御回路103は、Mix処理によって得られたWB補正値をWB処理に使用するWB補正値として決定し、画像データを現像し、最終画像データとする。   The WB control circuit 103 acquires a subject position block having a value of 1 from the subject position information c805 calculated in this way, and the brightness value Y1 when the strobe light is emitted and the brightness value Y2 when the strobe light is not emitted in the obtained subject position block. And calculate. Here, when the exposure conditions differ between strobe light emission and strobe non-light emission, the WB control circuit 103 calculates Y1 and Y2 by aligning the exposure conditions. The WB control circuit 103 uses the first WB correction value and the second WB correction value as the light quantity ratio with which the ratio of Y1 and Y2 calculated in this way is applied to the subject, and mix processing based on the light quantity ratio (weighted addition) )I do. Then, the WB control circuit 103 determines the WB correction value obtained by the Mix processing as the WB correction value used for the WB processing, develops the image data, and sets it as final image data.

なお、本実施形態では、ブロック毎に色味を補正し、輝度成分の補正は画面全体に適用しているがこれに限定されるものではない。例えば、ブロック毎にMix率α[i]を用いて第1のWB補正値と第2のWB補正値とを混合し、ブロック毎にMix後のWB補正値を求めることにより、ブロック毎に色温度補正係数kを求めることが可能である。   In the present embodiment, the color is corrected for each block, and the correction of the luminance component is applied to the entire screen. However, the present invention is not limited to this. For example, the first WB correction value and the second WB correction value are mixed using the Mix rate α [i] for each block, and the post-Mix WB correction value is obtained for each block, thereby obtaining a color for each block. It is possible to obtain the temperature correction coefficient k.

本実施形態によれば、被写体と背景に異なった光源が照射されているような場合に被写体と背景をともに適正な色味とする場合において、露出制御のための測光時と撮影時との色温度の変動に伴う輝度信号の補正をより正確に行うことが可能となる。   According to the present embodiment, when the subject and the background are irradiated with different light sources, when the subject and the background have both proper colors, the color at the time of metering for exposure control and the time of shooting It becomes possible to correct the luminance signal accompanying the variation in temperature more accurately.

本発明は、複数の機器(例えばホストコンピュータ、インタフェース機器、カメラヘッド等)から構成されるシステムを適用しても、一つの機器からなる装置(例えば、デジタルスチルカメラ、デジタルビデオカメラ等)に適用してもよい。   The present invention can be applied to an apparatus (for example, a digital still camera, a digital video camera, etc.) composed of a single device even if a system composed of a plurality of devices (for example, a host computer, an interface device, a camera head, etc.) is applied. May be.

また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。   The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

101:個体撮像素子、102:メモリ、103:WB制御回路、104:色マトリックス回路、105:LPF回路、106:CSUP回路、107:RGB変換回路、108:γ補正回路、109:色輝度変換回路、110:JPEG圧縮回路、111:Y生成回路、112:エッジ強調回路、113:制御回路、114:CPU   101: Individual imaging device, 102: Memory, 103: WB control circuit, 104: Color matrix circuit, 105: LPF circuit, 106: CSUP circuit, 107: RGB conversion circuit, 108: γ correction circuit, 109: Color luminance conversion circuit 110: JPEG compression circuit, 111: Y generation circuit, 112: Edge enhancement circuit, 113: Control circuit, 114: CPU

Claims (10)

ストロボ発光時に撮影された画像データに基づいて第1のホワイトバランス補正値を算出するとともに、ストロボ非発光時に撮影された画像データに基づいて第2のホワイトバランス補正値を算出する補正値算出手段と、
前記第1のホワイトバランス補正値に基づいて、前記ストロボ発光時に撮影された画像データから第1の画像データを現像するとともに、前記第2のホワイトバランス補正値に基づいて、前記ストロボ非発光時に撮影された画像データから第2の画像データを現像する現像手段と、
前記ストロボ非発光時に撮影された画像データの輝度値と前記ストロボ発光時に撮影された画像データの輝度値とに基づいて、外光の輝度成分とストロボ光の輝度成分とを算出する成分算出手段と、
前記外光の輝度成分と前記ストロボ光の輝度成分とに基づいて、前記第1の画像データと前記第2の画像データとの合成比率を算出する合成比率算出手段と、
前記合成比率算出手段により算出された前記合成比率に基づいて、前記第1のホワイトバランス補正値と前記第2のホワイトバランス補正値とを混合する混合手段と、
露出制御のための測光手段による測光時に撮影環境の光源色を補正するために使用されるホワイトバランス補正値と、前記混合手段により生成されたホワイトバランス補正値とに基づいて、色温度補正係数を算出する補正係数算出手段と、
前記合成比率算出手段により算出された前記合成比率に従って、前記第1の画像データと前記第2の画像データとを合成して第3の画像データを生成する合成手段と、
前記補正係数算出手段により算出された前記色温度補正係数を用いて、前記合成手段により生成された前記第3の画像データの輝度成分を補正する補正手段とを有することを特徴とする画像処理装置。
Correction value calculating means for calculating a first white balance correction value based on image data shot when the flash is fired and calculating a second white balance correction value based on image data shot when the flash is not flashing; ,
Based on the first white balance correction value, the first image data is developed from the image data photographed when the flash is fired, and is photographed when the flash is not fired based on the second white balance correction value. Developing means for developing second image data from the processed image data;
Component calculating means for calculating a luminance component of external light and a luminance component of strobe light based on a luminance value of image data shot when the flash is not emitted and a luminance value of image data shot when the flash is emitted; ,
A composition ratio calculating means for calculating a composition ratio between the first image data and the second image data based on the luminance component of the external light and the luminance component of the strobe light;
A mixing unit that mixes the first white balance correction value and the second white balance correction value based on the combination ratio calculated by the combination ratio calculation unit;
Based on the white balance correction value used to correct the light source color of the shooting environment during metering by the metering means for exposure control, and the white balance correction value generated by the mixing means, the color temperature correction coefficient is calculated. Correction coefficient calculation means for calculating,
Synthesizing means for synthesizing the first image data and the second image data according to the synthesis ratio calculated by the synthesis ratio calculating means to generate third image data;
An image processing apparatus comprising: a correction unit that corrects a luminance component of the third image data generated by the synthesis unit using the color temperature correction coefficient calculated by the correction coefficient calculation unit. .
前記合成比率算出手段は、ブロック毎の前記外光の輝度成分と前記ストロボ光の輝度成分とに基づいて、前記第1の画像データと前記第2の画像データとの合成比率をブロック毎に算出することを特徴とする請求項1に記載の画像処理装置。   The synthesis ratio calculation means calculates a synthesis ratio of the first image data and the second image data for each block based on the luminance component of the external light and the luminance component of the strobe light for each block. The image processing apparatus according to claim 1, wherein: 前記合成比率算出手段は、画素補間処理により、ブロック毎の合成比率から画素毎の合成比率を算出することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the combination ratio calculation unit calculates a combination ratio for each pixel from a combination ratio for each block by pixel interpolation processing. 前記合成手段は、各ブロックの輝度値に応じて、該当するブロックの合成処理を実行するか否かを制御することを特徴とする請求項1乃至3の何れか1項に記載の画像処理装置。   4. The image processing apparatus according to claim 1, wherein the synthesis unit controls whether or not to perform synthesis processing of a corresponding block according to a luminance value of each block. 5. . 前記補正値算出手段は、光源に対して任意の色味を残すように前記第2のホワイトバランス補正値を算出することを特徴とする請求項1乃至4の何れか1項に記載の画像処理装置。   5. The image processing according to claim 1, wherein the correction value calculation unit calculates the second white balance correction value so as to leave an arbitrary color for a light source. apparatus. 前記合成比率算出手段により算出された前記合成比率に基づいて、前記第1のホワイトバランス補正値と前記第2のホワイトバランス補正値との混合比率を算出する第1の混合比率算出手段を更に有し、
前記混合手段は、前記第1の混合比率算出手段により算出された前記混合比率に従って、前記第1のホワイトバランス補正値と前記第2のホワイトバランス補正値とを混合することを特徴とする請求項1乃至5の何れか1項に記載の画像処理装置。
First mixing ratio calculating means for calculating a mixing ratio of the first white balance correction value and the second white balance correction value based on the combining ratio calculated by the combining ratio calculating means. And
The mixing means mixes the first white balance correction value and the second white balance correction value according to the mixing ratio calculated by the first mixing ratio calculation means. The image processing apparatus according to any one of 1 to 5.
前記第1の混合比率算出手段は、ブロック毎の前記合成比率を画面全体について加算することにより前記混合比率を算出することを特徴とする請求項6に記載の画像処理装置。   The image processing apparatus according to claim 6, wherein the first mixing ratio calculation unit calculates the mixing ratio by adding the synthesis ratio for each block for the entire screen. 被写体領域の色温度を検出することにより、検出された色温度を前記混合手段により生成されたホワイトバランス補正値の代わりとして使用することを特徴とする請求項1乃至7の何れか1項に記載の画像処理装置。 The detected color temperature is used as a substitute for the white balance correction value generated by the mixing unit by detecting the color temperature of the subject region. Image processing apparatus. 画像処理装置によって実行される画像処理方法であって、
ストロボ発光時に撮影された画像データに基づいて第1のホワイトバランス補正値を算出するとともに、ストロボ非発光時に撮影された画像データに基づいて第2のホワイトバランス補正値を算出する補正値算出ステップと、
前記第1のホワイトバランス補正値に基づいて、前記ストロボ発光時に撮影された画像データから第1の画像データを現像するとともに、前記第2のホワイトバランス補正値に基づいて、前記ストロボ非発光時に撮影された画像データから第2の画像データを現像する現像ステップと、
前記ストロボ非発光時に撮影された画像データの輝度値と前記ストロボ発光時に撮影された画像データの輝度値とに基づいて、外光の輝度成分とストロボ光の輝度成分とを算出する成分算出ステップと、
前記外光の輝度成分と前記ストロボ光の輝度成分とに基づいて、前記第1の画像データと前記第2の画像データとの合成比率を算出する合成比率算出ステップと、
前記合成比率算出ステップにより算出された前記合成比率に基づいて、前記第1のホワイトバランス補正値と前記第2のホワイトバランス補正値とを混合する混合ステップと、
露出制御のための測光手段による測光時に撮影環境の光源色を補正するために使用されるホワイトバランス補正値と、前記混合ステップにより生成されたホワイトバランス補正値とに基づいて、色温度補正係数を算出する補正係数算出ステップと、
前記合成比率算出ステップにより算出された前記合成比率に従って、前記第1の画像データと前記第2の画像データとを合成して第3の画像データを生成する合成ステップと、
前記補正係数算出ステップにより算出された前記色温度補正係数を用いて、前記合成ステップにより生成された前記第3の画像データの輝度成分を補正する補正ステップとを有することを特徴とする画像処理方法。
An image processing method executed by an image processing apparatus,
A correction value calculating step of calculating a first white balance correction value based on image data photographed when the flash is emitted and calculating a second white balance correction value based on image data photographed when the flash is not emitted; ,
Based on the first white balance correction value, the first image data is developed from the image data photographed when the flash is fired, and is photographed when the flash is not fired based on the second white balance correction value. A developing step for developing second image data from the processed image data;
A component calculation step of calculating a luminance component of external light and a luminance component of strobe light based on a luminance value of image data shot when the flash is not emitted and a luminance value of image data shot when the flash is emitted; ,
A synthesis ratio calculating step of calculating a synthesis ratio of the first image data and the second image data based on the luminance component of the external light and the luminance component of the strobe light;
A mixing step of mixing the first white balance correction value and the second white balance correction value based on the combination ratio calculated by the combination ratio calculation step;
Based on the white balance correction value used for correcting the light source color of the shooting environment during metering by the metering means for exposure control, and the white balance correction value generated by the mixing step, the color temperature correction coefficient is calculated. A correction coefficient calculation step for calculating,
Combining the first image data and the second image data according to the composition ratio calculated in the composition ratio calculating step to generate third image data;
A correction step of correcting a luminance component of the third image data generated by the synthesis step using the color temperature correction coefficient calculated by the correction coefficient calculation step. .
ストロボ発光時に撮影された画像データに基づいて第1のホワイトバランス補正値を算出するとともに、ストロボ非発光時に撮影された画像データに基づいて第2のホワイトバランス補正値を算出する補正値算出ステップと、
前記第1のホワイトバランス補正値に基づいて、前記ストロボ発光時に撮影された画像データから第1の画像データを現像するとともに、前記第2のホワイトバランス補正値に基づいて、前記ストロボ非発光時に撮影された画像データから第2の画像データを現像する現像ステップと、
前記ストロボ非発光時に撮影された画像データの輝度値と前記ストロボ発光時に撮影された画像データの輝度値とに基づいて、外光の輝度成分とストロボ光の輝度成分とを算出する成分算出ステップと、
前記外光の輝度成分と前記ストロボ光の輝度成分とに基づいて、前記第1の画像データと前記第2の画像データとの合成比率を算出する合成比率算出ステップと、
前記合成比率算出ステップにより算出された前記合成比率に基づいて、前記第1のホワイトバランス補正値と前記第2のホワイトバランス補正値とを混合する混合ステップと、
露出制御のための測光手段による測光時に撮影環境の光源色を補正するために使用されるホワイトバランス補正値と、前記混合ステップにより生成されたホワイトバランス補正値とに基づいて、色温度補正係数を算出する補正係数算出ステップと、
前記合成比率算出ステップにより算出された前記合成比率に従って、前記第1の画像データと前記第2の画像データとを合成して第3の画像データを生成する合成ステップと、
前記補正係数算出ステップにより算出された前記色温度補正係数を用いて、前記合成ステップにより生成された前記第3の画像データの輝度成分を補正する補正ステップとをコンピュータに実行させるためのプログラム。
A correction value calculating step of calculating a first white balance correction value based on image data shot when the flash is fired and calculating a second white balance correction value based on image data shot when the flash is not flashed; ,
Based on the first white balance correction value, the first image data is developed from the image data photographed when the flash is fired, and is photographed when the flash is not fired based on the second white balance correction value. A developing step for developing second image data from the processed image data;
A component calculation step of calculating a luminance component of external light and a luminance component of strobe light based on a luminance value of image data shot when the flash is not emitted and a luminance value of image data shot when the flash is emitted; ,
A synthesis ratio calculating step of calculating a synthesis ratio of the first image data and the second image data based on the luminance component of the external light and the luminance component of the strobe light;
A mixing step of mixing the first white balance correction value and the second white balance correction value based on the combination ratio calculated by the combination ratio calculation step;
Based on the white balance correction value used for correcting the light source color of the shooting environment during metering by the metering means for exposure control, and the white balance correction value generated by the mixing step, the color temperature correction coefficient is calculated. A correction coefficient calculation step for calculating,
Combining the first image data and the second image data according to the composition ratio calculated in the composition ratio calculating step to generate third image data;
A program for causing a computer to execute a correction step of correcting a luminance component of the third image data generated in the synthesis step using the color temperature correction coefficient calculated in the correction coefficient calculation step.
JP2011195401A 2011-09-07 2011-09-07 Image processing apparatus, image processing method, and program Expired - Fee Related JP5854716B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011195401A JP5854716B2 (en) 2011-09-07 2011-09-07 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011195401A JP5854716B2 (en) 2011-09-07 2011-09-07 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2013058869A JP2013058869A (en) 2013-03-28
JP5854716B2 true JP5854716B2 (en) 2016-02-09

Family

ID=48134369

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011195401A Expired - Fee Related JP5854716B2 (en) 2011-09-07 2011-09-07 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP5854716B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6300514B2 (en) * 2013-12-20 2018-03-28 キヤノン株式会社 IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
CN105744247B (en) * 2015-05-26 2018-05-11 维沃移动通信有限公司 The method, apparatus of blank level adjustment and mobile equipment are carried out in a mobile device
CN114374830B (en) * 2022-01-06 2024-03-08 杭州海康威视数字技术股份有限公司 Image white balance method, electronic device and computer readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4360011B2 (en) * 2000-06-13 2009-11-11 ソニー株式会社 Image processing apparatus, image processing method, and recording medium
JP4004220B2 (en) * 2000-10-05 2007-11-07 株式会社リコー WHITE BALANCE ADJUSTMENT DEVICE, WHITE BALANCE ADJUSTMENT METHOD, AND COMPUTER READABLE RECORDING MEDIUM CONTAINING PROGRAM FOR EXECUTING THE METHOD IN COMPUTER
JP2002218495A (en) * 2001-01-15 2002-08-02 Fuji Photo Film Co Ltd White balance control method and electronic camera
JP3925138B2 (en) * 2001-10-03 2007-06-06 ソニー株式会社 Image signal processing method and image signal processing circuit
JP2003259390A (en) * 2002-03-01 2003-09-12 Canon Inc White balance correction apparatus, imaging unit provided with the same, control method therefor, program for activating the control method, and storage medium stored with the program

Also Published As

Publication number Publication date
JP2013058869A (en) 2013-03-28

Similar Documents

Publication Publication Date Title
JP5743696B2 (en) Image processing apparatus, image processing method, and program
JP6049343B2 (en) Image processing apparatus, image processing method, and program
JP5665436B2 (en) Image processing apparatus, image processing method, and program
JP5761946B2 (en) Image processing apparatus, image processing method, and storage medium
JP5808142B2 (en) Image processing apparatus, image processing method, and program
JP5693271B2 (en) Image processing apparatus and method
JP5804856B2 (en) Image processing apparatus, image processing method, and program
JP5804857B2 (en) Image processing apparatus, image processing method, and program
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
JP5225137B2 (en) Imaging apparatus, image processing method, and program
JP2013243639A (en) Image processing apparatus, image processing method, and program
CN110324529B (en) Image processing apparatus and control method thereof
JP5854716B2 (en) Image processing apparatus, image processing method, and program
JP5566680B2 (en) Imaging apparatus and imaging method
JP2009055077A (en) Imaging apparatus
JP2005167476A (en) White balance control apparatus
JP6570311B2 (en) Image processing apparatus and image processing method
JP2014120813A (en) Image pickup device and image pickup method
JP6021885B2 (en) Image processing apparatus, image processing method, and program
JP5943682B2 (en) Imaging apparatus, control method thereof, and program
JP2017034536A (en) Image processing apparatus, image processing method, and program
JP2016005105A (en) Imaging apparatus
JP2021087125A (en) Image processing device, control method thereof, and program
JP2014139738A (en) Image processing apparatus, imaging apparatus, and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140814

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150427

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150512

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150703

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: 20151110

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151208

R151 Written notification of patent or utility model registration

Ref document number: 5854716

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees