JP4733448B2 - Parallax generation device and parallax generation program - Google Patents

Parallax generation device and parallax generation program Download PDF

Info

Publication number
JP4733448B2
JP4733448B2 JP2005202298A JP2005202298A JP4733448B2 JP 4733448 B2 JP4733448 B2 JP 4733448B2 JP 2005202298 A JP2005202298 A JP 2005202298A JP 2005202298 A JP2005202298 A JP 2005202298A JP 4733448 B2 JP4733448 B2 JP 4733448B2
Authority
JP
Japan
Prior art keywords
distance
pixel
image
camera
conversion
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.)
Expired - Fee Related
Application number
JP2005202298A
Other languages
Japanese (ja)
Other versions
JP2007018459A (en
Inventor
俊彦 三須
保明 金次
正樹 高橋
眞 蓼沼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Japan Broadcasting Corp
Original Assignee
Japan Broadcasting Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Japan Broadcasting Corp filed Critical Japan Broadcasting Corp
Priority to JP2005202298A priority Critical patent/JP4733448B2/en
Publication of JP2007018459A publication Critical patent/JP2007018459A/en
Application granted granted Critical
Publication of JP4733448B2 publication Critical patent/JP4733448B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Description

本発明は、撮影した位置とは異なる視点からの画像を生成する技術に係り、特に、撮影された画像と、撮影したカメラから被写体までの距離を示す距離情報とに基づいて、視点の異なる画像を生成する視差生成装置及び視差生成プログラムに関する。   The present invention relates to a technique for generating an image from a viewpoint different from a captured position, and in particular, an image having a different viewpoint based on the captured image and distance information indicating a distance from the captured camera to the subject. The present invention relates to a parallax generation device and a parallax generation program.

従来、撮影した視点とは異なる視点からの画像を生成する場合には、被写体の3次元形状を推定してから所望の画像平面に投影する方法や、複数台のカメラにより被写体を撮影し、この画像間で演算処理により視点の異なる画像を合成する方法が行われていた。   Conventionally, when generating an image from a viewpoint different from the viewpoint from which the image was taken, a method of projecting the object on a desired image plane after estimating the three-dimensional shape of the object, or photographing the object with a plurality of cameras, A method of synthesizing images with different viewpoints by arithmetic processing between images has been performed.

また、複数の通常のテレビカメラによって撮影された複数の画像から両目視差を生成する画像を生成する装置が開示されている(特許文献1参照)。この装置は、撮影された複数の画像を各々拡大又は縮小し、更に、両目瞳孔間隔に合わせて、画像内において水平方向にずらすことで、両目視差を生成するための画像を生成するものである。   In addition, an apparatus for generating an image for generating binocular parallax from a plurality of images taken by a plurality of ordinary television cameras is disclosed (see Patent Document 1). This apparatus generates an image for generating binocular parallax by enlarging or reducing each of a plurality of captured images, and further shifting in the horizontal direction within the image in accordance with the binocular pupil interval. .

更に、1つの視点からの画像と、この視点から被写体までの距離を示す距離画像とに基づいて、視点が水平方向あるいは垂直方向に移動した場合の画像を生成する装置が開示されている(特許文献2参照)。この装置は、視点の移動量に対応する各画素のシフト量を、所定間隔の距離データに対応させたテーブルを予め格納し、このテーブルを参照して、画素ごとのシフト量を決定するものである。
特開平8−19003号公報(段落番号0007〜0036) 特開2001−256482号公報(段落番号0014〜0060)
Furthermore, an apparatus for generating an image when the viewpoint moves in the horizontal direction or the vertical direction based on an image from one viewpoint and a distance image indicating the distance from the viewpoint to the subject is disclosed (patent) Reference 2). This device stores in advance a table in which the shift amount of each pixel corresponding to the amount of movement of the viewpoint is associated with distance data at a predetermined interval, and refers to this table to determine the shift amount for each pixel. is there.
JP-A-8-19003 (paragraph numbers 0007 to 0036) JP 2001-256482 A (paragraph numbers 0014 to 0060)

しかしながら、被写体の3次元形状を推定する方法では、3次元形状の復元のために膨大な演算時間とメモリとを要するという問題があった。また、複数の画像間で演算処理により視点の異なる画像を合成する方法では、複数の画像間で、同一の部分が撮影されている画素同士の対応付けが必要となり、特にテクスチャの少ない被写体では視差演算の誤差が大きくなるという問題がある。   However, the method for estimating the three-dimensional shape of the subject has a problem that it takes a huge amount of calculation time and memory to restore the three-dimensional shape. In addition, in the method of synthesizing images with different viewpoints by arithmetic processing between a plurality of images, it is necessary to associate pixels in which the same part has been photographed between the plurality of images, and particularly in a subject with less texture, the parallax There is a problem that a calculation error increases.

更に、特許文献1の装置では、各々の画像を拡大又は縮小して水平方向にシフトするものであるので、予め撮影した視点以外の視点からの画像を生成することはできない。また、特許文献2の装置では、水平方向あるいは垂直方向への視点の移動が前提とされているため、カメラの姿勢の変化や焦点距離の変化には適用できない。また、この装置では、視点の移動量に対応するシフト量のテーブルを予め格納することで処理を高速化するものであるが、カメラの姿勢の変化や焦点距離の変化にも対応させようとすると多次元のテーブルをメモリ上に格納する必要が生じる。そのため、膨大なメモリが必要となるという問題があった。   Furthermore, since the apparatus of Patent Document 1 is to shift each image in the horizontal direction by enlarging or reducing each image, it is not possible to generate an image from a viewpoint other than the viewpoint that was previously captured. Further, since the apparatus of Patent Document 2 is premised on the movement of the viewpoint in the horizontal direction or the vertical direction, it cannot be applied to a change in camera posture or a change in focal length. In addition, this apparatus speeds up the process by storing a table of shift amounts corresponding to the amount of movement of the viewpoint in advance, but when trying to cope with changes in camera posture and focal length, It becomes necessary to store a multidimensional table in the memory. For this reason, there is a problem that a huge memory is required.

本発明は、前記従来技術の問題を解決するために成されたもので、3次元形状の復元や、画像間の画素の対応付けを行うことなく、かつ、被写体形状に制約を課すことなく、更に、膨大なメモリを必要とせずに、画像と距離情報とに基づいて、当該画像を撮影した条件とは視線の位置及びカメラの向きが異なる画像を生成することができる視差生成装置及び視差生成プログラムを提供することを目的とする。   The present invention was made to solve the problems of the prior art, without restoring the three-dimensional shape, associating pixels between images, and without imposing restrictions on the subject shape, Furthermore, a parallax generation device and a parallax generation that can generate an image in which the position of the line of sight and the direction of the camera are different from the conditions for capturing the image based on the image and the distance information without requiring a huge memory The purpose is to provide a program.

前記課題を解決するため、請求項1に記載の視差生成装置は、被写体の画像である入力画像と、前記入力画像を撮影したカメラから前記入力画像の各々の画素に対応する前記被写体までの距離を示す距離情報とを入力し、任意の視点において仮想的に設置された仮想カメラからの画像である視差画像を生成する視差生成装置であって、座標データ記憶手段と、座標変換手段と、視差画像記憶手段と、距離データ記憶手段と、距離変換手段と、変換距離記憶手段と、比較手段とを備える構成とした。 In order to solve the above problem, the parallax generation device according to claim 1, an input image that is an image of a subject, and a distance from a camera that has captured the input image to the subject corresponding to each pixel of the input image Is a parallax generation device that generates a parallax image that is an image from a virtual camera that is virtually installed at an arbitrary viewpoint, the coordinate data storage unit, the coordinate conversion unit, and the parallax An image storage unit, a distance data storage unit, a distance conversion unit, a conversion distance storage unit, and a comparison unit are provided.

かかる構成によれば、視差生成装置は、座標データ記憶手段に、カメラの位置に対する視点の相対位置(ξ,η,ζ)、カメラに対する仮想カメラの相対的な姿勢(α,δ,φ)、カメラの焦点距離f 及び仮想カメラの焦点距離fを含む変位量情報と、入力画像内における、対象となる画素の座標h,vと、当該画素に対応する被写体からカメラまでの距離とが所定値となるときの画素に対応する視差画像における画素の変換後の座標h’,v’を、式(9)で表されるように、入力画像における対象となる画素の座標h,v、距離及び変位量情報に対応付けた座標データを記憶する。 According to such a configuration, the parallax generating device stores the relative position (ξ, η, ζ) of the viewpoint with respect to the position of the camera, the relative posture (α, δ, φ) of the virtual camera with respect to the camera, in the coordinate data storage unit . Displacement amount information including the focal length f 0 of the camera and the focal length f of the virtual camera, the coordinates h and v of the target pixel in the input image, and the distance d from the subject corresponding to the pixel to the camera. The coordinates h ′, v ′ after pixel conversion in the parallax image corresponding to the pixel when the predetermined value is obtained are represented by the coordinates h, v 1 , Coordinate data associated with the distance d and the displacement amount information is stored.

また、視差生成装置は、座標変換手段によって、外部から入力された変位量情報と、距離情報とに基づいて、座標データ記憶手段に記憶された座標データを読み出して、補間演算によって、入力画像の各々の画素に対応する視差画像における変換後の画素の座標を算出する。ここで、読み出された座標データの変位量情報及び対象となる画素に対応する被写体からカメラまでの距離と、外部から入力された変位量情報、距離情報及び画素の座標が一致していなくても、視差画像生成装置は、補間演算によって、外部から入力された変位量情報及び距離情報に対応する、当該画素の視差画像における座標を算出することができる。更に、視差生成装置は、視差画像記憶手段に、入力画像の各々の画素の画素値を、座標変換手段によって算出された座標の画素の画素値として記憶する。 Further, the parallax generation device reads out the coordinate data stored in the coordinate data storage unit based on the displacement amount information and the distance information input from the outside by the coordinate conversion unit, and performs an interpolation operation on the input image. The coordinates of the converted pixel in the parallax image corresponding to each pixel are calculated. Here, the displacement information in the read coordinate data and the distance from the subject corresponding to the target pixel to the camera do not match the displacement information, distance information and pixel coordinates input from the outside. In addition, the parallax image generation device can calculate coordinates in the parallax image of the pixel corresponding to the displacement amount information and the distance information input from the outside by interpolation calculation. Furthermore, the parallax generation device stores the pixel value of each pixel of the input image in the parallax image storage unit as the pixel value of the pixel of the coordinates calculated by the coordinate conversion unit.

これによって、視差生成装置は、被写体の入力画像を、任意の位置及び任意の姿勢の仮想カメラからの画像である視差画像に変換して視差画像記憶手段に記憶することができる。   Accordingly, the parallax generation device can convert the input image of the subject into a parallax image that is an image from a virtual camera at an arbitrary position and arbitrary posture and store the parallax image in the parallax image storage unit.

また、視差生成装置は、距離データ記憶手段に、入力画像内における対象となる画素の座標、当該画素に対応する被写体からカメラまでの距離及び変位量情報が所定値となるときの当該画素に対応する被写体から視点までの距離を、座標、カメラまでの距離及び変位量情報に対応付けた距離データを記憶する。また、視差生成装置は、距離変換手段によって、外部から入力された変位量情報と、距離情報とに基づいて、距離データ記憶手段に記憶された距離データを読み出して、補間演算によって、入力画像の各々の画素に対応する被写体の視点までの距離を算出する。 Further, the parallax generation device corresponds to the distance data storage unit corresponding to the pixel when the coordinates of the target pixel in the input image, the distance from the subject to the camera corresponding to the pixel, and the displacement amount information are predetermined values. The distance data in which the distance from the subject to the viewpoint is associated with the coordinates, the distance to the camera, and the displacement amount information is stored. Further, the parallax generation device reads out the distance data stored in the distance data storage unit based on the displacement amount information input from the outside and the distance information by the distance conversion unit, and performs an interpolation calculation of the input image. The distance to the viewpoint of the subject corresponding to each pixel is calculated.

そして、視差生成装置は、変換距離記憶手段に、距離変換手段によって算出された距離を、座標変換手段によって算出された座標に対応付けて記憶する。更に、視差生成装置は、比較手段によって、距離変換手段で算出された距離が、この距離に対応する画素と同一の画素に対応付けられて変換距離記憶手段に記憶された距離に比べて小さい場合に、変換距離記憶手段に対して距離変換手段で算出された距離を書き込む許可を行うとともに、視差画像記憶手段に入力画像の当該画素の画素値を書き込む許可を行う。   The parallax generation device stores the distance calculated by the distance conversion unit in the conversion distance storage unit in association with the coordinates calculated by the coordinate conversion unit. Furthermore, in the parallax generation device, the distance calculated by the distance conversion unit by the comparison unit is smaller than the distance stored in the conversion distance storage unit in association with the same pixel as the pixel corresponding to this distance. In addition, the conversion distance storage unit is allowed to write the distance calculated by the distance conversion unit, and the parallax image storage unit is allowed to write the pixel value of the pixel of the input image.

これによって、視差生成装置は、入力画像の複数の画素の座標が、視差画像における同一の画素の座標に変換された場合には、仮想カメラからの距離が小さい画素の画素値を視差画像記憶手段に記憶する。   As a result, the parallax generation device, when the coordinates of the plurality of pixels of the input image are converted into the coordinates of the same pixel in the parallax image, the pixel value of the pixel having a small distance from the virtual camera is stored in the parallax image storage unit To remember.

また、請求項に記載の視差生成プログラムは、被写体の画像である入力画像と、前記入力画像を撮影したカメラから前記入力画像の各々の画素に対応する前記被写体までの距離を示す距離情報とを入力し、任意の視点において仮想的に設置された仮想カメラからの画像である視差画像を生成するために、座標データ記憶手段と、距離データ記憶手段と、変換距離記憶手段と、視差画像記憶手段とを備えるコンピュータを、座標変換手段、距離変換手段、比較手段、として機能させることとした。 The parallax generation program according to claim 2 includes an input image that is an image of a subject, distance information that indicates a distance from a camera that has captured the input image to the subject that corresponds to each pixel of the input image, and , And a coordinate data storage unit, a distance data storage unit, a conversion distance storage unit, and a parallax image storage unit for generating a parallax image that is an image from a virtual camera virtually installed at an arbitrary viewpoint The computer including the means is made to function as a coordinate conversion means, a distance conversion means, and a comparison means .

かかる構成によれば、視差生成プログラムは、座標変換手段によって、外部から入力された、カメラの位置に対する視点の相対位置(ξ,η,ζ)、カメラに対する仮想カメラの相対的な姿勢(α,δ,φ)、カメラの焦点距離f 及び仮想カメラの焦点距離fを含む変位量情報と、距離情報とに基づいて、入力画像内における、対象となる画素の座標h,vと、当該画素に対応する被写体からカメラまでの距離と、変位量情報とが所定値となるときの画素に対応する視差画像における画素の変換後の座標h’,v’を、式(9)で表されるように、入力画像における対象となる画素の座標h,v、当該画素に対応する被写体からカメラまでの距離及び変位量情報に対応付けた座標データを予め記憶する座標データ記憶手段から座標データを読み出して、補間演算によって、入力画像の各々の画素に対応する視差画像における画素の変換後の座標を算出する。また、視差生成プログラムは、距離変換手段によって、変位量情報と、距離情報とに基づいて、距離データ記憶手段に記憶された距離データを読み出して、補間演算によって、入力画像の各々の画素に対応する被写体の視点までの距離を算出する。また、視差生成プログラムは、比較手段によって、距離変換手段によって算出された距離が、この距離に対応する画素と同一の画素に対応付けられて変換距離記憶手段に記憶された距離に比べて小さい場合に、変換距離記憶手段に対して距離変換手段によって算出された距離を書き込む許可を行うとともに、視差画像記憶手段に入力画像の当該画素の画素値を書き込む許可を行う。 According to such a configuration, the parallax generation program receives the relative position (ξ, η, ζ) of the viewpoint with respect to the position of the camera, the relative orientation (α, δ, φ), the displacement information including the camera focal length f 0 and the virtual camera focal length f, and the distance information, the coordinates h and v of the target pixel in the input image, and the pixel The coordinates h ′ and v ′ after pixel conversion in the parallax image corresponding to the pixel when the distance d from the subject corresponding to the camera and the displacement amount information have a predetermined value are expressed by Expression (9). As described above, the coordinates h, v of the target pixel in the input image , the distance d from the subject corresponding to the pixel to the camera, and the coordinate data from the coordinate data storage means for storing the coordinate data associated with the displacement amount information in advance. Read The coordinates after pixel conversion in the parallax image corresponding to each pixel of the input image are calculated by interpolation . Further, the parallax generation program reads the distance data stored in the distance data storage unit based on the displacement amount information and the distance information by the distance conversion unit, and corresponds to each pixel of the input image by interpolation calculation. The distance to the viewpoint of the subject to be calculated is calculated. Further, the parallax generation program may be configured such that the distance calculated by the distance conversion unit by the comparison unit is smaller than the distance stored in the conversion distance storage unit in association with the same pixel as the pixel corresponding to the distance. In addition, the conversion distance storage unit is allowed to write the distance calculated by the distance conversion unit, and the parallax image storage unit is allowed to write the pixel value of the pixel of the input image.

これによって、視差生成プログラムは、被写体の入力画像を、任意の位置及び任意の姿勢の仮想カメラからの画像である視差画像に変換して視差画像記憶装置に記憶することができる。   Accordingly, the parallax generation program can convert the input image of the subject into a parallax image that is an image from a virtual camera at an arbitrary position and arbitrary posture and store the parallax image in the parallax image storage device.

本発明に係る視差生成装置及び視差生成プログラムでは、以下のような優れた効果を奏する。請求項1又は請求項に記載の発明によれば、3次元形状の復元や、複数の画像間の画素の対応付けを行わずに、任意の形状の被写体の入力画像と距離情報とに基づいて、任意の位置及び任意の姿勢の仮想カメラからの視差画像を生成することができる。また、座標データによって示される視差画像における画素の座標を補間して、入力画像の各々の画素の座標を算出するため、記憶された座標データ間のカメラの姿勢の変化や焦点距離の変化の間隔を大きくして、予め記憶しておく座標データの量を減らすことができる。 The parallax generation device and the parallax generation program according to the present invention have the following excellent effects. According to the invention described in claim 1 or 2 , based on the input image and distance information of a subject having an arbitrary shape without restoring a three-dimensional shape or associating pixels between a plurality of images. Thus, it is possible to generate a parallax image from a virtual camera at any position and any posture. Also, in order to calculate the coordinates of each pixel of the input image by interpolating the coordinates of the pixels in the parallax image indicated by the coordinate data, the interval between the change in the camera posture and the change in the focal length between the stored coordinate data Can be increased to reduce the amount of coordinate data stored in advance.

請求項に記載の発明によれば、視点から見て、ある被写体がそれより手前にある他の被写体の陰に隠れてしまう場合に、手前にある被写体のみを表示した視差画像を生成することができる。 According to the first aspect of the present invention, when a certain subject is hidden behind another subject in front of the viewpoint as viewed from the viewpoint, a parallax image displaying only the subject in front is generated. Can do.

以下、本発明の実施の形態について図面を参照して説明する。
[視差生成装置の構成]
まず、図1を参照して、本発明における視差生成装置1の構成について説明する。図1は、本発明における視差生成装置の構成を示したブロック図である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[Configuration of parallax generation device]
First, the configuration of the parallax generation device 1 according to the present invention will be described with reference to FIG. FIG. 1 is a block diagram illustrating a configuration of a parallax generation device according to the present invention.

視差生成装置1は、被写体を撮影した画像(入力画像)と、この画像を撮影したカメラから画像の各画素に対応する被写体までの距離を画素ごとに示す画像である距離画像とに基づいて、任意の視点からの画像(視差画像)を生成するものである。視差生成装置1は、カウンタ11と、アドレス演算手段12と、カウンタ13と、アドレス演算手段14と、距離画像記憶手段15と、座標データ記憶手段16と、幾何変換手段17と、距離データ記憶手段18と、距離変換手段19と、補間手段20と、比較手段21と、変換距離記憶手段22と、アドレス演算手段23と、視差画像記憶手段24とを備える。   The parallax generation device 1 is based on an image (input image) obtained by photographing a subject and a distance image that is an image showing the distance from the camera that photographed the image to the subject corresponding to each pixel of the image for each pixel. An image (parallax image) from an arbitrary viewpoint is generated. The parallax generation device 1 includes a counter 11, an address calculation unit 12, a counter 13, an address calculation unit 14, a distance image storage unit 15, a coordinate data storage unit 16, a geometric conversion unit 17, and a distance data storage unit. 18, a distance conversion unit 19, an interpolation unit 20, a comparison unit 21, a conversion distance storage unit 22, an address calculation unit 23, and a parallax image storage unit 24.

なお、視差生成装置1には、外部から被写体を撮影した画像と当該画像の同期信号、及び、距離画像と当該距離画像の同期信号が時系列に入力されるとともに、この画像を撮影したカメラに対する、視点の相対的な位置や、視点に仮想的に設置されるカメラの相対的な向きや焦点距離等を示す変位量(変位量情報)pが入力される。   Note that the parallax generation device 1 receives an image obtained by photographing an object from the outside, a synchronization signal of the image, and a distance image and a synchronization signal of the distance image in time series. A displacement amount (displacement amount information) p indicating the relative position of the viewpoint, the relative orientation of the camera virtually installed at the viewpoint, the focal length, and the like is input.

ここで、画像とは、2次元状に輝度情報を配置したものとし、各輝度情報は実空間上のある点の輝度がレンズ等による幾何変換により投影されたものである。また、輝度情報とは、電磁波スペクトルを光学フィルタなどの伝達関数を通して観測した光強度に関するものであり、1次元以上のベクトルで表現されるものとする。例えば、単色(モノクローム)の画像は、輝度情報は1画素当たり1次元である。カラー画像では、例えば、赤、青、緑の3原色(あるいは、輝度1次元及び色差2次元からなる信号)からなる3次元ベクトルとすることができる。更に、例えば、多バンド画像では、2以上の波長帯域で観測した輝度値をベクトル表現したものとすることができる。   Here, it is assumed that the luminance information is two-dimensionally arranged, and each luminance information is obtained by projecting the luminance of a certain point in the real space by a geometric transformation using a lens or the like. The luminance information relates to light intensity obtained by observing the electromagnetic wave spectrum through a transfer function such as an optical filter, and is expressed by a vector of one or more dimensions. For example, for a monochrome (monochrome) image, the luminance information is one-dimensional per pixel. In a color image, for example, it can be a three-dimensional vector composed of three primary colors of red, blue, and green (or a signal composed of one-dimensional luminance and two-dimensional color difference). Furthermore, for example, in a multi-band image, the luminance values observed in two or more wavelength bands can be expressed as vectors.

また、距離画像とは、2次元状に距離情報を配置したデータを指し、各距離情報は、前記画像の各画素に対応する実空間上の点とカメラとの間の距離を表す数値である。距離情報として、例えば、実空間上の点とカメラ上の代表的な点との間の距離を一意に決定できる数値を用いることができる。すなわち、例えば、実空間上の点とカメラのレンズの第1光学主点との距離を距離情報とすることができる。   The distance image refers to data in which distance information is arranged two-dimensionally, and each distance information is a numerical value representing the distance between a point on the real space corresponding to each pixel of the image and the camera. . As the distance information, for example, a numerical value that can uniquely determine the distance between a point on the real space and a representative point on the camera can be used. That is, for example, the distance information can be the distance between a point in real space and the first optical principal point of the camera lens.

更に、変位量pとは、画像を撮影したカメラ(実カメラ)に対する、視点に仮想的に設置される仮想カメラの相対位置を示す情報及び相対姿勢を示す情報、実カメラの焦点距離f0及び仮想カメラの焦点距離fのうちの1成分以上を含むものである。 Furthermore, the displacement amount p is information indicating the relative position of the virtual camera virtually installed at the viewpoint and information indicating the relative attitude with respect to the camera (real camera) that has captured the image, the focal length f 0 of the actual camera, and It includes one or more components of the focal length f of the virtual camera.

カウンタ11は、外部から入力された、被写体を撮影した画像の同期信号に基づいて、入力される画像の各画素の水平座標h及び垂直座標vを出力するものである。この水平座標hと垂直座標vは、アドレス演算手段12に出力される。   The counter 11 outputs the horizontal coordinate h and the vertical coordinate v of each pixel of the input image based on the synchronization signal of the image obtained by photographing the subject input from the outside. The horizontal coordinate h and the vertical coordinate v are output to the address calculation means 12.

なお、例えば、入力される画像が順次走査(プログレッシブ走査)の画像の場合には、水平同期信号及び垂直同期信号に基づいて計数を行い、主走査を水平方向(又は垂直方向)、副走査を垂直方向(又は水平方向)にとり、順次画素位置を選択することができる。また、例えば、映像入力が飛び越し走査(インタレース走査)の場合のように、水平座標h及び垂直座標vを一定の規則で定める順序で出力することとしてもよい。なお、同期信号入力として画像入力の信号を用い、当該画像の入力信号から同期信号成分を分離して、この同期信号に基づいて水平座標h及び垂直座標vを出力することとしてもよい。   For example, when the input image is an image that is sequentially scanned (progressive scan), counting is performed based on the horizontal synchronization signal and the vertical synchronization signal, the main scanning is performed in the horizontal direction (or the vertical direction), and the sub scanning is performed. The pixel positions can be selected sequentially in the vertical direction (or horizontal direction). Further, for example, the horizontal coordinate h and the vertical coordinate v may be output in the order determined by a certain rule, as in the case where the video input is interlaced scanning (interlaced scanning). Note that an image input signal may be used as the synchronization signal input, the synchronization signal component may be separated from the input signal of the image, and the horizontal coordinate h and the vertical coordinate v may be output based on the synchronization signal.

アドレス演算手段12は、カウンタ11から入力された水平座標h及び垂直座標vに基づいて、後記する距離画像記憶手段15及び視差画像記憶手段24に対するアクセス用のアドレス(読み出しアドレス)を示す信号を生成するものである。ここで距離画像記憶手段15には外部から距離画像が、視差画像記憶手段24には画像が入力され、アドレス演算手段12は、後記する視差画像記憶手段24から視差画像を出力する際に読み出すアドレスを示す信号を生成するとともに、後記する幾何変換手段17及び距離変換手段19によって当該距離画像の各画素のデータを読み出すアドレスを示す信号を生成する。なお、アドレス演算手段12は、当該信号を、距離画像記憶手段15に対しては距離画像の解像度(水平解像度及び垂直解像度)に応じて出力し、視差画像記憶手段24に対しては画像の解像度(水平解像度及び垂直解像度)に応じて出力する。   The address calculation unit 12 generates a signal indicating an address (read address) for accessing the distance image storage unit 15 and the parallax image storage unit 24 described later, based on the horizontal coordinate h and the vertical coordinate v input from the counter 11. To do. Here, the distance image storage unit 15 receives a distance image from the outside, the parallax image storage unit 24 receives an image, and the address calculation unit 12 reads an address when outputting the parallax image from the parallax image storage unit 24 described later. And a geometric conversion means 17 and a distance conversion means 19 to be described later generate a signal indicating an address for reading data of each pixel of the distance image. The address calculation means 12 outputs the signal to the distance image storage means 15 according to the resolution of the distance image (horizontal resolution and vertical resolution), and to the parallax image storage means 24, the image resolution. Output according to (horizontal resolution and vertical resolution).

ここで、距離画像記憶手段15及び視差画像記憶手段24からの読み出しがランダムアクセスによる場合には、アドレス演算手段12は、例えば、水平解像度がH画素、垂直解像度がV画素のときに1画素当たりWワードを割り当てて、アドレスAを以下の式(1)によって計算することとしてもよい。なお、ここで、A0は基底アドレスとする。
A=(h+vH)W+A0 …(1)
Here, when the reading from the distance image storage unit 15 and the parallax image storage unit 24 is performed by random access, the address calculation unit 12 performs, for example, per pixel when the horizontal resolution is H pixels and the vertical resolution is V pixels. It is also possible to assign W words and calculate the address A by the following equation (1). Here, A 0 is a base address.
A = (h + vH) W + A 0 (1)

また、例えば、カウンタ11が、画面の一端を基点として走査したときの走査済みの画素数を計数した値Cを出力する場合には、アドレス演算手段12は、アドレスAを以下の式(2)によって計算することとしてもよい。
A=CW+A0 …(2)
For example, when the counter 11 outputs a value C obtained by counting the number of scanned pixels when scanning is performed using one end of the screen as a base point, the address calculation unit 12 sets the address A to the following equation (2). It is good also as calculating by.
A = CW + A 0 (2)

更に、距離画像記憶手段15及び視差画像記憶手段24からの読み出しがシリアルアクセスによる場合には、アドレス演算手段12は、例えば、カウンタ11から入力される水平座標h(又は垂直座標v)が変化する度に、パルスを発生することでクロック信号を生成することとしてもよい。また、必要に応じて、アドレス演算手段12は、垂直座標v(又は水平座標h)が特定の値(例えば0)となる度に、パルスを発生することで、シリアルアクセス中のアドレスを原点に戻すためのリセット信号を発生することとしてもよい。   Further, when reading from the distance image storage unit 15 and the parallax image storage unit 24 is performed by serial access, the address calculation unit 12 changes, for example, the horizontal coordinate h (or vertical coordinate v) input from the counter 11. The clock signal may be generated by generating a pulse each time. If necessary, the address calculation means 12 generates a pulse every time the vertical coordinate v (or horizontal coordinate h) becomes a specific value (for example, 0), so that the address during serial access is set as the origin. A reset signal for returning may be generated.

カウンタ13は、外部から入力された、被写体からカメラまでの距離を示す距離画像の同期信号に基づいて、入力される距離画像の各画素の水平座標及び垂直座標を出力するものである。この水平座標と垂直座標は、アドレス演算手段14に出力される。なお、このカウンタ13は、カウンタ11と同様の方法で水平座標及び垂直座標を特定することができる。そして、同期信号入力として距離画像入力の信号を用い、当該距離画像の入力信号から同期信号成分を分離して、この同期信号に基づいて水平座標及び垂直座標を出力することとしてもよい。   The counter 13 outputs the horizontal coordinate and the vertical coordinate of each pixel of the input distance image based on the synchronization signal of the distance image indicating the distance from the subject to the camera input from the outside. The horizontal coordinates and the vertical coordinates are output to the address calculation means 14. The counter 13 can specify the horizontal coordinate and the vertical coordinate in the same manner as the counter 11. Then, a distance image input signal may be used as a synchronization signal input, a synchronization signal component may be separated from the distance image input signal, and a horizontal coordinate and a vertical coordinate may be output based on the synchronization signal.

アドレス演算手段14は、カウンタ13から入力された水平座標及び垂直座標に基づいて、後記する距離画像記憶手段15に対するアクセス用のアドレス(書き込みアドレス)を示す信号を生成するものである。ここで距離画像記憶手段15には外部から距離画像が入力され、アドレス演算手段14は、当該距離画像の各画素のデータを書き込むアドレスを示す信号を生成する。ここで生成されたアドレスを示す信号は、距離画像記憶手段15に出力される。なお、このアドレス演算手段14は、アドレス演算手段12と同様の方法でアクセス用のアドレスを示す信号を生成することができる。   The address calculation means 14 generates a signal indicating an address (write address) for accessing the distance image storage means 15 described later, based on the horizontal coordinate and the vertical coordinate input from the counter 13. Here, the distance image is input to the distance image storage means 15 from the outside, and the address calculation means 14 generates a signal indicating an address for writing data of each pixel of the distance image. A signal indicating the address generated here is output to the distance image storage means 15. The address calculation means 14 can generate a signal indicating an access address in the same manner as the address calculation means 12.

距離画像記憶手段15は、外部から入力された距離画像を記憶するためのメモリであり、例えば、RAM(ランダムアクセスメモリ)やSAM(シリアルアクセスメモリ)によって実現することができる。ここで、距離画像記憶手段15には、アドレス演算手段14から入力される信号によって示されるアドレスに、距離画像の各々の画素に対応する距離を示す情報(距離情報)を記憶し、アドレス演算手段12から入力される信号によって示されるアドレスに記憶された距離情報を読み出して、幾何変換手段17及び距離変換手段19に出力する。   The distance image storage means 15 is a memory for storing a distance image input from the outside, and can be realized by, for example, a RAM (random access memory) or a SAM (serial access memory). Here, the distance image storage means 15 stores information (distance information) indicating the distance corresponding to each pixel of the distance image at the address indicated by the signal input from the address calculation means 14, and the address calculation means The distance information stored in the address indicated by the signal input from 12 is read out and output to the geometric conversion means 17 and the distance conversion means 19.

このように、距離画像記憶手段15が距離情報を記憶し、アドレス演算手段12から入力される信号に基づいて距離情報を読み出すことで、例えば、入力される画像と距離画像とで周波数が異なる場合にも、画像と距離画像とを同期させて出力することができる。なお、入力される画像と距離画像とが同期している場合には、視差生成装置1は、カウンタ13、アドレス演算手段14及び距離画像記憶手段15を備えず、距離画像が直接、幾何変換手段17及び距離変換手段19に入力されることとしてもよい。   As described above, when the distance image storage unit 15 stores the distance information and reads out the distance information based on the signal input from the address calculation unit 12, for example, when the input image and the distance image have different frequencies. In addition, the image and the distance image can be output in synchronization. When the input image and the distance image are synchronized, the parallax generation device 1 does not include the counter 13, the address calculation unit 14, and the distance image storage unit 15, and the distance image is directly converted into the geometric conversion unit. 17 and distance conversion means 19 may be input.

なお、距離画像記憶手段15から距離情報が所定の順序によって読み出される際に、異なる時点(フレーム、フィールドなどを単位とする)で記憶された距離情報が読み出されることを防ぐアドレッシングを行うことが望ましい。そのために、距離画像記憶手段15は、例えば、2画面分のメモリ領域(第1のメモリ領域及び第2のメモリ領域)を有し、ある時点では第1のメモリ領域を書き込み用、第2のメモリ領域を読み出し用とする。そして、次の時点では、第1のメモリ領域を読み出し用、第2のメモリ領域を書き込み用とし、書き込み及び読み出しのメモリ領域を交互に切り替えることを繰り返す。   When distance information is read from the distance image storage unit 15 in a predetermined order, it is desirable to perform addressing that prevents the distance information stored at different time points (in units of frames, fields, etc.) from being read. . For this purpose, the distance image storage means 15 has, for example, a memory area for two screens (a first memory area and a second memory area). At a certain point in time, the first memory area is used for writing, The memory area is for reading. At the next time point, the first memory area is used for reading, the second memory area is used for writing, and the writing and reading memory areas are alternately switched.

この操作は、基底アドレスを2種類(第1の基底アドレス及び第2の基底アドレス)用意して、これらをフレームごとに、書き込み及び読み出しに対して交互に設定することで実現可能である。すなわち、ある時点ではアドレス演算手段12が第1の基底アドレスを使用し、アドレス演算手段14が第2の基底アドレスを使用する。そして、次の時点ではアドレス演算手段12が第2の基底アドレスを使用し、アドレス演算手段14が第1の基底アドレスを使用する。このように、アドレス演算手段12及びアドレス演算手段14が交互に異なる基底アドレスを使用する。   This operation can be realized by preparing two types of base addresses (first base address and second base address) and alternately setting them for writing and reading for each frame. That is, at a certain point in time, the address calculation means 12 uses the first base address, and the address calculation means 14 uses the second base address. At the next time, the address calculation means 12 uses the second base address, and the address calculation means 14 uses the first base address. Thus, the address calculation means 12 and the address calculation means 14 use different base addresses alternately.

座標データ記憶手段16は、座標データを記憶するもので、半導体メモリ、ハードディスク等の一般的な記憶手段である。この座標データは、後記する幾何変換手段17によって読み出され、幾何変換手段17によって、撮影された画像を異なる視点からの画像に画素ごとに変換した後の座標を算出する際に参照されて用いられる。   The coordinate data storage means 16 stores coordinate data and is a general storage means such as a semiconductor memory or a hard disk. This coordinate data is read by the geometric conversion means 17 to be described later, and is referred to and used when the coordinates after the photographed image is converted into images from different viewpoints for each pixel by the geometric conversion means 17 are used. It is done.

なお、座標データは、当該カメラの位置から見た視点の相対位置及び相対姿勢(カメラパラメータ)である変位量p、及び、カメラから被写体までの距離dを所定の値に設定し、このカメラによって撮影された画像を当該視点からの画像に変換した際の、撮影された画像の各画素の変換後の座標を、当該変位量p、及び、距離dに対応させたものである。座標データ記憶手段16は、様々な変位量p及び距離dについての複数の座標データを予め記憶している。   In the coordinate data, the displacement p, which is the relative position and relative orientation (camera parameter) of the viewpoint viewed from the position of the camera, and the distance d from the camera to the subject are set to predetermined values, The converted coordinates of each pixel of the captured image when the captured image is converted into an image from the viewpoint are associated with the displacement amount p and the distance d. The coordinate data storage means 16 stores in advance a plurality of coordinate data for various displacement amounts p and distances d.

ここで、図2を参照して、座標データ記憶手段16に記憶される座標データの算出方法について説明する。ここで、カメラによって撮影された画像の水平座標h及び垂直座標vの画素を変換した後の座標を、水平座標h’及び垂直座標v’とする。図2は、座標データ記憶手段に記憶される座標データの算出方法を説明するための説明図である。なお、ここで、入力される画像を撮影したカメラを実カメラ、この実カメラから変位量pだけ移動した位置及び姿勢に仮想的に配置したカメラを仮想カメラという。ここでは、実カメラ及び仮想カメラによって撮影される画像の変換において、透視投影モデルが成り立つ場合を例に説明するが、レンズに収差がある場合、魚眼レンズを使用する場合、撮像面形状に歪みがある場合など、透視投影が成り立たないカメラを仮定してもよい。   Here, with reference to FIG. 2, the calculation method of the coordinate data memorize | stored in the coordinate data memory | storage means 16 is demonstrated. Here, the coordinates after converting the pixels of the horizontal coordinate h and the vertical coordinate v of the image photographed by the camera are set as a horizontal coordinate h ′ and a vertical coordinate v ′. FIG. 2 is an explanatory diagram for explaining a method of calculating coordinate data stored in the coordinate data storage means. Here, a camera that captures an input image is referred to as a real camera, and a camera that is virtually arranged at a position and orientation moved by a displacement amount p from the real camera is referred to as a virtual camera. Here, a case where a perspective projection model is established in the conversion of an image photographed by a real camera and a virtual camera will be described as an example. However, when the lens has aberration, when a fisheye lens is used, the imaging surface shape is distorted. In some cases, a camera in which perspective projection does not hold may be assumed.

図2に示すように、実カメラCによって撮影された画像上における画素の座標(h,v)に対応する被写体上の点をPとする。また、距離dは、画像の各画素に対応する実空間における被写体上の点と、カメラのレンズの第1光学主点との間の距離を示す。そして、変位量pは、実カメラCの固定された座標系に対する仮想カメラC’の相対位置(ξ,η,ζ)及び相対姿勢(α,δ,φ)、実カメラCの焦点距離f0及び仮想カメラC’の焦点距離fのうちの1成分以上を含むものである。ここで、変位量pは、以下の式(3)によって表されることとする。なお、相対姿勢は、ここでは、パン角α、チルト角δ及びロール角φによって表すが、例えば、オイラー角、回転行列、オイラーパラメータ等の任意の表現形式を用いることができる。 As shown in FIG. 2, let P be the point on the subject corresponding to the coordinates (h, v) of the pixel on the image taken by the real camera C. The distance d indicates the distance between a point on the subject in real space corresponding to each pixel of the image and the first optical principal point of the camera lens. The displacement amount p is determined by the relative position (ξ, η, ζ) and relative orientation (α, δ, φ) of the virtual camera C ′ with respect to the coordinate system of the real camera C, and the focal length f 0 of the real camera C. And one or more components of the focal length f of the virtual camera C ′. Here, the displacement amount p is represented by the following equation (3). Here, the relative posture is represented by the pan angle α, the tilt angle δ, and the roll angle φ. However, for example, any expression format such as an Euler angle, a rotation matrix, and Euler parameters can be used.

Figure 0004733448
Figure 0004733448

ここで、実カメラ座標系から見たある方向ベクトルを仮想カメラ系に変換する3行3列の回転行列をRとし、この行列Rの第1行成分を取り出した行ベクトルをR1、第2行成分を取り出した行ベクトルをR2、第3行成分を取り出した行ベクトルをR3とすると、行列Rは、以下の式(4)によって表される。 Here, a rotation matrix of 3 rows and 3 columns for converting a certain direction vector seen from the real camera coordinate system into a virtual camera system is R, and a row vector obtained by extracting the first row component of this matrix R is R 1 , 2 When the row vector from which the row component is extracted is R 2 and the row vector from which the third row component is extracted is R 3 , the matrix R is expressed by the following equation (4).

Figure 0004733448
Figure 0004733448

そして、仮想カメラ座標系における点Pの位置ベクトルをvqとすると、ベクトルvqは、以下の式(5)によって表される。 When the position vector of the point P in the virtual camera coordinate system is v q , the vector v q is expressed by the following equation (5).

Figure 0004733448
Figure 0004733448

また、実カメラCから見た点Pの位置ベクトルをvpとすると、ベクトルvpは、以下の式(6)によって表される。 Further, if the position vector of the point P viewed from the real camera C is v p , the vector v p is expressed by the following equation (6).

Figure 0004733448
Figure 0004733448

よって、式(3)から式(5)より、ベクトルvqについて、以下の式(7)が得られる。 Therefore, the following equation (7) is obtained for the vector v q from equations (3) to (5).

Figure 0004733448
Figure 0004733448

一方、仮想カメラC’で撮影した画像内における点Pの座標(h’,v’)は、以下の式(8)によって表される。   On the other hand, the coordinates (h ′, v ′) of the point P in the image photographed by the virtual camera C ′ are expressed by the following formula (8).

Figure 0004733448
Figure 0004733448

そして、前記の式(6)と式(8)より、以下の式(9)が得られる。   Then, the following equation (9) is obtained from the above equations (6) and (8).

Figure 0004733448
Figure 0004733448

なお、行列R及び行ベクトルR1、R2、R3をパン角α、チルト角δ及びロール角φによって表現すると、以下の式(10)のようになる。 When the matrix R and the row vectors R 1 , R 2 , R 3 are expressed by the pan angle α, the tilt angle δ, and the roll angle φ, the following equation (10) is obtained.

Figure 0004733448
Figure 0004733448

このようにして、前記の式(9)及び式(10)に基づいて、変位量p及びカメラから被写体までの距離dが所定値の場合における、ある座標h,vの画素についての座標データを算出することができる。そして、諸入力量h、v、d、ξ、η、ζ、α、δ、φ、f0、fの張るベクトル空間Sにおける代表的な点(代表点)s(k)(図示せず)をK個配置する(Kは2以上の整数、kは1以上K以下の整数)。そして、座標データ記憶手段16は、前記の方法によって算出されたK個の代表点s(1)、s(2)、…、s(K)の変換後の座標h’,v’に、変換前の座標h,v、変位量p及び距離dを対応させた座標データを予め記憶する。なお、座標データ記憶手段16には、変位量p及び距離dのサンプリングの間隔を、所定値おきに規則正しくとった座標データを記憶することとしてもよいし、ベクトル量子化のように、ランダムな複数の代表点についての座標データを記憶することとしてもよい。 Thus, based on the above formulas (9) and (10), the coordinate data for the pixels with certain coordinates h and v when the displacement amount p and the distance d from the camera to the subject are predetermined values are obtained. Can be calculated. Then, representative points (representative points) s (k) (not shown) in the vector space S spanned by the various input quantities h, v, d, ξ, η, ζ, α, δ, φ, f 0 , and f. Are arranged (K is an integer of 2 or more, k is an integer of 1 to K). Then, the coordinate data storage means 16 converts the K representative points s (1), s (2),..., S (K) calculated by the above method into converted coordinates h ′ and v ′. Coordinate data in which the previous coordinates h and v, the displacement amount p, and the distance d are associated is stored in advance. The coordinate data storage means 16 may store coordinate data in which the sampling interval of the displacement amount p and the distance d is regularly taken every predetermined value, or a plurality of random data such as vector quantization may be stored. It is also possible to store the coordinate data for the representative points.

幾何変換手段(座標変換手段)17は、外部から入力された変位量pと、距離画像記憶手段15から入力された距離情報と、カウンタ11から入力された座標h,vと、座標データ記憶手段16に記憶された座標データとに基づいて、外部から入力された画像の各々の画素について、当該画素の水平座標h及び垂直座標vを、視点からの画像における水平座標h’及び垂直座標v’に変換するものである。ここでは、幾何変換手段17は、アドレス演算部17aと、座標補間部17bとを備える。   The geometric conversion means (coordinate conversion means) 17 includes a displacement amount p input from the outside, distance information input from the distance image storage means 15, coordinates h and v input from the counter 11, and coordinate data storage means. For each pixel of the image input from the outside based on the coordinate data stored in 16, the horizontal coordinate h and the vertical coordinate v of the pixel are converted into the horizontal coordinate h ′ and the vertical coordinate v ′ in the image from the viewpoint. It is to convert to. Here, the geometric conversion means 17 is provided with the address calculating part 17a and the coordinate interpolation part 17b.

アドレス演算部17aは、外部から入力された変位量pと、距離画像記憶手段15から入力された距離情報と、カウンタ11から入力された座標h,vとに基づいて、後記する座標補間部17bによる補間に用いられる座標データの、座標データ記憶手段16におけるアドレスを出力するものである。このアドレスは、座標補間部17bに出力される。   The address calculation unit 17a is based on a displacement amount p input from the outside, distance information input from the distance image storage means 15, and coordinates h and v input from the counter 11, and a coordinate interpolation unit 17b described later. The address in the coordinate data storage means 16 of the coordinate data used for the interpolation is output. This address is output to the coordinate interpolation unit 17b.

ここで、座標データ記憶手段16には、様々な変位量p、距離d及び画素の座標h,vに対応付けられた座標データが記憶され、アドレス演算部17aは、例えば、座標補間部17bによってニアレストネイバー法によって補間する場合には、ベクトル空間Sにおいて、入力された変位量p、距離情報及び画素の座標h,vによって示される点sの最近傍の代表点s(k)の座標データを1つ選択して、このアドレスを座標補間部17bに出力することとしてもよい。また、座標補間部17bによって複数の座標データに基づいて補間する場合には、アドレス演算部17aは、複数の座標データのアドレスを出力することとしてもよい。   Here, the coordinate data storage means 16 stores coordinate data associated with various displacements p, distances d, and pixel coordinates h and v. The address calculation unit 17a is, for example, operated by the coordinate interpolation unit 17b. In the case of interpolation by the nearest neighbor method, in the vector space S, coordinate data of the nearest representative point s (k) of the point s indicated by the input displacement amount p, distance information, and pixel coordinates h and v. It is also possible to select one and output this address to the coordinate interpolation unit 17b. When the coordinate interpolation unit 17b performs interpolation based on a plurality of coordinate data, the address calculation unit 17a may output the addresses of the plurality of coordinate data.

座標補間部17bは、アドレス演算部17aから入力されたアドレスに基づいて座標データ記憶手段16から座標データを読み出して、当該座標データに基づいて補間処理を行い、実カメラによる画像において水平座標h及び垂直座標vの画素を仮想カメラからの画像に変換した際の、水平座標h’及び垂直座標v’を算出するものである。ここで算出された水平座標h’及び垂直座標v’は、補間手段20に出力される。   The coordinate interpolation unit 17b reads coordinate data from the coordinate data storage unit 16 based on the address input from the address calculation unit 17a, performs an interpolation process based on the coordinate data, and performs horizontal coordinates h and The horizontal coordinate h ′ and the vertical coordinate v ′ when the pixel of the vertical coordinate v is converted into an image from the virtual camera are calculated. The calculated horizontal coordinate h ′ and vertical coordinate v ′ are output to the interpolation unit 20.

ここで、例えば、座標補間部17bが、ニアレストネイバー法によって補間を行う場合には、アドレス演算部17aから1つの座標データに対応するアドレスが入力され、座標補間部17bは、このアドレスに対応する座標データを読み出す。例えば、外部から、カメラの位置に対する視点の相対位置のx座標として「ξ=11cm」が入力され、座標データ記憶手段16に記憶されたξ=10cmの座標データのアドレスがアドレス演算部17aから入力された場合には、座標補間部17bは、このξ=10cmに対応する座標データを座標データ記憶手段16から読み出す。そして、座標補間部17bは、座標データ記憶手段16から読み出された座標データによって示される座標を、変換後の水平座標h’及び垂直座標v’とすることとしてもよい。   Here, for example, when the coordinate interpolation unit 17b performs interpolation by the nearest neighbor method, an address corresponding to one coordinate data is input from the address calculation unit 17a, and the coordinate interpolation unit 17b corresponds to this address. Read the coordinate data. For example, “ξ = 11 cm” is input from the outside as the x coordinate of the relative position of the viewpoint with respect to the camera position, and the address of the coordinate data of ξ = 10 cm stored in the coordinate data storage unit 16 is input from the address calculation unit 17a. In such a case, the coordinate interpolation unit 17b reads the coordinate data corresponding to this ξ = 10 cm from the coordinate data storage unit 16. Then, the coordinate interpolation unit 17b may set the coordinate indicated by the coordinate data read from the coordinate data storage unit 16 as the converted horizontal coordinate h 'and vertical coordinate v'.

あるいは、例えば、座標補間部17bが、ベクトル空間Sにおいて、入力された変位量p、距離d及び画素の座標h,vによって示される点sを取り囲む代表点s(k)に対応する座標データを読み出して、この座標データによって示される座標と、点sの位置とに基づいて一次補間を施してその結果を変換後の水平座標h’及び垂直座標v’とすることとしてもよい。   Alternatively, for example, the coordinate interpolation unit 17b obtains coordinate data corresponding to the representative point s (k) surrounding the point s indicated by the input displacement amount p, distance d, and pixel coordinates h, v in the vector space S. It is also possible to read out and perform primary interpolation based on the coordinates indicated by the coordinate data and the position of the point s, and set the result as the converted horizontal coordinate h ′ and vertical coordinate v ′.

また、例えば、座標補間部17bが、テイラー展開を用いて補間することとしてもよい。このとき、座標データ記憶手段16には、ベクトル空間Sにおける代表点s(k)の座標データとともに、前記の式(9)、(10)に基づいて、以下の式(11)によって算出された、この代表点s(k)の周りにおけるs=(h,v,d,α,δ,φ,f0,f)による偏微分係数行列Mを予め記憶しておく。 For example, the coordinate interpolation unit 17b may perform interpolation using Taylor expansion. At this time, the coordinate data storage means 16 is calculated by the following equation (11) based on the equations (9) and (10) together with the coordinate data of the representative point s (k) in the vector space S. The partial differential coefficient matrix M by s = (h, v, d, α, δ, φ, f 0 , f) around the representative point s (k) is stored in advance.

Figure 0004733448
Figure 0004733448

そして、座標補間部17bが、ベクトル空間Sにおいて、入力された値(h、v、d、ξ、η、ζ、α、δ、φ、f0、f)に最も近くに存在する代表点s(k)と、当該代表点における偏微分係数行列Mとを座標データ記憶手段16から読み出し、下記の式(12)によって変換後の座標h’,v’を算出することができる。 Then, the coordinate interpolation unit 17b is the representative point s that is closest to the input values (h, v, d, ξ, η, ζ, α, δ, φ, f 0 , f) in the vector space S. (K) and the partial differential coefficient matrix M at the representative point can be read from the coordinate data storage means 16 and the converted coordinates h ′ and v ′ can be calculated by the following equation (12).

Figure 0004733448
Figure 0004733448

なお、ここでは、諸入力量h、v、d、ξ、η、ζ、α、δ、φ、f0、fの張るベクトル空間Sの場合を説明したが、必要に応じて(h、v、d、ξ、η、ζ、α、δ、φ、f0、f)の一部分だけを取り出したベクトルの張るベクトル空間としてもよい。 Here, the case of the vector space S spanned by the various input quantities h, v, d, ξ, η, ζ, α, δ, φ, f 0 , and f has been described, but if necessary, (h, v , D, ξ, η, ζ, α, δ, φ, f 0 , f).

距離データ記憶手段18は、距離データを記憶するもので、半導体メモリ、ハードディスク等の一般的な記憶手段である。この距離データは、後記する距離変換手段19によって読み出され、画素ごとに、撮影された画像を異なる視点からの画像に変換した後の画素に対応する被写体から視点までの距離d’を算出する際に参照されて用いられる。   The distance data storage means 18 stores distance data and is a general storage means such as a semiconductor memory or a hard disk. This distance data is read by the distance conversion means 19 described later, and for each pixel, a distance d ′ from the subject to the viewpoint corresponding to the pixel after converting the captured image into an image from a different viewpoint is calculated. Used when referred to.

なお、距離データは、変位量p、及び、カメラから被写体までの距離dを所定の値に設定し、このカメラによって撮影された画像を当該視点からの画像に変換した際の、撮影された画像の各画素の変換後の各画素に対応する被写体から視点までの距離d’を、当該変位量p、及び、距離dに対応させたものである。距離データ記憶手段18は、様々な変位量p及び距離dについての複数の距離データを予め記憶している。   In the distance data, the displacement p and the distance d from the camera to the subject are set to predetermined values, and the image captured when the image captured by the camera is converted into an image from the viewpoint. The distance d ′ from the subject corresponding to each pixel after conversion of each pixel to the viewpoint is made to correspond to the displacement amount p and the distance d. The distance data storage means 18 stores a plurality of distance data for various displacement amounts p and distances d in advance.

ここで、図2を参照して、距離データ記憶手段18に記憶される距離データの算出方法について説明する。図2に示すように、実カメラCによって撮影された画像上における画素の座標(h,v)に対応する被写体(点P)から実カメラCまでの距離dである場合に、仮想カメラC’から点Pまでの距離d’は、仮想カメラ座標系における点Pの位置ベクトルvqの絶対値であるので、距離d’は、以下の式(13)によって算出することができる。 Here, a method for calculating the distance data stored in the distance data storage means 18 will be described with reference to FIG. As shown in FIG. 2, when the distance d is from the subject (point P) corresponding to the pixel coordinates (h, v) on the image taken by the real camera C to the real camera C, the virtual camera C ′ Since the distance d ′ from the point P to the point P is the absolute value of the position vector v q of the point P in the virtual camera coordinate system, the distance d ′ can be calculated by the following equation (13).

Figure 0004733448
Figure 0004733448

なお、距離データ記憶手段18には、変位量p及び距離dのサンプリングの間隔を、所定値おきに規則正しくとった距離データを記憶することとしてもよいし、ベクトル量子化のように、ランダムな複数の代表点についての距離データを記憶することとしてもよい。   The distance data storage unit 18 may store distance data in which the sampling intervals of the displacement amount p and the distance d are regularly set every predetermined value, or a plurality of random numbers such as vector quantization may be stored. It is also possible to store the distance data for the representative points.

図1に戻って説明を続ける。距離変換手段(距離変換手段)19は、外部から入力された変位量pと、距離画像記憶手段15から入力された距離情報と、カウンタ11から入力された座標h,vと、距離データ記憶手段18に記憶された距離データとに基づいて、外部から入力された画像の各々の画素の距離情報によって示される距離dを、撮影された画像を異なる視点からの画像に変換した後の画素に対応する被写体から視点までの距離d’に変換するものである。ここでは、距離変換手段19は、アドレス演算部19aと、距離補間部19bとを備える。   Returning to FIG. 1, the description will be continued. The distance conversion means (distance conversion means) 19 includes a displacement amount p input from the outside, distance information input from the distance image storage means 15, coordinates h and v input from the counter 11, and distance data storage means. The distance d indicated by the distance information of each pixel of the image input from the outside based on the distance data stored in 18 corresponds to the pixel after the captured image is converted into an image from a different viewpoint. This is converted into a distance d ′ from the subject to be viewed to the viewpoint. Here, the distance conversion means 19 includes an address calculation unit 19a and a distance interpolation unit 19b.

アドレス演算部19aは、外部から入力された変位量pと、距離画像記憶手段15から入力された距離情報によって示される距離dとに基づいて、後記する座標補間部17bによる補間に用いられる距離データの、距離データ記憶手段18におけるアドレスを出力するものである。このアドレスは、距離補間部19bに出力される。   The address calculation unit 19a uses distance data used for interpolation by the coordinate interpolation unit 17b described later, based on the displacement amount p input from the outside and the distance d indicated by the distance information input from the distance image storage unit 15. The address in the distance data storage means 18 is output. This address is output to the distance interpolation unit 19b.

ここで、距離データ記憶手段18には、様々な変位量p及び距離dに対応付けられた距離データが記憶され、アドレス演算部19aは、例えば、ニアレストネイバー法によって、入力された変位量pと距離dとに最近傍の距離データを1つ選択してこのアドレスを距離補間部19bに出力することとしてもよい。また、距離補間部19bによって複数の距離データに基づいて補間を行う場合には、アドレス演算部19aは、複数の距離データのアドレスを出力することとしてもよい。   Here, the distance data storage means 18 stores distance data associated with various displacement amounts p and distances d, and the address calculation unit 19a receives the input displacement amount p by, for example, the nearest neighbor method. It is also possible to select one of the nearest distance data for the distance d and output the address to the distance interpolation unit 19b. When the distance interpolation unit 19b performs interpolation based on a plurality of distance data, the address calculation unit 19a may output addresses of the plurality of distance data.

距離補間部19bは、アドレス演算部19aから入力されたアドレスに基づいて距離データ記憶手段18から距離データを読み出して、当該距離データに基づいて補間処理を行い、実カメラによる画像において水平座標h及び垂直座標vの画素を仮想カメラからの画像に変換した際の、当該画素に対応する被写体から視点までの距離d’を算出するものである。ここで算出された距離d’は、補間手段20に出力される。   The distance interpolation unit 19b reads the distance data from the distance data storage unit 18 based on the address input from the address calculation unit 19a, performs an interpolation process based on the distance data, and in the image by the real camera, the horizontal coordinates h and The distance d ′ from the subject corresponding to the pixel to the viewpoint when the pixel at the vertical coordinate v is converted into an image from the virtual camera is calculated. The distance d ′ calculated here is output to the interpolation means 20.

補間手段20は、幾何変換手段17から入力された水平座標h’及び垂直座標v’、あるいは、距離変換手段19から入力された距離d’のそれぞれ複数のデータに対して補間処理を行うものである。ここで補間された水平座標h”、垂直座標v”及び距離d”は、アドレス演算手段23に出力される。   The interpolation unit 20 performs an interpolation process on each of a plurality of data of the horizontal coordinate h ′ and the vertical coordinate v ′ input from the geometric conversion unit 17 or the distance d ′ input from the distance conversion unit 19. is there. The interpolated horizontal coordinate h ″, vertical coordinate v ″, and distance d ″ are output to the address calculation unit 23.

例えば、補間手段20は、カウンタ11から出力された水平座標h及び垂直座標vに関する複数の組み合わせに注目し、それぞれの水平座標h’、垂直座標v’及び距離d’に基づいて補間処理を行うことができる。ここで、図3を参照して、補間手段20による補間処理について具体例を挙げて説明する。ここでは、補間手段20が、3点の近接する画素の水平座標h’、垂直座標v’及び距離d’に対して補間処理を行う場合について説明する。図3は、補間手段が、3点の近接する画素の水平座標、垂直座標及び距離に対して行う補間処理を説明するための説明図である。   For example, the interpolation unit 20 pays attention to a plurality of combinations related to the horizontal coordinate h and the vertical coordinate v output from the counter 11 and performs an interpolation process based on the respective horizontal coordinate h ′, vertical coordinate v ′, and distance d ′. be able to. Here, with reference to FIG. 3, the interpolation process by the interpolation means 20 will be described with a specific example. Here, a case will be described in which the interpolation unit 20 performs an interpolation process on the horizontal coordinate h ′, the vertical coordinate v ′, and the distance d ′ of three adjacent pixels. FIG. 3 is an explanatory diagram for explaining an interpolation process performed by the interpolation unit with respect to the horizontal coordinate, vertical coordinate, and distance of three adjacent pixels.

図3(a)に示すように、外部から入力される画像内における、隣接する3つの画素によって囲まれる三角形状のメッシュを想定し、当該メッシュを構成する三角パッチのそれぞれに注目する。ここで、ある三角パッチtの3頂点の座標を(h0,v0)、(h1,v1)、(h2,v2)とする。更に、この3頂点の座標を幾何変換手段17によって変換した結果を(h0’,v0’)、(h1’,v1’)、(h2’,v2’)とする。そして、図3(b)に示すように、補間手段20は、この3点Q0(h0’,v0’)、Q1(h1’,v1’)、Q2(h2’,v2’)に囲まれる3角形の内部の全格子点Qi(hi’,vi’)に対して補間値(h”,v”)及びd”を算出する。ここで、補間値(h”,v”)及びd”は、下記の式(14)によって求められる。 As shown in FIG. 3A, assuming a triangular mesh surrounded by three adjacent pixels in an image input from the outside, attention is paid to each of the triangular patches constituting the mesh. Here, the coordinates of the three vertices of a triangular patch t are (h 0 , v 0 ), (h 1 , v 1 ), and (h 2 , v 2 ). Further, the results obtained by converting the coordinates of the three vertices by the geometric conversion means 17 are (h 0 ′, v 0 ′), (h 1 ′, v 1 ′), and (h 2 ′, v 2 ′). Then, as shown in FIG. 3 (b), the interpolation means 20 uses the three points Q 0 (h 0 ′, v 0 ′), Q 1 (h 1 ′, v 1 ′), Q 2 (h 2 ′). , V 2 ′), interpolation values (h ″, v ″) and d ″ are calculated for all the lattice points Q i (h i ′, v i ′) inside the triangle. The values (h ″, v ″) and d ″ are obtained by the following equation (14).

Figure 0004733448
Figure 0004733448

なお、図3(b)に示すように、a1、b1、a2及びb2は、点Q0及び点Q2を通る直線に平行で点Qiを通る直線が、点Q0及び点Q1を通る直線と交わる点R1と、点Q0及び点Q1を通る直線に平行で点Qiを通る直線が、点Q0及び点Q2を通る直線と交わる点R2とを用いて、以下の式(15)により定められる。 As shown in FIG. 3B, a 1 , b 1 , a 2 and b 2 are parallel to the straight line passing through the points Q 0 and Q 2 and passing through the point Q i , and the points Q 0 and the point R 1 intersects the straight line passing through the point Q 1, the straight line passing through the parallel point Q i on the straight line passing through the point Q 0 and the point Q 1 is, the point R 2 intersects the straight line passing through the point Q 0 and the point Q 2 Is defined by the following equation (15).

Figure 0004733448
Figure 0004733448

ここで、補間手段20に、幾何変換手段17及び距離変換手段19から3点分の座標h’,v’及び距離d’が一度に入力されることとしてもよいし、補間手段20が、図示しないメモリを備え、メモリに3点分の座標h’,v’及び距離d’が蓄積された時点で、この3点について補間処理を行うこととしてもよい。   Here, the coordinates h ′, v ′ and the distance d ′ for three points may be input to the interpolation unit 20 from the geometric conversion unit 17 and the distance conversion unit 19 at a time. The memory may be provided, and when the coordinates h ′, v ′ and the distance d ′ for the three points are accumulated in the memory, the interpolation processing may be performed on the three points.

図1に戻って説明を続ける。比較手段21は、補間手段20から入力された距離d”と、後記する変換距離記憶手段22から入力された距離d”とを比較し、補間手段20から入力された距離d”が変換距離記憶手段22から入力された距離d”より小さい(又は、大きくない)場合に、変換距離記憶手段22及び視差画像記憶手段24に対して書き込み許可を与えるものである。なお、比較手段21は、補間手段20によって算出された距離d”の画素に対応する距離d”が変換距離記憶手段22に記憶されていない場合にも、変換距離記憶手段22及び視差画像記憶手段24に対して書き込み許可を与える。ここで生成された書き込み許可の指令は、変換距離記憶手段22と視差画像記憶手段24とに出力される。   Returning to FIG. 1, the description will be continued. The comparison means 21 compares the distance d ″ input from the interpolation means 20 with the distance d ″ input from the conversion distance storage means 22 described later, and the distance d ″ input from the interpolation means 20 is stored as the conversion distance storage. When the distance d ″ input from the means 22 is smaller (or not larger) than the distance d ″, write permission is given to the conversion distance storage means 22 and the parallax image storage means 24. Note that the comparison unit 21 also includes the conversion distance storage unit 22 and the parallax image storage unit even when the distance d ″ corresponding to the pixel of the distance d ″ calculated by the interpolation unit 20 is not stored in the conversion distance storage unit 22. 24 is given write permission. The write permission command generated here is output to the conversion distance storage unit 22 and the parallax image storage unit 24.

なお、この比較手段21によって書き込み許可を与えることで、視点から見て、補間手段20によって算出された距離d”に対応する被写体が、すでに変換距離記憶手段22に記憶された距離d”に対応する被写体の陰に隠れてしまう場合に、距離d”及び画素値を、変換距離記憶手段22及び視差画像記憶手段24に上書きされないように制御することができる。   In addition, by giving the writing permission by the comparison unit 21, the subject corresponding to the distance d ″ calculated by the interpolation unit 20 corresponds to the distance d ″ already stored in the conversion distance storage unit 22 from the viewpoint. The distance d ″ and the pixel value can be controlled so that they are not overwritten in the conversion distance storage means 22 and the parallax image storage means 24 when the object is hidden behind the subject.

変換距離記憶手段22は、補間手段20によって算出された距離d”を記憶するもので、半導体メモリ、ハードディスク等の一般的な記憶手段である。ここで、変換距離記憶手段22は、後記するアドレス演算手段23から入力されたアドレスに記憶された距離d”を比較手段21に出力し、比較手段21から書き込み許可の指令が入力された場合に、補間手段20によって算出された距離d”を当該アドレスに記憶する。この距離d”は、補間手段20から入力された距離d”が変換距離記憶手段22に記憶された距離d”より小さい(又は、大きくない)かを判断する際に参照されて用いられる。   The conversion distance storage means 22 stores the distance d ″ calculated by the interpolation means 20, and is a general storage means such as a semiconductor memory or a hard disk. Here, the conversion distance storage means 22 is an address described later. The distance d ″ stored in the address input from the calculation unit 23 is output to the comparison unit 21. When a write permission command is input from the comparison unit 21, the distance d ″ calculated by the interpolation unit 20 is This distance d ″ is referred to when determining whether the distance d ″ input from the interpolation means 20 is smaller (or not larger) than the distance d ″ stored in the conversion distance storage means 22. Used.

アドレス演算手段(画素対応付け手段)23は、補間手段20から入力された、変換後の水平座標h”及び垂直座標v”に基づいて、距離d”を変換距離記憶手段22に書き込むとともに、距離d”を変換距離記憶手段22から読み出すためのアドレスを示す情報を生成し、更に、外部から入力される画像の画素値を後記する視差画像記憶手段24に書き込むためのアドレスを示す情報を生成するものである。ここで生成された信号は、変換距離記憶手段22及び視差画像記憶手段24に出力される。なお、このアドレス演算手段23は、アドレス演算手段12と同様の方法でアクセス用のアドレスを示す信号を生成することができる。   The address calculation means (pixel association means) 23 writes the distance d ″ in the conversion distance storage means 22 based on the converted horizontal coordinates h ″ and vertical coordinates v ″ input from the interpolation means 20, and Information indicating an address for reading d ″ from the conversion distance storage unit 22 is generated, and further, information indicating an address for writing a pixel value of an image input from the outside to the parallax image storage unit 24 described later is generated. Is. The signal generated here is output to the conversion distance storage unit 22 and the parallax image storage unit 24. The address calculation means 23 can generate a signal indicating an access address in the same manner as the address calculation means 12.

視差画像記憶手段24は、外部から入力された画像を記憶するためのメモリである。この視差画像記憶手段24は、少なくとも書き込みに関してはランダムアクセスが可能なものでなければならない。なお、読み出しに関してはランダムアクセス及びシリアルアクセスのいずれでもよい。ここで、視差画像記憶手段24は、比較手段21から書き込み許可の指令が入力された場合に、アドレス演算手段23から入力される信号によって示されるアドレスに、入力される画像の各々の画素の画素値を記憶する。これによって、視差画像記憶手段24には、入力された画像を仮想カメラからの画像に変換した視差画像が記憶される。そして、アドレス演算手段12から入力される信号によって示されるアドレスに記憶された画素値が、視差画像記憶手段24から順次読み出されて外部に出力されることで、視差画像が外部に出力される。   The parallax image storage unit 24 is a memory for storing an image input from the outside. This parallax image storage means 24 must be capable of random access at least for writing. For reading, either random access or serial access may be used. Here, the parallax image storage unit 24, when a write permission command is input from the comparison unit 21, the pixel of each pixel of the input image at the address indicated by the signal input from the address calculation unit 23 Store the value. Thereby, the parallax image storage unit 24 stores a parallax image obtained by converting the input image into an image from the virtual camera. The pixel value stored at the address indicated by the signal input from the address calculation unit 12 is sequentially read out from the parallax image storage unit 24 and output to the outside, so that the parallax image is output to the outside. .

なお、視差画像記憶手段24から情報が所定の順序によって読み出される際に、距離画像記憶手段15と同様に、異なる時点(フレーム、フィールドなどを単位とする)で記憶された画素値が読み出されることを防ぐアドレッシングを行うことが望ましい。そのために、視差画像記憶手段24は、例えば、2画面分のメモリ領域を有し、書き込み用のメモリ領域と読み出し用のメモリ領域とを交互に切り替えることを繰り返すことで、外部に出力される画像の乱れを防ぐことができる。この操作は、基底アドレスを2種類用意して、フレームごとにアドレス演算手段12及びアドレス演算手段23が交互に異なる基底アドレスを使用することで実現できる。   Note that when information is read out from the parallax image storage unit 24 in a predetermined order, pixel values stored at different time points (in units of frames, fields, etc.) are read out as in the distance image storage unit 15. It is desirable to perform addressing to prevent this. For this purpose, the parallax image storage means 24 has, for example, a memory area for two screens, and an image output to the outside by repeatedly switching between a memory area for writing and a memory area for reading. Can be prevented. This operation can be realized by preparing two types of base addresses and using different base addresses alternately by the address calculation means 12 and the address calculation means 23 for each frame.

以上のように視差生成装置1を構成することで、視差生成装置1は、入力された画像を任意の視点からの画像(視差画像)に変換して出力することができる。更に、視差生成装置1は、入力された画像の複数の画素の座標が、視差画像における同一の画素の座標に変換された場合には、仮想カメラからの距離d”が小さい画素の画素値を視差画像記憶手段24に記憶する。そのため、視点から見てある被写体がそれより手前にある他の被写体の陰に隠れてしまう場合に、手前にある被写体のみを表示した視差画像を生成することができる。   By configuring the parallax generation device 1 as described above, the parallax generation device 1 can convert an input image into an image (parallax image) from an arbitrary viewpoint and output it. Further, when the coordinates of a plurality of pixels of the input image are converted into the coordinates of the same pixel in the parallax image, the parallax generation device 1 calculates the pixel value of the pixel having a small distance d ″ from the virtual camera. This is stored in the parallax image storage unit 24. Therefore, when a subject viewed from the viewpoint is hidden behind another subject in front of it, a parallax image in which only the subject in front is displayed can be generated. it can.

なお、視差生成装置1は、コンピュータにおいて各手段を各機能プログラムとして実現することも可能であり、各機能プログラムを結合して、視差画像生成プログラムとして動作させることも可能である。   In addition, the parallax generation device 1 can also realize each unit as each function program in a computer, and can also operate each unit as a parallax image generation program by combining the function programs.

[視差生成装置の動作]
次に図4を参照(適宜図1参照)して、本発明における視差生成装置1の動作について説明する。図4は、本発明における視差生成装置の動作を示したフローチャートである。なお、ここでは、視差生成装置1が視差画像を生成して視差画像記憶手段24に記憶する動作について説明する。
[Operation of parallax generator]
Next, the operation of the parallax generation device 1 according to the present invention will be described with reference to FIG. 4 (see FIG. 1 as appropriate). FIG. 4 is a flowchart showing the operation of the parallax generation device according to the present invention. Here, an operation in which the parallax generation device 1 generates a parallax image and stores the parallax image in the parallax image storage unit 24 will be described.

まず、視差生成装置1は、図示しない入力手段によって、ある画素の画素値を入力するとともに、当該画素に対応する距離情報を入力する(ステップS11)。そして、視差生成装置1は、カウンタ11によって、外部から入力された画像の同期信号に基づいて、ステップS11において入力された画素値に対応する画素の座標h,vを算出する(ステップS12)。   First, the parallax generation device 1 inputs a pixel value of a certain pixel by an input unit (not shown) and inputs distance information corresponding to the pixel (step S11). Then, the parallax generation device 1 calculates the coordinates h and v of the pixel corresponding to the pixel value input in step S11 based on the synchronization signal of the image input from the outside by the counter 11 (step S12).

そして、視差生成装置1は、幾何変換手段17によって、座標データ記憶手段16に記憶された座標データを参照して、ステップS12において算出された画素の座標h,vを、当該画像を撮影したカメラ(実カメラ)に対して変位量pによって示される位置及び姿勢の仮想カメラからの画像における画素の座標h’,v’に変換するとともに、距離変換手段19によって、距離データ記憶手段18に記憶された距離データを参照して、ステップS11において入力された距離情報によって示される距離dを、仮想カメラから当該画素に対応する被写体までの距離d’に変換する(ステップS13)。また、視差生成装置1は、補間手段20によって、ステップS13において変換された座標h’,v’及び距離d’について補間処理を行う(ステップS14)。   Then, the parallax generation device 1 refers to the coordinate data stored in the coordinate data storage unit 16 by the geometric conversion unit 17 and uses the coordinates h and v of the pixel calculated in step S12 to capture the image. The coordinates are converted into pixel coordinates h ′ and v ′ in the image from the virtual camera at the position and orientation indicated by the displacement amount p with respect to the (real camera) and stored in the distance data storage means 18 by the distance conversion means 19. Referring to the distance data, the distance d indicated by the distance information input in step S11 is converted into a distance d ′ from the virtual camera to the subject corresponding to the pixel (step S13). Further, the parallax generation device 1 performs an interpolation process on the coordinates h ′, v ′ and the distance d ′ converted in step S13 by the interpolation unit 20 (step S14).

そして、視差生成装置1は、比較手段21によって、同一の画素に対して変換距離記憶手段22に距離d”が記憶されている場合に、ステップS14において補間処理によって算出された距離d”が、記憶された距離d”より小さい(又は、大きくない)かを判断する(ステップS15)。そして、記憶された距離d”より小さくない(又は、大きい)場合は(ステップS15でNo)には、ステップS11に戻って、次の画素について画素値と距離情報を入力する動作以降の動作を行う。一方、記憶された距離d”より小さい(又は、大きくない)場合は(ステップS15でYes)には、視差生成装置1は、ステップS14において算出された座標h”,v”に基づいてアドレス演算手段23によって算出された当該座標h”,v”に対応するアドレスに対して、視差画像記憶手段24にはステップS11において入力された画素値を、変換距離記憶手段22にはステップS14において算出された距離d”を記憶し(ステップS16)、ステップS11に戻って、次の画素について画素値と距離情報を入力する動作以降の動作を行う。   Then, when the distance d ″ is stored in the conversion distance storage unit 22 for the same pixel by the comparison unit 21, the parallax generation device 1 determines that the distance d ″ calculated by the interpolation process in step S14 is It is determined whether it is smaller (or not larger) than the stored distance d ″ (step S15). If it is not smaller (or larger) than the stored distance d ″ (No in step S15), Returning to step S11, the operation after the operation of inputting the pixel value and distance information for the next pixel is performed. On the other hand, when the distance d ″ is smaller than (or not larger than) the stored distance d ″ (Yes in Step S15), the parallax generation device 1 performs the address calculation based on the coordinates h ″, v ″ calculated in Step S14. For the address corresponding to the coordinates h ″ and v ″ calculated by the means 23, the pixel value input in step S11 is calculated in the parallax image storage means 24 and the conversion distance storage means 22 is calculated in step S14. The distance d ″ is stored (step S16), and the process returns to step S11 to perform the operation after the operation of inputting the pixel value and the distance information for the next pixel.

以上の動作によって、視差生成装置1は、画素ごとに座標h,vと距離dの変換を行い、視差画像を生成して視差画像記憶手段24に記憶することができる。なお、視差画像記憶手段24に記憶された視差画像は、アドレス演算手段12によって算出されたアドレスに基づいて、例えば、視差画像記憶手段24が、各々書き込み用及び読み出し用の1フレーム分のメモリ領域を切り替える場合には1フレーム遅れで、1フィールド分のメモリ領域を切り替える場合には1フィールド遅れで順次外部に出力される。   Through the above operation, the parallax generation device 1 can convert the coordinates h and v and the distance d for each pixel, generate a parallax image, and store the parallax image in the parallax image storage unit 24. Note that the parallax image stored in the parallax image storage unit 24 is based on the address calculated by the address calculation unit 12, for example, the parallax image storage unit 24 has a memory area for one frame for writing and reading, respectively. When switching the memory area, it is delayed by one frame, and when switching the memory area for one field, it is sequentially output to the outside with a delay of one field.

本発明における視差生成装置の構成を示したブロック図である。It is the block diagram which showed the structure of the parallax generator in this invention. 本発明における視差生成装置の座標データ記憶手段に記憶される座標データの算出方法を説明するための説明図である。It is explanatory drawing for demonstrating the calculation method of the coordinate data memorize | stored in the coordinate data memory | storage means of the parallax generator in this invention. 本発明における視差生成装置の補間手段が、3点の近接する画素の水平座標、垂直座標及び距離情報に対して行う補間処理を説明するための説明図である。It is explanatory drawing for demonstrating the interpolation process which the interpolation means of the parallax production | generation apparatus in this invention performs with respect to the horizontal coordinate of the 3 adjacent pixels, the vertical coordinate, and distance information. 本発明における視差生成装置の動作を示したフローチャートである。It is the flowchart which showed the operation | movement of the parallax generator in this invention.

符号の説明Explanation of symbols

1 視差生成装置
11 カウンタ
12 アドレス演算手段
13 カウンタ
14 アドレス演算手段
15 距離画像記憶手段
16 座標データ記憶手段
17 幾何変換手段(座標変換手段)
18 距離データ記憶手段
19 距離変換手段(距離変換手段)
20 補間手段
21 比較手段
22 変換距離記憶手段
23 アドレス演算手段(画素対応付け手段)
24 視差画像記憶手段
DESCRIPTION OF SYMBOLS 1 Parallax production | generation apparatus 11 Counter 12 Address calculating means 13 Counter 14 Address calculating means 15 Distance image storage means 16 Coordinate data storage means 17 Geometric conversion means (coordinate conversion means)
18 Distance data storage means 19 Distance conversion means (distance conversion means)
20 Interpolating means 21 Comparison means 22 Conversion distance storage means 23 Address calculation means (pixel association means)
24 Parallax image storage means

Claims (2)

被写体の画像である入力画像と、前記入力画像を撮影したカメラから前記入力画像の各々の画素に対応する前記被写体までの距離を示す距離情報とを入力し、任意の視点において仮想的に設置された仮想カメラからの画像である視差画像を生成する視差生成装置であって、
前記カメラの位置に対する前記視点の相対位置(ξ,η,ζ)、前記カメラに対する前記仮想カメラの相対的な姿勢(α,δ,φ)、前記カメラの焦点距離f 及び前記仮想カメラの焦点距離fを含む変位量情報と、前記入力画像内における、対象となる画素の座標h,vと、当該画素に対応する被写体から前記カメラまでの距離とが所定値となるときの前記画素に対応する前記視差画像における画素の変換後の座標h’,v’を、下記の式(9)で表されるように、前記入力画像における前記対象となる画素の座標h,v、前記距離及び前記変位量情報に対応付けた座標データを記憶する座標データ記憶手段と、
記変位量情報と、前記距離情報とに基づいて、前記座標データ記憶手段に記憶された座標データを読み出して、補間演算によって、前記入力画像の各々の前記画素に対応する前記視差画像における画素の変換後の座標を算出する座標変換手段と、
前記入力画像の各々の画素の画素値を、前記座標変換手段によって算出された座標の画素の画素値として記憶する視差画像記憶手段と、
前記入力画像内における前記対象となる画素の座標、当該画素に対応する被写体から前記カメラまでの距離及び前記変位量情報が所定値となるときの当該画素に対応する前記被写体から前記視点までの距離を、前記座標、前記カメラまでの距離及び前記変位量情報に対応付けた距離データを記憶する距離データ記憶手段と、
前記変位量情報と、前記距離情報とに基づいて、前記距離データ記憶手段に記憶された距離データを読み出して、補間演算によって、前記入力画像の各々の前記画素に対応する前記被写体の前記視点までの距離を算出する距離変換手段と、
この距離変換手段によって算出された距離を、前記座標変換手段によって算出された座標に対応付けて記憶する変換距離記憶手段と、
前記距離変換手段によって算出された距離が、この距離に対応する画素と同一の画素に対応付けられて前記変換距離記憶手段に記憶された距離に比べて小さい場合に、前記変換距離記憶手段に対して前記距離変換手段によって算出された距離を書き込む許可を行うとともに、前記視差画像記憶手段に前記入力画像の当該画素の画素値を書き込む許可を行う比較手段と、
を備えることを特徴とする視差生成装置。
Figure 0004733448
Figure 0004733448
An input image that is an image of a subject and distance information that indicates the distance from the camera that captured the input image to the subject corresponding to each pixel of the input image are input, and are virtually installed at an arbitrary viewpoint. A parallax generation device that generates a parallax image that is an image from a virtual camera,
The relative position (ξ, η, ζ) of the viewpoint with respect to the camera position, the relative orientation (α, δ, φ) of the virtual camera with respect to the camera, the focal length f 0 of the camera, and the focal point of the virtual camera The displacement amount information including the distance f, the coordinates h and v of the target pixel in the input image, and the distance d from the subject corresponding to the pixel to the camera are predetermined values. The coordinates h ′, v ′ after pixel conversion in the corresponding parallax image are expressed by the following equation (9), the coordinates h, v of the target pixel in the input image, and the distance d: Coordinate data storage means for storing coordinate data associated with the displacement amount information;
Before Symbol displacement amount information, based on said distance information, reads the coordinate coordinate data stored in the data storing means, pixels in the parallax image by interpolation, corresponding to the pixels of each of the input image Coordinate conversion means for calculating the converted coordinates of
Parallax image storage means for storing a pixel value of each pixel of the input image as a pixel value of a pixel of coordinates calculated by the coordinate conversion means;
The coordinates of the target pixel in the input image, the distance from the subject corresponding to the pixel to the camera, and the distance from the subject corresponding to the pixel to the viewpoint when the displacement information is a predetermined value Distance data storage means for storing distance data associated with the coordinates, the distance to the camera, and the displacement amount information;
Based on the displacement amount information and the distance information, the distance data stored in the distance data storage means is read out, and by interpolation calculation, up to the viewpoint of the subject corresponding to each pixel of the input image Distance conversion means for calculating the distance of
Conversion distance storage means for storing the distance calculated by the distance conversion means in association with the coordinates calculated by the coordinate conversion means;
When the distance calculated by the distance conversion means is smaller than the distance stored in the conversion distance storage means associated with the same pixel as the pixel corresponding to this distance, the conversion distance storage means Comparing means for permitting writing of the distance calculated by the distance converting means and for permitting writing of the pixel value of the pixel of the input image in the parallax image storage means,
A parallax generating device comprising:
Figure 0004733448
Figure 0004733448
被写体の画像である入力画像と、前記入力画像を撮影したカメラから前記入力画像の各々の画素に対応する前記被写体までの距離を示す距離情報とを入力し、任意の視点において仮想的に設置された仮想カメラからの画像である視差画像を生成するために
前記カメラの位置に対する前記視点の相対位置(ξ,η,ζ)、前記カメラに対する前記仮想カメラの相対的な姿勢(α,δ,φ)、前記カメラの焦点距離f 及び前記仮想カメラの焦点距離fを含む変位量情報と、前記入力画像内における、対象となる画素の座標h,vと、当該画素に対応する被写体から前記カメラまでの距離とが所定値となるときの前記画素に対応する前記視差画像における画素の変換後の座標h’,v’を、下記の式(9)で表されるように、前記入力画像における前記対象となる画素の座標h,v、前記距離及び前記変位量情報に対応付けた座標データを記憶する座標データ記憶手段と
前記入力画像内における前記対象となる画素の座標、当該画素に対応する被写体から前記カメラまでの距離及び前記変位量情報が所定値となるときの当該画素に対応する前記被写体から前記視点までの距離を、前記座標、前記カメラまでの距離及び前記変位量情報に対応付けた距離データを記憶する距離データ記憶手段と、
前記入力画像の各々の前記画素に対応する前記被写体の前記視点までの距離を、前記入力画像の各々の前記画素に対応する前記視差画像における画素の変換後の座標に対応付けて記憶する変換距離記憶手段と、
前記入力画像の各々の画素の画素値を記憶する視差画像記憶手段とを備えるコンピュータを、
記変位量情報と、前記距離情報とに基づいて、前記座標データ記憶手段に記憶された座標データを読み出して、補間演算によって、前記入力画像の各々の前記画素に対応する前記視差画像における画素の変換後の座標を算出する座標変換手段、
前記変位量情報と、前記距離情報とに基づいて、前記距離データ記憶手段に記憶された距離データを読み出して、補間演算によって、前記入力画像の各々の前記画素に対応する前記被写体の前記視点までの距離を算出する距離変換手段、
前記距離変換手段によって算出された距離が、この距離に対応する画素と同一の画素に対応付けられて前記変換距離記憶手段に記憶された距離に比べて小さい場合に、前記変換距離記憶手段に対して前記距離変換手段によって算出された距離を書き込む許可を行うとともに、前記視差画像記憶手段に前記入力画像の当該画素の画素値を書き込む許可を行う比較手段、
として機能させることを特徴とする視差生成プログラム。
Figure 0004733448
Figure 0004733448
An input image that is an image of a subject and distance information that indicates the distance from the camera that captured the input image to the subject corresponding to each pixel of the input image are input, and are virtually installed at an arbitrary viewpoint. to generate the parallax image is an image from the virtual camera,
The relative position (ξ, η, ζ) of the viewpoint with respect to the camera position, the relative orientation (α, δ, φ) of the virtual camera with respect to the camera, the focal length f 0 of the camera, and the focal point of the virtual camera The displacement amount information including the distance f, the coordinates h and v of the target pixel in the input image, and the distance d from the subject corresponding to the pixel to the camera are predetermined values. The coordinates h ′, v ′ after pixel conversion in the corresponding parallax image are expressed by the following equation (9), the coordinates h, v of the target pixel in the input image, and the distance d: Coordinate data storage means for storing coordinate data associated with the displacement amount information ;
The coordinates of the target pixel in the input image, the distance from the subject corresponding to the pixel to the camera, and the distance from the subject corresponding to the pixel to the viewpoint when the displacement information is a predetermined value Distance data storage means for storing distance data associated with the coordinates, the distance to the camera, and the displacement amount information;
A conversion distance for storing a distance to the viewpoint of the subject corresponding to each pixel of the input image in association with coordinates after conversion of the pixel in the parallax image corresponding to the pixel of the input image. Storage means;
A computer comprising parallax image storage means for storing pixel values of each pixel of the input image;
Before Symbol displacement amount information, based on said distance information, reads the coordinate coordinate data stored in the data storing means, pixels in the parallax image by interpolation, corresponding to the pixels of each of the input image Coordinate conversion means for calculating coordinates after conversion of
Based on the displacement amount information and the distance information, the distance data stored in the distance data storage means is read out, and by interpolation calculation, up to the viewpoint of the subject corresponding to each pixel of the input image Distance conversion means for calculating the distance of
When the distance calculated by the distance conversion means is smaller than the distance stored in the conversion distance storage means associated with the same pixel as the pixel corresponding to this distance, the conversion distance storage means Comparing means for permitting writing of the distance calculated by the distance converting means and for permitting writing of the pixel value of the pixel of the input image in the parallax image storage means,
A parallax generation program characterized by being caused to function as.
Figure 0004733448
Figure 0004733448
JP2005202298A 2005-07-11 2005-07-11 Parallax generation device and parallax generation program Expired - Fee Related JP4733448B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005202298A JP4733448B2 (en) 2005-07-11 2005-07-11 Parallax generation device and parallax generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005202298A JP4733448B2 (en) 2005-07-11 2005-07-11 Parallax generation device and parallax generation program

Publications (2)

Publication Number Publication Date
JP2007018459A JP2007018459A (en) 2007-01-25
JP4733448B2 true JP4733448B2 (en) 2011-07-27

Family

ID=37755551

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005202298A Expired - Fee Related JP4733448B2 (en) 2005-07-11 2005-07-11 Parallax generation device and parallax generation program

Country Status (1)

Country Link
JP (1) JP4733448B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000322576A (en) * 1999-05-11 2000-11-24 Toshiba Corp Method for preparing three-dimensional image data and method for preparing optional viewpoint image using three-dimensional image data
JP2001256482A (en) * 2000-03-08 2001-09-21 Fuji Xerox Co Ltd Device and method for generating parallax image
JP2005050033A (en) * 2003-07-31 2005-02-24 Canon Inc Image processing method and image generating device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000322576A (en) * 1999-05-11 2000-11-24 Toshiba Corp Method for preparing three-dimensional image data and method for preparing optional viewpoint image using three-dimensional image data
JP2001256482A (en) * 2000-03-08 2001-09-21 Fuji Xerox Co Ltd Device and method for generating parallax image
JP2005050033A (en) * 2003-07-31 2005-02-24 Canon Inc Image processing method and image generating device

Also Published As

Publication number Publication date
JP2007018459A (en) 2007-01-25

Similar Documents

Publication Publication Date Title
JP4942221B2 (en) High resolution virtual focal plane image generation method
US8855441B2 (en) Method and apparatus for transforming a non-linear lens-distorted image
US9412151B2 (en) Image processing apparatus and image processing method
JP6273163B2 (en) Stereoscopic panorama
JP6299124B2 (en) Projection system, image processing apparatus, projection method, and program
KR100730406B1 (en) Three-dimensional display apparatus using intermediate elemental images
JP5751986B2 (en) Image generation device
KR100914211B1 (en) Distorted image correction apparatus and method
JP5984493B2 (en) Image processing apparatus, image processing method, imaging apparatus, and program
JPWO2007018008A1 (en) Image composition apparatus and image composition method
JP2013009274A (en) Image processing device, image processing method, and program
RU2690757C1 (en) System for synthesis of intermediate types of light field and method of its operation
JP5704984B2 (en) Imaging device
JP4871820B2 (en) Video display system and parameter generation method for the system
JP5370606B2 (en) Imaging apparatus, image display method, and program
JP4649171B2 (en) Magnification Chromatic Aberration Correction Device, Magnification Chromatic Aberration Correction Method, and Magnification Chromatic Aberration Correction Program
WO2019008693A1 (en) Image processing device, imaging device, image processing method, image processing program and storage medium
JP5566199B2 (en) Image processing apparatus, control method therefor, and program
KR20210128203A (en) System and method for providing volumetric 3D video
JP5747679B2 (en) Presentation method of 3D image
JP4733448B2 (en) Parallax generation device and parallax generation program
JP2012150614A (en) Free viewpoint image generation device
JP4925112B2 (en) Free viewpoint image generation method
JPWO2015083502A1 (en) Image processing apparatus, method, and program
JP7514125B2 (en) Image processing device and program thereof

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20061227

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080122

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100907

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100914

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101108

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110125

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110310

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110329

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110422

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

Free format text: PAYMENT UNTIL: 20140428

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees