JP2012107971A - Picture processing device and distance measuring device - Google Patents

Picture processing device and distance measuring device Download PDF

Info

Publication number
JP2012107971A
JP2012107971A JP2010256576A JP2010256576A JP2012107971A JP 2012107971 A JP2012107971 A JP 2012107971A JP 2010256576 A JP2010256576 A JP 2010256576A JP 2010256576 A JP2010256576 A JP 2010256576A JP 2012107971 A JP2012107971 A JP 2012107971A
Authority
JP
Japan
Prior art keywords
measurement
distance
measurement position
image
subject
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
JP2010256576A
Other languages
Japanese (ja)
Inventor
Hiroshi Yamato
宏 大和
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.)
Konica Minolta Inc
Original Assignee
Konica Minolta 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 Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2010256576A priority Critical patent/JP2012107971A/en
Publication of JP2012107971A publication Critical patent/JP2012107971A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Stereoscopic And Panoramic Photography (AREA)
  • Image Processing (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a technique that can realize stereoscopic representation matching a given scene of photographic shooting.SOLUTION: A picture processing device comprises a first range finder 12 that measures in a preliminary measuring position in a photographic shooting area the distance to an object in the shooting area and thereby acquires a set of distance information; setting means that sets the final measuring position in the photographic shooting area for additionally measuring the distance to the object in the shooting area on the basis of the set of distance information acquired by the first range finder 12; a second range finder 13 that acquires another set of distance information by measuring the distance in the final measuring position; and a parallax information generator 15 that generates parallax information on the basis of the sets of distance information acquired by the first range finder 12 and the second range finder 13; and a stereoscopic picture generator 16 that generates a stereoscopic picture on the basis of the parallax information.

Description

本発明は、画像処理技術に関する。   The present invention relates to an image processing technique.

近年、3次元の立体画像を視認可能な3次元テレビの普及が進んでいる。しかし、ハード面での普及が進む一方で、立体表示可能なソフト(コンテンツ)の量は依然として少ないため、立体画像を容易に作成可能な技術が望まれている。   In recent years, three-dimensional televisions capable of visually recognizing three-dimensional stereoscopic images have been spreading. However, since the amount of software (content) that can be stereoscopically displayed is still small while the spread of hardware is progressing, a technique that can easily create a stereoscopic image is desired.

しかし、単純に複数台のカメラにより取得した画像を立体画像として用いると、表示ディスプレイの大きさ次第では、立体感に欠ける画像となる可能性がある。   However, if images acquired by a plurality of cameras are simply used as a stereoscopic image, there is a possibility that the image lacks a stereoscopic effect depending on the size of the display.

個々のディスプレイに適した立体感を得るには、視差の調整を行うことが重要である。一般的に、視差の調整を正確に行う手法としては、例えば特許文献1のように、2台のカメラによってステレオ撮影された2枚の画像相互間で対応点探索を行い、カメラから各被写体までの距離を計測した上で、計測された距離に応じて視差量を補正する手法が存在する。   It is important to adjust parallax in order to obtain a stereoscopic effect suitable for each display. In general, as a method for accurately adjusting parallax, for example, as in Patent Document 1, a corresponding point search is performed between two images captured in stereo by two cameras, and the camera to each subject. There is a method for correcting the amount of parallax according to the measured distance.

特開2005−210217号公報Japanese Patent Laying-Open No. 2005-210217

しかし、上記手法では、撮影対象となる被写体に応じた距離計測が行われていないため、撮影シーンに応じた立体表示を行うことが困難となっていた。例えば、撮影対象が物体(または人物)である場合、立体表示においては、撮影対象となる物体の形状を精度よく表現することが重要となるが、上記手法では、全ての被写体に対して距離計測を行い、視差量を補正することになるため、撮影対象となる物体の形状を精度よく表現し、撮影シーンに応じた立体表示を行うことができなかった。   However, in the above method, since distance measurement according to the subject to be photographed is not performed, it has been difficult to perform stereoscopic display according to the photographing scene. For example, when the subject to be photographed is an object (or person), it is important to accurately represent the shape of the object to be photographed in stereoscopic display. However, in the above method, distance measurement is performed on all subjects. Since the amount of parallax is corrected, the shape of the object to be photographed can be accurately expressed and stereoscopic display according to the photographing scene cannot be performed.

そこで、本発明は、撮影シーンに応じた立体表示を実現することが可能な技術を提供することを目的とする。   Therefore, an object of the present invention is to provide a technique capable of realizing a stereoscopic display according to a shooting scene.

上記の課題を解決するため、請求項1の発明は、画像処理装置であって、撮影領域における被写体までの距離計測を、前記撮影領域に設定された第1計測位置において行って、第1距離情報を取得する第1計測手段と、前記第1距離情報に基づいて、撮影領域における被写体までの距離計測を追加して行うための第2計測位置を前記撮影領域において設定する設定手段と、前記第2計測位置において距離計測を行って、第2距離情報を取得する第2計測手段と、第1距離情報および第2距離情報に基づいて、視差情報を生成する視差情報生成手段と、前記視差情報に基づいて立体画像を生成する画像生成手段とを備える。   In order to solve the above problems, the invention of claim 1 is an image processing apparatus, wherein distance measurement to a subject in a photographing region is performed at a first measurement position set in the photographing region, and a first distance is obtained. First measurement means for acquiring information, setting means for setting a second measurement position in the imaging area for performing distance measurement to the subject in the imaging area based on the first distance information, A second measurement unit configured to perform distance measurement at the second measurement position and obtain second distance information; a parallax information generation unit configured to generate parallax information based on the first distance information and the second distance information; and the parallax. Image generating means for generating a stereoscopic image based on the information.

また、請求項2の発明は、請求項1の発明に係る画像処理装置において、前記設定手段は、前記第1距離情報に基づいて、前記第2計測位置を定めた複数の計測パターンの中から、1つの計測パターンを選択する。   According to a second aspect of the present invention, in the image processing apparatus according to the first aspect of the present invention, the setting unit is configured to select the second measurement position from a plurality of measurement patterns based on the first distance information. One measurement pattern is selected.

また、請求項3の発明は、請求項1の発明に係る画像処理装置において、前記設定手段は、第1計測位置において計測された被写体までの距離が近距離であったとき、当該第1計測位置の周辺に前記第2計測位置を設定する。   According to a third aspect of the present invention, in the image processing apparatus according to the first aspect of the invention, when the distance to the subject measured at the first measurement position is a short distance, the setting means performs the first measurement. The second measurement position is set around the position.

また、請求項4の発明は、請求項1の発明に係る画像処理装置において、前記設定手段は、前記第1計測位置を囲む閉領域において前記第2計測位置を設定し、前記設定手段は、第1計測位置において計測された被写体までの距離が近距離であったときは、当該第1計測位置に関する閉領域を比較的大きい領域とし、第1計測位置において計測された被写体までの距離が遠距離であったときは、当該第1計測位置に関する閉領域を比較的小さい領域とする。   According to a fourth aspect of the present invention, in the image processing apparatus according to the first aspect of the invention, the setting unit sets the second measurement position in a closed region surrounding the first measurement position, and the setting unit includes: When the distance to the subject measured at the first measurement position is a short distance, the closed region related to the first measurement position is a relatively large region, and the distance to the subject measured at the first measurement position is long. When the distance is a distance, the closed region related to the first measurement position is set as a relatively small region.

また、請求項5の発明は、請求項4の発明に係る画像処理装置において、前記設定手段は、第1計測位置において計測された被写体までの距離が近距離であったときは、当該第1計測位置に関する閉領域内において前記第2計測位置を密に設定し、第1計測位置において計測された被写体までの距離が遠距離であったときは、当該第1計測位置に関する閉領域内において前記第2計測位置を粗く設定する。   The invention according to claim 5 is the image processing apparatus according to claim 4, wherein the setting means is configured such that when the distance to the subject measured at the first measurement position is a short distance, When the second measurement position is densely set in the closed region related to the measurement position and the distance to the subject measured at the first measurement position is a long distance, the second measurement position is set in the closed region related to the first measurement position. The second measurement position is set coarsely.

また、請求項6の発明は、請求項1から請求項5のいずれかの発明に係る画像処理装置において、前記被写体についてのステレオ画像を取得する画像取得手段をさらに備え、前記第1計測手段および前記第2計測手段は、前記ステレオ画像を用いて距離計測を行う。   The invention according to claim 6 is the image processing apparatus according to any one of claims 1 to 5, further comprising image acquisition means for acquiring a stereo image of the subject, wherein the first measurement means and The second measuring unit performs distance measurement using the stereo image.

また、請求項7の発明は、請求項1の発明に係る画像処理装置において、前記被写体についてのステレオ画像を取得する画像取得手段をさらに備え、前記画像取得手段は、第1ステレオ画像と、当該第1ステレオ画像よりも時間的に後に撮影された第2ステレオ画像とを取得し、前記第1計測手段は、前記第1ステレオ画像を用いて距離計測を行って、第1距離情報を取得し、前記第2計測手段は、前記第1ステレオ画像を用いた距離計測によって取得された第1距離情報に基づいて設定される第2計測位置において、前記第2ステレオ画像を用いた距離計測を行う。   The invention of claim 7 is the image processing apparatus according to the invention of claim 1, further comprising image acquisition means for acquiring a stereo image of the subject, wherein the image acquisition means includes the first stereo image, A second stereo image taken after the first stereo image is acquired, and the first measurement means performs distance measurement using the first stereo image to acquire first distance information. The second measurement unit performs distance measurement using the second stereo image at a second measurement position set based on the first distance information acquired by distance measurement using the first stereo image. .

また、請求項8の発明は、請求項7の発明に係る画像処理装置において、前記第2計測手段は、前記第2ステレオ画像を用いた距離計測を、前記第1計測位置においても行って、第1距離情報を新たに取得し、前記設定手段は、新たに取得された第1距離情報に基づいて、前記第2計測位置を再設定する。   The invention according to claim 8 is the image processing apparatus according to claim 7, wherein the second measurement means performs distance measurement using the second stereo image also at the first measurement position, First distance information is newly acquired, and the setting means resets the second measurement position based on the newly acquired first distance information.

また、請求項9の発明は、請求項7または請求項8の発明に係る画像処理装置において、前記設定手段は、前記第1ステレオ画像および前記第2ステレオ画像それぞれに含まれる時間的に前後するフレーム間で被写体の動きベクトルを算出し、当該動きベクトルに基づいて前記第1計測位置を変更する。   According to a ninth aspect of the present invention, in the image processing device according to the seventh or eighth aspect of the present invention, the setting unit is moved back and forth in time included in each of the first stereo image and the second stereo image. A motion vector of the subject is calculated between the frames, and the first measurement position is changed based on the motion vector.

また、請求項10の発明は、請求項6から請求項9のいずれかの発明に係る画像処理装置において、前記第1計測位置は、前記ステレオ画像に含まれる1の画像から抽出された被写体領域において、当該被写体領域の中心付近に設定される。   According to a tenth aspect of the present invention, in the image processing device according to any of the sixth to ninth aspects, the first measurement position is a subject area extracted from one image included in the stereo image. Is set near the center of the subject area.

また、請求項11の発明は、請求項6から請求項10のいずれかの発明に係る画像処理装置において、前記第1計測位置および前記第2計測位置の総数は、1の前記ステレオ画像を用いた距離計測において、所定数以下となるように設定される。   The invention according to claim 11 is the image processing apparatus according to any one of claims 6 to 10, wherein the total number of the first measurement position and the second measurement position is one using the stereo image. The distance is set to be a predetermined number or less in the distance measurement.

また、請求項12の発明は、請求項1の発明に係る画像処理装置において、前記設定手段は、撮影領域における中心付近の第1計測位置における距離が、他の第1計測位置における距離に比べて近距離であった場合、撮影領域の中心付近において第2計測位置を密に設定し、撮影領域の端付近において、第2計測位置を粗く設定する。   According to a twelfth aspect of the present invention, in the image processing apparatus according to the first aspect of the invention, the setting means is configured such that the distance at the first measurement position in the vicinity of the center in the imaging region is larger than the distance at the other first measurement position. If the distance is short, the second measurement position is set densely near the center of the shooting area, and the second measurement position is set coarsely near the edge of the shooting area.

また、請求項13の発明は、請求項6から請求項11のいずれかの発明に係る画像処理装置において、前記設定手段は、前記ステレオ画像に含まれる1の画像を用いて被写体の距離情報を推定し、推定された距離情報を反映して、第2計測位置を変更する。   The invention according to claim 13 is the image processing apparatus according to any one of claims 6 to 11, wherein the setting means obtains subject distance information using one image included in the stereo image. The second measurement position is changed by reflecting the estimated distance information.

また、請求項14の発明は、距離計測装置であって、撮影領域における被写体までの距離計測を、前記撮影領域に設定された第1計測位置において行って、第1距離情報を取得する第1計測手段と、前記第1距離情報に基づいて、撮影領域における被写体までの距離計測を追加して行うための第2計測位置を前記撮影領域において設定する設定手段と、前記第2計測位置において距離計測を行って、第2距離情報を取得する第2計測手段とを備える。   In a fourteenth aspect of the present invention, the distance measuring device is a first distance measurement device that performs distance measurement to a subject in a shooting area at a first measurement position set in the shooting area and acquires first distance information. Measuring means; setting means for setting a second measurement position in the shooting area for performing distance measurement to the subject in the shooting area based on the first distance information; and distance at the second measurement position A second measuring unit that performs measurement and acquires second distance information.

本発明によれば、撮影シーンに応じた立体表示を実現することが可能になる。   According to the present invention, it is possible to realize a stereoscopic display according to a shooting scene.

本発明の第1実施形態に係る撮像装置の外観構成を示す図である。1 is a diagram illustrating an external configuration of an imaging apparatus according to a first embodiment of the present invention. 本発明の第1実施形態に係る撮像装置の外観構成を示す図である。1 is a diagram illustrating an external configuration of an imaging apparatus according to a first embodiment of the present invention. 撮像装置によって取得された2枚の画像を示す図である。It is a figure which shows two images acquired by the imaging device. 撮像装置の内部構成を示す図である。It is a figure which shows the internal structure of an imaging device. 撮像装置の機能ブロック図である。It is a functional block diagram of an imaging device. 立体画像が生成される様子を示す図である。It is a figure which shows a mode that a stereo image is produced | generated. 立体画像が生成される様子を示す図である。It is a figure which shows a mode that a stereo image is produced | generated. 撮像装置の動作に関するフローチャートである。It is a flowchart regarding operation | movement of an imaging device. 撮影領域において設定された予備計測位置を示す図である。It is a figure which shows the preliminary measurement position set in the imaging | photography area | region. 本計測位置の計測パターンを示す図である。It is a figure which shows the measurement pattern of this measurement position. 本計測位置の計測パターンを示す図である。It is a figure which shows the measurement pattern of this measurement position. 本計測位置の計測パターンを示す図である。It is a figure which shows the measurement pattern of this measurement position. 本計測位置の計測パターンを示す図である。It is a figure which shows the measurement pattern of this measurement position. 本計測位置の計測パターンを示す図である。It is a figure which shows the measurement pattern of this measurement position. 画像を構成する画素を分割して、サブピクセルを設定する様子を示す図である。It is a figure which shows a mode that the pixel which comprises an image is divided | segmented and a subpixel is set. 撮影領域において設定された予備計測位置を示す図である。It is a figure which shows the preliminary measurement position set in the imaging | photography area | region. 予備計測位置における計測結果を示す図である。It is a figure which shows the measurement result in a preliminary measurement position. 設定された本計測位置を示す図である。It is a figure which shows the set this measurement position. 粗領域および密領域の設定例を示す図である。It is a figure which shows the example of a setting of a coarse area | region and a dense area | region. 第1距離計測および第2距離計測の際に実行される動作のフローチャートである。It is a flowchart of the operation | movement performed in the case of a 1st distance measurement and a 2nd distance measurement. 第5実施形態に係る撮像装置において実行される、第1距離計測および第2距離計測の動作フローチャートである。It is an operation | movement flowchart of 1st distance measurement and 2nd distance measurement performed in the imaging device which concerns on 5th Embodiment.

以下、本発明の各実施形態について図面を参照して説明する。   Embodiments of the present invention will be described below with reference to the drawings.

<1.第1実施形態>
[1−1.外観構成]
図1および図2は、本発明の第1実施形態に係る撮像装置1Aの外観構成を示す図である。図3は、撮像装置1Aによって取得された2枚の画像を示す図である。
<1. First Embodiment>
[1-1. Appearance configuration]
1 and 2 are diagrams showing an external configuration of an imaging apparatus 1A according to the first embodiment of the present invention. FIG. 3 is a diagram illustrating two images acquired by the imaging apparatus 1A.

図1に示されるように、撮像装置1Aは、互いに基線長L分だけ離れて配置された主撮像部MCと副撮像部(補助撮像部)SCとを有している。このように、2つの撮像部MC,SCを有する撮像装置1Aは、被写体をステレオ撮影するステレオカメラとして機能する。   As shown in FIG. 1, the imaging apparatus 1 </ b> A includes a main imaging unit MC and a sub imaging unit (auxiliary imaging unit) SC that are separated from each other by a base line length L. Thus, the imaging device 1A having the two imaging units MC and SC functions as a stereo camera that takes a subject in stereo.

主撮像部MCおよび副撮像部SCからは、同じ精度の画像が取得される態様であってもよく、異なる精度の画像が取得される態様であってもよい。ここでは、例えば、主撮像部MCとして、ハイビジョン放送対応レンズ(HDTVレンズ)を有した比較的高解像度の画像を取得可能なカメラユニットを用い、副撮像部SCとして、比較的低解像度の画像を取得するマイクロカメラユニット(MCU)を用いるものとする。   From the main imaging unit MC and the sub imaging unit SC, an image with the same accuracy may be acquired, or an image with different accuracy may be acquired. Here, for example, a camera unit having a high-definition broadcast compatible lens (HDTV lens) that can acquire a relatively high resolution image is used as the main imaging unit MC, and a relatively low resolution image is used as the sub imaging unit SC. It is assumed that a micro camera unit (MCU) to be acquired is used.

このような撮像部MC,SCを有する撮像装置1Aからは、例えば、図3に示されるような2枚の画像(「ステレオ画像」とも称する)MG,SGが取得されることになる。2つの撮像部MC,SCは、同じ被写体(主被写体PSおよび背景BG)を撮像しているが、副撮像部SCの光軸は、基線長L分だけ主撮像部MCの光軸から離れているので、副撮像部SCで得られた画像(「参照画像」または「サブ画像」とも称する)SGと主撮像部MCで得られた画像(「基準画像」または「メイン画像」とも称する)MGとの間には視差に伴う差が生じる。   For example, two images (also referred to as “stereo images”) MG and SG as shown in FIG. 3 are acquired from the imaging apparatus 1A having such imaging units MC and SC. The two imaging units MC and SC are imaging the same subject (main subject PS and background BG), but the optical axis of the sub-imaging unit SC is separated from the optical axis of the main imaging unit MC by the baseline length L. Therefore, an image (also referred to as “reference image” or “sub-image”) SG obtained by the sub-imaging unit SC and an image (also referred to as “reference image” or “main image”) MG obtained by the main imaging unit MC. There is a difference due to parallax.

撮像装置1Aは、2つの撮像部MC,SCそれぞれによって、同じタイミングで異なる視点から撮影される2枚の画像MG,SGを用いることにより、2枚の画像相互間の対応点における視差を測定することができ、当該視差に基づいて、対応点における被写体と撮像装置1Aとの距離に関する情報(距離情報)を取得することができる。   The imaging apparatus 1A measures parallax at corresponding points between two images by using two images MG and SG taken from different viewpoints at the same timing by the two imaging units MC and SC, respectively. Based on the parallax, information about the distance between the subject at the corresponding point and the imaging device 1A (distance information) can be acquired.

本実施形態の撮像装置1Aでは、距離情報の取得に際し、最初に予備的に距離情報の取得が行われ、その後、予備的な距離情報の取得結果に基づいて、追加してさらに距離情報の取得が行われる。詳細は、後述する。   In the imaging apparatus 1A of the present embodiment, when acquiring distance information, distance information is first acquired preliminarily, and thereafter, additional distance information is acquired based on the preliminary distance information acquisition result. Is done. Details will be described later.

なお、撮像装置1Aにおいては、主撮像部MCおよび副撮像部SCの配列方向は、図1のように、水平面に対して垂直な方向(「縦方向」とも称する)であってもよく、図2のように、水平面に対して平行な方向(「横方向」とも称する)であってよい。2つの撮像部MC,SCを縦方向に配列することによれば、従来のカムコーダの形態を利用してコンパクトな構成とすることができる。   In the imaging apparatus 1A, the arrangement direction of the main imaging unit MC and the sub imaging unit SC may be a direction perpendicular to the horizontal plane (also referred to as “vertical direction”) as shown in FIG. 2 may be a direction parallel to the horizontal plane (also referred to as “lateral direction”). By arranging the two imaging units MC and SC in the vertical direction, a compact configuration can be achieved by utilizing the form of a conventional camcorder.

[1−2.内部構成]
次に、撮像装置1Aの内部構成について説明する。図4は、撮像装置1Aの内部構成を示す図である。
[1-2. Internal configuration]
Next, the internal configuration of the imaging apparatus 1A will be described. FIG. 4 is a diagram illustrating an internal configuration of the imaging apparatus 1A.

図4に示されるように、撮像装置1Aは、2つの撮像部MC,SCと、画像処理部3と、液晶ディスプレイ等で構成される表示部4と、ボタン等の操作部5とを有している。   As shown in FIG. 4, the imaging apparatus 1A includes two imaging units MC and SC, an image processing unit 3, a display unit 4 including a liquid crystal display, and an operation unit 5 such as buttons. ing.

主撮像部MCおよび副撮像部SCは、CCDまたはCMOS等の撮像素子を有し、同一の被写体に関する2つの画像信号(ここでは「画像」と略称している)を生成する。主撮像部MCおよび副撮像部SCから出力される画像および撮影条件を含むデータは、データ線LNを介して画像処理部3に入力される。   The main image capturing unit MC and the sub image capturing unit SC have an image sensor such as a CCD or a CMOS, and generate two image signals (abbreviated as “image” here) related to the same subject. Data including images and shooting conditions output from the main imaging unit MC and the sub imaging unit SC are input to the image processing unit 3 via the data line LN.

画像処理部3は、2つの撮像部MC,SCからのデータを受信するインターフェース(I/F)31と記憶装置32と全体制御部33とを備える。   The image processing unit 3 includes an interface (I / F) 31 that receives data from the two imaging units MC and SC, a storage device 32, and an overall control unit 33.

記憶装置32は、例えばメモリカード等で構成され、2つの撮像部MC,SCによって取得された基準画像MGおよび参照画像SGを記憶する。   The storage device 32 is constituted by, for example, a memory card or the like, and stores a standard image MG and a reference image SG acquired by the two imaging units MC and SC.

全体制御部33は、プロセッサとして動作するCPU34と、情報を一時的に記憶するRAM35と、プログラム等を記憶するROM36とを有し、撮像装置1Aの各部を統括的に制御する。全体制御部33は、ROM36内のプログラムを読み出してCPU34で実行することによって、各種機能を実現する。   The overall control unit 33 includes a CPU 34 that operates as a processor, a RAM 35 that temporarily stores information, and a ROM 36 that stores programs and the like, and comprehensively controls each unit of the imaging apparatus 1A. The overall control unit 33 implements various functions by reading a program in the ROM 36 and executing it by the CPU 34.

次に、撮像装置1Aで実現される機能について説明する。図5は、撮像装置1Aの機能ブロック図である。図6および図7は、立体画像が生成される様子を示す図である。   Next, functions realized by the imaging apparatus 1A will be described. FIG. 5 is a functional block diagram of the imaging apparatus 1A. 6 and 7 are diagrams illustrating how a stereoscopic image is generated.

図5に示されるように、撮像装置1Aは、撮影情報取得部11、第1距離計測部12、第2距離計測部13、カメラ情報記憶部14、視差情報生成部15、および立体画像生成部16を有している。なお、図5における、撮影情報取得部11、第1距離計測部12、第2距離計測部13、視差情報生成部15、および立体画像生成部16は、全体制御部33においてプログラムを実行することによって実現される機能を機能ブロックとして表したものである。   As illustrated in FIG. 5, the imaging apparatus 1A includes a shooting information acquisition unit 11, a first distance measurement unit 12, a second distance measurement unit 13, a camera information storage unit 14, a parallax information generation unit 15, and a stereoscopic image generation unit. 16. Note that the imaging information acquisition unit 11, the first distance measurement unit 12, the second distance measurement unit 13, the parallax information generation unit 15, and the stereoscopic image generation unit 16 in FIG. 5 execute a program in the overall control unit 33. The function realized by is expressed as a function block.

撮影情報取得部11は、主撮像部MCおよび副撮像部SCからステレオ画像(基準画像および参照画像)および撮影倍率等の撮影条件を含むデータを取得する。そして、撮影情報取得部11は、ステレオ画像を第1距離計測部12に出力する。   The imaging information acquisition unit 11 acquires data including imaging conditions such as a stereo image (standard image and reference image) and imaging magnification from the main imaging unit MC and the sub imaging unit SC. Then, the imaging information acquisition unit 11 outputs a stereo image to the first distance measurement unit 12.

第1距離計測部12および第2距離計測部13では、撮像装置1Aから被写体までの距離の計測が行われる。撮像装置1Aから被写体までの距離の計測手法としては、ここでは、ステレオ計測による手法が第1距離計測部12および第2距離計測部13において採用される。   The first distance measurement unit 12 and the second distance measurement unit 13 measure the distance from the imaging device 1A to the subject. Here, as a method for measuring the distance from the imaging apparatus 1A to the subject, a method using stereo measurement is employed in the first distance measuring unit 12 and the second distance measuring unit 13.

具体的には、第1距離計測部12(第2距離計測部13)は、基準画像MGおよび参照画像SGの相互間において、被写体上の対応点を特定して、対応点間の距離、すなわち対応点における被写体の視差を測定する。そして、第1距離計測部12は、2枚の画像の対応点における視差および三角測量の原理を利用して、対応点における被写体の3次元位置情報を算出する。そしてさらに、第1距離計測部12は、撮像装置1Aの位置と対応点における被写体の3次元位置情報とを用いて、対応点における被写体と撮像装置1Aとの距離情報を取得する。なお、3次元位置情報の算出は、カメラ情報記憶部14に記憶された主撮像部MCおよび副撮像部SCの位置および姿勢等の既知のカメラ情報(カメラパラメータ)をも用いて行われる。   Specifically, the first distance measuring unit 12 (second distance measuring unit 13) specifies corresponding points on the subject between the base image MG and the reference image SG, that is, the distance between the corresponding points, that is, The parallax of the subject at the corresponding point is measured. Then, the first distance measuring unit 12 calculates the three-dimensional position information of the subject at the corresponding points using the principles of parallax and triangulation at the corresponding points of the two images. Further, the first distance measurement unit 12 acquires distance information between the subject at the corresponding point and the imaging device 1A using the position of the imaging device 1A and the three-dimensional position information of the subject at the corresponding point. The calculation of the three-dimensional position information is also performed using known camera information (camera parameters) such as the positions and orientations of the main imaging unit MC and the sub imaging unit SC stored in the camera information storage unit 14.

本実施形態では、距離情報の取得に際し、第1距離計測部12において予備的に距離計測(「予備計測」とも称する)が行われ、第2距離計測部13では、当該予備計測の結果に基づいて、計測位置を追加して効率的に本計測が行われる。詳細は、後述する。   In the present embodiment, when the distance information is acquired, distance measurement (also referred to as “preliminary measurement”) is preliminarily performed in the first distance measurement unit 12, and the second distance measurement unit 13 is based on the result of the preliminary measurement. Thus, the main measurement is efficiently performed by adding the measurement position. Details will be described later.

視差情報生成部15(図5)は、第1距離計測部12および第2距離計測部13において取得された距離情報に基づいて、距離情報に応じた視差を取得し、視差情報を生成する。   The disparity information generation unit 15 (FIG. 5) acquires disparity according to the distance information based on the distance information acquired by the first distance measurement unit 12 and the second distance measurement unit 13, and generates disparity information.

立体画像生成部16は、視差情報生成部15で生成された視差情報に基づいて、基準画像をずらすことによって、立体画像を生成する。立体画像の生成手法としては、例えば、立体画像を構成する左目用画像および右目用画像のうち、どちらか一方の画像として基準画像MGを用い、他方の画像を新たに生成する手法を採用することができる。   The stereoscopic image generation unit 16 generates a stereoscopic image by shifting the reference image based on the parallax information generated by the parallax information generation unit 15. As a method for generating a stereoscopic image, for example, a method of using the reference image MG as one of the left-eye image and the right-eye image constituting the stereoscopic image and newly generating the other image is adopted. Can do.

当該手法では、図6に示されるように、例えば、基準画像MG1を左目用画像LG1としてそのまま用いた場合、立体画像生成部16は、視差情報に従って、基準画像MG1を水平方向(矢印YPの方向)に視差の値分ずらすことによって右目用画像RG1を生成する。左目用画像および右目用画像のうち、一方の画像として基準画像MGを用いることによれば、新たに生成する画像を1つにすることができるので、立体画像の生成処理を軽減することができる。   In this method, as illustrated in FIG. 6, for example, when the reference image MG1 is used as it is as the left-eye image LG1, the stereoscopic image generation unit 16 uses the reference image MG1 in the horizontal direction (the direction of the arrow YP) according to the parallax information. ) To generate the right-eye image RG1. By using the reference image MG as one of the left-eye image and the right-eye image, the number of newly generated images can be reduced to one, so that the three-dimensional image generation processing can be reduced. .

また、立体画像の生成手法としては、例えば、左目用画像および右目用画像の両方の画像を新たに生成する手法を採用してもよい。当該手法では、図7に示されるように、基準画像MG1を水平方向に視差の値の半分ずつずらすことによって、左目用画像LG2および右目用画像RG2が生成される。当該手法によれば、基準画像MG1のずらし量を減らすことができるので、左目用画像および右目用画像においてオクルージョン領域を減らすことができ、より違和感のない立体画像を生成することができる。   In addition, as a method of generating a stereoscopic image, for example, a method of newly generating both a left-eye image and a right-eye image may be employed. In this method, as shown in FIG. 7, the left-eye image LG2 and the right-eye image RG2 are generated by shifting the reference image MG1 by half of the parallax value in the horizontal direction. According to this method, since the shift amount of the reference image MG1 can be reduced, it is possible to reduce the occlusion area in the left-eye image and the right-eye image, and to generate a stereoscopic image that is more comfortable.

[1−3.動作]
次に、撮像装置1Aの動作について説明する。図8は、撮像装置1Aの動作に関するフローチャートである。図9は、撮影領域において設定された予備計測位置を示す図である。図10〜図14は、本計測位置の計測パターンを示す図である。
[1-3. Operation]
Next, the operation of the imaging apparatus 1A will be described. FIG. 8 is a flowchart regarding the operation of the imaging apparatus 1A. FIG. 9 is a diagram illustrating the preliminary measurement positions set in the imaging region. 10-14 is a figure which shows the measurement pattern of this measurement position.

図8に示されるように、まず、ステップSP11では、撮影情報取得部11が、主撮像部MCおよび副撮像部SCからステレオ画像を取得する。   As shown in FIG. 8, first, in step SP11, the imaging information acquisition unit 11 acquires a stereo image from the main imaging unit MC and the sub imaging unit SC.

ステップSP12では、第1距離計測部12によって、撮像装置1Aから被写体までの距離計測が予備的に行われる。ステップSP12で行われる距離の予備計測は、主撮像部MC(または副撮像部SC)によって撮影可能な撮影領域内において、予め定められた位置(計測位置)において行われる。   In step SP12, the first distance measurement unit 12 preliminarily measures the distance from the imaging device 1A to the subject. The preliminary distance measurement performed in step SP12 is performed at a predetermined position (measurement position) in an imaging region that can be imaged by the main imaging unit MC (or the sub imaging unit SC).

具体的には、図9に示されるように、予備計測では、予備計測を行う位置(「予備計測位置」とも称する)QPが、撮影領域において所定間隔ごとに一様に設定される。なお、図9では、撮影領域を表す基準画像MGを微小領域に区分けして、予備計測位置を微小領域単位で簡単化して示しているが、当該微小領域の構成単位は、基準画像MGを構成する1画素であってもよく、複数の画素によって構成される領域であってもよい。   Specifically, as shown in FIG. 9, in the preliminary measurement, the position (also referred to as “preliminary measurement position”) QP at which the preliminary measurement is performed is set uniformly at predetermined intervals in the imaging region. In FIG. 9, the reference image MG representing the imaging region is divided into minute regions, and the preliminary measurement positions are simplified in units of minute regions, but the constituent units of the minute regions constitute the reference image MG. It may be a single pixel or a region constituted by a plurality of pixels.

次のステップSP13では、予備計測の結果に基づいて、第2距離計測(本計測)を行う際の計測位置(「本計測位置」とも称する)が設定される。計測位置の設定は、例えば、計測位置を定めた複数のパターンの中から、1つの計測パターンを選択して決定するようにしてもよい。   In the next step SP13, a measurement position (also referred to as “main measurement position”) for performing the second distance measurement (main measurement) is set based on the result of the preliminary measurement. For example, the measurement position may be set by selecting one measurement pattern from a plurality of patterns that define the measurement position.

複数の計測パターンとしては、例えば、図10〜図14に示される各計測パターンを採用することができ、これらの計測パターンに関するデータは予め撮像装置1A内に格納されている。   As the plurality of measurement patterns, for example, each measurement pattern shown in FIGS. 10 to 14 can be adopted, and data relating to these measurement patterns is stored in the imaging apparatus 1A in advance.

図10の計測パターンPT10は、撮影領域の中心付近に計測位置RPを多く設定し、中心付近において密な距離計測を実現するパターンである。図11の計測パターンPT11は、撮影領域の下段部および上段部よりも中段部に計測位置RPを多く設定し、中段領域において密な距離計測を実現するパターンである。当該計測パターンPT11は、撮影領域の下段部に道路が存在し、上段部に空が存在するようなシーン向けの計測パターンである。図12の計測パターンPT12は、複数の予備計測位置のうち、被写体までの距離が最も近い予備計測位置を中心にして拡大した領域のみにおいて、計測位置RPを設定するパターンである。図13の計測パターンPT13は、撮影領域中の下段部において計測位置RPを多く設定し、下段領域において密な距離計測を実現するパターンである。図14の計測パターンPT14は、撮影領域において左右方向に行くほど計測位置RPを少なく設定し、左右の端領域において粗い距離計測を実現するパターンである。   A measurement pattern PT10 in FIG. 10 is a pattern in which a large number of measurement positions RP are set near the center of the imaging region and dense distance measurement is realized near the center. A measurement pattern PT11 in FIG. 11 is a pattern that realizes dense distance measurement in the middle region by setting more measurement positions RP in the middle step than in the lower and upper steps of the imaging region. The measurement pattern PT11 is a measurement pattern for a scene in which a road exists in the lower part of the imaging region and a sky exists in the upper part. A measurement pattern PT12 in FIG. 12 is a pattern in which the measurement position RP is set only in a region enlarged around the preliminary measurement position having the closest distance to the subject among the plurality of preliminary measurement positions. A measurement pattern PT13 in FIG. 13 is a pattern in which a large number of measurement positions RP are set in the lower part of the imaging region and dense distance measurement is realized in the lower part region. The measurement pattern PT14 in FIG. 14 is a pattern that realizes rough distance measurement in the left and right end regions by setting the measurement position RP to be smaller as it goes in the left-right direction in the imaging region.

なお、計測パターンPT10〜PT14を示す各図10〜14では、撮影領域内の計測パターンと被写体とが同時に示されているが、これは、計測位置RPと被写体との関係を把握し易くするために示したものであり、各図に描かれた被写体は計測パターンを示すものではない。   In each of FIGS. 10 to 14 showing the measurement patterns PT10 to PT14, the measurement pattern in the imaging region and the subject are shown at the same time. This is to make it easy to grasp the relationship between the measurement position RP and the subject. The subject drawn in each figure does not show a measurement pattern.

複数の計測パターンPT10〜PT14の中から1つの計測パターンを選択する手法としては、例えば、次のような手法を採用することができる。具体的には、各計測パターンPT10〜PT14において計測位置が密である領域を近距離領域とし、計測位置が粗である領域を遠距離領域として各計測パターンPT10〜PT14を遠近分布で表現する。そして、計測パターンPT10〜PT14の各遠近分布の中から、予備計測によって得られた撮影領域内の遠近分布に合うものを選択する。   As a method for selecting one measurement pattern from the plurality of measurement patterns PT10 to PT14, for example, the following method can be employed. Specifically, each measurement pattern PT10 to PT14 is expressed by a perspective distribution with a region where the measurement positions are dense in each measurement pattern PT10 to PT14 as a short distance region and a region where the measurement positions are coarse as a long distance region. Then, from among the perspective distributions of the measurement patterns PT10 to PT14, a pattern that matches the perspective distribution in the imaging region obtained by the preliminary measurement is selected.

予備計測によって得られた撮影領域内の遠近分布が、どの計測パターンPT10〜PT14の遠近分布に合うかについての選択は、例えば、予備計測の結果に基づいて、被写体までの距離が近距離である予備計測位置を近距離計測位置として特定した上で、当該近距離計測位置と、各計測パターンPT10〜PT14における近距離領域とを照合して、近距離領域内にどれぐらいの数の近距離計測位置が含まれるかを基準にして行われる。すなわち、近距離領域内に近距離計測位置を最も多く含む計測パターンが選択されることになる。   The selection as to which perspective pattern of the measurement patterns PT10 to PT14 the perspective distribution in the imaging region obtained by the preliminary measurement matches, for example, the distance to the subject is a short distance based on the result of the preliminary measurement. After specifying the preliminary measurement position as the short-distance measurement position, the short-distance measurement position is compared with the short-distance area in each of the measurement patterns PT10 to PT14 to determine how many short-distance measurements are in the short-distance area. This is done based on whether the position is included. That is, the measurement pattern that includes the most short-distance measurement positions in the short-distance region is selected.

なお、ここでいう近距離とは、或る閾値以下の距離をいい、遠距離とは、当該閾値よりも大きい距離をいう。また、本計測位置は、予備計測に対して距離計測を追加して行うための計測位置であるとも表現される。   Here, the short distance means a distance that is equal to or smaller than a certain threshold, and the far distance means a distance that is larger than the threshold. The main measurement position is also expressed as a measurement position for adding distance measurement to the preliminary measurement.

このようにステップSP13では、複数の計測パターンの中から、1つの計測パターンが選択され、本計測位置が設定される。   Thus, in step SP13, one measurement pattern is selected from a plurality of measurement patterns, and the main measurement position is set.

ステップSP14では、設定された本計測位置において、第2距離計測が行われる。なお、本実施形態では、第2距離計測は、第1距離計測と同様、ステレオ画像を用いたステレオ計測によって行われるので、本計測位置のうち、予備計測位置と重複する位置では、第2距離計測を行わなくてもよい。   In step SP14, the second distance measurement is performed at the set main measurement position. In the present embodiment, the second distance measurement is performed by stereo measurement using a stereo image as in the case of the first distance measurement. Therefore, the second distance measurement is performed at a position overlapping with the preliminary measurement position among the main measurement positions. It is not necessary to perform measurement.

ステップSP15では、視差情報生成部15によって、第1距離計測および第2距離計測で取得された距離情報に基づいて、視差情報が生成される。   In step SP15, the parallax information generation unit 15 generates parallax information based on the distance information acquired by the first distance measurement and the second distance measurement.

視差情報の生成に際して、撮影領域において距離計測によって距離情報が取得されていない位置(未取得位置)の距離情報は、周辺の距離情報を用いて算出される。特に第2距離計測において計測位置が粗く設定された領域における未取得位置の距離情報は、第1距離計測および第2距離計測によって既に取得されている距離情報を用いて算出されることになる。   When generating the parallax information, the distance information of the position where the distance information is not acquired by the distance measurement (unacquired position) in the imaging region is calculated using the peripheral distance information. In particular, the distance information of the unacquired position in the region where the measurement position is roughly set in the second distance measurement is calculated using the distance information already acquired by the first distance measurement and the second distance measurement.

未取得位置の距離情報は、例えば、未取得位置周辺の計測位置における距離情報を補間して算出することができる。なお、補間演算は、未取得位置の被写体が存在する3次元空間を考慮して、3次元で行ってもよく、或いは2次元画像(例えば基準画像MG)上の平面空間で行ってもよい。また、予め用意した補間テーブルを参照して補間演算を行ってもよい。   The distance information of the unacquired position can be calculated by interpolating distance information at measurement positions around the unacquired position, for example. Note that the interpolation calculation may be performed in three dimensions in consideration of a three-dimensional space in which a subject at an unacquired position exists, or may be performed in a planar space on a two-dimensional image (for example, the reference image MG). Further, interpolation calculation may be performed with reference to an interpolation table prepared in advance.

そして、ステップSP16では、立体画像生成部16によって、視差情報に基づいて、基準画像から立体画像が生成される。生成された立体画像は、撮像装置1Aの表示部4において表示される。また、撮像装置1Aは、生成した立体画像を外部に出力してもよい。   In step SP16, the stereoscopic image generation unit 16 generates a stereoscopic image from the reference image based on the parallax information. The generated stereoscopic image is displayed on the display unit 4 of the imaging apparatus 1A. Further, the imaging apparatus 1A may output the generated stereoscopic image to the outside.

[1−4.対応点探索処理]
ここで、ステップSP12およびステップSP14において、距離計測の際に実行される対応点の探索処理について説明する。図15は、画像を構成する画素を分割して、サブピクセルを設定する様子を示す図である。なお、図15は、基準画像MGの一部を拡大した図であり、当該図15には、画像内の1つの画素NPを横方向に3分割して、単位画素あたり、3つのサブピクセルBPを設定する様子が示されている。
[1-4. Corresponding point search process]
Here, the corresponding point search process executed at the time of distance measurement in step SP12 and step SP14 will be described. FIG. 15 is a diagram showing a state in which sub-pixels are set by dividing pixels constituting an image. FIG. 15 is an enlarged view of a part of the reference image MG. In FIG. 15, one pixel NP in the image is divided into three in the horizontal direction, and three subpixels BP per unit pixel. The state of setting is shown.

なお、上述のように、本実施形態の撮像装置1Aでは、主撮像部MCおよび副撮像部SCからは、異なる精度の画像が取得される態様であるため、一般的な対応点探索を実施するだけでは、正確に対応点を特定できない可能性が高い。そこで、撮像装置1Aでは、対応点の特定を精度良く行うために、対応点の探索数を増やして対応点探索処理を実行する。詳細は、後述する。   Note that, as described above, in the imaging apparatus 1A of the present embodiment, images with different accuracy are acquired from the main imaging unit MC and the sub imaging unit SC, so a general corresponding point search is performed. There is a high possibility that the corresponding points cannot be accurately identified only by the above. Therefore, in the imaging apparatus 1A, in order to specify the corresponding points with high accuracy, the number of corresponding points is increased and the corresponding point search process is executed. Details will be described later.

対応点の探索手法としては、例えば、基準画像MGにおいて探索窓(ウインドウ)を設定し、当該探索窓に対応する参照画像SG上の領域を求めることによって、対応点を特定する手法を採用することができる。   As a method for searching for corresponding points, for example, a method of specifying a corresponding point by setting a search window (window) in the standard image MG and obtaining a region on the reference image SG corresponding to the search window is adopted. Can do.

具体的には、基準画像MGにおいて、計測位置として設定された領域(計測領域)に含まれる画素、または計測位置として設定された画素を注目点とし、当該注目点を中心とする探索窓(ウインドウ)を設定し、当該探索窓を参照画像SG上でシフトさせつつ、相関値を算出する。そして、当該相関値に基づいて、参照画像SG上での探索窓の対応位置を取得し、探索窓の注目点に対する参照画像SG上の対応点を特定する。このような対応点の特定は、第1距離計測および第2距離計測において、計測位置として設定された画素(計測対象画素)ごとに行われる。   Specifically, in the reference image MG, a pixel included in an area (measurement area) set as a measurement position or a pixel set as a measurement position is a point of interest, and a search window (window) centering on the point of interest ) And the correlation value is calculated while shifting the search window on the reference image SG. And based on the said correlation value, the corresponding position of the search window on the reference image SG is acquired, and the corresponding point on the reference image SG with respect to the attention point of the search window is specified. Such identification of the corresponding points is performed for each pixel (measurement target pixel) set as a measurement position in the first distance measurement and the second distance measurement.

なお、相関値の算出方法としては、例えば、SAD(Sum of Absolute Difference)法、SSD(Sum of Squared intensity Difference)法(2乗残差法)、NCC(Normalized cross Correlation)法(正規化相互相関法)等の比較する画像間の画素の輝度値を用いて相関値を算出する方法を用いてもよい。また、相関値の算出方法として、例えば、位相限定相関法(POC法)、位相差解析法(PSA法)等の比較する画像間の位相情報を用いて相関値を算出する方法を用いてもよい。   In addition, as a calculation method of a correlation value, SAD (Sum of Absolute Difference) method, SSD (Sum of Squared intensity Difference) method (square residual method), NCC (Normalized cross Correlation) method (normalized cross correlation) For example, a method of calculating a correlation value using a luminance value of a pixel between images to be compared may be used. Further, as a correlation value calculation method, for example, a method of calculating a correlation value using phase information between images to be compared, such as a phase only correlation method (POC method), a phase difference analysis method (PSA method), or the like may be used. Good.

また、基準画像MGを取得する主撮像部MCがズーム撮影機能を有している場合において、基準画像MGがズーム撮影機能を利用して撮影されたときは、ユーザ(使用者)は、被写体の形状を精度良く表した立体画像の生成を希望していると考えられる。しかし、主撮像部MCがズーム撮影機能を有している場合において、ズーム撮影機能を利用して基準画像MGを撮影したとき等、基準画像MGと参照画像SGとでは、互いに共通する領域における画像の解像度が異なるため、距離計測の計測点数が少なくなり得る。   In addition, when the main imaging unit MC that obtains the reference image MG has a zoom shooting function, when the reference image MG is shot using the zoom shooting function, the user (user) It is thought that the generation of a stereoscopic image that accurately represents the shape is desired. However, when the main imaging unit MC has a zoom shooting function, when the standard image MG is shot using the zoom shooting function, the image in the common area between the standard image MG and the reference image SG is used. Since the resolutions of the distances are different, the number of distance measurement points can be reduced.

そこで、撮像装置1Aでは、基準画像MGおよび参照画像SGのうち、どちらかの画像における各画素をサブピクセルに分割して(図15参照)、対応点の特定が行われる。   Therefore, in the imaging apparatus 1A, each pixel in either one of the standard image MG and the reference image SG is divided into sub-pixels (see FIG. 15), and the corresponding points are specified.

具体的には、参照画像SGにおいて、基準画像MGと同じ領域を切り出したときに、切り出された画像が、基準画像MGに比べて解像度の少ない画像であるとする。   Specifically, it is assumed that when the same area as the standard image MG is cut out in the reference image SG, the cut out image is an image having a lower resolution than the standard image MG.

このような場合において、基準画像MGを基準にして参照画像SGに対して対応点探索を実施するときは、参照画像SGにおける画素をサブピクセルに分割してサブピクセル単位で対応点探索を実施する。一方、参照画像SGを基準にして基準画像MGに対して対応点探索を実施するときは、参照画像SG上の計測点を増やすために、参照画像SGの画素をサブピクセルに分割する。そして、参照画像SG上の注目点をサブピクセル単位で設定して、対応点探索数を増やして、対応点探索を実施する。   In such a case, when the corresponding point search is performed on the reference image SG based on the standard image MG, the pixel in the reference image SG is divided into sub-pixels, and the corresponding point search is performed on a sub-pixel basis. . On the other hand, when the corresponding point search is performed on the reference image MG with reference to the reference image SG, the pixels of the reference image SG are divided into sub-pixels in order to increase the measurement points on the reference image SG. Then, the point of interest on the reference image SG is set in units of subpixels, the number of corresponding point searches is increased, and the corresponding point search is performed.

このように、画素をサブピクセルに分割して、対応点の特定処理を行うことによれば、距離計測の計測位置を増やすことができるので、使用者が撮影対象とした主被写体を、高精細に表現した立体画像を生成することが可能になる。   In this way, by dividing the pixel into sub-pixels and performing the corresponding point specifying process, it is possible to increase the measurement position of the distance measurement. It is possible to generate a stereoscopic image expressed in

以上のように、撮像装置1Aは、撮影領域における被写体までの距離計測を、撮影領域に設定された予備計測位置において行って、距離情報を取得する第1距離計測部12と、第1距離計測部12で取得された距離情報に基づいて、撮影領域における被写体までの距離計測を追加して行うための本計測位置を撮影領域において設定する設定手段と、本計測位置において距離計測を行って、距離情報を取得する第2距離計測部13と、第1距離計測部12および第2距離計測部13で取得された距離情報に基づいて、視差情報を生成する視差情報生成部15と、視差情報に基づいて立体画像を生成する立体画像生成部16とを備えている。   As described above, the imaging apparatus 1A performs the distance measurement to the subject in the shooting area at the preliminary measurement position set in the shooting area, and acquires the distance information, and the first distance measurement. Based on the distance information acquired by the unit 12, a setting unit that sets a main measurement position in the shooting region for additionally performing distance measurement to the subject in the shooting region, and performs distance measurement at the main measurement position, A second distance measurement unit 13 that acquires distance information, a disparity information generation unit 15 that generates disparity information based on the distance information acquired by the first distance measurement unit 12 and the second distance measurement unit 13, and disparity information And a three-dimensional image generation unit 16 for generating a three-dimensional image based on the above.

このような撮像装置1Aによれば、撮影シーンに応じた距離計測を行うことができるので、撮影シーンに応じた立体表示を実現することが可能になる。また、このように予備計測の結果を利用して、本計測位置を設定することによれば、無駄な計測位置において距離計測を行うことなく、撮影シーンに即した立体画像を効率的に生成することが可能になる。   According to such an imaging apparatus 1A, distance measurement according to a shooting scene can be performed, so that stereoscopic display according to the shooting scene can be realized. Further, by setting the main measurement position using the result of preliminary measurement in this way, a stereoscopic image corresponding to the shooting scene is efficiently generated without performing distance measurement at a useless measurement position. It becomes possible.

<2.第2実施形態>
次に、本発明の第2実施形態について説明する。第2実施形態に係る撮像装置1Bでは、計測位置の設定手法が、第1実施形態の撮像装置1Aとは異なる。なお、撮像装置1Bは、上記相違点以外は、撮像装置1Aとほぼ同様の構造および機能(図1〜5参照)を有しており、共通する部分については同じ符号を付して説明を省略する。
<2. Second Embodiment>
Next, a second embodiment of the present invention will be described. In the imaging apparatus 1B according to the second embodiment, the measurement position setting method is different from that of the imaging apparatus 1A according to the first embodiment. The imaging device 1B has substantially the same structure and function (see FIGS. 1 to 5) as the imaging device 1A except for the differences described above, and common portions are denoted by the same reference numerals and description thereof is omitted. To do.

上述のように、本実施形態の撮像装置1Bでは、計測位置の設定手法が、第1実施形態の撮像装置1Aとは異なる。図16は、撮影領域において設定された予備計測位置QPを示す図である。   As described above, in the imaging apparatus 1B of the present embodiment, the measurement position setting method is different from that of the imaging apparatus 1A of the first embodiment. FIG. 16 is a diagram illustrating the preliminary measurement position QP set in the imaging region.

具体的には、撮像装置1Bの予備計測は、図16に示されるように、撮影領域の中心付近に予備計測位置QPを多く設定して行われる。すなわち、撮影領域の中心付近では密に予備計測が行われ、中心から離れるに従って粗い予備計測が行われる。   Specifically, the preliminary measurement of the imaging apparatus 1B is performed by setting a large number of preliminary measurement positions QP near the center of the imaging region, as shown in FIG. That is, preliminary measurement is performed densely near the center of the imaging region, and rough preliminary measurement is performed as the distance from the center increases.

そして、予備計測の結果、粗い予備計測を行った領域において、被写体までの距離が近距離である予備計測位置(近距離計測位置)が検出されたときは、当該予備計測位置の周辺に計測位置を多数設定して、本計測を行う。   As a result of the preliminary measurement, when a preliminary measurement position (short distance measurement position) in which the distance to the subject is a short distance is detected in the area where the rough preliminary measurement has been performed, the measurement position is around the preliminary measurement position. Set a large number of and perform the main measurement.

このように、撮像装置1Bでは、粗い予備計測を行った領域において、近距離の被写体が検出されたときは、本計測において、当該近距離の被写体が存在すると想定される領域において計測位置を追加設定し、密な距離計測を行う。   As described above, in the imaging apparatus 1B, when a near-distance subject is detected in the region where the rough preliminary measurement is performed, the measurement position is added in the region where the near-distance subject is assumed to be present in the main measurement. Set and measure dense distance.

これによれば、撮影領域の中から、近距離の被写体に関する距離情報を効率的に取得することが可能になるとともに、近距離の被写体を高精細に表現した立体画像を生成することが可能になる。   According to this, it is possible to efficiently acquire distance information regarding a short-distance subject from a shooting region, and it is possible to generate a stereoscopic image that expresses a short-distance subject with high definition. Become.

<3.第3実施形態>
次に、本発明の第3実施形態について説明する。第3実施形態に係る撮像装置1Cでは、計測位置の設定手法が、第1実施形態の撮像装置1Aとは異なる。なお、撮像装置1Cは、上記相違点以外は、撮像装置1Aとほぼ同様の構造および機能(図1〜5参照)を有しており、共通する部分については同じ符号を付して説明を省略する。
<3. Third Embodiment>
Next, a third embodiment of the present invention will be described. In the imaging apparatus 1C according to the third embodiment, the measurement position setting method is different from that of the imaging apparatus 1A according to the first embodiment. The imaging device 1C has substantially the same structure and function (see FIGS. 1 to 5) as the imaging device 1A except for the differences described above, and common portions are denoted by the same reference numerals and description thereof is omitted. To do.

上述のように、本実施形態の撮像装置1Cでは、計測位置の設定手法が、第1実施形態の撮像装置1Aとは異なる。図17は、予備計測位置における計測結果を示す図である。図18は、設定された本計測位置を示す図である。図19は、粗領域および密領域の設定例を示す図である。   As described above, in the imaging device 1C of the present embodiment, the measurement position setting method is different from that of the imaging device 1A of the first embodiment. FIG. 17 is a diagram illustrating a measurement result at the preliminary measurement position. FIG. 18 is a diagram illustrating the set main measurement positions. FIG. 19 is a diagram illustrating a setting example of a coarse area and a dense area.

具体的には、撮像装置1Cの予備計測は、第1実施形態と同様(図9参照)、予備計測位置QPを、基準画像MG内において所定間隔ごとに一様に設定して行われる。   Specifically, the preliminary measurement of the imaging device 1C is performed by setting the preliminary measurement position QP uniformly at predetermined intervals in the reference image MG, as in the first embodiment (see FIG. 9).

そして、本計測を行う本計測位置は、各予備計測位置を基準にして、予備計測位置ごとの距離情報を反映して設定される。   Then, the main measurement position for performing the main measurement is set by reflecting distance information for each preliminary measurement position with reference to each preliminary measurement position.

具体的には、まず、予備計測位置ごとに予備計測位置を囲む閉領域(「本計測領域」とも称する)が設定される。本計測領域の大きさは、設定される本計測領域の基準となる予備計測位置の距離情報に基づいて決定される。より詳細には、被写体までの距離が近距離の予備計測位置(近距離計測位置)については、本計測領域が相対的に大きく設定され、被写体までの距離が遠距離の予備計測位置(遠距離計測位置)については、本計測領域が相対的に小さく設定される。   Specifically, first, a closed region (also referred to as “main measurement region”) surrounding the preliminary measurement position is set for each preliminary measurement position. The size of the main measurement area is determined based on the distance information of the preliminary measurement position that is the reference of the set main measurement area. More specifically, for the preliminary measurement position where the distance to the subject is a short distance (short distance measurement position), this measurement area is set to be relatively large, and the preliminary measurement position where the distance to the subject is a long distance (far distance) With respect to (measurement position), the main measurement area is set relatively small.

そして、近距離計測位置に基づく本計測領域内には、本計測位置を密に設定し、遠距離計測位置に基づく本計測領域内には、本計測位置を粗く設定して、第2距離計測が行われる。   Then, the main measurement position is set densely in the main measurement area based on the short distance measurement position, and the main measurement position is set roughly in the main measurement area based on the long distance measurement position, so that the second distance measurement is performed. Is done.

例えば、撮影領域に設定された予備計測位置QPにおいて予備計測が行われた結果、図17のように、黒く塗りつぶされた黒丸で表される近距離計測位置FPと、白抜きの白丸で表される遠距離計測位置WPとが検出されたとする。この場合、図18に示されるように、近距離計測位置の周辺には、大きな本計測領域が設定されるとともに、当該本計測領域内には、本計測位置HPが密に設定される。なお、図18において、本計測領域内の本計測位置は、黒く塗りつぶされた黒三角で表される。一方、遠距離計測位置の周辺には、小さな本計測領域が設定されて、当該本計測領域内では、本計測位置が粗く設定されるが、図18では、対比を容易にするため、遠距離計測位置に基づいて設定される本計測位置を不図示としている。   For example, as a result of the preliminary measurement being performed at the preliminary measurement position QP set in the photographing region, as shown in FIG. 17, the short distance measurement position FP represented by a black circle filled in black and the white circle surrounded by white are represented. It is assumed that a long distance measurement position WP is detected. In this case, as shown in FIG. 18, a large main measurement area is set around the short-distance measurement position, and the main measurement positions HP are densely set in the main measurement area. In FIG. 18, the main measurement position in the main measurement region is represented by a black triangle filled in black. On the other hand, a small main measurement area is set around the long distance measurement position, and the main measurement position is set roughly in the main measurement area. In FIG. The main measurement position set based on the measurement position is not shown.

本計測位置の粗密の設定に際して、予備計測で得られた距離情報を粗領域および密領域の大きさに反映させない場合、粗領域LR(斜線ハッチング領域)および密領域MRは、図19のように設定されることになる。この場合、本来、密に計測位置を設定して距離情報を取得したい近距離の領域が遠距離側に含まれてしまう可能性が高くなり、滑らかな形状を計測することが困難になる。   When setting the coarse and dense measurement positions, if the distance information obtained in the preliminary measurement is not reflected in the sizes of the coarse area and the dense area, the coarse area LR (shaded hatched area) and the dense area MR are as shown in FIG. Will be set. In this case, there is a high possibility that a short-distance area for which distance information should be acquired by setting the measurement position densely is included on the long-distance side, and it is difficult to measure a smooth shape.

これに対して、本実施形態のように、粗領域に対して密領域を大きく設定することにより、近距離の被写体が存在する可能性が高い領域に対して優先的に本計測位置を割り当てることによれば、近距離の被写体の形状を正確に表現した立体画像を生成することが可能になる。   On the other hand, the main measurement position is preferentially assigned to an area where there is a high possibility that an object at a short distance exists by setting a dense area larger than a rough area as in the present embodiment. Therefore, it is possible to generate a stereoscopic image that accurately represents the shape of a subject at a short distance.

なお、密領域および粗領域の大きさは、距離情報に対応した粗領域および密領域の大きさを表すテーブルを予め保持し、当該テーブルを用いて設定するようにしてもよい。   Note that the sizes of the dense region and the coarse region may be set using a table that holds in advance a table representing the sizes of the coarse region and the dense region corresponding to the distance information.

このように、撮像装置1Cでは、撮影領域において粗く一様に行う予備計測によって、近距離計測位置が存在した場合は、当該近距離計測位置の周辺に大きな本計測領域が追加して設定され、当該本計測領域において密な距離計測が行われる。   As described above, in the imaging apparatus 1C, when a short-distance measurement position exists by preliminary measurement that is performed roughly and uniformly in the photographing area, a large main measurement area is additionally set around the short-distance measurement position. In the main measurement area, dense distance measurement is performed.

これによれば、撮影領域の中から、近距離の被写体に関する距離情報を効率的に取得することが可能になるとともに、近距離の被写体を高精細に表現した立体画像を生成することが可能になる。   According to this, it is possible to efficiently acquire distance information regarding a short-distance subject from a shooting region, and it is possible to generate a stereoscopic image that expresses a short-distance subject with high definition. Become.

<4.第4実施形態>
次に、本発明の第4実施形態について説明する。第4実施形態に係る撮像装置1Dでは、計測位置の設定手法が、第1実施形態の撮像装置1Aとは異なる。なお、撮像装置1Dは、上記相違点以外は、撮像装置1Aとほぼ同様の構造および機能(図1〜5参照)を有しており、共通する部分については同じ符号を付して説明を省略する。
<4. Fourth Embodiment>
Next, a fourth embodiment of the present invention will be described. In the imaging device 1D according to the fourth embodiment, the measurement position setting method is different from that of the imaging device 1A according to the first embodiment. The imaging device 1D has substantially the same structure and function (see FIGS. 1 to 5) as the imaging device 1A except for the differences described above, and common portions are denoted by the same reference numerals and description thereof is omitted. To do.

上述のように、本実施形態の撮像装置1Dでは、計測位置の設定手法が、第1実施形態の撮像装置1Aとは異なる。図20は、第1距離計測および第2距離計測の際に実行される動作のフローチャートである。   As described above, in the imaging device 1D of the present embodiment, the measurement position setting method is different from that of the imaging device 1A of the first embodiment. FIG. 20 is a flowchart of operations executed during the first distance measurement and the second distance measurement.

撮像装置1Dの予備計測は、基準画像MG(または参照画像SG)の中から物体領域を抽出し、抽出した物体の中心付近の代表点を予備計測位置に設定して行われる。そして、代表点における予備計測によって、被写体までの距離が近距離である予備計測位置(近距離計測位置)が特定された場合、当該予備計測位置の周辺に本計測位置を追加で密に設定して本計測を行う。   The preliminary measurement of the imaging apparatus 1D is performed by extracting an object region from the standard image MG (or reference image SG) and setting a representative point near the center of the extracted object as a preliminary measurement position. If a preliminary measurement position (short-distance measurement position) with a short distance to the subject is identified by preliminary measurement at the representative point, the main measurement position is additionally set densely around the preliminary measurement position. To perform this measurement.

より詳細には、図20に示されるように、ステップSP21において基準画像MGから物体領域の抽出が行われる。物体領域の抽出手法としては、平均値シフト法、グラフカット法等、一般的な領域抽出手法が用いられる。   More specifically, as shown in FIG. 20, the object region is extracted from the reference image MG in step SP21. As an object region extraction method, a general region extraction method such as an average value shift method or a graph cut method is used.

ステップSP22では、抽出された物体領域の中心付近において、代表点が設定される。近距離の物体と遠距離の物体とが重なっている可能性の高い物体の境界付近では、対応点探索処理の精度が低下するため、このように物体領域の境界を避けて物体領域の中心付近に代表点を設定することによれば、第2距離計測の際に実行される対応点探索処理の精度を向上させることができる。   In step SP22, a representative point is set near the center of the extracted object region. Near the boundary of an object that is likely to overlap an object at a short distance and an object at a long distance, the accuracy of the corresponding point search process decreases. If the representative point is set to, the accuracy of the corresponding point search process executed at the time of the second distance measurement can be improved.

次のステップSP23では、設定された代表点を予備計測位置として、第1距離計測(予備計測)が行われる。   In the next step SP23, the first distance measurement (preliminary measurement) is performed using the set representative point as the preliminary measurement position.

ステップSP24では、予備計測の結果に基づいて、本計測を行うか否かの判定が行われる。   In step SP24, it is determined whether or not to perform the main measurement based on the preliminary measurement result.

具体的には、物体領域が大きく、かつ当該物体領域の代表点における距離が近距離である場合は、物体領域内に密に本計測位置を設定して、第2距離計測を行う動作工程(ステップSP25)に移行させる。   Specifically, when the object area is large and the distance at the representative point of the object area is a short distance, the operation step of setting the main measurement position densely in the object area and performing the second distance measurement ( The process proceeds to step SP25).

一方、物体領域が小さい場合は、密に計測位置を設定して細かく対応点探索を行っても、対応点探索処理の精度が低いと考えられることから、第2距離計測を回避し、代表点における距離情報を当該物体領域の距離情報とする。また、代表点における距離が遠距離である場合も、第2距離計測を回避し、代表点における距離情報を当該物体領域の距離情報とする。   On the other hand, if the object region is small, the corresponding point search process is considered to be less accurate even if the measurement position is set densely and the corresponding point search is performed finely. Is the distance information of the object region. Also, when the distance at the representative point is a long distance, the second distance measurement is avoided, and the distance information at the representative point is the distance information of the object region.

このように、撮像装置1Dでは、取得された画像から物体領域を抽出し、抽出された物体に代表点を設定して、当該代表点において予備計測を行う。そして、予備計測結果および物体領域の大きさに基づいて、第2距離計測を行うか否かを判定する。これによれば、効率的に距離情報を取得することが可能になるとともに、近距離の比較的大きい物体の形状を正確に表現した立体画像を生成することができる。   As described above, the imaging apparatus 1D extracts an object region from the acquired image, sets a representative point for the extracted object, and performs preliminary measurement at the representative point. Then, based on the preliminary measurement result and the size of the object region, it is determined whether or not the second distance measurement is performed. According to this, it is possible to efficiently acquire distance information, and it is possible to generate a stereoscopic image that accurately represents the shape of an object with a relatively short distance.

また、代表点における距離が遠距離である場合に、代表点における距離情報を当該物体領域の距離情報とする(物体領域内は、代表点における距離情報で埋める)ことによれば、遠距離の物体領域内において立体感が生じるのを防ぐことができるので、違和感の少ない立体画像を生成することが可能になる。   Further, when the distance at the representative point is a long distance, the distance information at the representative point is set as the distance information of the object area (the object area is filled with the distance information at the representative point). Since it is possible to prevent a stereoscopic effect from occurring in the object area, it is possible to generate a stereoscopic image with a little uncomfortable feeling.

なお、ここでは、基準画像MGの中から物体領域を抽出する場合について例示したが、抽出される対象は、物体のみならず人体等を含む被写体であればよく、撮像装置1Dでは、基準画像MGから被写体領域の抽出が行われるとも表現できる。   Here, the case where the object region is extracted from the reference image MG has been illustrated, but the target to be extracted may be a subject including not only the object but also a human body. In the imaging apparatus 1D, the reference image MG is used. It can also be expressed that subject area extraction is performed from

<5.第5実施形態>
次に、本発明の第5実施形態について説明する。第5実施形態に係る撮像装置1Eでは、第1距離計測と第2距離計測とがそれぞれ、異なるタイミングで取得される画像に対して行われる。なお、撮像装置1Eは、撮像装置1Aとほぼ同様の構造および機能(図1〜5参照)を有しており、共通する部分については同じ符号を付して説明を省略する。
<5. Fifth Embodiment>
Next, a fifth embodiment of the present invention will be described. In the imaging device 1E according to the fifth embodiment, the first distance measurement and the second distance measurement are performed on images acquired at different timings. Note that the imaging device 1E has substantially the same structure and function (see FIGS. 1 to 5) as the imaging device 1A, and common portions are denoted by the same reference numerals and description thereof is omitted.

上述のように、本実施形態の撮像装置1Eでは、第1距離計測と第2距離計測とがそれぞれ、異なるタイミングで取得される画像に対して行われる。図21は、撮像装置1Eにおいて実行される、第1距離計測および第2距離計測の動作フローチャートである。   As described above, in the imaging apparatus 1E of the present embodiment, the first distance measurement and the second distance measurement are performed on images acquired at different timings. FIG. 21 is an operation flowchart of first distance measurement and second distance measurement executed in the imaging apparatus 1E.

具体的には、図21に示されるように、ステップSP31では、撮影情報取得部11によって、ステレオ画像が取得される。   Specifically, as illustrated in FIG. 21, in step SP31, the shooting information acquisition unit 11 acquires a stereo image.

次のステップSP32では、第1距離計測部12による第1距離計測が終了したか否かが判定される。第1距離計測が終了している場合は、動作工程は、ステップSP35に移行される。ステップSP35に移行した場合の処理内容は、後述する。   In the next step SP32, it is determined whether or not the first distance measurement by the first distance measurement unit 12 has been completed. When the first distance measurement has been completed, the operation process moves to step SP35. The processing contents when the process proceeds to step SP35 will be described later.

一方、第1距離計測が終了していない場合は、動作工程は、ステップSP33に移行される。   On the other hand, when the first distance measurement has not ended, the operation process moves to step SP33.

ステップSP33では、第1距離計測が行われる。本実施形態の第1距離計測は、上記第1実施形態から第4実施形態で示される計測手法のいずれかを採用して行われる。   In step SP33, the first distance measurement is performed. The first distance measurement of the present embodiment is performed by adopting any of the measurement methods shown in the first to fourth embodiments.

ステップSP34では、第1距離計測の結果に基づいて、本計測位置が設定される。本計測位置の設定手法としては、ステップSP33の第1距離計測で採用した実施形態の設定手法が採用される。   In step SP34, the main measurement position is set based on the result of the first distance measurement. As the setting method of the measurement position, the setting method of the embodiment adopted in the first distance measurement in step SP33 is employed.

本計測位置の設定が終了すると、動作工程は、ステップSP31に移行され、再びステレオ画像の取得が実行される。   When the setting of the main measurement position is completed, the operation process moves to step SP31, and stereo image acquisition is executed again.

新たなステレオ画像が取得されると、動作工程は、ステップSP32を経て、ステップSP35へと移行される。   When a new stereo image is acquired, the operation process proceeds to step SP35 via step SP32.

ステップSP35では、ステップSP34で設定された本計測位置において、新たに取得されたステレオ画像を用いた第2距離計測が行われる。また、当該第2距離計測では、予備計測位置においても、新たに取得されたステレオ画像を用いて距離計測が行われる。   In step SP35, the second distance measurement using the newly acquired stereo image is performed at the main measurement position set in step SP34. In the second distance measurement, distance measurement is performed using a newly acquired stereo image even at the preliminary measurement position.

ステップSP36では、第2距離計測の結果に基づいて、予備計測位置における距離情報が変化したか否かが判定される。予備計測位置における距離情報が変化したか否かは、過去に取得されたステレオ画像を用いた第1距離計測または第2距離計測の計測結果と、現在のステレオ画像を用いた第2距離計測の計測結果とを比較して行われる。   In step SP36, it is determined whether the distance information at the preliminary measurement position has changed based on the result of the second distance measurement. Whether or not the distance information at the preliminary measurement position has changed depends on the measurement result of the first distance measurement or the second distance measurement using the stereo image acquired in the past and the second distance measurement using the current stereo image. This is done by comparing the measurement results.

ステップSP36において、距離情報が変化してないと判定された場合、動作工程は、ステップSP31に移行され、次のステレオ画像が取得される。一方、距離情報が変化したと判定された場合、動作工程は、ステップSP37に移行される。   If it is determined in step SP36 that the distance information has not changed, the operation process moves to step SP31, and the next stereo image is acquired. On the other hand, when it is determined that the distance information has changed, the operation process proceeds to step SP37.

ステップSP37では、本計測位置の変更(再設定)が行われる。例えば、或る予備計測位置において計測される距離が、近距離から遠距離へと変化した場合は、当該予備計測位置の周囲に設定した本計測位置を本計測の対象から除外する処理が行われる。一方、或る予備計測位置において計測される距離が、遠距離から近距離へと変化した場合は、当該予備計測位置の周辺に新たな本計測位置を設定する処理が行われる。   In step SP37, the main measurement position is changed (reset). For example, when the distance measured at a certain preliminary measurement position changes from a short distance to a long distance, a process of excluding the main measurement position set around the preliminary measurement position from the target of the main measurement is performed. . On the other hand, when the distance measured at a certain preliminary measurement position changes from a long distance to a short distance, a process of setting a new main measurement position around the preliminary measurement position is performed.

ステップSP37が終了すると、動作工程は、ステップSP31に移行され、新たに取得されるステレオ画像を用いて、新たな本計測位置において第2距離計測が行われる。   When step SP37 ends, the operation process moves to step SP31, and the second distance measurement is performed at a new main measurement position using a newly acquired stereo image.

このように、撮像装置1Eでは、最初に取得されるステレオ画像に対して、第1距離計測が行われ、第1距離計測の結果に基づいて本計測位置が設定される。そして、設定された本計測位置に基づいて、順次に取得されるステレオ画像ごとに第2距離計測が行われる。これによれば、過去に行われた第2距離計測の計測位置の情報を用いて、次のステレオ画像に対する第2距離計測が行われるので、順次に取得されるステレオ画像ごとに本計測位置を全て設定する処理を省略することができ、処理量を低減することが可能になる。   As described above, in the imaging device 1E, the first distance measurement is performed on the stereo image acquired first, and the main measurement position is set based on the result of the first distance measurement. Then, based on the set main measurement position, the second distance measurement is performed for each stereo image acquired sequentially. According to this, since the second distance measurement for the next stereo image is performed using the information on the measurement position of the second distance measurement performed in the past, the main measurement position is set for each sequentially acquired stereo image. All the setting processes can be omitted, and the processing amount can be reduced.

<6.変形例>
以上、この発明の実施の形態について説明したが、この発明は、上記に説明した内容に限定されるものではない。
<6. Modification>
Although the embodiments of the present invention have been described above, the present invention is not limited to the contents described above.

例えば、上記各実施形態の第1距離計測では、距離計測の手法として、ステレオ計測による手法が採用されていたが、これに限定されず、例えば、TOF(Time of Flight)手法またはレーザ光を用いて距離計測を行う手法を採用してもよい。   For example, in the first distance measurement of each of the above embodiments, a stereo measurement technique has been adopted as a distance measurement technique. However, the present invention is not limited to this. Alternatively, a method for measuring the distance may be employed.

また、上記各実施形態における、予備計測位置および本計測位置の設定に際して、他の情報を反映させてもよい。   Further, in setting the preliminary measurement position and the main measurement position in each of the above embodiments, other information may be reflected.

例えば、2次元画像(例えば基準画像MG)から被写体の距離情報を推定し、当該推定距離情報を反映させて、予備計測位置または本計測位置を変更してもよい。或いは、2次元画像における色情報に基づいて、色ごとに領域分割を行い、色および領域の大きさに応じて、予備計測位置または本計測位置を変更するようにしてもよい。   For example, the subject distance information may be estimated from a two-dimensional image (for example, the reference image MG), and the preliminary measurement position or the main measurement position may be changed by reflecting the estimated distance information. Alternatively, based on the color information in the two-dimensional image, the area may be divided for each color, and the preliminary measurement position or the main measurement position may be changed according to the color and the size of the area.

また、上記第1実施形態から第5実施形態において、一組のステレオ画像に対する第1距離計測および第2距離計測において設定される計測位置は、その総数が固定数以下となるように設定されることが好ましい。ここで、上記固定数は、順次に取得されるステレオ画像の取得間隔以内に、各計測位置において距離計測を行って立体画像の生成を行うことが可能な計測位置の数である。   In the first to fifth embodiments, the measurement positions set in the first distance measurement and the second distance measurement for a set of stereo images are set so that the total number is equal to or less than a fixed number. It is preferable. Here, the fixed number is the number of measurement positions at which the distance measurement can be performed at each measurement position to generate a stereoscopic image within the acquisition interval of sequentially acquired stereo images.

これによれば、順次に取得される各ステレオ画像に対して立体画像を確実に生成することが可能になる。   According to this, it becomes possible to reliably generate a stereoscopic image for each stereo image acquired sequentially.

また、上記各実施形態では、或る閾値以下の距離を近距離と称し、当該閾値よりも大きい距離を遠距離と称していたが、これに限定されず、取得される画像(例えば基準画像MG)内における被写体の相対的な位置関係から、近距離および遠距離を定めてもよい。   In each of the above embodiments, a distance equal to or smaller than a certain threshold is referred to as a short distance, and a distance greater than the threshold is referred to as a long distance. However, the present invention is not limited to this. The short distance and the long distance may be determined from the relative positional relationship of the subject in ().

また、上記各実施形態における視差情報生成部15では、視差情報の生成に際して、次のような処理を実行してもよい。   In addition, the disparity information generation unit 15 in each of the above embodiments may execute the following processing when generating disparity information.

具体的には、予備計測位置の周辺に本計測位置を設定して、本計測を行った場合において、隣接する計測位置(予備計測位置と本計測位置、または本計測位置同士)における距離の差分が、所定の閾値よりも小さいときは、隣接する当該計測位置同士を統合して視差情報を生成してもよい。なお、隣接する当該計測位置の距離情報としては、例えば、隣接する計測位置間の平均値を用いればよい。   Specifically, when the main measurement position is set around the preliminary measurement position and the main measurement is performed, the difference in distance between adjacent measurement positions (the preliminary measurement position and the main measurement position, or the main measurement positions). However, when it is smaller than the predetermined threshold value, the parallax information may be generated by integrating adjacent measurement positions. As the distance information of the adjacent measurement positions, for example, an average value between the adjacent measurement positions may be used.

これによれば、同じ被写体において微小な立体感が生じるのを防ぐことができるので、違和感の少ない立体画像を生成することが可能になる。   According to this, since it is possible to prevent a minute stereoscopic effect from occurring in the same subject, it is possible to generate a stereoscopic image with a little uncomfortable feeling.

また、隣接する当該計測位置同士を統合して視差情報を生成する上述の処理において、計測位置における距離が遠距離であるときは、隣接する当該計測位置の距離情報として、既定値を用いてもよい。   Further, in the above-described processing for generating disparity information by integrating adjacent measurement positions, when the distance at the measurement position is a long distance, a default value may be used as the distance information of the adjacent measurement position. Good.

これによれば、遠方の同じ被写体において微小な立体感が生じるのを防ぐことができるので、違和感の少ない立体画像を生成することが可能になる。   According to this, since it is possible to prevent a minute stereoscopic effect from being generated in the same subject in the distance, it is possible to generate a stereoscopic image with less sense of incongruity.

また、計測位置を密に設定して距離計測を行った領域(例えば、図10,16における中心部分、または図13における下段部分等)における距離情報が遠距離の情報であった場合、データの間引き処理によって密の計測データから粗い計測データを生成し、当該粗い計測データを用いて視差情報を生成してもよい。   In addition, when the distance information in the region (for example, the central part in FIGS. 10 and 16 or the lower part in FIG. 13) in which the measurement positions are set densely is long distance information, Coarse measurement data may be generated from dense measurement data by thinning processing, and parallax information may be generated using the coarse measurement data.

これによれば、遠距離の被写体において立体感が生じるのを防ぐことができるので、違和感の少ない立体画像を生成することが可能になる。   According to this, since it is possible to prevent a stereoscopic effect from being generated in a long-distance subject, it is possible to generate a stereoscopic image with a little uncomfortable feeling.

また、上記第5実施形態におけるステップSP37では、本計測位置の変更が行われているが、さらに予備計測位置をも変更してもよい。例えば、現在のフレームと過去のフレームとの間でマッチング処理を行って動きベクトル(オプティカルフロー)を求め、求められた動きベクトルに基づいて被写体の位置ズレ量を推定し、当該位置ズレ量に応じて予備計測位置を移動させてもよい。   In step SP37 in the fifth embodiment, the main measurement position is changed. However, the preliminary measurement position may be changed. For example, a matching process is performed between the current frame and a past frame to obtain a motion vector (optical flow), the position displacement amount of the subject is estimated based on the obtained motion vector, and the amount of position displacement is Thus, the preliminary measurement position may be moved.

また、上記第1実施形態では、本計測位置を定めた複数の計測パターンの中から、1つの計測パターンを選択していたが、本計測位置の設定方針を複数有するようにして、複数の設定方針から選択された1の設定方針に沿って、本計測位置を設定する態様であってもよい。   In the first embodiment, one measurement pattern is selected from a plurality of measurement patterns that define the main measurement position. However, a plurality of settings are made so as to have a plurality of setting policies for the main measurement position. A mode in which the main measurement position is set according to one setting policy selected from the policy may be used.

本計測位置の設定方針としては、例えば、撮影領域の中心付近に本計測位置を密に設定し、撮影領域の端付近では、本計測位置を粗に設定する方針が想定される。当該方針に沿って本計測位置が設定されると、図10に示されるような計測位置の配置となる。なお、当該設定方針は、例えば、撮影領域における中心付近の予備計測位置における距離が、他の予備計測位置における距離に比べて近距離であった場合に選択される。   As a policy for setting the main measurement position, for example, a policy is assumed in which the main measurement position is densely set near the center of the shooting region and the main measurement position is roughly set near the end of the shooting region. When the main measurement position is set in accordance with the policy, the measurement position is arranged as shown in FIG. The setting policy is selected, for example, when the distance at the preliminary measurement position near the center in the imaging region is shorter than the distances at other preliminary measurement positions.

また、本計測位置の別の設定方針としては、例えば、撮影領域の下段部および上段部よりも中段部において本計測位置を密に設定する方針が想定される。当該方針に沿って本計測位置が設定されると、図11に示されるような計測位置の配置となる。なお、当該設定方針は、例えば、撮影領域における中段部の予備計測位置の距離が全般的に近距離であった場合に選択される。   Further, as another setting policy of the main measurement position, for example, a policy of setting the main measurement position more densely in the middle part than the lower part and the upper part of the imaging region is assumed. When the main measurement position is set in accordance with the policy, the measurement position is arranged as shown in FIG. The setting policy is selected, for example, when the distance between the preliminary measurement positions in the middle stage in the imaging region is generally close.

また、上記各実施形態では、撮像装置1A〜1Eにおいて立体画像が生成される場合について例示したが、これに限定されない。具体的には、一般的なコンピュータによって構成される画像処理装置において、上記撮像装置1A〜1Eの画像処理部3を実現してもよい。この場合、1組のステレオ画像は、画像処理装置としての当該コンピュータに対して、外部から入力されることになる。   Moreover, in each said embodiment, although illustrated about the case where a stereo image was produced | generated in imaging device 1A-1E, it is not limited to this. Specifically, the image processing device 3 of the imaging devices 1A to 1E may be realized in an image processing device configured by a general computer. In this case, a set of stereo images is input from the outside to the computer as the image processing apparatus.

また、第1距離計測部12と第2距離計測部13とを有する撮像装置1A〜1Eは、被写体までの距離を計測する距離計測装置とも称せられる。   The imaging devices 1A to 1E having the first distance measuring unit 12 and the second distance measuring unit 13 are also referred to as distance measuring devices that measure the distance to the subject.

1A〜1E 撮像装置
3 画像処理部
11 撮影情報取得部
12 第1距離計測部
13 第2距離計測部
14 カメラ情報記憶部
15 視差情報生成部
16 立体画像生成部
BG 背景
PS 主被写体
MG,MG1 基準画像
PT10〜PT14 計測パターン
RP 計測位置
HP 本計測位置
QP 予備計測位置
FP 近距離計測位置
MR 密領域
LR 粗領域
1A to 1E Imaging device 3 Image processing unit 11 Shooting information acquisition unit 12 First distance measurement unit 13 Second distance measurement unit 14 Camera information storage unit 15 Parallax information generation unit 16 Stereo image generation unit BG Background PS Main subject MG, MG1 Reference Image PT10 to PT14 Measurement pattern RP Measurement position HP Main measurement position QP Preliminary measurement position FP Short range measurement position MR Dense area LR Rough area

Claims (14)

撮影領域における被写体までの距離計測を、前記撮影領域に設定された第1計測位置において行って、第1距離情報を取得する第1計測手段と、
前記第1距離情報に基づいて、撮影領域における被写体までの距離計測を追加して行うための第2計測位置を前記撮影領域において設定する設定手段と、
前記第2計測位置において距離計測を行って、第2距離情報を取得する第2計測手段と、
第1距離情報および第2距離情報に基づいて、視差情報を生成する視差情報生成手段と、
前記視差情報に基づいて立体画像を生成する画像生成手段と、
を備える画像処理装置。
First measurement means for measuring the distance to the subject in the imaging region at a first measurement position set in the imaging region and acquiring first distance information;
Setting means for setting a second measurement position in the imaging region for additionally performing distance measurement to the subject in the imaging region based on the first distance information;
Second measurement means for performing distance measurement at the second measurement position and acquiring second distance information;
Disparity information generating means for generating disparity information based on the first distance information and the second distance information;
Image generating means for generating a stereoscopic image based on the parallax information;
An image processing apparatus comprising:
前記設定手段は、前記第1距離情報に基づいて、前記第2計測位置を定めた複数の計測パターンの中から、1つの計測パターンを選択する請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the setting unit selects one measurement pattern from a plurality of measurement patterns that determine the second measurement position based on the first distance information. 前記設定手段は、第1計測位置において計測された被写体までの距離が近距離であったとき、当該第1計測位置の周辺に前記第2計測位置を設定する請求項1に記載の画像処理装置。   The image processing device according to claim 1, wherein the setting unit sets the second measurement position around the first measurement position when the distance to the subject measured at the first measurement position is a short distance. . 前記設定手段は、前記第1計測位置を囲む閉領域において前記第2計測位置を設定し、
前記設定手段は、第1計測位置において計測された被写体までの距離が近距離であったときは、当該第1計測位置に関する閉領域を比較的大きい領域とし、第1計測位置において計測された被写体までの距離が遠距離であったときは、当該第1計測位置に関する閉領域を比較的小さい領域とする請求項1に記載の画像処理装置。
The setting means sets the second measurement position in a closed region surrounding the first measurement position;
When the distance to the subject measured at the first measurement position is a short distance, the setting means sets the closed region related to the first measurement position as a relatively large region, and the subject measured at the first measurement position. The image processing apparatus according to claim 1, wherein when the distance to is a long distance, the closed region related to the first measurement position is a relatively small region.
前記設定手段は、第1計測位置において計測された被写体までの距離が近距離であったときは、当該第1計測位置に関する閉領域内において前記第2計測位置を密に設定し、第1計測位置において計測された被写体までの距離が遠距離であったときは、当該第1計測位置に関する閉領域内において前記第2計測位置を粗く設定する請求項4に記載の画像処理装置。   When the distance to the subject measured at the first measurement position is a short distance, the setting means densely sets the second measurement position within the closed region related to the first measurement position, and performs the first measurement. The image processing apparatus according to claim 4, wherein when the distance to the subject measured at the position is a long distance, the second measurement position is set roughly in a closed region related to the first measurement position. 前記被写体についてのステレオ画像を取得する画像取得手段をさらに備え、
前記第1計測手段および前記第2計測手段は、前記ステレオ画像を用いて距離計測を行う請求項1から請求項5のいずれかに記載の画像処理装置。
Image acquisition means for acquiring a stereo image of the subject;
The image processing apparatus according to claim 1, wherein the first measurement unit and the second measurement unit perform distance measurement using the stereo image.
前記被写体についてのステレオ画像を取得する画像取得手段をさらに備え、
前記画像取得手段は、第1ステレオ画像と、当該第1ステレオ画像よりも時間的に後に撮影された第2ステレオ画像とを取得し、
前記第1計測手段は、前記第1ステレオ画像を用いて距離計測を行って、第1距離情報を取得し、
前記第2計測手段は、前記第1ステレオ画像を用いた距離計測によって取得された第1距離情報に基づいて設定される第2計測位置において、前記第2ステレオ画像を用いた距離計測を行う請求項1に記載の画像処理装置。
Image acquisition means for acquiring a stereo image of the subject;
The image acquisition means acquires a first stereo image and a second stereo image taken after the first stereo image in time,
The first measurement means performs distance measurement using the first stereo image, acquires first distance information,
The second measurement means performs distance measurement using the second stereo image at a second measurement position set based on first distance information acquired by distance measurement using the first stereo image. Item 8. The image processing apparatus according to Item 1.
前記第2計測手段は、前記第2ステレオ画像を用いた距離計測を、前記第1計測位置においても行って、第1距離情報を新たに取得し、
前記設定手段は、新たに取得された第1距離情報に基づいて、前記第2計測位置を再設定する請求項7に記載の画像処理装置。
The second measurement means performs distance measurement using the second stereo image also at the first measurement position to newly acquire first distance information,
The image processing apparatus according to claim 7, wherein the setting unit resets the second measurement position based on newly acquired first distance information.
前記設定手段は、前記第1ステレオ画像および前記第2ステレオ画像それぞれに含まれる時間的に前後するフレーム間で被写体の動きベクトルを算出し、当該動きベクトルに基づいて前記第1計測位置を変更する請求項7または請求項8に記載の画像処理装置。   The setting unit calculates a motion vector of a subject between frames that are included in each of the first stereo image and the second stereo image, and changes the first measurement position based on the motion vector. The image processing apparatus according to claim 7 or 8. 前記第1計測位置は、前記ステレオ画像に含まれる1の画像から抽出された被写体領域において、当該被写体領域の中心付近に設定される請求項6から請求項9のいずれかに記載の画像処理装置。   10. The image processing device according to claim 6, wherein the first measurement position is set near the center of the subject region in a subject region extracted from one image included in the stereo image. 11. . 前記第1計測位置および前記第2計測位置の総数は、1の前記ステレオ画像を用いた距離計測において、所定数以下となるように設定される請求項6から請求項10のいずれかに記載の画像処理装置。   The total number of said 1st measurement position and said 2nd measurement position is set so that it may become below predetermined number in the distance measurement using one said stereo image. Image processing device. 前記設定手段は、撮影領域における中心付近の第1計測位置における距離が、他の第1計測位置における距離に比べて近距離であった場合、撮影領域の中心付近において第2計測位置を密に設定し、撮影領域の端付近において、第2計測位置を粗く設定する請求項1に記載の画像処理装置。   When the distance at the first measurement position near the center in the imaging region is closer than the distance at the other first measurement positions, the setting means densely sets the second measurement position near the center of the imaging region. The image processing apparatus according to claim 1, wherein the second measurement position is set roughly near the end of the imaging region. 前記設定手段は、前記ステレオ画像に含まれる1の画像を用いて被写体の距離情報を推定し、推定された距離情報を反映して、第2計測位置を変更する請求項6から請求項11のいずれかに記載の画像処理装置。   The said setting means estimates the distance information of a subject using one image included in the stereo image, and reflects the estimated distance information to change the second measurement position. The image processing apparatus according to any one of the above. 撮影領域における被写体までの距離計測を、前記撮影領域に設定された第1計測位置において行って、第1距離情報を取得する第1計測手段と、
前記第1距離情報に基づいて、撮影領域における被写体までの距離計測を追加して行うための第2計測位置を前記撮影領域において設定する設定手段と、
前記第2計測位置において距離計測を行って、第2距離情報を取得する第2計測手段と、
を備える距離計測装置。
First measurement means for measuring the distance to the subject in the imaging region at a first measurement position set in the imaging region and acquiring first distance information;
Setting means for setting a second measurement position in the imaging region for additionally performing distance measurement to the subject in the imaging region based on the first distance information;
Second measurement means for performing distance measurement at the second measurement position and acquiring second distance information;
A distance measuring device comprising:
JP2010256576A 2010-11-17 2010-11-17 Picture processing device and distance measuring device Pending JP2012107971A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010256576A JP2012107971A (en) 2010-11-17 2010-11-17 Picture processing device and distance measuring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010256576A JP2012107971A (en) 2010-11-17 2010-11-17 Picture processing device and distance measuring device

Publications (1)

Publication Number Publication Date
JP2012107971A true JP2012107971A (en) 2012-06-07

Family

ID=46493759

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010256576A Pending JP2012107971A (en) 2010-11-17 2010-11-17 Picture processing device and distance measuring device

Country Status (1)

Country Link
JP (1) JP2012107971A (en)

Similar Documents

Publication Publication Date Title
US8928736B2 (en) Three-dimensional modeling apparatus, three-dimensional modeling method and computer-readable recording medium storing three-dimensional modeling program
US10789765B2 (en) Three-dimensional reconstruction method
JP5456020B2 (en) Information processing apparatus and method
US8941750B2 (en) Image processing device for generating reconstruction image, image generating method, and storage medium
JP4657313B2 (en) Stereoscopic image display apparatus and method, and program
TWI497980B (en) System and method of processing 3d stereoscopic images
JP5291755B2 (en) Stereoscopic image generation method and stereoscopic image generation system
KR101804205B1 (en) Apparatus and method for image processing
JP5110138B2 (en) AR processing apparatus, AR processing method, and program
JP6452360B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP2003187261A (en) Device and method for generating three-dimensional image, three-dimensional image processing apparatus, three-dimensional image photographing display system, three-dimensional image processing method and storage medium
US20140340486A1 (en) Image processing system, image processing method, and image processing program
JP5533529B2 (en) Image processing apparatus and image processing system
JP6585938B2 (en) Stereoscopic image depth conversion apparatus and program thereof
WO2018032841A1 (en) Method, device and system for drawing three-dimensional image
JP4958689B2 (en) Stereoscopic image generating apparatus and program
KR20200021891A (en) Method for the synthesis of intermediate views of a light field, system for the synthesis of intermediate views of a light field, and method for the compression of a light field
JP2015073185A (en) Image processing device, image processing method and program
US20140192163A1 (en) Image pickup apparatus and integrated circuit therefor, image pickup method, image pickup program, and image pickup system
JP6021489B2 (en) Imaging apparatus, image processing apparatus and method thereof
JP5464129B2 (en) Image processing apparatus and parallax information generating apparatus
TWI536832B (en) System, methods and software product for embedding stereo imagery
KR101857977B1 (en) Image apparatus for combining plenoptic camera and depth camera, and image processing method
JP2013175821A (en) Image processing device, image processing method, and program
CN109379577B (en) Video generation method, device and equipment of virtual viewpoint