JP5353141B2 - Program, camera, image processing apparatus, and method of calculating degree of focus of image - Google Patents

Program, camera, image processing apparatus, and method of calculating degree of focus of image Download PDF

Info

Publication number
JP5353141B2
JP5353141B2 JP2008239182A JP2008239182A JP5353141B2 JP 5353141 B2 JP5353141 B2 JP 5353141B2 JP 2008239182 A JP2008239182 A JP 2008239182A JP 2008239182 A JP2008239182 A JP 2008239182A JP 5353141 B2 JP5353141 B2 JP 5353141B2
Authority
JP
Japan
Prior art keywords
image
focus
captured image
degree
captured
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.)
Active
Application number
JP2008239182A
Other languages
Japanese (ja)
Other versions
JP2010072298A (en
Inventor
司 村田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2008239182A priority Critical patent/JP5353141B2/en
Publication of JP2010072298A publication Critical patent/JP2010072298A/en
Application granted granted Critical
Publication of JP5353141B2 publication Critical patent/JP5353141B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a means for accurately obtaining focusing degree of a picked-up image by processing that is hardly influenced by noise and does not require parameter adjustment. <P>SOLUTION: A program makes a computer execute image reading processing for acquiring the picked-up image, localized area setting processing, structure information arithmetic operation processing, and focusing degree calculation processing. In the localized area setting processing, the computer successively designates two or more pixels under consideration from pixels included in the picked-up image, and also sets a localized area of predetermined size in the picked-up image with the position of each pixel under consideration as reference. In the structure information arithmetic operation processing, the computer obtains an image structure vector showing image structure in the position of each pixel under consideration using gradient information of a pixel value obtained from a plurality of pixels included in the localized area. In the focusing degree calculation processing, the computer obtains the focusing degree in the predetermined position of the picked-up image using information on the image structure vector. <P>COPYRIGHT: (C)2010,JPO&amp;INPIT

Description

本発明は、プログラム、カメラ、画像処理装置、及び画像の合焦度算出方法に関する。 The present invention, program, a camera, an image processing apparatus, and a focus degree calculation method of the image.

従来から、電子カメラなどで取得したデジタルの撮像画像に関し、画像の注目領域に含まれるエッジ量や高周波成分を用いて撮像画像の合焦度を評価する手法が公知である(一例として、特許文献1参照)。
特開2003−274258号公報
Conventionally, regarding a digital captured image acquired by an electronic camera or the like, a technique for evaluating the degree of focus of a captured image using an edge amount or a high-frequency component included in a region of interest of the image is known (for example, Patent Literature 1).
JP 2003-274258 A

しかし、上記の従来技術の手法で撮像画像の合焦度を求める場合には、画像に含まれるノイズが多くなるとエッジ量の誤検出が生じやすくなり、特に高い撮像感度で撮像された画像については合焦度の評価精度が大きく低下しうる。そのため、上記の従来技術でノイズの影響を抑制するためには、例えば、撮像感度を考慮してノイズ対策用のパラメータの設定を行うか、あるいは撮像感度に応じたノイズ除去処理を行うなどの煩雑な処理が要求される点で改善の余地があった。   However, when obtaining the degree of focus of a captured image using the above-described conventional technique, if the amount of noise included in the image increases, an erroneous detection of the edge amount is likely to occur, and particularly for an image captured with high imaging sensitivity. The evaluation accuracy of the degree of focus can be greatly reduced. Therefore, in order to suppress the influence of noise in the above-described conventional technology, for example, it is complicated to set parameters for noise countermeasures in consideration of imaging sensitivity or to perform noise removal processing according to imaging sensitivity. There is room for improvement in that it requires a special treatment.

そこで、本発明の目的は、ノイズの影響を受けにくく、パラメータ調整が不要な処理で撮像画像の合焦度を精度よく求めるための手段を提供することにある。   Accordingly, an object of the present invention is to provide means for accurately obtaining the degree of focus of a captured image by processing that is not easily affected by noise and does not require parameter adjustment.

一の態様に係るプログラムは、撮像画像を取得する取得処理と、前記撮像画像に含まれる画素のうちから注目画素を指定するとともに、前記注目画素の位置を基準として前記撮像画像内に所定サイズの局所領域を設定する局所領域設定処理と、前記局所領域に含まれる複数の画素から求めた画素値の勾配情報を用いて、前記局所領域内での前記勾配情報の総和を変数とする主成分分析の固有値問題を解くことにより、前記注目画素の位置での画像構造を示す画像構造ベクトルを求める構造情報演算処置と、少なくとも2つ以上の前記注目画素から求まる前記画像構造ベクトルの強度を示す情報の比較を行うことで、前記撮像画像の所定位置での合焦度を求める合焦度算出処理と、前記画像読込処理で複数枚の前記撮像画像を取得したときに、各々の前記撮像画像において前記合焦度を求める判定領域をそれぞれ設定する判定領域設定処理と、各々の前記撮像画像における前記判定領域での前記合焦度をそれぞれ比較して、該比較結果に基づいて前記撮像画像の選択を行う画像選択処理と、をコンピュータに実行させることを特徴とする。 The program according to one aspect specifies an acquisition process for acquiring a captured image, specifies a target pixel from among pixels included in the captured image, and has a predetermined size in the captured image with reference to the position of the target pixel. Using a local area setting process for setting a local area and gradient information of pixel values obtained from a plurality of pixels included in the local area, principal component analysis using the sum of the gradient information in the local area as a variable To solve the eigenvalue problem, a structure information calculation procedure for obtaining an image structure vector indicating an image structure at the position of the target pixel, and information indicating the intensity of the image structure vector obtained from at least two of the target pixels. By performing the comparison, when obtaining a plurality of the captured images in the degree-of-focus calculation process for obtaining the degree of focus at a predetermined position of the captured image, and the image reading process, A determination area setting process for setting a determination area for obtaining the degree of focus in each of the captured images is compared with the degree of focus in the determination area in each of the captured images, and based on the comparison result And causing the computer to execute image selection processing for selecting the captured image.

本発明では、複数の注目画素の位置での画像構造を示す画像構造ベクトルの情報を用いて、撮像画像の合焦度を精度よく求めることができる。   In the present invention, the degree of focus of a captured image can be obtained with high accuracy using information of an image structure vector indicating an image structure at a plurality of target pixel positions.

<一の実施形態の説明>
図1は、一の実施形態に係る画像処理装置の構成例を示すブロック図である。一の実施形態の画像処理装置は、画像処理プログラムがインストールされたパーソナルコンピュータである。この画像処理装置を構成するコンピュータ11は、画像処理プログラムの実行によって、入力された撮像画像に対する合焦度の評価を行うことができる。
<Description of One Embodiment>
FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus according to an embodiment. The image processing apparatus according to one embodiment is a personal computer in which an image processing program is installed. The computer 11 constituting the image processing apparatus can evaluate the degree of focus on the input captured image by executing the image processing program.

コンピュータ11は、データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16、バス17を有している。データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16は、バス17を介して相互に接続されている。さらに、コンピュータ11には、入出力I/F16を介して、入力デバイス18(キーボード、ポインティングデバイスなど)とモニタ19とがそれぞれ接続されている。なお、入出力I/F16は、入力デバイス18からの各種入力を受け付けるとともに、モニタ19に対して表示用のデータを出力する。   The computer 11 includes a data reading unit 12, a storage device 13, a CPU 14, a memory 15, an input / output I / F 16, and a bus 17. The data reading unit 12, the storage device 13, the CPU 14, the memory 15, and the input / output I / F 16 are connected to each other via a bus 17. Further, an input device 18 (keyboard, pointing device, etc.) and a monitor 19 are connected to the computer 11 via an input / output I / F 16. The input / output I / F 16 receives various inputs from the input device 18 and outputs display data to the monitor 19.

データ読込部12は、撮像画像のデータや、画像処理プログラムを外部から読み込むときに用いられる。例えば、データ読込部12は、着脱可能な記憶媒体からデータを取得する読込デバイス(光ディスク、磁気ディスク、光磁気ディスクの読込装置など)や、公知の通信規格に準拠して外部の装置と通信を行う通信デバイス(USBインターフェース、LANモジュール、無線LANモジュールなど)で構成される。   The data reading unit 12 is used when reading captured image data or an image processing program from the outside. For example, the data reading unit 12 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.

記憶装置13は、上記の画像処理プログラムと、プログラムの実行に必要となる各種のデータとを記憶する。また、記憶装置13には、データ読込部12から取得した撮像画像のデータを記録することもできる。なお、一の実施形態での記憶装置13は、ハードディスクや、不揮発性の半導体メモリなどで構成される。   The storage device 13 stores the image processing program and various data necessary for executing the program. The storage device 13 can also record captured image data acquired from the data reading unit 12. Note that the storage device 13 in one embodiment is configured by a hard disk, a nonvolatile semiconductor memory, or the like.

CPU14は、コンピュータ11の各部動作を統括的に制御するプロセッサである。また、CPU14は、画像処理プログラムの実行によって、撮像画像の所定位置での画像構造を示す画像構造ベクトルを求める。そして、CPU14は、この画像構造ベクトルの情報を用いて撮像画像の合焦度を求める(なお、上記の演算処理の内容については後述する)。また、メモリ15は、画像処理プログラムの演算結果などを一時的に記憶する。このメモリ15は、例えば揮発性のSDRAMなどで構成される。   The CPU 14 is a processor that comprehensively controls the operation of each part of the computer 11. Further, the CPU 14 obtains an image structure vector indicating an image structure at a predetermined position of the captured image by executing the image processing program. And CPU14 calculates | requires the focus degree of a captured image using the information of this image structure vector (In addition, the content of said arithmetic processing is mentioned later). The memory 15 temporarily stores the calculation result of the image processing program. The memory 15 is composed of, for example, a volatile SDRAM.

次に、一の実施形態の画像処理プログラムによる撮像画像の合焦度評価について説明する。   Next, the evaluation of the degree of focus of a captured image by the image processing program of one embodiment will be described.

一般的に、撮像画像内のノイズは画像の構造やエッジの方向とは無関係に存在するため、画像のノイズに起因するエッジ量は指向性のないものとなる。一方、通常の撮像画像では、画像の構造に起因して、局所領域では構造方向の画素値同士に強い相関が生じることが知られている。そして、上記の局所領域において、相関の強い方向(画像の構造が類似する方向)における画素値の差分は小さな値を示し、相関の強い方向に対して垂直方向の画素値の差分は大きな値を示す。   In general, noise in a captured image exists regardless of the structure of the image and the direction of the edge, so that the amount of edge due to the noise of the image has no directivity. On the other hand, in a normal captured image, it is known that a strong correlation occurs between pixel values in the structure direction in the local region due to the structure of the image. In the local region, the difference in pixel values in the direction with strong correlation (direction in which the image structure is similar) shows a small value, and the difference in pixel values in the vertical direction with respect to the direction with strong correlation shows a large value. Show.

そのため、一の実施形態の画像処理プログラムは、上記性質を利用し、主成分分析の手法を用いて求まる、局所領域での画像構造を示す画像構造ベクトルの情報に基づき撮像画像の合焦度を評価している。   For this reason, the image processing program of one embodiment uses the above-described properties to determine the degree of focus of a captured image based on information on an image structure vector indicating an image structure in a local region, which is obtained using a principal component analysis technique. Evaluating.

(合焦度評価処理の動作例1)
以下、図2の流れ図を参照しつつ、一の実施形態の画像処理プログラムによる合焦度評価処理の一例として、1枚の撮像画像において合焦度の高い箇所を探索するときの動作例を説明する。なお、図2の流れ図の処理は、ユーザーによるプログラム実行指示に応じて開始される。
(Operation example 1 of focus evaluation processing)
Hereinafter, referring to the flowchart of FIG. 2, as an example of the focus degree evaluation process by the image processing program according to the embodiment, an operation example when searching for a portion with a high focus degree in one captured image will be described. To do. 2 is started in response to a program execution instruction from the user.

ステップS101:CPU14は、評価対象となる撮像画像のデータを、データ読込部12を介して外部から取得する。S101で取得された撮像画像のデータは、CPU14の制御によって、記憶装置13またはメモリ15に記録される。なお、CPU14は、撮像画像のデータが予め記憶装置13に記憶されている場合には、S101の処理を省略してもよい。   Step S <b> 101: The CPU 14 acquires data of a captured image to be evaluated from the outside via the data reading unit 12. The captured image data acquired in S101 is recorded in the storage device 13 or the memory 15 under the control of the CPU 14. Note that the CPU 14 may omit the processing of S101 when captured image data is stored in the storage device 13 in advance.

ステップS102:CPU14は、撮像画像に含まれる複数の画素のうちから、画像構造ベクトルを求める注目画素Xの位置を指定する。   Step S102: The CPU 14 designates the position of the pixel of interest X for obtaining the image structure vector from among a plurality of pixels included in the captured image.

ここで、一例として、S102でのCPU14は、撮像画像の全ての画素を注目画素Xとして順次指定するものとして説明を行うが、撮像画像内の所定画素からなる小領域において以下の処理を行ってもよい。なお、S102でのCPU14は、注目画素Xの位置を変更するときには、画像の左上隅を起点として1行ずつ左から右に注目画素Xを順番に指定してゆくものとする。   Here, as an example, the CPU 14 in S102 is described as sequentially specifying all pixels of the captured image as the target pixel X. However, the following processing is performed in a small region including predetermined pixels in the captured image. Also good. Note that when changing the position of the pixel of interest X in S102, the CPU 14 sequentially designates the pixel of interest X from left to right one line at a time starting from the upper left corner of the image.

ステップS103:CPU14は、注目画素Xの位置を基準として、撮像画像内に所定の局所領域を設定する(図3参照)。この局所領域のサイズと形は任意に設定できるが、一例として、S103でのCPU14は、撮像画像内において注目画素を中心とした矩形の範囲(例えば9×9画素の範囲)を局所領域として設定する。   Step S103: The CPU 14 sets a predetermined local region in the captured image with reference to the position of the target pixel X (see FIG. 3). Although the size and shape of the local area can be set arbitrarily, as an example, the CPU 14 in S103 sets a rectangular area (for example, a 9 × 9 pixel area) centered on the target pixel in the captured image as the local area. To do.

ステップS104:CPU14は、局所領域に含まれる各画素の画素値の勾配情報を用いて、注目画素Xの位置での画像構造ベクトルを求める。ここでは一例として、S104でのCPU14は、画素値の勾配を求めるときに、撮像画像の輝度に着目して演算を行う。入力される撮像画像データがYCbCr形式のものであれば、CPU14はY成分の画素値の勾配を求めればよいが、撮像画像データがRGB形式の場合には、CPU14はRGBのいずれかの画素値の勾配を求めてもよく、あるいはRGBからYCbCrへ色空間変換後にY成分の画素値の勾配を求めればよい。   Step S104: The CPU 14 obtains an image structure vector at the position of the target pixel X using the gradient information of the pixel value of each pixel included in the local region. Here, as an example, the CPU 14 in S104 performs calculation by paying attention to the luminance of the captured image when obtaining the gradient of the pixel value. If the input captured image data is in the YCbCr format, the CPU 14 only needs to obtain the gradient of the pixel value of the Y component. However, if the captured image data is in the RGB format, the CPU 14 determines any pixel value of RGB. The gradient of the pixel value of the Y component may be obtained after color space conversion from RGB to YCbCr.

次に、S104でのCPU14は、以下の要領で画像構造ベクトルを求める演算処理を行う。上記の局所領域(S103)内の各画素xiについて、画素値の勾配を Next, the CPU 14 in S104 performs calculation processing for obtaining an image structure vector in the following manner. For each pixel x i in the local region (S103), the gradient of the pixel value is

の固有値問題を解くことで求めることができる。但し、上記の式(2)中の「C」は、局所領域内の各画素xiにおける画素値f(x)を用いて下式(3)により定義される行列を示している。 Can be obtained by solving the eigenvalue problem. However, “C” in the above equation (2) indicates a matrix defined by the following equation (3) using the pixel value f (x) at each pixel x i in the local region.

なお、上記の式(3)の「Σ」は、いずれも局所領域に含まれる全画素の和を示している。 Note that “Σ” in Equation (3) above represents the sum of all the pixels included in the local region.

また、上記の行列Cは2行2列の行列であるので、上記の式(2)は2つの固有値と、2つの異なる単位固有ベクトルとをもつことが分かる。   Further, since the matrix C is a 2 × 2 matrix, the above equation (2) has two eigenvalues and two different unit eigenvectors.

ステップS105:CPU14は、現在の注目画素Xが最後の位置(画像の右下隅の画素)のものであるか否かを判定する。上記要件を満たす場合(YES側)にはS106に移行する。一方、上記要件を満たさない場合(NO側)には、CPU14はS102に戻って上記動作を繰り返す。なお、S105でのNO側のループにより、撮像画像の各位置で求められた画像構造ベクトルの情報がそれぞれメモリ15に記憶されることとなる。   Step S105: The CPU 14 determines whether or not the current pixel of interest X is at the last position (pixel at the lower right corner of the image). If the above requirement is satisfied (YES side), the process proceeds to S106. On the other hand, if the above requirement is not satisfied (NO side), the CPU 14 returns to S102 and repeats the above operation. Note that the image structure vector information obtained at each position of the captured image is stored in the memory 15 by the NO-side loop in S105.

ステップS106:CPU14は、画像構造ベクトルの情報を用いて、以下の(イ)または(ロ)のいずれかの手法(あるいは両者の組み合わせ)によって、撮像画像の各位置での合焦評価値Eを求める。   Step S106: The CPU 14 uses the information on the image structure vector to obtain the focus evaluation value E at each position of the captured image by either of the following methods (A) or (B) (or a combination of both). Ask.

(イ)CPU14は、各注目画素の位置における画像構造ベクトルの強度を示す固有値λs(S104で求まったもの)から、撮像画像の各位置での合焦評価値を求める。 (A) The CPU 14 obtains a focus evaluation value at each position of the captured image from the eigenvalue λ s (obtained at S104) indicating the intensity of the image structure vector at the position of each target pixel.

ここで、上記の固有値λsは画像の構造の指向強度を2乗した量となっているので、固有値λsの2重根を合焦評価値とすることが好ましい。また、固有値λsは局所領域内の画素数に比例する値であるため、局所領域内の画素数で平均化することが好ましい。そのため、CPU14は、以下の式(4)により、各々の注目画素Xごとに合焦評価値Eを演算する。 Here, since the eigenvalue λ s is an amount obtained by squaring the directivity of the image structure, the double root of the eigenvalue λ s is preferably used as the focus evaluation value. Further, since the eigenvalue λ s is a value proportional to the number of pixels in the local area, it is preferable to average with the number of pixels in the local area. Therefore, the CPU 14 calculates a focus evaluation value E for each target pixel X by the following equation (4).

なお、式(4)の「N」は、局所領域内の画素数を示している。また、上記の画像構造ベクトルの強度が大きくなるほど画像の合焦度はより高くなることを示す。したがって、注目画素の位置での画像の合焦度が高い程上記の合焦評価値Eの値も高くなる。 Note that “N” in Expression (4) indicates the number of pixels in the local region. It also indicates that the degree of focus of the image increases as the intensity of the image structure vector increases. Therefore, the higher the focus degree of the image at the position of the target pixel is, the higher the focus evaluation value E is.

(ロ)CPU14は、隣接する注目画素間における画像構造ベクトルの方向の相関に基づいて、撮像画像の各位置での合焦評価値Eを求める。   (B) The CPU 14 obtains a focus evaluation value E at each position of the captured image based on the correlation of the direction of the image structure vector between adjacent target pixels.

画像内で合焦状態にある被写体については、画像における構造の相関が高くなることから、注目画素とその周囲の画素との画像構造ベクトルはそれぞれ同じ方向に向きやすくなる。一方、画像内でピントが合っていない被写体については、画像がボケて構造の指向性が失われてしまい、合焦状態と比べると画像構造ベクトルの向きは不均一なものとなる。そのため、隣接する注目画素間での画像構造ベクトルの方向の相関をみれば、画像の各位置での合焦度を評価できることが分かる。   For a subject that is in focus in the image, since the correlation of the structure in the image is high, the image structure vectors of the pixel of interest and its surrounding pixels are easily oriented in the same direction. On the other hand, for an out-of-focus subject in the image, the image is blurred and the directivity of the structure is lost, and the orientation of the image structure vector is non-uniform compared to the focused state. Therefore, it can be seen that the degree of focus at each position of the image can be evaluated by looking at the correlation of the direction of the image structure vector between adjacent target pixels.

ステップS107:CPU14は、S106で求めた合焦評価値の分布状態をモニタ19に表示する。これにより、ユーザーは、モニタ19の表示から画像の合焦状態を容易に確認できる。   Step S107: The CPU 14 displays the focus evaluation value distribution obtained in S106 on the monitor 19. Thereby, the user can easily confirm the focused state of the image from the display on the monitor 19.

一例として、図4に評価対象の撮像画像の例を示すとともに、図5に合焦評価値の分布状態の表示画面を模式的に示す。なお、簡単のため、図5の表示画面では合焦評価値が高いほど太い線で被写体を表現する。図4は、中央の人物にピントが合っているが、背景の木はボケた状態となっている画像を示している。この場合、図5に示す合焦評価値の表示画面では、人物の合焦評価値が高い値で示される一方で、背景の木の合焦評価値は低い値で示される。以上で、図2の流れ図の説明を終了する。   As an example, FIG. 4 shows an example of a captured image to be evaluated, and FIG. 5 schematically shows a display screen of a focus evaluation value distribution state. For the sake of simplicity, the subject is represented by a thicker line as the focus evaluation value is higher on the display screen of FIG. FIG. 4 shows an image in which the person in the center is in focus but the background tree is blurred. In this case, in the focus evaluation value display screen shown in FIG. 5, the focus evaluation value of the person is shown as a high value, while the focus evaluation value of the background tree is shown as a low value. Above, description of the flowchart of FIG. 2 is complete | finished.

(合焦度評価処理の動作例2)
次に、図6の流れ図を参照しつつ、一の実施形態の画像処理プログラムによる撮像画像の合焦度評価処理の別例として、複数枚の撮像画像を対象として各画像間で合焦状態を比較するときの動作例を説明する。なお、図6の流れ図の処理も、ユーザーによるプログラム実行指示に応じて開始される。
(Operation example 2 of focus evaluation processing)
Next, referring to the flowchart of FIG. 6, as another example of the focus degree evaluation process of the captured image by the image processing program of the one embodiment, the in-focus state between each image is targeted for a plurality of captured images. An operation example for comparison will be described. Note that the processing in the flowchart of FIG. 6 is also started in response to a program execution instruction from the user.

ステップS201:CPU14は、評価対象となる複数枚の撮像画像のデータを、データ読込部12を介して外部から取得する。ここでは一例としてS201でCPU14が、同一の被写体を連写撮影した撮像画像群を評価対象とする場合を考える。なお、S201の処理の内容は、図2のS101にほぼ対応するので重複説明は省略する。   Step S201: The CPU 14 acquires data of a plurality of captured images to be evaluated from the outside via the data reading unit 12. Here, as an example, a case is considered in which the CPU 14 sets a captured image group obtained by continuously shooting the same subject as an evaluation target in S201. Note that the content of the processing in S201 substantially corresponds to S101 in FIG.

ステップS202:CPU14は、上記の複数枚の撮像画像のうちで、合焦評価値の演算を行う画像を指定する。ここで、S202でのCPU14は、S201で取得した複数枚の撮像画像のすべてを演算対象として順次指定してゆくものとする。   Step S202: The CPU 14 designates an image on which the focus evaluation value is calculated among the plurality of captured images. Here, the CPU 14 in S202 sequentially designates all of the plurality of captured images acquired in S201 as calculation targets.

ステップS203:CPU14は、S202で指定した撮像画像の画素のうちから、画像構造ベクトルを求める注目画素Xの位置を指定する。   Step S203: The CPU 14 designates the position of the target pixel X for obtaining the image structure vector from the pixels of the captured image designated in S202.

ここでは一例としてS203でCPU14が、撮像画像を撮像したときの焦点検出エリアの位置を基準として、撮像画像の一部分に判定領域を設定する場合を考える。そして、この判定領域内の画素から注目画素Xを順次指定するものとする。   Here, as an example, consider a case where the CPU 14 sets a determination region in a part of the captured image based on the position of the focus detection area when the captured image is captured in S203. Then, the target pixel X is sequentially designated from the pixels in the determination area.

上記の判定領域を設定するために、S203でのCPU14は、撮影時の焦点検出エリアの位置情報を撮像画像データの付帯情報(例えばExif規格によるヘッダ情報)から取得するものとする。なお、図6の処理の例では、CPU14は、画像内で焦点検出エリアに対応する矩形の小領域を判定領域とする(図7参照)。また、各々の撮像画像間で判定領域の位置はいずれも共通するものとする。   In order to set the determination area, the CPU 14 in S203 acquires position information of a focus detection area at the time of shooting from supplementary information (for example, header information according to the Exif standard) of captured image data. In the example of the process in FIG. 6, the CPU 14 sets a rectangular small area corresponding to the focus detection area in the image as a determination area (see FIG. 7). In addition, it is assumed that the position of the determination region is common between the captured images.

ステップS204:CPU14は、判定領域内の注目画素Xの位置を基準として、撮像画像内に所定サイズの局所領域を設定する。なお、S204の処理の内容は、図2のS103に対応するので重複説明は省略する。   Step S204: The CPU 14 sets a local area of a predetermined size in the captured image with reference to the position of the target pixel X in the determination area. Note that the content of the processing in S204 corresponds to S103 in FIG.

ステップS205:CPU14は、局所領域に含まれる各画素の画素値の勾配情報を用いて、注目画素Xの位置での画像構造ベクトルを求める。なお、S205の処理の内容は、図2のS104に対応するので重複説明は省略する。   Step S205: The CPU 14 obtains an image structure vector at the position of the target pixel X using the gradient information of the pixel value of each pixel included in the local region. Note that the content of the processing in S205 corresponds to S104 in FIG.

ステップS206:CPU14は、現在の注目画素Xが上記判定領域内の最後の位置であるか否かを判定する。上記要件を満たす場合(YES側)にはS207に移行する。一方、上記要件を満たさない場合(NO側)には、CPU14はS203に戻って上記動作を繰り返す。なお、S206でのNO側のループにより、上記の判定領域内の各画素位置で求められた画像構造ベクトルの情報がそれぞれメモリ15に記憶されることとなる。   Step S206: The CPU 14 determines whether or not the current target pixel X is the last position in the determination area. If the above requirement is satisfied (YES side), the process proceeds to S207. On the other hand, if the above requirement is not satisfied (NO side), the CPU 14 returns to S203 and repeats the above operation. Note that the image structure vector information obtained at each pixel position in the determination region is stored in the memory 15 by the NO-side loop in S206.

ステップS207:CPU14は、判定領域内の画像構造ベクトルの情報を用いて、撮像画像の判定領域の各画素位置における合焦評価値Eを求める。S207でのCPU14は、図2のS106での処理と同様に、画像構造ベクトルの強度(固有値λs)から合焦評価値Eを求めるか、あるいは、隣接する注目画素間での固有単位ベクトルの内積から合焦評価値Eを求めればよい。そのため、上記の合焦評価値の演算についての重複説明は省略する。 Step S207: The CPU 14 obtains a focus evaluation value E at each pixel position in the determination region of the captured image using information on the image structure vector in the determination region. The CPU 14 in S207 obtains the focus evaluation value E from the intensity (eigenvalue λ s ) of the image structure vector as in the process in S106 of FIG. 2, or the eigenunit vector between adjacent target pixels. The focus evaluation value E may be obtained from the inner product. For this reason, redundant description of the calculation of the focus evaluation value is omitted.

ステップS208:CPU14は、全ての撮像画像が処理されたか否かを判定する。上記要件を満たす場合(YES側)にはS209に移行する。一方、上記要件を満たさない場合(NO側)には、CPU14はS202に戻って、未処理の他の撮像画像を演算対象として上記動作を繰り返す。   Step S208: The CPU 14 determines whether or not all captured images have been processed. If the above requirement is satisfied (YES side), the process proceeds to S209. On the other hand, if the above requirement is not satisfied (NO side), the CPU 14 returns to S202 and repeats the above operation with another unprocessed captured image as a calculation target.

ステップS209:CPU14は、各々の撮像画像の判定領域における合焦評価値Eの大きさを比較して、全ての撮像画像のうちから合焦度が最も高い画像を選択する。例えば、CPU14は、評価対象の撮像画像群のうちで合焦評価値Eが最大値をとる画像を選択する。   Step S209: The CPU 14 compares the in-focus evaluation values E in the determination areas of the respective captured images, and selects an image with the highest degree of focus from among all the captured images. For example, the CPU 14 selects an image in which the focus evaluation value E has the maximum value from the group of captured images to be evaluated.

ここで、画像構造ベクトルの強度から合焦評価値Eを求める場合、上記の固有値λsは画像の輝度値の影響を受けることとなる。そのため、それぞれ輝度の異なる複数の撮像画像間で固有値λsに基づく合焦評価値Eを比較する場合には、CPU14は合焦評価値Eを正規化する必要が生じる。一例として、CPU14は、任意の撮像画像における画像構造ベクトルの固有値λsの最大値λmaxを求めるとともに、全ての撮像画像において画像構造ベクトルの固有値λsをそれぞれ上記の最大値λmaxで除して正規化すればよい。なお、注目画素間での固有単位ベクトルの内積から合焦評価値Eを求めた場合には、合焦評価値Eは画像の輝度値に影響されないので上記のような正規化を行う必要はない。 Here, when the focus evaluation value E is obtained from the intensity of the image structure vector, the eigenvalue λ s is influenced by the luminance value of the image. Therefore, when comparing the focus evaluation value E based on the eigenvalue λ s between a plurality of captured images having different luminances, the CPU 14 needs to normalize the focus evaluation value E. As an example, CPU 14, as well as obtaining the maximum value lambda max of the eigenvalues lambda s of the image structure vectors in any of the captured image, the eigenvalues lambda s of the image structure vector are divided by the maximum value lambda max of the all of the captured image Normalization. When the focus evaluation value E is obtained from the inner product of the unique unit vectors between the target pixels, the focus evaluation value E is not affected by the luminance value of the image, and thus it is not necessary to perform the normalization as described above. .

ステップS210:CPU14は、S209での画像の選択結果をモニタ19に表示する。例えば、CPU14は、S209で選択された撮像画像の再生画面やファイル名の情報などをモニタ19に表示する(この場合の表示画面の図示は省略する)。これにより、ユーザーは、複数枚の撮像画像のうちから、焦点検出エリアに対応する被写体に最もピントが合った良好な画像を容易にピックアップできる。以上で、図6の流れ図の説明を終了する。   Step S210: The CPU 14 displays the image selection result in S209 on the monitor 19. For example, the CPU 14 displays the reproduction screen of the captured image selected in S209, information on the file name, and the like on the monitor 19 (the display screen in this case is not shown). Thus, the user can easily pick up a good image that is most in focus on the subject corresponding to the focus detection area from among the plurality of captured images. Above, description of the flowchart of FIG. 6 is complete | finished.

以下、一の実施形態での作用効果を述べる。一の実施形態でのCPU14は、撮像画像の局所領域での画像構造ベクトルをそれぞれ求めるとともに、画像構造ベクトルの強度や画像構造ベクトルの方向の相関に基づいて撮像画像の合焦度を評価する。上記の画像構造ベクトルは、局所領域内における画素値の勾配から主成分分析の手法を用いて求めるので、方向性のないノイズによる勾配成分から上記の画像構造ベクトルへのノイズの影響は非常に小さなものとなる。そのため、一の実施形態では、画像のエッジ量や画像の高周波成分から合焦度を求める手法よりも、画像の合焦度をより高い精度で求めることが可能となる。   Hereinafter, the operational effects of the embodiment will be described. In one embodiment, the CPU 14 obtains an image structure vector in a local region of the captured image, and evaluates the degree of focus of the captured image based on the correlation between the strength of the image structure vector and the direction of the image structure vector. Since the above image structure vector is obtained from the gradient of the pixel value in the local region using the principal component analysis method, the influence of noise from the gradient component due to non-directional noise on the above image structure vector is very small. It will be a thing. Therefore, in one embodiment, it is possible to obtain the degree of focus of an image with higher accuracy than the method of obtaining the degree of focus from the edge amount of the image and the high frequency component of the image.

また、一の実施形態では、撮像画像の撮像感度に応じてパラメータを調整する必要はなく、コンピュータ11によって撮像画像の合焦度を評価するときのユーザーの利便性が大きく向上する。   In one embodiment, it is not necessary to adjust parameters according to the imaging sensitivity of the captured image, and the convenience of the user when the computer 11 evaluates the degree of focus of the captured image is greatly improved.

<他の実施形態の説明>
図8は、他の実施形態の電子カメラの構成例を示すブロック図である。電子カメラ21は、フォーカシングレンズ22と、レンズ駆動部23と、撮像素子24と、制御部25と、ROM26と、バッファメモリ27と、モニタ28と、記録I/F29と、レリーズ釦30とを有している。ここで、レンズ駆動部23、撮像素子24、ROM26、バッファメモリ27、モニタ28、記録I/F29およびレリーズ釦30は、それぞれ制御部25に接続されている。
<Description of other embodiments>
FIG. 8 is a block diagram illustrating a configuration example of an electronic camera according to another embodiment. The electronic camera 21 includes a focusing lens 22, a lens driving unit 23, an image sensor 24, a control unit 25, a ROM 26, a buffer memory 27, a monitor 28, a recording I / F 29, and a release button 30. doing. Here, the lens driving unit 23, the image sensor 24, the ROM 26, the buffer memory 27, the monitor 28, the recording I / F 29, and the release button 30 are connected to the control unit 25, respectively.

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

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

ここで、電子カメラ21の撮影モードにおいて、撮像素子24はレリーズ釦30の全押し操作に応答して記録用の静止画像(本画像)を撮像する。また、撮影モードでの撮像素子24は、撮影待機時にも所定間隔毎に観測用の画像(スルー画像)を連続的に撮像する。ここで、時系列に取得されたスルー画像のデータは、モニタ28での動画像表示や制御部25による各種の演算処理に使用される。   Here, in the shooting mode of the electronic camera 21, the image sensor 24 captures a still image (main image) for recording in response to a full press operation of the release button 30. Further, the imaging element 24 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 28 and various arithmetic processes by the control unit 25.

制御部25は、電子カメラ21の動作を統括的に制御するプロセッサである。また、制御部25は、ROM26に格納されたプログラムの実行により、画像処理部31、合焦度評価部32として機能する。   The control unit 25 is a processor that comprehensively controls the operation of the electronic camera 21. Further, the control unit 25 functions as an image processing unit 31 and a focusing degree evaluation unit 32 by executing a program stored in the ROM 26.

画像処理部31は、撮像画像のデータに対して各種の画像処理(色補間処理、階調変換処理、輪郭強調処理、ホワイトバランス調整、色変換処理など)を施す。また、画像処理部31は、テンプレートマッチングにより、時系列に入力されるスルー画像から追尾対象となる被写体の位置を継続的に検出できる。なお、追尾対象の被写体としては、人間、動物、乗物などのあらゆる物体を対象とすることができる。   The image processing unit 31 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. Further, the image processing unit 31 can continuously detect the position of the subject to be tracked from the through image input in time series by template matching. Note that the tracking target subject can be any object such as a human being, an animal, or a vehicle.

合焦度評価部32は、上記の一の実施形態と同様に、撮像画像の局所領域で画像構造ベクトルをそれぞれ求めるとともに、画像構造ベクトルの情報を用いて合焦評価値を求める。   As in the first embodiment, the focus degree evaluation unit 32 obtains an image structure vector in each local region of the captured image, and obtains a focus evaluation value using information on the image structure vector.

ROM26には、制御部25によって実行されるプログラムが記憶されている。なお、このプログラムによる撮影モードでの動作例については後述する。また、バッファメモリ27は、画像処理部31による画像処理の前工程や後工程で画像のデータを一時的に記憶する。このバッファメモリ27は揮発性の記憶媒体であるSDRAMにより構成される。また、モニタ28は、制御部25の指示に応じて各種画像を表示する。   The ROM 26 stores a program executed by the control unit 25. An example of the operation in the shooting mode by this program will be described later. The buffer memory 27 temporarily stores image data in a pre-process or post-process of image processing by the image processing unit 31. The buffer memory 27 is composed of SDRAM which is a volatile storage medium. The monitor 28 displays various images according to instructions from the control unit 25.

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

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

(電子カメラの撮影モードでの動作例)
次に、図9の流れ図を参照しつつ、他の実施形態の電子カメラ21の撮影モードでの動作例を説明する。なお、図9の流れ図の処理は、レリーズ釦30の半押し操作に応じて開始される。
(Operation example in shooting mode of electronic camera)
Next, an operation example in the shooting mode of the electronic camera 21 of another embodiment will be described with reference to the flowchart of FIG. 9 is started in response to a half-press operation of the release button 30.

ステップS301:制御部25は、撮像素子24を駆動させてスルー画像を撮像する。そして、撮像素子24から出力されたスルー画像のデータは、制御部25に入力される。   Step S301: The control unit 25 drives the image sensor 24 to capture a through image. The through image data output from the image sensor 24 is input to the control unit 25.

ステップS302:合焦度評価部32は、スルー画像(S301)において焦点検出エリアに対応する判定領域から、画像構造ベクトルを求める注目画素Xの位置を指定する。   Step S302: The focus degree evaluation unit 32 designates the position of the target pixel X for obtaining the image structure vector from the determination area corresponding to the focus detection area in the through image (S301).

ステップS303:合焦度評価部32は、注目画素Xの位置を基準として、スルー画像内に所定サイズの局所領域を設定する。なお、S303の処理の内容は、図2のS103に対応するので重複説明は省略する。   Step S303: The focus degree evaluation unit 32 sets a local area of a predetermined size in the through image with the position of the target pixel X as a reference. Note that the content of the processing in S303 corresponds to S103 in FIG.

ステップS304:合焦度評価部32は、局所領域に含まれる各画素の画素値の勾配情報を用いて、注目画素Xの位置での画像構造ベクトルを求める。なお、S304の処理の内容は、図2のS104に対応するので重複説明は省略する。   Step S304: The focus evaluation unit 32 obtains an image structure vector at the position of the target pixel X using gradient information of pixel values of each pixel included in the local region. Note that the content of the process in S304 corresponds to S104 in FIG.

ステップS305:合焦度評価部32は、現在の注目画素Xが上記判定領域内の最後の位置であるか否かを判定する。上記要件を満たす場合(YES側)にはS306に移行する。一方、上記要件を満たさない場合(NO側)には、合焦度評価部32はS302に戻って上記動作を繰り返す。   Step S305: The focus degree evaluation unit 32 determines whether or not the current target pixel X is the last position in the determination area. If the above requirement is satisfied (YES side), the process proceeds to S306. On the other hand, when the above requirement is not satisfied (NO side), the focus evaluation unit 32 returns to S302 and repeats the above operation.

ステップS306:合焦度評価部32は、画像構造ベクトルの情報を用いて、スルー画像の判定領域における合焦評価値Eを求める。S306での合焦度評価部32は、図2のS106での処理と同様に、画像構造ベクトルの強度(固有値λs)から合焦評価値Eを求めるか、あるいは、隣接する注目画素間での固有単位ベクトルの内積から合焦評価値Eを求めればよい。そのため、上記の合焦評価値の演算についての重複説明は省略する。 Step S306: The focus degree evaluation unit 32 obtains a focus evaluation value E in the through image determination region using the information of the image structure vector. The focus degree evaluation unit 32 in S306 obtains the focus evaluation value E from the intensity (eigenvalue λ s ) of the image structure vector, or between adjacent target pixels, similarly to the process in S106 of FIG. The in-focus evaluation value E may be obtained from the inner product of the eigen unit vectors. For this reason, redundant description of the calculation of the focus evaluation value is omitted.

ステップS307:合焦度評価部32は、フォーカシングレンズ22のレンズ位置が合焦状態にあるか否かを判定する。具体的には、合焦度評価部32は、フォーカシングレンズ22のレンズ位置がそれぞれ前後するスルー画像との間で合焦評価値Eの大小を比較する。そして、合焦度評価部32は、現在のレンズ位置での合焦評価値Eがピークであれば合焦状態と判定する。   Step S307: The focus evaluation unit 32 determines whether or not the lens position of the focusing lens 22 is in focus. Specifically, the focus degree evaluation unit 32 compares the focus evaluation value E with the through image in which the lens position of the focusing lens 22 is front and back. Then, the focusing degree evaluation unit 32 determines that the in-focus state if the focusing evaluation value E at the current lens position is a peak.

上記要件を満たす場合(YES側)にはS309に移行する。一方、上記要件を満たさない場合(NO側)にはS308に移行する。なお、合焦評価値Eの初回演算時には、S307での合焦度評価部32はNO側の判定を行ってS308に処理を移行する。   If the above requirement is satisfied (YES side), the process proceeds to S309. On the other hand, if the above requirement is not satisfied (NO side), the process proceeds to S308. When the focus evaluation value E is calculated for the first time, the focus degree evaluation unit 32 in S307 performs a NO determination, and the process proceeds to S308.

ステップS308:制御部25は、レンズ駆動部23を介してフォーカシングレンズ22のレンズ位置を山登り動作で所定方向に移動させるとともに、S301に戻って上記動作を繰り返す。なお、制御部25は、レンズ位置の移動後に焦点評価値が大きくなる場合には、フォーカシングレンズ22を同一方向に移動させる。一方、制御部25は、レンズ位置の移動後に焦点評価値が小さくなる場合には、フォーカシングレンズ22を逆方向に移動させる。   Step S308: The control unit 25 moves the lens position of the focusing lens 22 in a predetermined direction by hill-climbing operation via the lens driving unit 23, and returns to S301 to repeat the above operation. Note that the control unit 25 moves the focusing lens 22 in the same direction when the focus evaluation value increases after the lens position is moved. On the other hand, when the focus evaluation value decreases after the lens position is moved, the control unit 25 moves the focusing lens 22 in the reverse direction.

ステップS309:制御部25は、レリーズ釦30が全押しされたか否かを判定する。レリーズ釦30が全押しされた場合(YES側)にはS310に移行する。一方、レリーズ釦30が全押しされていない場合(NO側)には、制御部25はレリーズ釦30の全押しを待機する。   Step S309: The control unit 25 determines whether or not the release button 30 has been fully pressed. When the release button 30 is fully pressed (YES side), the process proceeds to S310. On the other hand, when the release button 30 is not fully pressed (NO side), the control unit 25 waits for the release button 30 to be fully pressed.

ステップS310:制御部25は、撮像素子24を駆動させて本画像の撮像処理を実行する。本画像のデータは、画像処理部31で所定の処理が施された後に、記録I/F29を介して記憶媒体33に記録される。以上で、図9の流れ図の説明を終了する。   Step S <b> 310: The control unit 25 drives the image sensor 24 to execute a main image imaging process. The data of the main image is recorded in the storage medium 33 via the recording I / F 29 after being subjected to predetermined processing by the image processing unit 31. Above, description of the flowchart of FIG. 9 is complete | finished.

他の実施形態の電子カメラ21は、スルー画像を用いてAF制御を行うときに、一の実施形態と同様に画像構造ベクトルの情報に基づいて画像の合焦度を評価する。よって、他の実施形態の電子カメラ21では、ノイズによる誤検出が少なく精度のよいAFを実現できる。   When performing AF control using a through image, the electronic camera 21 of another embodiment evaluates the degree of focus of the image based on the information of the image structure vector as in the case of the first embodiment. Therefore, in the electronic camera 21 according to another embodiment, it is possible to realize a highly accurate AF with less erroneous detection due to noise.

(他の実施形態における撮影モードの変形例)
他の実施形態の電子カメラ21の撮影モードでは、画像処理部31は、スルー画像から追尾対象の被写体を継続的に検出する被写体追尾処理を実行することができる。例えば、画像処理部31は、レリーズ釦30の半押しに応答して、焦点検出エリアに対応する被写体のテンプレートをスルー画像から生成する。画像処理部31は、新たなスルー画像が取得されるたびにテンプレートマッチングを実行して、追尾対象の被写体を検出する。
(Modifications of shooting modes in other embodiments)
In the shooting mode of the electronic camera 21 according to another embodiment, the image processing unit 31 can execute subject tracking processing for continuously detecting a tracking target subject from a through image. For example, in response to a half-press of the release button 30, the image processing unit 31 generates a subject template corresponding to the focus detection area from the through image. The image processing unit 31 executes template matching each time a new through image is acquired, and detects a tracking target subject.

そして、上記の被写体追尾処理が実行されているときには、S302での合焦度評価部32は、各々のスルー画像において追尾対象の被写体の位置を中心として判定領域を設定してもよい。この場合には、被写体追尾のときのAF制御の精度を向上させることが可能となる。   Then, when the subject tracking process is being executed, the focus degree evaluation unit 32 in S302 may set a determination region around the position of the subject to be tracked in each through image. In this case, it is possible to improve the accuracy of AF control during subject tracking.

<実施形態の補足事項>
(1)本発明のプログラムを実行する装置は、上記実施形態のコンピュータ11や電子カメラ21の例に限定されることなく、画像の表示出力機能を有する電子機器全般(カメラ付携帯電話や画像のビューアなど)に広く適用できる。
<Supplementary items of the embodiment>
(1) The apparatus for executing the program of the present invention is not limited to the examples of the computer 11 and the electronic camera 21 of the above-described embodiment, and is a general electronic device having an image display output function (camera mobile phone with camera or image Widely applicable to viewers).

(2)上記の各実施形態では、合焦度を求める各種の演算処理をプログラムでソフトウェア的に実現する例を説明したが、これらの処理をASICを用いてハードウエア的に実現しても勿論かまわない。   (2) In each of the above-described embodiments, an example has been described in which various arithmetic processes for obtaining the degree of focus are realized by software using a program. However, these processes may be realized by hardware using an ASIC. It doesn't matter.

(3)上記の他の実施形態では、電子カメラ21がAFを行うときに画像構造ベクトルの情報に基づいて画像の合焦度を求める例を説明した。しかし、他の実施形態の電子カメラ21も、一の実施形態の場合と同様に、撮影後の後処理工程において本画像を評価対象として合焦度の評価を行うことは勿論可能である。   (3) In the other embodiments described above, an example has been described in which the degree of focus of an image is obtained based on information of an image structure vector when the electronic camera 21 performs AF. However, as with the case of the first embodiment, the electronic camera 21 of the other embodiments can of course evaluate the degree of focus using the main image as an evaluation target in a post-processing step after shooting.

(4)上記の図6の処理において、CPU14は、図2の処理の場合と同様に、撮像画像全体で画像構造ベクトルの情報を求めるようにしてもよい。   (4) In the process of FIG. 6 described above, the CPU 14 may obtain information on the image structure vector for the entire captured image, as in the case of the process of FIG.

以上の詳細な説明により、実施形態の特徴点および利点は明らかになるであろう。これは、特許請求の範囲が、その精神および権利範囲を逸脱しない範囲で前述のような実施形態の特徴点および利点にまで及ぶことを意図するものである。また、当該技術分野において通常の知識を有する者であれば、あらゆる改良および変更に容易に想到できるはずであり、発明性を有する実施形態の範囲を前述したものに限定する意図はなく、実施形態に開示された範囲に含まれる適当な改良物および均等物によることも可能である。   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.

一の実施形態に係る画像処理装置の構成例を示すブロック図1 is a block diagram illustrating a configuration example of an image processing apparatus according to an embodiment. 一の実施形態での撮像画像の合焦度評価処理の一例を示す流れ図The flowchart which shows an example of the focusing degree evaluation process of the captured image in one Embodiment 局所領域および画像構造ベクトルの説明図Illustration of local region and image structure vector 評価対象の撮像画像の例を示す図The figure which shows the example of the picked-up image of evaluation object 図4に対応する合焦評価値の分布状態の表示画面の例を示す模式図The schematic diagram which shows the example of the display screen of the distribution state of the focus evaluation value corresponding to FIG. 一の実施形態での撮像画像の合焦度評価処理の別例を示す流れ図The flowchart which shows another example of the focusing degree evaluation process of the captured image in one Embodiment 判定領域の設定例を示す図The figure which shows the example of setting of the judgment area 他の実施形態の電子カメラの構成例を示すブロック図The block diagram which shows the structural example of the electronic camera of other embodiment. 他の実施形態の電子カメラの撮影モードでの動作例を示す流れ図The flowchart which shows the operation example in the imaging | photography mode of the electronic camera of other embodiment

符号の説明Explanation of symbols

11…コンピュータ、12…データ読込部、13…記憶装置、14…CPU、15…メモリ、16…入出力I/F、17…バス、18…入力デバイス、19…モニタ、21…電子カメラ、22…フォーカシングレンズ、23…レンズ駆動部、24…撮像素子、25…制御部、26…ROM、27…バッファメモリ、28…モニタ、29…記録I/F、30…レリーズ釦、31…画像処理部、32…合焦度評価部、33…記憶媒体
DESCRIPTION OF SYMBOLS 11 ... Computer, 12 ... Data reading part, 13 ... Memory | storage device, 14 ... CPU, 15 ... Memory, 16 ... Input-output I / F, 17 ... Bus, 18 ... Input device, 19 ... Monitor, 21 ... Electronic camera, 22 DESCRIPTION OF SYMBOLS ... Focusing lens, 23 ... Lens drive part, 24 ... Image pick-up element, 25 ... Control part, 26 ... ROM, 27 ... Buffer memory, 28 ... Monitor, 29 ... Recording I / F, 30 ... Release button, 31 ... Image processing part 32 ... In-focus level evaluation unit 33 ... Storage medium

Claims (8)

撮像画像を取得する取得処理と、
前記撮像画像に含まれる画素のうちから注目画素を指定するとともに、前記注目画素の位置を基準として前記撮像画像内に所定サイズの局所領域を設定する局所領域設定処理と、
前記局所領域に含まれる複数の画素から求めた画素値の勾配情報を用いて、前記局所領域内での前記勾配情報の総和を変数とする主成分分析の固有値問題を解くことにより、前記注目画素の位置での画像構造を示す画像構造ベクトルを求める構造情報演算処置と、
少なくとも2つ以上の前記注目画素から求まる前記画像構造ベクトルの強度を示す情報の比較を行うことで、前記撮像画像の所定位置での合焦度を求める合焦度算出処理と、
前記画像読込処理で複数枚の前記撮像画像を取得したときに、各々の前記撮像画像において前記合焦度を求める判定領域をそれぞれ設定する判定領域設定処理と、
各々の前記撮像画像における前記判定領域での前記合焦度をそれぞれ比較して、該比較結果に基づいて前記撮像画像の選択を行う画像選択処理と、
をコンピュータに実行させることを特徴とするプログラム。
An acquisition process for acquiring a captured image;
A local area setting process for designating a target pixel from among pixels included in the captured image and setting a local area of a predetermined size in the captured image with reference to the position of the target pixel;
Using the gradient information of pixel values obtained from a plurality of pixels included in the local region, solving the eigenvalue problem of principal component analysis using the sum of the gradient information in the local region as a variable, the pixel of interest A structure information calculation procedure for obtaining an image structure vector indicating an image structure at the position of
A degree-of-focus calculation process for obtaining a degree of focus at a predetermined position of the captured image by comparing information indicating the intensity of the image structure vector obtained from at least two pixels of interest;
A determination area setting process for setting a determination area for obtaining the degree of focus in each captured image when a plurality of the captured images are acquired in the image reading process;
An image selection process for comparing the degree of focus in the determination region in each captured image and selecting the captured image based on the comparison result;
A program that causes a computer to execute.
請求項1に記載のプログラムにおいて、
前記構造情報演算処置では、前記局所領域内の画素xについて、画素値の勾配を
但し、式(2)の「C」は下式(3)により定義される。
The program according to claim 1,
In the structure information calculation procedure, the gradient of the pixel value is calculated for the pixel x i in the local region.
However, “C” in the equation (2) is defined by the following equation (3).
請求項1又は2に記載のプログラムにおいて、
前記合焦度算出処理の代わりに、隣接する前記注目画素間における前記画像構造ベクトルの方向の相関に基づいて前記合焦度を求める第2の合焦度算出処理を備える、ことを特徴とするプログラム。
In the program according to claim 1 or 2,
Instead of the focus degree calculation process, a second focus degree calculation process for obtaining the focus degree based on the correlation of the direction of the image structure vector between the adjacent target pixels is provided. program.
請求項1から3のいずれか1項に記載のプログラムにおいて、
前記撮像画像を撮像したときの焦点検出エリアの位置情報を取得する焦点位置情報取得処理をさらに含み、
前記判定領域設定処理では、前記焦点検出エリアの位置に基づいて前記判定領域を設定することを特徴とするプログラム。
In the program according to any one of claims 1 to 3,
A focus position information acquisition process for acquiring position information of a focus detection area when the captured image is captured;
In the determination area setting process, the determination area is set based on a position of the focus detection area.
請求項1から4のいずれか1項に記載のプログラムにおいて、
前記画像読込処理で複数枚の前記撮像画像を取得したときに、各々の前記撮像画像において追尾対象の被写体を検出する被写体追尾処理をさらに含み、
前記判定領域設定処理では、前記追尾対象の被写体の位置に基づいて前記判定領域を設定することを特徴とするプログラム。
In the program according to any one of claims 1 to 4,
A subject tracking process for detecting a subject to be tracked in each of the captured images when acquiring a plurality of the captured images in the image reading process;
In the determination area setting process, the determination area is set based on the position of the subject to be tracked.
請求項1から請求項5のいずれか1項に記載のプログラムを実行するコンピュータを備えることを特徴とするカメラ。   A camera comprising a computer that executes the program according to any one of claims 1 to 5. 撮像画像を取得する取得工程と、
前記撮像画像に含まれる画素のうちから注目画素を指定するとともに、前記注目画素の位置を基準として前記撮像画像内に所定サイズの局所領域を設定する局所領域設定工程と、
前記局所領域に含まれる複数の画素から求めた画素値の勾配情報を用い、前記局所領域内での前記勾配情報の総和を変数とする主成分分析の固有値問題を解くことにより、前記注目画素の位置での画像構造を示す画像構造ベクトルを求める構造情報演算工程と、
少なくとも2つ以上の前記注目画素から求まる前記画像構造ベクトルの強度を示す情報の比較を行うことで、前記撮像画像の所定位置での合焦度を求める合焦度算出工程と、
前記画像読込処理で複数枚の前記撮像画像を取得したときに、各々の前記撮像画像において前記合焦度を求める判定領域をそれぞれ設定する判定領域設定処理工程と、
各々の前記撮像画像における前記判定領域での前記合焦度をそれぞれ比較して、該比較結果に基づいて前記撮像画像の選択を行う画像選択処理工程と、
を含むことを特徴とする画像の合焦度算出方法。
An acquisition step of acquiring a captured image;
A local region setting step of designating a target pixel from among pixels included in the captured image and setting a local region of a predetermined size in the captured image with reference to the position of the target pixel;
By using gradient information of pixel values obtained from a plurality of pixels included in the local region, and solving an eigenvalue problem of principal component analysis using the sum of the gradient information in the local region as a variable, A structure information calculation step for obtaining an image structure vector indicating an image structure at a position;
A degree-of-focus calculation step for obtaining a degree of focus at a predetermined position of the captured image by comparing information indicating the intensity of the image structure vector obtained from at least two of the target pixels; and
A determination area setting process step for setting a determination area for obtaining the degree of focus in each captured image when acquiring a plurality of the captured images in the image reading process;
An image selection processing step of comparing the degree of focus in the determination region in each captured image and selecting the captured image based on the comparison result;
A method for calculating the degree of focus of an image, comprising:
撮像画像を取得する取得部と、
前記撮像画像に含まれる画素のうちから注目画素を指定するとともに、前記注目画素の位置を基準として前記撮像画像内に所定サイズの局所領域を設定する局所領域設定部と、
前記局所領域に含まれる複数の画素から求めた画素値の勾配情報を用いて、前記局所領域内での前記勾配情報の総和を変数とする主成分分析の固有値問題を解くことにより、前記注目画素の位置での画像構造を示す画像構造ベクトルを求める構造情報演算部と、
少なくとも2つ以上の前記注目画素から求まる前記画像構造ベクトルの強度を示す情報の比較を行うことで、前記撮像画像の所定位置での合焦度を求める合焦度算出部と、
前記画像読込処理で複数枚の前記撮像画像を取得したときに、各々の前記撮像画像において前記合焦度を求める判定領域をそれぞれ設定する判定領域設定部と、
各々の前記撮像画像における前記判定領域での前記合焦度をそれぞれ比較して、該比較結果に基づいて前記撮像画像の選択を行う画像選択部と、
を備えたことを特徴とする画像処理装置。
An acquisition unit for acquiring a captured image;
A local region setting unit that specifies a target pixel from among pixels included in the captured image, and sets a local region of a predetermined size in the captured image with reference to the position of the target pixel;
Using the gradient information of pixel values obtained from a plurality of pixels included in the local region, solving the eigenvalue problem of principal component analysis using the sum of the gradient information in the local region as a variable, the pixel of interest A structure information calculation unit for obtaining an image structure vector indicating an image structure at a position of
A degree-of-focus calculation unit that obtains a degree of focus at a predetermined position of the captured image by comparing information indicating the intensity of the image structure vector obtained from at least two or more pixels of interest;
A determination area setting unit that sets a determination area for obtaining the degree of focus in each captured image when a plurality of the captured images are acquired in the image reading process;
An image selection unit that compares the degree of focus in the determination region in each captured image and selects the captured image based on the comparison result;
An image processing apparatus comprising:
JP2008239182A 2008-09-18 2008-09-18 Program, camera, image processing apparatus, and method of calculating degree of focus of image Active JP5353141B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008239182A JP5353141B2 (en) 2008-09-18 2008-09-18 Program, camera, image processing apparatus, and method of calculating degree of focus of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008239182A JP5353141B2 (en) 2008-09-18 2008-09-18 Program, camera, image processing apparatus, and method of calculating degree of focus of image

Publications (2)

Publication Number Publication Date
JP2010072298A JP2010072298A (en) 2010-04-02
JP5353141B2 true JP5353141B2 (en) 2013-11-27

Family

ID=42204141

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008239182A Active JP5353141B2 (en) 2008-09-18 2008-09-18 Program, camera, image processing apparatus, and method of calculating degree of focus of image

Country Status (1)

Country Link
JP (1) JP5353141B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5920608B2 (en) * 2011-06-09 2016-05-25 ナム タイ,ヒョク Imaging system and method for evaluating image sharpness

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001305421A (en) * 2000-04-25 2001-10-31 Sharp Corp Automatic focusing device
JP2004219546A (en) * 2003-01-10 2004-08-05 Pentax Corp Automatic focusing device and automatic focusing method
JP2007088814A (en) * 2005-09-22 2007-04-05 Casio Comput Co Ltd Imaging apparatus, image recorder and imaging control program
JP2007233247A (en) * 2006-03-03 2007-09-13 Fujifilm Corp Focus adjusting amount decision device, method and program and imaging apparatus
JP2007266662A (en) * 2006-03-27 2007-10-11 Sanyo Electric Co Ltd Thumbnail generating device and imaging apparatus

Also Published As

Publication number Publication date
JP2010072298A (en) 2010-04-02

Similar Documents

Publication Publication Date Title
US9967482B2 (en) Image processing apparatus, image processing method, and storage medium for noise reduction processing
US8405736B2 (en) Face detection using orientation sensor data
US9508153B2 (en) Distance measurement apparatus, imaging apparatus, distance measurement method, and program
JP2009212853A (en) White balance controller, its control method, and imaging apparatus
JP2009111716A (en) Imaging apparatus, program and template generating method
US9489721B2 (en) Image processing apparatus, image processing method, and storage medium
JP6491581B2 (en) Image processing apparatus, control method therefor, and program
US20210256713A1 (en) Image processing apparatus and image processing method
KR102562720B1 (en) Detection apparatus, image processing apparatus, detection method, and image processing method
JP5369729B2 (en) Image processing apparatus, imaging apparatus, and program
JP5499531B2 (en) Electronic camera
JP2010154306A (en) Device, program and method for imaging control
JP4971785B2 (en) Image processing apparatus and method, and imaging apparatus
JP5206300B2 (en) Program, camera, image processing apparatus, and method for calculating focus degree of image
JP5353141B2 (en) Program, camera, image processing apparatus, and method of calculating degree of focus of image
JP2007258923A (en) Image processing apparatus, image processing method, image processing program
JP6099973B2 (en) Subject area tracking device, control method thereof, and program
JP2014007528A (en) Image processing apparatus and control method thereof
JP5146223B2 (en) Program, camera, image processing apparatus, and image contour extraction method
JP2022184134A (en) Imaging apparatus and control method thereof
US11403736B2 (en) Image processing apparatus to reduce noise in an image
JP7009252B2 (en) Image processing equipment, image processing methods and programs
US10237469B2 (en) Information processing apparatus, information processing method, and storage medium
JP5029647B2 (en) Subject tracking device and camera
JP2011147076A (en) Image processing apparatus, image capturing apparatus and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110916

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120322

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120813

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120925

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121126

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130514

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130711

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130812

R150 Certificate of patent or registration of utility model

Ref document number: 5353141

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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