JP2010016743A - Distance measuring apparatus, distance measuring method, distance measuring program, or imaging device - Google Patents

Distance measuring apparatus, distance measuring method, distance measuring program, or imaging device Download PDF

Info

Publication number
JP2010016743A
JP2010016743A JP2008176751A JP2008176751A JP2010016743A JP 2010016743 A JP2010016743 A JP 2010016743A JP 2008176751 A JP2008176751 A JP 2008176751A JP 2008176751 A JP2008176751 A JP 2008176751A JP 2010016743 A JP2010016743 A JP 2010016743A
Authority
JP
Japan
Prior art keywords
pixel
correlation amount
blur
area
processing target
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
JP2008176751A
Other languages
Japanese (ja)
Other versions
JP4990234B2 (en
Inventor
Shoichi Yanai
章一 谷内
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.)
Olympus Corp
Original Assignee
Olympus 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 Olympus Corp filed Critical Olympus Corp
Priority to JP2008176751A priority Critical patent/JP4990234B2/en
Publication of JP2010016743A publication Critical patent/JP2010016743A/en
Application granted granted Critical
Publication of JP4990234B2 publication Critical patent/JP4990234B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)
  • Measurement Of Optical Distance (AREA)
  • Focusing (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To perform a distance measurement with high precision rate even when an object distance is spatially varied. <P>SOLUTION: In a distance measuring apparatus having a blurring correlation amount operating unit (103) for operating correlation amount of blurring in each of process target areas (k1, k2) including distance measuring target pixel among a plurality of images in which blurring imaged by different imaging parameters is different, and an object distance-deciding unit (109) for calculating an object distance in every process target area from correlation amount of blurring operated in every process target area, the blurring correlation amount operating unit (103) comprises a pixel correlation amount operating unit (106) for operating the correlation amount of blurring of a pixel unit in every pixel within the process target area, a weighting control unit (107) for setting a weight coefficient of the correlation amount of blurring of the pixel unit in every pixel within the process target area, and a weighting average-operating unit (108) for operating a value of the weighting average as the correlation amount of blurring of the process target area by performing weighting average of the correlation amount of blurring of the pixel unit based on the weight coefficient. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、画像情報を用いて被写体の距離の測定を行う技術に関する。   The present invention relates to a technique for measuring the distance of a subject using image information.

従来、デジタルカメラなどの撮像装置において撮影するシーンの距離情報を安価に取得できるシステムとして、Depth from Defocus(DFD)方式が提案されている。DFD方式では、撮影レンズ等の撮影パラメータの制御によりぼけの異なる複数の画像が、CCD(電荷結合素子)やCMOS(相補型金属酸化膜半導体)などの撮像素子で捉えられる。さらに、各画像間のぼけの相関量が所定の対象画素毎に算出される。このぼけの相関量と被写体距離の関係を定める参照テーブルを参照することで、そのぼけの相関量に対応する被写体距離を求めて、対象画素に関して測距を行う(非特許文献1参照)。   2. Description of the Related Art Conventionally, a depth from defocus (DFD) method has been proposed as a system that can obtain distance information of a scene to be captured at an imaging apparatus such as a digital camera at a low cost. In the DFD method, a plurality of images with different blurs are captured by an imaging device such as a CCD (charge coupled device) or a CMOS (complementary metal oxide semiconductor) by controlling imaging parameters such as a photographing lens. Further, a blur correlation amount between the images is calculated for each predetermined target pixel. By referring to a reference table that defines the relationship between the blur correlation amount and the subject distance, the subject distance corresponding to the blur correlation amount is obtained, and distance measurement is performed on the target pixel (see Non-Patent Document 1).

ここで、ぼけの相関量とは、各画像間のぼけの相関の程度を示すものであり、各画像における光学系の点像分布関数(PSF)の分散と相関のある値である。例えば、ぼけの相関量は、各画像の点像分布関数(PSF)の分散の差分で表される。また、PSFとは、理想的な点像が光学系を通過した場合の光線の広がり(即ち、ぼけ方)を表す関数である。   Here, the blur correlation amount indicates the degree of blur correlation between the images, and is a value correlated with the dispersion of the point spread function (PSF) of the optical system in each image. For example, the blur correlation amount is represented by a difference in dispersion of the point spread function (PSF) of each image. PSF is a function representing the spread (that is, how to blur) a light ray when an ideal point image passes through the optical system.

DFD方式では、理論上は一画素単位での測距が可能である。測距精度を安定化させるために、測距対象画素の近傍の画素領域(DFDカーネルとも呼ぶ)のぼけの相関量も考慮して、測距対象画素についての被写体距離を算出する必要があった。
M. Subbarao and G. Surya, "Depth from Defocus: A Spatial Domain Approach," International Journal of Computer Vision, Vol. 13, No. 3, pp. 271-294, 1994
In the DFD method, it is theoretically possible to perform distance measurement in units of one pixel. In order to stabilize the distance measurement accuracy, it is necessary to calculate the subject distance for the distance measurement target pixel in consideration of the blur correlation amount of the pixel area (also referred to as the DFD kernel) in the vicinity of the distance measurement target pixel. .
M. Subbarao and G. Surya, "Depth from Defocus: A Spatial Domain Approach," International Journal of Computer Vision, Vol. 13, No. 3, pp. 271-294, 1994

しかし、DFDカーネル内で被写体距離が空間変動する場合、遠距離の画素と近距離の画素の両方が考慮されるため、測距対象画素の位置に結像する物体に対して測距精度の信頼性が低下する可能性がある。具体的には遠方の物体と近点の物体の境界がDFDカーネル内に存在する場合には、測距精度が低い可能性がある。   However, when the subject distance varies spatially in the DFD kernel, both the long-distance pixels and the short-distance pixels are taken into account. May be reduced. Specifically, when the boundary between a distant object and a near object exists in the DFD kernel, the ranging accuracy may be low.

本発明は、被写体距離が空間変動する場合でも、高い精度で測距を行うことを目的とする。   An object of the present invention is to perform distance measurement with high accuracy even when the subject distance fluctuates in space.

本発明のある態様に係る測距装置は、異なる撮影パラメータで撮影したぼけの異なる複数の画像間において、測距の対象となる測距対象画素を含有する処理対象領域毎に、ぼけの相関量を演算するぼけ相関量演算部と、前記処理対象領域毎に演算したぼけの相関量から、前記処理対象領域毎に被写体距離を算出する被写体距離決定部と、を有する測距装置であって、前記ぼけ相関量演算部は、前記処理対象領域内の画素毎に、画素単位のぼけの相関量を演算する画素相関量演算部と、前記処理対象領域内の画素毎に、前記画素単位のぼけの相関量の重み係数を設定する加重制御部と、前記重み係数に基づいて、前記画素単位のぼけの相関量の加重平均を行い、前記加重平均の値を前記処理対象領域のぼけ相関量として演算する加重平均演算部と、を備えることを特徴とする。   A distance measuring apparatus according to an aspect of the present invention provides a blur correlation amount for each processing target region including a distance measurement target pixel that is a target of distance measurement between a plurality of images with different blurs captured with different shooting parameters. A blur correlation amount calculation unit that calculates a subject distance determination unit that calculates a subject distance for each processing target region from a blur correlation amount calculated for each processing target region, The blur correlation amount calculation unit includes a pixel correlation amount calculation unit that calculates a correlation amount of blur in units of pixels for each pixel in the processing target region, and a blur in units of pixels for each pixel in the processing target region. A weight control unit that sets a weighting coefficient of the correlation amount, and performs a weighted average of the blur correlation amount of the pixel unit based on the weighting factor, and uses the value of the weighted average as a blur correlation amount of the processing target region Weighted average calculation unit to calculate , Characterized in that it comprises a.

本発明の別の態様に係る測距方法は、異なる撮影パラメータで撮影したぼけの異なる複数の画像間において、測距の対象となる測距対象画素を含有する処理対象領域毎に、ぼけの相関量を演算するぼけ相関量演算ステップと、前記処理対象領域毎に演算したぼけの相関量から、前記処理対象領域毎に被写体距離を算出する被写体距離決定ステップと、を有する測距方法であって、前記ぼけ相関量演算ステップは、前記処理対象領域内の画素毎に、画素単位のぼけの相関量を演算する画素相関量演算ステップと、前記処理対象領域内の画素毎に、前記画素単位のぼけの相関量の重み係数を設定する加重制御ステップと、前記重み係数に基づいて、前記画素単位のぼけの相関量の加重平均を行い、前記加重平均の値を前記処理対象領域のぼけ相関量として演算する加重平均演算ステップと、を備えることを特徴とする。   A distance measuring method according to another aspect of the present invention provides a correlation of blur for each processing target area including a distance measuring target pixel to be a distance measuring target between a plurality of images having different blurs shot with different shooting parameters. A blur correlation amount calculating step for calculating an amount; and a subject distance determining step for calculating a subject distance for each processing target region from a blur correlation amount calculated for each processing target region. The blur correlation amount calculating step includes: a pixel correlation amount calculating step for calculating a blur correlation amount for each pixel in the processing target region; and a pixel unit for each pixel in the processing target region. A weighting control step for setting a weighting coefficient for a blur correlation amount, and performing a weighted average of the blur correlation amount for each pixel based on the weighting factor, and calculating the weighted average value as a blur correlation of the processing target region Characterized in that it and a weighted average calculation step of calculating a.

本発明のさらに別の態様に係る測距プログラムは、異なる撮影パラメータで撮影したぼけの異なる複数の画像間において、測距の対象となる測距対象画素を含有する処理対象領域毎に、ぼけの相関量を演算するぼけ相関量演算手順と、前記処理対象領域毎に演算したぼけの相関量から、前記処理対象領域毎に被写体距離を算出する被写体距離決定手順と、を有する測距プログラムであって、前記ぼけ相関量演算手順は、前記処理対象領域内の画素毎に、画素単位のぼけの相関量を演算する画素相関量演算手順と、前記処理対象領域内の画素毎に、前記画素単位のぼけの相関量の重み係数を設定する加重制御手順と、前記重み係数に基づいて、前記画素単位のぼけの相関量の加重平均を行い、前記加重平均の値を前記処理対象領域のぼけ相関量として演算する加重平均演算手順と、を備えることを特徴とする。   A distance measuring program according to still another aspect of the present invention provides a blur detection method for each processing target area including a distance measurement target pixel to be a distance measurement object between a plurality of images having different blurs shot with different shooting parameters. A distance measurement program comprising: a blur correlation amount calculation procedure for calculating a correlation amount; and a subject distance determination procedure for calculating a subject distance for each processing target region from the blur correlation amount calculated for each processing target region. The blur correlation amount calculation procedure includes a pixel correlation amount calculation procedure for calculating a blur correlation amount in pixel units for each pixel in the processing target region, and a pixel unit for each pixel in the processing target region. A weighting control procedure for setting a weighting coefficient of a blur correlation amount, and performing a weighted average of the blur correlation amount in pixel units based on the weighting factor, and calculating the weighted average value as a blur correlation of the processing target region amount Characterized in that it comprises a weighted average calculation procedure for calculating by.

これら態様によれば、処理対象領域内の各画素での画素単位のぼけの相関量が算出される。さらに、画素単位のぼけの相関量の加重平均の値を処理対象領域のぼけ相関量として算出して、この加重平均の値から処理対象領域毎に被写体距離が算出できる。これにより、処理対象領域内の被写体距離の変動が存在しても、算出される被写体距離は処理対象領域内で加重平均を取ったものに相当する。従って、処理対象領域を設定することにより測距精度の安定性を保ちつつ、さらに処理対象領域内の被写体距離の変動の測距精度に対する影響が小さくなる。   According to these aspects, the blur correlation amount in pixel units at each pixel in the processing target area is calculated. Further, the weighted average value of the blur correlation amount in pixel units is calculated as the blur correlation amount of the processing target region, and the subject distance can be calculated for each processing target region from the weighted average value. Thus, even if there is a variation in subject distance within the processing target area, the calculated subject distance corresponds to a weighted average obtained within the processing target area. Therefore, setting the processing target area maintains the stability of the ranging accuracy, and further reduces the influence of the change in the subject distance in the processing target area on the ranging accuracy.

本発明によれば、測距精度の安定性を保ちつつ、処理対象領域内の被写体距離の変動が、測距対象画素の測距精度に及ぼす影響を低減させることが可能となる。   According to the present invention, it is possible to reduce the influence of the change in the subject distance in the processing target region on the distance measurement accuracy of the distance measurement target pixel while maintaining the stability of the distance measurement accuracy.

[第一実施形態]
図1を参照して、第一実施形態に係る測距装置について説明する。なお、測距装置は、デジタルカメラやデジタルビデオカメラ等の撮像装置(撮像用電子機器)に搭載されるものとして第一実施形態を説明する。しかし、本発明はこれに限定されることなく適用可能である。
[First embodiment]
A distance measuring apparatus according to the first embodiment will be described with reference to FIG. The first embodiment will be described assuming that the distance measuring device is mounted on an imaging device (imaging electronic device) such as a digital camera or a digital video camera. However, the present invention is applicable without being limited to this.

図1は、第一実施形態に係る測距装置を搭載する撮像装置を示す。撮像装置は、光学系10、光学系制御部20、撮像素子101、輝度信号制御部102、ぼけ相関量演算部103、被写体距離決定部109、LUT記憶部110、メモリ111、から構成される。輝度信号制御部102、ぼけ相関量演算部103、被写体距離決定部109(又はこれら全体)を、論理回路から構成してよいし、CPU(中央演算処理装置)と演算プログラムを格納するメモリ等から構成してもよい。測距装置は、ぼけ相関量演算部103、被写体距離決定部109、LUT記憶部110等から構成される。   FIG. 1 shows an imaging device equipped with a distance measuring device according to the first embodiment. The imaging apparatus includes an optical system 10, an optical system control unit 20, an image sensor 101, a luminance signal control unit 102, a blur correlation amount calculation unit 103, a subject distance determination unit 109, an LUT storage unit 110, and a memory 111. The luminance signal control unit 102, the blur correlation amount calculation unit 103, and the subject distance determination unit 109 (or all of them) may be configured by a logic circuit, or from a CPU (Central Processing Unit) and a memory that stores a calculation program. It may be configured. The distance measuring device includes a blur correlation amount calculation unit 103, a subject distance determination unit 109, an LUT storage unit 110, and the like.

ぼけ相関量演算部103は、バッファ104、カーネル位置制御部105、画素単位ぼけ相関量演算部106、加重制御部107、加重平均ぼけ相関量演算部108で構成される。以後、「カーネル位置制御部」をカーネル制御部と、「被写体距離決定部」を距離決定部と、「画素単位ぼけ相関量演算部」を画素相関量演算部と、「加重平均ぼけ相関量演算部」を加重平均演算部と呼ぶ。   The blur correlation amount calculation unit 103 includes a buffer 104, a kernel position control unit 105, a pixel unit blur correlation amount calculation unit 106, a weight control unit 107, and a weighted average blur correlation amount calculation unit 108. Thereafter, the “kernel position control unit” is the kernel control unit, the “subject distance determination unit” is the distance determination unit, the “pixel unit blur correlation amount calculation unit” is the pixel correlation amount calculation unit, and the “weighted average blur correlation amount calculation”. Part "is called a weighted average calculation part.

光学系10は、複数のレンズ群301及び絞り303等から構成され、外部から取り込んだ光を結像する撮影レンズとして機能する。なお、図1において、光学系10は、単焦点レンズとして示されているが、光学系10の構成は、図1に示したものに限られるものではない。例えば、光学系10は、ズームレンズを構成するものであってよい。又、例えば、レンズ群301の数は何枚でもよいし、絞り303の位置も適宜変更可能である。光学系10の焦点位置は、光学系制御部20によって可変である。   The optical system 10 includes a plurality of lens groups 301, a diaphragm 303, and the like, and functions as a photographing lens that forms an image of light taken from outside. In FIG. 1, the optical system 10 is shown as a single focus lens, but the configuration of the optical system 10 is not limited to that shown in FIG. 1. For example, the optical system 10 may constitute a zoom lens. For example, the number of lens groups 301 may be any number, and the position of the diaphragm 303 can be changed as appropriate. The focal position of the optical system 10 is variable by the optical system control unit 20.

光学系制御部20は、撮影パラメータ(カメラパラメータ)を変更する撮影パラメータ制御部として機能する。撮影パラメータには、光学系10の焦点位置(又はフォーカスレンズの位置)、絞り303の開口径、光学系10の焦点距離等が含まれる。なお、以後、本実施形態では、撮影パラメータが、光学系10の焦点位置である場合について説明される。   The optical system control unit 20 functions as a shooting parameter control unit that changes shooting parameters (camera parameters). The shooting parameters include the focal position of the optical system 10 (or the position of the focus lens), the aperture diameter of the diaphragm 303, the focal length of the optical system 10, and the like. Hereinafter, in the present embodiment, a case where the imaging parameter is the focal position of the optical system 10 will be described.

光学系制御部20は、光学系10の焦点位置を変更するために一つ以上のレンズ群301を移動させるレンズ駆動機構を含む。なお、レンズ群は、単一のレンズから構成されてもよい。以後、光学系10の焦点位置の変更のために移動する一つ以上のレンズ群301をフォーカスレンズと呼ぶ。レンズ駆動機構は、電気モータや超音波モータ等のモータ(又はアクチュエータ)を有する。レンズ駆動機構は、全群移動方式により全てのレンズ群301を一括して動かしてよい。或いは、レンズ駆動機構は、フロントフォーカシングやバックフォーカシング方式等により、一つのレンズ群を移動させてもよい。また、光学系制御部20は、絞り303の開口径を調整するための絞り制御機構を含む。絞り制御機構は、電気モータ等のモータ(又はアクチュエータ)などからなる。   The optical system control unit 20 includes a lens driving mechanism that moves one or more lens groups 301 to change the focal position of the optical system 10. The lens group may be composed of a single lens. Hereinafter, one or more lens groups 301 that move to change the focal position of the optical system 10 are referred to as focus lenses. The lens driving mechanism includes a motor (or actuator) such as an electric motor or an ultrasonic motor. The lens driving mechanism may move all the lens groups 301 at once by the all-group movement method. Alternatively, the lens driving mechanism may move one lens group by a front focusing method, a back focusing method, or the like. The optical system control unit 20 includes a diaphragm control mechanism for adjusting the aperture diameter of the diaphragm 303. The aperture control mechanism includes a motor (or actuator) such as an electric motor.

フォーカスレンズの位置(以後、フォーカスレンズ位置と呼ぶ)は、レンズ位置検出部401により検出される。検出されたフォーカスレンズ位置は、必要に応じて、光学系制御部20、ぼけ相関量演算部103、距離決定部109等で利用できるようにしてよい。レンズ位置検出部401は、焦点位置の変更のために移動するレンズ群の移動量を検出するセンサを有する。絞り303の開口径は、開口径検出部403により検出される。検出された開口径は、必要に応じて、光学系制御部20、ぼけ相関量演算部103、距離決定部109等で利用できるようにしてよい。開口径検出部403は、絞り制御機構のモータの動作量(回転量等)を開口径の指標として検出するものでよい。   The position of the focus lens (hereinafter referred to as the focus lens position) is detected by the lens position detection unit 401. The detected focus lens position may be used by the optical system control unit 20, the blur correlation amount calculation unit 103, the distance determination unit 109, and the like as necessary. The lens position detection unit 401 includes a sensor that detects the amount of movement of the lens group that moves to change the focal position. The aperture diameter of the diaphragm 303 is detected by the aperture diameter detector 403. The detected aperture diameter may be used by the optical system control unit 20, the blur correlation amount calculation unit 103, the distance determination unit 109, and the like as necessary. The aperture diameter detection unit 403 may detect an operation amount (rotation amount or the like) of the motor of the aperture control mechanism as an index of the aperture diameter.

光学系10を通過し結像する光束は、撮像素子101上で電気信号に変換される。撮像素子101は、CCD(電荷結合素子)又はCMOS(相補型金属酸化膜半導体)から構成される。この電気信号は、撮像素子101から画像データとして送出される。   A light beam that passes through the optical system 10 and forms an image is converted into an electrical signal on the image sensor 101. The image sensor 101 is composed of a CCD (charge coupled device) or a CMOS (complementary metal oxide semiconductor). This electric signal is sent out as image data from the image sensor 101.

輝度信号制御部102は、撮像素子101で撮影した画像データをデジタル信号に変換する。このデジタル信号を輝度信号と呼ぶ。輝度信号制御部102は、輝度信号に変換した画像データに対して像倍率補正処理や輝度分布の正規化処理などの処理を施す。像倍率補正処理は、異なる画像間の異なる倍率を補正する処理である。   The luminance signal control unit 102 converts image data captured by the image sensor 101 into a digital signal. This digital signal is called a luminance signal. The luminance signal control unit 102 performs processing such as image magnification correction processing and luminance distribution normalization processing on the image data converted into the luminance signal. The image magnification correction process is a process for correcting different magnifications between different images.

バッファ104は、輝度信号制御部102で輝度信号に変換された画像データを保持する。ここで、バッファ104は、少なくとも2枚以上の画像データを保持するメモリ空間を有するメモリである。バッファ104は、同一被写体に対して同一位置から撮影した2枚の画像データから変換された輝度信号を保持する。2枚の画像データは、異なる撮影パラメータで撮影、取得されたもので、ぼけ方が異なる。本実施形態では、撮影パラメータは光学系10の焦点位置であり、フォーカスレンズ位置を変えることにより焦点位置が互いに異なる2枚の画像データが撮影される。このため、光学系制御部20が、フォーカスレンズ(少なくとも一つのレンズ群)を移動させ、光学系10の焦点位置を変化させる。   The buffer 104 holds the image data converted into the luminance signal by the luminance signal control unit 102. Here, the buffer 104 is a memory having a memory space for holding at least two pieces of image data. The buffer 104 holds a luminance signal converted from two pieces of image data taken from the same position with respect to the same subject. The two pieces of image data are taken and acquired with different shooting parameters and have different blurring methods. In the present embodiment, the shooting parameter is the focal position of the optical system 10, and two pieces of image data having different focal positions are photographed by changing the focus lens position. Therefore, the optical system control unit 20 moves the focus lens (at least one lens group) and changes the focal position of the optical system 10.

カーネル制御部105は、バッファ104に保持された複数の画像において、測距対象となる測距対象画素の位置とその近傍領域を為す画素群をDFDカーネルとして設定する。このDFDカーネルが測距装置の測距処理の対象となり、DFDカーネルを処理対象領域と呼ぶことがある。DFDカーネルは、所定画素数を含有し、画像中の所定位置に設定される。所定位置は、例えば画像の中心付近であるが、特に限定されるものではない。DFDカーネルは、複数設定されてもよい。DFDカーネルの形状も特に制限されるものではないが、本実施形態では、測距対象画素を中心画素(又は中心付近画素)とした矩形領域で設定する。また、DFDカーネルの所定画素数が100個(10×10個)である場合を説明するが、所定画素数はこれに限定されるものではない。測距対象画素は、DFDカーネル内のどの位置に設定してもよいが、本実施形態ではDFDカーネルの中心位置(又は中心付近)に測距対象画素を配置する。   The kernel control unit 105 sets, as a DFD kernel, a pixel group that forms a distance measurement target pixel position to be a distance measurement target and a neighboring area in the plurality of images held in the buffer 104. This DFD kernel is a target of distance measurement processing by the distance measuring apparatus, and the DFD kernel may be referred to as a processing target area. The DFD kernel contains a predetermined number of pixels and is set at a predetermined position in the image. The predetermined position is, for example, near the center of the image, but is not particularly limited. A plurality of DFD kernels may be set. Although the shape of the DFD kernel is not particularly limited, in the present embodiment, the DFD kernel is set in a rectangular area having the distance measurement target pixel as a central pixel (or a pixel near the center). Although the case where the predetermined number of pixels of the DFD kernel is 100 (10 × 10) will be described, the predetermined number of pixels is not limited to this. The distance measurement target pixel may be set at any position in the DFD kernel, but in this embodiment, the distance measurement target pixel is arranged at the center position (or near the center) of the DFD kernel.

画素相関量演算部106(画素単位ぼけ相関量演算部)は、DFDカーネルとして設定された画素領域を、バッファ104に保持された2枚の画像データからそれぞれ抽出する。続いて、画素相関量演算部106は、DFDカーネル内の画素毎に画素単位のぼけ相関量を演算する。   The pixel correlation amount calculation unit 106 (pixel unit blur correlation amount calculation unit) extracts the pixel areas set as the DFD kernel from the two pieces of image data held in the buffer 104, respectively. Subsequently, the pixel correlation amount calculation unit 106 calculates a blur correlation amount in units of pixels for each pixel in the DFD kernel.

加重制御部107は、画素毎のぼけ相関量にそれぞれ対応する重み係数を設定する。画素相関量演算部106には、加重制御部107から重み係数が入力される。画素相関量演算部106は、画素毎のぼけ相関量に重み係数を掛け合わせた値を加重平均演算部108に出力する。なお、加重平均演算部108に加重制御部107から重み係数を入力し、加重平均演算部108が、画素毎のぼけ相関量に重み係数を掛け合わせてもよい。   The weight control unit 107 sets weighting coefficients corresponding to the blur correlation amounts for each pixel. A weight coefficient is input from the weight control unit 107 to the pixel correlation amount calculation unit 106. The pixel correlation amount calculation unit 106 outputs a value obtained by multiplying the blur correlation amount for each pixel by a weighting coefficient to the weighted average calculation unit 108. Note that a weighting coefficient may be input from the weighting control unit 107 to the weighted average calculation unit 108, and the weighted average calculation unit 108 may multiply the blur correlation amount for each pixel by the weighting coefficient.

加重平均演算部108は、重み付けしたDFDカーネル内の画素毎のぼけ相関量の和をDFDカーネルのぼけ相関量として出力する。即ち、加重平均演算部108は、DFDカーネル内の各画素のぼけ相関量の加重平均(又は重み付け加算)の値を算出する。   The weighted average calculation unit 108 outputs the sum of the blur correlation amount for each pixel in the weighted DFD kernel as the blur correlation amount of the DFD kernel. That is, the weighted average calculation unit 108 calculates the value of the weighted average (or weighted addition) of the blur correlation amount of each pixel in the DFD kernel.

距離決定部109(被写体距離決定部)は、加重平均演算部108から入力された画素単位のぼけ相関量の加重平均値からルックアップテーブル(LUT)に基づいて被写体距離を算出し、メモリ111に格納する。LUT記憶部110は、RAM(ランダムアクセスメモリ)、ROM(読み出し専用メモリ)等のメモリから構成され、ルックアップテーブルを記憶する。距離決定部109がメモリ111に被写体距離情報を格納すると、カーネル制御部105は測距点を変更し、バッファ104から新たなDFDカーネルを選択するかどうかの判断を行う。   The distance determination unit 109 (subject distance determination unit) calculates the subject distance from the weighted average value of the blur correlation amount in units of pixels input from the weighted average calculation unit 108 based on a lookup table (LUT), and stores it in the memory 111. Store. The LUT storage unit 110 includes a memory such as a RAM (Random Access Memory) and a ROM (Read Only Memory), and stores a lookup table. When the distance determination unit 109 stores the subject distance information in the memory 111, the kernel control unit 105 determines whether to change the distance measurement point and select a new DFD kernel from the buffer 104.

ルックアップテーブルは、図2のように、被写体距離Uとぼけ相関量σの関係を定めるものである。ぼけ相関量σは、被写体距離Uの逆数に対して、線形な関係がある(非特許文献1参照)。ルックアップテーブルにおいて、対応するぼけ相関量σがない場合には、補間によって被写体距離Uを求められる。ルックアップテーブルは、光学系10の状態(例えば、絞りの開口径Dや焦点距離f)ごとに設けられてよい。これは、被写体距離とぼけ相関量の関係は、光学系10の状態に依存し、光学系10の状態によってそれぞれ個別の関係式で表わされるためである。この場合、距離決定部109は、光学系10の状態に応じて、使用するルックアップテーブルを選択してよい。例えば、絞り303の開口径Dと光学系10の焦点距離fが可変の場合には、絞りの開口径Dや焦点距離fに応じて、使用するルックアップテーブルを選択してよい。   As shown in FIG. 2, the look-up table defines the relationship between the subject distance U and the blur correlation amount σ. The blur correlation amount σ has a linear relationship with the reciprocal of the subject distance U (see Non-Patent Document 1). If there is no corresponding blur correlation amount σ in the lookup table, the subject distance U can be obtained by interpolation. The look-up table may be provided for each state of the optical system 10 (for example, aperture diameter D or focal length f). This is because the relationship between the subject distance and the blur correlation amount depends on the state of the optical system 10 and is represented by an individual relational expression depending on the state of the optical system 10. In this case, the distance determination unit 109 may select a lookup table to be used according to the state of the optical system 10. For example, when the aperture diameter D of the diaphragm 303 and the focal length f of the optical system 10 are variable, a lookup table to be used may be selected according to the aperture diameter D and the focal distance f of the diaphragm.

なお、焦点距離fが可変の場合とは、光学系10が交換レンズの場合や光学系10がズームレンズの場合である。この場合、焦点距離検出部405が設けられ、焦点距離検出部405は、焦点距離fを検出する。光学系10が交換レンズの場合、焦点距離検出部405は、交換レンズのメモリに格納される焦点距離fを読み出せる。光学系10がズームレンズの場合、焦点距離検出部405は、ズームのためにレンズ群を動かす光学系制御部20のモータの動作量(回転量等)を焦点距離fの指標として検出できる。距離決定部109は、検出された焦点距離fから、使用するルックアップテーブルを特定できる。   The case where the focal length f is variable is when the optical system 10 is an interchangeable lens or when the optical system 10 is a zoom lens. In this case, a focal length detection unit 405 is provided, and the focal length detection unit 405 detects the focal length f. When the optical system 10 is an interchangeable lens, the focal length detection unit 405 can read the focal length f stored in the memory of the interchangeable lens. When the optical system 10 is a zoom lens, the focal length detection unit 405 can detect the operation amount (rotation amount, etc.) of the motor of the optical system control unit 20 that moves the lens group for zooming as an index of the focal length f. The distance determination unit 109 can specify a lookup table to be used from the detected focal length f.

又、フォーカスレンズの合焦位置と被写体距離は、一対一の対応関係があるので、ルックアップテーブルにおいて、被写体距離の代わりに、光学系10が合焦するフォーカスレンズの合焦位置を使用してよい。即ち、ルックアップテーブルは、フォーカスレンズの合焦位置(フォーカスレンズ合焦位置)とぼけ相関量との関係を定めるものであってもよい。   In addition, since there is a one-to-one correspondence between the focus position of the focus lens and the subject distance, the focus lens focus position at which the optical system 10 is focused is used instead of the subject distance in the lookup table. Good. That is, the look-up table may define a relationship between the focus lens focus position (focus lens focus position) and the blur correlation amount.

次に本実施形態におけるぼけ相関量演算部103での具体的な処理について説明する。   Next, specific processing in the blur correlation amount calculation unit 103 in the present embodiment will be described.

先ず異なる焦点位置で取得された輝度信号を、ぼけの異なる2つの画像データG1、G2としてバッファ104に保持する。続いて、カーネル制御部105は、撮影したシーンから被写体距離を計測する測距対象画素を選択する。次に、カーネル制御部105は、測距対象画素の近傍のM×M矩形領域の輝度値(画素値)をDFDカーネルとして画像G1、G2に設定する。ここで、画像G1、G2それぞれにおけるDFDカーネル内の輝度値をg1(u,v)、g2(u,v){u,v:1,2,3…M}、測距対象画素の座標を(cu,cv)と表記する。DFDカーネル内の任意の画素位置(u,v)における画素毎のぼけ相関量G(u,v)の演算式を式(1)に示す。   First, luminance signals acquired at different focal positions are held in the buffer 104 as two pieces of image data G1 and G2 having different blurs. Subsequently, the kernel control unit 105 selects a distance measurement target pixel for measuring the subject distance from the photographed scene. Next, the kernel control unit 105 sets the luminance value (pixel value) of the M × M rectangular area in the vicinity of the distance measurement target pixel as the DFD kernel in the images G1 and G2. Here, the luminance values in the DFD kernel in each of the images G1 and G2 are g1 (u, v), g2 (u, v) {u, v: 1,2,3. Indicated as (cu, cv). Equation (1) shows an arithmetic expression for the blur correlation amount G (u, v) for each pixel at an arbitrary pixel position (u, v) in the DFD kernel.

ここで、Cは実験値より導かれる定数、は輝度値の2次微分(ラプラシアン)を表す数学記号である。 Here, C is a constant derived from an experimental value, and is a mathematical symbol representing the second derivative (Laplacian) of the luminance value.

画素毎のぼけの相関量は、式(1)のように、ぼけの異なる2つの画像において、所定画素での輝度値の差分と2次微分とを計算し、この差分を2つの画像の所定画素での2次微分の平均値で除算して計算される。このぼけの相関量は、画像間の画素単位でのぼけの相関の程度を示す。   The correlation amount of blur for each pixel is calculated by calculating the difference between the luminance values at the predetermined pixels and the second derivative in two images having different blurs as shown in Expression (1), and calculating the difference between the two images. It is calculated by dividing by the average value of the second derivative at the pixel. The blur correlation amount indicates the degree of blur correlation in units of pixels between images.

加重平均演算部108が、DFDカーネルに対して算出するぼけ相関量の出力Gkは式(2)で与えられる。   The output Gk of the blur correlation amount calculated by the weighted average calculation unit 108 for the DFD kernel is given by Expression (2).

DFDカーネルに対して算出するぼけ相関量Gkは、画素単位のぼけ相関量G(u,v)の加重平均値で与えられる。加重平均値は、重み係数W(u,v)とぼけ相関量G(u,v)の積の合計から算出される。単位画素毎のぼけ相関量G(u,v)の重み係数W(u,v)は、Wi(u,v)とWg(u,v)の積で与えられる。ここでWi(u,v)、Wg(u,v)は、それぞれ、測距対象画素との画素間の距離差に応じた重み係数、測距対象画素との輝度差に応じた重み係数を示す。また、σi、σgは正規分布の標準偏差を示す。標準偏差σi、σgは実験データにより適切に与えられる。また、重み係数の総和は1に正規化されている。   The blur correlation amount Gk calculated for the DFD kernel is given as a weighted average value of the blur correlation amount G (u, v) in pixel units. The weighted average value is calculated from the sum of products of the weight coefficient W (u, v) and the blur correlation amount G (u, v). The weight coefficient W (u, v) of the blur correlation amount G (u, v) for each unit pixel is given by the product of Wi (u, v) and Wg (u, v). Here, Wi (u, v) and Wg (u, v) are respectively a weighting factor according to the distance difference between the pixel to be measured and a weighting factor according to the luminance difference from the ranged pixel. Show. Also, σi and σg indicate the standard deviation of normal distribution. The standard deviations σi and σg are appropriately given by experimental data. Further, the sum of the weight coefficients is normalized to 1.

例えば、図3(a)に示すように、重み係数Wi(u,v)は、ぼけ相関量を算出する画素(u,v)と測距対象画素(cu,cv)との座標間距離[(cu-u)2+(cv-v)2]1/2に対して正規分布関数で与えられてよい。このような確率密度関数に従って重み係数を与えることで、測距対象画素に近い画素に対して算出するぼけ相関量ほど重みが高く設定できる。また、例えば、図3(b)に示すように、重み係数Wg(u,v)は、ぼけ相関量を算出する画素と測距対象画素に関する画素単位のぼけ相関量の差分G(cu,cv)-G(u,v)に対して正規分布関数で与えられてよい。差分G(cu,cv)-G(u,v)は、ぼけ相関量を算出する画素と測距対象画素の輝度差の指標となっている。このような確率密度関数に従って重み係数を与えることで、測距対象画素との輝度差が小さい画素ほど、算出するぼけ相関量の重みが高く設定できる。このような重み係数W(u,v)を用いて、測距対象画素との被写体距離の差が小さくなる可能性の高い画素のぼけ相関量の影響が、被写体距離算出において大きくなる。 For example, as shown in FIG. 3A, the weighting coefficient Wi (u, v) is the inter-coordinate distance between the pixel (u, v) for calculating the blur correlation amount and the distance measurement target pixel (cu, cv) [ (cu-u) 2 + (cv-v) 2 ] 1/2 may be given as a normal distribution function. By giving a weighting coefficient according to such a probability density function, a higher weight can be set for a blur correlation amount calculated for a pixel closer to the distance measurement target pixel. For example, as shown in FIG. 3B, the weighting coefficient Wg (u, v) is a difference G (cu, cv) between the pixel for calculating the blur correlation amount and the blur correlation amount in pixel units related to the distance measurement target pixel. ) -G (u, v) may be given as a normal distribution function. The difference G (cu, cv) −G (u, v) is an indicator of the luminance difference between the pixel for calculating the blur correlation amount and the pixel to be measured. By giving a weighting coefficient according to such a probability density function, a pixel having a smaller luminance difference from the distance measurement target pixel can be set to have a higher weight of the calculated blur correlation amount. Using such a weighting factor W (u, v), the influence of the blur correlation amount of a pixel that is likely to have a small difference in subject distance from the distance measurement target pixel becomes large in subject distance calculation.

なお、重み係数Wi(u,v)は、正規分布関数以外でも、(cu,cv)と(u,v)の距離[(cu-u)2+(cv-v)2]1/2の増加に応じて小さくなる関数であれば使用できる。重み係数Wg(u,v)は、正規分布関数以外でも、G(cu,cv)-G(u,v)の増加に応じて小さくなる関数であれば使用できる。また、重み係数Wg(u,v)として、以下の式(3)のように、輝度差に関する正規分布関数をより直接的に計算してもよい。式(3)では、2つの画像G1、G2において、ぼけ相関量を算出する画素と測距対象画素との輝度差を合計して平均化したものg1(cu,cv)-g1(u,v)+g2(cu,cv)-g2(u,v)に対する正規分布関数を使用する。 Note that the weight coefficient Wi (u, v) is not a normal distribution function, but is a distance [(cu-u) 2 + (cv-v) 2 ] 1/2 between (cu, cv) and (u, v). Any function that becomes smaller as it increases can be used. The weight coefficient Wg (u, v) can be used as long as it is a function that becomes smaller as G (cu, cv) −G (u, v) increases, besides the normal distribution function. Further, as the weight coefficient Wg (u, v), a normal distribution function related to the luminance difference may be calculated more directly as in the following equation (3). In the expression (3), in two images G1 and G2, the luminance difference between the pixel for calculating the blur correlation amount and the pixel for distance measurement is summed and averaged g1 (cu, cv) -g1 (u, v Use the normal distribution function for) + g2 (cu, cv) -g2 (u, v).

次に、本実施形態の測距装置における被写体距離の算出手順を図4、図5を用いて説明する。   Next, the procedure for calculating the subject distance in the distance measuring apparatus according to the present embodiment will be described with reference to FIGS.

図4のフローチャートにおいて、ステップS1で、光学系制御部20は、光学系10のフォーカスレンズを予め決められた第一のフォーカスレンズ位置L1に移動する。光学系10の焦点位置は、第一のフォーカスレンズ位置L1に対応する第一の焦点位置になる。このように、撮影パラメータとしての光学系10の焦点位置を第一の焦点位置に設定する。図5(a)は、光学系10のフォーカスレンズが予め決められた第一のフォーカスレンズ位置L1に移動した様子を示す。   In the flowchart of FIG. 4, in step S1, the optical system control unit 20 moves the focus lens of the optical system 10 to a predetermined first focus lens position L1. The focal position of the optical system 10 is the first focal position corresponding to the first focus lens position L1. Thus, the focal position of the optical system 10 as the imaging parameter is set to the first focal position. FIG. 5A shows a state in which the focus lens of the optical system 10 has moved to a first focus lens position L1 that has been determined in advance.

ステップS2で、光学系10の第一の焦点位置(第一の撮影パラメータ)において、第一の画像G1を取得する。   In step S2, the first image G1 is acquired at the first focal position (first imaging parameter) of the optical system 10.

ステップS3で、輝度信号制御部102は、取得した第一の画像G1の輝度信号に対して、像倍率補正処理、輝度分布の正規化処理などの処理を行って画像データとしてバッファ104に保持する。像倍率補正処理は、第一及び第二の画像間で異なる倍率を補正する処理である。   In step S <b> 3, the luminance signal control unit 102 performs processing such as image magnification correction processing and luminance distribution normalization processing on the acquired luminance signal of the first image G <b> 1 and stores it in the buffer 104 as image data. . The image magnification correction process is a process for correcting a different magnification between the first and second images.

ステップS4で、カーネル制御部105は、測距対象画素の座標位置(cu,cv)を設定する。カーネル制御部105は、バッファ104に保持されている画像G1から測距対象画素を含む画素領域をDFDカーネル(処理対象領域)として読み出す。   In step S4, the kernel control unit 105 sets the coordinate position (cu, cv) of the distance measurement target pixel. The kernel control unit 105 reads a pixel area including the distance measurement target pixel from the image G1 held in the buffer 104 as a DFD kernel (processing target area).

ステップS5で、光学系制御部20は、光学系10のフォーカスレンズを予め決められた第二のフォーカスレンズ位置L2に移動する。光学系10の焦点位置は、第二のフォーカスレンズ位置L2に対応する第二の焦点位置になる。このように、撮影パラメータとしての光学系10の焦点位置を第二の焦点位置に設定する。図5(b)は、光学系10のフォーカスレンズが予め決められた第二のフォーカスレンズ位置L2に移動した様子を示す。   In step S5, the optical system control unit 20 moves the focus lens of the optical system 10 to a predetermined second focus lens position L2. The focal position of the optical system 10 is the second focal position corresponding to the second focus lens position L2. Thus, the focal position of the optical system 10 as the imaging parameter is set to the second focal position. FIG. 5B shows a state in which the focus lens of the optical system 10 has moved to a predetermined second focus lens position L2.

ステップS6で、光学系10の第二の焦点位置(第二の撮影パラメータ)において、第二の画像G2を取得する。   In step S6, the second image G2 is acquired at the second focal position (second imaging parameter) of the optical system 10.

ステップS7で、輝度信号制御部102は、取得した第二の画像G2の輝度信号に対して、像倍率補正処理、輝度分布の正規化処理などの処理を行って画像データとしてバッファ104に保持する。   In step S <b> 7, the luminance signal control unit 102 performs processing such as image magnification correction processing and luminance distribution normalization processing on the acquired luminance signal of the second image G <b> 2 and stores it in the buffer 104 as image data. .

ステップS8で、カーネル制御部105は、S4と同様に測距対象画素の座標位置(cu,cv)を設定する。カーネル制御部105は、バッファ104に保持されている画像G2から測距対象画素を含む画素領域をDFDカーネル(処理対象領域)として読み出す。画像G2のDFDカーネルの領域は、画像G1のDFDカーネルの領域に対応するものである。DFDカーネルの位置は、画像G1、G2内で画像中心に関して基本的に同じ位置にある。   In step S8, the kernel control unit 105 sets the coordinate position (cu, cv) of the distance measurement target pixel as in S4. The kernel control unit 105 reads a pixel area including a distance measurement target pixel from the image G2 held in the buffer 104 as a DFD kernel (processing target area). The region of the DFD kernel of the image G2 corresponds to the region of the DFD kernel of the image G1. The position of the DFD kernel is basically at the same position in the images G1 and G2 with respect to the image center.

ステップS9で、画素相関量演算部106は、DFDカーネル内の画素毎にぼけ相関量を演算する。   In step S9, the pixel correlation amount calculation unit 106 calculates a blur correlation amount for each pixel in the DFD kernel.

ステップS10で、画素相関量演算部106は、DFDカーネルに対し、予め正規分布関数として規定された重み係数を用いて、S9で算出された画素毎のぼけ相関量に重み付けする。画素相関量演算部106は、重み付きぼけ相関量として、画素毎のぼけ相関量と重み係数の積を算出する。   In step S <b> 10, the pixel correlation amount calculation unit 106 weights the blur correlation amount for each pixel calculated in step S <b> 9 using a weighting factor defined in advance as a normal distribution function for the DFD kernel. The pixel correlation amount calculation unit 106 calculates the product of the blur correlation amount and the weight coefficient for each pixel as the weighted blur correlation amount.

ステップS11で、加重平均演算部108は、S10で算出された重み付きぼけ相関量の総和を求め、DFDカーネル内で、画素単位のぼけ相関量G(u,v)の加重平均値を算出する。   In step S11, the weighted average calculation unit 108 obtains the sum of the weighted blur correlation amounts calculated in S10, and calculates the weighted average value of the blur correlation amount G (u, v) for each pixel in the DFD kernel. .

ステップS12で、距離決定部109は、LUT記憶部110のルックアップテーブルを参照し、画素単位のぼけ相関量G(u,v)の加重平均値(即ち、DFDカーネルのぼけ相関量)に対応する被写体距離を算出する。   In step S12, the distance determination unit 109 refers to the lookup table in the LUT storage unit 110 and corresponds to the weighted average value of the blur correlation amount G (u, v) in units of pixels (that is, the blur correlation amount of the DFD kernel). The subject distance to be calculated is calculated.

ステップS13で、距離決定部109は、現在の測距対象画素に関する被写体距離をメモリ111に格納する。   In step S <b> 13, the distance determination unit 109 stores the subject distance related to the current distance measurement target pixel in the memory 111.

ステップS14で、バッファに格納されている画像データに対する測距対象画素が他にも存在するかどうか判断する。測距対象画素が他に存在しなければ処理を終了する。   In step S14, it is determined whether or not there are other distance measurement target pixels for the image data stored in the buffer. If there are no other pixels to be measured, the process ends.

ステップS15で、測距対象画素が他にも存在すれば、測距対象画素を更新した後、S4、S8以後の処理を繰り返す。   If there are other distance measurement target pixels in step S15, the distance measurement target pixels are updated, and then the processes after S4 and S8 are repeated.

このように算出した被写体距離は、自動焦点制御におけるフォーカスレンズの合焦位置を求めるために利用される他、フラッシュ撮影時の調光制御等にも利用できる。また、測距対象画素毎に得られた被写体距離から、画像内における被写体距離の違いを表す距離マップを作成することもできる。   The subject distance calculated in this way is used not only for obtaining the focus position of the focus lens in automatic focus control but also for dimming control during flash photography. In addition, a distance map representing the difference in subject distance in the image can be created from the subject distance obtained for each distance measurement target pixel.

次に、第一実施形態の作用、効果を説明する。   Next, functions and effects of the first embodiment will be described.

画素単位のぼけの相関量の加重平均値をDFDカーネルのぼけ相関量として算出して、この加重平均値からDFDカーネル毎に被写体距離が算出できる。これにより、DFDカーネル内の被写体距離の変動が存在しても、算出される被写体距離はDFDカーネル内で加重平均を取ったものに相当する。従って、DFDカーネルを設定することにより測距精度の安定性を保ちつつ、DFDカーネル内の被写体距離の変動の測距精度に対する影響が小さくなる。   The weighted average value of the blur correlation amount in pixel units is calculated as the blur correlation amount of the DFD kernel, and the subject distance can be calculated for each DFD kernel from the weighted average value. Thus, even if there is a variation in subject distance in the DFD kernel, the calculated subject distance corresponds to a weighted average obtained in the DFD kernel. Therefore, setting the DFD kernel maintains the stability of the distance measurement accuracy, while reducing the influence on the distance measurement accuracy of the subject distance variation in the DFD kernel.

さらに、DFDカーネル内での画素単位ぼけ相関量の加重平均値を算出する際に、測距対象画素を基準として画素間距離、輝度差に応じた重み係数を用いる。重み係数は、測距対象画素と画素単位ぼけ相関量を算出する画素との画素間距離、輝度差の増加に応じて小さくなる関数、例えば、正規分布関数で与えられる。これにより、測距対象画素位置に近く、測距対象画素との被写体距離差が小さくなる可能性の高い画素から算出されたぼけ相関量が、被写体距離算出において重視される。従って、測距対象画素位置に結像する被写体の距離情報を高い精度で算出することが可能となる。   Further, when calculating the weighted average value of the pixel unit blur correlation amount in the DFD kernel, a weighting coefficient corresponding to the inter-pixel distance and the luminance difference is used with reference to the distance measurement target pixel. The weighting coefficient is given by a function that decreases as the distance between the pixels to be measured and the pixel for which the pixel unit blur correlation amount is calculated and the luminance difference increases, for example, a normal distribution function. Thereby, the blur correlation amount calculated from a pixel that is close to the distance measurement target pixel position and is likely to have a small subject distance difference from the distance measurement target pixel is emphasized in the subject distance calculation. Therefore, it is possible to calculate the distance information of the subject imaged at the distance measurement target pixel position with high accuracy.

[第一実施形態の変形例]
上記の第一実施形態において、撮影パラメータが光学系10の焦点位置である場合を説明した。しかし、撮影パラメータは、絞り303の開口径Dや光学系10の焦点距離fであってもよい。
[Modification of First Embodiment]
In the first embodiment, the case where the imaging parameter is the focal position of the optical system 10 has been described. However, the imaging parameter may be the aperture diameter D of the diaphragm 303 or the focal length f of the optical system 10.

撮影パラメータが開口径Dである場合、図4のステップS1において、光学系制御部20は、フォーカスレンズ位置を設定する代わりに、絞り制御機構により開口径Dを予め決められた第一の開口径D1に設定する。ステップS2において、光学系10の第一の開口径D1(第一の撮影パラメータ)において、第一の画像G1を取得する。ステップS5において、光学系制御部20は、絞り制御機構により開口径Dを予め決められた第二の開口径D2に設定する。ステップS6において、光学系10の第二の開口径D1(第二の撮影パラメータ)において、第二の画像G2を取得する。図4の他のステップは、上記の第一実施形態と同様である。   When the photographing parameter is the aperture diameter D, in step S1 of FIG. 4, the optical system control unit 20 sets the aperture diameter D in advance by the aperture control mechanism instead of setting the focus lens position. Set to D1. In step S2, the first image G1 is acquired at the first aperture diameter D1 (first imaging parameter) of the optical system 10. In step S5, the optical system control unit 20 sets the aperture diameter D to a predetermined second aperture diameter D2 by the diaphragm control mechanism. In step S6, the second image G2 is acquired at the second aperture diameter D1 (second imaging parameter) of the optical system 10. The other steps in FIG. 4 are the same as those in the first embodiment.

光学系10がズームレンズであり、撮影パラメータが光学系10の焦点距離fである場合、ステップS1において、光学系制御部20は、焦点距離fを予め決められた第一の焦点距離f1に設定する。ステップS2において、光学系10の第一の焦点距離f1(第一の撮影パラメータ)において、第一の画像G1を取得する。ステップS5において、光学系制御部20は、焦点距離fを予め決められた第二の焦点距離f2に設定する。ステップS6において、光学系10の第二の焦点距離f2(第二の撮影パラメータ)において、第二の画像G2を取得する。図4の他のステップは、上記の第一実施形態と同様である。   When the optical system 10 is a zoom lens and the shooting parameter is the focal length f of the optical system 10, in step S1, the optical system control unit 20 sets the focal length f to a predetermined first focal length f1. To do. In step S2, the first image G1 is acquired at the first focal length f1 (first imaging parameter) of the optical system 10. In step S5, the optical system control unit 20 sets the focal length f to a predetermined second focal length f2. In step S6, the second image G2 is acquired at the second focal length f2 (second imaging parameter) of the optical system 10. The other steps in FIG. 4 are the same as those in the first embodiment.

この変形例においても、DFDカーネルの使用による測距精度の安定性を保ち、且つDFDカーネル内の被写体距離の変動の測距精度に対する影響が小さくなる。このため、測距対象画素位置に結像する被写体の距離情報を高い精度で算出することが可能となる。   Also in this modified example, the stability of the distance measurement accuracy by using the DFD kernel is maintained, and the influence on the distance measurement accuracy due to the variation of the subject distance in the DFD kernel is reduced. For this reason, it is possible to calculate the distance information of the subject imaged at the distance measurement target pixel position with high accuracy.

[第二実施形態]
図6と図7を参照して、第二実施形態に係る測距装置又は撮像装置について説明する。図6に示すような測距装置又は撮像装置の構成において、第一実施形態と同様である部分については説明を省略し、主として構造の異なる点についてのみ説明する。
[Second Embodiment]
With reference to FIG. 6 and FIG. 7, the distance measuring device or the imaging device according to the second embodiment will be described. In the configuration of the distance measuring apparatus or the imaging apparatus as shown in FIG. 6, the description of the same parts as in the first embodiment is omitted, and only the differences in structure will be mainly described.

本実施形態では、第一実施形態と加重制御部107の構成が異なる。本実施形態において、加重制御部107は、領域分割部113、測距対象画素属性判定部114(属性判定部とも呼ぶ)、有効領域設定部115を備える。   In the present embodiment, the configuration of the weight control unit 107 is different from that of the first embodiment. In the present embodiment, the weight control unit 107 includes an area dividing unit 113, a distance measurement target pixel attribute determining unit 114 (also referred to as an attribute determining unit), and an effective region setting unit 115.

領域分割部113は、DFDカーネルの領域を複数の領域に分割する。領域分割部113は、撮影シーンの像情報から、所定の特徴量として主要被写体領域(所定の画素領域)の位置座標を決定する位置座標決定部を有し、この位置座標情報を保持する。領域分割部113は、主要被写体領域の位置座標に基づいて、DFDカーネルを主要被写体領域と非主要被写体領域に分割する。DFDカーネル内における両分割領域にはラベル(識別記号)が付与される。ここで、主要被写体領域とは、主要被写体が存在するおよその領域を示すものであり、非主要被写体領域は、主要被写体領域以外の領域である。なお、主要被写体領域と非主要被写体領域を分割領域と総称する。   The area dividing unit 113 divides the DFD kernel area into a plurality of areas. The area dividing unit 113 includes a position coordinate determining unit that determines the position coordinates of the main subject area (predetermined pixel area) as a predetermined feature amount from the image information of the shooting scene, and holds the position coordinate information. The area dividing unit 113 divides the DFD kernel into a main subject area and a non-main subject area based on the position coordinates of the main subject area. Labels (identification symbols) are assigned to both divided regions in the DFD kernel. Here, the main subject area indicates an approximate area where the main subject exists, and the non-main subject area is an area other than the main subject area. The main subject area and the non-main subject area are collectively referred to as divided areas.

撮影シーンの像情報から、所定の画素領域としての主要被写体領域の位置座標を決定する位置座標決定部は、公知の顔認識技術を利用できる。本実施形態では、説明の簡単化のため主要被写体領域を矩形領域として保持する顔認識技術の場合について説明を行うが、主要被写体領域がどの様な形状の領域で形成されていても本実施形態を適用可能である。   A position coordinate determination unit that determines the position coordinates of the main subject area as a predetermined pixel area from the image information of the shooting scene can use a known face recognition technique. In this embodiment, the case of the face recognition technology that holds the main subject area as a rectangular area will be described for the sake of simplification. However, the present embodiment will be described regardless of the shape of the main subject area. Is applicable.

属性判定部114は、測距対象画素が主要被写体領域と非主要被写体領域のどちらに含まれるかを判定する。有効領域設定部115は、DFDカーネルにおいて、測距対象画素を含む領域を有効領域として設定する。有効領域設定部115は、主要被写体領域と非主要被写体領域のうちで、測距対象画素を含まない分割領域で重み係数W(u,v)を0に設定し、測距対象画素を含む分割領域の重み係数W(u,v)を1/Nに設定する。ここで、Nは、DFDカーネル内で測距対象画素を含む分割領域の画素数である。有効領域設定部115は、重み係数W(u,v)が0の領域、即ち測距対象画素を含まない領域をDFDカーネルから除外する。これにより、画素相関量演算部106は、測距対象画素を含む領域を構成する画素についてのみ単位画素毎のぼけ相関量G(u,v)の演算を行う。   The attribute determination unit 114 determines whether the distance measurement target pixel is included in the main subject region or the non-main subject region. The effective area setting unit 115 sets an area including a distance measurement target pixel as an effective area in the DFD kernel. The effective area setting unit 115 sets a weighting factor W (u, v) to 0 in a divided area that does not include a distance measurement target pixel and includes a distance measurement target pixel in the main subject area and the non-main subject area. The area weighting factor W (u, v) is set to 1 / N. Here, N is the number of pixels in the divided area including the distance measurement target pixel in the DFD kernel. The effective area setting unit 115 excludes an area having a weighting factor W (u, v) of 0, that is, an area that does not include a distance measurement target pixel from the DFD kernel. Thereby, the pixel correlation amount calculation unit 106 calculates the blur correlation amount G (u, v) for each unit pixel only for the pixels constituting the region including the distance measurement target pixel.

DFDカーネル内の有効領域指定の具体例について図7(a)、図7(b)を用いて説明する。図7(a)は、被写体として人と背景を撮像した画像データと、測距対象画素に対応するDFDカーネルの拡大図を示している。測距対象画素の例をkg1、kg2を、またそれらに対応するDFDカーネルをk1、k2とする。また、被写体として撮像された人の顔領域Fは、主要被写体認識手段として公知の顔認識手段を用いて、主要被写体領域として予め認識される。その認識結果が、矩形の顔領域Fの画像座標として保持されている。   A specific example of effective area designation in the DFD kernel will be described with reference to FIGS. 7 (a) and 7 (b). FIG. 7A shows an enlarged view of image data obtained by capturing a person and a background as a subject and a DFD kernel corresponding to a distance measurement target pixel. Examples of distance measurement target pixels are kg1 and kg2, and the corresponding DFD kernels are k1 and k2. Further, the face area F of a person imaged as a subject is recognized in advance as a main subject area by using known face recognition means as main subject recognition means. The recognition result is held as the image coordinates of the rectangular face area F.

この場合の被写体距離の算出手順を図8のフローチャートに示す。この算出手順は、図4の第一実施形態のフローチャートにおける画素単位ぼけ相関量演算(S9)の前に、DFDカーネルの有効領域指定(S21、S22)を追加したものとなる。   The subject distance calculation procedure in this case is shown in the flowchart of FIG. This calculation procedure is obtained by adding DFD kernel effective area designation (S21, S22) before pixel unit blur correlation amount calculation (S9) in the flowchart of the first embodiment of FIG.

図8のステップS21、S22における有効領域指定の手順(サブルーチン)を図9のフローチャートに示す。   The procedure (subroutine) for specifying the effective area in steps S21 and S22 of FIG. 8 is shown in the flowchart of FIG.

ステップS31で、領域分割部113は、DFDカーネルの画像座標と顔認識領域Fの画像座標を比較し、両方の画像座標が一致する画素に、主要被写体領域の画素を表示するラベルを付与する。DFDカーネルの画像座標と顔認識領域Fの画像座標が一致しない画素に、非主要被写体領域の画素を表示するラベルを付与する。これにより、主要被写体領域の位置座標に基づいて、DFDカーネルの領域が主要被写体領域と非主要被写体領域に分割される。   In step S31, the area dividing unit 113 compares the image coordinates of the DFD kernel and the image coordinates of the face recognition area F, and assigns a label for displaying the pixels of the main subject area to the pixels whose both image coordinates match. A label for displaying a pixel in the non-main subject area is assigned to a pixel in which the image coordinates of the DFD kernel and the image coordinates of the face recognition area F do not match. Thereby, based on the position coordinates of the main subject area, the DFD kernel area is divided into a main subject area and a non-main subject area.

ステップS32において、属性判定部114は、測距対象画素kgが主要被写体領域又は非主要被写体領域のどちらに属するかを、その座標位置より判定する。図7(a)の例では、測距対象画素Kg1は非主要被写体、測距対象画素kg2は主要被写体に属すると判定される。   In step S32, the attribute determination unit 114 determines whether the distance measurement target pixel kg belongs to the main subject region or the non-main subject region based on the coordinate position. In the example of FIG. 7A, it is determined that the distance measurement target pixel Kg1 belongs to a non-main subject, and the distance measurement target pixel kg2 belongs to a main subject.

ステップS33において、有効領域設定部115は、測距対象画素kgが属しない分割領域の重み係数を0に設定する。有効領域設定部115は、測距対象画素kgが属する分割領域の画素数がNの場合、この分割領域で計算される画素単位のぼけ相関量の重み係数を1/Nに設定する。これにより、測距対象画素が属する分割領域でのぼけ相関量の平均値を演算できる。   In step S33, the effective area setting unit 115 sets the weighting factor of the divided area to which the distance measurement target pixel kg does not belong to zero. When the number of pixels in the divided area to which the distance measurement target pixel kg belongs is N, the effective area setting unit 115 sets the weight coefficient of the blur correlation amount in pixel units calculated in this divided area to 1 / N. Thereby, the average value of the blur correlation amount in the divided area to which the distance measurement target pixel belongs can be calculated.

測距対象画素Kg1の属する領域の画素数がN1であった場合、DFDカーネルk1に対応する重み係数テーブルは図7(b)のwt1となる。測距対象画素kg2の属する領域の画素数がN2であった場合、DFDカーネルk2に対応する重み係数テーブルは図7(b)のwt2となる。   When the number of pixels in the area to which the distance measurement target pixel Kg1 belongs is N1, the weight coefficient table corresponding to the DFD kernel k1 is wt1 in FIG. 7B. When the number of pixels in the area to which the distance measurement target pixel kg2 belongs is N2, the weight coefficient table corresponding to the DFD kernel k2 is wt2 in FIG. 7B.

ステップS34において、重み係数が0の画素をDFDカーネルから除外する。   In step S34, pixels with a weighting factor of 0 are excluded from the DFD kernel.

なお、画素を除外せずにDFDカーネルの全ての画素のぼけ相関量を算出してから、重み係数W(u,v)を画素単位のぼけ相関量G(u,v)に掛けて加重平均値を計算してもよい。この場合、測距対象画素を含まない領域の重み係数W(u,v)は0であるため、測距対象画素を含む領域の画素のみを考慮して、加重平均値が計算される。   In addition, after calculating the blur correlation amount of all pixels of the DFD kernel without excluding pixels, the weighted average is obtained by multiplying the weight coefficient W (u, v) by the blur correlation amount G (u, v) in pixel units. A value may be calculated. In this case, since the weight coefficient W (u, v) of the area not including the distance measurement target pixel is 0, the weighted average value is calculated in consideration of only the pixels of the area including the distance measurement target pixel.

また、重み係数を0以外の値に設定することにより測距対象画素を含まない分割領域を特定してDFDカーネルから除外することもできる。測距対象画素を含む領域と含まない領域の重み係数が異なる値であれば、両領域を特定できるためである。さらに、測距対象画素が属する分割領域での重み係数を前述の正規分布関数を用いて設定することもできる。   In addition, by setting the weighting factor to a value other than 0, it is possible to specify a divided area that does not include a distance measurement target pixel and exclude it from the DFD kernel. This is because both areas can be specified if the weighting coefficients of the area including the distance measurement target pixel and the area not including the distance measurement target pixel are different values. Furthermore, the weighting coefficient in the divided area to which the distance measurement target pixel belongs can be set using the above-described normal distribution function.

次に、第二実施形態の作用、効果を説明する。   Next, the operation and effect of the second embodiment will be described.

DFDカーネル内の各画素位置でのぼけ相関量平均を算出する際に、DFDカーネルの領域は、主要被写体領域と非主要被写体領域に分割される。主要被写体領域(所定の画素領域)の位置座標を用いることにより、明確にDFDカーネルの領域を分割できる。測距対象画素を含む領域と含まない領域に異なる重み係数を付与するので、重み係数の設定と同時に測距対象画素を含まない領域を特定でき簡便である。測距対象画素の属さない分割領域は、DFDカーネルから除外されるか、重み係数が0に設定される。これにより測距対象画素位置の像と被写体距離差が小さい像が結像するような分割領域の画素のみを用いて、ぼけ相関量の平均値を演算することが可能となる。従って、高精度に測距対象画素の被写体距離を算出することができる。   When calculating the average blur correlation amount at each pixel position in the DFD kernel, the area of the DFD kernel is divided into a main subject area and a non-main subject area. By using the position coordinates of the main subject area (predetermined pixel area), the DFD kernel area can be clearly divided. Since different weighting coefficients are assigned to the area including the distance measurement target pixel and the area not including the distance measurement target pixel, the area not including the distance measurement target pixel can be specified simultaneously with the setting of the weighting coefficient. The divided area to which the pixel to be measured does not belong is excluded from the DFD kernel, or the weight coefficient is set to 0. As a result, it is possible to calculate the average value of the blur correlation amount using only the pixels in the divided area where an image of the distance measurement target pixel position and an image with a small subject distance difference are formed. Therefore, the subject distance of the distance measurement target pixel can be calculated with high accuracy.

[第三実施形態]
図10―13を参照して、第三実施形態に係る測距装置又は撮像装置について説明する。本実施形態は、第二実施形態の変形例である。図10の第三実施形態に係る撮像装置において、第二実施形態と同様である部分については説明を省略し、主として構造の異なる点についてのみ説明する。
[Third embodiment]
With reference to FIGS. 10 to 13, the distance measuring apparatus or the imaging apparatus according to the third embodiment will be described. This embodiment is a modification of the second embodiment. In the imaging apparatus according to the third embodiment in FIG. 10, the description of the same parts as in the second embodiment is omitted, and only the differences in structure will be mainly described.

第三実施形態では、第二実施形態の構成に加えて、加重制御部107において、カーネル領域制御部116を備える。有効領域設定部115は、重み係数W(u,v)が0の分割領域をDFDカーネルから除外する。しかし、カーネル領域制御部116は、画素単位のぼけ相関量の演算対象から除外された分割領域の画素数分の領域を、DFDカーネルの周囲に設けて、画素単位のぼけ相関量の演算対象とする。   In the third embodiment, in addition to the configuration of the second embodiment, the weight control unit 107 includes a kernel region control unit 116. The effective area setting unit 115 excludes a divided area having a weighting factor W (u, v) of 0 from the DFD kernel. However, the kernel area control unit 116 provides the area for the number of pixels of the divided area excluded from the calculation target of the pixel-by-pixel blur correlation amount around the DFD kernel, To do.

第三実施形態に係る図11のフローチャートのステップS21、S22における有効領域指定の手順(サブルーチン)は、図9のフローチャートを改良したものである。図11のフローチャートは、図9のフローチャートにステップS35が追加されている。ステップS31−S34の処理は、第二実施形態と同様である。   The effective area designation procedure (subroutine) in steps S21 and S22 of the flowchart of FIG. 11 according to the third embodiment is an improvement of the flowchart of FIG. In the flowchart of FIG. 11, step S35 is added to the flowchart of FIG. The process of step S31-S34 is the same as that of 2nd embodiment.

第二実施形態において、重み係数テーブルがwt1またはwt2であるので、測距精度安定性のために抽出したDFDカーネルの一部の画素しか有効領域として利用されない。   In the second embodiment, since the weighting coefficient table is wt1 or wt2, only some pixels of the DFD kernel extracted for ranging accuracy stability are used as effective areas.

図12を参照すると、第三実施形態では、ステップS35で、カーネル領域制御部116は、画素単位のぼけ相関量の演算対象となるDFDカーネルを拡張する。このため、カーネル領域制御部116は、DFDカーネルの近傍(又は周囲)の画素を新たにDFDカーネルの一部として設定する。次に、カーネル領域制御部116は、測距対象画素が存在する分割領域と同じ重み係数を、この近傍の画素に付与する。   Referring to FIG. 12, in the third embodiment, in step S <b> 35, the kernel area control unit 116 expands the DFD kernel that is the calculation target of the blur correlation amount in units of pixels. Therefore, the kernel area control unit 116 newly sets a pixel in the vicinity (or surrounding) of the DFD kernel as a part of the DFD kernel. Next, the kernel area control unit 116 assigns the same weighting coefficient to the neighboring pixels as the divided area where the distance measurement target pixel exists.

以下に、図12の例を参照して、DFDカーネルを拡張する具体的手法について説明する。   A specific method for extending the DFD kernel will be described below with reference to the example of FIG.

カーネル領域制御部116は、測距対象画素が属する分割領域のDFDカーネル内での配置に応じて、DFDカーネルの周囲の画素を新たにDFDカーネルに組み込む。カーネル領域制御部116は、DFDカーネルの辺のうち測距対象画素の属する分割領域を画定する辺の周囲画素を、新たにDFDカーネルの領域として設定する。具体的には、カーネル領域制御部116は、測距対象画素の属する分割領域のラベルに着目し、DFDカーネルを画定する辺のうち、最も長く同じラベル番号が連なる辺を検出する。続いて、DFDカーネルの周囲において、検出した辺の法線方向にある画素領域をDFDカーネルの一部に組み込む。この画素領域は、除外した画素の画素数と同じ又は同等の画素数を有する。   The kernel area control unit 116 newly incorporates pixels around the DFD kernel into the DFD kernel according to the arrangement in the DFD kernel of the divided area to which the distance measurement target pixel belongs. The kernel area control unit 116 newly sets surrounding pixels on the side defining the divided area to which the distance measurement target pixel belongs among the sides of the DFD kernel as the DFD kernel area. Specifically, the kernel region control unit 116 pays attention to the label of the divided region to which the distance measurement target pixel belongs, and detects the longest side that has the same label number among the sides that define the DFD kernel. Subsequently, a pixel region in the normal direction of the detected side around the DFD kernel is incorporated into a part of the DFD kernel. This pixel area has the same or equivalent number of pixels as the number of excluded pixels.

図12では、DFDカーネルk1の左辺に測距対象領域と同一ラベルの画素が最も長く並ぶ。このため、除外した3列の画素領域に相当する画素領域を左辺の法線方向に設けて、DFDカーネルを拡張している。拡張された新たなDFDカーネルk1'に対応する重み付けテーブルwt1'が規定されている。   In FIG. 12, pixels having the same label as the distance measurement target area are arranged on the left side of the DFD kernel k1 for the longest time. Therefore, the DFD kernel is expanded by providing pixel areas corresponding to the excluded three pixel areas in the normal direction of the left side. A weighting table wt1 ′ corresponding to the new expanded DFD kernel k1 ′ is defined.

また、DFDカーネルk2は、カーネルの右辺と下辺に同一ラベルの画素が最も長く並ぶ。このため、両辺の法線方向にそれぞれ除外した画素数分だけDFDカーネルを拡張している。拡張された新たなDFDカーネルk2'に対応する重み付けテーブルwt2'が規定されている。重み付けテーブルwt1'、wt2'の重み付け係数は全て同値であり、DFDカーネルの画素数がNaであれば、重み付け係数は1/Naに設定される。   In the DFD kernel k2, pixels with the same label are arranged on the right side and the lower side of the kernel for the longest time. For this reason, the DFD kernel is expanded by the number of pixels excluded in the normal direction of both sides. A weighting table wt2 ′ corresponding to the new expanded DFD kernel k2 ′ is defined. The weighting coefficients of the weighting tables wt1 ′ and wt2 ′ are all the same value, and if the number of pixels of the DFD kernel is Na, the weighting coefficient is set to 1 / Na.

新しいDFDカーネルと対応する重み付け係数を用いて、バッファから画像データを読み出し、画素単位のぼけ相関量の演算と加重平均演算が行われる。   Image data is read from the buffer using a new DFD kernel and a corresponding weighting coefficient, and a blur correlation amount calculation and a weighted average calculation are performed for each pixel.

次に、第三実施形態の作用、効果を説明する。   Next, the operation and effect of the third embodiment will be described.

DFDカーネル内の各画素位置でのぼけ相関量平均を算出する際に、DFDカーネル内を分割し、測距対象画素の属さない分割領域の重みを0とする。また、重みを0としてDFDカーネルから除外した画素分を補完するため、画素領域をDFDカーネルの周囲の近傍領域から選択し、新しいDFDカーネルとして用いる。これにより測距対象画素位置の像と被写体距離差が小さい像が結像する分割領域の画素のみを用い、かつDFDカーネル内の有効画素数を維持した状態でぼけ相関量の平均値を演算することが可能となる。従って、より高精度に測距対象画素の被写体距離を算出することができる。   When calculating the average blur correlation amount at each pixel position in the DFD kernel, the DFD kernel is divided, and the weight of the divided region to which the distance measurement target pixel does not belong is set to zero. Also, in order to complement the pixels excluded from the DFD kernel with a weight of 0, a pixel area is selected from the neighboring areas around the DFD kernel and used as a new DFD kernel. As a result, the average value of the blur correlation amount is calculated using only the pixels in the divided area where the image of the distance measurement target pixel position and the image with a small subject distance difference are formed and maintaining the number of effective pixels in the DFD kernel. It becomes possible. Therefore, the subject distance of the distance measurement target pixel can be calculated with higher accuracy.

さらに、測距対象画素の属する分割領域のDFDカーネル内の配置特性に従って、DFDカーネルとして新たに用いる画素領域を選択するため、適切に新たなDFDカーネルが構成できる。   Furthermore, since a pixel area to be newly used as the DFD kernel is selected according to the arrangement characteristics in the DFD kernel of the divided area to which the distance measurement target pixel belongs, a new DFD kernel can be appropriately configured.

[第四実施形態]
図13と図14を参照して、第四実施形態に係る測距装置又は撮像装置について説明する。
[Fourth embodiment]
With reference to FIGS. 13 and 14, a distance measuring apparatus or an imaging apparatus according to the fourth embodiment will be described.

第四実施形態は、第二実施形態の変形例であり第二実施形態と同様である部分については説明を省略し、主として動作の異なる点についてのみ説明する。   The fourth embodiment is a modification of the second embodiment, and the description of the same parts as those of the second embodiment will be omitted, and only the differences in operation will be mainly described.

第四実施形態は、第二実施形態とDFDカーネルの領域分割手法が異なる。第四実施形態では、DFDカーネルの画素の所定の特徴量を用いて、DFDカーネルの領域分割を行う。所定の特徴量として、画素の輝度、RGB色情報、色の濃度、彩度、明度などが用いることができる。なお、RGB色情報、色の濃度、彩度、明度を、まとめて色情報と呼ぶ。   The fourth embodiment is different from the second embodiment in the area division method of the DFD kernel. In the fourth embodiment, region division of the DFD kernel is performed using a predetermined feature amount of pixels of the DFD kernel. As the predetermined feature amount, pixel brightness, RGB color information, color density, saturation, brightness, and the like can be used. Note that RGB color information, color density, saturation, and brightness are collectively referred to as color information.

以下に、所定の特徴量としてのRGB色情報(特に、肌色情報)を用いた例を説明する。   An example using RGB color information (particularly skin color information) as a predetermined feature amount will be described below.

領域分割部113は、DFDカーネル内の領域を特定色領域と不特定色領域に分割して、画素にラベル(識別記号)を付与する。ここで、特定色領域は、ある特定の色を有する領域を示し、不特定色領域は、特定色領域以外の領域である。属性判定部114は、測距対象画素が特定色領域と不特定色領域のどちらに含まれるかを判定する。なお、特定色領域と不特定色領域を分割領域と総称する。   The area dividing unit 113 divides an area in the DFD kernel into a specific color area and an unspecified color area, and gives a label (identification symbol) to the pixel. Here, the specific color area indicates an area having a specific color, and the non-specific color area is an area other than the specific color area. The attribute determination unit 114 determines whether the distance measurement target pixel is included in a specific color region or an unspecific color region. The specific color area and the nonspecific color area are collectively referred to as a divided area.

有効領域設定部115は、特定色領域と不特定色領域のうちで、測距対象画素を含まない分割領域で重み係数W(u,v)を0に設定し、測距対象画素を含む分割領域の重み係数W(u,v)を1/Nに設定する。ここで、Nは、DFDカーネル内で測距対象画素を含む領域の画素数である。有効領域設定部115は、重み係数W(u,v)が0の領域をDFDカーネルから除外する。これにより、画素相関量演算部106は、測距対象画素を含む領域を構成する画素についてのみ単位画素毎のぼけ相関量G(u,v)の演算を行う。   The effective area setting unit 115 sets a weighting factor W (u, v) to 0 in a divided area that does not include a distance measurement target pixel among the specific color area and the unspecified color area, and includes a distance measurement target pixel. The area weighting factor W (u, v) is set to 1 / N. Here, N is the number of pixels in the area including the distance measurement target pixel in the DFD kernel. The effective area setting unit 115 excludes an area having a weighting factor W (u, v) of 0 from the DFD kernel. Thereby, the pixel correlation amount calculation unit 106 calculates the blur correlation amount G (u, v) for each unit pixel only for the pixels constituting the region including the distance measurement target pixel.

なお、画素を除外せずにDFDカーネルの全ての画素のぼけ相関量を算出してから、重み係数W(u,v)を画素単位のぼけ相関量G(u,v)に掛けて加重平均値を計算してもよい。この場合、測距対象画素を含まない領域の重み係数W(u,v)は0であるため、測距対象画素を含む領域の画素のみを考慮して、加重平均値が計算される。   In addition, after calculating the blur correlation amount of all pixels of the DFD kernel without excluding pixels, the weighted average is obtained by multiplying the weight coefficient W (u, v) by the blur correlation amount G (u, v) in pixel units. A value may be calculated. In this case, since the weight coefficient W (u, v) of the area not including the distance measurement target pixel is 0, the weighted average value is calculated in consideration of only the pixels of the area including the distance measurement target pixel.

DFDカーネル内の有効領域指定の具体例について図13(a)、図13(b)を用いて説明する。図13(a)は、被写体として人と背景を撮像した画像データと、測距対象画素に対応するDFDカーネルの拡大図を示している。測距対象画素の例をkg1、kg2を、またそれらに対応するDFDカーネルをk1、k2とする。また、被写体として撮像される人の顔に相当する肌色領域Sに対応する肌色情報が予め設定されている。   A specific example of specifying an effective area in the DFD kernel will be described with reference to FIGS. 13 (a) and 13 (b). FIG. 13A shows an enlarged view of image data obtained by capturing a person and a background as a subject and a DFD kernel corresponding to a distance measurement target pixel. Examples of distance measurement target pixels are kg1 and kg2, and the corresponding DFD kernels are k1 and k2. Further, skin color information corresponding to the skin color region S corresponding to the face of a person imaged as a subject is preset.

図14を参照して、第四実施形態でのDFDカーネルの有効領域指定(S21、S22)の手順を示すサブルーチンについて説明する。   With reference to FIG. 14, a subroutine showing a procedure for specifying an effective area (S21, S22) of the DFD kernel in the fourth embodiment will be described.

ステップS41において、領域分割部113は、DFDカーネルの各画素の色情報と肌色情報とを比較する。各画素の色情報と肌色情報との差異が所定範囲内であれば、各画素に特定色領域(肌色領域)を示すラベルを付与する。各画素の色情報と肌色情報との差異が所定範囲外であれば、各画素に不特定色領域(非肌色領域)を示すラベルを付与する。   In step S41, the area dividing unit 113 compares the color information of each pixel of the DFD kernel with the skin color information. If the difference between the color information of each pixel and the skin color information is within a predetermined range, a label indicating a specific color region (skin color region) is assigned to each pixel. If the difference between the color information and the skin color information of each pixel is outside the predetermined range, a label indicating an unspecified color region (non-skin color region) is assigned to each pixel.

ステップS42において、属性判定部114は、測距対象画素kgが、特定色領域と不特定色領域のどちらに属するかを、測距対象画素kgの色情報と肌色情報の類似度により判定する。測距対象画素kgの色情報と肌色情報との差異が所定範囲内であれば、測距対象画素kgは特定色領域に属する。図13(a)の例では、測距対象画素Kg1は不特定色領域、測距対象画素kg2は特定色領域に属すると判定される。   In step S42, the attribute determination unit 114 determines whether the distance measurement target pixel kg belongs to the specific color area or the non-specific color area based on the similarity between the color information of the distance measurement pixel kg and the skin color information. If the difference between the color information of the distance measurement target pixel kg and the skin color information is within a predetermined range, the distance measurement target pixel kg belongs to the specific color region. In the example of FIG. 13A, it is determined that the distance measurement target pixel Kg1 belongs to an unspecified color area and the distance measurement target pixel kg2 belongs to a specific color area.

ステップS43において、有効領域設定部115は、測距対象画素kgが属しない分割領域の重み係数を0に設定する。一方、有効領域設定部115は、測距対象画素kgが属する分割領域の画素数がNの場合、この分割領域の重み係数を1/Nに設定する。これにより、測距対象画素が属する分割領域でのぼけ相関量の平均値を演算できる。   In step S43, the effective area setting unit 115 sets the weighting factor of the divided area to which the distance measurement target pixel kg does not belong to zero. On the other hand, when the number of pixels in the divided area to which the distance measurement target pixel kg belongs is N, the effective area setting unit 115 sets the weight coefficient of this divided area to 1 / N. Thereby, the average value of the blur correlation amount in the divided area to which the distance measurement target pixel belongs can be calculated.

測距対象画素Kg1の属する領域の画素数がN1であった場合、DFDカーネルk1に対応する重み係数テーブルは図13(b)のwt1となる。測距対象画素kg2の属する領域の画素数がN2であった場合、DFDカーネルk2に対応する重み係数テーブルは図13(b)のwt2となる。   When the number of pixels in the area to which the distance measurement target pixel Kg1 belongs is N1, the weighting coefficient table corresponding to the DFD kernel k1 is wt1 in FIG. 13B. When the number of pixels in the area to which the distance measurement target pixel kg2 belongs is N2, the weighting coefficient table corresponding to the DFD kernel k2 is wt2 in FIG.

ステップS44において、重み係数が0の画素をDFDカーネルから除外して、画素単位ぼけ相関量を演算する。   In step S44, pixels having a weight coefficient of 0 are excluded from the DFD kernel, and a pixel unit blur correlation amount is calculated.

なお、DFDカーネルの全画素のぼけ相関量を算出してから、重み係数W(u,v)を画素単位のぼけ相関量G(u,v)に掛けて加重平均値を計算してもよい。   Note that after calculating the blur correlation amount of all pixels of the DFD kernel, the weighted average value may be calculated by multiplying the blur coefficient G (u, v) by the weighting factor W (u, v). .

また、重み係数を0以外の値に設定することにより測距対象画素を含まない分割領域を特定してDFDカーネルから除外することもできる。測距対象画素を含む領域と含まない領域の重み係数が異なる値であれば、両領域を特定できるためである。さらに、測距対象画素が属する分割領域での重み係数を前述の正規分布関数を用いて設定することもできる。   In addition, by setting the weighting factor to a value other than 0, it is possible to specify a divided area that does not include a distance measurement target pixel and exclude it from the DFD kernel. This is because both areas can be specified if the weighting coefficients of the area including the distance measurement target pixel and the area not including the distance measurement target pixel are different values. Furthermore, the weighting coefficient in the divided area to which the distance measurement target pixel belongs can be set using the above-described normal distribution function.

なお、所定の特徴量として画素の輝度を用いる場合には、領域分割部113は、DFDカーネルの各画素の輝度と基準の輝度とを比較する。画素の輝度と基準の輝度との差異が所定の閾値以内であれば、その画素が、略特定の輝度を示す特定輝度領域に属する。画素の輝度と基準の輝度との差異が所定の閾値より大きければ、その画素が不特定輝度領域に属するとする。このように、明暗によってもDFDカーネルを分割でき、有効領域設定部115は、測距対象画素が属しない分割領域の重み係数を0に設定する。   Note that when the pixel luminance is used as the predetermined feature amount, the region dividing unit 113 compares the luminance of each pixel of the DFD kernel with the reference luminance. If the difference between the luminance of the pixel and the reference luminance is within a predetermined threshold value, the pixel belongs to a specific luminance region that shows substantially specific luminance. If the difference between the luminance of the pixel and the reference luminance is greater than a predetermined threshold, it is assumed that the pixel belongs to the unspecified luminance area. In this way, the DFD kernel can also be divided by brightness and darkness, and the effective area setting unit 115 sets the weighting factor of the divided area to which the distance measurement target pixel does not belong to 0.

次に、第四実施形態の作用、効果を説明する。   Next, the operation and effect of the fourth embodiment will be described.

DFDカーネル内の各画素位置でのぼけ相関量平均を算出する際に、DFDカーネルを画素の所定の特徴量を用いて分割し、測距対象画素の属する分割領域以外の重みを0とするかDFDカーネルから除外する。このように画素の特徴量のみを使用して、簡便にDFDカーネルを分割できる。さらに、測距対象画素位置の像と被写体距離差が小さい像が結像する分割領域の画素のみを用いてぼけ相関量の平均値を演算することが可能となる。従って、高精度に測距対象画素の被写体距離を算出することができる。   When calculating the average blur correlation amount at each pixel position in the DFD kernel, whether to divide the DFD kernel using a predetermined feature amount of pixels and set the weights other than the divided region to which the distance measurement target pixel belongs to 0 Exclude from DFD kernel. In this way, the DFD kernel can be easily divided using only the pixel feature amount. Furthermore, it is possible to calculate the average value of the blur correlation amount using only the pixels in the divided region where the image of the distance measurement target pixel position and the image with a small subject distance difference are formed. Therefore, the subject distance of the distance measurement target pixel can be calculated with high accuracy.

[その他の実施形態]
上述した各実施形態の説明では、測距装置が行う処理としてハードウェアによる処理を前提としていたが、このような構成に限定される必要はない。例えば、別途ソフトウェアにて処理する構成も可能である。この場合、測距装置は、CPU、RAM等の主記憶装置、上記処理の全て或いは一部を実現させるためのプログラムが記憶されたコンピュータ読み取り可能な記憶媒体を備えている。ここでは、このプログラムを測距プログラムと呼ぶ。そして、CPUが上記記憶媒体に記憶されている測距プログラムを読み出して、情報の加工・演算処理を実行することにより、上述の処理を実現させる。
[Other Embodiments]
In the description of each embodiment described above, hardware processing is assumed as processing performed by the distance measuring device, but the present invention is not limited to such a configuration. For example, a configuration in which processing is performed separately by software is also possible. In this case, the distance measuring device includes a main storage device such as a CPU and a RAM, and a computer-readable storage medium storing a program for realizing all or part of the above processing. Here, this program is called a distance measurement program. Then, the CPU reads out the distance measurement program stored in the storage medium and executes the information processing / calculation processing, thereby realizing the above-described processing.

ここで、コンピュータ読み取り可能な記録媒体とは、磁気ディスク、光磁気ディスク、CD−ROM、DVD−ROM、半導体メモリ等をいう。また、この測距プログラムを通信回線によってコンピュータに配信し、この配信を受けたコンピュータが当該測距プログラムを実行するようにしても良い。   Here, the computer-readable recording medium refers to a magnetic disk, a magneto-optical disk, a CD-ROM, a DVD-ROM, a semiconductor memory, and the like. Alternatively, the distance measurement program may be distributed to a computer via a communication line, and the computer that has received the distribution may execute the distance measurement program.

本発明は上記の実施形態に限定されずに、その技術的な思想の範囲内において種々の変更がなしうることは明白である。   The present invention is not limited to the above-described embodiment, and it is obvious that various modifications can be made within the scope of the technical idea.

第一実施形態に係る測距装置を搭載する撮像装置を示す概略構成図である。It is a schematic block diagram which shows the imaging device carrying the ranging device which concerns on 1st embodiment. 被写体距離Uとぼけ相関量σの関係を示す図である。It is a figure which shows the relationship between subject distance U and blur correlation amount (sigma). (a)重み係数と、ぼけ相関量を算出する画素と測距対象画素との距離の関係を示すグラフである。(b)重み係数と、ぼけ相関量を算出する画素と測距対象画素の輝度差の関係を示すグラフである。(A) It is a graph which shows the relationship between the weight coefficient and the distance of the pixel which calculates a blur correlation amount, and a ranging object pixel. (B) It is a graph which shows the relationship between the weight coefficient and the brightness | luminance difference of the pixel which calculates a blur correlation amount, and a ranging object pixel. 第一実施形態に係る被写体距離の算出手順を示すフローチャートである。It is a flowchart which shows the calculation procedure of the object distance which concerns on 1st embodiment. (a)第一のフォーカスレンズ位置L1を示す図である。(b)第二のフォーカスレンズ位置L2を示す図である。(A) It is a figure which shows the 1st focus lens position L1. (B) It is a figure which shows the 2nd focus lens position L2. 第二実施形態に係る測距装置を搭載する撮像装置を示す概略構成図である。It is a schematic block diagram which shows the imaging device carrying the ranging device which concerns on 2nd embodiment. (a)被写体の画像と、測距対象画素に対応するDFDカーネルの拡大図を示している。(b)第二実施形態に係る重み係数テーブルを示す図である。(A) An enlarged view of a subject image and a DFD kernel corresponding to a distance measurement target pixel is shown. (B) It is a figure which shows the weighting coefficient table which concerns on 2nd embodiment. 第二実施形態に係る被写体距離の算出手順を示すフローチャートである。It is a flowchart which shows the calculation procedure of the object distance which concerns on 2nd embodiment. 第二実施形態に係る有効領域指定の手順を示すフローチャートである。It is a flowchart which shows the procedure of effective area | region designation | designated which concerns on 2nd embodiment. 第三実施形態に係る測距装置を搭載する撮像装置を示す概略構成図である。It is a schematic block diagram which shows the imaging device carrying the ranging device which concerns on 3rd embodiment. 第三実施形態に係る有効領域指定の手順を示すフローチャートである。It is a flowchart which shows the procedure of effective area | region designation | designated which concerns on 3rd embodiment. 第三実施形態に係る重み係数テーブルを示す図である。It is a figure which shows the weighting coefficient table which concerns on 3rd embodiment. (a)第四実施形態に係る被写体の画像と、測距対象画素に対応するDFDカーネルの拡大図を示している。(b)第四実施形態に係る重み係数テーブルを示す図である。(A) An enlarged view of a subject image and a DFD kernel corresponding to a distance measurement target pixel according to the fourth embodiment. (B) It is a figure which shows the weighting coefficient table which concerns on 4th embodiment. 第四実施形態に係る有効領域指定の手順を示すフローチャートである。It is a flowchart which shows the procedure of effective area | region designation | designated which concerns on 4th embodiment.

符号の説明Explanation of symbols

10 光学系
20 光学系制御部
101 撮像素子
102 輝度信号制御部
103 ぼけ相関量演算部
104 バッファ
105 カーネル制御部
106 画素相関量演算部
107 加重制御部
108 加重平均演算部
109 被写体距離決定部
110 LUT記憶部
111 メモリ
301 レンズ群
303 絞り
401 レンズ位置検出部
403 開口径検出部
405 焦点距離検出部
k1、k2 処理対象領域
DESCRIPTION OF SYMBOLS 10 Optical system 20 Optical system control part 101 Image pick-up element 102 Luminance signal control part 103 Blur correlation amount calculation part 104 Buffer 105 Kernel control part 106 Pixel correlation amount calculation part 107 Weight control part 108 Weighted average calculation part 109 Subject distance determination part 110 LUT Storage unit 111 Memory 301 Lens group 303 Aperture 401 Lens position detection unit 403 Aperture diameter detection unit 405 Focal length detection unit
k1, k2 target area

Claims (12)

異なる撮影パラメータで撮影したぼけの異なる複数の画像間において、測距の対象となる測距対象画素を含有する処理対象領域毎に、ぼけの相関量を演算するぼけ相関量演算部と、
前記処理対象領域毎に演算したぼけの相関量から、前記処理対象領域毎に被写体距離を算出する被写体距離決定部と、を有する測距装置であって、
前記ぼけ相関量演算部は、
前記処理対象領域内の画素毎に、画素単位のぼけの相関量を演算する画素相関量演算部と、
前記処理対象領域内の画素毎に、前記画素単位のぼけの相関量の重み係数を設定する加重制御部と、
前記重み係数に基づいて、前記画素単位のぼけの相関量の加重平均を行い、前記加重平均の値を前記処理対象領域のぼけ相関量として演算する加重平均演算部と、を備えることを特徴とする測距装置。
A blur correlation amount calculation unit that calculates a correlation amount of blur for each processing target region including a distance measurement target pixel that is a target of distance measurement between a plurality of images with different blurs shot with different shooting parameters;
A subject distance determining unit that calculates a subject distance for each processing target region from a blur correlation amount calculated for each processing target region;
The blur correlation amount calculation unit
A pixel correlation amount calculation unit that calculates a correlation amount of blur in units of pixels for each pixel in the processing target region;
A weighting control unit that sets a weighting coefficient of the blur correlation amount in units of pixels for each pixel in the processing target region;
A weighted average calculation unit that performs a weighted average of the correlation amount of blur in units of pixels based on the weighting factor, and calculates a value of the weighted average as a blur correlation amount of the processing target region, Ranging device.
前記加重制御部は、前記測距対象画素と前記画素単位のぼけの相関量が演算される画素との画素間距離に応じて、前記重み係数を設定することを特徴とする請求項1に記載の測距装置。   The weighting control unit sets the weighting coefficient according to an inter-pixel distance between the distance measurement target pixel and a pixel for which a blur correlation amount of the pixel unit is calculated. Ranging device. 前記加重制御部は、前記測距対象画素と前記画素単位のぼけの相関量が演算される画素との輝度の差分に応じて、前記重み係数を設定することを特徴とする請求項1に記載の測距装置。   The weighting control unit sets the weighting coefficient according to a difference in luminance between the distance measurement target pixel and a pixel for which a blur correlation amount of the pixel unit is calculated. Ranging device. 前記加重制御部は、
前記処理対象領域を複数の分割領域に分割する領域分割部と、
前記測距対象画素が前記複数の分割領域のいずれに含有されるかを判定する属性判定部と、
前記測距対象画素が属さない分割領域を前記処理対象領域から除外する有効領域設定部と、を備えることを特徴とする請求項1に記載の測距装置。
The weight control unit includes:
An area dividing unit for dividing the processing target area into a plurality of divided areas;
An attribute determination unit that determines which of the plurality of divided regions contains the pixel to be measured;
The distance measuring apparatus according to claim 1, further comprising: an effective area setting unit that excludes a divided area to which the distance measuring target pixel does not belong from the processing target area.
前記加重制御部は、
前記処理対象領域を複数の分割領域に分割する領域分割部と、
前記測距対象画素が前記複数の分割領域のいずれに含有されるかを判定する属性判定部と、
前記測距対象画素が属さない分割領域の画素に対して前記重み係数を0に設定する有効領域設定部と、を備えることを特徴とする請求項1に記載の測距装置。
The weight control unit
A region dividing unit that divides the processing target region into a plurality of divided regions;
An attribute determination unit that determines in which of the plurality of divided regions the pixel to be measured is contained;
The distance measuring apparatus according to claim 1, further comprising: an effective area setting unit that sets the weighting coefficient to 0 for pixels in a divided area to which the distance measurement target pixel does not belong.
前記加重制御部は、前記測距対象画素が属さない分割領域の画素数に基づいて、前記処理対象領域の周囲の画素を組み込むように前記処理対象領域を拡張する領域制御部を備えることを特徴とする請求項4又は5に記載の測距装置。   The weight control unit includes an area control unit that expands the processing target area so as to incorporate pixels around the processing target area based on the number of pixels in the divided area to which the ranging target pixel does not belong. The distance measuring device according to claim 4 or 5. 前記領域制御部は、前記測距対象画素が属する分割領域の前記処理対象領域内での配置に応じて、前記処理対象領域に組み込む画素を選択することを特徴とする請求項6に記載の測距装置。   The measurement according to claim 6, wherein the area control unit selects a pixel to be incorporated into the processing target area according to an arrangement of the divided area to which the ranging target pixel belongs in the processing target area. Distance device. 前記領域分割部は、前記画像内で所定の画素領域の位置座標を決定し、前記所定の画素領域の位置座標に基づいて、前記処理対象領域を前記所定の画素領域とそれ以外の領域に分割することを特徴とする請求項4又は5に記載の測距装置。   The region dividing unit determines position coordinates of a predetermined pixel region in the image, and divides the processing target region into the predetermined pixel region and other regions based on the position coordinates of the predetermined pixel region. 6. The distance measuring device according to claim 4 or 5, wherein: 前記領域分割部は、前記処理対象領域内の画素の輝度情報または色情報に基づいて、前記処理対象領域を分割することを特徴とする請求項4又は5に記載の測距装置。   6. The distance measuring device according to claim 4, wherein the region dividing unit divides the processing target region based on luminance information or color information of pixels in the processing target region. 被写体を結像させる光学系と、
前記光学系により結像した像を電気信号に変換する撮像素子と、
請求項1に記載の測距装置と、を備えることを特徴とする撮像装置。
An optical system for imaging a subject;
An image sensor that converts an image formed by the optical system into an electrical signal;
An imaging apparatus comprising: the distance measuring apparatus according to claim 1.
異なる撮影パラメータで撮影したぼけの異なる複数の画像間において、測距の対象となる測距対象画素を含有する処理対象領域毎に、ぼけの相関量を演算するぼけ相関量演算ステップと、
前記処理対象領域毎に演算したぼけの相関量から、前記処理対象領域毎に被写体距離を算出する被写体距離決定ステップと、を有する測距方法であって、
前記ぼけ相関量演算ステップは、
前記処理対象領域内の画素毎に、画素単位のぼけの相関量を演算する画素相関量演算ステップと、
前記処理対象領域内の画素毎に、前記画素単位のぼけの相関量の重み係数を設定する加重制御ステップと、
前記重み係数に基づいて、前記画素単位のぼけの相関量の加重平均を行い、前記加重平均の値を前記処理対象領域のぼけ相関量として演算する加重平均演算ステップと、を備えることを特徴とする測距方法。
A blur correlation amount calculation step for calculating a blur correlation amount for each processing target region including a distance measurement target pixel to be a distance measurement target between a plurality of images having different blurs shot with different shooting parameters;
A subject distance determination step of calculating a subject distance for each processing target region from a blur correlation amount calculated for each processing target region,
The blur correlation amount calculating step includes:
A pixel correlation amount calculating step for calculating a correlation amount of blur in units of pixels for each pixel in the processing target region;
A weight control step for setting a weighting coefficient of the correlation amount of blur of the pixel unit for each pixel in the processing target region;
A weighted average calculation step of performing a weighted average of the correlation amount of blur of the pixel unit based on the weighting factor, and calculating a value of the weighted average as a blur correlation amount of the processing target region, Ranging method to do.
異なる撮影パラメータで撮影したぼけの異なる複数の画像間において、測距の対象となる測距対象画素を含有する処理対象領域毎に、ぼけの相関量を演算するぼけ相関量演算手順と、
前記処理対象領域毎に演算したぼけの相関量から、前記処理対象領域毎に被写体距離を算出する被写体距離決定手順と、を有する測距プログラムであって、
前記ぼけ相関量演算手順は、
前記処理対象領域内の画素毎に、画素単位のぼけの相関量を演算する画素相関量演算手順と、
前記処理対象領域内の画素毎に、前記画素単位のぼけの相関量の重み係数を設定する加重制御手順と、
前記重み係数に基づいて、前記画素単位のぼけの相関量の加重平均を行い、前記加重平均の値を前記処理対象領域のぼけ相関量として演算する加重平均演算手順と、を備えることを特徴とする測距プログラム。
A blur correlation amount calculation procedure for calculating a correlation amount of blur for each processing target region including a distance measurement target pixel to be a distance measurement target between a plurality of images with different blurs shot with different shooting parameters;
A subject distance determination procedure for calculating a subject distance for each processing target region from a blur correlation amount calculated for each processing target region,
The blur correlation amount calculation procedure is as follows:
For each pixel in the processing target area, a pixel correlation amount calculation procedure for calculating a correlation amount of blur in pixel units,
A weighting control procedure for setting a weighting coefficient of a blur correlation amount in units of pixels for each pixel in the processing target region;
A weighted average calculation step of performing a weighted average of the blur correlation amount of the pixel unit based on the weighting factor and calculating a value of the weighted average as a blur correlation amount of the processing target region. Ranging program to do.
JP2008176751A 2008-07-07 2008-07-07 Ranging device, ranging method, ranging program or imaging device Expired - Fee Related JP4990234B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008176751A JP4990234B2 (en) 2008-07-07 2008-07-07 Ranging device, ranging method, ranging program or imaging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008176751A JP4990234B2 (en) 2008-07-07 2008-07-07 Ranging device, ranging method, ranging program or imaging device

Publications (2)

Publication Number Publication Date
JP2010016743A true JP2010016743A (en) 2010-01-21
JP4990234B2 JP4990234B2 (en) 2012-08-01

Family

ID=41702395

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008176751A Expired - Fee Related JP4990234B2 (en) 2008-07-07 2008-07-07 Ranging device, ranging method, ranging program or imaging device

Country Status (1)

Country Link
JP (1) JP4990234B2 (en)

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102223477A (en) * 2010-04-13 2011-10-19 索尼公司 Four-dimensional polynomial model for depth estimation based on two-picture matching
WO2011158508A1 (en) * 2010-06-17 2011-12-22 パナソニック株式会社 Image processing device and image processing method
WO2011158507A1 (en) * 2010-06-17 2011-12-22 パナソニック株式会社 Image processing device, and image processing method
WO2012056686A1 (en) 2010-10-27 2012-05-03 パナソニック株式会社 3d image interpolation device, 3d imaging device, and 3d image interpolation method
WO2012066774A1 (en) * 2010-11-17 2012-05-24 パナソニック株式会社 Image pickup device and distance measuring method
JP2013062803A (en) * 2011-09-14 2013-04-04 Canon Inc Method for determining distance information, method for determining distance map, computer device, imaging system, and computer program
JP2013242617A (en) * 2012-05-17 2013-12-05 Canon Inc Image processing device, imaging device, distance measurement method, and distance measurement program
JP2013254097A (en) * 2012-06-07 2013-12-19 Canon Inc Image processing apparatus, and method and program for controlling the same
JP2014063142A (en) * 2012-08-31 2014-04-10 Canon Inc Distance detection device, imaging apparatus, program, recording medium, and distance detection method
WO2014104379A1 (en) 2012-12-28 2014-07-03 Canon Kabushiki Kaisha Image capturing apparatus
JP2014145725A (en) * 2013-01-30 2014-08-14 Canon Inc Image processing apparatus and imaging device
EP2858036A1 (en) 2013-10-02 2015-04-08 Canon Kabushiki Kaisha Image processing device, image capturing apparatus, and image processing method for obtaining depth information
JP2015072155A (en) * 2013-10-02 2015-04-16 キヤノン株式会社 Image processor, imaging device and image processing method
JP2015121773A (en) * 2013-11-19 2015-07-02 パナソニックIpマネジメント株式会社 Imaging device
WO2015128908A1 (en) * 2014-02-26 2015-09-03 パナソニックIpマネジメント株式会社 Depth position detection device, image pickup element, and depth position detection method
JP2015170308A (en) * 2014-03-10 2015-09-28 サクサ株式会社 Image processor
JP2016018116A (en) * 2014-07-09 2016-02-01 キヤノン株式会社 Focus adjustment device, focus adjustment method and program, and imaging apparatus
US9299151B2 (en) 2013-08-08 2016-03-29 Canon Kabushiki Kaisha Depth calculation device, imaging apparatus, and depth calculation method
US9338426B2 (en) 2010-10-27 2016-05-10 Panasonic Intellectual Property Management Co., Ltd. Three-dimensional image processing apparatus, three-dimensional imaging apparatus, and three-dimensional image processing method
JP2016090568A (en) * 2014-10-31 2016-05-23 キヤノン株式会社 Distance measurement device, imaging device, and distance measurement method
JP2016218206A (en) * 2015-05-19 2016-12-22 キヤノン株式会社 Imaging device and control method of the same
US9661302B2 (en) 2012-08-27 2017-05-23 Canon Kabushiki Kaisha Depth information acquisition apparatus, imaging apparatus, depth information acquisition method and program
US9928598B2 (en) 2014-10-31 2018-03-27 Canon Kabushiki Kaisha Depth measurement apparatus, imaging apparatus and depth measurement method that calculate depth information of a target pixel using a color plane of which a correlation value is at most a threshold
WO2018163335A1 (en) * 2017-03-08 2018-09-13 マクセル株式会社 Distance measurement device, head-mounted display device, mobile information terminal, image display device, surroundings monitoring system, and distance measurement method
WO2019135313A1 (en) 2018-01-04 2019-07-11 ソニー株式会社 Information processing device, information processing method and program
WO2019155735A1 (en) 2018-02-07 2019-08-15 ソニー株式会社 Information processing device, information processing method, and program
JP2021009978A (en) * 2019-07-03 2021-01-28 株式会社Fuji Assembling machine

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007139892A (en) * 2005-11-15 2007-06-07 Olympus Corp Focusing detection device
JP2007199633A (en) * 2006-01-30 2007-08-09 Olympus Corp Focusing detector

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007139892A (en) * 2005-11-15 2007-06-07 Olympus Corp Focusing detection device
JP2007199633A (en) * 2006-01-30 2007-08-09 Olympus Corp Focusing detector

Cited By (52)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102223477A (en) * 2010-04-13 2011-10-19 索尼公司 Four-dimensional polynomial model for depth estimation based on two-picture matching
JP2011221535A (en) * 2010-04-13 2011-11-04 Sony Corp Four-dimensional polynomial model for depth estimation based on two-picture matching
CN102223477B (en) * 2010-04-13 2014-04-16 索尼公司 Four-dimensional polynomial model for depth estimation based on two-picture matching
JP5841844B2 (en) * 2010-06-17 2016-01-13 ドルビー・インターナショナル・アーベー Image processing apparatus and image processing method
CN102472621A (en) * 2010-06-17 2012-05-23 松下电器产业株式会社 Image processing device, and image processing method
US8773570B2 (en) 2010-06-17 2014-07-08 Panasonic Corporation Image processing apparatus and image processing method
US9134126B2 (en) 2010-06-17 2015-09-15 Dolby International Ab Image processing device, and image processing method
JPWO2011158508A1 (en) * 2010-06-17 2013-08-19 パナソニック株式会社 Image processing apparatus and image processing method
JP5869883B2 (en) * 2010-06-17 2016-02-24 パナソニック株式会社 Image processing device
WO2011158507A1 (en) * 2010-06-17 2011-12-22 パナソニック株式会社 Image processing device, and image processing method
WO2011158508A1 (en) * 2010-06-17 2011-12-22 パナソニック株式会社 Image processing device and image processing method
US8994869B2 (en) 2010-06-17 2015-03-31 Panasonic Corporation Image processing apparatus and image processing method
WO2012056686A1 (en) 2010-10-27 2012-05-03 パナソニック株式会社 3d image interpolation device, 3d imaging device, and 3d image interpolation method
US9270970B2 (en) 2010-10-27 2016-02-23 Dolby International Ab Device apparatus and method for 3D image interpolation based on a degree of similarity between a motion vector and a range motion vector
US9338426B2 (en) 2010-10-27 2016-05-10 Panasonic Intellectual Property Management Co., Ltd. Three-dimensional image processing apparatus, three-dimensional imaging apparatus, and three-dimensional image processing method
WO2012066774A1 (en) * 2010-11-17 2012-05-24 パナソニック株式会社 Image pickup device and distance measuring method
US8698943B2 (en) 2010-11-17 2014-04-15 Panasonic Corporation Imaging apparatus and distance measurement method
JP2013062803A (en) * 2011-09-14 2013-04-04 Canon Inc Method for determining distance information, method for determining distance map, computer device, imaging system, and computer program
JP2013242617A (en) * 2012-05-17 2013-12-05 Canon Inc Image processing device, imaging device, distance measurement method, and distance measurement program
JP2013254097A (en) * 2012-06-07 2013-12-19 Canon Inc Image processing apparatus, and method and program for controlling the same
US9661302B2 (en) 2012-08-27 2017-05-23 Canon Kabushiki Kaisha Depth information acquisition apparatus, imaging apparatus, depth information acquisition method and program
JP2014063142A (en) * 2012-08-31 2014-04-10 Canon Inc Distance detection device, imaging apparatus, program, recording medium, and distance detection method
WO2014104379A1 (en) 2012-12-28 2014-07-03 Canon Kabushiki Kaisha Image capturing apparatus
US9398218B2 (en) 2012-12-28 2016-07-19 Canon Kabushiki Kaisha Image capturing apparatus
JP2014145725A (en) * 2013-01-30 2014-08-14 Canon Inc Image processing apparatus and imaging device
US9846944B2 (en) 2013-08-08 2017-12-19 Canon Kabushiki Kaisha Depth calculation device, imaging apparatus, and depth calculation method
US9299151B2 (en) 2013-08-08 2016-03-29 Canon Kabushiki Kaisha Depth calculation device, imaging apparatus, and depth calculation method
CN104519328A (en) * 2013-10-02 2015-04-15 佳能株式会社 Image processing device, image capturing apparatus, and image processing method
EP2858036A1 (en) 2013-10-02 2015-04-08 Canon Kabushiki Kaisha Image processing device, image capturing apparatus, and image processing method for obtaining depth information
JP2015072155A (en) * 2013-10-02 2015-04-16 キヤノン株式会社 Image processor, imaging device and image processing method
EP3327667A1 (en) 2013-10-02 2018-05-30 Canon Kabushiki Kaisha Image processing device, image capturing apparatus, and image processing method for obatining depth information
US9264606B2 (en) 2013-10-02 2016-02-16 Canon Kabushiki Kaisha Processing device, image pickup device and processing method
JP2015072324A (en) * 2013-10-02 2015-04-16 キヤノン株式会社 Image processor, imaging device and image processing method
US9581436B2 (en) 2013-10-02 2017-02-28 Canon Kabushiki Kaisha Image processing device, image capturing apparatus, and image processing method
JP2015121773A (en) * 2013-11-19 2015-07-02 パナソニックIpマネジメント株式会社 Imaging device
US9836847B2 (en) 2014-02-26 2017-12-05 Panasonic Intellectual Property Management Co., Ltd. Depth estimation apparatus, imaging device, and depth estimation method
JPWO2015128908A1 (en) * 2014-02-26 2017-03-30 パナソニックIpマネジメント株式会社 Depth position detection device, imaging device, and depth position detection method
WO2015128908A1 (en) * 2014-02-26 2015-09-03 パナソニックIpマネジメント株式会社 Depth position detection device, image pickup element, and depth position detection method
JP2015170308A (en) * 2014-03-10 2015-09-28 サクサ株式会社 Image processor
JP2016018116A (en) * 2014-07-09 2016-02-01 キヤノン株式会社 Focus adjustment device, focus adjustment method and program, and imaging apparatus
US9928598B2 (en) 2014-10-31 2018-03-27 Canon Kabushiki Kaisha Depth measurement apparatus, imaging apparatus and depth measurement method that calculate depth information of a target pixel using a color plane of which a correlation value is at most a threshold
JP2016090568A (en) * 2014-10-31 2016-05-23 キヤノン株式会社 Distance measurement device, imaging device, and distance measurement method
JP2016218206A (en) * 2015-05-19 2016-12-22 キヤノン株式会社 Imaging device and control method of the same
WO2018163335A1 (en) * 2017-03-08 2018-09-13 マクセル株式会社 Distance measurement device, head-mounted display device, mobile information terminal, image display device, surroundings monitoring system, and distance measurement method
CN110392818A (en) * 2017-03-08 2019-10-29 麦克赛尔株式会社 Distance-measuring device, head-mounted display device, portable information terminal, image display, surroundings monitoring system and distance measurement method
JPWO2018163335A1 (en) * 2017-03-08 2019-11-21 マクセル株式会社 Distance measuring device, head mounted display device, portable information terminal, video display device, periphery monitoring system, and distance measuring method
CN110392818B (en) * 2017-03-08 2021-11-09 麦克赛尔株式会社 Distance measuring device, head-mounted display device, portable information terminal, image display device, and periphery monitoring system
US11422372B2 (en) 2017-03-08 2022-08-23 Maxell, Ltd. Distance measurement device, head-mounted display device, mobile information terminal, image display device, surroundings monitoring system, and distance measurement method
WO2019135313A1 (en) 2018-01-04 2019-07-11 ソニー株式会社 Information processing device, information processing method and program
WO2019155735A1 (en) 2018-02-07 2019-08-15 ソニー株式会社 Information processing device, information processing method, and program
JP2021009978A (en) * 2019-07-03 2021-01-28 株式会社Fuji Assembling machine
JP7313211B2 (en) 2019-07-03 2023-07-24 株式会社Fuji Assembly machine

Also Published As

Publication number Publication date
JP4990234B2 (en) 2012-08-01

Similar Documents

Publication Publication Date Title
JP4990234B2 (en) Ranging device, ranging method, ranging program or imaging device
US10997696B2 (en) Image processing method, apparatus and device
JP5398156B2 (en) WHITE BALANCE CONTROL DEVICE, ITS CONTROL METHOD, AND IMAGING DEVICE
JP5932476B2 (en) Image processing apparatus, imaging apparatus, distance measuring method, and distance measuring program
JP5374119B2 (en) Distance information acquisition device, imaging device, and program
US9992478B2 (en) Image processing apparatus, image pickup apparatus, image processing method, and non-transitory computer-readable storage medium for synthesizing images
CN109255810B (en) Image processing apparatus and image processing method
JP7285791B2 (en) Image processing device, output information control method, and program
JP6531542B2 (en) IMAGE PROCESSING SYSTEM, IMAGE PROCESSING DEVICE, IMAGING DEVICE, IMAGE PROCESSING METHOD, PROGRAM, AND RECORDING MEDIUM
US20190355101A1 (en) Image refocusing
TWI626500B (en) Image capturing apparatus, lens unit, and signal processing apparatus
JP2021505086A (en) Image processing methods and image processing equipment, computer-readable storage media and computer equipment
JP2018195079A (en) Image processing apparatus and image processing method
CN111246092A (en) Image processing method, image processing device, storage medium and electronic equipment
JP6320053B2 (en) Image processing apparatus, image processing method, and computer program
JP6604908B2 (en) Image processing apparatus, control method thereof, and control program
KR20170101532A (en) Method for image fusion, Computer program for the same, and Recording medium storing computer program for the same
JP2004133919A (en) Device and method for generating pseudo three-dimensional image, and program and recording medium therefor
JP2023033355A (en) Image processing device and control method therefor
WO2020084894A1 (en) Multi-camera system, control value calculation method and control device
WO2016067507A1 (en) Image processing apparatus, monitoring camera system, image processing method and program
JP6554009B2 (en) IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, PROGRAM, AND RECORDING MEDIUM
CN114762313B (en) Image processing method, device, storage medium and electronic equipment
JP6386843B2 (en) Image processing apparatus, image processing method, program, and storage medium
CN114500870B (en) Image processing method and device and electronic equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110602

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120404

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

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

R151 Written notification of patent or utility model registration

Ref document number: 4990234

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20150511

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees