JP2024058870A - Distance measuring device, imaging apparatus, and control method and program for distance measuring device - Google Patents

Distance measuring device, imaging apparatus, and control method and program for distance measuring device Download PDF

Info

Publication number
JP2024058870A
JP2024058870A JP2022166251A JP2022166251A JP2024058870A JP 2024058870 A JP2024058870 A JP 2024058870A JP 2022166251 A JP2022166251 A JP 2022166251A JP 2022166251 A JP2022166251 A JP 2022166251A JP 2024058870 A JP2024058870 A JP 2024058870A
Authority
JP
Japan
Prior art keywords
distance
subject
focus
image
measurement device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2022166251A
Other languages
Japanese (ja)
Inventor
聖雄 池本
Masao Ikemoto
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2022166251A priority Critical patent/JP2024058870A/en
Publication of JP2024058870A publication Critical patent/JP2024058870A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a distance measuring device, an imaging apparatus, and a control method and program for the distance measuring device that enable highly accurate distance measurement over the entire screen of a distance image.
SOLUTION: A distance measuring device 100 includes a distance calculation unit 17 for calculating a distance 38 from an imaging optical system 10 to a subject 101 at a first position of a photographing screen 500 as a subject distance and a focus adjustment unit 12 for adjusting a focus distance by calculating an adjustment amount 40 of the focus distance, which is the distances 30, 31 from the imaging optical system 10 to condensing points 36, 37, by using the subject distance, and changing the distances 30, 31 by the adjustment amount 40. The distance calculation unit 17 generates a distance image of the subject 101 on the basis of a parallax image acquired by the imaging optical system 10 after the focus distance has been adjusted. The focus adjustment unit 12 calculates the adjustment amount 40 so that the difference between the focus distance and the subject distance at a second position of the photographing screen 500 is smaller than the difference between the focus distance and the subject distance at the first position.
SELECTED DRAWING: Figure 3
COPYRIGHT: (C)2024,JPO&INPIT

Description

本発明は、距離計測装置、撮像装置、距離計測装置の制御方法およびプログラムに関する。 The present invention relates to a distance measurement device, an imaging device, and a control method and program for a distance measurement device.

従来から、デジタルスチルカメラやビデオカメラによる距離計測技術が知られている。特許文献1には、撮像素子の一部の画素に測距機能を持たせ、位相差方式で検出するようにした固体撮像素子に関する技術が記載されている。特許文献1に記載の技術は、レンズの瞳上の異なる領域を通過した光束により生成される2つの像を、それぞれ異なる受光部で取得する。両画像から視差を算出し、三角測量の原理に基づいてデフォーカス量を求め、距離を求めることができる。画面上の異なる位置毎に距離を算出することで距離画像を生成することができる。また、各画素の受光部で取得した信号は、撮影画像を生成するための画像信号として用いることができるので、撮影と同時に測距が可能となる。 Distance measurement techniques using digital still cameras and video cameras have been known for some time. Patent Document 1 describes a technology related to a solid-state imaging element in which some of the pixels of the imaging element are provided with a distance measurement function and detection is performed using a phase difference method. The technology described in Patent Document 1 captures two images generated by light beams passing through different areas on the pupil of the lens, each captured by a different light receiving section. The parallax is calculated from both images, and the amount of defocus is found based on the principle of triangulation, making it possible to find the distance. A distance image can be generated by calculating the distance for each different position on the screen. In addition, the signal acquired by the light receiving section of each pixel can be used as an image signal for generating the captured image, making it possible to measure the distance simultaneously with shooting.

特許第5212396号公報Japanese Patent No. 5212396

ところで、ユーザがデジタルスチルカメラやビデオカメラによって、略平面で表面に凹凸があるような物体の距離計測を行う場合、計測したい領域が画面内に入るように構図を定め、前記領域で合焦するようにフォーカスを調整し、撮影を行う。カメラは、撮影画面の各位置における距離を算出することで、距離画像を生成する。このとき、ユーザが画面中央に最も計測したい領域を定め、画面中央で合焦させると、画面周辺では、像面湾曲によってデフォーカスするため、画像のコントラストが下がり、視差演算の精度が低下する。更に、画面周辺では、画素に入射する光の角度範囲が画面中央とは大きく異なるため、画面中央よりも基線長が短くなる。これらの影響により画面中央と比べて、画面周辺では測距性能が大幅に劣化するという問題があった。 When a user uses a digital still camera or video camera to measure the distance to an object that is approximately flat and has an uneven surface, the user composes the image so that the area to be measured is within the screen, adjusts the focus so that the area is in focus, and then takes the image. The camera generates a distance image by calculating the distance at each position on the shooting screen. In this case, if the user determines that the area they most want to measure is in the center of the screen and focuses on the center of the screen, the image contrast at the periphery of the screen will decrease due to defocusing caused by field curvature, and the accuracy of parallax calculation will decrease. Furthermore, the angular range of light incident on the pixels at the periphery of the screen is significantly different from that at the center of the screen, so the baseline length is shorter than at the center of the screen. These effects cause a problem of significant degradation of distance measurement performance at the periphery of the screen compared to the center of the screen.

本発明は、上記の課題に鑑みてなされたものである。本発明は、距離画像の画面全体で高精度な測距を行うことができる距離計測装置、撮像装置、距離計測装置の制御方法およびプログラムを提供することを目的とする。 The present invention has been made in consideration of the above problems. The present invention aims to provide a distance measurement device, an imaging device, and a control method and program for a distance measurement device that can perform highly accurate distance measurement over the entire screen of a distance image.

上記目的を達成するために、本発明距離計測装置は、結像光学系によって被写体が撮影された撮影画面の第1位置において、前記結像光学系の光軸方向における前記結像光学系から前記被写体までの距離を被写体距離として算出する第1算出手段と、前記光軸方向における前記結像光学系から前記結像光学系の集光点までの距離であるピント距離の調整量を前記被写体距離を用いて算出する第2算出手段と、前記ピント距離を前記調整量だけ変化させることによって、前記ピント距離の調整を行うピント調整手段と、前記ピント距離の調整後の前記結像光学系によって取得された視差画像に基づいて、前記被写体の距離画像を生成する生成手段と、を備え、前記第2算出手段は、前記撮影画面の第2位置における前記ピント距離と前記被写体距離の差が、前記第1位置における前記ピント距離と前記被写体距離の差よりも小さくなるように、前記調整量を算出することを特徴とする。 In order to achieve the above object, the distance measurement device of the present invention includes a first calculation means for calculating the distance from the imaging optical system to the subject in the optical axis direction of the imaging optical system as the subject distance at a first position on the shooting screen where the subject is photographed by the imaging optical system, a second calculation means for calculating an adjustment amount of the focus distance, which is the distance from the imaging optical system to the focal point of the imaging optical system in the optical axis direction, using the subject distance, a focus adjustment means for adjusting the focus distance by changing the focus distance by the adjustment amount, and a generation means for generating a distance image of the subject based on a parallax image acquired by the imaging optical system after the focus distance adjustment, and the second calculation means calculates the adjustment amount so that the difference between the focus distance and the subject distance at the second position on the shooting screen is smaller than the difference between the focus distance and the subject distance at the first position.

本発明によれば、距離画像の画面全体で高精度な測距を行うことができる。 The present invention makes it possible to perform highly accurate distance measurements across the entire range image screen.

距離計測装置の一例を示す模式図である。FIG. 1 is a schematic diagram illustrating an example of a distance measurement device. 撮影および距離計測の処理の流れなどの一例を説明する図である。FIG. 2 is a diagram illustrating an example of a processing flow of photographing and distance measurement. 結像光学系によって撮像素子に結像する光線を表す図である。FIG. 2 is a diagram illustrating light rays that are imaged on an image sensor by an imaging optical system. 受光部の入射角感度特性と光線の角度範囲を示す図である。4 is a diagram showing the incident angle sensitivity characteristics of the light receiving unit and the angle range of light rays. FIG. 撮影および距離計測の処理の流れなどの一例を説明する図である。FIG. 2 is a diagram illustrating an example of a processing flow of photographing and distance measurement. 被写体の形状とピント面の関係を示す図である。FIG. 2 is a diagram showing the relationship between the shape of a subject and a focal plane. 撮影および距離計測の処理の流れの一例を説明する図である。FIG. 4 is a diagram illustrating an example of a processing flow of photographing and distance measurement. 距離計測装置の一例を示す模式図である。FIG. 1 is a schematic diagram illustrating an example of a distance measurement device.

以下、本発明の実施形態について図面を参照しながら詳細に説明する。ただし、以下の本実施形態に記載されている構成はあくまで例示に過ぎず、本発明の範囲は本実施形態に記載されている構成によって限定されることはない。例えば、本発明を構成する各部は、同様の機能を発揮し得る任意の構成のものと置換することができる。また、任意の構成物が付加されていてもよい。また、本実施形態のうちの、任意の2以上の構成(特徴)を組み合わせることもできる。以下、図1~図8を参照して、本実施形態について説明する。 The following describes an embodiment of the present invention in detail with reference to the drawings. However, the configurations described in the following embodiments are merely examples, and the scope of the present invention is not limited by the configurations described in the present embodiments. For example, each part constituting the present invention can be replaced with any configuration that can perform a similar function. In addition, any component may be added. In addition, any two or more configurations (features) of the present embodiments can be combined. The following describes the present embodiment with reference to Figures 1 to 8.

(装置構成)
図1は、本実施形態に係る距離計測装置100の一例を示す模式図である。図1(a)に示すように、距離計測装置100は、結像光学系10、撮像素子11、ピント調整部12、信号処理部13、記憶部14、入力部15、表示部16、および各部位間で信号を伝送するための配線を有している。信号処理部13は、距離演算部17および画像処理部18を有している。結像光学系10は、1枚または複数のレンズから構成され、被写体101の像を撮像素子11上に結像させる光学系である。19は、結像光学系10の光軸を表している。図1(b)は、撮像素子11の一部を示す図である。撮像素子11は、CCDやCMOSなどのイメージセンサを有する撮像素子である。撮像素子11は、カラーフィルタを有する撮像素子でもよいし、モノクロの撮像素子でもよいし、三板式の撮像素子でもよい。撮像素子11は、測距機能を有する画素20を有している。なお、本実施形態における画素20とは、撮影画像を構成する最小単位の要素として定義している。
(Device configuration)
FIG. 1 is a schematic diagram showing an example of a distance measurement device 100 according to the present embodiment. As shown in FIG. 1A, the distance measurement device 100 includes an imaging optical system 10, an image sensor 11, a focus adjustment unit 12, a signal processing unit 13, a storage unit 14, an input unit 15, a display unit 16, and wiring for transmitting signals between each unit. The signal processing unit 13 includes a distance calculation unit 17 and an image processing unit 18. The imaging optical system 10 is an optical system that includes one or more lenses and forms an image of a subject 101 on the image sensor 11. 19 represents the optical axis of the imaging optical system 10. FIG. 1B is a diagram showing a part of the image sensor 11. The image sensor 11 is an image sensor having an image sensor such as a CCD or a CMOS. The image sensor 11 may be an image sensor having a color filter, a monochrome image sensor, or a three-plate image sensor. The image sensor 11 includes pixels 20 having a distance measurement function. In this embodiment, the pixel 20 is defined as a minimum unit element that constitutes a captured image.

図1(c)は、画素20を示す図である。画素20は、受光部21、22および瞳分割手段24を有している。更に、各画素20は、図示しないカラーフィルタを有している。受光部21と受光部22は、画素20の中心を基準に、瞳分割方向(x方向)に互いに対称な構造となっている。基板23は、撮像する波長帯域で吸収を有する材料、例えばSiであり、イオン打ち込みなどで、内部の少なくとも一部の領域に受光部21,22を形成する。結像光学系10によって各受光部21、22に到達した光束は、電気信号に変換され、図示しない信号処理回路より出力される。瞳分割手段24は、結像光学系10の射出瞳の一部の領域からの光束を受光部21に導き、他の一部の領域からの光束を受光部22に導くように構成している。受光部21および受光部22により、異なる瞳領域を通過した光束による測距像が取得される。 1(c) is a diagram showing a pixel 20. The pixel 20 has light receiving sections 21 and 22 and a pupil division means 24. Furthermore, each pixel 20 has a color filter (not shown). The light receiving sections 21 and 22 are symmetrical with respect to each other in the pupil division direction (x direction) with respect to the center of the pixel 20. The substrate 23 is made of a material that has absorption in the wavelength band to be imaged, such as Si, and the light receiving sections 21 and 22 are formed in at least a part of the interior region by ion implantation or the like. The light beams that reach each of the light receiving sections 21 and 22 by the imaging optical system 10 are converted into electrical signals and output by a signal processing circuit (not shown). The pupil division means 24 is configured to guide the light beam from a part of the region of the exit pupil of the imaging optical system 10 to the light receiving section 21, and guide the light beam from another part of the region to the light receiving section 22. The light receiving sections 21 and 22 obtain distance measurement images by the light beams that have passed through different pupil regions.

図1(a)に戻る。ピント調整部12は、被写体101からの光が結像光学系10を介して撮像素子11上で結像するように調整する機能を有している。例えば、ピント調整部12は、結像光学系10の一部のレンズを光軸方向(z方向)に動かすことで調整することができる。あるいは、ピント調整部12は、結像光学系10と撮像素子11との間の距離を変えることで調整してもよい。ピント調整部12は、後述する方法で調整量を算出し、ピント距離の調整を行う。 Returning to FIG. 1(a), the focus adjustment unit 12 has a function of adjusting the light from the subject 101 so that it forms an image on the image sensor 11 via the imaging optical system 10. For example, the focus adjustment unit 12 can perform adjustment by moving a part of the lens of the imaging optical system 10 in the optical axis direction (z direction). Alternatively, the focus adjustment unit 12 may perform adjustment by changing the distance between the imaging optical system 10 and the image sensor 11. The focus adjustment unit 12 calculates the amount of adjustment using a method described below, and adjusts the focus distance.

距離演算部17は、受光部21および受光部22で取得した画像に基づいて、公知の方法により、距離画像を生成する。距離演算部17は、受光部21で取得した画像と受光部22で取得した画像の視差を算出し、結像光学系10の光学情報を用いて距離情報に変換する。距離演算部17は、撮影画面上の位置毎に距離を計算することで距離画像を生成することができる。以下、受光部21で取得した画像と受光部22で取得した画像を「視差画像」という。 The distance calculation unit 17 generates a distance image by a known method based on the images acquired by the light receiving unit 21 and the light receiving unit 22. The distance calculation unit 17 calculates the parallax between the image acquired by the light receiving unit 21 and the image acquired by the light receiving unit 22, and converts it into distance information using optical information from the imaging optical system 10. The distance calculation unit 17 can generate a distance image by calculating the distance for each position on the shooting screen. Hereinafter, the image acquired by the light receiving unit 21 and the image acquired by the light receiving unit 22 are referred to as "parallax images."

画像処理部18は、撮像素子11から出力されるアナログ信号のAD変換やノイズ除去、デモザイキング、輝度信号変換、収差補正、ホワイトバランス調整、色補正などの各種信号処理を行う機能を有している。画像処理部18は、受光部21および受光部22で取得した信号を用いて、各画素20の画素値を生成し、被写体101の撮影画像を生成することができる。画像処理部18は、撮影画像を、各画素20において受光部21、22の双方で取得した信号を加算することで生成する。あるいは、画像処理部18は、各画素20において、受光部21、22の双方で取得した信号を所定の割合で加算することで撮影画像を生成してもよいし、受光部21、22の一方で取得した信号のみを用いて撮影画像を生成してもよい。 The image processing unit 18 has a function of performing various signal processing such as AD conversion of the analog signal output from the image sensor 11, noise removal, demosaicing, luminance signal conversion, aberration correction, white balance adjustment, and color correction. The image processing unit 18 can generate pixel values of each pixel 20 using signals acquired by the light receiving unit 21 and the light receiving unit 22, and generate a captured image of the subject 101. The image processing unit 18 generates the captured image by adding the signals acquired by both the light receiving units 21 and 22 at each pixel 20. Alternatively, the image processing unit 18 may generate the captured image by adding the signals acquired by both the light receiving units 21 and 22 at a predetermined ratio at each pixel 20, or may generate the captured image using only the signal acquired by one of the light receiving units 21 and 22.

記憶部14は、撮影画像のデータ、距離画像のデータ、その他中間データなど、距離計測装置100で利用されるパラメータデータなどが格納される不揮発性の記憶媒体である。記憶部14としては、高速に読み書きでき、且つ、大容量の記憶媒体であれば、どのようなものを利用してもよい。記憶部14には、例えば、フラッシュメモリなどが好ましい。入力部15は、ユーザが操作し、距離計測装置100に対して情報入力や設定変更を行うためのインターフェイスである。入力部15には、例えばダイヤル、ボタン、スイッチ、タッチパネルなどを利用することができる。表示部16は、タッチパネル機能を有する液晶ディスプレイや有機ELディスプレイなどで構成される。表示部16は、撮影時の構図確認、撮影・記憶した画像の閲覧、各種設定画面やメッセージ情報の表示などに利用される。なお、距離計測装置100は、不図示の制御部を有する。その制御部は、CPU、ROM、およびRAMなどで構成され、距離計測装置100の動作を制御する。具体的には、CPUは、ROMに記憶されたプログラムをRAMの作業領域に展開して順次実行することで、距離計測装置100の各部を制御する。 The storage unit 14 is a non-volatile storage medium in which parameter data used in the distance measurement device 100, such as captured image data, distance image data, and other intermediate data, is stored. Any storage medium that can be read and written at high speed and has a large capacity may be used as the storage unit 14. For example, a flash memory is preferable for the storage unit 14. The input unit 15 is an interface operated by the user to input information and change settings to the distance measurement device 100. For example, a dial, a button, a switch, a touch panel, etc. can be used for the input unit 15. The display unit 16 is composed of a liquid crystal display or an organic EL display with a touch panel function. The display unit 16 is used for checking the composition when shooting, viewing images that have been shot and stored, displaying various setting screens and message information, etc. The distance measurement device 100 has a control unit (not shown). The control unit is composed of a CPU, a ROM, a RAM, etc., and controls the operation of the distance measurement device 100. Specifically, the CPU controls each part of the distance measurement device 100 by expanding the programs stored in the ROM into the working area of the RAM and executing them sequentially.

(撮影・処理フロー)
図2および図3を用いて、本実施形態の撮影および距離計測の処理の流れの一例を説明する。図2(a)は、撮影および距離計測の処理の流れを示すフローチャートである。図2(a)の処理(距離計測装置の制御方法)は、不図示の制御部において、CPU(コンピュータ)がROMに記憶されたプログラムをRAMに展開して実行し、距離計測装置100の各部を制御することで実現される。
(Photography and processing flow)
An example of the flow of the photographing and distance measurement process of this embodiment will be described with reference to Figures 2 and 3. Figure 2(a) is a flowchart showing the flow of the photographing and distance measurement process. The process of Figure 2(a) (control method of the distance measurement device) is realized by a CPU (computer) in a control unit (not shown) expanding a program stored in a ROM into a RAM, executing the program, and controlling each unit of the distance measurement device 100.

図3は、結像光学系10によって撮像素子11に結像する光線を表す図である。実線の32は、画面中央の光線を表している。破線の33、34は、画面周辺の光線を表している。以下、各像高における結像光学系10から被写体101側の集光点36、37までの光軸方向(z方向)の距離30、31を、ピント距離と呼ぶ。本実施形態において、ピント距離は、結像光学系10のレンズの主点からの距離と定義しているが、結像光学系10側の基準は、センサ位置あるいはレンズ先端の位置など任意の位置としてもよい。この点は、結像光学系10から被写体101までの光軸方向(z方向)の距離38についても、同様である。また、被写体101側の集光点36、37をつないで形成される面を、ピント面35と呼ぶ。なお、被写体101は、平面形状である。また、被写体101のテクスチャは、画面全体で略同じである。 3 is a diagram showing light rays that are imaged on the image sensor 11 by the imaging optical system 10. The solid line 32 represents light rays at the center of the screen. The dashed lines 33 and 34 represent light rays at the periphery of the screen. Hereinafter, the distances 30 and 31 in the optical axis direction (z direction) from the imaging optical system 10 to the light condensing points 36 and 37 on the subject 101 side at each image height are called the focal distance. In this embodiment, the focal distance is defined as the distance from the principal point of the lens of the imaging optical system 10, but the reference on the imaging optical system 10 side may be any position such as the sensor position or the position of the lens tip. This point is also the same for the distance 38 in the optical axis direction (z direction) from the imaging optical system 10 to the subject 101. The surface formed by connecting the light condensing points 36 and 37 on the subject 101 side is called the focal plane 35. The subject 101 has a planar shape. The texture of the subject 101 is approximately the same throughout the screen.

図2(a)に戻る。図2(a)のフローチャートでは、ステップS21において、距離計測装置100の制御部は、撮影画面内での距離38を算出する位置(第1位置)を決定する。距離38を算出する位置は、撮影画面の中央付近になるように決定される。例えば、図2(b)に示すように、ユーザは、結像光学系10の撮影範囲の中央付近に最も計測したい被写体領域が入るように被写体101または結像光学系10の位置を調整する。更に、ユーザは、表示部16(指定手段)で表示されたライブビュー画面160上で中央付近の領域を指定する(画面に触れる)。これにより、距離38を算出する位置が、撮影画面の中央付近になるように決定される。あるいは、図2(c)に示すように、ユーザは、ファインダー画面161上に設定した検出枠162が被写体101上の計測したい位置になるように結像光学系10または被写体101を移動させる。更に、ユーザは、不図示のシャッターボタンを半押しあるいは全押しする。これにより、距離38を算出する位置が、撮影画面の中央付近になるように決定されてもよい。これらのようにして、ユーザは、自らの操作によって、最も計測したい位置を結像光学系10の撮影範囲の中央付近に決定することができる。 Return to FIG. 2(a). In the flowchart of FIG. 2(a), in step S21, the control unit of the distance measurement device 100 determines the position (first position) in the shooting screen where the distance 38 is calculated. The position where the distance 38 is calculated is determined to be near the center of the shooting screen. For example, as shown in FIG. 2(b), the user adjusts the position of the subject 101 or the imaging optical system 10 so that the subject area that is most desired to be measured is near the center of the shooting range of the imaging optical system 10. Furthermore, the user specifies an area near the center on the live view screen 160 displayed on the display unit 16 (designation means) (touches the screen). As a result, the position where the distance 38 is calculated is determined to be near the center of the shooting screen. Alternatively, as shown in FIG. 2(c), the user moves the imaging optical system 10 or the subject 101 so that the detection frame 162 set on the finder screen 161 is at the position on the subject 101 where the measurement is desired. Furthermore, the user half-presses or fully presses the shutter button (not shown). As a result, the position where the distance 38 is calculated may be determined to be near the center of the shooting screen. In this way, the user can determine, by their own operation, that the position they most want to measure is near the center of the imaging range of the imaging optical system 10.

ステップS22において、距離計測装置100の制御部は、ステップS21で決定した位置における結像光学系10から被写体101までの光軸方向(z方向)の距離38を、被写体距離として算出する(第1算出工程)。この処理では、撮像素子11で取得される視差画像の前記位置における画像信号を基に、公知の手法を用いた視差演算が行われることによって、被写体距離が算出される。このような被写体距離の算出は、距離演算部17(第1算出手段)にて行うことができる。距離演算部17は、前記位置のみについて、画像信号を取得し、距離演算を行う。そのため、距離演算部17は、被写体距離を高速に算出することができる。 In step S22, the control unit of the distance measurement device 100 calculates the distance 38 in the optical axis direction (z direction) from the imaging optical system 10 to the subject 101 at the position determined in step S21 as the subject distance (first calculation step). In this process, the subject distance is calculated by performing a parallax calculation using a known method based on the image signal at the position of the parallax image acquired by the image sensor 11. Such calculation of the subject distance can be performed by the distance calculation unit 17 (first calculation means). The distance calculation unit 17 acquires the image signal only for the position and performs distance calculation. Therefore, the distance calculation unit 17 can calculate the subject distance quickly.

ステップS23において、距離計測装置100の制御部は、被写体距離(被写体距離情報)と画面上の位置情報とを用いてピント距離の調整量を算出する(第2算出工程)。ピント距離の調整量の算出は、ピント調整部12(第2算出手段)にて行うことができる。ピント調整部12は、事前に被写体距離に応じた各像高のピント距離の情報(ピント面情報)を保持しておく。次に、ピント調整部12は、画面上の位置情報と被写体距離情報を、事前に保持していたピント面情報と照合することで、撮影画面の周辺(以下、「画面周辺」という)におけるピント距離を算出する。そして、ピント調整部12は、画面周辺(第2位置)におけるピント距離と被写体距離の差が、前記位置における、つまり撮影画面の中央付近(以下、「画面中央」という)におけるピント距離と被写体距離の差よりも小さくなるピント距離の調整量を算出する。 In step S23, the control unit of the distance measurement device 100 calculates the adjustment amount of the focus distance using the subject distance (subject distance information) and the position information on the screen (second calculation step). The calculation of the adjustment amount of the focus distance can be performed by the focus adjustment unit 12 (second calculation means). The focus adjustment unit 12 holds information of the focus distance (focus plane information) for each image height according to the subject distance in advance. Next, the focus adjustment unit 12 calculates the focus distance in the periphery of the shooting screen (hereinafter referred to as the "screen periphery") by comparing the position information on the screen and the subject distance information with the focus plane information held in advance. Then, the focus adjustment unit 12 calculates the adjustment amount of the focus distance such that the difference between the focus distance and the subject distance in the periphery of the screen (second position) is smaller than the difference between the focus distance and the subject distance in the position, that is, near the center of the shooting screen (hereinafter referred to as the "screen center").

ステップS24において、距離計測装置100の制御部は、ステップS23で算出した調整量だけピント距離が変わるように調整を行う(ピント調整工程)。ピント距離の調整は、ピント調整部12(ピント調整手段)によって、上述方法で行うことができる。図3(b)は、ピント距離の調整後の光線の一例を表した図である。図3(b)において、39はピント距離の調整後のピント面を表し、40はステップS23で算出した調整量を表している。ピント調整部12は、ピント距離の調整によって、ピント面35を調整量40だけ被写体101側へシフトさせることで、画面周辺におけるピント距離と被写体距離の差を、画面中央におけるピント距離と被写体距離の差よりも小さくする。なお、図3(b)では、画面周辺におけるピント距離と被写体距離の差は0である。 In step S24, the control unit of the distance measurement device 100 adjusts the focal distance so that it changes by the adjustment amount calculated in step S23 (focus adjustment process). The focal distance can be adjusted by the focus adjustment unit 12 (focus adjustment means) in the above-mentioned manner. FIG. 3B is a diagram showing an example of a light beam after the focal distance is adjusted. In FIG. 3B, 39 represents the focal plane after the focal distance is adjusted, and 40 represents the adjustment amount calculated in step S23. The focus adjustment unit 12 adjusts the focal distance to shift the focal plane 35 by the adjustment amount 40 toward the subject 101, thereby making the difference between the focal distance and the subject distance at the periphery of the screen smaller than the difference between the focal distance and the subject distance at the center of the screen. In FIG. 3B, the difference between the focal distance and the subject distance at the periphery of the screen is 0.

ステップS25において、距離計測装置100の制御部は、撮影を行い、撮像素子11より視差画像を取得する。なお、撮影は、入力部15におけるユーザ操作に基づいて行われる。また、シャッタ速度やF値などの撮影条件は、ユーザが入力部15で事前に設定してもよいし、画像情報や別途設けた測光センサなどの情報を基に自動で決定されるように構成してもよい。ステップS26において、距離計測装置100の制御部は、ステップS25で取得した視差画像を基づいて、公知の方法によって各像高における距離38を算出し、距離画像を生成する(生成工程)。距離画像の生成は、距離演算部17(生成手段)にて行うことができる。その後、図2(a)のフローチャートは終了する。このようにして、距離演算部17は、1ショットで取得された視差画像から距離画像を生成するので、負荷が小さい。なお、距離計測装置100の制御部は、生成した距離画像のデータを記憶部14に記憶する。また、距離計測装置100の制御部は、算出した各像高における距離38の情報を被写体101の距離情報として記憶部14に記憶する。更に、距離計測装置100の制御部は、入力部15におけるユーザ操作に基づいて、距離画像や被写体101の距離情報を表示部16に表示することができる。 In step S25, the control unit of the distance measurement device 100 performs shooting and acquires a parallax image from the image sensor 11. The shooting is performed based on a user operation in the input unit 15. The shooting conditions such as the shutter speed and F-number may be set in advance by the user in the input unit 15, or may be configured to be automatically determined based on image information and information from a separately provided photometry sensor. In step S26, the control unit of the distance measurement device 100 calculates the distance 38 at each image height by a known method based on the parallax image acquired in step S25, and generates a distance image (generation process). The distance image can be generated by the distance calculation unit 17 (generation means). After that, the flowchart in FIG. 2(a) ends. In this way, the distance calculation unit 17 generates a distance image from a parallax image acquired in one shot, so the load is small. The control unit of the distance measurement device 100 stores the data of the generated distance image in the storage unit 14. The control unit of the distance measurement device 100 also stores the calculated information on the distance 38 at each image height in the storage unit 14 as distance information of the subject 101. Furthermore, the control unit of the distance measurement device 100 can display a distance image and distance information of the subject 101 on the display unit 16 based on a user operation on the input unit 15.

距離計測装置100の制御部は、距離画像や撮影画像のデータを、記憶部14に記憶し、アプリケーションに合わせた処理に用いることができる。例えば、距離画像は、被写体101の厚みの分布の計測や長さの計測に用いることができる。あるいは、距離計測装置100の制御部は、信号処理部13によって距離画像を点群データやメッシュデータに変換することで、距離画像を三次元データとして扱ってもよい。 The control unit of the distance measurement device 100 can store the distance image and captured image data in the memory unit 14 and use them for processing according to the application. For example, the distance image can be used to measure the thickness distribution or length of the subject 101. Alternatively, the control unit of the distance measurement device 100 can treat the distance image as three-dimensional data by converting it into point cloud data or mesh data using the signal processing unit 13.

(効果が得られる理由)
以下、本実施形態に係る距離計測装置100で、凹凸面の高精度な距離画像を得ることができる理由について述べる。図3(a)に示すように、画面中央で被写体101に合焦させて撮影が行われると、結像光学系10の像面湾曲により、画面周辺では被写体101と集光点37がずれるため、画面周辺がボケた画像が取得される。画面周辺がボケた画像で視差演算が行われると、画像のコントラストが低いため、視差演算の精度が低下する。図4は、受光部21、22の入射角感度特性41、42と、光線34の角度範囲43、44を示す図である。角度範囲43は、画面周辺の光線34の入射角度範囲を表している。図4に示すように、画面周辺では、画素20への入射光の角度範囲43に対してA画素(受光部21)とB画素(受光部22)の感度が異なるため、デフォーカスすると、A画像とB画像の形状の差が大きくなり、視差演算の誤差が増大する。加えて、A画素(受光部21)およびB画素(受光部22)への入射光量が小さくなり、画像信号のS/Nも悪くなるため、これに起因する視差演算の誤差も発生する。更に、画面周辺では射出瞳の端付近を通過した光に対して画素感度が低くなるため、基線長が短くなる。基線長は、短いほど視差演算の誤差に伴う測距誤差は大きくなる。以上、これらの理由により、画面周辺では、測距誤差が非常に増大する。
(Reasons for the effectiveness)
The reason why the distance measuring device 100 according to this embodiment can obtain a highly accurate distance image of an uneven surface will be described below. As shown in FIG. 3A, when an image is captured by focusing on the object 101 at the center of the screen, the object 101 and the light condensing point 37 are misaligned at the periphery of the screen due to the curvature of the field of the imaging optical system 10, and an image with a blurred periphery of the screen is obtained. When a parallax calculation is performed on an image with a blurred periphery of the screen, the accuracy of the parallax calculation decreases due to low image contrast. FIG. 4 is a diagram showing the incident angle sensitivity characteristics 41, 42 of the light receiving units 21, 22 and the angle ranges 43, 44 of the light ray 34. The angle range 43 represents the incident angle range of the light ray 34 at the periphery of the screen. As shown in FIG. 4, at the periphery of the screen, the sensitivity of the A pixel (light receiving unit 21) and the B pixel (light receiving unit 22) to the angle range 43 of the incident light to the pixel 20 is different, so that when defocused, the difference in shape between the A image and the B image becomes large, and the error in the parallax calculation increases. In addition, the amount of light incident on the A pixel (light receiving section 21) and the B pixel (light receiving section 22) decreases, and the S/N ratio of the image signal also deteriorates, which causes errors in the parallax calculation. Furthermore, at the periphery of the screen, pixel sensitivity to light that has passed near the edge of the exit pupil decreases, resulting in a shorter baseline. The shorter the baseline length, the greater the distance measurement error associated with the parallax calculation error. For these reasons, distance measurement errors increase significantly at the periphery of the screen.

これに対して、距離計測装置100は、画面中央での距離38を被写体距離として求め、図3(b)に示すように、画面周辺でのピント距離(距離31)が被写体距離(画面中央での距離38)に近づくようピント調整を行い、撮影および距離画像の生成を行う。これにより、画面周辺では、デフォーカスによる画像のボケが低減する。更に、上述のA画像とB画像の形状の差の影響も小さくなるため、視差演算の精度が向上する。よって、基線長が短くても、高精度な測距が可能となる。 In response to this, the distance measurement device 100 determines the distance 38 at the center of the screen as the subject distance, and adjusts the focus so that the focus distance (distance 31) at the periphery of the screen approaches the subject distance (distance 38 at the center of the screen) as shown in FIG. 3(b), and then captures the image and generates a distance image. This reduces image blurring due to defocus at the periphery of the screen. Furthermore, the effect of the difference in shape between image A and image B described above is also reduced, improving the accuracy of parallax calculation. Therefore, high-precision distance measurement is possible even with a short baseline length.

図4において、角度範囲44は、画面中央の光線32の入射角度範囲を表している。上述のピント調整が行われると、画面中央では、デフォーカス量が増加し、画像のボケに伴う視差演算の誤差が増加する。しかしながら、図4に示すように、入射光の角度範囲44に対して受光部21、22の入射角感度特性41、42が対称であり、デフォーカスによるA画像とB画像の形状の差が小さいので、視差演算の誤差が小さい。また、画面中央では、結像光学系10の射出瞳の周辺を通過した光に対して画素感度が高く、基線長が長くなるため、視差演算の誤差の影響は小さく、測距精度を維持できる。このような原理により、距離計測装置100は、画面中央での距離38を被写体距離として求め、画面周辺で被写体距離を用いたピント調整を行ってから、視差画像を取得し距離画像を生成することで、距離画像の画面全体で高精度な測距を行うことができる。すなわち、画面中央と画面周辺では、受光部21、22の入射角感度特性41、42の対称性の相違、つまり視差画像の対称性の相違があるが、上述のピント調整は、視差画像の対称性の相違が加味されている。そのため、上述のピント調整が行われると、画面周辺では視差演算の精度が向上する一方、画面中央では、視差演算の誤差が増加するけれども、測距精度を維持できる。 In FIG. 4, the angle range 44 represents the range of the incidence angle of the light ray 32 at the center of the screen. When the focus adjustment described above is performed, the amount of defocus increases at the center of the screen, and the error in the parallax calculation due to the blurring of the image increases. However, as shown in FIG. 4, the incidence angle sensitivity characteristics 41, 42 of the light receiving units 21, 22 are symmetrical with respect to the angle range 44 of the incident light, and the difference in shape between the A image and the B image due to defocus is small, so the error in the parallax calculation is small. In addition, at the center of the screen, the pixel sensitivity is high for the light that has passed through the periphery of the exit pupil of the imaging optical system 10, and the baseline length is long, so the effect of the error in the parallax calculation is small and the distance measurement accuracy can be maintained. Based on this principle, the distance measurement device 100 obtains the distance 38 at the center of the screen as the subject distance, performs focus adjustment using the subject distance at the periphery of the screen, acquires a parallax image, and generates a distance image, thereby performing highly accurate distance measurement over the entire screen of the distance image. That is, there is a difference in symmetry between the incident angle sensitivity characteristics 41, 42 of the light receiving units 21, 22 at the center of the screen and the periphery of the screen, i.e., a difference in symmetry of the parallax images, but the focus adjustment described above takes into account the difference in symmetry of the parallax images. Therefore, when the focus adjustment described above is performed, the accuracy of the parallax calculation improves at the periphery of the screen, while the error in the parallax calculation increases at the center of the screen, but the distance measurement accuracy can be maintained.

なお、ステップS22において、被写体距離を算出する位置は、出来るだけ画面中央の方が好ましい。なぜなら、上述のように、画面中央ほど基線長が長く、デフォーカスした際の視差演算の誤差が小さいため、画面中央の方が高精度な被写体距離情報を得ることができ、ピント距離の調整量の算出誤差を低減することができるからである。また、ステップS23では、画面周辺におけるピント距離と被写体距離の差が少なくなればよいので、図3(b)に示すように、画面周辺におけるピント距離が被写体距離と同じとなるように、ピント距離の調整量が求められてもよい。あるいは、各像高におけるピント距離と被写体距離の差の総和、平均値、または二乗平均値などが最小となるように、ピント距離の調整量が求められてもよい。いずれの場合も、画面周辺における視差演算の誤差や基線長の影響を低減することができるので、上述の効果を得ることができる。 In step S22, the position for calculating the subject distance is preferably the center of the screen. This is because, as described above, the base line length is longer toward the center of the screen, and the error in the parallax calculation when defocused is smaller, so that the center of the screen can obtain more accurate subject distance information and reduce the calculation error of the adjustment amount of the focus distance. In step S23, since it is sufficient to reduce the difference between the focus distance and the subject distance at the periphery of the screen, as shown in FIG. 3B, the adjustment amount of the focus distance may be calculated so that the focus distance at the periphery of the screen is the same as the subject distance. Alternatively, the adjustment amount of the focus distance may be calculated so that the sum, average, or square mean value of the difference between the focus distance and the subject distance at each image height is minimized. In either case, the effect described above can be obtained because the error in the parallax calculation at the periphery of the screen and the influence of the base line length can be reduced.

(ピント距離の調整量の算出方法)
ステップS23において、距離計測装置100の制御部は、各像高のピント距離の情報(ピント面情報)を、レンズ設計データを基に、各被写体距離の像面湾曲量を算出することで求めることができる。あるいは、距離計測装置100の制御部は、各像高のピント距離の情報(ピント面情報)を、上述の像面湾曲量の算出ではなく、事前に計測することで求めてもよい。この場合、距離計測装置100の制御部は、所定の距離に配置された被写体101の撮影を行い、各像高において、画像のコントラストが最も高くなる距離もしくは視差量の絶対値が最小となる距離を計測する。これにより、距離計測装置100の制御部は、各像高のピント距離の情報(ピント面情報)を求める。このようにして、距離計測装置100の制御部は、各像高のピント距離の情報(ピント面情報)を計測値から求めることで、製造誤差による設計値からのズレを除去することができるので、より高精度な距離計測が可能となる。
(Calculation method for focal distance adjustment amount)
In step S23, the control unit of the distance measurement device 100 can obtain information on the focal distance (focal plane information) for each image height by calculating the amount of curvature of field for each object distance based on the lens design data. Alternatively, the control unit of the distance measurement device 100 may obtain information on the focal distance (focal plane information) for each image height by measuring it in advance instead of calculating the amount of curvature of field. In this case, the control unit of the distance measurement device 100 takes an image of the object 101 placed at a predetermined distance, and measures the distance at which the contrast of the image is highest or the absolute value of the parallax amount is smallest at each image height. As a result, the control unit of the distance measurement device 100 obtains information on the focal distance (focal plane information) for each image height. In this way, the control unit of the distance measurement device 100 obtains information on the focal distance (focal plane information) for each image height from the measured value, thereby eliminating deviations from the design value due to manufacturing errors, and thus enabling more accurate distance measurement.

距離計測装置100の制御部は、ピント距離の調整量を、距離計測装置100の内部の温度あるいは外部の温度を加味して算出することで、より高精度に求めることができる。距離計測装置100では、その内部または外部の環境温度が変わると、結像光学系10のレンズや鏡筒、または撮像素子11の変形や変位、結像光学系10のレンズの屈折率変化などが起こり、像面湾曲量が変化し、ピント面が変化する。距離計測装置100の内部あるいは外部の所定の位置に温度計(温度の計測手段)を設置しておく。距離計測装置100の制御部は、事前に温度とピント面の関係を設計データあるいは計測により求めておき、被写体距離情報や位置情報に加えて温度情報を用いてピント面を求めることでより、高精度にピント距離の調整量を算出することができる。 The control unit of the distance measurement device 100 can calculate the adjustment amount of the focal distance with higher accuracy by taking into account the internal or external temperature of the distance measurement device 100. In the distance measurement device 100, when the internal or external environmental temperature changes, the lens or lens barrel of the imaging optical system 10 or the image sensor 11 is deformed or displaced, and the refractive index of the lens of the imaging optical system 10 changes, causing a change in the amount of curvature of field and a change in the focal plane. A thermometer (temperature measurement means) is installed at a predetermined position inside or outside the distance measurement device 100. The control unit of the distance measurement device 100 can calculate the adjustment amount of the focal distance with higher accuracy by calculating the relationship between temperature and the focal plane in advance using design data or measurement, and calculating the focal plane using temperature information in addition to subject distance information and position information.

距離計測装置100の制御部は、ピント距離の調整量を、画面中央と画面周辺におけるデフォーカスや画像のS/Nなどに伴う視差演算の誤差や、画面中央と画面周辺における基線長を加味して決めることが好ましい。距離計測装置100の制御部は、これらの情報を、事前に設計データあるいは計測により求めることができる。距離計測装置100の制御部は、これらの情報を基に、画面中央と画面周辺の各々のデフォーカスに伴う測距精度を求めておき、この情報を基に被写体距離に伴う各像高の測距精度の差が小さくなるピント距離の調整量を決定する。これにより、距離計測装置100の制御部は、画面中央と画面周辺の測距精度の差を低減することができ、画面全体で同程度の測距精度で距離画像を生成することができる。 It is preferable that the control unit of the distance measurement device 100 determines the amount of adjustment of the focus distance taking into account the error in parallax calculation associated with defocus at the center and periphery of the screen, the image S/N, and the baseline length at the center and periphery of the screen. The control unit of the distance measurement device 100 can obtain this information in advance from design data or by measurement. Based on this information, the control unit of the distance measurement device 100 obtains the distance measurement accuracy associated with each defocus at the center and periphery of the screen, and based on this information, determines the amount of adjustment of the focus distance that reduces the difference in distance measurement accuracy for each image height associated with the subject distance. In this way, the control unit of the distance measurement device 100 can reduce the difference in distance measurement accuracy between the center and periphery of the screen, and can generate a distance image with the same level of distance measurement accuracy across the entire screen.

(ピント距離の調整についての実行判定処理)
本実施形態では、図5(a)に示すように、図2(a)に示すフローチャートに対して、ピント距離の調整を行うかどうかの判定処理が設けられることで、被写体101の形状に応じて適切なピント距離で撮影および距離画像の生成が可能となる。図5(a)の処理は、不図示の制御部において、CPUがROMに記憶されたプログラムをRAMに展開して実行し、距離計測装置100の各部を制御することで実現される。以下、図5(a)の処理の流れを説明する。
(Processing for Determining Whether to Adjust the Focus Distance)
In this embodiment, as shown in Fig. 5(a), a process of determining whether or not to adjust the focus distance is added to the flowchart shown in Fig. 2(a), thereby enabling shooting and generating a distance image at an appropriate focus distance according to the shape of the subject 101. The process of Fig. 5(a) is realized by a CPU in a control unit (not shown) expanding a program stored in a ROM into a RAM, executing the program, and controlling each unit of the distance measurement device 100. The flow of the process of Fig. 5(a) will be described below.

ステップS21において、距離計測装置100の制御部は、上述と同様にして、撮影画面内での距離38を算出する位置を決定する。ステップS51において、距離計測装置100の制御部は、ステップS21の撮影画面の画面中央および画面周辺におけるコントラストを算出する。この算出は、画像処理部18(第3算出手段)にて行うことができる。図5(b)は、撮影画面500上におけるコントラストを計算する位置を表している。位置501は、画面中央の位置を表している。位置502、503、504、505、506、507、508、509は、各々画面周辺の位置を表している。コントラストは、撮影画面内の一部の画像領域内に含まれる画素値から算出され、例えば、次式によって算出される。 In step S21, the control unit of the distance measurement device 100 determines the position in the shooting screen where the distance 38 is calculated in the same manner as described above. In step S51, the control unit of the distance measurement device 100 calculates the contrast in the center and periphery of the shooting screen in step S21. This calculation can be performed by the image processing unit 18 (third calculation means). Figure 5 (b) shows the positions on the shooting screen 500 where the contrast is calculated. Position 501 represents the position in the center of the screen. Positions 502, 503, 504, 505, 506, 507, 508, and 509 each represent positions on the periphery of the screen. The contrast is calculated from pixel values contained in a portion of the image area in the shooting screen, for example, using the following formula.

ここで、Cはコントラスト、Imaxは画素値の最大値、Iminは画素値の最小値を表している。なお、距離計測装置100では、コントラストが算出される際の画像領域のサイズを、任意の大きさに設定することができる。 Here, C represents the contrast, Imax represents the maximum pixel value, and Imin represents the minimum pixel value. Note that in the distance measurement device 100, the size of the image area when the contrast is calculated can be set to any size.

ステップS52において、距離計測装置100の制御部は、ピント距離の調整を行うかどうかの判定を行う。この処理において、距離計測装置100の制御部は、画面中央と画面周辺におけるコントラストを比較する。距離計測装置100の制御部は、画面周辺の左右の両端の位置502と503、あるいは上下の両端の位置504と505、あるいは斜め方向の両端の位置506と507、508と509のコントラストと、画面中央の位置501のコントラストを比較する。距離計測装置100の制御部は、コントラストの比較判定を、画面中央のコントラストに対する画面周辺のコントラストの割合が、事前に設定された所定割合よりも大きいかどうかで行う。あるいは、距離計測装置100の制御部は、コントラストの比較判定を、画面中央と画面周辺のコントラストの差を画面中央のコントラストで除算した際の値が、事前に設定された閾値よりも大きいどうかで行ってもよい。あるいは、距離計測装置100の制御部は、コントラストの比較判定を、画面中央と画面周辺のコントラストの差が、事前に設定された別の閾値よりも大きいかどうかで行ってもよい。 In step S52, the control unit of the distance measurement device 100 judges whether to adjust the focal distance. In this process, the control unit of the distance measurement device 100 compares the contrast at the center of the screen and the periphery of the screen. The control unit of the distance measurement device 100 compares the contrast at the left and right ends of the periphery of the screen 502 and 503, or the top and bottom ends of the screen 504 and 505, or the diagonal ends of the screen 506 and 507, or 508 and 509, with the contrast at the center of the screen 501. The control unit of the distance measurement device 100 compares the contrast based on whether the ratio of the contrast at the periphery of the screen to the contrast at the center of the screen is greater than a predetermined ratio set in advance. Alternatively, the control unit of the distance measurement device 100 may compare the contrast based on whether the value obtained by dividing the difference in contrast between the center of the screen and the periphery of the screen by the contrast at the center of the screen is greater than a threshold set in advance. Alternatively, the control unit of the distance measurement device 100 may compare the contrast based on whether the difference in contrast between the center of the screen and the periphery of the screen is greater than another threshold set in advance.

画面周辺の両端のコントラストについて、画面中央のコントラストに対する画面周辺のコントラストの割合が所定割合よりも大きくない場合、距離計測装置100の制御部がピント距離の調整を行うと判定し、処理はステップS22に進む。ステップS22からS24において、距離計測装置100の制御部は、上述と同様にして、ピント距離の調整を行う。これに対して、画面周辺の少なくとも一端のコントラストについて、画面中央のコントラストに対する画面周辺のコントラストの割合が所定割合よりも大きい場合は、距離計測装置100の制御部がピント距離の調整を行なわないと判定する。その後、処理はステップS25に進む。ステップS25からステップ26において、距離計測装置100の制御部は、上述と同様にして、視差画像を取得し、距離画像を生成する。その後、図5のフローチャートは終了する。距離計測装置100は、図5(a)のフローチャートのように、ピント距離の調整を行うかどうかの判定結果に応じて、ピント距離の調整および視差画像を取得することで、被写体101の形状に応じて効率よく距離画像を生成することが可能となる。 If the ratio of the contrast of the screen periphery to the contrast of the screen center is not greater than a predetermined ratio for the contrast at both ends of the screen periphery, the control unit of the distance measurement device 100 determines to adjust the focus distance, and the process proceeds to step S22. In steps S22 to S24, the control unit of the distance measurement device 100 adjusts the focus distance in the same manner as described above. On the other hand, if the ratio of the contrast of the screen periphery to the contrast of the screen center is greater than a predetermined ratio for the contrast of at least one end of the screen periphery, the control unit of the distance measurement device 100 determines not to adjust the focus distance. Then, the process proceeds to step S25. In steps S25 to S26, the control unit of the distance measurement device 100 acquires a parallax image and generates a distance image in the same manner as described above. Then, the flowchart in FIG. 5 ends. As shown in the flowchart in FIG. 5(a), the distance measurement device 100 adjusts the focus distance and acquires a parallax image according to the result of the determination of whether to adjust the focus distance, thereby making it possible to efficiently generate a distance image according to the shape of the subject 101.

図6は、被写体101の形状とピント面35、60の関係を示す図である。被写体101のテクスチャは、画面全体で略同じと仮定する。図6(a)は、被写体101が平面形状の場合の図である。図6(b)は、被写体101が凸面形状の場合の図である。これらの場合、画面中央では、集光点36が被写体101に近いので、画像のコントラストが高くなる。一方、画面周辺では、集光点37が被写体101から遠いので、ボケが生じ、画像のコントラストが低くなる。そこで、距離計測装置100は、上述の方法でピント距離の調整を行い、ピント面35がピント面60となる変更をしてから、視差画像の取得および距離画像の生成を行う。これにより、画面周辺の集光点62が被写体101に近くなり、距離計測装置100は、上述と同様にして、距離画像の画面全体で高精度な測距が可能となる。 Figure 6 is a diagram showing the relationship between the shape of the subject 101 and the focal planes 35 and 60. It is assumed that the texture of the subject 101 is approximately the same across the entire screen. Figure 6 (a) is a diagram showing the case where the subject 101 has a planar shape. Figure 6 (b) is a diagram showing the case where the subject 101 has a convex shape. In these cases, in the center of the screen, the focal point 36 is close to the subject 101, so the contrast of the image is high. On the other hand, in the periphery of the screen, the focal point 37 is far from the subject 101, so blurring occurs and the contrast of the image is low. Therefore, the distance measurement device 100 adjusts the focal distance using the above-mentioned method, changes the focal plane 35 to the focal plane 60, and then acquires a parallax image and generates a distance image. As a result, the focal point 62 on the periphery of the screen becomes closer to the subject 101, and the distance measurement device 100 can perform high-precision distance measurement across the entire screen of the distance image in the same manner as described above.

図6(c)は、被写体101が凹面形状の場合の図である。この場合、画面中央では上述と同様に画像のコントラストが高くなるが、画面周辺でも集光点37が被写体101に近いので、画像のコントラストが高くなる。従って、距離計測装置100は、上述の方法でピント距離の調整を行い、ピント面35がピント面60となる変更を行うと、画面周辺でも、集光点62と被写体101との差が大きくなり、デフォーカス量が更に増大するため、測距精度が低下し、逆効果となる。図6(d)は、被写体101が平面形状で結像光学系10に対して傾いて配置された場合の図である。この場合、画面周辺の片方の一端では、集光点37が被写体101に近いので、画像のコントラストは高くなる。これに対して、画面周辺の片方とは逆側の一端では、集光点37が被写体101から遠いので、画像のコントラストは低くなる。従って、距離計測装置100は、上述の方法でピント距離の調整を行うと、画面周辺のいずれか一方の一端では、集光点62と被写体101との差が大きくなり、デフォーカス量が更に増大するため、測距精度が低下し、逆効果となる。なお、図6(a)(b)(c)(d)の61は、ピント距離の調整後のピント面60における光軸方向(z方向)の集光点である。 Figure 6(c) is a diagram showing the case where the subject 101 has a concave shape. In this case, the image contrast is high in the center of the screen as described above, but the image contrast is also high at the periphery of the screen because the condenser point 37 is close to the subject 101. Therefore, when the distance measurement device 100 adjusts the focal distance by the above-mentioned method and changes the focal plane 35 to the focal plane 60, the difference between the condenser point 62 and the subject 101 becomes large even at the periphery of the screen, and the defocus amount further increases, so the distance measurement accuracy decreases and the effect is reversed. Figure 6(d) is a diagram showing the case where the subject 101 has a planar shape and is arranged at an angle to the imaging optical system 10. In this case, at one end of the periphery of the screen, the condenser point 37 is close to the subject 101, so the contrast of the image is high. On the other hand, at the opposite end of the periphery of the screen, the condenser point 37 is far from the subject 101, so the contrast of the image is low. Therefore, when the distance measurement device 100 adjusts the focal distance using the above-mentioned method, the difference between the focal point 62 and the subject 101 becomes large at one end of the screen periphery, and the defocus amount increases further, which reduces the distance measurement accuracy and has the opposite effect. Note that 61 in Figures 6(a), (b), (c), and (d) is the focal point in the optical axis direction (z direction) on the focal plane 60 after the focal distance is adjusted.

距離計測装置100は、図6(c)(d)の場合のように、画面周辺の両端もしくは片方の一端の画像のコントラストが高く、画面中央の画像のコントラストとの差が小さいときは、ピント距離の調整を行わないで視差画像の取得および距離画像の生成を行う。これにより、距離計測装置100は、画面全体で高精度な距離画像の生成が可能である。 When the contrast of the image at either end or one of the edges of the screen is high and the difference with the contrast of the image at the center of the screen is small, as in the case of Figures 6(c) and (d), the distance measurement device 100 acquires parallax images and generates distance images without adjusting the focus distance. This enables the distance measurement device 100 to generate highly accurate distance images across the entire screen.

以上の理由より、距離計測装置100は、画面中央と画面周辺の画像のコントラストを比較し、画面周辺の両端の画像のコントラストが比較的低い場合にピント距離の調整を行う。これに対して、画面周辺の両端または一端の画像のコントラストが比較的高い場合はピント距離の調整を行わない。これにより、距離計測装置100は、被写体101の形状に応じて画面全体で高精度な距離画像の生成が可能となる。 For the above reasons, the distance measurement device 100 compares the contrast of the image at the center of the screen and the periphery of the screen, and adjusts the focal distance if the contrast of the image at both ends of the periphery of the screen is relatively low. In contrast, if the contrast of the image at both ends or one end of the periphery of the screen is relatively high, the focal distance is not adjusted. This enables the distance measurement device 100 to generate a highly accurate distance image across the entire screen according to the shape of the subject 101.

なお、本実施形態では、像面湾曲によって画面周辺におけるピント距離が画面中央よりも近い場合について説明したが、像面湾曲によって画面周辺におけるピント距離が画面中央よりも遠い場合でも、同様の効果が得ることができる。この場合も、距離計測装置100は、画面中央と画面周辺の画像のコントラストを比較した結果に応じて、ピント距離の調整を行うかどうかを判定する。これにより、距離計測装置100は、被写体101が平面形状または凹面形状のときにピント距離の調整を行い、視差画像の取得および距離画像を生成する。一方、距離計測装置100は、被写体101が凸面形状のときにピント距離の調整を行わずに、視差画像の取得および距離画像を生成する。このようにして、距離計測装置100は、上述と同様の効果を得ることができる。 In this embodiment, the case where the focal distance at the periphery of the screen is closer than the center of the screen due to the curvature of field has been described, but the same effect can be obtained even when the focal distance at the periphery of the screen is farther than the center of the screen due to the curvature of field. In this case, the distance measurement device 100 determines whether to adjust the focal distance depending on the result of comparing the contrast of the image at the center of the screen and the image at the periphery of the screen. As a result, the distance measurement device 100 adjusts the focal distance when the subject 101 has a flat or concave shape, acquires a parallax image, and generates a distance image. On the other hand, the distance measurement device 100 acquires a parallax image and generates a distance image without adjusting the focal distance when the subject 101 has a convex shape. In this way, the distance measurement device 100 can obtain the same effect as described above.

(画像認識)
本実施形態では、図7に示すように、図2(a)に示すフローチャートに対して、距離算出位置決定の処理後に仮ピント調整の処理が設けられ、撮影画像を用いた画像認識の処理が行われることで、高精度な画像認識結果と距離画像を得ることが可能となる。図7の処理は、不図示の制御部において、CPUがROMに記憶されたプログラムをRAMに展開して実行し、距離計測装置100の各部を制御することで実現される。以下、図7(a)の処理の流れを説明する。ステップS21において、距離計測装置100の制御部は、上述と同様にして、撮影画面内での距離38を算出する位置を決定する。
(Image Recognition)
In this embodiment, as shown in Fig. 7, a provisional focus adjustment process is added after the distance calculation position determination process in the flowchart shown in Fig. 2(a), and image recognition process is performed using the captured image, making it possible to obtain a highly accurate image recognition result and distance image. The process in Fig. 7 is realized by a control unit (not shown) in which a CPU loads a program stored in a ROM into a RAM, executes the program, and controls each unit of the distance measurement device 100. The process flow in Fig. 7(a) will be described below. In step S21, the control unit of the distance measurement device 100 determines a position in the captured screen where the distance 38 is to be calculated, in the same manner as described above.

ステップS71において、距離計測装置100の制御部は、仮ピント調整を行う。仮ピント調整は、ピント調整部12(仮ピント調整手段)にて行うことができる。この処理において、ピント調整部12は、ステップS21で決定された位置において、被写体101に合焦するように、ピント距離を調整する。ステップS72において、距離計測装置100の制御部は、ステップS71で仮ピント調整が行われた状態で被写体101を撮影する。これにより、撮影画像が取得される。撮影は、入力部15におけるユーザ操作に基づいて行われる。ステップS73において、距離計測装置100の制御部は、ステップS72で取得した撮影画像の信号を基に画像認識処理を行う。この処理は、画像処理部18(画像認識手段)にて行うことができる。画像認識処理とは、被写体101の特徴検出(数や色や輪郭形状など)、材質推定、物体認識、領域分割、欠陥領域の検出など様々な処理である。距離計測装置100の制御部は、最も注目する領域(ステップS21で決定した位置)で合焦した撮影画像に基づいて、画像認識処理を行うことができ、高精度な認識結果を得ることができる。 In step S71, the control unit of the distance measurement device 100 performs a temporary focus adjustment. The temporary focus adjustment can be performed by the focus adjustment unit 12 (temporary focus adjustment means). In this process, the focus adjustment unit 12 adjusts the focus distance so as to focus on the subject 101 at the position determined in step S21. In step S72, the control unit of the distance measurement device 100 photographs the subject 101 in a state in which the temporary focus adjustment has been performed in step S71. This results in the acquisition of a photographed image. The photographing is performed based on a user operation in the input unit 15. In step S73, the control unit of the distance measurement device 100 performs an image recognition process based on the signal of the photographed image acquired in step S72. This process can be performed by the image processing unit 18 (image recognition means). The image recognition process includes various processes such as feature detection (number, color, contour shape, etc.) of the subject 101, material estimation, object recognition, area division, and detection of defective areas. The control unit of the distance measurement device 100 can perform image recognition processing based on the captured image focused on the area of greatest interest (the position determined in step S21), thereby obtaining highly accurate recognition results.

ステップS22からステップ26において、距離計測装置100の制御部は、上述と同様にして処理を行う。これにより、距離計測装置100の制御部は、ステップS22において、被写体101に合焦した画像で被写体距離の算出を行うことができ、より高精度な被写体距離情報を得ることができる。その後、図7のフローチャートは終了する。これにより、距離計測装置100の制御部は、画面全体で高精度な測距が行われた距離画像を得ることができる。なお、距離計測装置100の制御部は、ステップS71からステップS73を、ステップS26の後に行ってもよい。以上より、本実施形態に係る距離計測装置100は、図7の処理を実行することにより、高精度な画像認識結果と距離画像を得ることができる。 In steps S22 to S26, the control unit of the distance measurement device 100 performs processing in the same manner as described above. As a result, in step S22, the control unit of the distance measurement device 100 can calculate the subject distance using an image focused on the subject 101, and can obtain more accurate subject distance information. The flowchart in FIG. 7 then ends. As a result, the control unit of the distance measurement device 100 can obtain a distance image in which highly accurate distance measurement has been performed over the entire screen. Note that the control unit of the distance measurement device 100 may perform steps S71 to S73 after step S26. As described above, the distance measurement device 100 according to this embodiment can obtain a highly accurate image recognition result and distance image by executing the processing in FIG. 7.

なお、上述の図5のフローチャートでは、図7のフローチャートと同様にして、ステップS21の後において、仮ピント調整に関する処理(ステップS71からステップS73)が設けられてもよい。この場合、距離計測装置100の制御部は、ステップS22において、被写体101に合焦した画像で被写体距離の算出を行うことができ、より高精度な被写体距離情報を得ることができる。また、距離計測装置100の制御部は、ステップS51で画像のコントラストをより正確に求めることができ、ステップS52における判定処理の精度を高めることができる。また、距離計測装置100の制御部は、全画面でデフォーカスした画像が取得されることを回避することができ、距離画像の精度を高めることができる。 In the above-mentioned flowchart of FIG. 5, similarly to the flowchart of FIG. 7, a process related to a temporary focus adjustment (steps S71 to S73) may be provided after step S21. In this case, the control unit of the distance measurement device 100 can calculate the subject distance using an image focused on the subject 101 in step S22, and can obtain more accurate subject distance information. Furthermore, the control unit of the distance measurement device 100 can more accurately determine the contrast of the image in step S51, and can improve the accuracy of the determination process in step S52. Furthermore, the control unit of the distance measurement device 100 can avoid acquiring a defocused image on the entire screen, and can improve the accuracy of the distance image.

(その他の手段・構成)
以上、本発明の好ましい実施形態について説明したが、本発明は上述した本実施形態に限定されず、その要旨の範囲内で種々の変形および変更が可能である。本発明は、上述の本実施形態の1以上の機能を実現するプログラムを、ネットワークや記憶媒体を介してシステムや装置に供給し、そのシステムまたは装置のコンピュータの1つ以上のプロセッサがプログラムを読み出して実行する処理でも実現可能である。また、本発明は、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other means and configurations)
Although the preferred embodiment of the present invention has been described above, the present invention is not limited to the above-described embodiment, and various modifications and changes are possible within the scope of the gist of the present invention. The present invention can also be realized by supplying a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and having one or more processors of a computer in the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that realizes one or more functions.

すなわち、本発明は、距離計測装置100の他に、コンピュータプログラムをも包含する。本実施形態のコンピュータプログラムは、距離画像の生成のために、コンピュータに所定の工程を実行させるものである。本実施形態のプログラムは、距離計測装置100またはそれを有するデジタルカメラなどの撮像装置のコンピュータにインストールされる。インストールされたプログラムがコンピュータによって実行されることで上記の機能が実現し、高速で高精度な距離画像の生成が可能なものとすることができる。 In other words, the present invention includes a computer program in addition to the distance measurement device 100. The computer program of this embodiment causes a computer to execute predetermined steps in order to generate a distance image. The program of this embodiment is installed in the computer of the distance measurement device 100 or an imaging device having the same, such as a digital camera. The installed program is executed by the computer to realize the above functions, making it possible to generate distance images quickly and with high accuracy.

なお、上述のデジタルカメラなどの撮像装置は、距離計測装置100を有することによって、視差画像から算出される被写体101の距離情報および距離画像を記憶・表示する記憶部14(記憶手段)と表示部16(表示手段)を有することができる。 In addition, by having the distance measurement device 100, an imaging device such as the above-mentioned digital camera can have a memory unit 14 (storage means) and a display unit 16 (display means) that store and display distance information and a distance image of the subject 101 calculated from the parallax image.

図1の構成では、距離計測装置100内で距離情報を算出しているが、図8に示す構成のように、距離計測装置100は、距離演算部17とは異なる演算装置800を用いて距離情報を算出してもよい。演算装置800は、例えばPCである。演算装置800は、距離計測装置100と有線または無線で接続されていて、距離計測装置100で取得した画像のデータを通信可能である。更に、演算装置800は、ステップS26の処理を行う演算部を有している。ステップ25で取得した画像のデータが有線または無線で演算装置800に転送され、演算装置800内の演算部においてステップ26の処理が実行されることで、演算装置800は、距離画像を生成することができる。このような構成でも上述と同様に、画面全体で高精度な距離画像を生成することができる。また、ステップ25で取得した画像のデータは、1ショットで取得された視差画像のデータであることから、演算装置800への転送負荷が小さい。 1, the distance information is calculated in the distance measurement device 100. However, as shown in FIG. 8, the distance measurement device 100 may calculate the distance information using a calculation device 800 different from the distance calculation unit 17. The calculation device 800 is, for example, a PC. The calculation device 800 is connected to the distance measurement device 100 by wire or wirelessly, and is capable of communicating image data acquired by the distance measurement device 100. Furthermore, the calculation device 800 has a calculation unit that performs processing of step S26. The image data acquired in step 25 is transferred to the calculation device 800 by wire or wirelessly, and the calculation unit in the calculation device 800 executes the processing of step 26, so that the calculation device 800 can generate a distance image. With this configuration, a high-precision distance image can be generated over the entire screen, as described above. Furthermore, since the image data acquired in step 25 is parallax image data acquired in one shot, the transfer load on the calculation device 800 is small.

本実施形態の開示は、以下の構成、方法およびプログラムを含む。
(構成1) 結像光学系によって被写体が撮影された撮影画面の第1位置において、前記結像光学系の光軸方向における前記結像光学系から前記被写体までの距離を被写体距離として算出する第1算出手段と、
前記光軸方向における前記結像光学系から前記結像光学系の集光点までの距離であるピント距離の調整量を前記被写体距離を用いて算出する第2算出手段と、
前記ピント距離を前記調整量だけ変化させることによって、前記ピント距離の調整を行うピント調整手段と、
前記ピント距離の調整の後の前記結像光学系によって取得された視差画像に基づいて、前記被写体の距離画像を生成する生成手段と、を備え、
前記第2算出手段は、前記撮影画面の第2位置における前記ピント距離と前記被写体距離の差が、前記第1位置における前記ピント距離と前記被写体距離の差よりも小さくなるように、前記調整量を算出することを特徴とする距離計測装置。
(構成2) 前記第2算出手段は、前記結像光学系の像面湾曲量に基づいて前記調整量を算出することを特徴とする構成1に記載の距離計測装置。
(構成3) 前記距離計測装置の内部又は外部の温度を計測する温度の計測手段を備え、
前記第2算出手段は、前記温度を加味して前記調整量を算出することを特徴とする構成2に記載の距離計測装置。
(構成4) 前記第2算出手段は、前記第1位置における基線長及び前記第2位置における基線長を加味して前記調整量を算出することを特徴とする構成1乃至3のいずれか一項に記載の距離計測装置。
(構成5) 前記第2算出手段は、前記第1位置および前記第2位置における視差画像の対称性の相違を加味して前記調整量を算出することを特徴とする構成1乃至4のいずれか一項に記載の距離計測装置。
(構成6) 前記第2算出手段は、前記第2位置における前記ピント距離が前記被写体距離と同じとなるように前記調整量を算出することを特徴とする構成1乃至3のいずれか一項に記載の距離計測装置。
(構成7) 前記第1位置で前記集光点が前記被写体に合うように前記ピント距離の仮ピント調整を行う仮ピント調整手段と、
前記ピント距離の仮ピント調整の後の前記結像光学系によって取得された撮影画像について画像認識処理を行う画像認識手段と、を備えることを特徴とする構成1乃至6のいずれか一項に記載の距離計測装置。
(構成8) 前記第1算出手段は、前記ピント距離の仮ピント調整の後の前記結像光学系によって前記被写体が撮影された前記撮影画面の前記第1位置において前記被写体距離を算出することを特徴とする構成7に記載の距離計測装置。
(構成9) 前記第1算出手段は、前記ピント距離の調整の前の前記結像光学系によって取得された視差画像に基づいて前記被写体距離を算出することを特徴とする構成1乃至7のいずれか一項に記載の距離計測装置。
(構成10) 前記第1位置をユーザが指定することが可能な指定手段を備えることを特徴とする構成1乃至9のいずれか一項に記載の距離計測装置。
(構成11) 前記第1位置は前記撮影画面の画面中央であり、前記第2位置は前記撮影画面の画面周辺であることを特徴とする構成1乃至10のいずれか一項に記載の距離計測装置。
(構成12) 前記撮影画面の画面中央のコントラストと前記撮影画面の画面周辺の両端のコントラストを算出する第3算出手段を備え、
前記生成手段は、前記撮影画面の画面中央のコントラストに対する前記撮影画面の画面周辺の少なくとも一端のコントラストの割合が所定割合よりも大きい場合、前記ピント調整手段による前記ピント距離の調整が行われない前記結像光学系によって取得された視差画像に基づいて、前記被写体の距離画像を生成することを特徴とする構成1乃至11のいずれか一項に記載の距離計測装置。
(構成13) 構成1乃至12のいずれか一項に記載の距離計測装置と、
前記視差画像から算出される前記被写体の距離情報及び前記距離画像を記憶する記憶手段と、
前記距離情報及び前記距離画像を表示する表示手段と、を備えることを特徴とする撮像装置。
(方法1) 結像光学系によって被写体が撮影された撮影画面の第1位置において、前記結像光学系の光軸方向における前記結像光学系から前記被写体までの距離を被写体距離として算出する第1算出工程と、
前記光軸方向における前記結像光学系から前記結像光学系の集光点までの距離であるピント距離の調整量を前記被写体距離を用いて算出する第2算出工程と、
前記ピント距離を前記調整量だけ変化させることによって、前記ピント距離の調整を行うピント調整工程と、
前記ピント距離の調整の後の前記結像光学系によって取得された視差画像に基づいて、前記被写体の距離画像を生成する生成工程と、を備え、
前記第2算出工程は、前記撮影画面の第2位置における前記ピント距離と前記被写体距離の差が、前記第1位置における前記ピント距離と前記被写体距離の差よりも小さくなるように、前記調整量を算出することを特徴とする距離計測装置の制御方法。
(プログラム1) 構成1乃至12のずれか一項に記載の距離計測装置の各手段をコンピュータに実行させるためのプログラム。
The disclosure of this embodiment includes the following configuration, method, and program.
(Configuration 1) A first calculation means for calculating a distance from the imaging optical system to the subject in an optical axis direction of the imaging optical system at a first position of a photographing screen where the subject is photographed by the imaging optical system, as a subject distance;
a second calculation means for calculating an adjustment amount of a focus distance, which is a distance from the imaging optical system to a light condensing point of the imaging optical system in the optical axis direction, using the subject distance;
a focus adjustment unit that adjusts the focus distance by changing the focus distance by the adjustment amount;
a generating unit that generates a distance image of the subject based on a parallax image acquired by the imaging optical system after the focus distance is adjusted,
a second calculation means for calculating the adjustment amount so that a difference between the focus distance and the subject distance at a second position of the shooting screen is smaller than a difference between the focus distance and the subject distance at the first position of the shooting screen.
(Configuration 2) The distance measurement device according to configuration 1, wherein the second calculation means calculates the adjustment amount based on an amount of field curvature of the imaging optical system.
(Configuration 3) A temperature measuring means for measuring an internal or external temperature of the distance measuring device is provided,
3. The distance measurement device according to configuration 2, wherein the second calculation means calculates the adjustment amount taking into account the temperature.
(Configuration 4) The distance measurement device according to any one of configurations 1 to 3, wherein the second calculation means calculates the adjustment amount by taking into account a base line length at the first position and a base line length at the second position.
(Configuration 5) The distance measuring device according to any one of configurations 1 to 4, wherein the second calculation means calculates the adjustment amount by taking into account a difference in symmetry between the parallax images at the first position and the second position.
(Configuration 6) The distance measurement device according to any one of configurations 1 to 3, wherein the second calculation means calculates the adjustment amount so that the focus distance at the second position is equal to the subject distance.
(Configuration 7) A temporary focus adjustment unit that performs temporary focus adjustment of the focal distance so that the light condensing point is aligned with the subject at the first position;
The distance measurement device according to any one of configurations 1 to 6, further comprising: an image recognition means for performing image recognition processing on a captured image acquired by the imaging optical system after the temporary focus adjustment of the focus distance.
(Configuration 8) The distance measurement device according to Configuration 7, wherein the first calculation means calculates the subject distance at the first position on the shooting screen where the subject is photographed by the imaging optical system after a temporary focus adjustment of the focus distance.
(Configuration 9) The distance measuring device according to any one of configurations 1 to 7, wherein the first calculation means calculates the subject distance based on a parallax image acquired by the imaging optical system before adjustment of the focus distance.
(Configuration 10) The distance measurement device according to any one of configurations 1 to 9, further comprising a designation means that enables a user to designate the first position.
(Configuration 11) The distance measurement device according to any one of configurations 1 to 10, wherein the first position is a center of the image capture screen, and the second position is a periphery of the image capture screen.
(Configuration 12) A third calculation means for calculating a contrast at a center of the image capturing screen and a contrast at both ends of the image capturing screen,
The distance measurement device described in any one of configurations 1 to 11, characterized in that when the ratio of the contrast of at least one edge of the periphery of the shooting screen to the contrast of the center of the shooting screen is greater than a predetermined ratio, the generation means generates a distance image of the subject based on a parallax image acquired by the imaging optical system in which the focus distance is not adjusted by the focus adjustment means.
(Configuration 13) A distance measurement device according to any one of configurations 1 to 12,
a storage means for storing the distance image and distance information of the object calculated from the parallax image;
and a display unit for displaying the distance information and the distance image.
(Method 1) A first calculation step of calculating, as a subject distance, a distance from the imaging optical system to the subject in an optical axis direction of the imaging optical system at a first position on a photographing screen where the subject is photographed by the imaging optical system;
a second calculation step of calculating, using the subject distance, an adjustment amount of a focus distance, which is a distance from the imaging optical system to a light condensing point of the imaging optical system in the optical axis direction;
a focus adjustment step of adjusting the focus distance by changing the focus distance by the adjustment amount;
generating a distance image of the subject based on a parallax image acquired by the imaging optical system after the focus distance is adjusted;
A control method for a distance measurement device, characterized in that the second calculation step calculates the adjustment amount so that the difference between the focus distance and the subject distance at a second position on the shooting screen is smaller than the difference between the focus distance and the subject distance at the first position.
(Program 1) A program for causing a computer to execute each means of the distance measurement device according to any one of configurations 1 to 12.

10 結像光学系
12 ピント調整部(第2算出手段)(ピント調整手段)
17 距離演算部(第1算出手段)(生成手段)
30、31 距離(ピント距離)
36、37 集光点
38 距離(被写体距離)
40 調整量
100 距離計測装置
101 被写体
500 撮影画面
10: Imaging optical system 12: Focus adjustment unit (second calculation means) (focus adjustment means)
17 Distance calculation unit (first calculation means) (generation means)
30, 31 Distance (focus distance)
36, 37 Focus point 38 Distance (subject distance)
40 Adjustment amount 100 Distance measurement device 101 Subject 500 Shooting screen

Claims (15)

結像光学系によって被写体が撮影された撮影画面の第1位置において、前記結像光学系の光軸方向における前記結像光学系から前記被写体までの距離を被写体距離として算出する第1算出手段と、
前記光軸方向における前記結像光学系から前記結像光学系の集光点までの距離であるピント距離の調整量を前記被写体距離を用いて算出する第2算出手段と、
前記ピント距離を前記調整量だけ変化させることによって、前記ピント距離の調整を行うピント調整手段と、
前記ピント距離の調整の後の前記結像光学系によって取得された視差画像に基づいて、前記被写体の距離画像を生成する生成手段と、を備え、
前記第2算出手段は、前記撮影画面の第2位置における前記ピント距離と前記被写体距離の差が、前記第1位置における前記ピント距離と前記被写体距離の差よりも小さくなるように、前記調整量を算出することを特徴とする距離計測装置。
a first calculation means for calculating a distance from the imaging optical system to the subject in an optical axis direction of the imaging optical system at a first position on a photographing screen where the subject is photographed by the imaging optical system, as a subject distance;
a second calculation means for calculating an adjustment amount of a focus distance, which is a distance from the imaging optical system to a light condensing point of the imaging optical system in the optical axis direction, using the subject distance;
a focus adjustment unit that adjusts the focus distance by changing the focus distance by the adjustment amount;
a generating unit that generates a distance image of the subject based on a parallax image acquired by the imaging optical system after the focus distance is adjusted,
a second calculation means for calculating the adjustment amount so that a difference between the focus distance and the subject distance at a second position of the shooting screen is smaller than a difference between the focus distance and the subject distance at the first position of the shooting screen.
前記第2算出手段は、前記結像光学系の像面湾曲量に基づいて前記調整量を算出することを特徴とする請求項1に記載の距離計測装置。 The distance measurement device according to claim 1, characterized in that the second calculation means calculates the adjustment amount based on the amount of field curvature of the imaging optical system. 前記距離計測装置の内部又は外部の温度を計測する温度の計測手段を備え、
前記第2算出手段は、前記温度を加味して前記調整量を算出することを特徴とする請求項2に記載の距離計測装置。
A temperature measuring means for measuring an internal or external temperature of the distance measuring device is provided,
3. The distance measurement device according to claim 2, wherein the second calculation means calculates the adjustment amount taking into account the temperature.
前記第2算出手段は、前記第1位置における基線長及び前記第2位置における基線長を加味して前記調整量を算出することを特徴とする請求項1に記載の距離計測装置。 The distance measurement device according to claim 1, characterized in that the second calculation means calculates the adjustment amount by taking into account the baseline length at the first position and the baseline length at the second position. 前記第2算出手段は、前記第1位置および前記第2位置における視差画像の対称性の相違を加味して前記調整量を算出することを特徴とする請求項1に記載の距離計測装置。 The distance measurement device according to claim 1, characterized in that the second calculation means calculates the adjustment amount taking into account the difference in symmetry of the parallax images at the first position and the second position. 前記第2算出手段は、前記第2位置における前記ピント距離が前記被写体距離と同じとなるように前記調整量を算出することを特徴とする請求項1に記載の距離計測装置。 The distance measurement device according to claim 1, characterized in that the second calculation means calculates the adjustment amount so that the focus distance at the second position is the same as the subject distance. 前記第1位置で前記集光点が前記被写体に合うように前記ピント距離の仮ピント調整を行う仮ピント調整手段と、
前記ピント距離の仮ピント調整の後の前記結像光学系によって取得された撮影画像について画像認識処理を行う画像認識手段と、を備えることを特徴とする請求項1に記載の距離計測装置。
a temporary focus adjustment means for performing a temporary focus adjustment of the focal distance so that the light condensing point coincides with the subject at the first position;
2. The distance measurement device according to claim 1, further comprising: an image recognition unit that performs an image recognition process on the captured image acquired by the imaging optical system after the temporary focus adjustment of the focus distance.
前記第1算出手段は、前記ピント距離の仮ピント調整の後の前記結像光学系によって前記被写体が撮影された前記撮影画面の前記第1位置において前記被写体距離を算出することを特徴とする請求項7に記載の距離計測装置。 The distance measurement device according to claim 7, characterized in that the first calculation means calculates the subject distance at the first position on the photographic screen where the subject is photographed by the imaging optical system after the temporary focus adjustment of the focal distance. 前記第1算出手段は、前記ピント距離の調整の前の前記結像光学系によって取得された視差画像に基づいて前記被写体距離を算出することを特徴とする請求項1に記載の距離計測装置。 The distance measurement device according to claim 1, characterized in that the first calculation means calculates the subject distance based on a parallax image acquired by the imaging optical system before adjusting the focal distance. 前記第1位置をユーザが指定することが可能な指定手段を備えることを特徴とする請求項1に記載の距離計測装置。 The distance measurement device according to claim 1, characterized in that it is provided with a designation means that allows a user to designate the first position. 前記第1位置は前記撮影画面の画面中央であり、前記第2位置は前記撮影画面の画面周辺であることを特徴とする請求項1に記載の距離計測装置。 The distance measurement device according to claim 1, characterized in that the first position is the center of the image capture screen, and the second position is the periphery of the image capture screen. 前記撮影画面の画面中央のコントラストと前記撮影画面の画面周辺の両端のコントラストを算出する第3算出手段を備え、
前記生成手段は、前記撮影画面の画面中央のコントラストに対する前記撮影画面の画面周辺の少なくとも一端のコントラストの割合が所定割合よりも大きい場合、前記ピント調整手段による前記ピント距離の調整が行われない前記結像光学系によって取得された視差画像に基づいて、前記被写体の距離画像を生成することを特徴とする請求項1に記載の距離計測装置。
a third calculation means for calculating a contrast at a center of the photographic screen and a contrast at both ends of the periphery of the photographic screen;
The distance measurement device described in claim 1, characterized in that the generation means generates a distance image of the subject based on a parallax image acquired by the imaging optical system in which the focus distance is not adjusted by the focus adjustment means when a ratio of contrast at at least one edge of the periphery of the shooting screen to a contrast at the center of the shooting screen is greater than a predetermined ratio.
請求項1に記載の距離計測装置と、
前記視差画像から算出される前記被写体の距離情報及び前記距離画像を記憶する記憶手段と、
前記距離情報及び前記距離画像を表示する表示手段と、を備えることを特徴とする撮像装置。
A distance measurement device according to claim 1 ;
a storage means for storing the distance image and distance information of the object calculated from the parallax image;
and a display unit for displaying the distance information and the distance image.
結像光学系によって被写体が撮影された撮影画面の第1位置において、前記結像光学系の光軸方向における前記結像光学系から前記被写体までの距離を被写体距離として算出する第1算出工程と、
前記光軸方向における前記結像光学系から前記結像光学系の集光点までの距離であるピント距離の調整量を前記被写体距離を用いて算出する第2算出工程と、
前記ピント距離を前記調整量だけ変化させることによって、前記ピント距離の調整を行うピント調整工程と、
前記ピント距離の調整の後の前記結像光学系によって取得された視差画像に基づいて、前記被写体の距離画像を生成する生成工程と、を備え、
前記第2算出工程は、前記撮影画面の第2位置における前記ピント距離と前記被写体距離の差が、前記第1位置における前記ピント距離と前記被写体距離の差よりも小さくなるように、前記調整量を算出することを特徴とする距離計測装置の制御方法。
a first calculation step of calculating, as a subject distance, a distance from the imaging optical system to the subject in an optical axis direction of the imaging optical system at a first position on a photographing screen where the subject is photographed by the imaging optical system;
a second calculation step of calculating, using the subject distance, an adjustment amount of a focus distance, which is a distance from the imaging optical system to a light condensing point of the imaging optical system in the optical axis direction;
a focus adjustment step of adjusting the focus distance by changing the focus distance by the adjustment amount;
generating a distance image of the subject based on a parallax image acquired by the imaging optical system after the focus distance is adjusted;
A control method for a distance measurement device, characterized in that the second calculation step calculates the adjustment amount so that the difference between the focus distance and the subject distance at a second position on the shooting screen is smaller than the difference between the focus distance and the subject distance at the first position.
請求項1に記載の距離計測装置の各手段をコンピュータに実行させるためのプログラム。 A program for causing a computer to execute each means of the distance measurement device described in claim 1.
JP2022166251A 2022-10-17 2022-10-17 Distance measuring device, imaging apparatus, and control method and program for distance measuring device Pending JP2024058870A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022166251A JP2024058870A (en) 2022-10-17 2022-10-17 Distance measuring device, imaging apparatus, and control method and program for distance measuring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022166251A JP2024058870A (en) 2022-10-17 2022-10-17 Distance measuring device, imaging apparatus, and control method and program for distance measuring device

Publications (1)

Publication Number Publication Date
JP2024058870A true JP2024058870A (en) 2024-04-30

Family

ID=90826917

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022166251A Pending JP2024058870A (en) 2022-10-17 2022-10-17 Distance measuring device, imaging apparatus, and control method and program for distance measuring device

Country Status (1)

Country Link
JP (1) JP2024058870A (en)

Similar Documents

Publication Publication Date Title
US9635243B2 (en) Ranging apparatus, imaging apparatus, and ranging method
JP6091228B2 (en) Image processing apparatus and imaging apparatus
US20120268613A1 (en) Image capturing apparatus and control method thereof
JP5676962B2 (en) Focus detection apparatus and imaging apparatus
JP6053347B2 (en) Imaging apparatus, control method therefor, and program
WO2014171304A1 (en) Imaging device, imaging device drive method, and imaging device control program
JP5743519B2 (en) Imaging apparatus and control method thereof
JP2012500506A (en) Camera and camera control method
JP4923587B2 (en) Focus detection apparatus, method and camera
JP6353233B2 (en) Image processing apparatus, imaging apparatus, and image processing method
JP2016066995A (en) Image deviation amount calculation device, imaging device and image deviation amount calculation method
JP2007233033A (en) Focusing device and imaging apparatus
JP2017194591A (en) Distance measurement device, imaging apparatus, and distance measurement method
JP2014194502A (en) Imaging apparatus and imaging system
JP2016142924A (en) Imaging apparatus, method of controlling the same, program, and storage medium
JP2024058870A (en) Distance measuring device, imaging apparatus, and control method and program for distance measuring device
JP2023083980A (en) Distance measuring device, distance detection art and imaging device
US11295464B2 (en) Shape measurement device, control method, and recording medium
JP2014142497A (en) Imaging apparatus and method for controlling the same
JP6576114B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP5251203B2 (en) Image processing apparatus and image processing program
JP6573382B2 (en) Imaging apparatus and photometric method
JP2020036091A (en) Imaging device and control method therefor, program, and storage medium
JP6455582B2 (en) Imaging device
US20220232166A1 (en) Range measurement apparatus, storage medium and range measurement method