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

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

Info

Publication number
JP2017034536A
JP2017034536A JP2015154241A JP2015154241A JP2017034536A JP 2017034536 A JP2017034536 A JP 2017034536A JP 2015154241 A JP2015154241 A JP 2015154241A JP 2015154241 A JP2015154241 A JP 2015154241A JP 2017034536 A JP2017034536 A JP 2017034536A
Authority
JP
Japan
Prior art keywords
image
subject
light
ratio
strobe
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.)
Pending
Application number
JP2015154241A
Other languages
Japanese (ja)
Inventor
福井 貴明
Takaaki Fukui
貴明 福井
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 JP2015154241A priority Critical patent/JP2017034536A/en
Publication of JP2017034536A publication Critical patent/JP2017034536A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To obtain an excellent image to which an optimal WB correction is applied to each image region of a stroboscope light emission image even when there is a motion in a subject.SOLUTION: A WB control part (303) performs a WB correction of a strobe light emission image by using a first WB correction value corresponding to a strobe light and a second WB correction value corresponding to an environment light. A CPU (314) acquires a subject distance, extracts a mobile region, and determines a synthesis ratio of the strobe light emission image and a strobe non-light emission image in each subject region on the basis of a light amount ratio of the strobe light and environment light. The CPU(314) estimates a strobe irradiation amount on the basis of the subject distance and an arrangement light characteristic of the strobe light, calculates ratios of the strobe irradiation amount and the environment light, set them as the synthesis ratio of the mobile region, and performs synthesis in the other subject region to each subject region by using the determined synthesis ratio.SELECTED DRAWING: Figure 1

Description

本発明は、撮影された画像の被写体領域毎にホワイトバランス補正を行う画像処理装置、画像処理方法、及びプログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program that perform white balance correction for each subject area of a photographed image.

一般に、デジタルカメラやデジタルビデオカメラ等の撮像装置(以下、カメラとする。)は、撮影した画像の色調を調整するホワイトバランス制御機能を備えている。ホワイトバランス制御には、大別して、マニュアルホワイトバランス制御と、オートホワイトバランス制御がある。マニュアルホワイトバランス制御は、予め白色被写体を撮像してホワイトバランス係数を求めておき、そのホワイトバランス係数を一画面分の撮影画像全体に適用してホワイトバランス補正を行う画像処理である。一方、オートホワイトバランス制御は、撮像画像から白色と思われる部分を自動検出し、その部分の色成分と撮影画像全体の各色成分の平均値とからホワイトバランス係数を算出する。そして、オートホワイトバランス制御では、そのホワイトバランス係数を撮影画像に適用してホワイトバランス補正が行われる。   In general, an imaging apparatus (hereinafter referred to as a camera) such as a digital camera or a digital video camera has a white balance control function for adjusting the color tone of a captured image. The white balance control is roughly classified into manual white balance control and auto white balance control. Manual white balance control is image processing in which a white subject is imaged in advance to obtain a white balance coefficient, and the white balance coefficient is applied to the entire captured image for one screen to perform white balance correction. On the other hand, the auto white balance control automatically detects a white part from the captured image and calculates a white balance coefficient from the color component of the part and the average value of each color component of the entire captured image. In auto white balance control, white balance correction is performed by applying the white balance coefficient to the captured image.

ここで、例えばストロボ発光を伴う画像撮影が行われる場合、カメラにより写されている撮影エリア内の被写体等には、ストロボ光の他に、例えば室内灯のような照明器具からの照明光等が当たっていることが多い。このように、撮影エリア内に様々な光源の光がある場合、前述のホワイトバランス制御では、ホワイトバランス係数を撮影画像全体に適用してホワイトバランス制御が行われるため、各光源に対応した適正な色味の画像を得ることが困難である。例えば、ストロボ光のような高色温度光源にホワイトバランスを合わせた場合、白熱灯のような低色温度光源にはホワイトバランスが合わなくなってしまう。逆に、白熱灯の低色温度光源にホワイトバランスを合わせた場合には、ストロボ光の高色温度光源にはホワイトバランスが合わなくなってしまう。また、例えば両方の光源の中間にホワイトバランスを合わせてホワイトバランス制御を行った場合には、それら両方の光源の何れにもホワイトバランスが合わなくなってしまう。このように両方の光源の中間にホワイトバランスを合わせた場合、ストロボ光が照射されている領域の画像は青みを帯び、低色温度光源の光が照射されている領域の画像は赤味を帯びるような色味になってしまう。   Here, for example, in the case of taking an image with strobe light emission, the subject in the shooting area captured by the camera is not only strobe light but also illumination light from a lighting device such as a room light. Often hits. As described above, when there is light from various light sources in the shooting area, the white balance control described above applies the white balance coefficient to the entire shot image and performs white balance control. It is difficult to obtain a tinted image. For example, when the white balance is adjusted to a high color temperature light source such as strobe light, the white balance is not adjusted to a low color temperature light source such as an incandescent lamp. On the other hand, when the white balance is adjusted to the low color temperature light source of the incandescent lamp, the white balance does not match the high color temperature light source of the strobe light. For example, when white balance control is performed by adjusting white balance between both light sources, the white balance does not match any of both light sources. In this way, when white balance is adjusted between the two light sources, the image of the area irradiated with the strobe light is bluish, and the image of the area irradiated with the light of the low color temperature light source is reddish. It becomes a color like this.

これに対し、特許文献1には、前述のような複数の光源に合った色味の画像を得ることを目的とした電子スチルカメラが提案されている。特許文献1に記載の電子スチルカメラは、ストロボ発光画像とストロボ非発光画像を任意の被写体領域毎に比較してデータの比を求め、その比の値によりストロボ光の寄与度を判定する。そして、特許文献1の電子スチルカメラは、その寄与度に応じて、ストロボ発光時の撮影画像データに対して、領域毎にホワイトバランス係数を選択してホワイトバランス制御を行う。以下、このように画像の領域毎にホワイトバランス係数を選択してホワイトバランス制御を行うことを、部分ホワイトバランス(部分WB)制御と表記する。その他にも、特許文献1には、ストロボ非発光画像とストロボ発光画像の差分を取ることでストロボ照射量を推定し、そのストロボ照射量に応じたホワイトバランス制御を行うことが記載されている。   On the other hand, Patent Document 1 proposes an electronic still camera for the purpose of obtaining an image having a tint suitable for a plurality of light sources as described above. The electronic still camera described in Patent Document 1 compares a strobe light emission image and a strobe non-light emission image for each arbitrary subject area to obtain a data ratio, and determines the contribution of strobe light based on the ratio value. Then, the electronic still camera of Patent Document 1 performs white balance control by selecting a white balance coefficient for each region with respect to captured image data at the time of strobe light emission according to the degree of contribution. Hereinafter, the white balance control performed by selecting the white balance coefficient for each region of the image in this manner is referred to as partial white balance (partial WB) control. In addition, Patent Document 1 describes that a strobe irradiation amount is estimated by taking a difference between a strobe non-emission image and a strobe emission image, and white balance control is performed according to the strobe irradiation amount.

また、特許文献2には、部分WB制御の例として、撮影画像から被写体ブレ領域と被写体の非ブレ領域を検出し、それら被写体ブレ領域と非ブレ領域の各画像領域に対してホワイトバランス制御を行う画像処理装置が提案されている。非ブレ領域に対するホワイトバランス係数は、ストロボ発光画像と非発光画像からストロボ発光成分と外光成分を抽出して、それぞれ抽出した光成分と被写体ブレ領域に基づいて算出される。一方、被写体ブレ領域に対するホワイトバランス係数は、非ブレ領域のホワイトバランス係数に基づく補間演算により算出される。そして、特許文献2の画像処理装置は、ストロボ発光時の撮影画像に対して、それら被写体ブレ領域と非ブレ領域の画像領域に対して各々算出されたホワイトバランス係数を適用したホワイトバランス制御を行う。また、この特許文献2には、画像の高周波成分を検出し、その高周波成分に基づいて被写体ブレ領域を検出することが記載されている。   In Patent Document 2, as an example of partial WB control, a subject blur region and a subject non-blurring region are detected from a captured image, and white balance control is performed on each of the subject blur region and the non-blurring region. An image processing apparatus has been proposed. The white balance coefficient for the non-blurring region is calculated based on the extracted light component and the subject blur region, respectively, by extracting the strobe light emission component and the external light component from the strobe light emission image and the non-light emission image. On the other hand, the white balance coefficient for the subject blur area is calculated by interpolation based on the white balance coefficient of the non-blurr area. Then, the image processing apparatus of Patent Document 2 performs white balance control that applies the calculated white balance coefficient to the image areas of the subject blur area and the non-blurr area on the captured image at the time of flash emission. . Japanese Patent Application Laid-Open No. H10-228561 describes that a high frequency component of an image is detected and a subject blur region is detected based on the high frequency component.

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

前述したように特許文献1に記載の技術では、ストロボ発光画像とストロボ非発光画像を任意の被写体領域毎に比較したデータの比に基づいて、ストロボ発光時の撮影画像の画像領域毎にホワイトバランス制御が行われる。しかしながら、特許文献1に記載の技術では、例えば被写体等が動いている場合には、画像領域毎のデータの比を正確に求めることができなくなり、間違ったホワイトバランス制御を行ってしまい、例えばまだら模様のような画像を生成してしまう虞がある。このように、特許文献1に記載の技術では、被写体等が動いている場合には、ストロボ発光時の撮影画像内の各画像領域に対して最適なホワイトバランス制御が施された良好な画像を得ることが難しい。   As described above, in the technique described in Patent Document 1, white balance is applied to each image area of a captured image at the time of flash emission based on a ratio of data obtained by comparing a flash emission image and a non-flash emission image for each arbitrary subject area. Control is performed. However, in the technique described in Patent Document 1, for example, when a subject or the like is moving, it becomes impossible to accurately determine the ratio of data for each image area, and wrong white balance control is performed. There is a risk of generating an image like a pattern. As described above, in the technique described in Patent Document 1, when a subject or the like is moving, a good image in which optimum white balance control is performed on each image area in a captured image at the time of flash emission is obtained. Difficult to get.

また、特許文献2に記載の技術では、画像の高周波成分を基に被写体ブレ領域等の各画像領域が検出され、そして、ストロボ発光時の撮影画像の各画像領域に対するホワイトバランス係数が、ストロボ発光画像と非発光画像の光成分に基づいて算出されている。しかしながら、特許文献2の技術では、例えば細かい絵柄のように領域内の画像自体が高周波成分を有している場合と、被写体等が動いたことによる被写体ブレや手ブレ等による高周波成分の画像領域とを、区別することができない。このため、例えば細かい絵柄の画像領域を、被写体ブレ領域のような動きのある画像領域として誤って検出してしまうと、各画像領域に対するホワイトバランス制御も誤ったものとなる。このように、特許文献2に記載の技術では、被写体等に動きがある場合に、ストロボ発光時の撮影画像内の各画像領域に対して最適なホワイトバランス制御が施された良好な画像を得ることができなくなることがある。   In the technique described in Patent Document 2, each image region such as a subject blur region is detected based on a high-frequency component of the image, and the white balance coefficient for each image region of the captured image at the time of strobe light emission is strobe light emission. It is calculated based on the light components of the image and the non-light emitting image. However, in the technique of Patent Document 2, for example, when an image in a region itself has a high-frequency component such as a fine pattern, and an image region of a high-frequency component due to subject blurring or camera shake caused by movement of a subject or the like Cannot be distinguished. For this reason, for example, if an image area with a fine pattern is erroneously detected as an image area with movement such as a subject blur area, white balance control for each image area is also erroneous. As described above, the technique disclosed in Patent Document 2 obtains a good image in which optimum white balance control is performed on each image area in a captured image at the time of flash emission when a subject or the like moves. It may not be possible.

本発明はこのような問題点に鑑みてなされたものである。本発明は、被写体等に動きがある場合であっても、ストロボ発光時の撮影画像の各画像領域に対して最適なホワイトバランス補正が施された良好な画像を得ることを可能とする画像処理装置、画像処理方法、及びプログラムを提供することを目的とする。   The present invention has been made in view of such problems. The present invention is an image processing that makes it possible to obtain a good image in which optimum white balance correction has been performed on each image area of a captured image at the time of flash emission even when the subject or the like is moving. An object is to provide an apparatus, an image processing method, and a program.

本発明の画像処理装置は、ストロボ光に対応した第1のホワイトバランス補正値を用いて、環境光の下でストロボ発光時に撮影された第1の画像のホワイトバランスを補正し、環境光に対応した第2のホワイトバランス補正値を用いて、ストロボ発光が無い環境光の下で撮影された第2の画像のホワイトバランスを補正する補正手段と、前記第1の画像の撮影がなされた際の各被写体までの距離を表す被写体距離を取得する取得手段と、第1の画像から、前記第1の画像の撮影と前記第2の画像の撮影がなされた間に移動した移動被写体の被写体領域を抽出する抽出手段と、前記第1の画像と第2の画像とに基づいて、前記第1の画像の被写体領域毎にストロボ光と環境光の光量比率を求め、前記被写体領域毎の前記光量比率に基づいて、前記第1の画像と第2の画像を被写体領域毎に合成するための合成比率を決定する決定手段と、前記被写体距離とストロボ光の配光特性とに基づいて、前記第1の画像が撮影された際の、被写体領域毎のストロボ光の照射量を推定して、前記被写体領域毎のストロボ光の照射量と環境光との割合を算出する算出手段と、前記移動被写体の被写体領域については前記算出された前記割合を前記合成比率として用い、前記移動被写体ではない被写体の被写体領域については前記決定手段にて決定された合成比率を用いて、前記ホワイトバランス補正がなされた後の前記第1の画像と前記第2の画像を被写体領域毎に合成する合成手段とを有することを特徴とする。   The image processing apparatus according to the present invention uses the first white balance correction value corresponding to strobe light to correct the white balance of the first image taken at the time of strobe emission under ambient light, and supports environment light. Using the second white balance correction value, correction means for correcting the white balance of the second image taken under ambient light without strobe light emission, and when the first image is taken An acquisition means for acquiring a subject distance representing a distance to each subject; and a subject area of a moving subject that has moved from the first image during the shooting of the first image and the second image. Based on the extraction means for extracting, the first image and the second image, a light quantity ratio of strobe light and ambient light is obtained for each subject area of the first image, and the light quantity ratio for each subject area Based on before The first image is captured based on a determining means for determining a composition ratio for composing the first image and the second image for each subject area, and the subject distance and the light distribution characteristic of the strobe light. Calculating means for estimating the amount of strobe light irradiation for each subject area and calculating the ratio between the amount of strobe light irradiation for each subject area and the ambient light, and for the subject area of the moving subject The calculated ratio is used as the combination ratio, and the subject area of the subject that is not the moving subject is used as the first ratio after the white balance correction is performed using the combination ratio determined by the determination unit. The image processing apparatus includes combining means for combining the image and the second image for each subject area.

本発明によれば、被写体等に動きがある場合であっても、ストロボ発光時の撮影画像の各画像領域に対して最適なホワイトバランス補正が施された良好な画像を得ることが可能となる。   According to the present invention, it is possible to obtain a good image in which optimum white balance correction is performed on each image area of a captured image at the time of flash emission even when the subject or the like is moving. .

実施形態の撮像装置の概略構成を示す図である。It is a figure which shows schematic structure of the imaging device of embodiment. 第1の実施形態の撮像装置の全体の処理フロー図である。1 is an overall process flow diagram of an imaging apparatus according to a first embodiment. 撮像装置における撮影制御を時系列に並べた状態を示す図である。It is a figure which shows the state which arranged the imaging | photography control in the imaging device in time series. WB補正値算出処理のフローチャートである。It is a flowchart of a WB correction value calculation process. ブロック分割の説明に用いる図である。It is a figure used for description of block division. 白検出を行うための色評価値の関係の一例を示す特性図である。It is a characteristic view which shows an example of the relationship of the color evaluation value for performing white detection. 色温度とCxCy値との対応関係の説明に用いる図である。It is a figure used for description of the correspondence between color temperature and CxCy value. 被写体の動き判定を行う際のフローチャートである。It is a flowchart at the time of performing a subject's motion determination. 差分色味評価値に基づく動き判定の説明に用いる図である。It is a figure used for description of the motion determination based on a difference color evaluation value. 画像合成処理のフローチャートである。It is a flowchart of an image composition process. 距離マップと撮影条件から合成の割合を求める処理フロー図である。It is a processing flowchart which calculates | requires the ratio of composition from a distance map and imaging | photography conditions. 第2の実施形態の主要部の処理フロー図である。It is a processing flowchart of the principal part of 2nd Embodiment. 第3の実施形態の主要部の処理フロー図である。It is a processing flow figure of the principal part of 3rd Embodiment.

以下に、本発明の好適な実施の形態について説明する。本実施形態の画像処理装置は、例えば、デジタルスチルカメラやデジタルビデオカメラ等の撮像装置、撮像装置にて撮像された画像信号を処理するか若しくは自身が撮像機能を備えた情報処理装置等に適用可能である。それら情報処理装置としては、一例として、タブレット端末やスマートフォン、電子ゲーム機、ナビゲーション装置、パーソナルコンピュータなど様々な情報処理装置が挙げられる。また、本実施形態に係る後述する各処理は、ハードウェア構成とコンピュータプログラムによるソフトウェア構成の何れにおいても実現可能であり、ソフトウェア構成はCPU等が本実施形態に係るコンピュータプログラムを実行することにより実現可能である。これらのことは以下の第1の実施形態だけでなく、後述する他の実施形態においても同様に適用される。   Hereinafter, a preferred embodiment of the present invention will be described. The image processing apparatus according to the present embodiment is applied to, for example, an imaging apparatus such as a digital still camera or a digital video camera, an image processing apparatus that processes an image signal captured by the imaging apparatus, or an information processing apparatus that itself has an imaging function. Is possible. Examples of such information processing apparatuses include various information processing apparatuses such as a tablet terminal, a smartphone, an electronic game machine, a navigation apparatus, and a personal computer. In addition, each process to be described later according to the present embodiment can be realized by either a hardware configuration or a software configuration by a computer program, and the software configuration is realized by a CPU or the like executing the computer program according to the present embodiment. Is possible. These are similarly applied not only to the following first embodiment but also to other embodiments described later.

<第1の実施形態>
図1には、本実施形態の画像処理装置の一適用例としての撮像装置の概略構成例を示す。図1において、鏡筒部315は、フォーカスレンズやズームレンズを含むレンズ光学系、絞り、メカニカルシャッターなどを備える。鏡筒制御回路313は、後述するCPU314にて計算された露出値とフォーカスレンズの駆動量等の各値に基づいて、鏡筒部315の絞り、メカニカルシャッター、フォーカスレンズ等を駆動制御する。鏡筒部315のレンズ光学系は、被写体等の光学像を撮像素子301の撮像面上に結像させる。
<First Embodiment>
FIG. 1 shows a schematic configuration example of an imaging apparatus as an application example of the image processing apparatus of the present embodiment. In FIG. 1, a lens barrel 315 includes a lens optical system including a focus lens and a zoom lens, a diaphragm, a mechanical shutter, and the like. The lens barrel control circuit 313 drives and controls the aperture, the mechanical shutter, the focus lens, and the like of the lens barrel portion 315 based on values such as an exposure value calculated by a CPU 314 described later and a driving amount of the focus lens. The lens optical system of the lens barrel 315 forms an optical image of a subject or the like on the imaging surface of the image sensor 301.

撮像素子301は、CCDイメージセンサやCMOSセンサ等の固体撮像素子であり、その撮像面上に例えばベイヤー配列となされたRGB原色カラーフィルタが配され、カラー画像の撮像が可能となされている。撮像素子301は、例えばCPU314による制御の下、画像の撮像とその撮像信号の出力を行う。本実施形態において、撮像素子301はA/D変換器等の前処理回路を含み、その前処理回路を介したデジタル画像信号はメモリ302に送られる。メモリ302は、CPU314による制御の下、撮像素子301により撮像された画像信号等を格納し、その格納した画像信号を出力する。メモリ302から出力された画像信号は、周辺光量補正部320とCPU314へ送られる。   The image pickup element 301 is a solid-state image pickup element such as a CCD image sensor or a CMOS sensor, and an RGB primary color filter having a Bayer arrangement, for example, is arranged on the image pickup surface, and a color image can be picked up. For example, the image sensor 301 captures an image and outputs an image signal under the control of the CPU 314. In the present embodiment, the image sensor 301 includes a preprocessing circuit such as an A / D converter, and a digital image signal via the preprocessing circuit is sent to the memory 302. The memory 302 stores an image signal captured by the image sensor 301 under the control of the CPU 314, and outputs the stored image signal. The image signal output from the memory 302 is sent to the peripheral light amount correction unit 320 and the CPU 314.

また、本実施形態において、撮像素子301は、複数の焦点検出用画素が撮像面の有効撮像領域内の略々全面に配置されている。焦点検出用画素は、相関演算用の二つの像を生成するための画素である。焦点検出用画素により生成された相関演算用の二つの像の信号は、撮像素子301の周辺回路として設けられている図示しない演算回路に送られる。演算回路は、相関演算により二つの像の位相差を算出する。撮像素子301の全ての焦点検出用画素の出力信号から演算回路にて算出された位相差の信号は、被写体への合焦制御の際のフォーカスレンズの駆動量計算や、後述するような距離マップの生成演算等に使用される。なお、焦点検出用画素の出力信号から算出された位相差信号に基づく合焦制御は既存の技術であるため、その詳細な説明については省略する。   In the present embodiment, the imaging element 301 has a plurality of focus detection pixels arranged on substantially the entire surface within the effective imaging area of the imaging surface. The focus detection pixel is a pixel for generating two images for correlation calculation. Signals of two images for correlation calculation generated by the focus detection pixels are sent to an arithmetic circuit (not shown) provided as a peripheral circuit of the image sensor 301. The arithmetic circuit calculates the phase difference between the two images by correlation calculation. The phase difference signal calculated by the arithmetic circuit from the output signals of all the focus detection pixels of the image sensor 301 is used to calculate the driving amount of the focus lens at the time of focusing control on the subject, or a distance map as described later. It is used for the generation calculation. Note that focusing control based on the phase difference signal calculated from the output signal of the focus detection pixel is an existing technique, and thus detailed description thereof is omitted.

周辺光量補正部320は、鏡筒部315のズームレンズのズームポジションや絞り値などに応じて生じる周辺光量の低下を補うように、撮像素子301の撮像面上の像高毎に対応したゲインアップ量を決定する。そして、周辺光量補正部320は、そのゲインアップ量に基づいて画像信号に対するゲイン調整を行うことにより、周辺光量の低下分を補正する。なお、ゲインアップ量は、CPU314が算出してもよい。周辺光量補正部320による周辺光量補正後の画像信号は、ホワイトバランス制御部303に送られる。なお、以下の説明ではホワイトバランスを「WB」と表記する。   The peripheral light amount correction unit 320 increases the gain corresponding to each image height on the imaging surface of the image sensor 301 so as to compensate for the decrease in the peripheral light amount that occurs according to the zoom position or aperture value of the zoom lens of the lens barrel unit 315. Determine the amount. Then, the peripheral light amount correction unit 320 corrects the decrease in the peripheral light amount by performing gain adjustment on the image signal based on the gain increase amount. Note that the CPU 314 may calculate the gain increase amount. The image signal after the peripheral light amount correction by the peripheral light amount correction unit 320 is sent to the white balance control unit 303. In the following description, white balance is expressed as “WB”.

CPU314は、撮像画像全体が所定の輝度になるような露出値で撮影するためのシャッター速度と絞り値を計算すると共に、合焦領域内にある被写体に合焦させる合焦制御のためのフォーカスレンズの駆動量を計算する。CPU314にて計算された露出値(シャッター速度、絞り値)及びフォーカスレンズの駆動量が、鏡筒制御回路313に送られる。これにより、鏡筒制御回路313は、CPU314から供給されたそれら各値に基づいて、前述したように、鏡筒部315の絞り、メカニカルシャッター、フォーカスレンズ等を駆動させる。   The CPU 314 calculates a shutter speed and an aperture value for photographing with an exposure value so that the entire captured image has a predetermined luminance, and a focus lens for focus control for focusing on a subject in the focus area. Calculate the drive amount. The exposure value (shutter speed and aperture value) calculated by the CPU 314 and the driving amount of the focus lens are sent to the lens barrel control circuit 313. As a result, the lens barrel control circuit 313 drives the aperture, the mechanical shutter, the focus lens, and the like of the lens barrel 315 based on the values supplied from the CPU 314 as described above.

また、CPU314は、ストロボ光を発光させるストロボ発光制御と、ストロボ光を発光させないストロボ非発光制御と、ストロボ光を発光させる際のストロボ発光量制御をも行う。CPU314は、ストロボ発光制御を行う場合には、前述した鏡筒部315に対するシャッター速度と絞り値等の制御とともに、撮像画像の例えば被写体領域が所定の輝度になるようなストロボ発光量を算出する。そして、CPU314は、その算出したストロボ発光量のストロボ発光がなされるようにストロボ発光部316を制御する。これにより、ストロボ発光部316は、CPU314にて算出されたストロボ発光量となるストロボ光を発光させる。ストロボ発光部316は、内蔵ストロボ装置であってもよいし、外付け等のストロボ装置であってもよい。   The CPU 314 also performs strobe light emission control that emits strobe light, strobe non-emission control that does not emit strobe light, and strobe light emission control when strobe light is emitted. When performing the flash emission control, the CPU 314 calculates the flash emission amount such that the subject area of the captured image has a predetermined luminance, along with the control of the shutter speed and the aperture value for the lens barrel 315 described above. Then, the CPU 314 controls the strobe light emission unit 316 so that strobe light emission of the calculated strobe light emission amount is performed. As a result, the strobe light emitting unit 316 emits strobe light having the strobe light emission amount calculated by the CPU 314. The strobe light emitting unit 316 may be a built-in strobe device or an external strobe device.

なお、本実施形態では、後述するように、環境光下でストロボ光を発光させて撮像された画像を適宜「ストロボ発光画像」と表記する。本実施形態では、このストロボ発光画像が、最終的に撮影画像として取得される画像(撮影者が撮影画像として取得したい画像)であり、以下、この最終的に取得される撮影画像を「本露光画像」と表記する。この本露光画像(ストロボ発光画像)は、本実施形態における第1の画像である。また、本実施形態において、後述するように、ストロボ発光がなされていない環境光(外光)のみで撮像された第2の画像を適宜「ストロボ非発光画像」と表記する。ストロボ非発光画像は、本実施形態における第2の画像である。   In the present embodiment, as will be described later, an image captured by emitting strobe light under ambient light is appropriately referred to as a “strobe emission image”. In the present embodiment, this strobe light emission image is an image that is finally acquired as a captured image (an image that the photographer wants to acquire as a captured image). Hereinafter, this finally acquired captured image is referred to as “main exposure. Indicated as “image”. This main exposure image (flash emission image) is the first image in the present embodiment. In the present embodiment, as will be described later, the second image captured only with ambient light (external light) that does not emit strobe light is appropriately referred to as a “strobe non-light-emitting image”. The strobe non-emission image is the second image in the present embodiment.

WB制御部303は、本実施形態における第1,第2のホワイトバランス補正処理を行う第1、第2の補正手段である。WB制御部303は、後述するようにしてCPU314により算出される第1のホワイトバランス補正値(第1のWB補正値)を用いて、本露光画像であるストロボ発光画像に対する後述する第1のWB補正処理を行う。また、WB制御部303は、後述するようにしてCPU314により算出される第2のホワイトバランス補正値(第2のWB補正値)を用いて、本露光画像であるストロボ発光画像に対する後述する第2のWB補正処理を行う。なお、第1,第2のWB補正値の算出処理と第1,第2のWB補正処理の詳細については後述する。WB制御部303により、第1のWB補正処理が行われた後のストロボ発光画像と、第2のWB補正処理が行われた後のストロボ発光画像の信号は、色変換MTX(マトリクス)回路304とY(輝度信号)生成回路311に送られる。   The WB control unit 303 is first and second correction units that perform first and second white balance correction processes in the present embodiment. The WB control unit 303 uses a first white balance correction value (first WB correction value) calculated by the CPU 314 as will be described later, and uses a first WB to be described later for the strobe light emission image that is the main exposure image. Perform correction processing. In addition, the WB control unit 303 uses a second white balance correction value (second WB correction value) calculated by the CPU 314 as described later, and a second described later with respect to a strobe light emission image that is the main exposure image. WB correction processing is performed. Details of the first and second WB correction value calculation processes and the first and second WB correction processes will be described later. A color conversion MTX (matrix) circuit 304 is used for the strobe emission image after the first WB correction processing is performed by the WB control unit 303 and the strobe emission image signal after the second WB correction processing are performed. And Y (luminance signal) generation circuit 311.

色変換MTX回路304は、第1のWB補正処理後のストロボ発光画像の信号に対し、画像が後に最適な色で再現されるように色ゲインを掛け、さらにR−Y,B−Yの色差信号に変換して第1の色差信号を生成する。同様に、色変換MTX回路304は、第2のWB補正処理後のストロボ発光画像の信号に対し、後に最適な色で再現されるように色ゲインを掛け、さらにR−Y,B−Y色差信号に変換して第2の色差信号を生成する。色変換MTX回路304で色変換された後の第1,第2の色差信号は、LPF(ローパスフィルタ)回路305に送られる。   The color conversion MTX circuit 304 multiplies the strobe light emission image signal after the first WB correction processing by a color gain so that the image is reproduced with an optimum color later, and further, the color difference between RY and BY. It converts into a signal and produces | generates a 1st color difference signal. Similarly, the color conversion MTX circuit 304 multiplies the strobe light emission image signal after the second WB correction processing by a color gain so as to be reproduced with an optimum color later, and further performs RY, BY color difference. It converts into a signal and produces | generates a 2nd color difference signal. The first and second color difference signals after color conversion by the color conversion MTX circuit 304 are sent to an LPF (low-pass filter) circuit 305.

LPF回路305は、第1の色差信号の帯域を制限し、その帯域制限後の第1の帯域制限色差信号をCSUP(Chroma Supress)回路306に出力する。同様に、LPF回路305は、第2の色差信号の帯域を制限して、その帯域制限後の第2の帯域制限色差信号をCSUP回路306に出力する。   The LPF circuit 305 limits the band of the first color difference signal, and outputs the first band limited color difference signal after the band limitation to a CSUP (Chroma Suppress) circuit 306. Similarly, the LPF circuit 305 limits the band of the second color difference signal and outputs the second band limited color difference signal after the band limitation to the CSUP circuit 306.

CSUP回路306は、第1の帯域制限色差信号の飽和部分の偽色成分を低減し、その偽色成分低減後の第1の偽色低減色差信号をRGB変換回路307に出力する。同様に、CSUP回路306は、第2の帯域制限色差信号の飽和部分の偽色成分を低減し、その偽色成分低減後の第2の偽色低減色差信号をRGB変換回路307に出力する。   The CSUP circuit 306 reduces the false color component of the saturated portion of the first band limited color difference signal, and outputs the first false color reduced color difference signal after the false color component reduction to the RGB conversion circuit 307. Similarly, the CSUP circuit 306 reduces the false color component of the saturated portion of the second band limited color difference signal, and outputs the second false color reduced color difference signal after the false color component reduction to the RGB conversion circuit 307.

Y(輝度信号)生成回路311は、CPU314による制御の下、第1のWB補正処理後のストロボ発光画像から輝度信号Yを生成し、第1の輝度信号としてエッジ強調回路312に出力する。同様に、Y生成回路311は、CPU314による制御の下、第2のWB補正処理後のストロボ発光画像から輝度信号Yを生成し、第2の輝度信号としてエッジ強調回路312に出力する。   The Y (luminance signal) generation circuit 311 generates the luminance signal Y from the strobe light emission image after the first WB correction processing under the control of the CPU 314, and outputs it to the edge enhancement circuit 312 as the first luminance signal. Similarly, the Y generation circuit 311 generates a luminance signal Y from the strobe light emission image after the second WB correction process under the control of the CPU 314, and outputs it to the edge enhancement circuit 312 as the second luminance signal.

エッジ強調回路312は、CPU314による制御の下、第1の輝度信号に対してエッジ強調処理を施し、そのエッジ強調処理後の第1のエッジ強調輝度信号をRGB変換回路307に出力する。同様に、エッジ強調回路312は、CPU314による制御の下、第2の輝度信号に対してエッジ強調処理を施し、そのエッジ強調処理後の第2のエッジ強調輝度信号をRGB変換回路307に出力する。   The edge enhancement circuit 312 performs edge enhancement processing on the first luminance signal under the control of the CPU 314, and outputs the first edge enhancement luminance signal after the edge enhancement processing to the RGB conversion circuit 307. Similarly, the edge enhancement circuit 312 performs edge enhancement processing on the second luminance signal under the control of the CPU 314, and outputs the second edge enhanced luminance signal after the edge enhancement processing to the RGB conversion circuit 307. .

RGB変換回路307は、CSUP回路306からの第1の偽色低減色差信号とエッジ強調回路312からの第1のエッジ強調輝度信号とを用いて、第1のRGB画像信号を生成する。同様に、RGB変換回路307は、CSUP回路306からの第2の偽色低減色差信号とエッジ強調回路312からの第2のエッジ強調輝度信号とを用いて、第2のRGB画像信号を生成する。第1,第2のRGB画像信号は、γ(ガンマ)補正回路308に送られる。   The RGB conversion circuit 307 generates a first RGB image signal using the first false color reduction color difference signal from the CSUP circuit 306 and the first edge enhancement luminance signal from the edge enhancement circuit 312. Similarly, the RGB conversion circuit 307 generates a second RGB image signal using the second false color reduction color difference signal from the CSUP circuit 306 and the second edge enhancement luminance signal from the edge enhancement circuit 312. . The first and second RGB image signals are sent to a γ (gamma) correction circuit 308.

γ補正回路308は、第1のRGB画像信号に対してγカーブに基づく階調補正(γ補正)を施して第1の補正RGB画像信号を色輝度変換回路309へ出力する。同様に、γ補正回路308は、第2のRGB画像信号に対してγ補正を施して第2の補正RGB画像信号を色輝度変換回路309へ出力する。   The γ correction circuit 308 performs gradation correction (γ correction) based on the γ curve for the first RGB image signal, and outputs the first corrected RGB image signal to the color luminance conversion circuit 309. Similarly, the γ correction circuit 308 performs γ correction on the second RGB image signal and outputs the second corrected RGB image signal to the color luminance conversion circuit 309.

色輝度変換回路309は、第1の補正RGB画像信号を第1のYUV画像信号に変換する。同様に、色輝度変換回路309は、第2の補正RGB画像信号を第2のYUV画像信号に変換する。これら第1,第2のYUV画像信号は、画像合成処理部325に送られる。   The color luminance conversion circuit 309 converts the first corrected RGB image signal into a first YUV image signal. Similarly, the color luminance conversion circuit 309 converts the second corrected RGB image signal into a second YUV image signal. These first and second YUV image signals are sent to the image composition processing unit 325.

画像合成処理部325は、CPU314により後述するようにして生成される画像合成比率に基づいて、第1のYUV画像信号と第2のYUV画像信号とを合成して合成画像信号を生成する。画像合成処理部325における画像合成処理の詳細については後述する。画像合成処理部325による合成YUV画像信号は、JPEG圧縮回路310へ送られる。   The image composition processing unit 325 generates a composite image signal by combining the first YUV image signal and the second YUV image signal based on the image composition ratio generated by the CPU 314 as described later. Details of the image composition processing in the image composition processing unit 325 will be described later. The composite YUV image signal by the image composition processing unit 325 is sent to the JPEG compression circuit 310.

JPEG圧縮回路310は、画像合成処理部325による合成YUV画像信号を、例えばJPEG等のフォーマットに圧縮処理する。この圧縮処理後の画像信号は、不図示の気外部記録媒体又は内部記録媒体等に記録等される。   The JPEG compression circuit 310 compresses the combined YUV image signal from the image combining processing unit 325 into a format such as JPEG. The compressed image signal is recorded on an external recording medium (not shown) or an internal recording medium.

なお、図1では図示を省略しているが、本実施形態の撮像装置には、各種スイッチやダイヤル、シャッターボタンなどの操作デバイスをも備えている。なお、シャッターボタンは、いわゆる半押しと全押しが可能なスイッチにより構成されている。撮影者による操作デバイスを介した操作入力信号は、CPU314に送られる。撮影者は、操作デバイスを操作することで撮影パラメータの設定や撮影動作などの操作指示を入力することが可能である。また、図1では図示を省略しているが、本実施形態の撮像装置は、ライブビュー画像などを表示可能なEVF(電子ビューファインダー)や背面ディスプレイパネル等の表示デバイスも備えている。   Although not shown in FIG. 1, the imaging apparatus according to the present embodiment also includes operation devices such as various switches, dials, and shutter buttons. The shutter button is configured by a switch that can be pressed halfway and fully. An operation input signal by the photographer via the operation device is sent to the CPU 314. The photographer can input operation instructions such as setting of shooting parameters and shooting operations by operating the operation device. Although not shown in FIG. 1, the imaging apparatus according to the present embodiment also includes a display device such as an EVF (electronic viewfinder) or a rear display panel that can display a live view image or the like.

以下、図2を参照しながら、本実施形態の撮像装置における全体の処理のフローを、各処理を表すブロック別に分けて説明する。また、図3には、本実施形態の撮像装置のCPU314による撮影制御動作制御を時系列に並べて示す。   Hereinafter, the overall processing flow in the imaging apparatus of the present embodiment will be described separately for each block representing each processing, with reference to FIG. Further, FIG. 3 shows the shooting control operation control by the CPU 314 of the imaging apparatus of the present embodiment side by side in time series.

図3に示すように、CPU314は、例えばシャッターボタンのいわゆる半押しに相当するユーザー操作SW1がなされる前には、ライブビュー制御601により、定期的(フレーム毎)にライブビュー画像を撮影させる。そしてユーザー操作SW1がなされた場合、CPU314は、AFロック制御603とAEロック制御604を行う。なお、AFロック制御603は、鏡筒部315のフォーカスレンズを駆動するオートフォーカスの制御において焦点距離をロックする制御である。AEロック制御604は、自動露出制御において露出値(シャッター速度、絞り値)をロックする制御である。   As illustrated in FIG. 3, the CPU 314 causes the live view control 601 to capture a live view image periodically (for each frame) before a user operation SW1 corresponding to a so-called half-press of the shutter button, for example. When the user operation SW1 is performed, the CPU 314 performs AF lock control 603 and AE lock control 604. The AF lock control 603 is a control for locking the focal length in the auto focus control for driving the focus lens of the lens barrel 315. The AE lock control 604 is a control for locking the exposure value (shutter speed, aperture value) in the automatic exposure control.

そして、シャッターボタンの全押しに相当するユーザー操作SW2がなされた場合、CPU314は、テスト発光制御607と本露光制御608を行う。テスト発光制御607は、本露光が行われる前にストロボ発光部316をテスト発光させる制御であり、そのテスト発光により得られた露光量を基に、後の本露光の際のストロボ発光で適正露出が得られるストロボ発光量を求めるために行われる。本露光制御608ではストロボ発光部316を発光させて画像の撮影がなされる。また、テスト発光制御607の前には、外光制御606により、環境光すなわち外光のみの露光による撮影が行われる。以下、環境光については、適宜「外光」と表記する。なお、この外光のみの露光による画像撮影は、本露光制御608の直後に行われてもよいし、ライブビュー制御601の際に行われてもよい。   When the user operation SW2 corresponding to the full press of the shutter button is performed, the CPU 314 performs the test light emission control 607 and the main exposure control 608. The test light emission control 607 is a control for causing the strobe light emission unit 316 to perform test light emission before the main exposure is performed. Based on the exposure amount obtained by the test light emission, a proper exposure is obtained by the strobe light emission at the time of the subsequent main exposure. Is performed in order to obtain the amount of strobe light emission that can be obtained. In the main exposure control 608, the strobe light emitting unit 316 is caused to emit light and an image is taken. Further, before the test light emission control 607, the external light control 606 performs photographing by exposure of only ambient light, that is, external light. Hereinafter, the ambient light is appropriately referred to as “external light”. It should be noted that the image capturing by the exposure of only the external light may be performed immediately after the main exposure control 608 or may be performed during the live view control 601.

本実施形態においては、図3の本露光制御608のように、環境光下でストロボを発光させて撮影された本露光画像がストロボ発光画像である。また、本実施形態において、本露光制御608による撮影の直前(又は直後)の図3の外光制御606のように、ストロボ発光がなされていない環境光のみで撮影された画像がストロボ非発光画像である。また、ストロボ非発光画像は、ライブビュー制御601の際に撮影された画像が用いられてもよい。   In the present embodiment, as in the main exposure control 608 in FIG. 3, the main exposure image that is captured by causing the strobe to emit light under ambient light is a strobe light emission image. Further, in the present embodiment, as in the external light control 606 in FIG. 3 immediately before (or immediately after) the photographing by the main exposure control 608, an image photographed only with ambient light that is not subjected to strobe light emission is a strobe non-light emitting image. It is. In addition, an image captured during the live view control 601 may be used as the non-flash image.

図2のストロボ発光画像100は、例えば、撮影者により図3のユーザー操作SW2(シャッターボタンの全押し操作)がなされた後、図3の本露光制御608で取得された本露光画像のデータである。ストロボ発光画像100は、図1のメモリ302に保存される。   2 is the data of the main exposure image acquired by the main exposure control 608 in FIG. 3 after the user operation SW2 in FIG. 3 (full pressing operation of the shutter button) is performed by the photographer, for example. is there. The strobe light emission image 100 is stored in the memory 302 of FIG.

ストロボ非発光画像102は、例えば撮影者によりユーザー操作SW2がなされた後の図3の外光制御606で取得された撮影画像、又は、ストロボ発光がなされていない図3のライブビュー制御601の際に取得された最新のEVF画像である。図2の説明では、ストロボ非発光画像102が、図3のライブビュー制御601で取得されたEVF画像である場合を例に挙げて説明する。ストロボ非発光画像102は、図1のメモリ302に保存される。   The strobe non-emission image 102 is, for example, a captured image acquired by the external light control 606 in FIG. 3 after the user operation SW2 is performed by the photographer, or the live view control 601 in FIG. This is the latest EVF image acquired in (1). In the description of FIG. 2, a case where the strobe non-light emitting image 102 is an EVF image acquired by the live view control 601 of FIG. 3 will be described as an example. The non-flash image 102 is stored in the memory 302 of FIG.

ストロボ配光レンズ周辺光量137は、図1のCPU314が扱うストロボ配光情報とレンズ周辺光量データである。ストロボ配光情報とレンズ周辺光量データの詳細についての説明は後述する。なお、ストロボ配光レンズ周辺光量137の情報は、図1には図示していない情報記憶用のメモリ等に記憶されている。   The strobe light distribution lens peripheral light amount 137 is strobe light distribution information and lens peripheral light amount data handled by the CPU 314 in FIG. Details of the strobe light distribution information and the lens peripheral light amount data will be described later. Note that information on the strobe light distribution lens peripheral light amount 137 is stored in an information storage memory or the like not shown in FIG.

発光量情報110は、ストロボ発光部316におけるストロボ発光量であるガイドナンバーの情報である。発光量情報110の詳細な説明については後述する。なお、発光量情報110は、図1には図示していない情報記憶用のメモリ等に記憶されている。   The light emission amount information 110 is information on a guide number that is a strobe light emission amount in the strobe light emitting unit 316. Details of the light emission amount information 110 will be described later. The light emission amount information 110 is stored in an information storage memory or the like not shown in FIG.

第1のWB補正値算出処理111は、例えば発光量情報110に基づいて、後述する第1のWB補正値を算出する処理であり、図1のCPU314により行われる。また、第1のWB補正値算出処理111は、ストロボ発光画像100に基づいて第1のWB補正値を算出する処理であってもよい。図2では、発光量情報110に基づいて第1のWB補正値が算出される例を挙げている。図2の第1のWB処理1091は、本露光画像であるストロボ発光画像100に対して第1のWB補正値を用いた第1のWB補正を行う処理であり、図1のWB制御部303により行われる。なお、第1のWB補正値算出処理111は、図1のWB制御部303により行われてもよい。第1のWB補正値算出処理111と第1のWB処理1091の詳細については後述する。   The first WB correction value calculation process 111 is a process for calculating a first WB correction value, which will be described later, based on the light emission amount information 110, for example, and is performed by the CPU 314 in FIG. Further, the first WB correction value calculation process 111 may be a process for calculating the first WB correction value based on the strobe light emission image 100. FIG. 2 shows an example in which the first WB correction value is calculated based on the light emission amount information 110. The first WB process 1091 in FIG. 2 is a process for performing the first WB correction using the first WB correction value on the strobe light emission image 100 which is the main exposure image, and the WB control unit 303 in FIG. Is done. The first WB correction value calculation process 111 may be performed by the WB control unit 303 in FIG. Details of the first WB correction value calculation process 111 and the first WB process 1091 will be described later.

第2のWB補正値算出処理107は、ストロボ非発光画像102から後述する第2のWB補正値を算出する処理であり、図1のCPU314により行われる。図2の第2のWB処理1092は、本露光画像であるストロボ発光画像100に対して第2のWB補正値を用いた第2のWB補正を行う処理であり、図1のWB制御部303にて行われる。なお、第2のWB補正値算出処理107は、図1のWB制御部303により行われてもよい。第2のWB補正値算出処理107と第2のWB処理1092の詳細については後述する。   The second WB correction value calculation process 107 is a process for calculating a second WB correction value, which will be described later, from the non-flash image 102, and is performed by the CPU 314 in FIG. The second WB process 1092 in FIG. 2 is a process for performing the second WB correction using the second WB correction value on the strobe light emission image 100 which is the main exposure image, and the WB control unit 303 in FIG. Is done. The second WB correction value calculation process 107 may be performed by the WB control unit 303 in FIG. Details of the second WB correction value calculation process 107 and the second WB process 1092 will be described later.

以下、第1のWB補正値算出処理111と第2のWB補正値算出処理107の詳細について説明する。なお、ここでは、図1のCPU314が第1,第2のWB補正値算出処理111,107を行う例を挙げて説明するが、それら第1,第2のWB補正値算出処理111,107WB制御部303により行われてもよい。   Details of the first WB correction value calculation process 111 and the second WB correction value calculation process 107 will be described below. Here, although an example in which the CPU 314 in FIG. 1 performs the first and second WB correction value calculation processes 111 and 107 will be described, the first and second WB correction value calculation processes 111 and 107 WB control are described. This may be performed by the unit 303.

第1のWB補正値算出処理111は、前述したように、発光量情報110、又はストロボ発光画像100に基づいて、第1のWB補正値を算出可能となされているが、ここでは、ストロボ発光画像100に基づいて第1のWB補正値を算出する例について説明する。この場合、第1のWB補正値算出処理111において、CPU314は、図3の本露光制御608のように環境光下でストロボ発光時に撮影されたストロボ発光画像100(本露光画像)から第1のWB補正値を算出する。   The first WB correction value calculation processing 111 can calculate the first WB correction value based on the light emission amount information 110 or the strobe light emission image 100 as described above. An example in which the first WB correction value is calculated based on the image 100 will be described. In this case, in the first WB correction value calculation process 111, the CPU 314 performs a first operation from the strobe light emission image 100 (main exposure image) that is captured during strobe emission under ambient light as in the main exposure control 608 in FIG. A WB correction value is calculated.

図4は、CPU314が、図3の本露光制御608において撮影されたストロボ発光画像100から第1のWB補正値を算出する処理の詳細なフローチャートである。図4のフローチャートにおいて、CPU314は、ステップS101として、図5に示すように、図3の本露光制御608で取得されたストロボ発光画像100を、RGBの複数の画素毎に、予め任意に決められたm個のブロック201に分割する。以下の説明では、ブロック201を単にブロックと表記する。ステップS101の後、CPU314は、処理をステップS102へ進める。   FIG. 4 is a detailed flowchart of processing in which the CPU 314 calculates the first WB correction value from the strobe light emission image 100 photographed in the main exposure control 608 of FIG. In the flowchart of FIG. 4, the CPU 314 arbitrarily determines the strobe light emission image 100 acquired by the main exposure control 608 of FIG. 3 for each of a plurality of RGB pixels, as shown in FIG. Divide into m blocks 201. In the following description, the block 201 is simply expressed as a block. After step S101, the CPU 314 advances the process to step S102.

ステップS102では、CPU314は、前述のようにm個に分割したブロック毎に、ブロック内の全ての画素についてRGBの色毎の加算平均を行って色平均値R[i],G[i],B[i]を算出する。そして、CPU314は、ブロック毎に、式(1)により色評価値Cx[i],Cy[i]を算出する。なお、R[i],G[i],B[i]とCx[i],Cy[i]における「i」は、1番目〜m番目のブロックのうちの例えばi番目のブロックであることを表している。   In step S102, for each block divided into m as described above, the CPU 314 performs an addition average for each color of RGB for all pixels in the block to obtain color average values R [i], G [i], B [i] is calculated. Then, the CPU 314 calculates the color evaluation values Cx [i] and Cy [i] for each block according to the equation (1). Note that “i” in R [i], G [i], B [i] and Cx [i], Cy [i] is, for example, the i-th block among the 1st to m-th blocks. Represents.

Cx[i]=(R[i]−B[i])/Y[i]×1024
Cy[i]=(R[i]+B[i]−2G[i])/Y[i]×1024 ・・・式(1)
ただし、Y[i]=R[i]+2G[i]+B[i]、1024は階調数である。
Cx [i] = (R [i] −B [i]) / Y [i] × 1024
Cy [i] = (R [i] + B [i] −2G [i]) / Y [i] × 1024 Expression (1)
However, Y [i] = R [i] + 2G [i] + B [i], 1024 is the number of gradations.

ステップS102の後、CPU314は、処理をステップS103へ進める。ステップS103では、CPU314は、図6(a)に示すような座標軸を持つグラフを用いて白検出を行う。図6(a)におけるx座標の色評価値Cxは、負方向が高色温度被写体の白を撮影したときの色評価値、正方向が低色温度被写体の白を撮影したときの色評価値を示している。また、y座標の色評価値Cyは、光源の緑成分の度合いを意味しており、負方向になるにつれグリーン(緑)成分が大きくなることを示している。ここで、ストロボ光は既知の光源であるため、CPU314は、図3の本露光制御608によるストロボ発光画像に関しては、図6(a)に示すように限定された白検出範囲401を用いて白検出を行う。   After step S102, the CPU 314 advances the process to step S103. In step S103, the CPU 314 performs white detection using a graph having coordinate axes as shown in FIG. The color evaluation value Cx of the x coordinate in FIG. 6A is a color evaluation value when a negative direction is taken of white of a high color temperature subject, and a color evaluation value is obtained when the positive direction is taken of white of a low color temperature subject. Is shown. Moreover, the color evaluation value Cy of the y coordinate means the degree of the green component of the light source, and indicates that the green (green) component increases as it goes in the negative direction. Here, since the strobe light is a known light source, the CPU 314 uses the white detection range 401 limited as shown in FIG. 6A for the strobe emission image by the main exposure control 608 in FIG. Perform detection.

図7(a)のグラフと図7(b)の表は、黒体放射軸であり、色温度と色評価値Cx,Cyとの関係を示したものである。これら図7(a)のグラフと図7(b)の表は、予め黒体放射軸上の既知の色温度光源にて撮像装置で画像を撮影し、その撮影画像から色評価値Cx,Cyを算出することで求められている。もちろん、色温度方向だけではなく、例えば白色蛍光灯のようなグリーン方向やマゼンタ方向の色成分を多く含む光源に対しても同様に色評価値Cx,Cyとの対応関係を求めておいてもよい。また、前述したストロボの発光色温度に対応した色評価値Cx,Cyを取得しておけば、ストロボ光の色温度がわかれば、そのストロボ光源に対応した第1のWB補正値の算出が可能となる。   The graph of FIG. 7A and the table of FIG. 7B are blackbody radiation axes, and show the relationship between the color temperature and the color evaluation values Cx and Cy. These graphs in FIG. 7A and the table in FIG. 7B are obtained by photographing an image with an imaging device in advance with a known color temperature light source on a black body radiation axis, and calculating color evaluation values Cx, Cy from the photographed image. It is calculated by calculating. Of course, not only the color temperature direction but also the correspondence relationship with the color evaluation values Cx and Cy may be obtained for a light source including many color components in the green direction and magenta direction such as a white fluorescent lamp. Good. Further, if the color evaluation values Cx and Cy corresponding to the light emission color temperature of the strobe are obtained, the first WB correction value corresponding to the strobe light source can be calculated if the color temperature of the strobe light is known. It becomes.

図4のフローチャートに説明を戻し、CPU314は、ステップS103において、ステップS102で算出した例えばi番目のブロックの色評価値Cx[i],Cy[i]が、図6(a)に示したストロボ光用の白検出範囲401に含まれるか否かを判断する。CPU314は、ステップS103において、i番目のブロックの色評価値Cx[i],Cy[i]が白検出範囲401に含まれると判断した場合には、そのブロックの画像が白色であると判断して、処理をステップS104へ進める。   Returning to the flowchart of FIG. 4, in step S103, the CPU 314 determines that the color evaluation values Cx [i] and Cy [i] of the i-th block calculated in step S102 are the strobes shown in FIG. It is determined whether or not it is included in the white detection range 401 for light. If the CPU 314 determines in step S103 that the color evaluation values Cx [i] and Cy [i] of the i-th block are included in the white detection range 401, the CPU 314 determines that the image of that block is white. Then, the process proceeds to step S104.

ステップS104では、CPU314は、ステップS103で白検出範囲401に含まれると判断したi番目のブロックの色平均値R[i],G[i],B[i]を下記の式(2)のように積算する。ステップS104の後、CPU314は、処理をステップS105へ進める。一方、CPU314は、ステップS103において、i番目のブロックの色評価値Cx[i],Cy[i]が白検出範囲401に含まれないと判断した場合には、ステップS104での加算を行わずに、処理をステップS105へ進める。これらステップS103とステップS104の処理は、式(2)で表すことができる。式(2)は、i番目のブロックの色平均値R[i],G[i],B[i]の積分値SumR,SumG,SumBを求める式である。   In step S104, the CPU 314 determines the color average values R [i], G [i], and B [i] of the i-th block determined to be included in the white detection range 401 in step S103 by the following equation (2). Accumulate as follows. After step S104, the CPU 314 advances the process to step S105. On the other hand, if the CPU 314 determines in step S103 that the color evaluation values Cx [i] and Cy [i] of the i-th block are not included in the white detection range 401, the addition in step S104 is not performed. Then, the process proceeds to step S105. The processing of step S103 and step S104 can be expressed by equation (2). Expression (2) is an expression for obtaining integrated values SumR, SumG, and SumB of the color average values R [i], G [i], and B [i] of the i-th block.

Figure 2017034536
Figure 2017034536

ここで、CPU314は、色評価値Cx[i],Cy[i]が、図6(a)の白検出範囲401に含まれる場合は式(2)のSw[i]を「1」に、一方、白検出範囲401に含まれない場合には式(2)のSw[i]を「0」とする。これにより、CPU314は、ブロック毎に、ステップS103の判断結果に応じて色平均値R[i],G[i],B[i]の加算(積算)を行うか、又は、加算(積算)を行わないかの処理を実質的に切り替えている。   Here, when the color evaluation values Cx [i] and Cy [i] are included in the white detection range 401 in FIG. 6A, the CPU 314 sets Sw [i] in Expression (2) to “1”. On the other hand, if it is not included in the white detection range 401, Sw [i] in Expression (2) is set to “0”. Accordingly, the CPU 314 performs addition (integration) of the color average values R [i], G [i], and B [i] or adds (accumulation) for each block according to the determination result of step S103. The process of whether or not to perform is substantially switched.

次に、ステップS105の処理に進むと、CPU314は、全てのブロックについて前述のステップS102からステップS104の処理が終わったか否かを判定する。そして、CPU314は、未処理のブロックが存在する場合には、処理をステップS102に戻して、ステップS102以降の各処理を行う。一方、CPU314は、ステップS105で全てのブロックについて処理が終わったと判断した場合には、処理をステップS106へ進める。   Next, when the processing proceeds to step S105, the CPU 314 determines whether or not the processing from step S102 to step S104 is completed for all blocks. If there is an unprocessed block, the CPU 314 returns the process to step S102 and performs each process after step S102. On the other hand, if the CPU 314 determines in step S105 that the processing has been completed for all blocks, the process proceeds to step S106.

ステップS106では、CPU314は、前述の式(2)にて算出した積分値SumR,SumG,SumBを用い、式(3)により、第1のWB補正値WBCo1_R1,WBCo1_G1,WBCo1_B1を算出する。なお、式(3)では、ストロボ発光画像から式(2)にて算出された積分値SumR,SumG,SumBをsumR1,sumG1,sumB1と表記している。   In step S106, the CPU 314 calculates the first WB correction values WBCo1_R1, WBCo1_G1, and WBCo1_B1 according to the equation (3) using the integral values SumR, SumG, and SumB calculated in the above equation (2). In Expression (3), the integral values SumR, SumG, and SumB calculated from Expression (2) from the strobe light emission image are expressed as sumR1, sumG1, and sumB1.

WBCo1_R1=sumY1×1024/sumR1
WBCo1_G1=sumY1×1024/sumG1 ・・・式(3)
WBCo1_B1=sumY1×1024/sumB1
ただし、sumY1=(sumR1+2×sumG1+sumB1)/4
WBCo1_R1 = sumY1 × 1024 / sumR1
WBCo1_G1 = sumY1 × 1024 / sumG1 Formula (3)
WBCo1_B1 = sumY1 × 1024 / sumB1
However, sumY1 = (sumR1 + 2 × sumG1 + sumB1) / 4

ここまでの説明では、ストロボ発光画像100に基づいて第1のWB補正値が算出される例を挙げたが、CPU314は、第1のWB補正値算出処理111として、発光量情報110に基づいて第1のWB補正値を算出することも可能である。すなわち、ストロボ光は既知の光源であるため、CPU314は、図2の発光量情報110として、前述したストロボ発光部316のストロボ発光量情報を用いることで、第1のWB補正値を求めることもできる。発光量情報110に基づく第1のWB補正値の算出処理についての説明は後述する。   In the description so far, the example in which the first WB correction value is calculated based on the strobe light emission image 100 has been described. However, the CPU 314 performs the first WB correction value calculation processing 111 based on the light emission amount information 110. It is also possible to calculate the first WB correction value. That is, since the strobe light is a known light source, the CPU 314 may obtain the first WB correction value by using the strobe light amount information of the strobe light emitting unit 316 described above as the light amount information 110 in FIG. it can. The calculation process of the first WB correction value based on the light emission amount information 110 will be described later.

次に、図2の第2のWB補正値算出処理107として、図1のCPU314がストロボ非発光画像102に基づいて第2のWB補正値を算出する例について説明する。第2のWB補正値算出処理107において、CPU314は、図3のライブビュー制御601においてストロボ発光がなされていない環境光下で撮影されたストロボ非発光画像102(EVF画像)から第2のWB補正値を算出する。なお、第2のWB補正値算出処理107は、図1のWB制御部303により行われてもよい。また、第2のWB補正値は図3の外光制御606で撮影されたストロボ非発光画像から算出されてもよい。   Next, as the second WB correction value calculation process 107 in FIG. 2, an example in which the CPU 314 in FIG. 1 calculates the second WB correction value based on the non-flash image 102 will be described. In the second WB correction value calculation processing 107, the CPU 314 performs a second WB correction from the strobe non-emission image 102 (EVF image) taken under the ambient light in which the flash emission is not performed in the live view control 601 in FIG. Calculate the value. The second WB correction value calculation process 107 may be performed by the WB control unit 303 in FIG. Further, the second WB correction value may be calculated from the strobe non-light emission image photographed by the external light control 606 in FIG.

EVF画像であるストロボ非発光画像102から第2のWB補正値を算出する場合、CPU314は、前述した第1のWB補正値算出処理111の場合と同様にして第2のWB補正値WBCol_R2,WBCol_G2,WBCol_B2を算出する。   When calculating the second WB correction value from the strobe non-emission image 102 which is an EVF image, the CPU 314 performs the second WB correction value WBCol_R2, WBCol_G2 in the same manner as in the first WB correction value calculation process 111 described above. , WBCol_B2 is calculated.

第2のWB補正値を算出する処理の場合、CPU314は、図4のステップS101では、ストロボ非発光画像を前述同様にm個のブロックに分割する。   In the process of calculating the second WB correction value, the CPU 314 divides the strobe non-emission image into m blocks as described above in step S101 of FIG.

また、第2のWB補正値の算出処理の場合、CPU314は、図4のステップS104では、例えばi番目のブロックの色評価値Cx[i],Cy[i]が、図6(b)に示す外光用の白検出範囲402に含まれるか否かを判断する。図6(b)に示したような広い白検出範囲402を用いるのは、ストロボ光が既知の光源であるのに対し、外光(環境光)は既知の光源でないためであり、前述の図6(a)の白検出範囲401のように検出範囲を限定出来ないからである。図6(b)に示す外光用の白検出範囲402は、予め異なる光源のもとで白い物体を撮影し、その撮影画像データから求めた色評価値を黒体放射軸に沿ってプロットすることにより生成されたものである。この白検出範囲402は、外光(環境光)が、例えば、太陽光であるか、曇天光であるか、室内の蛍光灯や電球の光など、何れの種類の光源による光であるかにより、個別に設定可能となされている。これら各外光の種類に対応した白検出範囲402の何れを用いるかについては、例えば各外光の種類に応じて用意されている複数の光源撮影モードの選択に応じて行われる。図6(b)の色評価値CxとCyは前述の図6(a)と同様に表されており、色評価値Cyが負方向になるにつれてグリーン成分が大きくなって例えば蛍光灯光源に近づくことを示している。   In the case of the second WB correction value calculation process, in step S104 of FIG. 4, for example, the CPU 314 converts the color evaluation values Cx [i] and Cy [i] of the i-th block to FIG. It is determined whether or not it is included in the external light white detection range 402 shown. The reason why the wide white detection range 402 as shown in FIG. 6B is used is that strobe light is a known light source, whereas external light (environment light) is not a known light source. This is because the detection range cannot be limited like the white detection range 401 in FIG. In the white detection range 402 for external light shown in FIG. 6B, a white object is captured in advance under a different light source, and a color evaluation value obtained from the captured image data is plotted along the black body radiation axis. It is generated by. The white detection range 402 depends on whether the outside light (environment light) is, for example, sunlight, cloudy light, or light of any kind of light source such as indoor fluorescent light or light from a light bulb. It can be set individually. Which one of the white detection ranges 402 corresponding to each type of external light is used is determined depending on, for example, selection of a plurality of light source photographing modes prepared according to the type of each external light. The color evaluation values Cx and Cy in FIG. 6B are expressed in the same manner as in FIG. 6A described above, and as the color evaluation value Cy becomes negative, the green component increases and approaches, for example, a fluorescent light source. It is shown that.

また、第2のWB補正値の算出処理の場合、CPU314は、図4のステップS106において第2のWB補正値WBCo1_R2,WBCo1_G2,WBCo1_B2を算出する。なお、ストロボ非発光画像から前述の式(2)で算出された積分値をsumR2,sumG2,sumB2と表記した場合、式(3)ではsumR1,sumG1,sumB1に代えてsumR2,sumG2,sumB2が用いられる。また、式(3)では、WBCo1_R1,WBCo1_G1,WBCo1_B1に代えて、第2のWB補正値WBCo1_R2,WBCo1_G2,WBCo1_B2が算出される。   In the second WB correction value calculation process, the CPU 314 calculates the second WB correction values WBCo1_R2, WBCo1_G2, and WBCo1_B2 in step S106 of FIG. In addition, when the integral value calculated by the above-described equation (2) from the non-flash image is expressed as sumR2, sumG2, and sumB2, sumR2, sumG2, and sumB2 are used instead of sumR1, sumG1, and sumB1 in equation (3). It is done. In Expression (3), the second WB correction values WBCo1_R2, WBCo1_G2, and WBCo1_B2 are calculated instead of WBCo1_R1, WBCo1_G1, and WBCo1_B1.

図2の処理フローに説明を戻す。
図2の第1の現像処理1131は、図1の色変換MTX回路304から色輝度変換回路309までに相当する処理であり、第1のWB補正値を用いた第1のWB処理1091の後のストロボ発光画像100(本露光画像)に対する現像処理である。第1の現像処理1131によりストロボ発光画像100(本露光画像)がYUV画像に変換された後の画像が前述の第1のYUV画像である。第1のYUV画像は、輝度の色評価値Y1[i]と色差の色評価値u1[i],v1[i]とにより表される。第1のYUV画像(Y1[i],u1[i],v1[i])は、後述する画像合成処理114に送られる。
The description returns to the processing flow of FIG.
A first development process 1131 in FIG. 2 is a process corresponding to the color conversion MTX circuit 304 to the color luminance conversion circuit 309 in FIG. 1, and after the first WB process 1091 using the first WB correction value. Development processing of the strobe light emission image 100 (main exposure image). An image after the strobe light emission image 100 (main exposure image) is converted into a YUV image by the first development processing 1131 is the above-described first YUV image. The first YUV image is represented by a luminance color evaluation value Y1 [i] and color difference color evaluation values u1 [i], v1 [i]. The first YUV image (Y1 [i], u1 [i], v1 [i]) is sent to an image composition process 114 described later.

同様に、第2の現像処理1132は、図1の色変換MTX回路304から色輝度変換回路309までに相当する処理であり、第2のWB補正値を用いた第2のWB処理1092の後のストロボ発光画像100(本露光画像)に対する現像処理である。この第2の現像処理1132によりストロボ発光画像100(本露光画像)がYUV画像に変換された後の画像が前述の第2のYUV画像である。第2のYUV画像は、輝度の色評価値Y2[i]と色差の色評価値u2[i],v2[i]とにより表される。第2のYUV画像(Y2[i],u2[i],v2[i])は、後述する画像合成処理114に送られる。   Similarly, the second development process 1132 is a process corresponding to the color conversion MTX circuit 304 to the color luminance conversion circuit 309 in FIG. 1, and is performed after the second WB process 1092 using the second WB correction value. Development processing of the strobe light emission image 100 (main exposure image). The image after the strobe light emission image 100 (main exposure image) is converted into the YUV image by the second development processing 1132 is the above-described second YUV image. The second YUV image is represented by a luminance color evaluation value Y2 [i] and a color difference color evaluation value u2 [i], v2 [i]. The second YUV image (Y2 [i], u2 [i], v2 [i]) is sent to an image composition process 114 described later.

リサイズ処理101とリサイズ処理106は、例えば図1のCPU314により行われる処理である。リサイズ処理101とリサイズ処理106は、ストロボ非発光画像102が例えば図2のライブビュー制御601で取得されたEVF用の画像のように、本露光画像100よりも低い解像度の画像である場合に行われる処理である。具体的には、リサイズ処理101では、本露光画像100(ストロボ発光画像)をEVF用の画像に相当するサイズにリサイズする処理が行われる。なお、リサイズ処理101では、本露光画像(ストロボ発光画像100)をリサイズした後に、そのリサイズ後の画像を前述したようなブロックに分割する。リサイズ処理106は、後述する画像合成比率の情報を、EVF画像に対応したサイズから本露光画像100に対応したサイズにリサイズする処理である。なお、ストロボ非発光画像が、例えば図3の外光制御606で取得される画像のように、本露光制御608で取得される本露光画像と同じ解像度の画像である場合には、リサイズ処理101とリサイズ処理106は省略可能である。また、ストロボ非発光画像としてEVF画像を用いるか又は外光制御606による撮影画像を用いるかに応じて、リサイズ処理101とリサイズ処理106を実行するか否かが切り替えられてもよい。   The resizing process 101 and the resizing process 106 are processes performed by the CPU 314 in FIG. 1, for example. The resizing process 101 and the resizing process 106 are performed when the non-flash image 102 is an image having a resolution lower than that of the main exposure image 100, such as an image for EVF acquired by the live view control 601 in FIG. Process. Specifically, in the resizing process 101, a process of resizing the main exposure image 100 (flash emission image) to a size corresponding to an image for EVF is performed. In the resizing process 101, after resizing the main exposure image (flash emission image 100), the resized image is divided into blocks as described above. The resizing process 106 is a process for resizing image composition ratio information described later from a size corresponding to the EVF image to a size corresponding to the main exposure image 100. Note that if the strobe non-emission image is an image having the same resolution as the main exposure image acquired by the main exposure control 608, such as an image acquired by the external light control 606 in FIG. The resizing process 106 can be omitted. Whether or not to execute the resizing process 101 and the resizing process 106 may be switched depending on whether an EVF image is used as the strobe non-light-emitting image or a photographed image by the external light control 606 is used.

露光量演算処理103は、例えば図1のCPU314にて行われる処理である。CPU314は、露光量演算処理103において、ストロボ発光画像100とストロボ非発光画像102がそれぞれ撮影された際の、ISO感度と絞り値とシャッター速度とに基づいて、それら画像が撮影された際の露光量を算出する。ここで、ストロボ発光画像100とストロボ非発光画像102との間では、ISO感度や絞り値、シャッター速度の違い等により露出が異なる場合がある。また、後述するように、本実施形態では、後に行われる領域毎ストロボ発光量演算処理104においてストロボ光と環境光(外光)の光量比較に基づいてストロボ発光量が求められる。このため、CPU314は、露光量演算処理103において、ストロボ発光画像100とストロボ非発光画像102が撮影された際のISO感度と絞り値とシャッター速度とに基づいて、それら画像が撮影された際に設定された露光量を求める。さらに、CPU314は、露光量演算処理103において、それらストロボ発光画像100の露光量とストロボ非発光画像102の露光量との差分を求める。   The exposure amount calculation process 103 is, for example, a process performed by the CPU 314 in FIG. Based on the ISO sensitivity, aperture value, and shutter speed when the flash emission image 100 and the non-flash image 102 are respectively captured in the exposure amount calculation process 103, the CPU 314 performs exposure when the images are captured. Calculate the amount. Here, the exposure may differ between the flash emission image 100 and the non-flash image 102 due to differences in ISO sensitivity, aperture value, shutter speed, and the like. Further, as will be described later, in the present embodiment, the strobe light emission amount is obtained based on the comparison of the light amount of the strobe light and the ambient light (external light) in the area-specific strobe light amount calculation processing 104 performed later. For this reason, the CPU 314 determines whether the strobe light emission image 100 and the strobe non-light emission image 102 are captured based on the ISO sensitivity, the aperture value, and the shutter speed when the strobe light emission image 100 and the strobe non-light emission image 102 are captured. The set exposure amount is obtained. Further, the CPU 314 obtains a difference between the exposure amount of the strobe light emission image 100 and the exposure amount of the strobe non-light emission image 102 in the exposure amount calculation processing 103.

また、CPU314は、露光量演算処理103において、ストロボ非発光画像102を前述したようにブロック分割する。本実施形態の場合、前述のようにリサイズ処理101されたストロボ発光画像100のブロックと、EVF用の画像サイズのストロボ非発光画像102のブロックの領域は、画角に対して同一の領域になされている。そして、CPU314は、露光量演算処理103において、ストロボ非発光画像102について前述同様にしてブロック毎に積分値sumR2,sumG2,sumB2を求める。さらに、CPU314は、露光量演算処理103において、ストロボ非発光画像102のブロック毎の積分値に対して、前述の露光量の差分に応じた換算処理を行う。   In the exposure amount calculation process 103, the CPU 314 divides the strobe non-emission image 102 into blocks as described above. In the case of the present embodiment, the area of the block of the flash emission image 100 subjected to the resizing process 101 as described above and the area of the block of the flash non-light emission image 102 of the image size for EVF are made the same area with respect to the angle of view. ing. Then, the CPU 314 obtains integrated values sumR2, sumG2, and sumB2 for each block in the exposure amount calculation process 103 in the same manner as described above for the strobe non-light-emitting image 102. Further, in the exposure amount calculation process 103, the CPU 314 performs a conversion process according to the above-described exposure amount difference with respect to the integrated value for each block of the strobe non-light-emitting image 102.

領域毎ストロボ発光量演算処理104(以下、発光量演算処理104と表記する。)は、図1のCPU314により行われる処理である。CPU314は、発光量演算処理104において、露光量演算処理103で求めた露光量差分と、リサイズ処理101されたストロボ発光画像100と、ストロボ非発光画像102とに基づいて、画像領域毎のストロボ発光量を求める。   The area-specific strobe light emission calculation process 104 (hereinafter referred to as the light emission quantity calculation process 104) is a process performed by the CPU 314 in FIG. In the light emission amount calculation processing 104, the CPU 314 performs strobe light emission for each image region based on the exposure amount difference obtained in the exposure amount calculation processing 103, the strobe light emission image 100 subjected to the resizing processing 101, and the strobe non-light emission image 102. Find the amount.

ここで、本実施形態では、画像領域毎にWB補正を行うようになされている。本実施形態における画像領域とは、例えば人物や建物、空、乗り物などの様々な被写体画像の領域であり、本実施形態では被写体領域と表記している。このため、CPU314は、発光量演算処理104において、リサイズ処理101されたストロボ発光画像100と、ストロボ非発光画像102とに基づいて、被写体領域毎のストロボ発光量を求める。被写体領域毎のストロボ発光量は、被写体領域毎にストロボ光が照射された照射量であるため、以下の説明では被写体領域毎のストロボ照射量と表記する。   Here, in this embodiment, WB correction is performed for each image area. The image area in this embodiment is an area of various subject images such as a person, a building, the sky, and a vehicle, and is described as a subject area in this embodiment. For this reason, the CPU 314 obtains a strobe light emission amount for each subject area based on the strobe light emission image 100 subjected to the resizing process 101 and the strobe non-light emission image 102 in the light emission amount calculation process 104. The strobe emission amount for each subject area is the amount of irradiation with the strobe light for each subject area, and will be referred to as the strobe irradiation amount for each subject area in the following description.

領域毎外光・ストロボ光比率生成処理133(以下、光比率生成処理133と表記する。)は、図1のCPU314により行われる処理である。CPU314は、光比率生成処理133において、発光量演算処理104によるストロボ照射量とリサイズ処理101後のストロボ発光画像100とストロボ非発光画像102とに基づいて、被写体領域毎に、ストロボ光と環境光(外光)の光量比率を求める。   The outside light / strobe light ratio generation process 133 for each area (hereinafter referred to as a light ratio generation process 133) is a process performed by the CPU 314 in FIG. In the light ratio generation processing 133, the CPU 314 performs strobe light and ambient light for each subject area based on the strobe irradiation amount by the light emission amount calculation processing 104 and the strobe light emission image 100 and the strobe non-light emission image 102 after the resizing processing 101. The light quantity ratio of (external light) is obtained.

画像合成比率決定処理105(以下、合成比率決定処理105と表記する。)は、図1のCPU314により行われる処理である。CPU314は、合成比率決定処理105において、光比率生成処理133で求められた光量比率に基づいて、ストロボ発光画像100とストロボ非発光画像102を合成する際の、被写体領域毎の合成比率を決定する。   The image composition ratio determination process 105 (hereinafter referred to as composition ratio determination process 105) is a process performed by the CPU 314 in FIG. In the composition ratio determination process 105, the CPU 314 determines a composition ratio for each subject area when the strobe light emission image 100 and the strobe non-light emission image 102 are combined based on the light amount ratio obtained in the light ratio generation process 133. .

第1の色味情報取得処理1201は、図1のCPU314にて行われる処理である。CPU314は、第1の色味情報取得処理1201において、ストロボ発光画像100を取得して、ブロック毎の色平均値R[i],G[i],B[i]を算出し、さらにブロック毎の積分値sumR1,sumG1,sumB1を算出する。なお、以下の説明では、ストロボ発光画像100から算出されたブロック毎の色平均値R[i],G[i],B[i]を、R1[i],G1[i],B1[i]と表記する。第1の色味情報取得処理1201における処理の詳細については後述する。第1の色味情報取得処理1201によるストロボ発光画像100のブロック毎の色平均値R1[i],G1[i],B1[i]と積分値sumR1,sumG1,sumB1は、ストロボ発光画像色味補正処理121に送られる。   The first color information acquisition process 1201 is a process performed by the CPU 314 in FIG. In the first color information acquisition process 1201, the CPU 314 acquires the strobe light emission image 100, calculates the color average values R [i], G [i], B [i] for each block, and further for each block. Are integrated values sumR1, sumG1, and sumB1. In the following description, the color average values R [i], G [i], and B [i] for each block calculated from the strobe light emission image 100 are R1 [i], G1 [i], and B1 [i. ]. Details of the first color information acquisition processing 1201 will be described later. The average color values R1 [i], G1 [i], B1 [i] and integrated values sumR1, sumG1, sumB1 for each block of the strobe light emission image 100 by the first color information acquisition processing 1201 are the strobe light emission image color. It is sent to the correction process 121.

第2の色味情報取得処理1202は、図1のCPU314にて行われる処理である。CPU314は、第2の色味情報取得処理1202において、ストロボ非発光画像102を取得して、ブロック毎の色平均値R[i],G[i],B[i]を算出し、さらにブロック毎の積分値sumR2,sumG2,sumB2を算出する。なお、以下の説明では、ストロボ非発光画像102から算出されたブロック毎の色平均値R[i],G[i],B[i]を、R2[i],G2[i],B2[i]と表記する。第2の色味情報取得処理1202における処理の詳細については後述する。第2の色味情報取得処理1202によるストロボ非発光画像102のブロック毎の色平均値R2[i],G2[i],B2[i]と積分値sumR2,sumG2,sumB2は、ストロボ発光画像色味補正処理121に送られる。   The second color information acquisition process 1202 is a process performed by the CPU 314 in FIG. In the second color information acquisition processing 1202, the CPU 314 acquires the strobe non-light-emitting image 102, calculates the color average values R [i], G [i], and B [i] for each block, and further blocks The integral values sumR2, sumG2, and sumB2 are calculated for each. In the following description, the color average values R [i], G [i], and B [i] for each block calculated from the non-flash image 102 are represented by R2 [i], G2 [i], and B2 [ i]. Details of the processing in the second color information acquisition processing 1202 will be described later. The color average values R2 [i], G2 [i], B2 [i] and the integrated values sumR2, sumG2, sumB2 for each block of the strobe non-light-emitting image 102 obtained by the second color information acquisition processing 1202 are strobe light-emitting image colors. It is sent to the taste correction process 121.

ストロボ発光画像色味補正処理121(以下、色味補正処理121と表記する。)は、図1のCPU314により行われる処理である。CPU314は、色味補正処理121として、第1,第2の色味情報取得処理1201,1202から得られる情報と、発光量情報110と、光比率生成処理133による光量比率とに基づいて、ストロボ発光画像100のブロック毎の色味評価値を算出する。この色味補正処理121によるストロボ発光画像100のブロック毎の色味評価値算出処理の詳細については後述する。色味補正処理121により算出されたストロボ発光画像100の色味評価値は、移動体領域抽出処理123に送られる。   The strobe emission image color correction process 121 (hereinafter referred to as the color correction process 121) is a process performed by the CPU 314 in FIG. The CPU 314 performs strobe correction based on the information obtained from the first and second color information acquisition processes 1201 and 1202, the light emission amount information 110, and the light amount ratio obtained by the light ratio generation process 133 as the color correction process 121. A color evaluation value for each block of the luminescent image 100 is calculated. Details of the hue evaluation value calculation process for each block of the strobe light emission image 100 by the hue correction process 121 will be described later. The color evaluation value of the strobe light emission image 100 calculated by the color correction processing 121 is sent to the moving body region extraction processing 123.

移動体領域抽出処理123は、図1のCPU314にて行われる処理である。CPU314は、移動体領域抽出処理123として、ストロボ発光画像100の撮影がなされた際に移動していた移動被写体の被写体領域(以下、移動体領域と表記する。)を検出する。具体的には、CPU314は、移動体領域抽出処理123において、ストロボ発光画像100の色味評価値とストロボ非発光画像102の色味評価値との差分値を求める。そして、CPU314は、それら色味評価値の差分値に基づいて、ストロボ発光画像100から移動体領域を抽出する。この移動体領域抽出処理123における移動体領域の抽出処理の詳細については後述する。移動体領域抽出処理123により抽出された移動体領域の情報は、移動体領域合成比率補正処理140に送られる。   The moving body region extraction process 123 is a process performed by the CPU 314 in FIG. The CPU 314 detects a subject area (hereinafter referred to as a moving body area) of a moving subject that has moved when the strobe light emission image 100 is captured as the moving body area extraction process 123. Specifically, the CPU 314 obtains a difference value between the tint evaluation value of the strobe light emission image 100 and the tint evaluation value of the strobe non-light emission image 102 in the moving body region extraction processing 123. Then, the CPU 314 extracts a moving body region from the strobe light emission image 100 based on the difference value between the tint evaluation values. Details of the mobile object region extraction process in the mobile object region extraction process 123 will be described later. The information on the mobile body area extracted by the mobile body area extraction process 123 is sent to the mobile body area synthesis ratio correction process 140.

ストロボ外光比率推定処理130(以下、比率推定処理130と表記する。)は、図1のCPU314にて行われる処理である。CPU314は、比率推定処理130において、後述する距離マップとストロボ配光情報とレンズ周辺光量、及び、発光量情報110とに基づいて、被写体領域毎に、ストロボ発光部316のストロボ光と環境光(外光)との割合(光量比率)を算出する。比率推定処理130における被写体領域毎の割合算出処理の詳細については後述する。比率推定処理130による被写体領域毎の割合情報は、移動体領域合成比率補正処理140に送られる。   The strobe light ratio estimation process 130 (hereinafter referred to as the ratio estimation process 130) is a process performed by the CPU 314 in FIG. In the ratio estimation process 130, the CPU 314 performs the strobe light and the ambient light (for the subject area) on the basis of the distance map, strobe light distribution information, the lens peripheral light amount, and the light emission amount information 110 described later. The ratio (light quantity ratio) to external light) is calculated. Details of the ratio calculation process for each subject area in the ratio estimation process 130 will be described later. The ratio information for each subject area obtained by the ratio estimation process 130 is sent to the moving object area synthesis ratio correction process 140.

移動体領域合成比率補正処理140(以下、合成比率補正処理140と表記する。)は、図1のCPU314にて行われる処理である。CPU314は、合成比率補正処理140において、移動体領域抽出処理123にて抽出された移動体領域について、合成比率決定処理105で算出された合成比率を、比率推定処理130による割合とする。合成比率補正処理140における移動体領域についての割合修正処理の詳細については後述する。合成比率補正処理140による補正処理後の合成比率の情報は、リサイズ処理106に送られる。   The moving body region composition ratio correction process 140 (hereinafter referred to as composition ratio correction process 140) is a process performed by the CPU 314 in FIG. In the composition ratio correction process 140, the CPU 314 sets the composition ratio calculated in the composition ratio determination process 105 for the mobile body area extracted in the mobile object area extraction process 123 as the ratio by the ratio estimation process 130. Details of the ratio correction process for the moving object region in the combination ratio correction process 140 will be described later. Information on the composition ratio after the correction processing by the composition ratio correction process 140 is sent to the resizing process 106.

リサイズ処理106は、図1のリサイズ処理部324にて行われる処理である。合成比率補正処理140による補正処理後の合成比率は、EVF画像のサイズに対応した情報となされているため、図1のリサイズ処理部324は、本露光画像100に対応させるようにリサイズする。リサイズ処理106によるリサイズ後の合成比率の情報は、画像合成処理114に送られる。   The resizing process 106 is a process performed by the resizing processing unit 324 in FIG. Since the composition ratio after the correction processing by the composition ratio correction processing 140 is information corresponding to the size of the EVF image, the resizing processing unit 324 in FIG. 1 resizes the information to correspond to the main exposure image 100. Information on the composition ratio after resizing by the resizing processing 106 is sent to the image composition processing 114.

画像合成処理114は、図1の画像合成処理部325により行われる処理である。画像合成処理部325は、画像合成処理114において、第1の現像処理1131後の第1のYUV画像と、第2の現像処理1132後の第2のYUV画像とを、リサイズ処理106後の画像合成比率に基づいて合成して合成YUV画像を生成する。本実施形態の場合、移動体領域についての合成比率は、前述した比率推定処理130で求められた割合に修正されている。したがって、合成YUV画像は、移動体領域では比率推定処理130による割合で第1,第2のYUV画像が合成され、それ以外の被写体領域では画像合成比率決定処理105による合成比率で第1,第2のYUV画像が合成されされた画像となる。この画像合成処理114による画像合成処理後の合成YUV画像の信号は、図1の画像合成処理部325から図1のJPEG圧縮回路310に送られる。   The image composition processing 114 is processing performed by the image composition processing unit 325 in FIG. In the image composition processing 114, the image composition processing unit 325 converts the first YUV image after the first development processing 1131 and the second YUV image after the second development processing 1132 into an image after the resizing processing 106. A composite YUV image is generated by combining based on the composite ratio. In the case of the present embodiment, the composition ratio for the moving body region is corrected to the ratio obtained by the ratio estimation process 130 described above. Therefore, the first and second YUV images are synthesized with the ratio of the ratio estimation process 130 in the moving body area, and the first and first YUV images are synthesized with the synthesis ratio of the image synthesis ratio determination process 105 in the other subject areas. This is a composite image of the two YUV images. The composite YUV image signal after the image composition processing by the image composition processing 114 is sent from the image composition processing unit 325 in FIG. 1 to the JPEG compression circuit 310 in FIG.

図8には、図1のCPU314が、ストロボ発光画像100とストロボ非発光画像102から色味評価値を算出し、それら色味評価値に基づいてストロボ発光画像100から移動体領域を抽出する際の動き領域判定処理のフローチャートを示す。この図8のフローチャートは、図2の第1,第2の色味情報取得処理1201,1202から移動体領域抽出処理123までの処理を示している。   In FIG. 8, when the CPU 314 in FIG. 1 calculates a tint evaluation value from the strobe light emission image 100 and the strobe non-light emission image 102 and extracts a moving body region from the strobe light emission image 100 based on the color evaluation value. The flowchart of a motion area | region determination process is shown. The flowchart of FIG. 8 shows processing from the first and second color information acquisition processing 1201 and 1202 to the moving body region extraction processing 123 of FIG.

図8のステップS501では、CPU314は、図2の第2の色味情報取得処理1202において、ストロボ非発光画像102を取得する。ステップS501の後、CPU314は、ステップS502に処理を進める。   In step S501 of FIG. 8, the CPU 314 acquires the strobe non-light emitting image 102 in the second color information acquisition process 1202 of FIG. After step S501, the CPU 314 advances the process to step S502.

ステップS502の処理は、図2の第2の色味情報取得処理1202と色味補正処理121に含まれる。ステップS502の第2の色味情報取得処理1202において、CPU314は、ステップS501で取得したストロボ非発光画像102から、前述したようなブロック毎の色平均値R2[i],G2[i],B2[i]を算出する。さらに、第2の色味情報取得処理1202において、CPU314は、ブロック毎の色平均値R2[i],G2[i],B2[i]を用いて、前述の式(2)と同様の演算によりブロック毎の積分値sumR2,sumG2,sumB2を算出する。また、ステップS502の色味補正処理121において、CPU314は、式(4)により、ストロボ非発光画像102におけるブロック毎の輝度値b[i]を算出する。   The process of step S502 is included in the second color information acquisition process 1202 and the color correction process 121 of FIG. In the second tint information acquisition process 1202 in step S502, the CPU 314 determines the color average values R2 [i], G2 [i], B2 for each block as described above from the strobe non-light emitting image 102 acquired in step S501. [i] is calculated. Further, in the second color information acquisition process 1202, the CPU 314 uses the color average values R2 [i], G2 [i], and B2 [i] for each block to perform the same calculation as the above-described equation (2). Thus, the integral values sumR2, sumG2, and sumB2 for each block are calculated. Further, in the tint correction processing 121 in step S502, the CPU 314 calculates the luminance value b [i] for each block in the strobe non-light-emitting image 102 by the equation (4).

b[i]=0.3*R2[i]+0.6*G2[i]+0.1*B2[i] ・・・式(4)   b [i] = 0.3 * R2 [i] + 0.6 * G2 [i] + 0.1 * B2 [i] (4)

ステップS502の後、CPU314は、ステップS503に処理を進める。ステップS503の処理は、図2の第1の色味情報取得処理1201に含まれる。ステップS503の第1の色味情報取得処理1201において、CPU314は、ストロボ発光画像100を取得する。ステップS503の後、CPU314は、ステップS504に処理を進める。   After step S502, the CPU 314 advances the process to step S503. The process of step S503 is included in the first color information acquisition process 1201 in FIG. In the first color information acquisition process 1201 in step S503, the CPU 314 acquires the strobe light emission image 100. After step S503, the CPU 314 advances the process to step S504.

ステップS504の処理は、図2の第1の色味情報取得処理1201に含まれる。ステップS504の色味情報取得処理1201において、CPU314は、発光量情報110からストロボの色温度情報を取得する。なお、ストロボの色温度は、ストロボ発光部316が例えばキセノン管を有する場合、キセノン管の発光特性としての色温度と発光時間などの関係から決まるため、そのストロボ色温度情報も発光量情報110より算出できる。ステップS504の後、CPU314は、ステップS505に処理を進める。   The process of step S504 is included in the first color information acquisition process 1201 in FIG. In the color information acquisition process 1201 in step S <b> 504, the CPU 314 acquires the color temperature information of the strobe from the light emission amount information 110. The color temperature of the strobe is determined from the relationship between the color temperature and the light emission time as the light emission characteristic of the xenon tube when the strobe light emitting unit 316 has, for example, a xenon tube. It can be calculated. After step S504, the CPU 314 advances the process to step S505.

ステップS505の処理は、図2の第2の色味情報取得処理1202と色味補正処理121に含まれる。ステップS505の第1の色味情報取得処理1201において、CPU314は、ステップS503で取得したストロボ発光画像100からブロック毎の色平均値R1[i],G1[i],B1[i]を算出する。さらに、CPU314は、ストロボ発光画像100のブロック毎の色平均値R1[i],G1[i],B1[i]を用い、前述の式(2)と同様の演算によりブロック毎の積分値sumR1,sumG1,sumB1を算出する。また、ステップS505の色味補正処理121において、CPU314は、式(5)により、ストロボ発光画像100におけるブロック毎の輝度値a[i]を算出する。   The process of step S505 is included in the second color information acquisition process 1202 and the color correction process 121 in FIG. In the first color information acquisition process 1201 in step S505, the CPU 314 calculates the color average values R1 [i], G1 [i], and B1 [i] for each block from the strobe light emission image 100 acquired in step S503. . Further, the CPU 314 uses the color average values R1 [i], G1 [i], and B1 [i] for each block of the strobe light emission image 100, and calculates the integral value sumR1 for each block by the same calculation as the above-described equation (2). , SumG1, sumB1 are calculated. In the tint correction process 121 in step S505, the CPU 314 calculates the luminance value a [i] for each block in the strobe light emission image 100 using Expression (5).

a[i]=0.3*R1[i]+0.6*G1[i]+0.1*B1[i] ・・・式(5)   a [i] = 0.3 * R1 [i] + 0.6 * G1 [i] + 0.1 * B1 [i] (5)

ステップS505の後、CPU314は、ステップS506に処理を進める。ステップS506の処理は、図2の色味補正処理121に含まれる。ステップS506の色味補正処理121において、CPU314は、ブロック毎のストロボ光の照射量を推定する。具体的には、CPU314は、式(6)により、ステップS502で取得したストロボ非発光画像102のブロック毎の輝度値b[i]と、ステップS505で算出したストロボ発光画像100のブロック毎の輝度値a[i]との差分c[i]を求める。これら輝度値b[i]と輝度値a[i]の差分c[i]が、推定されたストロボ光の照射量となる。   After step S505, the CPU 314 advances the process to step S506. The process of step S506 is included in the color correction process 121 of FIG. In the tint correction processing 121 in step S506, the CPU 314 estimates the amount of strobe light irradiation for each block. Specifically, the CPU 314 calculates the luminance value b [i] for each block of the strobe non-light-emitting image 102 acquired in step S502 and the luminance for each block of the strobe light-emitting image 100 calculated in step S505 according to equation (6). The difference c [i] from the value a [i] is obtained. The difference c [i] between the luminance value b [i] and the luminance value a [i] is the estimated strobe light irradiation amount.

c[i]=a[i]−b[i] ・・・式(6)   c [i] = a [i] −b [i] (6)

なお、ストロボ発光画像100とストロボ非発光画像102との間で、シャッタースピードや絞り値、ISO感度設定などの露光量や感度設定が異なる場合は、ストロボ非発光画像102の輝度成分b[i]に対してその露光差分を補正する。これにより、ストロボ成分の露光量の算出が可能となる。ステップS506の後、CPU314は、ステップS507に処理を進める。   When the exposure amount and sensitivity setting such as the shutter speed, aperture value, and ISO sensitivity setting are different between the strobe light emission image 100 and the strobe non-light emission image 102, the luminance component b [i] of the strobe non-light emission image 102 is different. The exposure difference is corrected. As a result, the exposure amount of the strobe component can be calculated. After step S506, the CPU 314 advances the process to step S507.

ステップS507の処理は、図2の色味補正処理121に含まれる。ステップS507の色味補正処理121において、CPU314は、ステップS502,S505のブロック毎の積分値とステップS506のストロボ照射量とステップS504のストロボ色温度情報とに基づいて、ストロボ発光画像100の色評価値を算出する。   The process of step S507 is included in the color correction process 121 of FIG. In the tint correction processing 121 in step S507, the CPU 314 evaluates the color of the strobe image 100 based on the integrated value for each block in steps S502 and S505, the strobe irradiation amount in step S506, and the strobe color temperature information in step S504. Calculate the value.

ステップS507の図2の色味補正処理121において、CPU314は、ストロボ非発光画像102の色評価値を求める。具体的には、CPU314は、ステップS502によるブロック毎の積分値sumR2,sumG2,sumB2を用い、前述の式(3)と同様の演算でWB係数WB_R_evf[i],WB_G_evf[i],WB_B_evf[i]を算出する。なお、WB_R_evf[i]はR(赤)のWB係数であり、WB_G_evf[i]はG(緑)のWB係数、WB_B_evf[i]はB(青)のWB係数である。そして、色味補正処理121において、CPU314は、下記の式(7)と式(8)により、ストロボ非発光画像102におけるブロック毎の色味評価値WCx_evf[i],WCy_evf[i]を算出する。   In the color tone correction process 121 of FIG. 2 in step S507, the CPU 314 obtains the color evaluation value of the strobe non-light emitting image 102. Specifically, the CPU 314 uses the integrated values sumR2, sumG2, and sumB2 for each block in step S502, and performs the same calculation as in the above equation (3), using the WB coefficients WB_R_evf [i], WB_G_evf [i], WB_B_evf [i ] Is calculated. WB_R_evf [i] is an R (red) WB coefficient, WB_G_evf [i] is a G (green) WB coefficient, and WB_B_evf [i] is a B (blue) WB coefficient. Then, in the tint correction process 121, the CPU 314 calculates the tint evaluation values WCx_evf [i] and WCy_evf [i] for each block in the strobe non-light-emitting image 102 by the following formulas (7) and (8). .

R2'[i]=WB_R_evf[i]×R2[i]
G2'[i]=WB_G_evf[i]×G2[i] ・・・式(7)
B2'[i]=WB_B_evf[i]×B2[i]
R2 ′ [i] = WB_R_evf [i] × R2 [i]
G2 ′ [i] = WB_G_evf [i] × G2 [i] (7)
B2 ′ [i] = WB_B_evf [i] × B2 [i]

WCx_evf[i]=(R2'[i]−B2'[i])/Y2'[i]×1024
WCy_evf[i]=(R2'[i]+B2'[i]−2G2'[i])/Y2'[i]×1024
ただし、Y2'[i]=(R2'[i]+2G2'[i]+B2'[i])/4 ・・・式(8)
WCx_evf [i] = (R2 ′ [i] −B2 ′ [i]) / Y2 ′ [i] × 1024
WCy_evf [i] = (R2 ′ [i] + B2 ′ [i] −2G2 ′ [i]) / Y2 ′ [i] × 1024
However, Y2 ′ [i] = (R2 ′ [i] + 2G2 ′ [i] + B2 ′ [i]) / 4 (8)

また、ステップS507の色味補正処理121において、CPU314は、ストロボ発光画像100の色評価値を求める。CPU314は、ステップS505によるブロック毎の積分値sumR1,sumG1,sumB1を用いて、前述の式(3)と同様の演算でWB係数WB_R_flash[i],WB_G_flash[i],WB_B_flash[i]を算出する。なお、WB_R_flash[i]はR(赤)のWB係数であり、WB_G_flash[i]はG(緑)のWB係数、WB_B_flash[i]はB(青)のWB係数である。ただし、ストロボ発光画像100の場合、前述の式(4)ではR2[i],G2[i],B2[i]に代えてR1[i],G1[i],B1[i]が用いられる。また、式(4)では、WB_R_evf[i],WB_G_evf[i],WB_B_evf[i]に代えてWB_R_flash[i],WB_G_flash[i],WB_B_flash[i]が用いられる。また、式(4)では、R2'[i],G2'[i],B2'[i]に代えてR1'[i],G1'[i],B1'[i]が用いられる。   In the color correction processing 121 in step S507, the CPU 314 obtains the color evaluation value of the strobe light emission image 100. The CPU 314 calculates the WB coefficients WB_R_flash [i], WB_G_flash [i], and WB_B_flash [i] using the integration values sumR1, sumG1, and sumB1 for each block in step S505, by the same calculation as the above-described equation (3). . WB_R_flash [i] is an R (red) WB coefficient, WB_G_flash [i] is a G (green) WB coefficient, and WB_B_flash [i] is a B (blue) WB coefficient. However, in the case of the strobe light emission image 100, R1 [i], G1 [i], and B1 [i] are used in place of R2 [i], G2 [i], and B2 [i] in the above equation (4). . In Expression (4), WB_R_flash [i], WB_G_flash [i], and WB_B_flash [i] are used instead of WB_R_evf [i], WB_G_evf [i], and WB_B_evf [i]. In the formula (4), R1 ′ [i], G1 ′ [i], and B1 ′ [i] are used instead of R2 ′ [i], G2 ′ [i], and B2 ′ [i].

また、ストロボ発光画像100の色評価値を求める場合、ステップS507の色味補正処理121において、CPU314は、WB係数WB_R_flash[i],WB_G_flash[i],WB_B_flash[i]を補正する。具体的には、CPU314は、ストロボ非発光画像102から算出されたWB係数WB_R_evf[i],WB_G_evf[i],WB_B_evf[i]と、被写体領域毎のストロボ照射量と、ストロボ色温度情報とに応じた補正処理を行う。ここで、WB係数WB_R_flash[i],WB_G_flash[i],WB_B_flash[i]を補正する際の補正値は、環境光(外光)とストロボ光の比率に応じた可変の値として求められる。具体的には、CPU314は、式(9)により求められる輝度成分合成比率α[i]を、WB係数の補正値とする。   When obtaining the color evaluation value of the strobe light emission image 100, the CPU 314 corrects the WB coefficients WB_R_flash [i], WB_G_flash [i], and WB_B_flash [i] in the tint correction processing 121 in step S507. Specifically, the CPU 314 uses the WB coefficients WB_R_evf [i], WB_G_evf [i], WB_B_evf [i] calculated from the non-flash image 102, the stroboscopic irradiation amount for each subject area, and the strobo color temperature information. The corresponding correction process is performed. Here, the correction value for correcting the WB coefficients WB_R_flash [i], WB_G_flash [i], and WB_B_flash [i] is obtained as a variable value according to the ratio between the ambient light (external light) and the strobe light. Specifically, the CPU 314 sets the luminance component synthesis ratio α [i] obtained by Expression (9) as the correction value for the WB coefficient.

α[i]=c[i]/(a[i]+c[i]) ・・・式(9)   α [i] = c [i] / (a [i] + c [i]) (9)

また、CPU314は、ステップS502,S505による各WB係数と輝度成分合成比率α[i]を用いて環境光とストロボ光の比率に応じたWB係数WB_R_cap[i],WB_G_cap[i],WB_B_cap[i]を算出する。このWB係数WB_R_cap[i],WB_G_cap[i],WB_B_cap[i]の計算式は式(10)により表される。このWB係数WB_R_cap[i],WB_G_cap[i],WB_B_cap[i]が、ストロボ発光画像100における補正後のWB係数である。   In addition, the CPU 314 uses the WB coefficients and the luminance component synthesis ratio α [i] in steps S502 and S505, and uses the WB coefficients WB_R_cap [i], WB_G_cap [i], and WB_B_cap [i] according to the ratio of the ambient light to the strobe light. ] Is calculated. Formulas for calculating the WB coefficients WB_R_cap [i], WB_G_cap [i], and WB_B_cap [i] are expressed by Expression (10). The WB coefficients WB_R_cap [i], WB_G_cap [i], and WB_B_cap [i] are corrected WB coefficients in the strobe light emission image 100.

WB_R_cap[i]=WB_R_evf[i]×(1−α[i])+WB_R_flash[i]×α[i]
WB_G_cap[i]=WB_G_evf[i]×(1−α[i])+WB_G_flash[i]×α[i]
WB_B_cap[i]=WB_B_evf[i]×(1−α[i])+WB_B_flash[i]×α[i]
・・・式(10)
WB_R_cap [i] = WB_R_evf [i] × (1−α [i]) + WB_R_flash [i] × α [i]
WB_G_cap [i] = WB_G_evf [i] × (1−α [i]) + WB_G_flash [i] × α [i]
WB_B_cap [i] = WB_B_evf [i] × (1−α [i]) + WB_B_flash [i] × α [i]
... Formula (10)

また、CPU314は、WB係数WB_R_cap[i],WB_G_cap[i],WB_B_cap[i]をストロボ発光画像100の色平均値R1[i],G1[i],B1[i]に乗算し、R1"[i],G1"[i],B1"[i]を求める。これらR1"[i],G1"[i],B1"[i]の計算式は、式(11)により表される。   Further, the CPU 314 multiplies the WB coefficients WB_R_cap [i], WB_G_cap [i], and WB_B_cap [i] by the color average values R1 [i], G1 [i], and B1 [i] of the strobe light emission image 100 to obtain R1 ". [i], G1 "[i], B1" [i] are obtained. The calculation formula of these R1 "[i], G1" [i], B1 "[i] is expressed by the following equation (11).

R1"[i]=WB_R_cap[i]×R1[i]
G1"[i]=WB_G_cap[i]×G1[i] ・・・式(11)
B1"[i]=WB_B_cap[i]×B1[i]
R1 "[i] = WB_R_cap [i] × R1 [i]
G1 "[i] = WB_G_cap [i] × G1 [i] (11)
B1 "[i] = WB_B_cap [i] × B1 [i]

そして、CPU314は、式(12)の演算により、ストロボ発光画像100における色味評価値WCx_cap[i],WCy_cap[i]を求める。   Then, the CPU 314 obtains the tint evaluation values WCx_cap [i] and WCy_cap [i] in the strobe light emission image 100 by the calculation of Expression (12).

WCx_cap[i]=(R1"[i]−B1"[i])/Y1"[i]×1024
WCy_cap[i]=(R1"[i]+B1"[i]−2G1"[i])/Y1"[i]×1024
ただし、Y1"[i]=(R1"[i]+2G1"[i]+B1"[i])/4 ・・・式(12)
WCx_cap [i] = (R1 "[i] -B1" [i]) / Y1 "[i] * 1024
WCy_cap [i] = (R1 "[i] + B1" [i] -2G1 "[i]) / Y1" [i] × 1024
However, Y1 "[i] = (R1" [i] + 2G1 "[i] + B1" [i]) / 4 ... Formula (12)

ステップS507の後、CPU314は、ステップS508に処理を進める。ステップS508の処理は、図2の移動体領域抽出処理123に含まれる。具体的には、CPU314は、ストロボ発光画像100の色味評価値WCx_cap[i],WCy_cap[i]とストロボ非発光画像102の色味評価値WCx_evf[i],WCy_evf[i]の差分絶対値ΔWCx,ΔWCyを求める。さらに、CPU314は、それらブロック毎の差分絶対値の合計値を差分色味評価値ΔWCxWCyとして求める。ステップS507におけるブロック毎の差分絶対値ΔWCx,ΔWCyと差分色味評価値ΔWCxCyの演算は式(13)により表すことができる。   After step S507, the CPU 314 advances the process to step S508. The process of step S508 is included in the moving body region extraction process 123 of FIG. Specifically, the CPU 314 calculates the absolute difference between the tint evaluation values WCx_cap [i] and WCy_cap [i] of the strobe light emission image 100 and the tint evaluation values WCx_evf [i] and WCy_evf [i] of the strobe non-light emission image 102. ΔWCx and ΔWCy are obtained. Further, the CPU 314 obtains the total difference absolute value for each block as the difference color evaluation value ΔWCxWCy. The calculation of the difference absolute values ΔWCx, ΔWCy and the difference color evaluation value ΔWCxCy for each block in step S507 can be expressed by Expression (13).

ΔWCx=|WCx_cap[i]−WCx_evf[i]|
ΔWCy=|WCy_cap[i]−WCy_evf[i]| ・・・式(13)
ΔWCxCy=ΔWCx+ΔWCy
ΔWCx = | WCx_cap [i] −WCx_evf [i] |
ΔWCy = | WCy_cap [i] −WCy_evf [i] | Expression (13)
ΔWCxCy = ΔWCx + ΔWCy

ステップS508の後、CPU314は、ステップS509に処理を進める。ステップS509の処理は、図2の移動体領域抽出処理123に含まれる。ステップS508の移動体領域抽出処理123において、CPU314は、図2の移動体領域抽出処理123の中の動き判定処理として、ステップS508でブロック毎に算出された差分色味評価値ΔWCxCyから動き判定を行う。   After step S508, the CPU 314 advances the process to step S509. The process of step S509 is included in the moving body region extraction process 123 of FIG. In the moving body region extraction process 123 of step S508, the CPU 314 performs a motion determination from the difference color evaluation value ΔWCxCy calculated for each block in step S508 as a motion determination process in the moving body region extraction process 123 of FIG. Do.

図9には、ブロック毎の差分色味評価値ΔWCxCyから動き判定が行われる例を示す。図9の各四角はそれぞれブロックに相当し、それら各四角の中の数字はそれぞれ各ブロックの差分色味評価値ΔWCxCyの具体的な数値を表している。この図9に示すように、CPU314は、差分色味評価値ΔWCxCyの値に対して閾値を用いた動き判定を行う。図9は、閾値として「50」の値が設定されている場合に、差分色味評価値ΔWCxCyの値が「50」以上となっている太枠の各ブロックが、移動被写体の被写体領域の各ブロックと判定される例を挙げている。   FIG. 9 shows an example in which motion determination is performed from the difference color evaluation value ΔWCxCy for each block. Each square in FIG. 9 corresponds to a block, and the number in each square represents a specific numerical value of the difference color evaluation value ΔWCxCy of each block. As illustrated in FIG. 9, the CPU 314 performs a motion determination using a threshold value on the difference color evaluation value ΔWCxCy. In FIG. 9, when a value of “50” is set as the threshold value, each block with a thick frame in which the value of the difference color evaluation value ΔWCxCy is “50” or more is represented by each of the subject areas of the moving subject. An example of determining a block is given.

前述したようにストロボの照射量算出は、ストロボ発光画像100とストロボ非発光画像102の差分輝度値から算出されており、例えば被写体が動いていない画像領域においてはストロボ照射量が適正に算出される。したがって、被写体に動きがなくストロボの照射量の算出が成功していれば、WB係数も適正な値が算出されることになり、色味評価値についても正しい値が算出可能となる。一方で、被写体が動いたた場合などは、誤ったストロボ照射量を算出する可能性があり、また、WB係数も正しく算出できなくなって、結果として色味評価値も誤った値が算出されることになる。したがって、本実施形態では、色味評価値の差分絶対値を用いることで、被写体の移動の有無の判定が可能になっている。   As described above, the strobe irradiation amount is calculated from the difference luminance value between the strobe light emission image 100 and the strobe non-light emission image 102. For example, in the image area where the subject is not moving, the strobe irradiation amount is appropriately calculated. . Therefore, if the subject does not move and the calculation of the strobe irradiation amount is successful, an appropriate value is also calculated for the WB coefficient, and a correct value can also be calculated for the tint evaluation value. On the other hand, when the subject moves, there is a possibility of calculating an incorrect strobe exposure amount, and the WB coefficient cannot be calculated correctly. As a result, the color evaluation value is also calculated incorrectly. It will be. Therefore, in this embodiment, it is possible to determine whether or not the subject has moved by using the absolute difference value of the color evaluation value.

なお、本実施形態では、差分色味評価値ΔWCxCyに対する閾値を一定値としているが、ストロボ非発光画像102の色味評価値WCx_evf[i],WCy_evf[i]に応じて閾値を可変にしてもよい。つまり、差分色味評価値ΔWCxCyは、被写体の色味やストロボ非発光時の撮影環境である色温度によって色毎に敏感度が異なるためであり、色毎に敏感度を変化させることで、動き領域の判定の精度を向上させることができる。   In the present embodiment, the threshold value for the difference color evaluation value ΔWCxCy is set to a constant value. However, even if the threshold value is made variable according to the color evaluation values WCx_evf [i] and WCy_evf [i] of the strobe non-emission image 102. Good. That is, the difference color evaluation value ΔWCxCy varies depending on the color depending on the color of the subject and the color temperature that is the shooting environment when the strobe is not lit. The accuracy of region determination can be improved.

また、被写体領域の動き領域判定に用いた差分色味評価値ΔWCxCyは、前述したようにストロボ光の色温度に応じたWB係数が掛けられているが、色味成分の補正までは行われていない。この場合、例えば色味がグレーの画像領域に対しては、正確に色味成分を算出可能であるものの、有彩色に対しては若干の誤差を有する可能性がある。例えば、低色温度光源であれば、赤みのある被写体や、高色温度光源下の青みのある被写体などは、それらの色味が強く発色する傾向がある。これら色温度毎の発色性の差分の誤差を減らすために、ストロボ非発光画像102における環境光の色温度やWB係数に応じた色味補正、被写体の色味毎の補正を行うことで、精度を向上させることが可能である。例えば、ストロボ非発光画像102とストロボ発光画像100の両方の色評価値に対して、色温度や適用されたWB係数毎に、色評価値WCx,WCyの補正ゲインを予め算出等しておくことで実現可能である。式(14)には、色評価値WCx,WCyをWB係数や色温度に応じて補正した色評価値WCx',WCy'を求める演算式を示す。ただし、式(14)のa,b,c,dは、色温度毎に算出される補正係数である。   Further, as described above, the difference color evaluation value ΔWCxCy used for determining the movement area of the subject area is multiplied by the WB coefficient corresponding to the color temperature of the strobe light, but the correction of the color component has not been performed. Absent. In this case, for example, a color component can be accurately calculated for an image region with a gray color, but there may be some error for a chromatic color. For example, in the case of a low color temperature light source, a reddish subject or a bluish subject under a high color temperature light source tends to develop a strong color. In order to reduce an error in the difference in color developability for each color temperature, the color correction according to the color temperature of the ambient light and the WB coefficient in the non-flash image 102, and the correction for each color of the subject are performed. It is possible to improve. For example, the correction gains of the color evaluation values WCx and WCy are calculated in advance for each of the color temperature and the applied WB coefficient for the color evaluation values of both the non-flash image 102 and the flash image 100. It is feasible. Expression (14) shows an arithmetic expression for obtaining the color evaluation values WCx ′ and WCy ′ obtained by correcting the color evaluation values WCx and WCy according to the WB coefficient and the color temperature. However, a, b, c, and d in Equation (14) are correction coefficients calculated for each color temperature.

Figure 2017034536
Figure 2017034536

補正係数a,b,c,dの値は、例えば色チャートを色温度毎に撮影して色毎に色評価値WCx,WCyを算出し、例えば色温度が5000Kのときの色評価値WCx,WCyを基準とし、各色温度で色評価値概略同じ値になるような係数として予め求めておく。もちろん、算出した係数は、色温度毎に線形補間等を行うことで、取得された色温度以外の中間色温度についても求めることが可能であることはいうまでもない。このような色味変換処理は、色温度毎の色味の差分を吸収させる色再現マトリックスと同様の効果を有し、これらの処理により色温度毎の色味の差分を吸収させることにより動き被写体の検出を精度よく行うことが可能になる。   The correction coefficients a, b, c, and d are obtained by, for example, photographing a color chart for each color temperature and calculating the color evaluation values WCx and WCy for each color. For example, the color evaluation values WCx, WCx, Using WCy as a reference, the color evaluation value is determined in advance as a coefficient that is approximately the same value at each color temperature. Of course, the calculated coefficient can be obtained for intermediate color temperatures other than the acquired color temperature by performing linear interpolation or the like for each color temperature. Such a color conversion process has the same effect as a color reproduction matrix that absorbs a color difference for each color temperature, and a moving subject is obtained by absorbing the color difference for each color temperature by these processes. Can be accurately detected.

図10には、図1の画像合成処理部325にて行われる図2の画像合成処理114の詳細なフローチャートを示す。図10のステップS201では、画像合成処理部325は、第1のWB補正値を用いてWB補正処理がなされた後のストロボ発光画像100が図2の第1の現像処理1131にて現像された第1のYUV画像を取得する。ここで取得される第1のYUV画像は、前述した色評価値Y1[i],u1[i],v1[i]で表される。ステップS201の後、画像合成処理部325は、ステップS202に処理を進める。   FIG. 10 shows a detailed flowchart of the image composition processing 114 of FIG. 2 performed by the image composition processing unit 325 of FIG. In step S201 in FIG. 10, the image composition processing unit 325 has developed the strobe light emission image 100 after the WB correction processing is performed using the first WB correction value in the first development processing 1131 in FIG. A first YUV image is acquired. The first YUV image acquired here is represented by the color evaluation values Y1 [i], u1 [i], and v1 [i] described above. After step S201, the image composition processing unit 325 advances the process to step S202.

ステップS202では、画像合成処理部325は、第2のWB補正値を用いてWB補正処理がなされた後のストロボ発光画像100が図2の第2の現像処理1132にて現像された第2のYUV画像を取得する。ここで取得される第2のYUV画像は、前述した色評価値Y2[i],u2[i],v2[i]で表される。ステップS202の後、画像合成処理部325は、ステップS203に処理を進める。   In step S202, the image composition processing unit 325 performs the second development processing 1132 in FIG. 2 to develop the second strobe image 100 after the WB correction processing is performed using the second WB correction value. A YUV image is acquired. The second YUV image acquired here is represented by the color evaluation values Y2 [i], u2 [i], and v2 [i] described above. After step S202, the image composition processing unit 325 advances the process to step S203.

ステップS203では、画像合成処理部325は、第1のYUV画像と第2のYUV画像をそれぞれ前述同様にブロック分割する。ステップS203の後、画像合成処理部325は、ステップS204に処理を進める。ステップS204では、画像合成処理部325は、前述の式(9)により算出される輝度成分合成比率α[i]を、画像合成比率α[i]として取得する。ステップS204の後、画像合成処理部325は、ステップS205に処理を進める。   In step S203, the image composition processing unit 325 divides the first YUV image and the second YUV image into blocks as described above. After step S203, the image composition processing unit 325 advances the processing to step S204. In step S204, the image composition processing unit 325 acquires the luminance component composition ratio α [i] calculated by the above-described equation (9) as the image composition ratio α [i]. After step S204, the image composition processing unit 325 advances the processing to step S205.

ステップS205では、画像合成処理部325は、ステップS204で取得した画像合成比率α[i]を用いた式(15)の演算により、ステップS201で取得した第1のYUV画像と、ステップS202で取得した第2のYUV画像とを、ブロック毎に合成する。第1のYUV画像と第2のYUV画像を合成した合成YUV画像は、色評価値Y3[i],u3[i],v3[i]で表される。   In step S205, the image composition processing unit 325 obtains the first YUV image obtained in step S201 and the first YUV image obtained in step S202 by the calculation of Expression (15) using the image composition ratio α [i] obtained in step S204. The second YUV image is combined for each block. A composite YUV image obtained by combining the first YUV image and the second YUV image is represented by color evaluation values Y3 [i], u3 [i], and v3 [i].

Y3[i]=Y1[i]*α[i]+Y2[i]*(1−α[i])
u3[i]=u1[i]*α[i]+u2[i]*(1−α[i]) ・・・式(15)
v3[i]=v1[i]*α[i]+v2[i]*(1−α[i])
Y3 [i] = Y1 [i] * α [i] + Y2 [i] * (1−α [i])
u3 [i] = u1 [i] * α [i] + u2 [i] * (1−α [i]) (15)
v3 [i] = v1 [i] * α [i] + v2 [i] * (1−α [i])

また、ブロックの境界部分の色味ずれを緩和するため、ステップS205において、画像合成処理部325は、画素補間処理を行うことにより、ブロック毎の画像合成比率α[i]から画素毎の画像合成比率率α'[j]を算出してもよい。なお、α'[j]の[j]はj番目の画素であることを表している。画素補間処理としては例えばバイリニア補間処理を用いることができ、画像合成処理部325は、バイリニア補間処理によりブロック毎の画像合成比率α[i]から画素毎の画像合成比率α'[j]を算出する。この例の場合、ステップS205において、画像合成処理部325は、式(16)の演算により、画素毎の画像合成比率α'[j]を用いて、第1のYUV画像と第2のYUV画像を合成して合成YUV画像を生成する。なお、画素毎に画像合成がなされる場合の第1のYUV画像は、画素毎の色評価値Y1[j],u1[j],v1[j]で表され、第2のYUV画像は、画素毎の色評価値Y2[j],u2[j],v2[j]で表される。また、合成YUV画像は、画素毎の色評価値Y3[j],u3[j],v3[j]で表される。   Further, in order to alleviate the color shift at the boundary portion of the block, in step S205, the image composition processing unit 325 performs pixel interpolation processing, thereby performing image composition for each pixel from the image composition ratio α [i] for each block. The ratio rate α ′ [j] may be calculated. Note that [j] of α ′ [j] represents the j-th pixel. For example, bilinear interpolation processing can be used as the pixel interpolation processing, and the image composition processing unit 325 calculates the image composition ratio α ′ [j] for each pixel from the image composition ratio α [i] for each block by the bilinear interpolation processing. To do. In this example, in step S205, the image composition processing unit 325 uses the image composition ratio α ′ [j] for each pixel to calculate the first YUV image and the second YUV image by the calculation of Expression (16). Are combined to generate a composite YUV image. Note that the first YUV image when image synthesis is performed for each pixel is represented by color evaluation values Y1 [j], u1 [j], and v1 [j] for each pixel, and the second YUV image is It is represented by color evaluation values Y2 [j], u2 [j], and v2 [j] for each pixel. The composite YUV image is represented by color evaluation values Y3 [j], u3 [j], and v3 [j] for each pixel.

Y3[j]=Y1[j]*α'[j]+Y2[j]*(1−α'[j])
u3[j]=u1[j]*α'[j]+u2[j]*(1−α'[j]) ・・・式(16)
v3[j]=v1[j]*α'[j]+v2[j]*(1−α'[j])
Y3 [j] = Y1 [j] * α ′ [j] + Y2 [j] * (1−α ′ [j])
u3 [j] = u1 [j] * α ′ [j] + u2 [j] * (1−α ′ [j]) (16)
v3 [j] = v1 [j] * α ′ [j] + v2 [j] * (1−α ′ [j])

図11は、図2の比率推定処理130における距離マップとストロボ配光情報とレンズ周辺光量と発光量情報110とに基づいて、ストロボ発光部316のストロボ量と環境光(外光)との割合を算出する処理フローを示す。本実施形態の場合、CPU314による比率推定処理130が割合の算出手段に相当する。この図11は、図2の光比率推定処理130に含まれる各処理を詳細に示した図である。図11のストロボ発光画像100と移動体領域合成比率補正処理140の説明は省略する。   11 shows the ratio between the strobe amount of the strobe light emitting unit 316 and the ambient light (external light) based on the distance map, the strobe light distribution information, the lens peripheral light amount, and the light emission amount information 110 in the ratio estimation process 130 of FIG. The processing flow which calculates is shown. In the present embodiment, the ratio estimation process 130 by the CPU 314 corresponds to a ratio calculation unit. FIG. 11 is a diagram showing in detail each process included in the light ratio estimation process 130 of FIG. Description of the strobe light emission image 100 and the moving body region composition ratio correction processing 140 in FIG. 11 is omitted.

図11及び図2のストロボ配光レンズ周辺光量137は、ストロボ配光情報とレンズ周辺光量データを含む。ストロボ配光情報は、ストロボ発光時の配光量を予め測定をしておくことで算出されたストロボ配光特性を表す情報である。具体的には、予め暗中において反射率18%のグレーカード面に対して適正距離から正対させてストロボ発光を行い、鏡筒部315のズームレンズを広角端として撮影した撮影画像についてレンズ周辺光量落ち量を補正することで算出される配光量情報である。   The strobe light distribution lens peripheral light amount 137 of FIGS. 11 and 2 includes strobe light distribution information and lens peripheral light amount data. The strobe light distribution information is information representing strobe light distribution characteristics calculated by measuring in advance the light distribution during strobe light emission. Specifically, the amount of light around the lens of a photographed image obtained by performing strobe light emission from an appropriate distance with respect to a gray card surface having a reflectance of 18% in the dark in advance and taking the zoom lens of the lens barrel 315 as the wide-angle end. This is light distribution information calculated by correcting the drop amount.

なお、ストロボ配光情報の算出の際には、撮影距離を可変にして撮影距離毎に配光情報を取得しておくことにより、ストロボとレンズの光軸のずれ量を吸収させることも可能である。また、別の方法としては、ストロボの取り付け位置とストロボの反射板やフレネルレンズ形状から周辺への照射光強度分布を算出しておき、レンズの焦点距離からストロボの配光分布を算出することも可能である。そして、レンズの焦点距離に応じた配光情報を求めることで、焦点距離が変化した時のストロボ配光を算出可能である。例えば、ズームレンズの焦点距離が広角端から2倍の焦点距離であれば、予め測定された広角端のストロボ配光分布における水平・垂直で中央から50%の範囲の領域を配光領域としてもよい。レンズ周辺光量落ち量についても、ズームポジションや絞り値毎に周辺光量落ち量の測定をしておいてもよいし、レンズの設計情報及び撮像素子301の周辺入射光量特性から光学設計値に基づいて算出されてもよい。   When calculating the strobe light distribution information, the amount of deviation between the strobe and the optical axis of the lens can be absorbed by varying the shooting distance and acquiring the light distribution information for each shooting distance. is there. Another method is to calculate the light intensity distribution to the periphery from the strobe mounting position and the strobe reflector or Fresnel lens shape, and then calculate the strobe light distribution from the focal length of the lens. Is possible. Then, by obtaining light distribution information according to the focal length of the lens, it is possible to calculate the strobe light distribution when the focal length changes. For example, if the focal length of the zoom lens is double the focal length from the wide-angle end, a horizontal and vertical range of 50% from the center in the strobe light distribution at the wide-angle end measured in advance may be used as the light distribution region. Good. As for the lens peripheral light amount drop amount, the peripheral light amount drop amount may be measured for each zoom position or aperture value, or based on the optical design value based on the lens design information and the peripheral incident light amount characteristic of the image sensor 301. It may be calculated.

図11の距離マップ生成処理131は、例えば図1のCPU314により行われる処理である。CPU314は、距離マップ生成処理131において、撮像素子301の焦点検出用画素の出力信号の相関演算により生成された位相差に対して、その位相差を焦点ずれ量に変換する変換係数を掛けることにより焦点ずれ量を演算する。そして、CPU314は、撮像素子301の全ての焦点検出用画素に各々対応した各焦点ズレ量から、撮像素子301の撮像面における焦点ズレ量マップを作成する。   The distance map generation process 131 in FIG. 11 is a process performed by the CPU 314 in FIG. 1, for example. In the distance map generation process 131, the CPU 314 multiplies the phase difference generated by the correlation calculation of the output signals of the focus detection pixels of the image sensor 301 by a conversion coefficient that converts the phase difference into a defocus amount. Calculate the defocus amount. Then, the CPU 314 creates a focus shift amount map on the imaging surface of the image sensor 301 from each focus shift amount corresponding to each of all focus detection pixels of the image sensor 301.

ここで、焦点ズレ量マップとは、撮像素子301の撮像面上において各焦点検出用画素の位置と各焦点ズレ量とを対応させた分布データである。そして、CPU314は、距離マップ生成処理131において、鏡筒部315のレンズ光学系におけるレンズ情報を考慮し、焦点ズレ量マップの各焦点ズレ量を、被写体までの距離情報(以下、被写体距離とする。)に変換する。これにより、撮像素子301の撮影画面上の各焦点検出用画素の位置と被写体距離とを対応させた分布データを得ることが可能となる。また、CPU314は、距離マップ生成処理131において、被写体距離の分布データに基づき、被写体領域を抽出する。例えば、被写体距離の分布の中で、略々同じ被写体距離となっている領域を繋ぎ合わせてグルーピングし、撮影画面中に含まれる被写体の輪郭を抽出する。これにより、各被写体領域と被写体距離を対応させた被写体距離マップが得られることになる。この被写体距離マップが、距離マップ生成処理131により生成される距離マップである。   Here, the focus shift amount map is distribution data in which the position of each focus detection pixel is associated with each focus shift amount on the imaging surface of the image sensor 301. In the distance map generation process 131, the CPU 314 considers lens information in the lens optical system of the lens barrel unit 315, and sets each focus shift amount of the focus shift amount map as distance information to the subject (hereinafter referred to as subject distance). .). This makes it possible to obtain distribution data in which the position of each focus detection pixel on the shooting screen of the image sensor 301 is associated with the subject distance. In the distance map generation process 131, the CPU 314 extracts a subject area based on the subject distance distribution data. For example, regions having substantially the same subject distance in the subject distance distribution are connected and grouped to extract the contour of the subject included in the shooting screen. As a result, a subject distance map in which each subject area is associated with the subject distance is obtained. This subject distance map is a distance map generated by the distance map generation processing 131.

なお、距離マップを生成する際の焦点検出用画素の機能は、撮像素子301の有効撮像領域内の全ての画素が有していてもよいし、数画素毎の画素が有していてもよい。数画素毎の画素が焦点検出用画素となされていている場合、各焦点検出用画素は、撮像素子301の撮像面上に一様に分布するように配される。距離マップ生成処理131により生成された距離マップの情報は、ストロボ成分推定処理132に送られる。   Note that the function of the focus detection pixel when generating the distance map may be included in all the pixels in the effective imaging region of the imaging element 301, or may be included in every several pixels. . When the pixels for every several pixels are the focus detection pixels, the focus detection pixels are arranged so as to be uniformly distributed on the imaging surface of the image sensor 301. Information on the distance map generated by the distance map generation process 131 is sent to the strobe component estimation process 132.

図11のストロボ成分推定処理132は、例えば図1のCPU314により行われる処理である。CPU314は、ストロボ成分推定処理132において、前述したストロボ配光レンズ周辺光量137と発光量情報110と距離マップとに基づいて、ストロボ成分を算出する。   The strobe component estimation process 132 in FIG. 11 is a process performed by the CPU 314 in FIG. 1, for example. In the strobe component estimation process 132, the CPU 314 calculates a strobe component based on the strobe light distribution lens peripheral light amount 137, the light emission amount information 110, and the distance map.

発光量情報110は、ストロボ発光部316におけるストロボ発光量であるガイドナンバーの情報である。具体的には、ストロボ発光時間やストロボ用コンデンサ端子の電圧値又は実際に発光時に消費された電流値などとガイドナンバーとの対応関係が予め測定されており、その対応関係を示す情報として発光量情報110が用意されている。CPU314は、この発光量情報110における対応関係を基に、ストロボ発光時のガイドナンバーを求めることができる。また別の手法として、ストロボ発光部316に光量センサーを配しておき、CPU314は、ストロボ発光時に光量センサーが検出した光量値に応じてガイドナンバーを決定してもよい。   The light emission amount information 110 is information on a guide number that is a strobe light emission amount in the strobe light emitting unit 316. Specifically, the correspondence between the strobe flash time, the voltage value of the strobe capacitor terminal or the current value actually consumed at the time of light emission, and the guide number is measured in advance, and the amount of light emitted as information indicating the correspondence Information 110 is prepared. The CPU 314 can obtain a guide number for strobe light emission based on the correspondence relationship in the light emission amount information 110. As another method, a light amount sensor may be provided in the strobe light emitting unit 316, and the CPU 314 may determine a guide number according to a light amount value detected by the light amount sensor during strobe light emission.

ここで、一般的に、ガイドナンバーは下記のように定義される。例えばISO100の感度の場合、ガイドナンバーは式(17)のように定義される。   Here, in general, the guide number is defined as follows. For example, in the case of ISO 100 sensitivity, the guide number is defined as in Expression (17).

ガイドナンバー=被写体距離×絞り値 ・・・式(17)
なお、絞り値はF値である。
Guide number = Subject distance × Aperture value (17)
The aperture value is an F value.

また、被写体距離の2乗値とストロボ光量は反比例し、ISO感度とストロボ光量は比例する。例えば、被写体距離が2倍になると被写体上のストロボ光量は1/4倍になり、ISO感度が2倍になると撮像面上でのストロボ光量は2倍相当になる。本実施形態では、例えば基準ISO感度と基準被写体距離において、暗中で反射率18%のグレーカード面にストロボ光を照射した際の撮像面の光量が予め算出されて、図示しないROM等に保持されている。これにより、CPU314は、被写体距離、ガイドナンバー、絞り値、ISO感度等の情報を基に、被写体領域毎にストロボ光量成分を算出可能となる。また、ガイドナンバーは、画面中央部分における適正な光量を表す値として定義される。このため、CPU314は、画面の周辺部分については、撮像面上における周辺光量落ち量に応じて、ストロボ照射量の周辺部の光量補正を行うことが可能である。   Further, the square value of the subject distance and the strobe light amount are inversely proportional, and the ISO sensitivity and the strobe light amount are proportional. For example, when the subject distance is doubled, the strobe light amount on the subject is ¼, and when the ISO sensitivity is doubled, the strobe light amount on the imaging surface is doubled. In the present embodiment, for example, at the standard ISO sensitivity and the standard subject distance, the amount of light on the imaging surface when the strobe light is applied to the gray card surface with a reflectance of 18% in the dark is calculated in advance and held in a ROM (not shown) or the like. ing. Accordingly, the CPU 314 can calculate the strobe light amount component for each subject area based on information such as the subject distance, guide number, aperture value, ISO sensitivity, and the like. The guide number is defined as a value representing an appropriate amount of light at the center of the screen. For this reason, the CPU 314 can correct the light amount of the peripheral portion of the strobe irradiation amount in accordance with the peripheral light amount drop amount on the imaging surface for the peripheral portion of the screen.

CPU314は、ストロボ成分推定処理132において、これらストロボ配光レンズ周辺光量137のストロボ配光量とレンズ周辺光量とストロボ発光量(ガイドナンバー)と被写体距離とに応じて、撮像面への入射光量であるストロボ成分を推定する。式(18)には、撮像素子301の撮像面の座標(x,y)におけるストロボ成分の推定量の演算式を示す。   In the strobe component estimation process 132, the CPU 314 indicates the amount of light incident on the imaging surface in accordance with the strobe light distribution amount of the strobe light distribution lens peripheral light amount 137, the lens peripheral light amount, the strobe light emission amount (guide number), and the subject distance. Estimate the strobe component. Expression (18) shows an arithmetic expression for the estimated amount of the strobe component at the coordinates (x, y) of the imaging surface of the image sensor 301.

f(x,y)=G.N.×St(x,y)×LensSHD(x,y)/(Dist(x,y)×FNo)×(R(x,y)/0.18)×AETarget
・・・式(18)
f(x,y):ストロボ照射がなされたときの撮像素子301への入射光量
G.N.:ガイドナンバー
St(x,y):配光情報であり、画像中心部の配光量を「1」とした時の周辺の配光分布
LensSHD(x,y):画像中心部の配光量を「1」とした時のレンズの周辺光量比率
Dist(x,y):被写体領域毎の被写体距離
R(x,y):被写体反射率
AETarget:適正露光撮影時に得られるの撮像素子301の出力レベル
f (x, y) = GN × St (x, y) × LensSHD (x, y) / (Dist (x, y) × FNo) × (R (x, y) /0.18) × AETarget
... Formula (18)
f (x, y): the amount of light incident on the image sensor 301 when stroboscopic irradiation is performed
GN: Guide number
St (x, y): Light distribution information, and surrounding light distribution when the light distribution at the center of the image is “1”
LensSHD (x, y): Peripheral light quantity ratio of the lens when the light distribution at the center of the image is “1”
Dist (x, y): Subject distance for each subject area
R (x, y): Subject reflectance
AETarget: Output level of the image sensor 301 obtained at the time of appropriate exposure shooting

ここで、例えば反射率18%のグレーカードを撮影した場合、撮影画像の中央部では、式(18)は式(19)のように簡略化できる。さらにストロボ光が適正露光となるガイドナンバー(G.N.)で撮影されている場合、式(17)から撮像素子301の出力値は適正露光での撮影がなされた際に得られるの出力レベルの値が得られることがわかる。   Here, for example, when a gray card with a reflectance of 18% is photographed, Expression (18) can be simplified as Expression (19) at the center of the photographed image. Further, when the strobe light is photographed with a guide number (GN) that provides proper exposure, the output value of the image sensor 301 is obtained from the equation (17) as the output level value obtained when photographing is performed with proper exposure. It turns out that it is obtained.

f(x,y)=G.N.×/(Dist(x,y)×FNo)×AETarget ・・・式(19)   f (x, y) = G.N. × / (Dist (x, y) × FNo) × AETarget Expression (19)

また、ストロボ非発光画像102とストロボ発光画像100に含まれる外光成分(環境光成分)のうち、光源による光量成分と被写体反射率の切り分けはできないため、被写体の反射率は測定できない。このため、被写体の反射率は、簡易的に一律に18%の反射率として計算してもよいし、ストロボ発光画像100の色味や輝度値に応じて反射率の想定を変えてもよい。例えば、黄色の被写体の場合、反射率を70%に設定するなど、色味やストロボ発光画像100の輝度値に応じて反射率の推定を行うことで精度を向上させることも可能である。また、ストロボ光のガイドナンバーを変えた2回の撮影を行い、それら2回の撮影による両撮影画像の差分を求めることで、外光成分を除去することができ、それらの画像差分量がストロボ光変動分となる。また前述したように、被写体距離とガイドナンバーの差分から被写体へのストロボ光の照射量の推定が可能になるため、そのストロボ照射量と実際の画像信号値の比率を計算することで、被写体の反射率を測定することが可能である。   In addition, among the external light components (environmental light components) included in the strobe non-light emitting image 102 and the strobe light emitting image 100, the light amount component by the light source and the subject reflectance cannot be separated, so the subject reflectance cannot be measured. For this reason, the reflectance of the subject may be simply calculated as a reflectance of 18% in a simple manner, or the assumption of the reflectance may be changed according to the color and luminance value of the strobe light emission image 100. For example, in the case of a yellow subject, it is possible to improve the accuracy by estimating the reflectance according to the color and the luminance value of the strobe light emission image 100, such as setting the reflectance to 70%. In addition, by taking two shots with different strobe light guide numbers and obtaining the difference between the two shot images by the two shots, the external light component can be removed, and the difference between these images is the strobe. It becomes the amount of light fluctuation. In addition, as described above, since it is possible to estimate the amount of strobe light applied to the subject from the difference between the subject distance and the guide number, the ratio of the strobe amount to the actual image signal value is calculated to calculate the ratio of the subject. It is possible to measure the reflectance.

図11に説明を戻す。
領域毎外光・ストロボ光比率生成処理138(以下、光比率生成処理138と表記する。)は、ストロボ発光画像100の画像信号の値から、ストロボ成分推定処理132で算出したストロボ成分の値を減算することにより、外光成分量を算出する。そして、光比率生成処理138は、前述の光比率生成処理133と同様の処理により、被写体領域毎にストロボ光と外光の割合(光量比率)を求める。この光比率生成処理138により算出された割合の情報は、合成比率補正処理140に送られる。
Returning to FIG.
The external light / strobe light ratio generation process 138 for each region (hereinafter referred to as the light ratio generation process 138) uses the value of the strobe component calculated by the strobe component estimation process 132 from the value of the image signal of the strobe emission image 100. By subtracting, the amount of external light components is calculated. Then, the light ratio generation process 138 obtains the ratio of the strobe light to the outside light (light quantity ratio) for each subject area by the same process as the light ratio generation process 133 described above. Information on the ratio calculated by the light ratio generation process 138 is sent to the combination ratio correction process 140.

合成比率補正処理140は、前述したように、移動体領域抽出処理123にて抽出された移動体領域について、合成比率決定処理105で算出された合成比率を、ストロボ外光比率推定処理130による被写体領域毎の割合に応じて修正する。   As described above, the composition ratio correction process 140 uses the composition ratio calculated in the composition ratio determination process 105 for the moving object area extracted in the moving object area extraction process 123, as the subject by the strobe outside light ratio estimation process 130. Modify according to the ratio of each area.

以上説明したように、本実施形態においては、前述したように第1のYUV画像と第2のYUV画像を、画像合成比率α[i]に応じて画像合成処理114にて合成している。ここで、一般的に、複数の光源からの光が混合された際の色味は、それぞれ光の加法性が成り立つ。つまり、ストロボ光量と外光成分の光量比率が判れば、それぞれの光源の光に対応したWB補正処理後の画像を、ストロボ光量と外光量の光量比率に応じて合成すれば、両方の光源に適したWB制御がなされた画像が得られる。そして、本実施形態においては、本露光画像であるストロボ発光画像100について、被写体等が移動していない被写体領域については、第1のWB補正値にてWB補正された画像と第2のWB補正値にてWB補正された画像の合成が行われている。このように被写体等が移動していない被写体領域においては、外光光量とストロボ光量が正確に算出可能であるため光量比率を正確に算出ができる。   As described above, in the present embodiment, as described above, the first YUV image and the second YUV image are combined by the image combining process 114 in accordance with the image combining ratio α [i]. Here, generally, the additiveness of light is established for the color when light from a plurality of light sources is mixed. In other words, if the light intensity ratio between the strobe light quantity and the external light component is known, an image after WB correction processing corresponding to the light of each light source is synthesized according to the light quantity ratio between the strobe light quantity and the external light quantity. An image subjected to appropriate WB control is obtained. In the present embodiment, with respect to the subject area where the subject or the like has not moved in the strobe light emission image 100 that is the main exposure image, an image that is WB corrected with the first WB correction value and the second WB correction. An image subjected to WB correction with values is synthesized. As described above, in the subject area where the subject or the like is not moving, the light amount ratio can be accurately calculated because the external light amount and the strobe light amount can be accurately calculated.

一方で、被写体等が移動している移動被写体である場合、その移動体領域については、ストロボ非発光画像102とストロボ発光画像100との比較では正確な光量比率の算出ができない。このため、本実施形態では、本露光画像であるストロボ発光画像100から算出した距離マップとその時の撮影情報とに基づいて、ストロボ光と外光との割合を推定している。そして、本実施形態では、移動体領域については、その割合を画像合成比率として用い、画像合成を行うようにしている。   On the other hand, when the subject or the like is a moving subject, the light amount ratio cannot be accurately calculated by comparing the strobe non-emission image 102 and the strobe emission image 100 for the moving body region. For this reason, in this embodiment, the ratio of strobe light to outside light is estimated based on the distance map calculated from the strobe light emission image 100 that is the main exposure image and the shooting information at that time. In the present embodiment, with respect to the moving object region, the ratio is used as the image composition ratio to perform image composition.

本実施形態によれば、ストロボ発光画像100とストロボ非発光画像102を用いて移動体領域を判定し、また被写体の距離情報を取得し、移動体動領域に対しては距離情報に基づく合成比率を決定している。このため、本実施形態によれば、ストロボ光を発光したシーンにおいて、被写体に動きがあったとしても、被写体領域毎に最適なホワイトバランス制御が可能となり、主被写体と背景を共に適正な色味とする画像を取得することができる。   According to the present embodiment, the moving body region is determined using the strobe light emission image 100 and the strobe non-light emission image 102, the distance information of the subject is acquired, and the composition ratio based on the distance information is obtained for the moving body movement region. Is determined. For this reason, according to the present embodiment, even if the subject moves in a scene that emits strobe light, optimal white balance control can be performed for each subject region, and both the main subject and the background have an appropriate color tone. Can be acquired.

なお、本実施形態では、各焦点検出用画素における位相差を検出することで距離マップを求める例を挙げている。ただし、位相差検出方式による距離の測定は、近距離の領域であれば被写界深度が距離に対して十分に浅いため正確に算出可能であるものの、遠距離である場合には距離に対して深度が深いため、正確に距離の算出はできない。しかしながら、近距離の領域では被写体距離によってストロボ光の照射量の差分が大きいため、ストロボ光の照射量の差分による色ムラが大きくなる。このため、色ムラを生じさせないためにも正確にWB補正の制御が必要になるが、遠距離に対してはストロボ照射量の距離による変動が少なくなるため、距離を正確に算出する必要はない。   In the present embodiment, an example is given in which a distance map is obtained by detecting a phase difference in each focus detection pixel. However, the distance measurement by the phase difference detection method can be calculated accurately because the depth of field is sufficiently shallow with respect to the distance if it is a short-distance region. Because the depth is deep, the distance cannot be calculated accurately. However, in the short-distance region, the difference in the amount of strobe light irradiation is large depending on the subject distance, so that the color unevenness due to the difference in the amount of strobe light irradiation increases. For this reason, it is necessary to accurately control the WB correction so as not to cause color unevenness. However, since the fluctuation of the strobe irradiation amount with respect to a long distance is reduced, it is not necessary to accurately calculate the distance. .

<第2の実施形態>
以下、第2の実施形態の撮像装置について説明する。第2の実施形態は、距離マップの情報を用いて移動体領域を抽出する場合の例である。図12は、第2の実施形態の撮像装置において、前述の第1の実施形態における図2の処理フローとは異なる部分を抜き出して示す図である。第2の実施形態の場合、前述の図2の処理フローの第1,第2の色味情報取得処理1201,1202とストロボ発光画像色味補正処理121に代えて、図12に示す後述する各処理1311,1312,1341,1342,135,136が用いられる。なお、第2の実施形態において、距離マップの情報に基づいて移動体領域を抽出すること以外の他の各処理は、前述の図2の処理フローと同様であるため、それらの説明は省略する。
<Second Embodiment>
Hereinafter, an imaging apparatus according to the second embodiment will be described. The second embodiment is an example in the case where a moving body region is extracted using information of a distance map. FIG. 12 is a diagram showing a part different from the processing flow of FIG. 2 in the first embodiment described above in the imaging apparatus of the second embodiment. In the case of the second embodiment, instead of the first and second color information acquisition processes 1201 and 1202 and the strobe light emission image color correction process 121 in the process flow of FIG. Processing 1311, 1312, 1341, 1342, 135, 136 is used. In the second embodiment, the processes other than extracting the moving body region based on the information of the distance map are the same as those in the process flow of FIG. 2 described above, and thus the description thereof is omitted. .

図12に示すように、第2の実施形態の場合、ストロボ発光画像100は、第1の距離マップ生成処理1311に送られる。第1の距離マップ生成処理1311は、例えば図1のCPU314により行われる処理である。CPU314は、第1の距離マップ生成処理1311として、前述した図11の距離マップ生成処理131で説明したのと同様にして、ストロボ発光画像100から距離マップを生成する。以下、第1の距離マップ生成処理1311により生成された距離マップを「第1の距離マップ」と表記する。第1の距離マップの情報は、第1の距離マップ信頼度生成処理1341と距離マップ差分抽出処理136に送られる。   As shown in FIG. 12, in the case of the second embodiment, the strobe light emission image 100 is sent to the first distance map generation process 1311. The first distance map generation process 1311 is a process performed by, for example, the CPU 314 in FIG. As the first distance map generation process 1311, the CPU 314 generates a distance map from the strobe light emission image 100 in the same manner as described in the distance map generation process 131 of FIG. 11 described above. Hereinafter, the distance map generated by the first distance map generation process 1311 is referred to as a “first distance map”. The information of the first distance map is sent to the first distance map reliability generation process 1341 and the distance map difference extraction process 136.

ストロボ非発光画像102は、第2の距離マップ生成処理1312に送られる。第2の距離マップ生成処理1322は、例えば図1のCPU314により行われる処理である。CPU314は、第2の距離マップ生成処理1311として、前述同様に、ストロボ非発光画像102から距離マップを生成する。以下、第2の距離マップ生成処理1312により生成された距離マップを「第2の距離マップ」と表記する。第2の距離マップの情報は、第2の距離マップ信頼度生成処理1342と距離マップ高信頼度領域抽出処理135に送られる。   The strobe non-light-emitting image 102 is sent to the second distance map generation process 1312. The second distance map generation process 1322 is a process performed by the CPU 314 in FIG. As the second distance map generation process 1311, the CPU 314 generates a distance map from the strobe non-light emitting image 102 as described above. Hereinafter, the distance map generated by the second distance map generation process 1312 is referred to as a “second distance map”. The information of the second distance map is sent to the second distance map reliability generation process 1342 and the distance map high reliability area extraction process 135.

第1の距離マップ信頼度生成処理1341(以下、第1の信頼度生成処理1341と表記する。)は、例えば図1のCPU314により行われる処理である。前述したように、距離マップは、全ての焦点検出用画素の出力信号の相関演算により求められた位相差に基づいて生成されている。CPU314は、第1の信頼度生成処理1341として、第1の距離マップについて相関演算の結果である位相差の信頼性を判定する。この場合の信頼性とは、焦点検出用画素による二つの像の信号の一致度に相当し、二つの像の信号の一致度が高い場合は焦点検出結果の信頼性が高いと言える。CPU314は、第1の信頼度生成処理1341において、焦点検出用画素による二つの像の信号の一致度が或る閾値を超えているか否かにより、相関演算の位相差検出結果の信頼性の判定を行う。このように、CPU314は、第1の信頼度生成処理1341において、第1の距離マップが生成された際の各位相差についての信頼度を判定する。第1の信頼度生成処理1341による第1の距離マップの信頼度の判定結果の情報は、距離マップ高信頼度領域抽出処理135に送られる。   The first distance map reliability generation process 1341 (hereinafter referred to as the first reliability generation process 1341) is, for example, a process performed by the CPU 314 in FIG. As described above, the distance map is generated based on the phase difference obtained by the correlation calculation of the output signals of all the focus detection pixels. As the first reliability generation process 1341, the CPU 314 determines the reliability of the phase difference that is the result of the correlation calculation for the first distance map. The reliability in this case corresponds to the degree of coincidence of the signals of the two images by the focus detection pixels, and it can be said that the reliability of the focus detection result is high when the degree of coincidence of the signals of the two images is high. In the first reliability generation process 1341, the CPU 314 determines the reliability of the phase difference detection result of the correlation calculation based on whether or not the degree of coincidence of the signals of the two images by the focus detection pixels exceeds a certain threshold value. I do. As described above, the CPU 314 determines the reliability of each phase difference when the first distance map is generated in the first reliability generation process 1341. Information on the determination result of the reliability of the first distance map by the first reliability generation process 1341 is sent to the distance map high reliability area extraction process 135.

第2の距離マップ信頼度生成処理1342(以下、第2の信頼度生成処理1342と表記する。)は、例えば図1のCPU314により行われる処理である。CPU314は、第2の信頼度生成処理1342として、第1の信頼度生成処理1341と同様にして、第2の距離マップについて各位相差の信頼度を判定する。第2の信頼度生成処理1342による第2の距離マップの信頼度の判定結果の情報は、距離マップ高信頼度領域抽出処理135に送られる。   The second distance map reliability generation process 1342 (hereinafter referred to as the second reliability generation process 1342) is, for example, a process performed by the CPU 314 in FIG. As the second reliability generation process 1342, the CPU 314 determines the reliability of each phase difference for the second distance map in the same manner as the first reliability generation process 1341. Information on the determination result of the reliability of the second distance map by the second reliability generation process 1342 is sent to the distance map high reliability area extraction process 135.

距離マップ高信頼度領域抽出処理135(以下、信頼度領域抽出処理135と表記する。)は、例えば図1のCPU314により行われる処理である。CPU314は、信頼度領域抽出処理135として、第1の距離マップの各位相差の信頼度と第2の距離マップの各位相差の信頼度とを比較し、両者の差が少ない信頼度を選択する。そして、CPU314は、信頼度領域抽出処理135において、選択された各位相差の信頼度が所定の値より高くなっている信頼度が集まった領域を、第1,第2の両距離マップにおいて信頼度の高い領域として抽出する。以下、第1,第2の両距離マップにおいて信頼度が高いとして抽出された領域を「高信頼度領域」と表記する。信頼度領域抽出処理135により抽出された高信頼度領域の情報は、移動体領域抽出処理123に送られる。   The distance map high reliability area extraction process 135 (hereinafter referred to as reliability area extraction process 135) is, for example, a process performed by the CPU 314 in FIG. As the reliability region extraction processing 135, the CPU 314 compares the reliability of each phase difference in the first distance map with the reliability of each phase difference in the second distance map, and selects a reliability with a small difference between the two. Then, in the reliability region extraction processing 135, the CPU 314 determines, in the first and second distance maps, the reliability of the regions where the reliability of the selected phase differences is higher than a predetermined value. Are extracted as high regions. Hereinafter, an area extracted as having high reliability in both the first and second distance maps is referred to as “high reliability area”. The information on the high reliability area extracted by the reliability area extraction process 135 is sent to the mobile object area extraction process 123.

距離マップ差分抽出処理136(以下、差分抽出処理136と表記する。)は、例えば図1のCPU314により行われる処理である。CPU314は、差分抽出処理136として、第1の距離マップと第2の距離マップの各距離情報の差分を求め、差分が大きい距離情報が集まった領域を抽出する。以下、それら差分が大きい距離情報が集まった領域を「大差分距離領域」と表記する。差分抽出処理136により抽出された大差分距離領域の情報は、移動体領域抽出処理123に送られる。   The distance map difference extraction process 136 (hereinafter referred to as difference extraction process 136) is a process performed by the CPU 314 of FIG. As the difference extraction process 136, the CPU 314 obtains a difference between the distance information of the first distance map and the second distance map, and extracts an area where distance information having a large difference is gathered. Hereinafter, an area where distance information having a large difference is collected is referred to as a “large difference distance area”. The information on the large difference distance area extracted by the difference extraction process 136 is sent to the moving object area extraction process 123.

第2の実施形態の場合、CPU314は、移動体領域抽出処理123として、大差分距離領域で且つ高信頼度領域である領域を、ストロボ発光画像100の移動体領域として抽出する。第2の移動体領域抽出処理123により抽出された移動体領域の情報は、合成比率補正処理140に送られる。合成比率補正処理140は前述の第1の実施形態と同様であるため、この説明は省略する。   In the case of the second embodiment, the CPU 314 extracts a region that is a large difference distance region and a high reliability region as a moving body region extraction process 123 as a moving body region of the strobe light emission image 100. The information on the moving body area extracted by the second moving body area extraction process 123 is sent to the composition ratio correction process 140. Since the combination ratio correction process 140 is the same as that in the first embodiment, the description thereof is omitted.

以上説明したように、第2の実施形態によれば、移動体領域を距離マップに基づいて抽出しており、距離マップを用いることで画素毎に距離情報の抽出が可能になり、このため、高い解像度で移動体領域の抽出が可能になるという長所を有する。また、第2の実施形態によれば、第1の実施形態の場合のように画像領域毎に色味の評価を行う必要がなくなるため、演算量の低減が可能となる。   As described above, according to the second embodiment, the moving object region is extracted based on the distance map, and the distance information can be extracted for each pixel by using the distance map. It has an advantage that a moving body region can be extracted with high resolution. Further, according to the second embodiment, it is not necessary to evaluate the color for each image area as in the case of the first embodiment, so that the amount of calculation can be reduced.

ただし、第2の実施形態の場合、例えば暗い被写体やコントラストの少ない被写体等の場合には、前述した位相差に基づく距離の測定ができなくなることがあり、距離マップによる移動体領域の抽出が難しくなる虞がある。このような場合には、第1の実施形態の色味評価による移動体領域の抽出を行うように切り替え、また、距離を計測可能な領域の面積が一定の面積以上になった場合には距離マップを使用した移動体領域抽出を行うようにするなどの使い分けを行ってもよい。また、それら距離マップによる移動体領域抽出と色味評価による移動体領域抽出の使い分けを行う場合、それらの何れを用いるかは、例えば線形補間などの手法で決めてもよい。   However, in the case of the second embodiment, for example, in the case of a dark subject or a subject with low contrast, the distance based on the above-described phase difference may not be measured, and it is difficult to extract the moving body region using the distance map. There is a risk of becoming. In such a case, switching is performed so that the moving body region is extracted by the color evaluation of the first embodiment, and the distance is measured when the area of the region where the distance can be measured is equal to or larger than a certain area. Different usage such as performing mobile object region extraction using a map may be performed. Further, when the mobile body region extraction based on the distance map and the mobile body region extraction based on the color evaluation are used separately, which one to use may be determined by a method such as linear interpolation.

<第3の実施形態>
以下、第3の実施形態の撮像装置について説明する。第3の実施形態は、移動体領域の画像合成比率を、ストロボ光と外光の光量比と、被写体距離との相関演算結果に基づいて決定する場合の例である。図13は、第3の実施形態の撮像装置において、前述の第1の実施形態における図2の処理フローとは異なる部分を抜き出して示す図である。第3の実施形態の場合、前述の図2の処理フローに加えて、後述する各処理139,134,150,160,161が設けられている。なお、第3の実施形態において、これら追加された各処理以外の他の各処理は、前述の図2の処理フローと同様であるため、それらの説明は省略する。ただし、第3の実施形態の場合、図2のストロボ外光比率推定処理130は行われず、ストロボ光と外光の光量比と、被写体距離との相関演算結果に基づいて、移動体領域の画像合成比率が求められる。
<Third Embodiment>
Hereinafter, an imaging apparatus according to the third embodiment will be described. The third embodiment is an example in which the image composition ratio of the moving body region is determined based on the correlation calculation result between the strobe light / external light quantity ratio and the subject distance. FIG. 13 is a diagram showing an extracted part of the imaging apparatus according to the third embodiment, which is different from the processing flow of FIG. 2 in the first embodiment described above. In the case of the third embodiment, in addition to the process flow of FIG. 2 described above, processes 139, 134, 150, 160, 161 described later are provided. In the third embodiment, the other processes other than the added processes are the same as those in the process flow of FIG. 2 described above, and a description thereof will be omitted. However, in the case of the third embodiment, the strobe outside light ratio estimation processing 130 of FIG. 2 is not performed, and the moving object region image is based on the correlation calculation result between the strobe light and outside light amount ratio and the subject distance. A composite ratio is required.

図13に示すように、第3の実施形態の場合、ストロボ発光画像100は、距離マップ生成処理139と被写体領域判別処理160に送られる。距離マップ生成処理139は、前述した図11の距離マップ生成処理131や図12の第1の距離マップ生成処理1311と同じ処理であるため、詳細な説明は省略する。距離マップ生成処理139により生成された距離マップの情報は、距離マップ信頼度生成処理134と被写体領域毎距離情報取得処理161と距離・光量比相関演算処理150とに送られる。   As shown in FIG. 13, in the case of the third embodiment, the strobe light emission image 100 is sent to a distance map generation process 139 and a subject area determination process 160. The distance map generation process 139 is the same process as the distance map generation process 131 of FIG. 11 and the first distance map generation process 1311 of FIG. The information of the distance map generated by the distance map generation process 139 is sent to the distance map reliability generation process 134, the subject area distance information acquisition process 161, and the distance / light quantity ratio correlation calculation process 150.

距離マップ信頼度生成処理134は、前述の図12で説明した第1の信頼度生成処理1341と同じ処理であるため、詳細な説明は省略する。距離マップ信頼度生成処理134により生成された距離マップの信頼度の情報は、合成比率補正処理140に送られる。   The distance map reliability generation process 134 is the same process as the first reliability generation process 1341 described with reference to FIG. The distance map reliability information generated by the distance map reliability generation process 134 is sent to the composition ratio correction process 140.

被写体領域判別処理160は、例えば図1のCPU314により行われる処理である。CPU314は、被写体領域判別処理160として、本露光画像であるストロボ発光画像100に含まれる被写体領域を判別する。CPU314は、被写体領域判別処理160として、顔画像領域検出処理や、彩度や色相や輝度値等により似た色の画像領域を検出する処理、オートフォーカス情報や距離マップによる距離情報に基づいて画像領域を検出する処理などにより被写体領域を判別する。なお、これら顔画像検出処理や、似た色による画像領域検出処理、距離情報に基づく画像領域検出処理は、一般的に知られた技術であるため、ここではそれらの詳細な説明は省略する。なお、被写体領域判別処理160は、これらの各処理が組み合わされた処理であってもよい。被写体領域判別処理160により判別された被写体領域の情報は、被写体領域毎距離情報取得処理161に送られる。   The subject area determination process 160 is a process performed by the CPU 314 of FIG. The CPU 314 determines the subject area included in the flash emission image 100 that is the main exposure image as the subject area determination processing 160. The CPU 314 performs image processing based on face image area detection processing, processing for detecting an image area having a similar color based on saturation, hue, luminance value, and the like as subject area determination processing 160, autofocus information, and distance information based on a distance map. The subject region is determined by processing for detecting the region. Note that these face image detection processing, image region detection processing using similar colors, and image region detection processing based on distance information are generally known techniques, and thus detailed description thereof is omitted here. The subject area determination process 160 may be a process in which these processes are combined. Information on the subject area determined by the subject area determination processing 160 is sent to the subject region distance information acquisition processing 161.

被写体領域毎距離情報取得処理161(以下、距離情報取得処理161と表記する。)は、例えば図1のCPU314により行われる処理である。CPU314は、距離情報取得処理161として、被写体領域毎に距離情報の分布を算出し、被写体領域毎に距離の代表値を算出する。被写体領域毎の距離の代表値としては、例えば平均値や中央値など統計的な手法を用いて得られる値を用いる。距離情報取得処理161による被写体領域毎の距離情報の代表値は、合成比率補正処理140に送られる。   The subject area distance information acquisition process 161 (hereinafter referred to as a distance information acquisition process 161) is, for example, a process performed by the CPU 314 in FIG. As the distance information acquisition process 161, the CPU 314 calculates a distribution of distance information for each subject area, and calculates a representative value of the distance for each subject area. As the representative value of the distance for each subject area, for example, a value obtained by using a statistical method such as an average value or a median value is used. The representative value of the distance information for each subject area obtained by the distance information acquisition process 161 is sent to the composition ratio correction process 140.

距離・光量比相関演算処理150(以下、相関演算処理150と表記する。)は、例えば図1のCPU314により行われる処理である。CPU314は、相関演算処理150として、距離マップ生成処理139からの距離マップと、前述した光比率生成処理133からの光量比率とに基づいて、被写体領域毎の被写体距離と光量比率との間の相関演算を行う。なお、このときの相関演算手法は、最小二乗法などの一般的な手法などが用いられる。相関演算処理150による相関演算で求められた相関係数は、合成比率補正処理140に送られる。   The distance / light quantity ratio correlation calculation processing 150 (hereinafter referred to as correlation calculation processing 150) is, for example, processing performed by the CPU 314 in FIG. As the correlation calculation processing 150, the CPU 314 correlates between the subject distance and the light amount ratio for each subject region based on the distance map from the distance map generation processing 139 and the light amount ratio from the light ratio generation processing 133 described above. Perform the operation. As a correlation calculation method at this time, a general method such as a least square method is used. The correlation coefficient obtained by the correlation calculation by the correlation calculation process 150 is sent to the synthesis ratio correction process 140.

第3の実施形態の場合の合成比率補正処理140では、相関演算処理150からの相関係数と、距離マップ信頼度生成処理134からの信頼度と、距離情報取得処理161からの距離情報の代表値とに基づいて、移動体領域毎に合成比率の補正が行われる。具体的には、CPU314は、第3の実施形態における合成比率補正処理140として、距離マップの信頼度が閾値以上の高い移動体領域については、相関演算処理150による相関係数に基づいて合成比率を決定する。一方、距離マップの信頼度が閾値より低い移動体領域については、合成比率補正処理140では、移動体領域の距離の代表値と光量比率との相関演算による相関係数を求め、その相関係数に基づいて合成比率を算出する。そして、合成比率補正処理140による補正処理後の合成比率の情報は、前述した図2のリサイズ処理106に送られる。   In the combination ratio correction process 140 in the case of the third embodiment, the correlation coefficient from the correlation calculation process 150, the reliability from the distance map reliability generation process 134, and the distance information representative from the distance information acquisition process 161 are represented. Based on the value, the composition ratio is corrected for each moving body region. Specifically, the CPU 314 performs the composition ratio correction processing 140 according to the third embodiment for a moving body region whose distance map reliability is higher than a threshold based on the correlation coefficient by the correlation calculation processing 150. To decide. On the other hand, for a mobile object region whose reliability of the distance map is lower than the threshold, the composition ratio correction process 140 obtains a correlation coefficient by a correlation operation between the representative value of the distance of the mobile object region and the light amount ratio, and the correlation coefficient Based on the above, the composition ratio is calculated. Then, the information of the composition ratio after the correction processing by the composition ratio correction processing 140 is sent to the resize processing 106 in FIG.

なお、第3の実施形態において、ストロボ光の照射量の相関係数を算出する際には、ストロボ光の照射分布を用い、ストロボ光の比率をストロボ照射量に依存させるように補正することで、被写体距離と光量比率との相関演算の精度を向上させることが可能となる。すなわち、ストロボ光量と外光量の光量比率は、ストロボ照射量に依存するため、相関係数を算出する際に、ストロボ照射分布に応じてストロボ光の比率を補正する。より具体的には、相関係数を算出する際のストロボ光量に対して、図1のストロボ配光レンズ周辺光量137と撮影時の焦点距離とからストロボ配光情報を算出し、配光分布の画像中心部の照射量との比率をストロボ光量に乗算する。このようにすることでストロボ照射ムラがないデータに対してストロボ光量と距離との相関を得ることができ、より精度の高い距離と外光とストロボの光量の相関係数を得られる。一方、前述のように算出された相関係数から被写体距離に応じたストロボ光量を算出する際、ストロボ光量に対して、撮像面内のストロボ照射量分布に応じた照射光量比を乗算することで、ストロボ光と外光量の光量比率をより高精度に算出可能になる。   In the third embodiment, when calculating the correlation coefficient of the strobe light irradiation amount, the strobe light irradiation distribution is used, and the strobe light ratio is corrected to be dependent on the strobe light amount. Thus, it is possible to improve the accuracy of the correlation calculation between the subject distance and the light amount ratio. In other words, since the light amount ratio between the strobe light amount and the external light amount depends on the strobe light amount, the strobe light ratio is corrected according to the strobe light distribution when calculating the correlation coefficient. More specifically, the strobe light distribution information is calculated from the strobe light distribution lens peripheral light amount 137 of FIG. 1 and the focal length at the time of photographing with respect to the strobe light amount when calculating the correlation coefficient. Multiply the strobe light amount by the ratio to the irradiation amount at the center of the image. In this way, the correlation between the strobe light amount and the distance can be obtained with respect to data having no strobe irradiation unevenness, and the correlation coefficient between the distance, the outside light, and the strobe light amount can be obtained with higher accuracy. On the other hand, when calculating the strobe light amount according to the subject distance from the correlation coefficient calculated as described above, the strobe light amount is multiplied by the irradiation light amount ratio according to the strobe light amount distribution in the imaging surface. Thus, the light quantity ratio between the strobe light and the external light quantity can be calculated with higher accuracy.

以上説明したように、第3の実施形態では、距離マップと光量比率との相関関係をストロボ発光画像100から算出し、ストロボ発光画像100の距離マップを用いて補正を行っている。このように、同一のストロボ発光画像100の距離マップとストロボ発光量との相関係数を算出しているため、被写体の移動による誤差が生ずることがなく、したがって、移動体領域について精度良くWB補正を行えるようになる。また、第3の実施形態においては、ストロボ発光画像100の被写体領域判別と距離マップ生成を行うことで、ストロボ発光画像100から距離と被写体領域との関係を得ることができる。例えば、ストロボ発光画像100内の被写体領域では、被写体距離が均一であることも多く、したがって、本実施形態では、距離マップが正確に求められていない場合においても、光量比率の算出の精度を向上させることができる。   As described above, in the third embodiment, the correlation between the distance map and the light amount ratio is calculated from the strobe light emission image 100, and correction is performed using the distance map of the strobe light emission image 100. As described above, since the correlation coefficient between the distance map of the same strobe light emission image 100 and the strobe light emission amount is calculated, an error due to the movement of the subject does not occur. Therefore, the WB correction is accurately performed for the moving body region. Can be done. In the third embodiment, the relationship between the distance and the subject area can be obtained from the strobe light emission image 100 by determining the subject area of the strobe light emission image 100 and generating the distance map. For example, in the subject area in the strobe light emission image 100, the subject distance is often uniform. Therefore, in the present embodiment, even when the distance map is not accurately obtained, the calculation accuracy of the light amount ratio is improved. Can be made.

<その他の実施形態>
本発明は、上述した各実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
<Other embodiments>
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read the program. It can also be realized by processing to be executed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

上述の各実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明は、その技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   Each of the above-described embodiments is merely a specific example for carrying out the present invention, and the technical scope of the present invention should not be construed as being limited thereto. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

100 ストロボ発光画像(本露光画像)、101 リサイズ処理、102 ストロボ非発光画像(EVF画像)、103 露光量演算処理、104 領域毎ストロボ発光量演算処理、105 画像合成比率決定処理、106 リサイズ処理、107 第2のWB補正値算出処理、1091 第1のWB処理、1092 第2のWB処理、110 発光量情報、111 第1のWB補正値算出処理、1131 第1の現像処理、1132 第2の現像処理、114 画像合成処理、1201 第1の色味情報取得処理、1202 第2の色味情報取得処理、121 ストロボ発光画像色味補正処理、123 移動体領域抽出処理、130 ストロボ外光比率推定処理、131 距離マップ生成処理、132 ストロボ成分推定処理、138 領域毎外光・ストロボ光比率生成処理、1311 第1の距離マップ生成処理、1312 第2の距離マップ生成処理、1341 第1の距離マップ信頼度生成処理、1342 第2の距離マップ信頼度生成処理、136 距離マップ差分抽出処理、135 距離マップ高信頼度領域抽出処理、137 ストロボ配光レンズ周辺光量情報、140 移動体領域合成比率補正処理、150 距離光量比相関演算処理、301 撮像素子、302 メモリ、303 WB制御部、304 色変換MTR回路、305 LPF回路、306 CSUP回路、307 RGB変換回路、308 ガンマ補正回路、309 色輝度変換回路、310 JPEG圧縮回路、311 Y生成回路、312 エッジ強調回路、313 鏡筒制御回路、314 CPU、315 鏡筒部、316 ストロボ発光部、320 周辺光量補正部、325 画像合成処理部   100 Strobe light emission image (main exposure image), 101 Resize processing, 102 Strobe non-light emission image (EVF image), 103 Exposure amount calculation processing, 104 Strobe light emission amount calculation processing for each area, 105 Image composition ratio determination processing, 106 Resizing processing, 107 2nd WB correction value calculation processing, 1091 1st WB processing, 1092 2nd WB processing, 110 light emission amount information, 111 1st WB correction value calculation processing, 1131 1st development processing, 1132 2nd Development processing, 114 image composition processing, 1201 first color information acquisition processing, 1202 second color information acquisition processing, 121 strobe emission image color correction processing, 123 moving body region extraction processing, 130 strobe external light ratio estimation Processing, 131 distance map generation processing, 132 strobe component estimation processing, 138 outside light / stoke for each region Robo light ratio generation process, 1311 first distance map generation process, 1312 second distance map generation process, 1341 first distance map reliability generation process, 1342 second distance map reliability generation process, 136 distance map difference Extraction processing, 135 Distance map high reliability region extraction processing, 137 Strobe light distribution lens peripheral light amount information, 140 Moving body region composition ratio correction processing, 150 Distance light amount ratio correlation calculation processing, 301 Image sensor, 302 Memory, 303 WB control unit 304 color conversion MTR circuit, 305 LPF circuit, 306 CSUP circuit, 307 RGB conversion circuit, 308 gamma correction circuit, 309 color luminance conversion circuit, 310 JPEG compression circuit, 311 Y generation circuit, 312 edge enhancement circuit, 313 lens barrel control Circuit, 314 CPU, 315 lens barrel, 316 Flash output unit, 320 peripheral light amount correction unit, 325 image synthesis processing unit

Claims (9)

ストロボ光に対応した第1のホワイトバランス補正値を用いて、環境光の下でストロボ発光時に撮影された第1の画像のホワイトバランスを補正し、環境光に対応した第2のホワイトバランス補正値を用いて、ストロボ発光が無い環境光の下で撮影された第2の画像のホワイトバランスを補正する補正手段と、
前記第1の画像の撮影がなされた際の各被写体までの距離を表す被写体距離を取得する取得手段と、
第1の画像から、前記第1の画像の撮影と前記第2の画像の撮影がなされた間に移動した移動被写体の被写体領域を抽出する抽出手段と、
前記第1の画像と第2の画像とに基づいて、前記第1の画像の被写体領域毎にストロボ光と環境光の光量比率を求め、前記被写体領域毎の前記光量比率に基づいて、前記第1の画像と第2の画像を被写体領域毎に合成するための合成比率を決定する決定手段と、
前記被写体距離とストロボ光の配光特性とに基づいて、前記第1の画像が撮影された際の、被写体領域毎のストロボ光の照射量を推定して、前記被写体領域毎のストロボ光の照射量と環境光との割合を算出する算出手段と、
前記移動被写体の被写体領域については前記算出された前記割合を前記合成比率として用い、前記移動被写体ではない被写体の被写体領域については前記決定手段にて決定された合成比率を用いて、前記ホワイトバランス補正がなされた後の前記第1の画像と前記第2の画像を被写体領域毎に合成する合成手段と
を有することを特徴とする画像処理装置。
The first white balance correction value corresponding to the strobe light is used to correct the white balance of the first image taken when the strobe light is emitted under the ambient light, and the second white balance correction value corresponding to the ambient light. Correcting means for correcting the white balance of the second image taken under ambient light without strobe light emission,
An acquisition means for acquiring a subject distance representing a distance to each subject when the first image is captured;
Extraction means for extracting from the first image a subject area of a moving subject that has moved during the shooting of the first image and the shooting of the second image;
Based on the first image and the second image, a light quantity ratio between strobe light and ambient light is obtained for each subject area of the first image, and based on the light quantity ratio for each subject area, the first light quantity ratio is obtained. Determining means for determining a synthesis ratio for synthesizing the first image and the second image for each subject area;
Based on the subject distance and the light distribution characteristic of the strobe light, the amount of strobe light irradiation for each subject region when the first image is taken is estimated, and the strobe light irradiation for each subject region is estimated. A calculating means for calculating a ratio between the amount and the ambient light;
The white balance correction is performed using the calculated ratio as the composition ratio for the subject area of the moving subject, and using the composition ratio determined by the determining means for the subject area of the subject that is not the moving subject. An image processing apparatus, comprising: a combining unit that combines the first image and the second image after being subjected to each subject area.
ストロボ光に対応した第1のホワイトバランス補正値を用いて、環境光の下でストロボ発光時に撮影された第1の画像のホワイトバランスを補正し、環境光に対応した第2のホワイトバランス補正値を用いて、ストロボ発光が無い環境光の下で撮影された第2の画像のホワイトバランスを補正する補正手段と、
前記第1の画像の撮影がなされた際の各被写体までの距離を表す被写体距離を取得する取得手段と、
第1の画像から、前記第1の画像の撮影と前記第2の画像の撮影がなされた間に移動した移動被写体の被写体領域を抽出する抽出手段と、
前記第1の画像と第2の画像とに基づいて、前記第1の画像の被写体領域毎にストロボ光と環境光の光量比率を求め、前記被写体領域毎の前記光量比率に基づいて、前記第1の画像と第2の画像を被写体領域毎に合成するための合成比率を決定する決定手段と、
前記被写体距離と前記光量比率との間の相関演算を行って相関係数を求める相関演算手段と、
前記移動被写体の被写体領域については前記演算された前記相関係数に基づいて補正した合成比率を用い、前記移動被写体ではない被写体の被写体領域については前記決定手段にて決定された合成比率を用いて、前記ホワイトバランス補正がなされた後の前記第1の画像と前記第2の画像を被写体領域毎に合成する合成手段と
を有することを特徴とする画像処理装置。
The first white balance correction value corresponding to the strobe light is used to correct the white balance of the first image taken when the strobe light is emitted under the ambient light, and the second white balance correction value corresponding to the ambient light. Correcting means for correcting the white balance of the second image taken under ambient light without strobe light emission,
An acquisition means for acquiring a subject distance representing a distance to each subject when the first image is captured;
Extraction means for extracting from the first image a subject area of a moving subject that has moved during the shooting of the first image and the shooting of the second image;
Based on the first image and the second image, a light quantity ratio between strobe light and ambient light is obtained for each subject area of the first image, and based on the light quantity ratio for each subject area, the first light quantity ratio is obtained. Determining means for determining a synthesis ratio for synthesizing the first image and the second image for each subject area;
Correlation calculating means for calculating a correlation coefficient by performing a correlation calculation between the subject distance and the light amount ratio;
For the subject area of the moving subject, the composite ratio corrected based on the calculated correlation coefficient is used, and for the subject area of the subject that is not the moving subject, the composite ratio determined by the determining means is used. An image processing apparatus comprising: a combining unit that combines the first image and the second image after the white balance correction for each subject area.
前記取得手段は、前記移動被写体の被写体領域について前記被写体距離の信頼度を求め、
前記合成手段は、
前記被写体距離の信頼度の値が所定の閾値以上の移動被写体の被写体領域については、前記相関演算手段による前記相関係数に基づいて補正した前記合成比率を用い、
前記被写体距離の信頼度の値が所定の閾値より低い移動被写体の被写体領域については、前記被写体距離の代表値を求め、前記被写体距離の代表値と前記光量比率との間の相関演算による前記相関係数を求めて、前記被写体距離の代表値と前記光量比率との間の相関演算による前記相関係数に基づいて補正した前記合成比率を用いて、
前記ホワイトバランス補正がなされた後の前記第1の画像と前記第2の画像を被写体領域毎に合成することを特徴とする請求項2に記載の画像処理装置。
The acquisition means obtains the reliability of the subject distance for the subject area of the moving subject,
The synthesis means includes
For the subject area of the moving subject whose reliability value of the subject distance is equal to or greater than a predetermined threshold, the composite ratio corrected based on the correlation coefficient by the correlation calculating means is used.
For a subject area of a moving subject whose reliability value of the subject distance is lower than a predetermined threshold, a representative value of the subject distance is obtained, and the phase is calculated by a correlation calculation between the representative value of the subject distance and the light amount ratio. Using the composite ratio corrected based on the correlation coefficient by the correlation calculation between the representative value of the subject distance and the light amount ratio, by obtaining the relationship number,
The image processing apparatus according to claim 2, wherein the first image and the second image after the white balance correction are combined for each subject area.
前記抽出手段は、前記第1の画像の被写体領域毎の第1の色味情報と前記第2の画像の被写体領域毎の第2の色味情報を求め、前記第1の色味情報と第2の色味情報とに差がある被写体領域を、前記移動被写体の被写体領域として抽出することを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。   The extraction means obtains first color information for each subject area of the first image and second color information for each subject area of the second image, and obtains the first color information and the first color information. The image processing apparatus according to claim 1, wherein a subject area having a difference between the two color information is extracted as a subject area of the moving subject. 前記抽出手段は、前記第1の画像の撮影がなされた際の被写体距離と前記第2の画像の撮影がなされた際の被写体距離とに差がある被写体領域を、前記移動被写体の被写体領域として抽出することを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。   The extraction means uses a subject area having a difference between a subject distance when the first image is taken and a subject distance when the second image is taken as a subject area of the moving subject. The image processing apparatus according to claim 1, wherein the image processing apparatus is extracted. 前記決定手段は、前記合成比率に対する補間処理により画素毎の合成比率を決定し、
前記合成手段は、前記画素毎の合成比率により前記第1の画像と前記第2の画像を合成することを特徴とする請求項1〜5のいずれか1項に記載の画像処理装置。
The determining means determines a composition ratio for each pixel by an interpolation process for the composition ratio,
The image processing apparatus according to claim 1, wherein the synthesizing unit synthesizes the first image and the second image based on a synthesis ratio for each pixel.
補正手段が、ストロボ光に対応した第1のホワイトバランス補正値を用いて、環境光の下でストロボ発光時に撮影された第1の画像のホワイトバランスを補正し、環境光に対応した第2のホワイトバランス補正値を用いて、ストロボ発光が無い環境光の下で撮影された第2の画像のホワイトバランスを補正するステップと、
取得手段が、前記第1の画像の撮影がなされた際の各被写体までの距離を表す被写体距離を取得するステップと、
抽出手段が、第1の画像から、前記第1の画像の撮影と前記第2の画像の撮影がなされた間に移動した移動被写体の被写体領域を抽出するステップと、
決定手段が、前記第1の画像と第2の画像とに基づいて、前記第1の画像の被写体領域毎にストロボ光と環境光の光量比率を求め、前記被写体領域毎の前記光量比率に基づいて、前記第1の画像と第2の画像を被写体領域毎に合成するための合成比率を決定するステップと、
算出手段が、前記被写体距離とストロボ光の配光特性とに基づいて、前記第1の画像が撮影された際の、被写体領域毎のストロボ光の照射量を推定して、前記被写体領域毎のストロボ光の照射量と環境光との割合を算出するステップと、
合成手段が、前記移動被写体の被写体領域については前記算出された前記割合を前記合成比率として用い、前記移動被写体ではない被写体の被写体領域については前記決定手段にて決定された合成比率を用いて、前記ホワイトバランス補正がなされた後の前記第1の画像と前記第2の画像を被写体領域毎に合成するステップと
を含むことを特徴とする画像処理方法。
The correction means corrects the white balance of the first image taken at the time of flash emission under the ambient light using the first white balance correction value corresponding to the flash light, and the second corresponding to the environmental light. Using the white balance correction value to correct the white balance of the second image taken under ambient light without flash emission;
An obtaining unit obtaining a subject distance representing a distance to each subject when the first image is captured;
An extracting unit extracting, from the first image, a subject area of a moving subject that has moved during the shooting of the first image and the shooting of the second image;
Based on the first image and the second image, the determining means obtains a light quantity ratio of strobe light and ambient light for each subject area of the first image, and based on the light quantity ratio for each subject area. Determining a combining ratio for combining the first image and the second image for each subject area;
The calculation means estimates the amount of strobe light irradiation for each subject area when the first image is taken based on the subject distance and the light distribution characteristic of the strobe light, and Calculating a ratio between the amount of strobe light irradiation and ambient light;
Combining means uses the calculated ratio as the combining ratio for the subject area of the moving subject, and uses the combining ratio determined by the determining means for the subject area of the subject that is not the moving subject, An image processing method comprising: synthesizing the first image after the white balance correction and the second image for each subject area.
補正手段が、ストロボ光に対応した第1のホワイトバランス補正値を用いて、環境光の下でストロボ発光時に撮影された第1の画像のホワイトバランスを補正し、環境光に対応した第2のホワイトバランス補正値を用いて、ストロボ発光が無い環境光の下で撮影された第2の画像のホワイトバランスを補正するステップと、
取得手段が、前記第1の画像の撮影がなされた際の各被写体までの距離を表す被写体距離を取得するステップと、
抽出手段が、第1の画像から、前記第1の画像の撮影と前記第2の画像の撮影がなされた間に移動した移動被写体の被写体領域を抽出するステップと、
決定手段が、前記第1の画像と第2の画像とに基づいて、前記第1の画像の被写体領域毎にストロボ光と環境光の光量比率を求め、前記被写体領域毎の前記光量比率に基づいて、前記第1の画像と第2の画像を被写体領域毎に合成するための合成比率を決定するステップと、
相関演算手段が、前記被写体距離と前記光量比率との間の相関演算を行って相関係数を求めるステップと、
合成手段が、前記移動被写体の被写体領域については前記演算された前記相関係数に基づいて補正した合成比率を用い、前記移動被写体ではない被写体の被写体領域については前記決定手段にて決定された合成比率を用いて、前記ホワイトバランス補正がなされた後の前記第1の画像と前記第2の画像を被写体領域毎に合成するステップと
を含むことを特徴とする画像処理方法。
The correction means corrects the white balance of the first image taken at the time of flash emission under the ambient light using the first white balance correction value corresponding to the flash light, and the second corresponding to the environmental light. Using the white balance correction value to correct the white balance of the second image taken under ambient light without flash emission;
An obtaining unit obtaining a subject distance representing a distance to each subject when the first image is captured;
An extracting unit extracting, from the first image, a subject area of a moving subject that has moved during the shooting of the first image and the shooting of the second image;
Based on the first image and the second image, the determining means obtains a light quantity ratio of strobe light and ambient light for each subject area of the first image, and based on the light quantity ratio for each subject area. Determining a combining ratio for combining the first image and the second image for each subject area;
A step of calculating a correlation coefficient by performing a correlation calculation between the subject distance and the light amount ratio;
The composition means uses the composition ratio corrected based on the calculated correlation coefficient for the subject area of the moving subject, and the composition determined by the determination means for the subject area of the subject that is not the moving subject. An image processing method comprising: combining the first image after the white balance correction and the second image for each subject area using a ratio.
コンピュータを、請求項1〜6のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1-6.
JP2015154241A 2015-08-04 2015-08-04 Image processing apparatus, image processing method, and program Pending JP2017034536A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015154241A JP2017034536A (en) 2015-08-04 2015-08-04 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015154241A JP2017034536A (en) 2015-08-04 2015-08-04 Image processing apparatus, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2017034536A true JP2017034536A (en) 2017-02-09

Family

ID=57989043

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015154241A Pending JP2017034536A (en) 2015-08-04 2015-08-04 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2017034536A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019087299A1 (en) * 2017-10-31 2019-05-09 株式会社モルフォ Image combination device, image combination method, image combination program, and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019087299A1 (en) * 2017-10-31 2019-05-09 株式会社モルフォ Image combination device, image combination method, image combination program, and storage medium
CN109997350A (en) * 2017-10-31 2019-07-09 株式会社摩如富 Image synthesizer, image composition method, image synthesis program and storage medium
CN109997350B (en) * 2017-10-31 2021-01-15 株式会社摩如富 Image synthesizing apparatus, image synthesizing method, and storage medium
US11272124B2 (en) 2017-10-31 2022-03-08 Morpho, Inc. Image compositing device, image compositing method, and storage medium

Similar Documents

Publication Publication Date Title
JP6049343B2 (en) Image processing apparatus, image processing method, and program
KR101388130B1 (en) Image processing apparatus and image processing method
JP5743696B2 (en) Image processing apparatus, image processing method, and program
KR101352440B1 (en) Image processing apparatus, image processing method, and recording medium
JP5808142B2 (en) Image processing apparatus, image processing method, and program
US9036046B2 (en) Image processing apparatus and method with white balance correction
US8810681B2 (en) Image processing apparatus and image processing method
US11838648B2 (en) Image processing device, imaging apparatus, image processing method, and program for determining a condition for high dynamic range processing
JP5854716B2 (en) Image processing apparatus, image processing method, and program
JP6570311B2 (en) Image processing apparatus and image processing method
JP2003309854A (en) Digital camera
JP2017034536A (en) Image processing apparatus, image processing method, and program
JP2014120813A (en) Image pickup device and image pickup method
JP5943682B2 (en) Imaging apparatus, control method thereof, and program
JP6900577B2 (en) Image processing equipment and programs
JP5292829B2 (en) Imaging device
JP6021885B2 (en) Image processing apparatus, image processing method, and program
JP2016005105A (en) Imaging apparatus
JP6616674B2 (en) Image processing apparatus and method, and imaging apparatus
JP2023154575A (en) Imaging apparatus and control method for the same, and image processing device
JP2017188852A (en) Imaging apparatus, imaging method, and program