JP2010197968A - Focus evaluation apparatus, camera and program - Google Patents

Focus evaluation apparatus, camera and program Download PDF

Info

Publication number
JP2010197968A
JP2010197968A JP2009045945A JP2009045945A JP2010197968A JP 2010197968 A JP2010197968 A JP 2010197968A JP 2009045945 A JP2009045945 A JP 2009045945A JP 2009045945 A JP2009045945 A JP 2009045945A JP 2010197968 A JP2010197968 A JP 2010197968A
Authority
JP
Japan
Prior art keywords
focus evaluation
focus
image
color component
region
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.)
Granted
Application number
JP2009045945A
Other languages
Japanese (ja)
Other versions
JP5463688B2 (en
Inventor
Tsukasa Murata
司 村田
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.)
Nikon Corp
Original Assignee
Nikon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2009045945A priority Critical patent/JP5463688B2/en
Publication of JP2010197968A publication Critical patent/JP2010197968A/en
Application granted granted Critical
Publication of JP5463688B2 publication Critical patent/JP5463688B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)
  • Focusing (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a means for more appropriately evaluating focus with giving consideration to the whole main object. <P>SOLUTION: The focus evaluation apparatus includes: a target area setting part; a frequency distribution generating part; a color component analyzing part; an evaluation area setting part; and a focus calculating part. The target area setting part sets the target area in a part of a photographed image photographed by an imaging apparatus. The frequency distribution generating part determines the frequency distribution of color components included in the image in the target area. The color component analyzing part sets at least one or more ranges of the main color components in the target area on the basis of the frequency distribution. The evaluation area setting part classifies the color components in each position of the photographed image in accordance with the range of the main color components and sets the focus evaluation area in the photographed image on the basis of the classification result. The focus calculating part evaluates the focused state of the object in the focus evaluation area. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、合焦評価装置、カメラおよびプログラムに関する。   The present invention relates to a focus evaluation apparatus, a camera, and a program.

一般的に、撮像装置のオートフォーカス(AF)について、焦点検出エリアの形状および位置は撮像装置の設計段階で予め制約される。また、従来から、色情報に基づいて撮影画像から主要被写体を抽出する技術も知られている。一例として、特許文献1には、主要被写体が人物であることを前提として、色情報に基づいて撮影画像から肌の領域を抽出する技術が開示されている。   In general, for autofocus (AF) of an imaging apparatus, the shape and position of a focus detection area are constrained in advance at the design stage of the imaging apparatus. Conventionally, a technique for extracting a main subject from a photographed image based on color information is also known. As an example, Patent Document 1 discloses a technique for extracting a skin region from a captured image based on color information on the premise that a main subject is a person.

しかし、従来の技術では、被写体の局所的な一点ではなく、主要被写体の全体を考慮して適切な合焦評価を行うことは困難であった。しかも、通常の撮影では、主要被写体の種類や色は予め特定できないため、色情報によって主要被写体の抽出を行うことも困難である。   However, with the conventional technology, it is difficult to perform an appropriate focus evaluation in consideration of the entire main subject rather than a single point on the subject. In addition, in normal shooting, the type and color of the main subject cannot be specified in advance, and it is difficult to extract the main subject from the color information.

そこで、本発明は、主要被写体の全体を考慮してより適切な合焦評価を行うための手段を提供することを目的とする。   Accordingly, an object of the present invention is to provide means for performing more appropriate focus evaluation in consideration of the entire main subject.

一の態様の合焦評価装置は、注目領域設定部と、度数分布生成部と、色成分解析部と、評価領域設定部と、合焦演算部とを備える。注目領域設定部は、撮像装置で撮影された撮影画像の一部に注目領域を設定する。度数分布生成部は、注目領域の画像に含まれる色成分の度数分布を求める。色成分解析部は、度数分布に基づいて、注目領域における主要色成分の範囲を少なくとも1以上設定する。評価領域設定部は、撮影画像の各位置の色成分を主要色成分の範囲に応じて分類し、該分類結果に基づいて撮影画像内に合焦評価領域を設定する。合焦演算部は、合焦評価領域で被写体の合焦評価を行う。   The focus evaluation apparatus according to one aspect includes an attention area setting section, a frequency distribution generation section, a color component analysis section, an evaluation area setting section, and a focus calculation section. The attention area setting unit sets the attention area in a part of the captured image captured by the imaging device. The frequency distribution generation unit obtains a frequency distribution of color components included in the image of the attention area. The color component analysis unit sets at least one or more main color component ranges in the region of interest based on the frequency distribution. The evaluation area setting unit classifies the color component at each position of the captured image according to the range of the main color component, and sets a focus evaluation area in the captured image based on the classification result. The focus calculation unit performs focus evaluation of the subject in the focus evaluation area.

上記の一の態様において、評価領域設定部は、注目領域と少なくとも一部が重なる位置に合焦評価領域を設定してもよい。   In the one aspect described above, the evaluation area setting unit may set the focus evaluation area at a position at least partially overlapping the attention area.

上記の一の態様において、評価領域設定部は、分類結果によって合焦評価領域の候補領域が複数設定されたときに、各々の候補領域の空間分布に基づいて合焦評価領域を設定してもよい。   In the above aspect, the evaluation region setting unit may set the focus evaluation region based on the spatial distribution of each candidate region when a plurality of focus evaluation region candidate regions are set according to the classification result. Good.

上記の一の態様において、色成分として色相の情報を用いてもよい。   In the one aspect described above, hue information may be used as the color component.

なお、上記の一の態様の合焦評価装置を備えたカメラや、コンピュータを上記の一の態様の合焦評価装置として機能させるプログラムや、このプログラムを記憶した記憶媒体や、上記の一の態様における合焦評価装置の動作を方法のカテゴリで表現したものも、本発明の具体的態様として有効である。   In addition, the camera provided with the focusing evaluation apparatus according to the one aspect described above, a program that causes a computer to function as the focusing evaluation apparatus according to the first aspect, a storage medium that stores the program, and the one aspect described above Expressing the operation of the in-focus evaluation apparatus in the method category is also effective as a specific aspect of the present invention.

本発明では、注目領域の色成分の度数分布から主要色成分の範囲を設定し、この主要色成分の範囲に基づいて設定された合焦評価領域によって、主要被写体の全体を考慮してより適切な合焦評価を行うことができる。   In the present invention, the range of the main color component is set from the frequency distribution of the color components of the attention area, and the focus evaluation area set based on the range of the main color component is more appropriate in consideration of the entire main subject. Focusing evaluation can be performed.

一の実施形態における電子カメラの構成例を示すブロック図1 is a block diagram illustrating a configuration example of an electronic camera according to an embodiment. 一の実施形態の電子カメラにおける撮影モードでの動作例を示す流れ図6 is a flowchart showing an operation example in a shooting mode in the electronic camera of one embodiment. 一の実施形態における処理対象の画像の例を示す図The figure which shows the example of the image of the process target in one Embodiment 図3の画像に対応する色相成分のヒストグラムHistogram of hue component corresponding to the image of FIG. 注目領域の主要色成分の範囲に基づいて、図3の画像を領域分割した例を示す図The figure which shows the example which divided | segmented the image of FIG. 3 into the area | region based on the range of the main color component of an attention area 画像全体の色相から決定した主要色成分の範囲によって、図3の画像を領域分割した比較例を示す図The figure which shows the comparative example which divided | segmented the image of FIG. 3 into the area | region by the range of the main color component determined from the hue of the whole image 図3の画像における合焦評価領域の設定例を示す図The figure which shows the example of a setting of the focusing evaluation area | region in the image of FIG. 他の実施形態に係る焦点評価装置の構成例を示すブロック図The block diagram which shows the structural example of the focus evaluation apparatus which concerns on other embodiment. 他の実施形態における焦点評価処理の動作例を説明する流れ図Flowchart for explaining an operation example of focus evaluation processing in another embodiment

<一の実施形態の説明>
図1は、一の実施形態における電子カメラの構成例を示すブロック図である。電子カメラ11は、フォーカシングレンズ12と、レンズ駆動部13と、撮像素子14と、制御部15と、ROM16と、メインメモリ17と、モニタ18と、記録I/F19と、レリーズ釦20とを有している。ここで、レンズ駆動部13、撮像素子14、ROM16、メインメモリ17、モニタ18、記録I/F19およびレリーズ釦20は、それぞれ制御部15に接続されている。
<Description of One Embodiment>
FIG. 1 is a block diagram illustrating a configuration example of an electronic camera according to an embodiment. The electronic camera 11 includes a focusing lens 12, a lens driving unit 13, an image sensor 14, a control unit 15, a ROM 16, a main memory 17, a monitor 18, a recording I / F 19, and a release button 20. is doing. Here, the lens driving unit 13, the image sensor 14, the ROM 16, the main memory 17, the monitor 18, the recording I / F 19 and the release button 20 are connected to the control unit 15.

フォーカシングレンズ12は、焦点調節を行うためのレンズである。このフォーカシングレンズ12のレンズ位置は、レンズ駆動部13によって光軸方向に調整される。   The focusing lens 12 is a lens for performing focus adjustment. The lens position of the focusing lens 12 is adjusted by the lens driving unit 13 in the optical axis direction.

撮像素子14は、フォーカシングレンズ12を含む撮像光学系によって結像される被写体の像を撮影(撮像)し、カラーの撮影画像の画像信号を生成する。なお、撮像素子14から出力された画像信号は、A/D変換回路(不図示)を介して制御部15に入力される。   The imaging element 14 captures (captures) an image of a subject formed by an imaging optical system including the focusing lens 12 and generates an image signal of a color captured image. The image signal output from the image sensor 14 is input to the control unit 15 via an A / D conversion circuit (not shown).

ここで、電子カメラ11の撮影モードにおいて、撮像素子14はレリーズ釦20の全押し操作に応答して記録用の静止画像(本画像)を撮像する。また、撮影モードでの撮像素子14は、撮影待機時にも所定間隔毎に観測用の画像(スルー画像)を連続的に撮像する。ここで、時系列に取得されたスルー画像のデータは、モニタ18での動画像表示や制御部15による各種の演算処理に使用される。   Here, in the photographing mode of the electronic camera 11, the image sensor 14 captures a still image (main image) for recording in response to a full pressing operation of the release button 20. Further, the imaging element 14 in the shooting mode continuously captures images for observation (through images) at predetermined intervals even during standby for shooting. Here, the data of the through image acquired in time series is used for moving image display on the monitor 18 and various arithmetic processes by the control unit 15.

制御部15は、電子カメラ11の動作を統括的に制御するプロセッサである。この制御部15は、ROM16に格納されたプログラムの実行により、画像処理部21、注目領域設定部22、度数分布生成部23、色成分解析部24、評価領域設定部25、合焦演算部26として機能する。   The control unit 15 is a processor that comprehensively controls the operation of the electronic camera 11. The control unit 15 executes an image processing unit 21, a region of interest setting unit 22, a frequency distribution generation unit 23, a color component analysis unit 24, an evaluation region setting unit 25, and a focus calculation unit 26 by executing a program stored in the ROM 16. Function as.

画像処理部21は、撮影画像のデータに対して各種の画像処理(色補間処理、階調変換処理、輪郭強調処理、ホワイトバランス調整、色変換処理など)を施す。なお、注目領域設定部22、度数分布生成部23、色成分解析部24、評価領域設定部25、合焦演算部26の動作については後述する。   The image processing unit 21 performs various types of image processing (color interpolation processing, gradation conversion processing, contour enhancement processing, white balance adjustment, color conversion processing, etc.) on the captured image data. The operations of the attention area setting unit 22, the frequency distribution generation unit 23, the color component analysis unit 24, the evaluation area setting unit 25, and the focus calculation unit 26 will be described later.

ROM16には、制御部15によって実行されるプログラムが記憶されている。なお、このプログラムによる撮影モードでの動作例については後述する。また、メインメモリ17は、画像処理部21による画像処理の前工程や後工程で画像のデータを一時的に記憶する。また、モニタ18は、制御部15の指示に応じて各種画像を表示する。   The ROM 16 stores a program executed by the control unit 15. An example of the operation in the shooting mode by this program will be described later. Further, the main memory 17 temporarily stores image data in the pre-process and post-process of image processing by the image processing unit 21. The monitor 18 displays various images according to instructions from the control unit 15.

記録I/F19は、不揮発性の記憶媒体19aを接続するためのコネクタを有している。そして、記録I/F19は、コネクタに接続された記憶媒体19aに対してデータの書き込み/読み込みを実行する。上記の記憶媒体19aは、ハードディスクや、半導体メモリを内蔵したメモリカードなどで構成される。なお、図1では記憶媒体19aの一例としてメモリカードを図示する。   The recording I / F 19 has a connector for connecting a nonvolatile storage medium 19a. Then, the recording I / F 19 executes data writing / reading with respect to the storage medium 19a connected to the connector. The storage medium 19a includes a hard disk, a memory card incorporating a semiconductor memory, or the like. In FIG. 1, a memory card is illustrated as an example of the storage medium 19a.

レリーズ釦20は、半押し操作による撮影前のAF動作開始の指示入力と、全押し操作による撮像動作開始の指示入力とをユーザから受け付ける。   The release button 20 receives from the user an instruction input for starting an AF operation before photographing by a half-press operation and an instruction input for starting an imaging operation by a full-press operation.

次に、図2の流れ図を参照しつつ、一の実施形態の電子カメラ11における撮影モードでの動作例を説明する。なお、図2の流れ図の処理は、制御部15の制御によって、ユーザの撮影モードの起動操作に応じて開始される。   Next, an operation example in the shooting mode in the electronic camera 11 of the embodiment will be described with reference to the flowchart of FIG. Note that the processing of the flowchart of FIG. 2 is started in response to a user's activation operation of the shooting mode under the control of the control unit 15.

ステップS101:制御部15は、撮像素子14を駆動させてスルー画像の撮像を開始する。その後、スルー画像は所定間隔ごとに逐次生成されることとなる。なお、撮像素子14から出力されたスルー画像のデータは、制御部15に入力される。   Step S101: The control unit 15 drives the imaging device 14 to start capturing a through image. Thereafter, the through images are sequentially generated at predetermined intervals. The through image data output from the image sensor 14 is input to the control unit 15.

また、撮影モードでの制御部15は、スルー画像から生成された表示用の画像(ビュー画像)をモニタ18に動画表示させる。したがって、ユーザは、モニタ18のビュー画像を参照して、撮影構図を決定するためのフレーミングを行うことができる。   Further, the control unit 15 in the shooting mode causes the monitor 18 to display a moving image of the display image (view image) generated from the through image. Therefore, the user can perform framing for determining the shooting composition with reference to the view image on the monitor 18.

ステップS102:注目領域設定部22は、撮影画面(スルー画像の撮影範囲)の一部に注目領域を設定する。この注目領域は、スルー画像のうちから主要被写体の色情報を抽出する範囲となる。例えば、注目領域設定部22は、ユーザの操作により指定された範囲を注目領域とする。   Step S102: The attention area setting unit 22 sets the attention area in a part of the photographing screen (through image photographing range). This attention area is a range in which color information of the main subject is extracted from the through image. For example, the attention area setting unit 22 sets a range designated by a user operation as the attention area.

また、制御部15は、注目領域の範囲を示す表示を上記のビュー画像に重畳させてモニタ18に出力する。これにより、ユーザは、注目領域の位置に主要被写体が収まるように構図を決定できる。なお、一の実施形態では、注目領域の位置に主要被写体がある構図のときにユーザがレリーズ釦20の半押し操作を行うものとする。   In addition, the control unit 15 superimposes a display indicating the range of the attention area on the view image and outputs it to the monitor 18. As a result, the user can determine the composition so that the main subject is within the position of the region of interest. In one embodiment, it is assumed that the user performs a half-press operation of the release button 20 when the main subject is in the position of the attention area.

ステップS103:制御部15は、レリーズ釦20の半押し操作を受け付けたか否かを判定する。上記要件を満たす場合(YES側)にはS104に処理が移行する。一方、上記要件を満たさない場合(NO側)には、制御部15はレリーズ釦20の半押し操作を待機する。   Step S103: The control unit 15 determines whether or not a half-press operation of the release button 20 has been accepted. If the above requirement is satisfied (YES side), the process proceeds to S104. On the other hand, when the above requirement is not satisfied (NO side), the control unit 15 waits for a half-press operation of the release button 20.

ステップS104:制御部15は、レリーズ釦20の半押し操作のタイミングで取得されたスルー画像を処理対象の画像とする。なお、図3は、一の実施形態における処理対象の画像の例を示している。図3では、注目領域の位置を矩形の枠で示している。なお、図3での注目領域は、画像上の岩の部分と重なっている。   Step S104: The control unit 15 sets the through image acquired at the timing of the half-press operation of the release button 20 as a processing target image. FIG. 3 shows an example of an image to be processed in one embodiment. In FIG. 3, the position of the attention area is indicated by a rectangular frame. Note that the region of interest in FIG. 3 overlaps the rock portion on the image.

ステップS105:制御部15は、処理対象の画像の色空間をHSV色空間(またはHLS色空間)に変換する。一の実施形態での制御部15は、RGB色空間(またはYUV色空間)のカラーのスルー画像のデータを、HSV色空間に対応した8bitの画像のデータに変換するものとする。   Step S105: The control unit 15 converts the color space of the image to be processed into an HSV color space (or HLS color space). In one embodiment, the control unit 15 converts RGB color space (or YUV color space) color through-image data into 8-bit image data corresponding to the HSV color space.

ステップS106:度数分布生成部23は、処理対象の画像の注目領域に含まれる各画素の色相成分(H)に注目し、注目領域内での色相成分と画素数との対応関係を示す度数分布を求める。   Step S106: The frequency distribution generation unit 23 pays attention to the hue component (H) of each pixel included in the attention area of the processing target image, and indicates the frequency distribution indicating the correspondence between the hue component and the number of pixels in the attention area. Ask for.

ここで、図4は、図3の処理対象の画像に対応する色相成分のヒストグラムを示す。図4の横軸は、8bitの色相値(0−255)を示し、図4の縦軸は各々の色相値に対応する画素数(頻度)を示している。この図4の例では、縦軸の画素数を8bit(0−255)の範囲に正規化した状態で示している。また、図4において、注目領域内での色相成分と画素数との対応関係を示すヒストグラムは実線で示している。なお、図4では、上記の比較例として、処理対象の画像全体での色相成分と画素数との対応関係を示すヒストグラムを破線で示している。   Here, FIG. 4 shows a histogram of hue components corresponding to the image to be processed in FIG. The horizontal axis in FIG. 4 indicates an 8-bit hue value (0-255), and the vertical axis in FIG. 4 indicates the number of pixels (frequency) corresponding to each hue value. In the example of FIG. 4, the number of pixels on the vertical axis is normalized in the range of 8 bits (0-255). In FIG. 4, the histogram indicating the correspondence between the hue component and the number of pixels in the region of interest is indicated by a solid line. In FIG. 4, as a comparative example described above, a histogram indicating the correspondence relationship between the hue component and the number of pixels in the entire image to be processed is indicated by a broken line.

図3の画像は、画像全体において木や芝生による緑色の部分の比率が高く、注目領域に対応する岩の部分は相対的に比率が小さい。そのため、図4の破線で示す画像全体のヒストグラムでは、緑の色相の範囲(色相値50の周辺)における頻度が非常に高く、岩の色相の範囲(色相値100−180の周辺)における頻度は相対的に低くなってしまう。   In the image of FIG. 3, the ratio of the green part due to trees or lawn is high in the entire image, and the ratio of the rock part corresponding to the region of interest is relatively small. Therefore, in the histogram of the entire image shown by the broken line in FIG. 4, the frequency in the green hue range (around the hue value 50) is very high, and the frequency in the rock hue range (around the hue value 100-180) is It will be relatively low.

一方、図3の画像の注目領域では、岩の部分の比率が非常に高く、緑色の部分はほとんど含まれていない。そのため、図4の実線で示す注目領域のヒストグラムでは、岩の色相の範囲における頻度が非常に高く、緑の色相の範囲における頻度はゼロに近くなる。このことから、注目領域での色相成分の度数分布には、主要被写体(岩)の色相の特徴がよく反映されていることが分かる。   On the other hand, in the attention area of the image of FIG. 3, the ratio of the rock portion is very high, and the green portion is hardly included. Therefore, in the histogram of the attention area indicated by the solid line in FIG. 4, the frequency in the rock hue range is very high, and the frequency in the green hue range is close to zero. From this, it can be seen that the hue characteristics of the main subject (rock) are well reflected in the frequency distribution of the hue component in the region of interest.

ステップS107:制御部15は、注目領域での色相成分の度数分布(S106で求めたもの)につき、隣接する色相間で頻度の変化を平滑化する。具体的には、制御部15は、度数分布の各色相成分に対して、色相値が1ずつ異なる2つの色相成分との間で頻度の平滑化を行う平滑化フィルタ(1/4[1,2,1]の平滑化フィルタ)をそれぞれ適用する。このS107の処理は、図4に示す実線のヒストグラムの横軸方向に平滑化フィルタをかけて、ヒストグラムの曲線を滑らかにすることに相当する。なお、制御部15は、上記の処理において周期境界条件を適用し、色相値の上限(色相値255)および下限(色相値0)を連続するものとして扱う。これにより、色相値の上限および下限でも頻度の平滑化が可能となる。   Step S107: The control unit 15 smoothes the change in frequency between adjacent hues with respect to the frequency distribution of the hue components in the attention area (obtained in S106). Specifically, the control unit 15 performs a smoothing filter (1/4 [1, 1/4 [1, 2) for smoothing the frequency between two hue components having different hue values by one for each hue component of the frequency distribution. 2, 1] smoothing filter) is applied. The processing of S107 corresponds to smoothing the curve of the histogram by applying a smoothing filter in the horizontal axis direction of the solid line histogram shown in FIG. The control unit 15 applies the periodic boundary condition in the above processing, and treats the upper limit (hue value 255) and lower limit (hue value 0) of the hue value as being continuous. As a result, the frequency can be smoothed even at the upper and lower limits of the hue value.

また、S107の処理において、度数分布の頻度の平滑化をある程度まで行うと、後述の主要色成分の範囲を設定し易くなる。その一方で、度数分布の頻度の平滑化を過度に行うと、色相成分に基づいて領域分割を行う位置があいまいとなる傾向がある。よって、S107の処理で平滑化を行う回数は、上記の事情を考慮して制御部15が適宜設定する。なお、一の実施形態の例では、制御部15が3回程度まで平滑化の処理を行うものとする。   Further, if the frequency distribution frequency is smoothed to some extent in the processing of S107, it becomes easy to set a range of main color components described later. On the other hand, if the frequency distribution frequency is excessively smoothed, the position where the region is divided based on the hue component tends to be ambiguous. Therefore, the number of times smoothing is performed in the process of S107 is appropriately set by the control unit 15 in consideration of the above circumstances. In the example of the embodiment, the control unit 15 performs the smoothing process up to about three times.

ステップS108:色成分解析部24は、注目領域での色相成分の度数分布(S107で平滑化されたもの)に基づいて、注目領域における主要色成分の範囲を少なくとも1以上設定する。一例として、色成分解析部24は、以下の(イ)から(ハ)の処理により、主要色成分の範囲の設定を行う。   Step S108: The color component analysis unit 24 sets at least one or more main color component ranges in the attention area based on the frequency distribution of the hue components in the attention area (smoothed in S107). As an example, the color component analysis unit 24 sets a range of main color components by the following processes (a) to (c).

(イ)色成分解析部24は、平滑化後の度数分布において色相値と頻度との対応関係を示す分布関数(図4の実線のヒストグラムを平滑化したものに相当する)を参照し、上記の分布関数で頻度がピークとなる位置(色相値)を主要色成分の候補とする。勿論、上記の主要色成分の候補は複数であってもよい。   (A) The color component analysis unit 24 refers to a distribution function (corresponding to the smoothed histogram of the solid line in FIG. 4) indicating the correspondence between the hue value and the frequency in the smoothed frequency distribution. The position (hue value) at which the frequency becomes a peak in the distribution function is used as a candidate for the main color component. Of course, there may be a plurality of candidates for the main color component.

具体的には、まず、色成分解析部24は、上記の分布関数の横軸方向(色相値の変化する方向)において、頻度分布が極大値となる位置(あるいは分布関数の横軸方向で頻度の差分の符号が正から負へ変化する位置)を求める。そして、色成分解析部24は、分布関数から求めた上記の位置(色相値)のうち、頻度の値が閾値未満となるものを除外して主要色成分の候補とする。なお、一の実施形態では、主要色成分の候補を絞り込む閾値を8bitの階調(0−255)で70に設定した。   Specifically, first, the color component analysis unit 24 determines the position at which the frequency distribution reaches a maximum value (or the frequency in the horizontal axis direction of the distribution function) in the horizontal axis direction (the direction in which the hue value changes) of the above distribution function. The position at which the sign of the difference of (1) changes from positive to negative) is obtained. Then, the color component analysis unit 24 excludes the position (hue value) obtained from the distribution function from which the frequency value is less than the threshold and sets it as a candidate for the main color component. In one embodiment, the threshold for narrowing down the main color component candidates is set to 70 with 8-bit gradation (0-255).

(ロ)色成分解析部24は、上記の主要色成分の候補のうちから、頻度の値の高さに注目して主要色成分の色相値を決定する。具体的には、色成分解析部24は、上記の主要色成分の候補のうちから、頻度の値が高い順に主要色成分の色相値を所定数まで選択する。なお、一の実施形態での色成分解析部24は、主要色成分の色相値を2つまで選択するものとする。   (B) The color component analysis unit 24 determines the hue value of the main color component by paying attention to the frequency value from among the main color component candidates. Specifically, the color component analysis unit 24 selects up to a predetermined number of hue values of the main color components from the main color component candidates in descending order of frequency values. Note that the color component analysis unit 24 in one embodiment selects up to two hue values of main color components.

(ハ)色成分解析部24は、上記の分布関数を参照し、注目する主要色成分の色相値に基づいて主要色成分の範囲を設定する。なお、色成分解析部24は、上記(ロ)で選択された各々の主要色成分の色相値について、主要色成分の範囲をそれぞれ設定する。   (C) The color component analysis unit 24 refers to the distribution function described above, and sets the range of the main color component based on the hue value of the main color component of interest. The color component analysis unit 24 sets the range of the main color component for the hue value of each main color component selected in (b) above.

具体的には、色成分解析部24は、上記の分布関数の横軸方向において、注目する主要色成分の色相値の周囲に生じる谷の位置を探索する。このとき、色成分解析部24は、頻度分布が極小値となる位置(あるいは分布関数の横軸方向で頻度の差分の符号が負から正へ変化する位置)を求めればよい。また、色成分解析部24は、上記の谷を探索するときも、頻度の値が閾値(例えば8bitの階調で70)以上となる位置を除外するものとする。そして、色成分解析部24は、注目する各主要色成分の色相値を中心として、それぞれ左右に隣接する2つの谷までの色相値の範囲を各主要色成分の範囲とする。   Specifically, the color component analysis unit 24 searches for the positions of valleys that occur around the hue value of the main color component of interest in the horizontal axis direction of the distribution function. At this time, the color component analysis unit 24 may obtain a position where the frequency distribution becomes a minimum value (or a position where the sign of the frequency difference changes from negative to positive in the horizontal axis direction of the distribution function). Also, the color component analysis unit 24 excludes positions where the frequency value is equal to or higher than a threshold value (for example, 70 for an 8-bit gradation) when searching for the valley. Then, the color component analysis unit 24 sets the range of the hue values up to two valleys adjacent to the left and right respectively as the range of each main color component with the hue value of each main color component of interest as the center.

なお、一の実施形態では、複数の主要色成分の範囲のうち、主要色成分での色相値の頻度が1番高くなったものを第1の主要色成分の範囲と称する。また、主要色成分での色相値の頻度が2番目高いものを第2の主要色成分の範囲と称する。   In one embodiment, a range in which the frequency of the hue value of the main color component is the highest among the plurality of main color component ranges is referred to as a first main color component range. In addition, the second highest color component range in which the hue value frequency of the main color component is the second highest is referred to.

ステップS109:評価領域設定部25は、処理対象の画像における各画素の色相値に基づいて、画像の領域分割を行う。具体的には、評価領域設定部25は、画像の各画素の色相値がいずれの主要色成分の範囲(S108)に属するかによって分類する。次に、評価領域設定部25は、は、上記の分類結果に基づいて、画像上で同一の主要色成分の範囲に属する画素をそれぞれグループ化して領域分割を行う。   Step S109: The evaluation area setting unit 25 divides the area of the image based on the hue value of each pixel in the image to be processed. Specifically, the evaluation area setting unit 25 performs classification according to which main color component range (S108) the hue value of each pixel of the image belongs to. Next, the evaluation area setting unit 25 performs area division by grouping pixels belonging to the same main color component range on the image based on the above classification result.

ここで、図5は、注目領域の主要色成分の範囲に基づいて、図3の画像を領域分割した例を示す図である。図5の赤色の箇所は、第1の主要色成分の範囲に対応する。また、図5の緑色の箇所は、第2の主要色成分の範囲に対応する。また、図5の黒色の箇所は、色相値がいずれの主要色成分の範囲にも属さない部分を示している。   Here, FIG. 5 is a diagram illustrating an example in which the image of FIG. 3 is divided into regions based on the range of the main color component of the region of interest. The red part in FIG. 5 corresponds to the range of the first main color component. Further, the green portion in FIG. 5 corresponds to the range of the second main color component. Further, a black portion in FIG. 5 indicates a portion where the hue value does not belong to any of the main color component ranges.

図5の例によれば、第1の主要色成分の範囲(赤色)は、注目領域の位置にある被写体(岩)の部分によく一致し、岩の周囲にある芝生や木の部分は黒色となっている。そのため、一の実施形態による領域分割処理では、画像から主要被写体を精度よく抽出できることが分かる。   According to the example of FIG. 5, the range of the first main color component (red) matches well with the portion of the subject (rock) at the position of the region of interest, and the lawn and tree portions around the rock are black. It has become. Therefore, it can be seen that the main subject can be accurately extracted from the image by the region division processing according to the embodiment.

また、図5の比較例として、画像全体の色相から決定した主要色成分によって、図3の画像を領域分割した例を図6に示す。この図6の例では、主要色成分の範囲を赤色で示し、主要色成分の範囲に属さない部分は黒色で示している。この図6の比較例では、注目領域の位置にある被写体が黒色で示されており、主要色成分によって主要被写体を抽出できないことが分かる。   Further, as a comparative example of FIG. 5, FIG. 6 shows an example in which the image of FIG. 3 is divided into regions by main color components determined from the hue of the entire image. In the example of FIG. 6, the range of the main color component is shown in red, and the portion not belonging to the range of the main color component is shown in black. In the comparative example of FIG. 6, the subject at the position of the attention area is shown in black, and it can be seen that the main subject cannot be extracted by the main color component.

ステップS110:評価領域設定部25は、いずれかの主要色成分の範囲に属する領域のうちから、合焦評価領域を選択する。具体的には、評価領域設定部25は、以下のいずれかの方法(あるいはその組み合わせ)により合焦評価領域を選択する。   Step S110: The evaluation area setting unit 25 selects a focus evaluation area from among the areas belonging to one of the main color component ranges. Specifically, the evaluation area setting unit 25 selects a focus evaluation area by any one of the following methods (or a combination thereof).

例えば、評価領域設定部25は、注目領域と少なくとも一部が重なる領域を合焦評価領域とする。また、評価領域設定部25は、候補となる領域が複数ある場合には、第1の主要色成分の範囲に属する領域を優先的に合焦評価領域としてもよい。なお、図7は、図3の画像における合焦評価領域の設定例を示している。この図7の例では、合焦評価領域を白色で示している。   For example, the evaluation area setting unit 25 sets an area at least partially overlapping the attention area as the focus evaluation area. In addition, when there are a plurality of candidate areas, the evaluation area setting unit 25 may preferentially set an area belonging to the range of the first main color component as the focus evaluation area. FIG. 7 shows an example of setting the focus evaluation area in the image of FIG. In the example of FIG. 7, the focus evaluation area is shown in white.

さらに、評価領域設定部25は、候補となる領域が複数ある場合には、撮影時のシーンモードの設定や領域の空間分布とを考慮して、合焦評価領域を決定してもよい。   Furthermore, when there are a plurality of candidate areas, the evaluation area setting unit 25 may determine the focus evaluation area in consideration of the setting of the scene mode at the time of shooting and the spatial distribution of the area.

一例として、シーンモードが「ポートレート撮影」である場合、評価領域設定部25は、画像内でのまとまりが大きな領域を優先的に合焦評価領域としてもよい。また、評価領域設定部25は、シーンモードが「風景撮影」である場合、画像内に大きく広がっている領域を優先的に合焦評価領域としてもよい。なお、シーンモードが「マクロ撮影」である場合、評価領域設定部25は、被写体が至近側にある領域を優先的に合焦評価領域としてもよい。   As an example, when the scene mode is “portrait shooting”, the evaluation area setting unit 25 may preferentially set an area having a large group in the image as a focus evaluation area. In addition, when the scene mode is “landscape shooting”, the evaluation area setting unit 25 may preferentially set an area that is greatly expanded in the image as a focus evaluation area. When the scene mode is “macro shooting”, the evaluation area setting unit 25 may preferentially set the area where the subject is on the near side as the focus evaluation area.

なお、画像内での領域のまとまりや広がりを判断するときには、評価領域設定部25は、各領域で画像の2次モーメントを求めればよい。このとき、重心周りのモーメントが小さければ領域が広がっている傾向にあると判断でき、重心周りのモーメントが大きければ領域がまとまっている傾向にあると判断できる。   Note that when determining the grouping or spreading of the region in the image, the evaluation region setting unit 25 may obtain the second moment of the image in each region. At this time, if the moment around the center of gravity is small, it can be determined that the region tends to expand, and if the moment around the center of gravity is large, it can be determined that the region tends to be gathered.

ステップS111:合焦演算部26は、撮影画面内の合焦評価領域(S110)を焦点検出エリアとしてAFを実行する。例えば、合焦演算部26は、公知のコントラスト検出方式により、合焦評価領域の全ての位置でコントラストが高くなるようにフォーカシングレンズ12の位置を調整する。なお、合焦演算部26は、必要に応じて、絞り(不図示)を絞り込んで被写界深度を深くするなどの制御を行うようにしてもよい。   Step S111: The focus calculation unit 26 performs AF using the focus evaluation area (S110) in the shooting screen as a focus detection area. For example, the focus calculation unit 26 adjusts the position of the focusing lens 12 by using a known contrast detection method so that the contrast becomes high at all positions in the focus evaluation area. Note that the focusing calculation unit 26 may perform control such as reducing the aperture (not shown) to increase the depth of field as necessary.

ステップS112:制御部15は、レリーズ釦20の全押し操作を受け付けたか否かを判定する。上記要件を満たす場合(YES側)にはS114に処理が移行する。一方、上記要件を満たさない場合(NO側)にはS113に処理が移行する。   Step S112: The control unit 15 determines whether or not a full pressing operation of the release button 20 has been accepted. If the above requirement is satisfied (YES side), the process proceeds to S114. On the other hand, if the above requirement is not satisfied (NO side), the process proceeds to S113.

ステップS113:制御部15は、レリーズ釦20の半押し操作が解除されたか否かを判定する。上記要件を満たす場合(YES側)には、制御部15はS102に戻って上記動作を繰り返す。一方、上記要件を満たさない場合(NO側)には、制御部15はS112に戻ってレリーズ釦20の全押し操作を待機する。   Step S113: The control unit 15 determines whether or not the half-press operation of the release button 20 has been released. If the above requirement is satisfied (YES side), the control unit 15 returns to S102 and repeats the above operation. On the other hand, when the above requirement is not satisfied (NO side), the control unit 15 returns to S112 and waits for a full pressing operation of the release button 20.

ステップS114:制御部15は、レリーズ釦20の全押しに応じて、撮像素子14を駆動させて本画像の撮像処理を実行する。本画像のデータは、画像処理部21で所定の処理が施された後に記録I/F19を介して記憶媒体19aに記録される。以上で、図2の流れ図の説明を終了する。   Step S114: In response to the release button 20 being fully pressed, the control unit 15 drives the imaging device 14 to execute the imaging process for the main image. The data of the main image is recorded in the storage medium 19a via the recording I / F 19 after being subjected to predetermined processing by the image processing unit 21. Above, description of the flowchart of FIG. 2 is complete | finished.

一の実施形態の電子カメラ11は、注目領域内での色相成分と画素数との対応関係を示す度数分布から主要色成分の範囲を設定する(S106、S108)。そして、電子カメラ11は、主要色成分の範囲を用いて主要被写体に対応する合焦評価領域を設定し(S109、S110)、この合焦評価領域を焦点検出エリアとしてAFを行う(S111)。これにより、一の実施形態では、任意のシーンにおいて、主要被写体の全体を焦点検出エリアとする適応的なAFを行うことができる。   The electronic camera 11 of one embodiment sets the range of the main color component from the frequency distribution indicating the correspondence between the hue component and the number of pixels in the region of interest (S106, S108). Then, the electronic camera 11 sets a focus evaluation area corresponding to the main subject using the range of the main color component (S109, S110), and performs AF using the focus evaluation area as a focus detection area (S111). Thereby, in one embodiment, adaptive AF can be performed in an arbitrary scene with the entire main subject as a focus detection area.

<他の実施形態の説明>
図8は、他の実施形態に係る焦点評価装置の構成例を示すブロック図である。他の実施形態の焦点評価装置は、焦点評価プログラムがインストールされたパーソナルコンピュータである。この焦点評価装置を構成するコンピュータは、焦点評価プログラムの実行によって、電子カメラなどの撮像装置で生成された画像ファイルを読み込むとともに、この画像ファイルの撮影画像の焦点評価を行う。
<Description of other embodiments>
FIG. 8 is a block diagram illustrating a configuration example of a focus evaluation apparatus according to another embodiment. The focus evaluation apparatus according to another embodiment is a personal computer in which a focus evaluation program is installed. A computer constituting the focus evaluation apparatus reads an image file generated by an imaging apparatus such as an electronic camera by executing a focus evaluation program, and performs focus evaluation of a captured image of the image file.

ここで、一の実施形態で処理対象となる画像ファイルは、例えばExif(Exchangeable image file format for digital still cameras)規格に準拠したファイル形式で生成される。そして、一の実施形態で処理対象となる画像ファイルには、撮像装置で撮像されたカラーの撮影画像(本画像)と、この撮影画像に関する撮影情報(AFによる焦点検出エリアの位置情報など)とが対応付けされて記憶されている。   Here, the image file to be processed in one embodiment is generated in a file format conforming to, for example, the Exif (Exchangeable image file format for digital still cameras) standard. The image file to be processed in one embodiment includes a color captured image (main image) captured by the imaging device, and shooting information (position information of a focus detection area by AF, etc.) related to the captured image. Are stored in association with each other.

図8に示すコンピュータ31は、データ読込部32、記憶装置33、CPU34、メモリ35および入出力I/F36、バス37を有している。データ読込部32、記憶装置33、CPU34、メモリ35および入出力I/F36は、バス37を介して相互に接続されている。さらに、コンピュータ31には、入出力I/F36を介して、入力デバイス38(キーボード、ポインティングデバイスなど)とモニタ39とがそれぞれ接続されている。なお、入出力I/F36は、入力デバイス38からの各種入力を受け付けるとともに、モニタ39に対して表示用のデータを出力する。   A computer 31 illustrated in FIG. 8 includes a data reading unit 32, a storage device 33, a CPU 34, a memory 35, an input / output I / F 36, and a bus 37. The data reading unit 32, the storage device 33, the CPU 34, the memory 35, and the input / output I / F 36 are connected to each other via a bus 37. Furthermore, an input device 38 (keyboard, pointing device, etc.) and a monitor 39 are connected to the computer 31 via an input / output I / F 36. The input / output I / F 36 accepts various inputs from the input device 38 and outputs display data to the monitor 39.

データ読込部32は、上記の画像ファイルや、画像処理プログラムを外部から読み込むときに用いられる。例えば、データ読込部32は、着脱可能な記憶媒体からデータを取得する読込デバイス(光ディスク、磁気ディスク、光磁気ディスクの読込装置など)や、公知の通信規格に準拠して外部の装置と通信を行う通信デバイス(USBインターフェース、LANモジュール、無線LANモジュールなど)で構成される。   The data reading unit 32 is used when reading the image file or the image processing program from the outside. For example, the data reading unit 32 communicates with a reading device (such as an optical disk, a magnetic disk, or a magneto-optical disk reading device) that acquires data from a removable storage medium, or an external device in accordance with a known communication standard. It consists of communication devices (USB interface, LAN module, wireless LAN module, etc.) to be performed.

記憶装置33は、例えば、ハードディスクや、不揮発性の半導体メモリなどの記憶媒体で構成される。この記憶装置33には、上記の画像処理プログラムと、プログラムの実行に必要となる各種のデータとが記録されている。なお、記憶装置33には、データ読込部32から読み込んだ画像ファイルを記憶しておくこともできる。   The storage device 33 is configured by a storage medium such as a hard disk or a nonvolatile semiconductor memory, for example. The storage device 33 stores the image processing program and various data necessary for executing the program. The storage device 33 can also store the image file read from the data reading unit 32.

CPU34は、コンピュータ31の各部を統括的に制御するプロセッサである。このCPU34は、焦点評価プログラムの実行によって、注目領域設定部41、度数分布生成部42、色成分解析部43、評価領域設定部44、合焦演算部45として機能する。   The CPU 34 is a processor that comprehensively controls each unit of the computer 31. The CPU 34 functions as an attention area setting unit 41, a frequency distribution generation unit 42, a color component analysis unit 43, an evaluation area setting unit 44, and a focus calculation unit 45 by executing the focus evaluation program.

メモリ35は、焦点評価プログラムの演算結果などを一時的に記憶する。このメモリ35は、例えば揮発性のSDRAMなどで構成される。   The memory 35 temporarily stores the calculation result of the focus evaluation program. The memory 35 is composed of, for example, a volatile SDRAM.

次に、図9の流れ図を参照しつつ、他の実施形態における合焦評価処理の動作例を説明する。なお、図9の処理は、ユーザによるプログラム実行指示に応じて、CPU34が合焦評価プログラムを実行することで開始される。   Next, an operation example of the focus evaluation process in another embodiment will be described with reference to the flowchart of FIG. The process of FIG. 9 is started when the CPU 34 executes the focus evaluation program in response to a program execution instruction from the user.

ステップS201:CPU34は、データ読込部32を介して処理対象の画像ファイルを外部から取得する。S201で取得された画像ファイルは、CPU34の制御によって、記憶装置33またはメモリ35に記録される。なお、処理対象の画像ファイルが予め記憶装置33に記憶されている場合には、CPU34はS201の処理を省略してもよい。   Step S201: The CPU 34 acquires an image file to be processed from the outside via the data reading unit 32. The image file acquired in S201 is recorded in the storage device 33 or the memory 35 under the control of the CPU 34. Note that when the image file to be processed is stored in the storage device 33 in advance, the CPU 34 may omit the process of S201.

ステップS202:CPU34は、処理対象の画像ファイルに含まれる撮影画像(本画像)の色空間をHSV色空間またはHLS色空間に変換する。一の実施形態でのCPU34は、RGB色空間(またはYUV色空間)のカラー撮影画像のデータを、HSV色空間に対応した8bitの画像のデータに変換するものとする。なお、撮影画像が予めHSV色空間に対応する形式である場合には、CPU34はS202の処理を省略してもよい。   Step S202: The CPU 34 converts the color space of the captured image (main image) included in the image file to be processed into an HSV color space or an HLS color space. It is assumed that the CPU 34 in one embodiment converts color photographed image data in the RGB color space (or YUV color space) into 8-bit image data corresponding to the HSV color space. When the captured image has a format corresponding to the HSV color space in advance, the CPU 34 may omit the process of S202.

ステップS203:注目領域設定部41は、処理対象の画像ファイルから撮影情報を読み出して、撮影画像の撮像前に予め行われたAFによる焦点検出エリアの位置情報(画像内での焦点検出エリアのXY位置とそのサイズ)を取得する。   Step S203: The attention area setting unit 41 reads shooting information from the image file to be processed, and position information of the focus detection area by the AF performed in advance before shooting the shot image (XY of the focus detection area in the image) Get position and its size).

そして、注目領域設定部41は、上記の焦点検出エリアの位置を基準として、撮影画像の一部に注目領域を設定する。一の実施形態での注目領域設定部41は、焦点検出エリアを中心とする撮影画像内の矩形の部分領域を注目領域とする。このとき、注目領域設定部41は、撮影画像において焦点検出エリアに対応する範囲をそのまま注目領域としてもよい。   Then, the attention area setting unit 41 sets the attention area in a part of the captured image with reference to the position of the focus detection area. In one embodiment, the attention area setting unit 41 sets a rectangular partial area in the captured image centered on the focus detection area as the attention area. At this time, the attention area setting unit 41 may directly use the range corresponding to the focus detection area in the captured image as the attention area.

ステップS204:度数分布生成部42は、撮影画像の注目領域に含まれる各画素の色相成分(H)に注目し、注目領域内での色相成分と画素数との対応関係を示す度数分布を求める。なお、S204の処理は、図2のS106の処理に対応するので重複説明を省略する。   Step S204: The frequency distribution generation unit 42 pays attention to the hue component (H) of each pixel included in the attention area of the captured image, and obtains the frequency distribution indicating the correspondence between the hue component and the number of pixels in the attention area. . Note that the processing in S204 corresponds to the processing in S106 in FIG.

ステップS205:CPU34は、注目領域での色相成分の度数分布(S204で求めたもの)につき、隣接する色相間で頻度の変化を平滑化する。なお、S205の処理は、図2のS107の処理に対応するので重複説明を省略する。   Step S205: The CPU 34 smoothes the change in frequency between adjacent hues with respect to the frequency distribution of the hue components in the attention area (obtained in S204). Note that the processing in S205 corresponds to the processing in S107 in FIG.

ステップS206:色成分解析部43は、注目領域での色相成分の度数分布(S105で平滑化されたもの)に基づいて、注目領域における主要色成分の範囲を少なくとも1以上設定する。なお、S206の処理は、図2のS108の処理に対応するので重複説明を省略する。   Step S206: The color component analysis unit 43 sets at least one or more main color component ranges in the attention area based on the frequency distribution of the hue components in the attention area (smoothed in S105). The process of S206 corresponds to the process of S108 in FIG.

ステップS207:評価領域設定部44は、撮影画像の各画素の色相値に基づいて、画像の領域分割を行う。なお、S207の処理は、図2のS109の処理に対応するので重複説明を省略する。   Step S207: The evaluation area setting unit 44 divides the area of the image based on the hue value of each pixel of the captured image. Note that the processing in S207 corresponds to the processing in S109 in FIG.

ステップS208:評価領域設定部44は、いずれかの主要色成分の範囲に属する領域のうちから、合焦評価領域を選択する。なお、S208の処理は、図2のS110の処理に対応するので重複説明を省略する。   Step S208: The evaluation area setting unit 44 selects a focus evaluation area from among the areas belonging to one of the main color component ranges. Note that the processing in S208 corresponds to the processing in S110 in FIG.

ステップS209:合焦演算部45は、合焦評価領域における撮影画像の合焦度を求める。そして、合焦演算部45は、合焦評価領域で最も高い合焦度を示す画素位置を抽出する。   Step S209: The focus calculation unit 45 obtains the focus degree of the captured image in the focus evaluation area. Then, the focus calculation unit 45 extracts a pixel position indicating the highest focus degree in the focus evaluation area.

例えば、S209での合焦演算部45は、撮影画像に各々の周波数特性が異なる一対のエッジ抽出処理を施し、これらのエッジ抽出処理で求まる一対のエッジ量の差分を用いて合焦度を求めてもよい。あるいは、S209での合焦演算部45は、合焦評価領域の各位置において、所定範囲分の画素値の勾配から求めた画像構造ベクトルを求め、この画像構造ベクトルの強度や、画像構造ベクトルの方向の相関に基づいて合焦度を求めてもよい。   For example, the focus calculation unit 45 in S209 performs a pair of edge extraction processes with different frequency characteristics on the captured image, and obtains the degree of focus using a difference between the pair of edge amounts obtained by these edge extraction processes. May be. Alternatively, the focus calculation unit 45 in S209 obtains an image structure vector obtained from the gradient of pixel values for a predetermined range at each position in the focus evaluation area, and determines the strength of the image structure vector and the image structure vector. The degree of focus may be obtained based on the correlation of directions.

ステップS210:合焦演算部45は、撮影画像のピントの状態を判断する。具体的には、合焦演算部45は、撮影画像の焦点検出エリアの位置と、S209で抽出した画素位置との直線距離を求める。上記の直線距離がほぼ0とみなせる場合、処理対象の撮影画像は主要被写体にピントがあった状態と判断できる。一方、上記の直線距離が許容範囲よりも大きければ、処理対象の撮影画像は主要被写体からピントに合っていない状態と判断できる。そのため、S210で求めた直線距離の大きさを指標として、CPU34は撮影画像の合焦状態を評価し、合焦状態の良好な画像を自動的に選別できる。勿論、CPU34は、S210で求めた直線距離の大きさの情報をユーザに提示するのみに留めてもよい。以上で、図9の流れ図の説明を終了する。   Step S210: The focus calculation unit 45 determines the focus state of the captured image. Specifically, the focus calculation unit 45 obtains a linear distance between the position of the focus detection area of the captured image and the pixel position extracted in S209. When the straight line distance can be regarded as almost zero, it can be determined that the captured image to be processed is in focus on the main subject. On the other hand, if the linear distance is larger than the allowable range, it can be determined that the captured image to be processed is not in focus from the main subject. Therefore, the CPU 34 can evaluate the in-focus state of the captured image using the magnitude of the linear distance obtained in S210 as an index, and can automatically select an image in good in-focus state. Of course, the CPU 34 may only present the information on the magnitude of the linear distance obtained in S210 to the user. Above, description of the flowchart of FIG. 9 is complete | finished.

上記の他の実施形態の合焦評価装置では、一の実施形態とほぼ同様のアルゴリズムによって、注目領域の色情報に基づいて撮影画像に合焦評価領域を設定する。そして、合焦評価装置は、合焦評価領域での合焦度を用いて撮影画像のピントを評価する。したがって、他の実施形態の合焦評価装置は、多様な撮影画像において、主要被写体に対応する合焦評価領域を的確に設定でき、主要被写体の全体を考慮してより適切な合焦評価を行うことができる。   In the focus evaluation apparatus of the other embodiment described above, the focus evaluation area is set in the captured image based on the color information of the attention area by an algorithm that is substantially the same as that of the first embodiment. Then, the focus evaluation device evaluates the focus of the captured image using the degree of focus in the focus evaluation area. Therefore, the focus evaluation apparatus according to another embodiment can accurately set the focus evaluation area corresponding to the main subject in various captured images, and perform more appropriate focus evaluation in consideration of the entire main subject. be able to.

<実施形態の補足事項>
(1)上記の各実施形態では、注目領域設定部、度数分布生成部、色成分解析部、評価領域設定部、合焦演算部の機能をプログラムによってソフトウエア的に実現する例を説明したが、ASICを用いて上記の各部をハードウエア的に実現しても勿論かまわない。
<Supplementary items of the embodiment>
(1) In each of the above-described embodiments, an example has been described in which the functions of the attention area setting unit, the frequency distribution generation unit, the color component analysis unit, the evaluation area setting unit, and the focus calculation unit are realized by software using a program. Of course, the above-described units may be implemented in hardware using an ASIC.

(2)上記の一の実施形態では、コンパクト型の電子カメラでの構成例を説明した。しかし、本発明の撮像装置は、レンズ交換可能な一眼レフレックス型の電子カメラにも適用することが勿論可能である。なお、本発明を一眼レフレックス型の電子カメラに適用する場合には、本画像を撮像する撮像素子によってスルー画像を撮像してもよく、また、本画像を撮像する撮像素子とは別にスルー画像を撮像するための撮像素子を設けてもよい。   (2) In the above-described one embodiment, the configuration example of the compact electronic camera has been described. However, the imaging apparatus of the present invention can of course be applied to a single-lens reflex type electronic camera in which lenses can be exchanged. Note that when the present invention is applied to a single-lens reflex electronic camera, a through image may be captured by an image sensor that captures the main image, and the through image is separate from the image sensor that captures the main image. An image sensor for imaging the image may be provided.

また、本発明の撮像装置は、例えば、携帯電話などの電子機器に内蔵されるカメラモジュールに適用することも可能である。   The imaging device of the present invention can also be applied to a camera module built in an electronic device such as a mobile phone.

(3)上記の一の実施形態において、注目領域設定部22は、例えばレリーズ釦20の半押しに応じて、撮像画面の所定位置(撮影画面の中央部など)に注目領域を自動的に設定するようにしてもよい。さらに、撮像装置は、レリーズ釦の半押し時に予め決まった注目領域(例えば撮影画面の中心)内の色情報を取得し、その色情報から色成分解析を行って領域分割を行うようにしてもよい。   (3) In one embodiment described above, the attention area setting unit 22 automatically sets the attention area at a predetermined position on the imaging screen (such as the center of the imaging screen), for example, when the release button 20 is half-pressed. You may make it do. Furthermore, the imaging device may acquire color information in a predetermined region of interest (for example, the center of the shooting screen) when the release button is half-pressed, and perform color component analysis from the color information to perform region division. Good.

(4)上記の他の実施形態において、焦点評価装置は、画像ファイルの撮影画像よりも画像サイズが小さい縮小画像(例えば、撮影画像を間引いた画像など)を処理対象として、上記の合焦評価処理を行ってもよい。   (4) In the other embodiment described above, the focus evaluation apparatus uses the reduced image having a smaller image size than the captured image of the image file (for example, an image obtained by thinning the captured image) as a processing target, and performs the focus evaluation described above. Processing may be performed.

(5)上記の各実施形態では、処理対象の画像をHSV色空間またはHLS色空間に変換する例を説明したが、他の色空間に変換するものでもよい。一例として、L色空間の場合、度数分布生成部は注目領域の各画素をa平面上にマッピングし、a平面の色座標(0,0)を中心とする回転方向での度数分布を求めればよい。 (5) In each of the above-described embodiments, the example in which the image to be processed is converted into the HSV color space or the HLS color space has been described, but the image to be processed may be converted into another color space. Center as an example, the case of L * a * b * color space, frequency distribution generating unit maps each pixel of the region of interest on the a * b * plane, a * b * plane of the color coordinates (0, 0) The frequency distribution in the rotation direction is obtained.

(6)上記の一の実施形態において、S108での色成分解析部24は、分布関数上のピークおよび谷の位置を予め探索した後に、頻度の値の高さに応じて主要色成分の範囲を順次決定してもよい。   (6) In the one embodiment described above, the color component analysis unit 24 in S108 searches for the peak and valley positions on the distribution function in advance, and then determines the range of the main color component according to the height of the frequency value. May be sequentially determined.

以上の詳細な説明により、実施形態の特徴点および利点は明らかになるであろう。これは、特許請求の範囲が、その精神および権利範囲を逸脱しない範囲で前述のような実施形態の特徴点および利点にまで及ぶことを意図するものである。また、当該技術分野において通常の知識を有する者であれば、あらゆる改良および変更に容易に想到できるはずであり、発明性を有する実施形態の範囲を前述したものに限定する意図はなく、実施形態に開示された範囲に含まれる適当な改良物および均等物によることも可能である。   From the above detailed description, features and advantages of the embodiments will become apparent. It is intended that the scope of the claims extend to the features and advantages of the embodiments as described above without departing from the spirit and scope of the right. Further, any person having ordinary knowledge in the technical field should be able to easily come up with any improvements and modifications, and there is no intention to limit the scope of the embodiments having the invention to those described above. It is also possible to use appropriate improvements and equivalents within the scope disclosed in.

11…電子カメラ、15…制御部、22,41…注目領域設定部、23,42…度数分布生成部、24,43…色成分解析部、25,44…評価領域設定部、26,45…合焦演算部、31…コンピュータ、34…CPU DESCRIPTION OF SYMBOLS 11 ... Electronic camera, 15 ... Control part, 22, 41 ... Attention area setting part, 23, 42 ... Frequency distribution generation part, 24, 43 ... Color component analysis part, 25, 44 ... Evaluation area setting part, 26, 45 ... Focus calculation unit, 31 ... computer, 34 ... CPU

特開2001−14457JP2001-14457

Claims (6)

撮像装置で撮影された撮影画像の一部に注目領域を設定する注目領域設定部と、
前記注目領域の画像に含まれる色成分の度数分布を求める度数分布生成部と、
前記度数分布に基づいて、前記注目領域における主要色成分の範囲を少なくとも1以上設定する色成分解析部と、
前記撮影画像の各位置の色成分を前記主要色成分の範囲に応じて分類し、該分類結果に基づいて前記撮影画像内に合焦評価領域を設定する評価領域設定部と、
前記合焦評価領域で被写体の合焦評価を行う合焦演算部と、
を備えることを特徴とする合焦評価装置。
A region-of-interest setting unit that sets a region of interest in a part of a captured image captured by the imaging device;
A frequency distribution generation unit for determining a frequency distribution of color components included in the image of the region of interest;
A color component analyzer that sets at least one or more main color component ranges in the region of interest based on the frequency distribution;
A color component at each position of the captured image is classified according to a range of the main color component, and an evaluation region setting unit that sets a focus evaluation region in the captured image based on the classification result;
A focus calculation unit that performs focus evaluation of the subject in the focus evaluation area;
A focus evaluation apparatus comprising:
請求項1に記載の合焦評価装置において、
前記評価領域設定部は、前記注目領域と少なくとも一部が重なる位置に前記合焦評価領域を設定することを特徴とする合焦評価装置。
In the focus evaluation apparatus according to claim 1,
The focus evaluation apparatus, wherein the evaluation region setting unit sets the focus evaluation region at a position at least partially overlapping the region of interest.
請求項1または請求項2に記載の合焦評価装置において、
前記評価領域設定部は、前記分類結果によって前記合焦評価領域の候補領域が複数設定されたときに、各々の前記候補領域の空間分布に基づいて前記合焦評価領域を設定することを特徴とする合焦評価装置。
In the focus evaluation apparatus according to claim 1 or 2,
The evaluation area setting unit sets the focus evaluation area based on a spatial distribution of each candidate area when a plurality of candidate areas for the focus evaluation area are set according to the classification result. In-focus evaluation device.
請求項1から請求項3のいずれか1項に記載の合焦評価装置において、
前記色成分として色相の情報を用いることを特徴とする合焦評価装置。
In the focusing evaluation apparatus according to any one of claims 1 to 3,
An in-focus evaluation apparatus using hue information as the color component.
請求項1から請求項4のいずれか1項に記載の合焦評価装置を備えることを特徴とするカメラ。   A camera comprising the in-focus evaluation device according to claim 1. 撮像装置で撮影された撮影画像の一部に注目領域を設定する注目領域設定処理と、
前記注目領域の画像に含まれる色成分の度数分布を求める度数分布生成処理と、
前記度数分布に基づいて、前記注目領域における主要色成分の範囲を少なくとも1以上設定する色成分解析処理と、
前記撮影画像の各位置の色成分を前記主要色成分の範囲に応じて分類し、該分類結果に基づいて前記撮影画像内に合焦評価領域を設定する評価領域設定処理と、
前記合焦評価領域で被写体の合焦評価を行う合焦演算処理と、
をコンピュータに実行させることを特徴とするプログラム。
Attention area setting processing for setting the attention area in a part of the captured image captured by the imaging device;
A frequency distribution generation process for obtaining a frequency distribution of color components included in the image of the region of interest;
A color component analysis process for setting at least one or more main color component ranges in the region of interest based on the frequency distribution;
An evaluation area setting process for classifying the color components at each position of the captured image according to the range of the main color components, and setting a focus evaluation area in the captured image based on the classification result;
A focus calculation process for performing focus evaluation of a subject in the focus evaluation area;
A program that causes a computer to execute.
JP2009045945A 2009-02-27 2009-02-27 Focus evaluation device, camera and program Active JP5463688B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009045945A JP5463688B2 (en) 2009-02-27 2009-02-27 Focus evaluation device, camera and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009045945A JP5463688B2 (en) 2009-02-27 2009-02-27 Focus evaluation device, camera and program

Publications (2)

Publication Number Publication Date
JP2010197968A true JP2010197968A (en) 2010-09-09
JP5463688B2 JP5463688B2 (en) 2014-04-09

Family

ID=42822709

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009045945A Active JP5463688B2 (en) 2009-02-27 2009-02-27 Focus evaluation device, camera and program

Country Status (1)

Country Link
JP (1) JP5463688B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015102855A (en) * 2013-11-28 2015-06-04 株式会社ニコン Lens drive control device, electronic camera, and lens drive control program
JP2020134538A (en) * 2019-02-12 2020-08-31 浜松ホトニクス株式会社 Image acquisition device and image acquisition method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09181953A (en) * 1995-12-27 1997-07-11 Matsushita Electric Works Ltd Automatic tracking device
JPH11150676A (en) * 1997-11-17 1999-06-02 Canon Inc Image processor and tracking device
JP2001249265A (en) * 2000-03-02 2001-09-14 Olympus Optical Co Ltd Range finder
JP2003241065A (en) * 2002-02-15 2003-08-27 Fuji Photo Optical Co Ltd Autofocusing system
JP2009033738A (en) * 2007-07-04 2009-02-12 Sanyo Electric Co Ltd Imaging apparatus, data structure of image file
JP2009038777A (en) * 2007-08-06 2009-02-19 Chiba Univ Automatic tracking apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09181953A (en) * 1995-12-27 1997-07-11 Matsushita Electric Works Ltd Automatic tracking device
JPH11150676A (en) * 1997-11-17 1999-06-02 Canon Inc Image processor and tracking device
JP2001249265A (en) * 2000-03-02 2001-09-14 Olympus Optical Co Ltd Range finder
JP2003241065A (en) * 2002-02-15 2003-08-27 Fuji Photo Optical Co Ltd Autofocusing system
JP2009033738A (en) * 2007-07-04 2009-02-12 Sanyo Electric Co Ltd Imaging apparatus, data structure of image file
JP2009038777A (en) * 2007-08-06 2009-02-19 Chiba Univ Automatic tracking apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015102855A (en) * 2013-11-28 2015-06-04 株式会社ニコン Lens drive control device, electronic camera, and lens drive control program
JP2020134538A (en) * 2019-02-12 2020-08-31 浜松ホトニクス株式会社 Image acquisition device and image acquisition method
JP7209557B2 (en) 2019-02-12 2023-01-20 浜松ホトニクス株式会社 Image acquisition device and image acquisition method

Also Published As

Publication number Publication date
JP5463688B2 (en) 2014-04-09

Similar Documents

Publication Publication Date Title
JP4702635B2 (en) AUTO WHITE BALANCE CORRECTION VALUE CALCULATION DEVICE, METHOD, PROGRAM, AND IMAGING DEVICE
US8254630B2 (en) Subject extracting method and device by eliminating a background region using binary masks
KR101679290B1 (en) Image processing method and apparatus
JP2010045613A (en) Image identifying method and imaging device
JP2011035636A (en) Image processor and method
US8670609B2 (en) Systems and methods for evaluating images
JP2009111716A (en) Imaging apparatus, program and template generating method
JP5509621B2 (en) Image processing apparatus, camera, and program
JP5471130B2 (en) Image processing apparatus and method
JP5463688B2 (en) Focus evaluation device, camera and program
JP5515492B2 (en) Image processing apparatus and method
JP5146223B2 (en) Program, camera, image processing apparatus, and image contour extraction method
JP2019008830A (en) Subject detection device, imaging device, and program
JP6326841B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2018152095A (en) Image processing apparatus, imaging apparatus, and image processing program
JP6248662B2 (en) Image processing apparatus, imaging apparatus, and image processing program
Rahman et al. Real-time face-based auto-focus for digital still and cell-phone cameras
JP2011147076A (en) Image processing apparatus, image capturing apparatus and program
JP5631181B2 (en) Image processing apparatus, control method therefor, and program
JP6314281B1 (en) Image processing method and foreground region acquisition method
JP5214749B2 (en) AUTO WHITE BALANCE CORRECTION VALUE CALCULATION DEVICE, METHOD, PROGRAM, AND IMAGING DEVICE
JP6326840B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2017118341A (en) Image processing device, imaging device, electronic apparatus, and image processing program
JP6405638B2 (en) Subject detection device, imaging device, and program
JP6318661B2 (en) Subject detection device, imaging device, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120222

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121211

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130419

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130430

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130628

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130917

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131115

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131224

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140106

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5463688

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250