JP2009098436A - Focusing measurement device, method of focusing measurement and program - Google Patents

Focusing measurement device, method of focusing measurement and program Download PDF

Info

Publication number
JP2009098436A
JP2009098436A JP2007270197A JP2007270197A JP2009098436A JP 2009098436 A JP2009098436 A JP 2009098436A JP 2007270197 A JP2007270197 A JP 2007270197A JP 2007270197 A JP2007270197 A JP 2007270197A JP 2009098436 A JP2009098436 A JP 2009098436A
Authority
JP
Japan
Prior art keywords
image
focus
amount
value
unit
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
JP2007270197A
Other languages
Japanese (ja)
Other versions
JP5115138B2 (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 JP2007270197A priority Critical patent/JP5115138B2/en
Priority to PCT/JP2008/002298 priority patent/WO2009050841A1/en
Priority to US12/669,934 priority patent/US8558942B2/en
Publication of JP2009098436A publication Critical patent/JP2009098436A/en
Application granted granted Critical
Publication of JP5115138B2 publication Critical patent/JP5115138B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology with which the focusing level is accurately measured in the focusing measurement of an image even for an image having a large luminance difference. <P>SOLUTION: A focusing measurement device of a first invention comprises: an image input part which captures an imaged image; a filter part which generates an out-of-focus image by using a pair of filters which have respectively different frequency characteristics for the image; an extraction part which extracts a first amount of feature and a second amount of feature from the image and the out-of-focus image, respectively, at a plurality of points on the image; a calculation part which calculates a focusing quantity which shows the degree of focusing on the basis of the first amount of feature and the second amount of feature; and a measurement part which measures the focusing level at the plurality of points of the image on the basis of the calculated focusing quantity. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、電子カメラ等の撮像装置のオートフォーカスや撮像された画像におけるピントの合っている度合いを示す合焦レベルを評価する合焦測定装置、合焦測定方法およびプログラムに関する。   The present invention relates to an in-focus measuring apparatus, an in-focus measuring method, and a program for evaluating an in-focus level indicating an autofocus of an imaging apparatus such as an electronic camera or a focus level in a captured image.

従来、ピントが合っているか否かの判定は、画像全領域またはオートフォーカス選択領域のような特定領域における画像のコントラストに基づいて行われる。即ち、コントラストが高いほどピントが合っており、低いほどピントがずれていると判定される。   Conventionally, whether or not the image is in focus is determined based on the contrast of the image in a specific region such as the entire image region or the autofocus selection region. That is, it is determined that the focus is higher as the contrast is higher and the focus is shifted as the contrast is lower.

特許文献1では、画像の特定領域における高周波成分を抽出して積算する。その積算値を、特定領域におけるコントラストを示す評価値として用いピントが合っているか否かの判定を行うことを開示している。   In Patent Document 1, high frequency components in a specific region of an image are extracted and integrated. It is disclosed that the integrated value is used as an evaluation value indicating the contrast in a specific region to determine whether or not the subject is in focus.

特許文献2では、画像の特定領域において遮断周波数の異なる2つの高周波成分をそれぞれ抽出する。2つの高周波成分から算出される評価値に基づいて、撮像装置の撮像レンズの移動速度をピントの合っている位置からのずれ幅に応じて適宜変えることで、ピントの合っている位置に収束する収束時間を向上させることを開示している。
特許第3840725号公報 特開平10−221594号公報
In Patent Document 2, two high-frequency components having different cutoff frequencies are extracted in a specific region of an image. Based on the evaluation value calculated from the two high-frequency components, the moving speed of the imaging lens of the imaging device is appropriately changed according to the deviation width from the in-focus position, thereby converging to the in-focus position. It discloses disclosing convergence time.
Japanese Patent No. 3840725 Japanese Patent Laid-Open No. 10-221594

しかしながら、特許文献1や特許文献2のような手法では、画像において、ピントは合っているが輝度差の小さい領域での評価値よりも、ピントは合っていないが輝度差の大きい領域での評価値の方が大きくなる場合がある。その結果、ピントが合っていないにもかかわらず、輝度差の大きい領域のところでピントが合っているという誤判定が生じる。   However, in the methods such as Patent Document 1 and Patent Document 2, in an image, the evaluation is performed in an area where the brightness difference is large but the focus difference is smaller than the evaluation value in the area where the brightness difference is small. The value may be larger. As a result, there is an erroneous determination that the image is in focus in a region where the luminance difference is large even though the image is not in focus.

上記従来技術が有する問題に鑑み、本発明の目的は、大きな輝度差が存在する画像の合焦レベルの測定においても正確に合焦測定できる技術を提供することにある。   SUMMARY OF THE INVENTION In view of the above-described problems of the prior art, an object of the present invention is to provide a technique that enables accurate focus measurement even when measuring the focus level of an image having a large luminance difference.

第1の発明に係る合焦測定装置は、撮像した画像を取得する画像入力部と、画像に対して周波数特性の異なる一対のフィルタをそれぞれ用いてボケ画像を生成するフィルタ部と、画像の複数の箇所において、画像と各々のボケ画像とから第1の特徴量と第2の特徴量とをそれぞれ抽出する抽出部と、第1の特徴量と第2の特徴量とからピントの合っている度合いを示す合焦量を算出する演算部と、算出された合焦量に基づいて画像の複数の箇所における合焦レベルを測定する測定部とを備えることを特徴とする。   An in-focus measurement apparatus according to a first invention includes an image input unit that acquires a captured image, a filter unit that generates a blurred image using a pair of filters having different frequency characteristics with respect to the image, and a plurality of images , The extraction unit for extracting the first feature value and the second feature value from the image and each blurred image, and the first feature value and the second feature value are in focus. An arithmetic unit that calculates a focus amount indicating a degree, and a measurement unit that measures focus levels at a plurality of locations on the image based on the calculated focus amount.

第2の発明は、第1の発明において、演算部は、第1の特徴量と第2の特徴量との差分、または差分を第1の特徴量、第2の特徴量または第1の特徴量と第2の特徴量との平均値で割った値を合焦量とすることを特徴とする。   In a second aspect based on the first aspect, the computing unit calculates the difference between the first feature amount and the second feature amount, or the difference as the first feature amount, the second feature amount, or the first feature. A value obtained by dividing the amount by the average value of the amount and the second feature amount is used as a focusing amount.

第3の発明は、第1の発明または第2の発明において、第1の特徴量および第2の特徴量は、画像と各々のボケ画像との差分または差分の絶対値から求まるエッジ量であることを特徴とする。   In a third aspect based on the first aspect or the second aspect, the first feature amount and the second feature amount are edge amounts obtained from a difference between the image and each blurred image or an absolute value of the difference. It is characterized by that.

第4の発明は、第1の発明ないし第3の発明のいずれかにおいて、演算部は、画像の複数の箇所のうち画像の所定の領域内にある箇所の各々にて算出された合焦量に基づいて、合焦レベルの基準値を算出する基準値演算部をさらに備え、測定部は、画像の複数の箇所における合焦レベルの測定を合焦量の基準値に対する値の大きさに基づいて行う基準値測定部をさらに備えることを特徴とする。   In a fourth aspect based on any one of the first aspect to the third aspect, the arithmetic unit calculates the amount of focus calculated at each of the portions in the predetermined region of the image among the plurality of portions of the image. And a reference value calculation unit that calculates a reference value of the focus level based on the measurement value, and the measurement unit measures the focus level at a plurality of locations of the image based on the magnitude of the value with respect to the reference value of the focus amount. And a reference value measuring unit to be performed.

第5の発明は、第4の発明において、測定部は、同一の撮像装置で撮像した他の画像の合焦レベルの測定に対しても基準値を用いるために保持する基準値記憶部をさらに備えることを特徴とする。   According to a fifth aspect, in the fourth aspect, the measurement unit further includes a reference value storage unit that is held to use the reference value for the measurement of the focus level of another image captured by the same imaging device. It is characterized by providing.

第6の発明は、第4の発明において、所定の領域は画像全領域であることを特徴とする。   In a sixth aspect based on the fourth aspect, the predetermined area is the entire image area.

第7の発明は、第4の発明において、所定の領域は撮影時のオートフォーカス選択領域であることを特徴とする。   According to a seventh aspect, in the fourth aspect, the predetermined area is an autofocus selection area at the time of shooting.

第8の発明は、第1の発明ないし第7の発明のいずれかにおいて、フィルタ部は、フィルタの周波数特性を撮像素子のISO感度に応じて変える周波数特性調節部をさらに備えることを特徴とする。   According to an eighth invention, in any one of the first to seventh inventions, the filter unit further includes a frequency characteristic adjusting unit that changes the frequency characteristic of the filter in accordance with the ISO sensitivity of the image sensor. .

第9の発明に係る合焦判定方法は、撮像した画像に対して周波数特性の異なる一対のフィルタをそれぞれ用いてボケ画像を生成する工程と、画像の複数の箇所において、画像と各々のボケ画像とから第1の特徴量と第2の特徴量とをそれぞれ抽出する工程と、第1の特徴量と第2の特徴量とからピントの合っている度合いを示す合焦量を算出する工程と、算出された合焦量に基づいて画像の複数の箇所における合焦レベルを測定する工程とを備えることを特徴とする。   According to a ninth aspect of the present invention, there is provided an in-focus determination method for generating a blurred image using a pair of filters having different frequency characteristics with respect to a captured image, and the image and each blurred image at a plurality of locations of the image. Extracting a first feature value and a second feature value from the first feature value, calculating a focus amount indicating a degree of focus from the first feature value and the second feature value, respectively. And a step of measuring focus levels at a plurality of locations of the image based on the calculated focus amount.

第10の発明のプログラムは、第1の発明ないし第8の発明のいずれかの合焦測定装置として、コンピュータを機能させる。   A program of a tenth invention causes a computer to function as the focus measurement device of any of the first to eighth inventions.

本発明によれば、1対の周波数特性の異なるフィルタを用いて画像の特徴量をそれぞれ抽出し、それらの差分を算出することにより、大きな輝度差が存在する画像においても合焦レベルを正確に測定することが可能となる。   According to the present invention, by extracting a feature amount of an image using a pair of filters having different frequency characteristics and calculating the difference between them, the focus level can be accurately adjusted even in an image having a large luminance difference. It becomes possible to measure.

≪第1の実施形態≫
図1は、本発明の第1の実施形態に係る電子カメラ10の構成図である。電子カメラ10は、撮像レンズ1、撮像素子2、A/D変換部3、バッファメモリ4、記憶部5、レンズ駆動部6、CPU7、操作部材8およびモニタ9から構成される。撮像レンズ1のレンズ駆動部6と撮像素子2とは、CPU7とそれぞれ接続されている。一方、バッファメモリ4、記憶部5、CPU7、操作部材8およびモニタ9は、バス11を介して情報伝達可能に接続されている。
<< First Embodiment >>
FIG. 1 is a configuration diagram of an electronic camera 10 according to the first embodiment of the present invention. The electronic camera 10 includes an imaging lens 1, an imaging device 2, an A / D conversion unit 3, a buffer memory 4, a storage unit 5, a lens driving unit 6, a CPU 7, an operation member 8, and a monitor 9. The lens driving unit 6 and the imaging element 2 of the imaging lens 1 are connected to the CPU 7 respectively. On the other hand, the buffer memory 4, the storage unit 5, the CPU 7, the operation member 8, and the monitor 9 are connected via a bus 11 so that information can be transmitted.

被写体からの光は、撮像レンズ1によって撮像素子2の撮像面に結像される。撮像素子2は、CPU7の指示に従って撮像する。撮像素子2は、CCDやCMOSの半導体のイメージセンサ等を適宜選択して用いることができる。   Light from the subject is imaged on the imaging surface of the imaging device 2 by the imaging lens 1. The image sensor 2 captures images according to instructions from the CPU 7. As the image sensor 2, a CCD or CMOS semiconductor image sensor or the like can be appropriately selected and used.

A/D変換部3は、撮像素子2からの画像信号の出力に対してA/D変換を行い、画像のデジタル信号を出力する。   The A / D converter 3 performs A / D conversion on the output of the image signal from the image sensor 2 and outputs a digital signal of the image.

バッファメモリ4は、撮像素子2が撮像してA/D変換された被写体像の画像を一時的に格納し保持する。   The buffer memory 4 temporarily stores and holds an image of the subject image captured by the image sensor 2 and A / D converted.

レンズ駆動部6は、CPU7の指示に基づいて撮像レンズ1をピントの合う最適な位置に移動させる。   The lens driving unit 6 moves the imaging lens 1 to an optimal position in focus based on an instruction from the CPU 7.

記憶部5は、バッファメモリ4に保持された画像を、CPU7の指示によりバス11を介して格納する。画像は、ビットマップ形式、jpeg形式、tiff形式等の様々な形式で保存される。また、記憶部5は、CPU7によって実行される合焦測定プログラム等を保存する。記憶部5に保存される画像やプログラム等は、バス11を介してCPU7から適宜参照することができる。記憶部5は、一般的なハードディスク装置や光磁気ディスク装置または脱着可能なメモリカード等の記憶装置を選択して用いることができる。   The storage unit 5 stores the image held in the buffer memory 4 via the bus 11 according to an instruction from the CPU 7. The image is stored in various formats such as a bitmap format, a jpeg format, and a tiff format. The storage unit 5 stores a focus measurement program executed by the CPU 7. Images, programs, and the like stored in the storage unit 5 can be appropriately referred from the CPU 7 via the bus 11. The storage unit 5 can select and use a storage device such as a general hard disk device, a magneto-optical disk device, or a removable memory card.

CPU7は、記憶部5に保存されている合焦測定プログラムを実行して、バッファメモリ4または記憶部5に保存されている画像を適宜読み込み合焦測定を行う。その測定結果に基づいて、CPU7は、撮像レンズ1をピントの合う最適な位置に移動させる指令をレンズ駆動部6に送信する。同時に、CPU7は、その測定結果を記憶部5に保存したりモニタ9に出力する。CPU7には、一般的なコンピュータのCPUが使用できる。   The CPU 7 executes a focus measurement program stored in the storage unit 5 and appropriately reads an image stored in the buffer memory 4 or the storage unit 5 to perform focus measurement. Based on the measurement result, the CPU 7 transmits a command for moving the imaging lens 1 to the optimum position in focus to the lens driving unit 6. At the same time, the CPU 7 stores the measurement result in the storage unit 5 or outputs it to the monitor 9. As the CPU 7, a CPU of a general computer can be used.

操作部材8は、ユーザによる部材操作の内容に応じた操作信号をCPU7に送る。操作部材8は、例えば、撮影モード等のモード設定釦、ズーム設定釦、レリーズ釦等の操作部材を有する。   The operation member 8 sends an operation signal corresponding to the content of the member operation by the user to the CPU 7. The operation member 8 includes operation members such as a mode setting button such as a shooting mode, a zoom setting button, and a release button.

モニタ9は、撮影された画像やモード設定画面等を表示する。モニタ9には、液晶モニタ等を適宜選択して用いることができる。   The monitor 9 displays a captured image, a mode setting screen, and the like. As the monitor 9, a liquid crystal monitor or the like can be appropriately selected and used.

次に、本第1の実施形態に係る合焦測定の手順について、図2のフローチャートを参照しながら説明する。   Next, the procedure for focusing measurement according to the first embodiment will be described with reference to the flowchart of FIG.

具体的には、ユーザが操作部材8のレリーズ釦を半押しすることにより、CPU7に対して被写体を撮像するための合焦測定の指令が送信される。CPU7は、記憶部5に保存する合焦測定プログラムを実行する。その結果、図2のステップS101からステップS108の処理が行われる。なお、本第1の実施形態において、電子カメラ10が撮像しようとする被写体は、図3のようなサッカーゴール周辺の風景とする。ピント合わせの基準となるオートフォーカス選択領域20を、サッカーゴール足下の芝に設定する。   Specifically, when the user presses the release button of the operation member 8 halfway, a focus measurement command for imaging the subject is transmitted to the CPU 7. The CPU 7 executes a focus measurement program stored in the storage unit 5. As a result, the processing from step S101 to step S108 in FIG. 2 is performed. In the first embodiment, the subject to be imaged by the electronic camera 10 is a landscape around the soccer goal as shown in FIG. An autofocus selection area 20 which is a reference for focusing is set on the grass under the soccer goal.

ステップS101では、CPU7が、現位置での撮像レンズ1によって撮像素子2の撮像面に結像される被写体像を撮像素子2に撮像させる。撮像した画像は、A/D変換部3を介してバッファメモリ4に保持される。CPU7は、撮像した画像をバッファメモリ4から直接読み込む。   In step S <b> 101, the CPU 7 causes the image pickup device 2 to pick up a subject image formed on the image pickup surface of the image pickup device 2 by the image pickup lens 1 at the current position. The captured image is held in the buffer memory 4 via the A / D conversion unit 3. The CPU 7 reads the captured image directly from the buffer memory 4.

ステップS102では、CPU7が、撮像した画像から2つのエッジ量を抽出する。CPU7は、周波数特性を示すパラメータσの異なる2つのガウス型をしたボカシフィルタP(r)∝exp(−r2/2σ2)を用い、画像に対してそれぞれ平滑化処理を行いボケ画像を生成する。CPU7は、撮像した画像と各々のボケ画像との差分を取ることにより、エッジ量の分布を示す2つのエッジ画像を生成する。CPU7は、2つのエッジ画像を記憶部5に保持する。 In step S102, the CPU 7 extracts two edge amounts from the captured image. The CPU 7 uses the two Gaussian blur filters P (r) ∝exp (−r 2 / 2σ 2 ) having different parameters σ indicating the frequency characteristics to generate a blurred image by performing smoothing processing on each of the images. To do. The CPU 7 generates two edge images indicating the distribution of edge amounts by taking the difference between the captured image and each blurred image. The CPU 7 holds two edge images in the storage unit 5.

なお、2つのパラメータσの値は任意に選ぶことができる。互いに近い値を選択することが好適である。その理由は、画像のピントが合っていない領域でのエッジ量は、ボカシフィルタPのパラメータσを少し変えたとしても、エッジ量の値はほとんど変化しない。一方、画像のピントが合っている領域では、ボカシフィルタPのパラメータσを少し変えると、エッジ量の値は大きく変化する。即ち、後述するステップS104にて求める2つのエッジ画像の差分で、エッジ量の変位を表す合焦量は、ピントが合っている領域ではそうでない領域と比べて大きな値となり、合焦レベルの測定が容易になる。したがって、本第1の実施形態では、σ=0.5と0.6とする。   The values of the two parameters σ can be arbitrarily selected. It is preferable to select values close to each other. The reason for this is that, even if the parameter σ of the blur filter P is slightly changed, the value of the edge amount in the region where the image is not in focus hardly changes. On the other hand, in the region where the image is in focus, when the parameter σ of the blur filter P is slightly changed, the value of the edge amount changes greatly. In other words, the focus amount representing the displacement of the edge amount is a difference between two edge images obtained in step S104, which will be described later, in the in-focus area, which is larger than the non-focus area, and the focus level is measured. Becomes easier. Therefore, in the first embodiment, σ = 0.5 and 0.6.

ステップS103では、CPU7が、ステップS102で求めたエッジ画像の各々について、例えば30画素×30画素の大きさのブロック領域に分割する。CPU7は、各エッジ画像のブロック領域毎に、そのブロック領域に含まれる画素全てのエッジ量を積算して全画素数で割ったエッジ量の平均値を算出する。これにより、各ブロック領域の特徴を1つの値で表せる。   In step S103, the CPU 7 divides each edge image obtained in step S102 into block areas each having a size of 30 pixels × 30 pixels, for example. For each block region of each edge image, the CPU 7 calculates an average value of the edge amounts obtained by integrating the edge amounts of all the pixels included in the block region and dividing the sum by the total number of pixels. Thereby, the feature of each block area can be expressed by one value.

ステップS104では、CPU7が、ブロック領域毎に、ステップS103において求めた2つのエッジ量の平均値の差分を、同じブロック領域のσ=0.5で求めたエッジ量の平均値で割る。CPU7は、算出した値をブロック領域の各々における合焦量として記憶部5に保持する。なお、本第1の実施形態では、合焦量を、2つのエッジ量の平均値の差分を同じブロック領域のσ=0.5で求めたエッジ量の平均値で割った値としたが、同じブロック領域のσ=0.6で求めたエッジ量の平均値やそれらを平均した値で割った値としても良い。   In step S104, the CPU 7 divides, for each block area, the difference between the average values of the two edge amounts obtained in step S103 by the average value of the edge amounts obtained with σ = 0.5 in the same block area. The CPU 7 holds the calculated value in the storage unit 5 as the focusing amount in each block area. In the first embodiment, the focus amount is a value obtained by dividing the difference between the average values of the two edge amounts by the average value of the edge amounts obtained with σ = 0.5 of the same block region. An average value of edge amounts obtained with σ = 0.6 in the same block region or a value obtained by dividing them by an average value may be used.

ステップS105では、CPU7が、ステップS104で求めた合焦量のうち、オートフォーカス選択領域20に含まれるブロック領域の合焦量を用いて、オートフォーカス選択領域20における合焦量の平均値を求める。CPU7は、求めた平均値を合焦量の基準値として記憶部5に保持する。   In step S105, the CPU 7 calculates an average value of the focusing amount in the autofocus selection area 20 by using the focusing amount of the block area included in the autofocus selection area 20 among the focusing amounts calculated in step S104. . The CPU 7 holds the obtained average value in the storage unit 5 as a reference value for the focusing amount.

図4は、ブロック領域毎に(合焦量−基準値)の差分を行い、正となる値の分布を3次元的に示す。本第1の実施形態における合焦量を、2つのエッジ量の平均値の差分を同じブロック領域のσ=0.5で求めたエッジ量の平均値で割った値としたことにより、輝度差のあるサッカーゴール周辺だけでなく、ピントを合わせようとするコントラストの低いゴール足下の芝のところにも値が均等に分布している。それ以外のピントが合っていないボケている領域では、上述したように合焦量が基準値と比較して小さい値であるために図示されない。なお、図4の合焦量=基準値となる平面において、図3のオートフォーカス選択領域20に対応する領域を21として示す。   FIG. 4 shows the distribution of positive values three-dimensionally by performing a difference of (focus amount−reference value) for each block region. By using the focus amount in the first embodiment as a value obtained by dividing the difference between the average values of the two edge amounts by the average value of the edge amounts obtained with σ = 0.5 of the same block region, the luminance difference The values are evenly distributed not only in the vicinity of the soccer goal, but also on the grass under the low-contrast goal where you want to focus. In other areas where the focus is not in focus, as described above, the focus amount is smaller than the reference value, and thus is not shown. In the plane where the focus amount = reference value in FIG. 4, an area corresponding to the autofocus selection area 20 in FIG.

ステップS106では、CPU7が、オートフォーカス選択領域20内の各ブロック領域における(合焦量−基準値)の差分のうち、正値のみを積算した積算値を求める。   In step S <b> 106, the CPU 7 obtains an integrated value obtained by integrating only positive values among the differences of (focus amount−reference value) in each block area in the autofocus selection area 20.

ステップS107では、CPU7が、ステップS106で求めた積算値を合焦レベル判定の評価値として用い、前回求めた評価値との比較からピントが合っているか否かを判定する。なお、この際ステップS106で用いる基準値は、各画像に同一の値を用いても良い。ピントが合っている度合いが高いほど合焦量も大きくなることから、ステップS106で求める積算値が目的とする領域内で最大になるとき、即ち、今回の評価値と前回の評価値とが一致するとき、撮像レンズ1はピントの合う最適な位置にあることを意味する。CPU7は、今回の評価値と前回の評価値とが一致するならば、撮像レンズ1はピントの合う最適な位置あると判断する。CPU7は、ピントが合ったことをユーザに知らせるために、例えば、モニタ9に記号や文字等を用いて表示する。そして、CPU7は合焦測定を終了する。一方、一致しない場合、ステップS108(NO側)へ移行する。なお、本第1の実施形態では、測定開始直後の場合、前回の評価値はないことから、ステップS107はスキップされてステップS108へ直接移行する。   In step S107, the CPU 7 uses the integrated value obtained in step S106 as an evaluation value for in-focus level determination, and determines whether or not the focus is achieved from a comparison with the previously obtained evaluation value. In this case, the reference value used in step S106 may be the same value for each image. The higher the degree of focus, the greater the amount of focus. Therefore, when the integrated value obtained in step S106 is maximized in the target area, that is, the current evaluation value and the previous evaluation value match. When this is done, it means that the imaging lens 1 is in the optimum position for focusing. If the current evaluation value matches the previous evaluation value, the CPU 7 determines that the imaging lens 1 is at the optimum position for focusing. In order to notify the user that the focus has been achieved, the CPU 7 displays, for example, on the monitor 9 using symbols or characters. Then, the CPU 7 ends the focus measurement. On the other hand, if they do not match, the process proceeds to step S108 (NO side). In the first embodiment, immediately after the start of measurement, since there is no previous evaluation value, step S107 is skipped and the process proceeds directly to step S108.

ステップS108では、CPU7が、オートフォーカス選択領域20における評価値が最大になるように、レンズ駆動部6を通じて撮像レンズ1の位置を移動させる。具体的には、今回の評価値>前回の評価値の場合には、前回と同じ方向に撮像レンズ1を移動させ、今回の評価値<前回の評価値の場合には、前回とは逆の方向に撮像レンズ1を移動させる。レンズ駆動部6が撮像レンズ1を移動させる量は、例えば、今回の評価値と前回の評価値との差分に応じて決められる。そして、ステップS101へ移行して、次の画像を撮像して合焦測定を行う。今回の評価値=前回の評価値となるまで、ステップS101からステップS108の作業を行う。評価値が最大となったとき、CPU7は、撮像レンズ1はピントの合う最適な位置にあると判断し合焦測定を終了する。   In step S108, the CPU 7 moves the position of the imaging lens 1 through the lens driving unit 6 so that the evaluation value in the autofocus selection area 20 is maximized. Specifically, if the current evaluation value> the previous evaluation value, the imaging lens 1 is moved in the same direction as the previous time. If the current evaluation value <the previous evaluation value, the reverse of the previous value. The imaging lens 1 is moved in the direction. The amount by which the lens driving unit 6 moves the imaging lens 1 is determined, for example, according to the difference between the current evaluation value and the previous evaluation value. Then, the process proceeds to step S101, and the next image is captured and in-focus measurement is performed. Steps S101 to S108 are performed until the current evaluation value = the previous evaluation value. When the evaluation value becomes the maximum, the CPU 7 determines that the imaging lens 1 is in an optimum position in focus and ends the focus measurement.

このように本第1の実施形態は、画像に対して、周波数特性を示すパラメータσの異なる2つのボカシフィルタPを用いることで、2つのエッジ画像を生成してそれらの差分によって合焦量を算出することにより、大きな輝度差が存在する場合においても被写体の撮像に対して合焦レベルの正確な測定が可能となる。
≪第2の実施形態≫
図5は、本発明の第2の実施形態に係る合焦測定装置30の構成図である。第2の実施形態に係る合焦測定装置30は、CPU31、メモリ32、記憶装置33、画像入力部34および入出力インターフェース36から構成される。CPU31、メモリ32、記憶装置33、画像入力部34および入出力インターフェース36は、バス35を介して情報伝達可能に接続されている。さらに、入出力インターフェース36を介して、入力装置37と出力装置38とが接続されている。
As described above, in the first embodiment, by using two blur filters P having different parameters σ indicating frequency characteristics for an image, two edge images are generated, and the focusing amount is determined by the difference between them. By calculating, even when there is a large luminance difference, it is possible to accurately measure the in-focus level for imaging of the subject.
<< Second Embodiment >>
FIG. 5 is a configuration diagram of the focus measuring apparatus 30 according to the second embodiment of the present invention. The focus measurement device 30 according to the second embodiment includes a CPU 31, a memory 32, a storage device 33, an image input unit 34, and an input / output interface 36. The CPU 31, the memory 32, the storage device 33, the image input unit 34 and the input / output interface 36 are connected via a bus 35 so that information can be transmitted. Further, an input device 37 and an output device 38 are connected via the input / output interface 36.

CPU31は、ユーザによる入力装置37からの開始命令と初期設定を、入出力インターフェース36を経由して受け、メモリ32に保持されている合焦測定プログラムを実行する。CPU31は、記憶装置33または画像入力部34に格納されている画像データを適宜読み込み、合焦測定を行う。この合焦測定の結果は、記憶装置33に保存され、同時に入出力インターフェース36を介して出力装置38に表示される。CPU31には、一般的なコンピュータのCPUが使用できる。   The CPU 31 receives a start command and initial setting from the input device 37 by the user via the input / output interface 36 and executes a focus measurement program held in the memory 32. The CPU 31 appropriately reads image data stored in the storage device 33 or the image input unit 34 and performs in-focus measurement. The result of this focus measurement is stored in the storage device 33 and is simultaneously displayed on the output device 38 via the input / output interface 36. As the CPU 31, a CPU of a general computer can be used.

メモリ32は、合焦測定プログラムの保持、およびCPU31が行う合焦測定に伴う途中の処理結果や各構成要素からの各種データの一時記憶に用いられる。メモリ32には、一般的な半導体メモリを用いることができる。   The memory 32 is used for holding a focus measurement program and temporarily storing processing results during the focus measurement performed by the CPU 31 and various data from each component. As the memory 32, a general semiconductor memory can be used.

記憶装置33は、CPU31での処理の対象となる画像データを格納および保持する。画像データは、ビットマップ形式、jpeg形式、tiff形式等の様々な形式で保持される。記憶装置33に保持されたデータは、バス35を介して、CPU31から適宜参照することができる。記憶装置33には、一般的なハードディスク装置や光磁気ディスク装置、または脱着可能なメモリカード等の記憶装置を選択して用いることができる。   The storage device 33 stores and holds image data to be processed by the CPU 31. Image data is held in various formats such as a bitmap format, a jpeg format, and a tiff format. The data held in the storage device 33 can be referred to as appropriate from the CPU 31 via the bus 35. As the storage device 33, a general hard disk device, a magneto-optical disk device, or a storage device such as a removable memory card can be selected and used.

画像入力部34は、処理対象となる画像データの入力を行うときに使われる。画像入力部34には、USBケーブルやメモリカード等の差し込み口が設けられている。そして、USBケーブル等によって接続される機器(スキャナ、デジタルカメラやデジタルビデオ等)、または差し込み口に挿入されたメモリカード等から、合焦測定装置30への画像入力が行われる。画像入力部34から入力された画像データは、バス35を介して、大容量記憶装置33に転送及び保持されても良いし、CPU31によって直接読み出されても良い。   The image input unit 34 is used when inputting image data to be processed. The image input unit 34 is provided with an insertion port such as a USB cable or a memory card. Then, an image is input to the focus measurement device 30 from a device (a scanner, a digital camera, a digital video, or the like) connected by a USB cable or the like, or a memory card inserted in an insertion slot. The image data input from the image input unit 34 may be transferred and held in the mass storage device 33 via the bus 35 or may be directly read out by the CPU 31.

入出力インターフェース36は、入力装置37からの開始命令や初期設定をCPU31に伝え、逆にCPU31からの処理結果を出力装置38へ送るために用いられる。   The input / output interface 36 is used to transmit a start command and initial setting from the input device 37 to the CPU 31, and conversely, send processing results from the CPU 31 to the output device 38.

入力装置37は、ユーザによる画像処理プログラムの実行開始指示や初期設定操作等に用いられる。入力装置37には、一般的なキーボードやマウス等を用いることができる。   The input device 37 is used for an instruction to start execution of an image processing program by the user, an initial setting operation, and the like. As the input device 37, a general keyboard, mouse, or the like can be used.

出力装置38は、CPU31から送られてくる処理の途中経過やその結果を、ユーザが確認可能な情報として表示する。出力装置38には、モニタやプリンタ等を用いることができる。   The output device 38 displays the progress and the result of the process sent from the CPU 31 as information that can be confirmed by the user. As the output device 38, a monitor, a printer, or the like can be used.

以下に、本第2の実施形態に係る合焦測定装置30について、図6のフローチャートに沿って説明する。   Hereinafter, the focus measuring apparatus 30 according to the second embodiment will be described with reference to the flowchart of FIG.

具体的には、ユーザが、入力装置37を使用して、初期設定等とともに合焦測定プログラムのコマンドを入力し開始命令を出す。入出力インターフェース36を通じて、合焦測定装置30のCPU31がその命令を受け、メモリ32に格納されている合焦判定プログラムを実行する。その結果、図6のステップS201からステップS206の処理が行われる。なお、以下の説明では、合焦測定装置30の記憶装置33に、複数の画像のデータが、あらかじめ記憶されていることを前提とする。   Specifically, using the input device 37, the user inputs a command for the focus measurement program together with initial settings and issues a start command. The CPU 31 of the focus measurement device 30 receives the command through the input / output interface 36 and executes the focus determination program stored in the memory 32. As a result, the processing from step S201 to step S206 in FIG. 6 is performed. In the following description, it is assumed that a plurality of image data are stored in advance in the storage device 33 of the focus measurement device 30.

ステップS201では、CPU31が、1枚の画像を記憶装置33より読み込みメモリ32に保持する。   In step S <b> 201, the CPU 31 reads one image from the storage device 33 and holds it in the memory 32.

ステップS202では、CPU31が、画像から2つのエッジ量を抽出する。CPU31は、周波数特性を示すパラメータσの異なる2つのガウス型をしたボカシフィルタPを用いて、画像に対してそれぞれ平滑化処理を行いボケ画像を生成する。CPU31は、画像と各々のボケ画像との差分を取ることにより、エッジ量の分布を示す2つのエッジ画像を生成する。CPU31は、2つのエッジ画像をメモリ32に保持する。なお、本第1の実施形態と同様に、σ=0.5と0.6とする。   In step S202, the CPU 31 extracts two edge amounts from the image. The CPU 31 performs a smoothing process on each image using two Gaussian blur filters P having different parameters σ indicating frequency characteristics to generate a blurred image. CPU31 produces | generates two edge images which show distribution of edge amount by taking the difference of an image and each blur image. The CPU 31 holds two edge images in the memory 32. Note that, as in the first embodiment, σ = 0.5 and 0.6.

ステップS203では、CPU31が、ステップS202で求めたエッジ画像の各々について、例えば30画素×30画素の大きさのブロック領域に分割する。CPU31は、各エッジ画像のブロック領域毎に、そのブロック領域に含まれる画素全てのエッジ量を積算して全画素数で割ったエッジ量の平均値を算出する。   In step S203, the CPU 31 divides each edge image obtained in step S202 into block areas each having a size of 30 pixels × 30 pixels, for example. For each block region of each edge image, the CPU 31 calculates an average value of edge amounts obtained by adding up the edge amounts of all the pixels included in the block region and dividing the sum by the total number of pixels.

ステップS204では、CPU31が、ブロック領域毎に、ステップS203において求めた2つのエッジ量の平均値の差分を、同じブロック領域のσ=0.5で求めたエッジ量の平均値で割る。CPU31は、算出した値をブロック領域の各々における合焦量としてメモリ32に保持する。   In step S204, for each block region, the CPU 31 divides the difference between the average values of the two edge amounts obtained in step S203 by the average value of the edge amounts obtained with σ = 0.5 in the same block region. The CPU 31 holds the calculated value in the memory 32 as the focusing amount in each block area.

ステップS205では、CPU31が、ステップS204で求めた合焦量を用いて、画像全体における合焦量の平均値を求める。CPU31は、求めた平均値を合焦量の基準値としてメモリ32に保持する。   In step S205, the CPU 31 obtains an average value of the focus amount in the entire image using the focus amount obtained in step S204. The CPU 31 holds the obtained average value in the memory 32 as a focus amount reference value.

ステップS206では、CPU31が、画像を入出力インターフェース36を介して出力装置38に出力する。同時に、CPU31は、出力装置38に出力された画像の上に、ステップS205で求めた基準値よりも大きな値である合焦量の領域をピントが合っている領域として線等で図示して、合焦判定を終了する。図7は、ステップS201にて読み込んだ画像が図3のサッカーゴールである場合、図4の分布に基づいて基準値よりも大きい合焦量の領域を破線で示したものである。
≪第3の実施形態≫
図8は、本発明の第3の実施形態に係る合焦判定装置における処理のフローチャートである。
In step S <b> 206, the CPU 31 outputs the image to the output device 38 via the input / output interface 36. At the same time, the CPU 31 illustrates, on the image output to the output device 38, a focusing amount area that is a value larger than the reference value obtained in step S205 as a focused area by a line or the like. The focus determination ends. FIG. 7 shows, in a broken line, an area with a focusing amount larger than the reference value based on the distribution of FIG. 4 when the image read in step S201 is the soccer goal of FIG.
<< Third Embodiment >>
FIG. 8 is a flowchart of processing in the focus determination apparatus according to the third embodiment of the present invention.

本第3の実施形態に係る合焦測定装置は、基本的に図5の第2の実施形態に係る合焦測定装置30と同じであり、各構成要素の動作に関する説明は省略する。本第3の実施形態が第2の実施形態と異なる点は、連写等によって撮像された複数の画像のうち、基準となる1枚の画像の基準値に基づいて最も合焦レベルの高い画像を選択することにある。   The focus measurement apparatus according to the third embodiment is basically the same as the focus measurement apparatus 30 according to the second embodiment in FIG. 5, and description of the operation of each component is omitted. The third embodiment is different from the second embodiment in that an image with the highest focus level is based on the reference value of one reference image among a plurality of images taken by continuous shooting or the like. Is to choose.

具体的には、ユーザが、入力装置37を使用して、初期設定等とともに合焦測定プログラムのコマンドを入力し開始命令を出す。入出力インターフェース36を通じて、合焦測定装置30のCPU31がその命令を受け、メモリ32に格納されている合焦判定プログラムを実行する。その結果、図8のステップS301からステップS309の処理が行われる。なお、以下の説明では、合焦測定装置30の記憶装置33に、図3の被写体を連写によって撮像した複数の画像があらかじめ保存されているとする。   Specifically, using the input device 37, the user inputs a command for the focus measurement program together with initial settings and issues a start command. The CPU 31 of the focus measurement device 30 receives the command through the input / output interface 36 and executes the focus determination program stored in the memory 32. As a result, the processing from step S301 to step S309 in FIG. 8 is performed. In the following description, it is assumed that a plurality of images obtained by continuously shooting the subject in FIG. 3 are stored in the storage device 33 of the focus measurement device 30 in advance.

ステップS301では、CPU31が、1枚の画像を記憶装置33より読み込み、メモリ32に保持する。なお、本第3の実施形態では、1枚目の画像を基準画像とする。   In step S <b> 301, the CPU 31 reads one image from the storage device 33 and holds it in the memory 32. In the third embodiment, the first image is the reference image.

ステップS302では、CPU31が、画像から2つのエッジ量を抽出する。CPU31は、周波数特性を示すパラメータσの異なる2つのガウス型をしたボカシフィルタPを用いて、画像に対してそれぞれ平滑化処理を行いボケ画像を生成する。CPU31は、撮像した画像と各々のボケ画像との差分を取ることにより、エッジ量の分布を示す2つのエッジ画像を生成する。CPU31は、2つのエッジ画像をメモリ32に保持する。なお、本第2の実施形態と同様に、σ=0.5と0.6とする。   In step S302, the CPU 31 extracts two edge amounts from the image. The CPU 31 performs a smoothing process on each image using two Gaussian blur filters P having different parameters σ indicating frequency characteristics to generate a blurred image. The CPU 31 generates two edge images indicating the distribution of edge amounts by taking the difference between the captured image and each blurred image. The CPU 31 holds two edge images in the memory 32. Note that, as in the second embodiment, σ = 0.5 and 0.6.

ステップS303では、CPU31が、ステップS302で求めたエッジ画像の各々について、例えば30画素×30画素の大きさのブロック領域に分割する。CPU31は、各エッジ画像のブロック領域毎に、そのブロック領域に含まれる画素全てのエッジ量を積算して全画素数で割ってエッジ量の平均値を算出する。   In step S303, the CPU 31 divides each edge image obtained in step S302 into block areas having a size of 30 pixels × 30 pixels, for example. For each block area of each edge image, the CPU 31 calculates the average value of the edge amounts by adding up the edge amounts of all the pixels included in the block region and dividing the result by the total number of pixels.

ステップS304では、CPU31が、ブロック領域毎に、ステップS303において求めた2つのエッジ量の平均値の差分を、同じブロック領域のσ=0.5で求めたエッジ量の平均値で割る。CPU31は、算出した値をブロック領域の各々における合焦量としてメモリ32に保持する。   In step S304, for each block region, the CPU 31 divides the difference between the average values of the two edge amounts obtained in step S303 by the average value of the edge amounts obtained with σ = 0.5 for the same block region. The CPU 31 holds the calculated value in the memory 32 as the focusing amount in each block area.

ステップS305では、CPU31が、処理対象の画像が基準画像であるか否かを判定する。基準画像であれば、ステップS306(YES側)へ移行する。基準画像でなければ、ステップS307(NO側)へ移行する。   In step S305, the CPU 31 determines whether or not the processing target image is a reference image. If it is a reference image, the process proceeds to step S306 (YES side). If it is not a reference image, the process proceeds to step S307 (NO side).

ステップS306では、CPU31が、ステップS304で求めた基準画像の合焦量のうち、オートフォーカス選択領域20に含まれるブロック領域の合焦量を用いて、オートフォーカス選択領域20における合焦量の平均値を求める。CPU31は、求めた平均値を基準画像における合焦量の基準値としてメモリ32に保持する。   In step S306, the CPU 31 uses the focus amount of the block area included in the autofocus selection area 20 out of the focus amount of the reference image obtained in step S304, and averages the focus amount in the autofocus selection area 20. Find the value. The CPU 31 holds the obtained average value in the memory 32 as a reference value for the focusing amount in the reference image.

ステップS307では、CPU31が、オートフォーカス選択領域20内の各ブロック領域における(合焦量−基準値)の差分のうち、正値のみを積算した積算値を求める。CPU31は、その積算値をメモリ32に保持する。   In step S <b> 307, the CPU 31 obtains an integrated value obtained by integrating only positive values among the differences of (focus amount−reference value) in each block area in the autofocus selection area 20. The CPU 31 holds the integrated value in the memory 32.

ステップS308では、CPU31が、連写にて撮像した画像全てに対して処理が行われた場合には、ステップS309へ移行する。未処理の画像がまだ存在する場合には、ステップS301(YES側)へ移行する。CPU31は、ステップS307にて求めた基準画像の基準値を用いて、連写による全ての画像に対してステップS301からステップS308の処理を行い、各々の画像の積算値を求めメモリ32に保持する。   In step S308, if the CPU 31 has processed all the images captured by continuous shooting, the process proceeds to step S309. If an unprocessed image still exists, the process proceeds to step S301 (YES side). The CPU 31 performs the processing from step S301 to step S308 on all images obtained by continuous shooting using the reference value of the reference image obtained in step S307, obtains the integrated value of each image, and holds it in the memory 32. .

ステップS309では、CPU31が、メモリ32よりステップS307で求めた連写による画像全ての積算値を読み込む。CPU31は、最も大きな積算値を与える画像をピントが最も合っている画像として、入出力インターフェース36を介して出力装置38に出力し合焦測定を終了する。
≪実施形態に関する補足事項≫
本第1の実施形態ないし本第3の実施形態では、エッジ量を、画像と各々のボケ画像との差分から求めた値としたが、本発明はこれに限定されない。例えば、エッジ量を、画像と各々のボケ画像との差分の絶対値から求まる値とすることもできる。
In step S309, the CPU 31 reads from the memory 32 the integrated value of all images obtained by continuous shooting obtained in step S307. The CPU 31 outputs the image that gives the largest integrated value as the most focused image to the output device 38 via the input / output interface 36 and ends the focus measurement.
≪Supplementary items regarding the embodiment≫
In the first embodiment to the third embodiment, the edge amount is a value obtained from the difference between the image and each blurred image, but the present invention is not limited to this. For example, the edge amount can be a value obtained from the absolute value of the difference between the image and each blurred image.

本第1の実施形態ないし本第3の実施形態では、合焦量を、各ブロック領域における2つのエッジ量の平均値の差分を、同じブロック領域のσ=0.5で求めたエッジ量の平均値で割った値としたが、本発明はこれに限定されない。例えば、2つのエッジ量の平均値の差分を同じブロック領域のσ=0.6で求めたエッジ量の平均値やそれらを平均した値で割った値を合焦量としても良いし、単なる差分を合焦量としても良い。図9は、例えば、本第1の実施形態のステップS105において、図3の画像を基に2つのエッジ量の平均値の差分を合焦量とした場合であって、基準値との差分のうち正の値となる合焦量の分布を図4と同じように示したものである。なお、図9の合焦量=基準値となる平面において、図3のオートフォーカス選択領域20に対応する領域を22として示す。   In the first to third embodiments, the in-focus amount is the difference between the average values of the two edge amounts in each block region, and the edge amount obtained by σ = 0.5 in the same block region. Although the value is divided by the average value, the present invention is not limited to this. For example, the difference between the average values of the two edge amounts may be the average value of the edge amounts obtained by σ = 0.6 in the same block area, or a value obtained by dividing them by the average value. May be used as the focusing amount. FIG. 9 shows, for example, the case where the difference between the average value of the two edge amounts based on the image of FIG. 3 is used as the in-focus amount in step S105 of the first embodiment, and the difference between the difference from the reference value is shown in FIG. FIG. 4 shows the distribution of the focusing amount that is a positive value in the same manner as in FIG. Note that an area corresponding to the autofocus selection area 20 in FIG. 3 is indicated as 22 on the plane where the focusing amount = reference value in FIG.

なお、本第1の実施形態ないし本第3の実施形態では、各ブロック領域の大きさを30画素×30画素としたが、本発明はこれに限定されない。ブロック領域の大きさは、処理する画像の大きさ、処理速度、メモリ領域の大きさおよび合焦測定の精度等に応じて適宜選択することが好適である。   In the first to third embodiments, the size of each block area is 30 pixels × 30 pixels, but the present invention is not limited to this. The size of the block area is suitably selected according to the size of the image to be processed, the processing speed, the size of the memory area, the accuracy of focus measurement, and the like.

なお、本第1の実施形態ないし本第3の実施形態では、合焦量を求めるために、各ブロック領域において、エッジ画像それぞれから求まるエッジ量の平均値を用いたが、本発明はこれに限定されない。各ブロック領域において、エッジ画像それぞれから求まるエッジ量の分散値を用いても良い。   In the first to third embodiments, the average value of the edge amounts obtained from the respective edge images is used in each block region in order to obtain the focusing amount. It is not limited. In each block region, a dispersion value of the edge amount obtained from each edge image may be used.

なお、本第1の実施形態ないし本第3の実施形態では、合焦量の基準値は、読み込んだ画像または連写による複数の画像のうち基準画像と指定した画像から求めた値としたが、本発明はこれに限定されない。例えば、ユーザが直接入力する値を基準値として用いることができる。   In the first to third embodiments, the focus amount reference value is a value obtained from a read image or a designated image among a plurality of images obtained by continuous shooting. However, the present invention is not limited to this. For example, a value directly input by the user can be used as the reference value.

なお、本第1の実施形態ないし本第3の実施形態では、ボカシフィルタPのパラメータσを0.5と0.6としたが、本発明はこれに限定されない。合焦測定の精度等だけでなく、撮像素子のISO感度が高くなるにつれて、撮像素子の画素からのスパイク状のノイズが画像に乗ることから、ノイズの影響を低減するために、撮像素子のISO感度に応じてボカシフィルタPのパラメータσを適宜選択することが好適である。   In the first embodiment to the third embodiment, the parameter σ of the blur filter P is set to 0.5 and 0.6, but the present invention is not limited to this. In addition to the accuracy of focus measurement and the like, as the ISO sensitivity of the image sensor increases, spike-like noise from the pixels of the image sensor is added to the image. It is preferable to appropriately select the parameter σ of the blur filter P according to the sensitivity.

なお、本第1の実施形態または本第3の実施形態では、オートフォーカス選択領域20を、撮像する視野の中心付近の領域に設定したが、本発明はこれに限定されない。オートフォーカス選択領域20は、視野の中心から外れた領域に設定されても良い。あるいは、オートフォーカス選択領域20は、複数の領域として設定され、全ての領域を合焦測定に使用しても良いし、一部の領域を適宜選択して合焦測定に使用しても良い。   In the first embodiment or the third embodiment, the autofocus selection area 20 is set to an area near the center of the field of view to be imaged, but the present invention is not limited to this. The autofocus selection area 20 may be set in an area outside the center of the visual field. Alternatively, the autofocus selection area 20 may be set as a plurality of areas, and all the areas may be used for in-focus measurement, or some areas may be appropriately selected and used for in-focus measurement.

なお、本第1の実施形態または本第3の実施形態では、基準値をオートフォーカス選択領域20内にあるブロック領域の合焦量を用いて求めたが、本発明はこれに限定されない。画像の全てのブロック領域の合焦量を用いて、基準値を求めることができる。   In the first embodiment or the third embodiment, the reference value is obtained using the focus amount of the block area in the autofocus selection area 20, but the present invention is not limited to this. The reference value can be obtained by using the focus amounts of all the block areas of the image.

なお、本第2の実施形態では、基準値を全てのブロック領域の合焦量を用いて求めたが、本発明はこれに限定されない。例えば、オートフォーカス選択領域や任意の大きさの領域に含まれるブロック領域の合焦量を用いて、基準値を求めることができる。   In the second embodiment, the reference value is obtained using the focus amounts of all the block areas, but the present invention is not limited to this. For example, the reference value can be obtained by using the focusing amount of the block area included in the autofocus selection area or an arbitrary size area.

なお、本第3の実施形態では、1枚目の画像を基準画像としたが、本発明はこれに限定されない。基準画像は、連写した複数の画像の中から任意に決めることができる。   In the third embodiment, the first image is the reference image, but the present invention is not limited to this. The reference image can be arbitrarily determined from a plurality of continuously shot images.

なお、本発明に係る合焦測定方法における各工程を実現するためのプログラムを備え、画像の合焦レベルを測定する合焦測定装置としてコンピュータを機能させることに対しても適用可能である。   It should be noted that the present invention is also applicable to having a program for realizing each step in the focus measurement method according to the present invention and causing a computer to function as a focus measurement device that measures the focus level of an image.

なお、本発明に係る合焦測定方法における各工程を実現するためのコンピュータプログラムを記憶する記録媒体に対しても適用可能である。   Note that the present invention is also applicable to a recording medium that stores a computer program for realizing each step in the focus measurement method according to the present invention.

なお、本発明は、その精神またはその主要な特徴から逸脱することなく他の様々な形で実施することができる。そのため、上述した実施形態はあらゆる点で単なる例示にすぎず、限定的に解釈されてはならない。本発明は、特許請求の範囲によって示されるものであって、本発明は明細書本文には何ら拘束されない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内である。   It should be noted that the present invention can be implemented in various other forms without departing from the spirit or main features thereof. For this reason, the above-described embodiment is merely an example in all respects and should not be construed in a limited manner. The present invention is shown by the scope of the claims, and the present invention is not limited to the text of the specification. Further, all modifications and changes belonging to the equivalent scope of the claims are within the scope of the present invention.

以上説明したように、本発明は、正確な合焦レベルの算出・判定が要求される、電子カメラやビデオカメラ等の画像の画像処理装置等に応用可能な技術である。   As described above, the present invention is a technique that can be applied to an image processing apparatus for an image such as an electronic camera or a video camera, for which accurate calculation and determination of an in-focus level is required.

本第1の実施形態に係る電子カメラの構成を示す図The figure which shows the structure of the electronic camera which concerns on this 1st Embodiment. 本第1の実施形態に係る合焦測定の手順を示すフローチャートThe flowchart which shows the procedure of the focus measurement which concerns on this 1st Embodiment. 本第1の実施形態における撮像の視野にサッカーゴールと芝とが配置されていることを示す図The figure which shows that the soccer goal and turf are arrange | positioned in the imaging | photography visual field in the 1st Embodiment 図3を撮像した画像の各ブロック領域のうち合焦量の基準値に対する差分のうち正の値となる差分の分布を3次元的に示す図The figure which shows three-dimensionally the distribution of the difference which becomes a positive value among the difference with respect to the reference value of the amount of focus among each block area | region of the image which imaged FIG. 本第2の実施形態に係る合焦判定装置の構成を示す図The figure which shows the structure of the focus determination apparatus which concerns on the 2nd embodiment. 本第2の実施形態に係る合焦測定の手順を示すフローチャートThe flowchart which shows the procedure of the focus measurement which concerns on the 2nd embodiment. 図3の撮像した画像において基準値よりも大きな値の合焦量の領域を線で示す図The figure which shows the area | region of the focusing amount of a larger value than a reference value with a line in the imaged image of FIG. 本第3の実施形態に係る合焦測定の手順を示すフローチャートThe flowchart which shows the procedure of the focus measurement which concerns on the 3rd embodiment. 図3を撮像した画像の各ブロック領域のうち新たに定義した合焦量の基準値に対する差分のうち正の値となる差分の分布を3次元的に示す図The figure which shows three-dimensionally the distribution of the difference which becomes a positive value among the differences with respect to the reference value of the amount of focus newly defined among each block area | region of the image which imaged FIG.

符号の説明Explanation of symbols

1 撮像レンズ、2 撮像素子、3 A/D変換部、4 バッファメモリ、5 記憶部、6 レンズ駆動部、7 CPU、8 操作部材、9 モニタ、10 電子カメラ、11 バス
DESCRIPTION OF SYMBOLS 1 Imaging lens, 2 Imaging device, 3 A / D conversion part, 4 Buffer memory, 5 Storage part, 6 Lens drive part, 7 CPU, 8 Operation member, 9 Monitor, 10 Electronic camera, 11 Bus

Claims (10)

撮像した画像を取得する画像入力部と、
前記画像に対して周波数特性の異なる一対のフィルタをそれぞれ用いてボケ画像を生成するフィルタ部と、
前記画像の複数の箇所において、前記画像と各々の前記ボケ画像とから第1の特徴量と第2の特徴量とをそれぞれ抽出する抽出部と、
前記第1の特徴量と前記第2の特徴量とからピントの合っている度合いを示す合焦量を算出する演算部と、
算出された前記合焦量に基づいて前記画像の複数の箇所における合焦レベルを測定する測定部と、
を備えることを特徴とする合焦測定装置。
An image input unit for acquiring a captured image;
A filter unit that generates a blurred image using a pair of filters each having a different frequency characteristic with respect to the image;
An extraction unit that extracts a first feature amount and a second feature amount from the image and each of the blurred images at a plurality of locations of the image;
A calculation unit that calculates a focus amount indicating a degree of focus from the first feature amount and the second feature amount;
A measurement unit that measures a focus level at a plurality of locations of the image based on the calculated focus amount;
An in-focus measurement device comprising:
請求項1に記載の合焦測定装置において、
前記演算部は、
前記第1の特徴量と前記第2の特徴量との差分、または前記差分を前記第1の特徴量、前記第2の特徴量または前記第1の特徴量と前記第2の特徴量との平均値で割った値を前記合焦量とする
ことを特徴とする合焦測定装置。
The in-focus measurement device according to claim 1,
The computing unit is
The difference between the first feature value and the second feature value, or the difference between the first feature value, the second feature value, or the first feature value and the second feature value. A value obtained by dividing by an average value is used as the focusing amount.
請求項1または請求項2に記載の合焦測定装置において、
前記第1の特徴量および前記第2の特徴量は、前記画像と各々の前記ボケ画像との差分または前記差分の絶対値から求まるエッジ量であることを特徴とする合焦測定装置。
In the focus measuring apparatus according to claim 1 or 2,
The in-focus measuring apparatus, wherein the first feature amount and the second feature amount are edge amounts obtained from a difference between the image and each blurred image or an absolute value of the difference.
請求項1ないし請求項3のいずれかに記載の合焦測定装置において、
前記演算部は、
前記画像の複数の箇所のうち前記画像の所定の領域内にある前記箇所の各々にて算出された前記合焦量に基づいて、合焦レベルの基準値を算出する基準値演算部をさらに備え、
前記測定部は、
前記画像の複数の箇所における合焦レベルの測定を前記合焦量の前記基準値に対する値の大きさに基づいて行う基準値測定部をさらに備える
ことを特徴とする合焦測定装置。
In the focus measurement apparatus according to any one of claims 1 to 3,
The computing unit is
A reference value calculation unit that calculates a reference value of a focus level based on the focus amount calculated at each of the locations in the predetermined region of the image among the plurality of locations of the image. ,
The measuring unit is
A focus measurement apparatus, further comprising: a reference value measurement unit that measures a focus level at a plurality of locations of the image based on a value of the focus amount with respect to the reference value.
請求項4に記載の合焦測定装置において、
前記測定部は、
同一の撮像装置で撮像した他の画像の合焦レベルの測定に対しても前記基準値を用いるために保持する基準値記憶部をさらに備える
ことを特徴とする合焦測定装置。
The in-focus measurement device according to claim 4,
The measuring unit is
A focus measurement apparatus, further comprising a reference value storage unit that holds the focus level of another image captured by the same imaging apparatus in order to use the reference value.
請求項4に記載の合焦測定装置において、
前記所定の領域は画像全領域であることを特徴とする合焦測定装置。
The in-focus measurement device according to claim 4,
The in-focus measuring apparatus, wherein the predetermined area is the entire area of the image.
請求項4に記載の合焦測定装置において、
前記所定の領域は撮影時のオートフォーカス選択領域であることを特徴とする合焦測定装置。
The in-focus measurement device according to claim 4,
The in-focus measuring apparatus, wherein the predetermined area is an autofocus selection area during photographing.
請求項1ないし請求項7のいずれかに記載の合焦測定装置において、
前記フィルタ部は、
前記フィルタの前記周波数特性を撮像素子のISO感度に応じて変える周波数特性調節部をさらに備える
ことを特徴とする合焦測定装置。
In the focus measurement apparatus according to any one of claims 1 to 7,
The filter unit is
A focus measurement apparatus, further comprising: a frequency characteristic adjustment unit that changes the frequency characteristic of the filter according to an ISO sensitivity of the image sensor.
撮像した画像に対して周波数特性の異なる一対のフィルタをそれぞれ用いてボケ画像を生成する工程と、
前記画像の複数の箇所において、前記画像と各々の前記ボケ画像とから第1の特徴量と第2の特徴量とをそれぞれ抽出する工程と、
前記第1の特徴量と前記第2の特徴量とからピントの合っている度合いを示す合焦量を算出する工程と、
算出された前記合焦量に基づいて前記画像の複数の箇所における合焦レベルを測定する工程と、
を備えることを特徴とする合焦測定方法。
Generating a blurred image using a pair of filters each having a different frequency characteristic with respect to the captured image;
Extracting a first feature amount and a second feature amount from the image and each of the blurred images at a plurality of locations of the image, respectively;
Calculating an in-focus amount indicating a degree of focus from the first feature amount and the second feature amount;
Measuring focus levels at a plurality of locations of the image based on the calculated focus amount;
A focus measurement method comprising:
請求項1ないし請求項8のいずれかに記載の合焦測定装置として、コンピュータを機能させるためのプログラム。
A program for causing a computer to function as the focus measurement device according to any one of claims 1 to 8.
JP2007270197A 2007-10-17 2007-10-17 Focus measurement device, focus measurement method and program Active JP5115138B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2007270197A JP5115138B2 (en) 2007-10-17 2007-10-17 Focus measurement device, focus measurement method and program
PCT/JP2008/002298 WO2009050841A1 (en) 2007-10-17 2008-08-25 Focusing measurement device, focusing measurement method, and program
US12/669,934 US8558942B2 (en) 2007-10-17 2008-08-25 Focusing measurement device, focusing measurement method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007270197A JP5115138B2 (en) 2007-10-17 2007-10-17 Focus measurement device, focus measurement method and program

Publications (2)

Publication Number Publication Date
JP2009098436A true JP2009098436A (en) 2009-05-07
JP5115138B2 JP5115138B2 (en) 2013-01-09

Family

ID=40701493

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007270197A Active JP5115138B2 (en) 2007-10-17 2007-10-17 Focus measurement device, focus measurement method and program

Country Status (1)

Country Link
JP (1) JP5115138B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8311362B2 (en) 2008-06-13 2012-11-13 Fujifilm Corporation Image processing apparatus, imaging apparatus, image processing method and recording medium
CN110335302A (en) * 2015-12-23 2019-10-15 意法半导体(R&D)有限公司 The depth map generated from single sensor

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7229651B2 (en) 2016-03-04 2023-02-28 住友金属鉱山株式会社 Liquid handling method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05207352A (en) * 1992-01-24 1993-08-13 Olympus Optical Co Ltd Focusing detector
JP2001331806A (en) * 2000-05-22 2001-11-30 Nec Corp Image processing system
JP2001352440A (en) * 2000-06-07 2001-12-21 Olympus Optical Co Ltd Image processing unit
JP2006135523A (en) * 2004-11-04 2006-05-25 Toshiba Corp Device, method, and program for judging image condition
JP2007128009A (en) * 2005-11-07 2007-05-24 Research Organization Of Information & Systems Imaging device and imaging method using out-of-focus structure
JP2008039611A (en) * 2006-08-07 2008-02-21 Canon Inc Device and method for measuring position and attitude, compound real feeling presentation system, computer program and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05207352A (en) * 1992-01-24 1993-08-13 Olympus Optical Co Ltd Focusing detector
JP2001331806A (en) * 2000-05-22 2001-11-30 Nec Corp Image processing system
JP2001352440A (en) * 2000-06-07 2001-12-21 Olympus Optical Co Ltd Image processing unit
JP2006135523A (en) * 2004-11-04 2006-05-25 Toshiba Corp Device, method, and program for judging image condition
JP2007128009A (en) * 2005-11-07 2007-05-24 Research Organization Of Information & Systems Imaging device and imaging method using out-of-focus structure
JP2008039611A (en) * 2006-08-07 2008-02-21 Canon Inc Device and method for measuring position and attitude, compound real feeling presentation system, computer program and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8311362B2 (en) 2008-06-13 2012-11-13 Fujifilm Corporation Image processing apparatus, imaging apparatus, image processing method and recording medium
CN110335302A (en) * 2015-12-23 2019-10-15 意法半导体(R&D)有限公司 The depth map generated from single sensor

Also Published As

Publication number Publication date
JP5115138B2 (en) 2013-01-09

Similar Documents

Publication Publication Date Title
JP5657343B2 (en) Electronics
US8558942B2 (en) Focusing measurement device, focusing measurement method, and program
JP6347675B2 (en) Image processing apparatus, imaging apparatus, image processing method, imaging method, and program
JP5484631B2 (en) Imaging apparatus, imaging method, program, and program storage medium
JP5246078B2 (en) Object location program and camera
JP2004343519A (en) Imaging apparatus and image processing apparatus
JP2010161744A (en) Image processing apparatus and image processing method
CN103888667B (en) Image capturing apparatus and control method thereof
JP5800187B2 (en) Imaging apparatus and distance information acquisition method
JP2007096437A (en) Determination of image creator&#39;s intention
JP5115138B2 (en) Focus measurement device, focus measurement method and program
JP5003406B2 (en) Focus measurement device, focus measurement method and program
JP2010154306A (en) Device, program and method for imaging control
JP5720488B2 (en) Imaging apparatus and distance information acquisition method
JP2010026734A (en) Image processor and its method
JP5369729B2 (en) Image processing apparatus, imaging apparatus, and program
KR100881958B1 (en) Calculating method of actual size of object and system thereof
JP2007258923A (en) Image processing apparatus, image processing method, image processing program
JP2012142729A (en) Camera
JP4271648B2 (en) Image composition apparatus, imaging means, and program
JP2011154194A (en) Imaging apparatus
JP5115297B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP6762779B2 (en) Image processing equipment, imaging equipment, image processing methods, and programs
JP2015156189A (en) image evaluation device, and image evaluation program
WO2018061430A1 (en) Measurement apparatus, measurement method, measurement program, and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101007

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120424

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120625

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121001

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5115138

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20151026

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20151026

Year of fee payment: 3

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250