JP5782761B2 - Parallax image generation device, parallax image generation method, program, and storage medium - Google Patents

Parallax image generation device, parallax image generation method, program, and storage medium Download PDF

Info

Publication number
JP5782761B2
JP5782761B2 JP2011055878A JP2011055878A JP5782761B2 JP 5782761 B2 JP5782761 B2 JP 5782761B2 JP 2011055878 A JP2011055878 A JP 2011055878A JP 2011055878 A JP2011055878 A JP 2011055878A JP 5782761 B2 JP5782761 B2 JP 5782761B2
Authority
JP
Japan
Prior art keywords
value
hidden surface
image
depth
reference position
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.)
Active
Application number
JP2011055878A
Other languages
Japanese (ja)
Other versions
JP2012195626A (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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2011055878A priority Critical patent/JP5782761B2/en
Publication of JP2012195626A publication Critical patent/JP2012195626A/en
Application granted granted Critical
Publication of JP5782761B2 publication Critical patent/JP5782761B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Description

本発明は、立体視を実現するための視差画像を生成する視差画像生成装置等に関し、更に詳しくは、2次元/3次元変換において生じる隠れ面を補正する視差画像生成装置等に関する。   The present invention relates to a parallax image generation device that generates a parallax image for realizing stereoscopic vision, and more particularly to a parallax image generation device that corrects a hidden surface generated in two-dimensional / three-dimensional conversion.

従来、3次元映像表示システムでは、大別して、2視差方式のものと、3以上の視差を持つ多視差方式のものがある。いずれの方式も、必要な視点数からシーンを見た映像を準備する必要がある。   Conventional three-dimensional video display systems are roughly classified into a two-parallax system and a multi-parallax system having three or more parallaxes. In either method, it is necessary to prepare a video in which the scene is viewed from the required number of viewpoints.

最も直接的な映像の制作方法としては、必要な視差数分のカメラを用意し、同一シーンを所定の間隔に配置された複数のカメラで撮影する方法が考えられる。最近では2視差を直接撮影できるカメラが市販されているが、多視差を直接撮影できるカメラは一般的でない。   As the most direct video production method, there can be considered a method in which cameras for the required number of parallaxes are prepared and the same scene is shot with a plurality of cameras arranged at predetermined intervals. Recently, cameras that can directly shoot two parallaxes are commercially available, but cameras that can directly shoot multiple parallaxes are not common.

また、3次元CG(Computer Graphics)画像を作成し、複数のカメラ位置を設定してレンダリングする方法も考えられる。3次元CG画像には奥行き情報が含まれており、3次元画像から多視差方式に対応した視差画像を作成することは可能である。しかし、カメラ位置の数が多い場合、レンダリング回数が多くなり、時間とコストがかかるという問題がある。
さらに、ほとんどの映像はCG画像ではなく実写であり、実写から3次元映像を作成することが求められている。
A method of creating a three-dimensional CG (Computer Graphics) image and setting a plurality of camera positions for rendering is also conceivable. The three-dimensional CG image includes depth information, and a parallax image corresponding to the multi-parallax method can be created from the three-dimensional image. However, when the number of camera positions is large, there is a problem that the number of renderings increases, which takes time and cost.
Furthermore, most videos are not CG images but are real photographs, and it is required to create a three-dimensional video from the real photographs.

実写映像による多視差映像を制作する為に、平面映像を基にして多視差映像に変換する手法(いわゆる2次元/3次元変換の手法)は、いくつか存在する(特許文献1、特許文献2)。
特許文献1は、平面映像を近景と遠景に分離し、近景領域だけを所定の距離だけシフトするとともに拡大して視差映像を生成する2次元/3次元変換手法について開示している。
一方、本出願人は、特許文献2において、2次元画像、及び奥行き情報を持つ画像(以下、「デプス画像」という。)を入力とし、デプス画像と仮想カメラ位置との関係から視差を求め視差映像を生成する手法を提案している。
There are several methods (so-called two-dimensional / three-dimensional conversion methods) for converting a multi-parallax image based on a flat image to produce a multi-parallax image based on a live-action image (Patent Document 1, Patent Document 2). ).
Patent Document 1 discloses a two-dimensional / three-dimensional conversion method in which a planar image is separated into a near view and a distant view, and only the near view region is shifted by a predetermined distance and enlarged to generate a parallax image.
On the other hand, the present applicant receives a parallax from a relationship between a depth image and a virtual camera position by inputting a two-dimensional image and an image having depth information (hereinafter referred to as “depth image”) in Patent Document 2. A method for generating video is proposed.

特開2010−233391号公報JP 2010-233391 A 特願2010−176864号公報Japanese Patent Application No. 2010-176864

しかしながら、特許文献1に記載の手法は、画面全体を近景および遠景の2段階の奥行きに分離するものであり、2段階の奥行きだけでは、生成された映像から受ける奥行きの印象が乏しいという問題がある。また、近景の内部は視差を持たないため、更に奥行きの印象が乏しいという問題がある。
また、特許文献1に記載の手法は、近景と遠景に分離してシフトすると映像の空白部が生じる為、近景をシフトするとともに拡大することにより空白部の出現を回避している。しかしながら、元々手前にある被写体は大きく撮影されている為、更に拡大することにより、画面のシーンに矛盾が生じ、違和感が大きいという問題がある。
However, the method described in Patent Document 1 separates the entire screen into two levels of depths of foreground and distant views, and there is a problem that the depth impression received from the generated image is poor with only the two levels of depth. is there. Further, since the inside of the foreground has no parallax, there is a problem that the impression of depth is further poor.
In addition, the technique described in Patent Document 1 avoids the appearance of a blank portion by shifting and enlarging the foreground because a blank portion of the video is generated when the foreground and the distant view are separated and shifted. However, since the subject in the foreground is originally photographed large, there is a problem that a further enlargement causes a contradiction in the scene on the screen and a great sense of discomfort.

一方、特許文献2に記載の手法は、デプス画像とカメラ位置の相対関係から、画像内の被写体ごとではなく画素ごとに視差によるシフト量を決めるので、全体の奥行きの印象が豊かになるという利点がある。
しかし、隣接する2画素間の奥行き量の情報だけでは、2画素が同一の被写体間に属するのか、別の被写体に属するのかが特定できないので、2画素が別の被写体に属する場合の隠れ面に対処できないという問題がある。
On the other hand, the technique described in Patent Document 2 has the advantage that the overall depth impression is enriched because the shift amount due to parallax is determined for each pixel rather than for each subject in the image from the relative relationship between the depth image and the camera position. There is.
However, since it is not possible to specify whether two pixels belong to the same subject or another subject only by information on the depth amount between two adjacent pixels, it is a hidden surface when two pixels belong to another subject. There is a problem that cannot be dealt with.

ここで、図15を参照しながら、「隠れ面」について説明する。「隠れ面」とは、元の平面画像ではその位置の画素情報が欠落している領域であり、視差によって生じるものである。
図15(a)は、元の平面画像を示している。元の平面画像に記録されたシーンは、背景100、円形の物体である手前物体101、長方形の物体である奥物体102によって構成されている。
図15(b)は、図15(a)におけるA方向から覗き込んだ様子を示している。図15(b)では、手前物体101と背景100との間に隠れ面103a(黒色の領域)が生じている。
また、図15(c)は、図15(a)におけるB方向から覗き込んだ様子を示している。図15(c)では、手前物体101と奥物体102との間に隠れ面103b(黒色の領域)が生じている。
このような隠れ面に対しては、何も対処をしないと、本来なら後ろの被写体が適切に補われて表示されるべき領域に、手前の被写体または後ろの被写体の境界部の画素が表示されてしまい、不自然な映像になってしまう場合がある。
Here, the “hidden surface” will be described with reference to FIG. The “hidden surface” is an area where pixel information at the position is missing in the original planar image, and is caused by parallax.
FIG. 15A shows the original planar image. The scene recorded in the original planar image is composed of a background 100, a front object 101 that is a circular object, and a back object 102 that is a rectangular object.
FIG. 15B shows a state of looking into from the A direction in FIG. In FIG. 15B, a hidden surface 103 a (black region) is generated between the near object 101 and the background 100.
FIG. 15 (c) shows a state of looking into from the B direction in FIG. 15 (a). In FIG. 15C, a hidden surface 103b (black region) is generated between the near object 101 and the deep object 102.
If no action is taken against such a hidden surface, pixels at the border of the front subject or the back subject are displayed in the area where the back subject should be properly compensated. May result in an unnatural image.

本発明は、前述した問題点に鑑みてなされたもので、その目的とすることは、隠れ面が違和感なく補正された視差画像を生成することができる視差画像生成装置等を提供することである。   The present invention has been made in view of the above-described problems, and an object of the present invention is to provide a parallax image generation device and the like that can generate a parallax image in which a hidden surface is corrected without a sense of incongruity. .

前述した目的を達成するために第1の発明は、立体視を実現するための視差画像を生成する視差画像生成装置であって、所望の2次元画像、前記2次元画像に係るカメラから被写体までの奥行き値を画素値に置き換えた画像であるデプス画像、及び、前記2次元画像のシーンを構成する被写体を識別するラベル値を画素値に置き換えた画像であるラベル画像を入力する画像入力手段と、カメラ数、カメラ間隔、及び、カメラからスクリーン面までの奥行き値から成るパラメータを入力するパラメータ入力手段と、スクリーン面のサンプリング点と、前記パラメータに基づいて設定されるカメラ位置と、を通る視線直線を算出し、前記奥行き値同士の区間の中で前記視線直線が通る区間である通過区間のいずれか1つを採用区間とし、前記採用区間における第1方向側の奥行き値である第1奥行き値、及び、前記第1方向とは異なる第2方向側の奥行き値である第2奥行き値のうち、より奥を示す方の位置を参照位置とする参照位置特定手段と、前記第1奥行き値及び前記第2奥行き値の位置にそれぞれ対応する前記ラベル画像の第1ラベル値及び第2ラベル値が異なる場合に、前記参照位置が隠れ面であると判定する隠れ面判定手段と、前記隠れ面判定手段によって前記参照位置が隠れ面でないと判定された場合には、前記2次元画像における前記参照位置の画素値を前記サンプリング点の画素値とし、前記隠れ面判定手段によって前記参照位置が隠れ面であると判定された場合には、前記隠れ面判定手段による判定結果を、前記第1奥行き値及び前記第2奥行き値のうち、より奥側を示す方向である第1方向側又は第2方向側に参照して、隠れ面境界位置を特定し、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより、前記サンプリング点の画素値を補償する画素値である補償画素値を割り当てる画素値割り当て手段と、を具備することを特徴とする視差画像生成装置である。
第1の発明によって、隠れ面が違和感なく補正された視差画像を生成することができる。また、これによって、多くの場合に合理的と考えられる補償画素値を割り当てることができる。
In order to achieve the above-described object, a first invention is a parallax image generation device that generates a parallax image for realizing stereoscopic vision, and includes a desired two-dimensional image, from a camera related to the two-dimensional image to a subject. An image input means for inputting a depth image that is an image in which the depth value is replaced with a pixel value, and a label image that is an image in which a label value that identifies a subject constituting the scene of the two-dimensional image is replaced with a pixel value , number of cameras, camera separation, and the parameter input means for inputting a parameter consisting of the depth values from the camera to the screen surface, and the sampling point of the screen surface, the camera position is set based on the previous Kipa parameter, the A line of sight line passing through is calculated, and any one of the passing sections, which are sections through which the line of sight line passes, among the sections of the depth values is adopted as the section adopted. Among the first depth value that is the depth value on the first direction side and the second depth value that is the depth value on the second direction side that is different from the first direction, refer to the position that indicates the back side. When the first label value and the second label value of the label image corresponding to the position of the first depth value and the second depth value are different from the reference position specifying unit as the position, the reference position is a hidden surface. When the reference position is determined not to be a hidden surface by the hidden surface determination means that determines that the pixel is a hidden surface, the pixel value of the reference position in the two-dimensional image is the pixel value of the sampling point. And when the reference position is determined to be a hidden surface by the hidden surface determination means, the determination result by the hidden surface determination means is determined as a deeper one of the first depth value and the second depth value. The pixel value of the sampling point is determined by referring to the first direction side or the second direction side which is a direction indicating the hidden surface boundary position, and by performing a folded copy of the pixel value with the hidden surface boundary position as the folded position. And a pixel value assigning unit for assigning a compensation pixel value which is a pixel value for compensating for the parallax image generation apparatus.
According to the first invention, it is possible to generate a parallax image in which the hidden surface is corrected without a sense of incongruity. This also makes it possible to assign compensation pixel values that are considered reasonable in many cases.

また、第1の発明における前記画素値割り当て手段における前記補償処理では、例えば、折り返しコピーされる画素位置のラベル値が、前記参照位置に現れるべき被写体のラベル値と一致するか否かを判定し、一致する場合には、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより、前記補償画素値を割り当てて、一致しない場合には、前記参照位置に現れるべき被写体のラベル値と同一の一繋がりのサンプリング点群のなかで最も遠い点に係る参照位置の画素値を、前記補償画素値として割り当てる。In the compensation processing in the pixel value assigning means according to the first aspect of the invention, for example, it is determined whether or not the label value of the pixel position to be copied by copying matches the label value of the subject that should appear at the reference position. If they match, the compensation pixel value is assigned by folding copy of the pixel value with the hidden surface boundary position as the folding position, and if they do not match, it is the same as the label value of the subject that should appear at the reference position A pixel value at a reference position related to the farthest point in a group of sampling points is assigned as the compensation pixel value.
これによって、他の被写体の画素値を補償画素値として補償することがなくなり、どのような場合であっても、合理的と考えられる補償画素値を割り当てることが可能になる。Accordingly, the pixel value of another subject is not compensated as the compensation pixel value, and in any case, it is possible to assign a compensation pixel value that is considered to be reasonable.

第1の発明において、前記隠れ面判定手段は、前記参照位置が隠れ面である場合、更に、前記第1奥行き値が前記第2奥行き値よりも奥側の値を示す場合には、前記視線直線が前記第1方向から手前の被写体と奥の被写体との間を通ることによって前記第1方向から覗き込んだ第1方向隠れ面が生じていると判定し、又は、前記第2奥行き値が前記第1奥行き値よりも奥側の値を示す場合には、前記視線直線が前記第2方向から手前の被写体と奥の被写体との間を通ることによって前記第2方向から覗き込んだ第2方向隠れ面が生じていると判定し、前記画素値割り当て手段における前記補償処理では、前記第1方向隠れ面の場合には、前記隠れ面判定手段による判定結果を前記第1方向に参照していくことによって隠れ面境界位置を特定し、又は、前記第2方向隠れ面の場合には、前記隠れ面判定手段による判定結果を前記第2方向に参照していくことによって隠れ面境界位置を特定し、更に、前記隠れ面境界位置を基準として前記補償画素値を特定することが望ましい。
これによって、隠れ面が違和感なく補正された視差画像を生成することができる。
In the first invention, when the reference position is a hidden surface, and when the first depth value indicates a value on the back side with respect to the second depth value, the hidden surface determination unit is configured to perform the line of sight. It is determined that a first direction hidden surface viewed from the first direction is generated by passing a straight line between the subject in front and the subject in the back from the first direction, or the second depth value is In the case where a value on the back side from the first depth value is indicated, the second line viewed from the second direction by passing the line of sight between the subject in the foreground and the subject in the back from the second direction. It is determined that a direction hidden surface has occurred, and the compensation processing in the pixel value assigning unit refers to the determination result by the hidden surface determination unit in the first direction in the case of the first direction hidden surface. To identify the hidden surface boundary position Alternatively, in the case of the hidden surface in the second direction, the hidden surface boundary position is specified by referring to the determination result by the hidden surface determination means in the second direction, and the hidden surface boundary position is used as a reference. It is desirable to specify the compensation pixel value as follows.
Thereby, a parallax image in which the hidden surface is corrected without a sense of incongruity can be generated.

第2の発明は、立体視を実現するための視差画像を生成する視差画像生成方法であって、所望の2次元画像、前記2次元画像に係るカメラから被写体までの奥行き値を画素値に置き換えた画像であるデプス画像、及び、前記2次元画像のシーンを構成する被写体を識別するラベル値を画素値に置き換えた画像であるラベル画像を入力する画像入力ステップと、カメラ数、カメラ間隔、及び、カメラからスクリーン面までの奥行き値から成るパラメータを入力するパラメータ入力ステップと、スクリーン面のサンプリング点と、前記パラメータに基づいて設定されるカメラ位置と、を通る視線直線を算出し、前記奥行き値同士の区間の中で前記視線直線が通る区間である通過区間のいずれか1つを採用区間とし、前記採用区間における第1方向側の奥行き値である第1奥行き値、及び、前記第1方向とは異なる第2方向側の奥行き値である第2奥行き値のうち、より奥を示す方の位置を参照位置とする参照位置特定ステップと、前記第1奥行き値及び前記第2奥行き値の位置にそれぞれ対応する前記ラベル画像の第1ラベル値及び第2ラベル値が異なる場合に、前記参照位置が隠れ面であると判定する隠れ面判定ステップと、前記隠れ面判定ステップによって前記参照位置が隠れ面でないと判定された場合には、前記2次元画像における前記参照位置の画素値を前記サンプリング点の画素値とし、前記隠れ面判定ステップによって前記参照位置が隠れ面であると判定された場合には、前記隠れ面判定ステップによる判定結果を、前記第1奥行き値及び前記第2奥行き値のうち、より奥側を示す方向である第1方向側又は第2方向側に参照して、隠れ面境界位置を特定し、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより、前記サンプリング点の画素値を補償する画素値である補償画素値を割り当てる画素値割り当てステップと、を含むことを特徴とする視差画像生成方法である。
第2の発明によって、隠れ面が違和感なく補正された視差画像を生成することができる。
A second invention is a parallax image generation method for generating a parallax image for realizing stereoscopic vision, wherein a desired two-dimensional image and a depth value from a camera to a subject related to the two-dimensional image are replaced with a pixel value An image input step of inputting a depth image that is a captured image, and a label image that is an image obtained by replacing a label value that identifies a subject constituting the scene of the two-dimensional image with a pixel value, the number of cameras, a camera interval, and calculates a parameter input step for inputting a parameter consisting of the depth values from the camera to the screen surface, and the sampling point of the screen surface, the camera position is set based on the previous Kipa parameter, the sight line passing through the One of the passing sections that are the sections through which the line of sight passes among the sections of depth values is defined as the employed section, and the first direction in the employed section Of the first depth value, which is the depth value of the second depth value, and the second depth value, which is the depth value on the second direction side different from the first direction, is a reference position specifying the position that indicates the back side as the reference position Hiding and determining that the reference position is a hidden surface when the first label value and the second label value of the label image respectively corresponding to the position of the first depth value and the second depth value are different from each other When it is determined by the surface determination step and the hidden surface determination step that the reference position is not a hidden surface, the pixel value of the reference position in the two-dimensional image is set as the pixel value of the sampling point, and the hidden surface determination is performed. If it is determined in the step that the reference position is a hidden surface, the determination result in the hidden surface determination step is determined as a deeper one of the first depth value and the second depth value. The pixel value of the sampling point is determined by referring to the first direction side or the second direction side which is a direction indicating the hidden surface boundary position, and by performing a folded copy of the pixel value with the hidden surface boundary position as the folded position. And a pixel value assigning step for assigning a compensated pixel value that is a pixel value for compensating for a parallax image.
According to the second invention, it is possible to generate a parallax image in which the hidden surface is corrected without a sense of incongruity.

第3の発明は、コンピュータを、所望の2次元画像、前記2次元画像に係るカメラから被写体までの奥行き値を画素値に置き換えた画像であるデプス画像、及び、前記2次元画像のシーンを構成する被写体を識別するラベル値を画素値に置き換えた画像であるラベル画像を入力する画像入力手段と、カメラ数、カメラ間隔、及び、カメラからスクリーン面までの奥行き値から成るパラメータを入力するパラメータ入力手段と、スクリーン面のサンプリング点と、前記パラメータに基づいて設定されるカメラ位置と、を通る視線直線を算出し、前記奥行き値同士の区間の中で前記視線直線が通る区間である通過区間のいずれか1つを採用区間とし、前記採用区間における第1方向側の奥行き値である第1奥行き値、及び、前記第1方向とは異なる第2方向側の奥行き値である第2奥行き値のうち、より奥を示す方の位置を参照位置とする参照位置特定手段と、前記第1奥行き値及び前記第2奥行き値の位置にそれぞれ対応する前記ラベル画像の第1ラベル値及び第2ラベル値が異なる場合に、前記参照位置が隠れ面であると判定する隠れ面判定手段と、前記隠れ面判定手段によって前記参照位置が隠れ面でないと判定された場合には、前記2次元画像における前記参照位置の画素値を前記サンプリング点の画素値とし、前記隠れ面判定手段によって前記参照位置が隠れ面であると判定された場合には、前記隠れ面判定手段による判定結果を、前記第1奥行き値及び前記第2奥行き値のうち、より奥側を示す方向である第1方向側又は第2方向側に参照して、隠れ面境界位置を特定し、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより、前記サンプリング点の画素値を補償する画素値である補償画素値を割り当てる画素値割り当て手段と、して機能させるためのプログラムである。
第3の発明に係るプログラムをコンピュータにインストールすることで、第1の発明に係る視差画像生成装置を得ることができる。
According to a third aspect of the present invention, a computer forms a desired two-dimensional image, a depth image that is an image obtained by replacing a depth value from the camera related to the two-dimensional image to a subject with a pixel value, and a scene of the two-dimensional image An image input means for inputting a label image, which is an image obtained by replacing a label value for identifying a subject to be replaced with a pixel value, and a parameter input for inputting a parameter consisting of the number of cameras, a camera interval, and a depth value from the camera to the screen surface. It means, and the sampling point of the screen surface, before the camera position is set based on Kipa parameters, calculates the line of sight line passing through a passage which is the line of sight straight line passing through the section in the depth values between the interval Any one of the sections is an adopted section, and is different from the first depth value, which is the depth value on the first direction side in the adopted section, and the first direction. Of the second depth values that are the depth values on the second direction side, corresponding to the position of the reference position specifying means that uses the position indicating the deeper as the reference position, and the positions of the first depth value and the second depth value, respectively. When the first label value and the second label value of the label image are different, the reference position is not a hidden surface by the hidden surface determination means that determines that the reference position is a hidden surface, and the hidden surface determination means. If it is determined, the pixel value of the reference position in the two-dimensional image is set as the pixel value of the sampling point, and when the reference position is determined to be a hidden surface by the hidden surface determination unit, The determination result by the hidden surface determination means is referred to the first direction side or the second direction side which is the direction indicating the far side of the first depth value and the second depth value, and the hidden surface boundary position is determined. Identify, This is a program for functioning as pixel value assigning means for assigning a compensation pixel value that is a pixel value for compensating the pixel value of the sampling point by folding copy of the pixel value with the hidden surface boundary position as the folding position. .
By installing the program according to the third invention in the computer, the parallax image generating device according to the first invention can be obtained.

第4の発明は、第3の発明に係るプログラムを記憶したコンピュータ読み取り可能な記憶媒体である。   A fourth invention is a computer-readable storage medium storing a program according to the third invention.

本発明により、隠れ面が違和感なく補正された視差画像を生成することができる視差画像生成装置等を提供することができる。   According to the present invention, it is possible to provide a parallax image generation device that can generate a parallax image in which a hidden surface is corrected without a sense of incongruity.

視差画像生成装置のハードウエア構成図Hardware configuration diagram of parallax image generation device 視差画像生成装置の入出力データを示す図The figure which shows the input-output data of a parallax image generation apparatus パラメータを説明する図Diagram explaining parameters 視差画像生成処理の詳細を示すフローチャートFlow chart showing details of parallax image generation processing 参照位置特定処理を説明する図The figure explaining reference position specific processing 参照位置特定処理を説明する図The figure explaining reference position specific processing 第1の処理例を示す図The figure which shows the 1st process example 第2の処理例を示す図The figure which shows the 2nd processing example 変形例1を説明する図The figure explaining modification 1 2次元画像の一例を示す図The figure which shows an example of a two-dimensional image デプス画像の一例を示す図Diagram showing an example of a depth image ラベル画像の一例を示す図The figure which shows an example of a label image 視線が左方向からの視差画像の一例を示す図The figure which shows an example of the parallax image from which the eyes | visual_axis is from the left direction 視線が右方向からの視差画像の一例を示す図The figure which shows an example of the parallax image from which a gaze is right 隠れ面を説明する図Illustration explaining the hidden surface

以下図面に基づいて、本発明の実施形態を詳細に説明する。
図1は、視差画像生成装置1のハードウエア構成図である。尚、図1のハードウエア構成は一例であり、用途、目的に応じて様々な構成を採ることが可能である。
視差画像生成装置1は、制御部11、記憶部12、メディア入出力部13、通信制御部14、入力部15、表示部16、周辺機器I/F部17等が、バス18を介して接続される。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a hardware configuration diagram of the parallax image generation device 1. Note that the hardware configuration in FIG. 1 is an example, and various configurations can be adopted depending on applications and purposes.
In the parallax image generation device 1, a control unit 11, a storage unit 12, a media input / output unit 13, a communication control unit 14, an input unit 15, a display unit 16, a peripheral device I / F unit 17, etc. are connected via a bus 18. Is done.

制御部11は、CPU(Central Processing Unit)、ROM(Read OnlY MemorY)、RAM(Random Access MemorY)等で構成される。
CPUは、記憶部12、ROM、記録媒体等に格納されるプログラムをRAM上のワークメモリ領域に呼び出して実行し、バス18を介して接続された各装置を駆動制御し、視差画像生成装置1が行う後述する処理を実現する。
ROMは、不揮発性メモリであり、視差画像生成装置1のブートプログラムやBIOS等のプログラム、データ等を恒久的に保持している。
RAMは、揮発性メモリであり、記憶部12、ROM、記録媒体等からロードしたプログラム、データ等を一時的に保持するとともに、制御部11が各種処理を行う為に使用するワークエリアを備える。
The control unit 11 includes a CPU (Central Processing Unit), a ROM (Read Only Y Memory Y), a RAM (Random Access Memory Y), and the like.
The CPU calls and executes a program stored in the storage unit 12, ROM, recording medium, or the like to a work memory area on the RAM, drives and controls each device connected via the bus 18, and the parallax image generation device 1. The process to be described later is realized.
The ROM is a non-volatile memory, and permanently stores a boot program of the parallax image generation device 1, a program such as BIOS, data, and the like.
The RAM is a volatile memory, and temporarily stores programs, data, and the like loaded from the storage unit 12, ROM, recording medium, and the like, and includes a work area used by the control unit 11 for performing various processes.

記憶部12は、HDD(ハードディスクドライブ)等であり、制御部11が実行するプログラム、プログラム実行に必要なデータ、OS(オペレーティングシステム)等が格納される。プログラムに関しては、OS(オペレーティングシステム)に相当する制御プログラムや、後述する処理を視差画像生成装置1に実行させるためのアプリケーションプログラムが格納されている。
これらの各プログラムコードは、制御部11により必要に応じて読み出されてRAMに移され、CPUに読み出されて各種の手段として実行される。
The storage unit 12 is an HDD (hard disk drive) or the like, and stores a program executed by the control unit 11, data necessary for program execution, an OS (operating system), and the like. As for the program, a control program corresponding to an OS (operating system) and an application program for causing the parallax image generating device 1 to execute processing described later are stored.
Each of these program codes is read by the control unit 11 as necessary, transferred to the RAM, read by the CPU, and executed as various means.

メディア入出力部13(ドライブ装置)は、データの入出力を行い、例えば、CDドライブ(−ROM、−R、−RW等)、DVDドライブ(−ROM、−R、−RW等)等のメディア入出力装置を有する。
通信制御部14は、通信制御装置、通信ポート等を有し、視差画像生成装置1とネットワーク間の通信を媒介する通信インタフェースであり、ネットワークを介して、他の装置間との通信制御を行う。ネットワークは、有線、無線を問わない。
The media input / output unit 13 (drive device) inputs / outputs data, for example, media such as a CD drive (-ROM, -R, -RW, etc.), DVD drive (-ROM, -R, -RW, etc.) Has input / output devices.
The communication control unit 14 includes a communication control device, a communication port, and the like, is a communication interface that mediates communication between the parallax image generation device 1 and the network, and performs communication control between other devices via the network. . The network may be wired or wireless.

入力部15は、データの入力を行い、例えば、キーボード、マウス等のポインティングデバイス、テンキー等の入力装置を有する。
入力部15を介して、視差画像生成装置1に対して、操作指示、動作指示、データ入力等を行うことができる。
表示部16は、CRTモニタ、液晶パネル等のディスプレイ装置、ディスプレイ装置と連携して視差画像生成装置1のビデオ機能を実現するための論理回路等(ビデオアダプタ等)を有する。
The input unit 15 inputs data and includes, for example, a keyboard, a pointing device such as a mouse, and an input device such as a numeric keypad.
An operation instruction, an operation instruction, data input, and the like can be performed on the parallax image generation device 1 via the input unit 15.
The display unit 16 includes a display device such as a CRT monitor and a liquid crystal panel, and a logic circuit (such as a video adapter) for realizing the video function of the parallax image generation device 1 in cooperation with the display device.

周辺機器I/F(インタフェース)部17は、視差画像生成装置1に周辺機器を接続させるためのポートであり、周辺機器I/F部17を介して視差画像生成装置1は周辺機器とのデータの送受信を行う。周辺機器I/F部17は、USBやIEEE1394やRS−235C等で構成されており、通常複数の周辺機器I/Fを有する。周辺機器との接続形態は有線、無線を問わない。
バス18は、各装置間の制御信号、データ信号等の授受を媒介する経路である。
The peripheral device I / F (interface) unit 17 is a port for connecting a peripheral device to the parallax image generation device 1, and the parallax image generation device 1 transmits data with the peripheral device via the peripheral device I / F unit 17. Send and receive. The peripheral device I / F unit 17 is configured by USB, IEEE 1394, RS-235C, or the like, and usually includes a plurality of peripheral devices I / F. The connection form with the peripheral device may be wired or wireless.
The bus 18 is a path that mediates transmission / reception of control signals, data signals, and the like between the devices.

図2は、視差画像生成装置1の入出力データを示す図である。図2に示すように、視差画像生成装置1は、2次元画像2、ラベル画像3、デプス画像4、並びにパラメータ5を入力データとする。また、視差画像生成装置1は、視差画像6を出力データとする。
2次元画像2、ラベル画像3、及びデプス画像4は、視差画像生成装置1の制御部11が生成しても良いし、メディア入出力部13、通信制御部14等を介して外部から取得しても良い。また、パラメータ5は、視差画像生成装置1の入力部15を介して入力しても良いし、予めパラメータ5が定義されたパラメータファイルを外部から取得しても良い。
視差画像6は、視差画像生成装置1の記憶部12に記憶されても良いし、表示部16に表示されても良いし、メディア入出力部13、通信制御部14等を介して外部に出力しても良い。
FIG. 2 is a diagram showing input / output data of the parallax image generating device 1. As shown in FIG. 2, the parallax image generating device 1 uses a two-dimensional image 2, a label image 3, a depth image 4, and a parameter 5 as input data. Further, the parallax image generation device 1 uses the parallax image 6 as output data.
The two-dimensional image 2, the label image 3, and the depth image 4 may be generated by the control unit 11 of the parallax image generation device 1, or may be acquired from the outside via the media input / output unit 13, the communication control unit 14, and the like. May be. The parameter 5 may be input via the input unit 15 of the parallax image generation device 1 or a parameter file in which the parameter 5 is defined in advance may be acquired from the outside.
The parallax image 6 may be stored in the storage unit 12 of the parallax image generation device 1, displayed on the display unit 16, or output to the outside via the media input / output unit 13, the communication control unit 14, and the like. You may do it.

2次元画像2は、動画像(平面映像)の1枚分のフレーム画像または静止画像である。動画像(平面映像)には、例えば、単位時間当たり所定のフレーム数(通常、1秒間に30フレーム)のカラー静止画像が含まれており、各画素がRGB各256段階の階調を持つ。
後述する視差画像生成処理のすべての処理は、フレームごとに独立して実行するので、以下の説明においては、1枚分のフレーム画像(静止画像)の処理について記述する。
The two-dimensional image 2 is a frame image or a still image for one moving image (planar image). A moving image (planar image) includes, for example, a color still image of a predetermined number of frames per unit time (usually 30 frames per second), and each pixel has 256 gradations of RGB.
Since all the processes of the parallax image generation process to be described later are executed independently for each frame, the following description will describe the process of one frame image (still image).

ラベル画像3は、それぞれの2次元画像2に対応付けて、2次元画像2に記録されたシーンを構成する被写体を識別する固有の数値(ラベル値)によって領域分けし、このラベル値を画素値に置き換えた画像である。例えば、背景、建物、及び人物から構成されるシーンにおいて、背景、建物、及び人物に相当するラベル値として、それぞれL0、L1、L2を割り当て、対応する2次元画像2の各画素がどの被写体に属しているかを、L0、L1、L2の画素値に置き換えることによって表現する。
ラベル画像3は、2次元画像2に基づいてフォトレタッチソフトなどを用いて手作業で生成してもよいし、別途ソフトウエアを用いて自動的に生成してもよい。
The label image 3 is associated with each two-dimensional image 2 and is divided into regions by unique numerical values (label values) for identifying subjects constituting the scene recorded in the two-dimensional image 2, and the label values are converted into pixel values. It is an image replaced with. For example, in a scene composed of a background, a building, and a person, L0, L1, and L2 are assigned as label values corresponding to the background, the building, and the person, respectively, and each pixel of the corresponding two-dimensional image 2 is assigned to which subject. Whether it belongs or not is expressed by replacing it with pixel values of L0, L1, and L2.
The label image 3 may be generated manually using photo retouching software or the like based on the two-dimensional image 2, or may be automatically generated using separate software.

デプス画像4は、2次元画像2に係るカメラから被写体までの奥行き値を画素値に置き換えた画像である。ここで、カメラとは、視差画像生成装置1の内部処理において定義される仮想的なカメラを意味する。
デプス画像4は、例えば、画素値の範囲が0〜255(8ビット)のグレースケールであり、0(黒)が最も奥、255(白)が最も手前を意味する場合が多いが、逆であっても良い。以下では、説明を分かり易くするために、デプス画像4は、画素値の範囲が0〜255であり、0(黒)が最も奥、255(白)が最も手前を意味するものとする。
デプス画像4は、2次元画像2に基づいてフォトレタッチソフトなどを用いて手作業で生成してもよいし、別途ソフトウエアを用いて自動的に生成してもよい。
The depth image 4 is an image in which the depth value from the camera to the subject related to the two-dimensional image 2 is replaced with a pixel value. Here, the camera means a virtual camera defined in the internal processing of the parallax image generation device 1.
The depth image 4 is, for example, a gray scale with a pixel value range of 0 to 255 (8 bits), and 0 (black) is the farthest and 255 (white) is often the foremost. There may be. In the following, for ease of explanation, it is assumed that the depth image 4 has a pixel value range of 0 to 255, 0 (black) being the deepest and 255 (white) being the foremost.
The depth image 4 may be generated manually using photo retouching software or the like based on the two-dimensional image 2, or may be automatically generated using separate software.

パラメータ5は、後述する視差画像生成処理に用いる値である。パラメータ5には、カメラ数n、カメラ間隔、スクリーン面からカメラまでの奥行き値などが含まれる。
更に、パラメータ5には、2次元画像2の横幅、縦幅、画素ピッチなどが含まれる。2次元画像2は、パラメータ5の横幅、縦幅、画素ピッチによって、横方向(X軸方向)のピクセル数、及び、縦方向(Y軸方向)のピクセル数が決まる。
The parameter 5 is a value used for a parallax image generation process to be described later. Parameter 5 includes the number of cameras n, the camera interval, the depth value from the screen surface to the camera, and the like.
Furthermore, the parameter 5 includes the horizontal width, vertical width, pixel pitch, and the like of the two-dimensional image 2. In the two-dimensional image 2, the number of pixels in the horizontal direction (X-axis direction) and the number of pixels in the vertical direction (Y-axis direction) are determined by the horizontal width, vertical width, and pixel pitch of the parameter 5.

図3は、パラメータ5について説明する図である。
視差画像生成処理では、図3に示すように、仮想的な3次元空間(XYZ空間)に、スクリーン面S、カメラC〜Cを配置する。
スクリーン面Sは、2次元画像2を投影する領域であり、視差画像6の各画素が含まれる。図3に示す例では、スクリーン面SはXY平面と一致する。
FIG. 3 is a diagram for explaining the parameter 5.
In the parallax image generation processing, as shown in FIG. 3, the screen surface S and the cameras C 1 to C 8 are arranged in a virtual three-dimensional space (XYZ space).
The screen surface S is an area where the two-dimensional image 2 is projected, and each pixel of the parallax image 6 is included. In the example shown in FIG. 3, the screen surface S coincides with the XY plane.

カメラC〜Cは、パラメータ5のカメラ数n、カメラ間隔、スクリーン面Sからカメラまでの奥行き値に基づいて配置する。図3に示す例では、カメラ数nが「8」、カメラ間隔が「等間隔のCcamera_X」、奥行き値が「Ccamera_Z」である。Ccamera_Xは、両目視差(約60mm〜70mm程度)とする。
また、図3に示す例では、カメラ設置線30は、スクリーン面Sと平行、かつ、スクリーン面Sとの距離が「Ccamera_Z」の直線である。CをカメラID(C=1、・・・、8)とすると、カメラC〜Cのカメラ位置(CXi、CZi)(i=1、・・・、8)は、以下の式に基づいて算出する。尚、wは、2次元画像2の横幅である。
The cameras C 1 to C 8 are arranged based on the number of cameras n of parameter 5, the camera interval, and the depth value from the screen surface S to the camera. In the example illustrated in FIG. 3, the camera number n is “8”, the camera interval is “equally spaced C camera_X ”, and the depth value is “C camera_Z ”. C camera_X is a binocular parallax (about 60 mm to about 70 mm).
In the example illustrated in FIG. 3, the camera installation line 30 is a straight line parallel to the screen surface S and having a distance of “C camera_Z ” from the screen surface S. When C i is a camera ID (C i = 1,..., 8), the camera positions (C Xi , C Zi ) (i = 1,..., 8) of the cameras C 1 to C 8 are as follows. Based on the formula of W is the width of the two-dimensional image 2.

図3に示す例では、カメラ間隔を等間隔としたが、これはディスプレイにおける画像の見せ方に依存する。カメラ間隔を等間隔とした場合、観察者がどの位置から見ても隣り合う視差画像6が見えるようになる。但し、他の見せ方を所望する場合には、カメラ間隔は等間隔でなくても良い。
また、図3に示す例では、カメラ設置線30を直線としたが、これもディスプレイにおける画像の見せ方に依存する。例えば、ディスプレイが曲面の場合、カメラ設置線30を曲線とすることが考えられる。
図3に示す最遠面Pは、視差画像6に表現される被写体の中でカメラCから最も遠い位置であり、かつ、スクリーン面Sと平行な面である。
In the example shown in FIG. 3, the camera interval is set to be equal, but this depends on how the image is displayed on the display. When the camera interval is set to be equal, the parallax images 6 adjacent to each other can be seen from any position. However, if another way of viewing is desired, the camera interval may not be equal.
In the example shown in FIG. 3, the camera installation line 30 is a straight line, but this also depends on how the image is shown on the display. For example, when the display is a curved surface, the camera installation line 30 may be a curved line.
A farthest plane P shown in FIG. 3 is a position farthest from the camera C among subjects represented in the parallax image 6 and is a plane parallel to the screen plane S.

図2の説明に戻る。
視差画像6は、立体視を実現するための画像である。本発明の実施の形態では、視差画像6は、特に、両目視差(約60mm〜70mm程度)を利用し、裸眼観察によって立体視を実現するための画像である。
尚、本発明の実施の形態では詳細に述べないが、複数の視差画像6をディスプレイの仕様に合わせて合成し、ディスプレイに表示することによって、裸眼観察による立体視を実現することが可能となる。複数の視差画像6の合成処理については、公知の技術を利用すれば良い。
Returning to the description of FIG.
The parallax image 6 is an image for realizing stereoscopic viewing. In the embodiment of the present invention, the parallax image 6 is an image for realizing stereoscopic vision by naked-eye observation, particularly using binocular parallax (about 60 mm to about 70 mm).
Although not described in detail in the embodiment of the present invention, a plurality of parallax images 6 are synthesized in accordance with the specifications of the display and displayed on the display, thereby making it possible to realize stereoscopic vision by naked eye observation. . A known technique may be used for the synthesis process of the plurality of parallax images 6.

参照位置特定処理21では、デプス画像4とパラメータ5などを入力データとする。参照位置特定処理21では、スクリーン面のサンプリング点と、所定のパラメータに基づいて設定されるカメラ位置と、を通る視線直線を算出し、デプス画像4における奥行き値同士の区間の中で視線直線が通る区間である通過区間のいずれか1つを採用区間とし、採用区間における第1方向(例えば、「左」)側の奥行き値である第1奥行き値、及び、第1方向とは異なる第2方向(例えば、「右」)側の奥行き値である第2奥行き値のうち、より奥を示す方の位置を参照位置とする。特定された参照位置は、「参照位置バッファ」としてRAMや記憶部12などに格納される。   In the reference position specifying process 21, the depth image 4 and the parameter 5 are used as input data. In the reference position specifying process 21, a line of sight that passes through the sampling point on the screen surface and the camera position set based on a predetermined parameter is calculated, and the line of sight in the interval between the depth values in the depth image 4 is calculated. Any one of the passing sections that are passing sections is taken as the adopted section, and the first depth value that is the depth value on the first direction (for example, “left”) side in the adopted section and the second different from the first direction Of the second depth values that are depth values on the direction (eg, “right”) side, the position that indicates the depth is the reference position. The identified reference position is stored in the RAM or the storage unit 12 as a “reference position buffer”.

参照位置バッファの大きさは、2次元画像2の横方向のピクセル数×縦方向のピクセル数分としても良いし、又は、2次元画像2の横方向のピクセル数分としても良い。後述する他のバッファの大きさについても同様である。尚、2次元画像2、ラベル画像3、デプス画図4、及び視差画像6の横方向のピクセル数及び縦方向のピクセル数は、全て同じである。
以下では、第1方向を左、第2方向を右として説明する。同様に、第1奥行き値は左奥行き値、第2奥行き値は右奥行き値として説明する。
The size of the reference position buffer may be the number of pixels in the horizontal direction of the two-dimensional image 2 × the number of pixels in the vertical direction, or may be the number of pixels in the horizontal direction of the two-dimensional image 2. The same applies to the sizes of other buffers to be described later. Note that the number of pixels in the horizontal direction and the number of pixels in the vertical direction of the two-dimensional image 2, the label image 3, the depth image 4, and the parallax image 6 are all the same.
In the following description, the first direction is left and the second direction is right. Similarly, the first depth value will be described as the left depth value, and the second depth value will be described as the right depth value.

参照位置については、2画素間の奥行き量によって特定することができる。一方、2画素間の奥行き量だけでは、その2画素が同一の被写体に属するのか、別の被写体に属するのかは特定できない。また、2画素が別々の被写体に属する場合には、その2画素の間には視差により隠れ面が生じ、何も対処しないと、本来なら後ろの被写体が適切に補われて表示されるべき領域に、手前の被写体または後ろの被写体の境界部の画素がコピーされる結果になり好ましくない。そこで、本発明の実施の形態では、ラベル画像3も入力データとし、隠れ面判定処理22、ラベル値割り当て処理23、及び画素値割り当て処理24により、隠れ面に対して適切な画素値を補う。   The reference position can be specified by the depth amount between two pixels. On the other hand, only by the depth amount between two pixels, it cannot be specified whether the two pixels belong to the same subject or another subject. In addition, when two pixels belong to different subjects, a hidden surface is generated due to the parallax between the two pixels, and if nothing is dealt with, an area that should be displayed by appropriately compensating for the rear subject. In addition, the result is that the pixels at the boundary of the front subject or the rear subject are copied, which is not preferable. Therefore, in the embodiment of the present invention, the label image 3 is also used as input data, and an appropriate pixel value is compensated for the hidden surface by the hidden surface determination process 22, the label value assignment process 23, and the pixel value assignment process 24.

隠れ面判定処理22では、ラベル画像3と参照位置バッファなどを入力データとする。隠れ面判定処理22では、左奥行き値及び右奥行き値の位置にそれぞれ対応するラベル画像3の左ラベル値及び右ラベル値が異なる場合、参照位置が隠れ面であると判定する。また、隠れ面判定処理22では、左ラベル値及び右ラベル値が同一である場合、参照位置が隠れ面ではないと判定する。隠れ面の判定結果は、「隠れ面バッファ」としてRAMや記憶部12などに格納される。   In the hidden surface determination process 22, the label image 3 and the reference position buffer are used as input data. In the hidden surface determination process 22, when the left label value and the right label value of the label image 3 corresponding to the positions of the left depth value and the right depth value are different, the reference position is determined to be a hidden surface. Moreover, in the hidden surface determination process 22, when the left label value and the right label value are the same, it determines with a reference position not being a hidden surface. The hidden surface determination result is stored in the RAM, the storage unit 12 or the like as a “hidden surface buffer”.

また、隠れ面判定処理22では、参照位置が隠れ面である場合、更に、左奥行き値が右奥行き値よりも奥側の値を示す場合には、視線直線が左方向から手前の被写体と奥の被写体との間を通ることによって、左から覗き込んだ左隠れ面が生じていると判定する。また、隠れ面判定処理22では、右奥行き値が左奥行き値よりも奥側の値を示す場合には、視線直線が右から手前の被写体と奥の被写体との間を通ることによって、右から覗き込んだ右隠れ面が生じていると判定する。この判定結果も、「隠れ面バッファ」としてRAMや記憶部12などに格納される。   Further, in the hidden surface determination process 22, when the reference position is a hidden surface, and further, when the left depth value indicates a value on the back side with respect to the right depth value, the line of sight line is compared with the object on the front side from the left direction. It is determined that a left hidden surface viewed from the left is generated by passing between the subject and the subject. Further, in the hidden surface determination processing 22, when the right depth value indicates a value on the back side with respect to the left depth value, the line of sight passes between the subject on the near side and the subject on the back from the right, and from the right. It is determined that the right hidden surface that you looked into has occurred. This determination result is also stored in the RAM or the storage unit 12 as a “hidden surface buffer”.

ラベル値割り当て処理23では、ラベル画像3と隠れ面バッファなどを入力データとする。ラベル値割り当て処理23では、隠れ面判定処理22において参照位置が隠れ面ではないと判定された場合、ラベル画像3の左ラベル値又は右ラベル値を、処理対象のサンプリング点に割り当てる(この場合、左ラベル値と右ラベル値は同一であるから、どちらでも良い。)。また、ラベル値割り当て処理23では、隠れ面判定処理22において参照位置が隠れ面であると判定された場合、当該隠れ面によってどの被写体が出てくるのか、及び、どの被写体が当該隠れ面を隠していたのかを特定する。言い換えると、ラベル値割り当て処理23では、隠れ面に係る奥側の被写体及び手前側の被写体を特定する。そして、ラベル値割り当て処理23では、特定された両者の被写体のラベル値を、処理対象のサンプリング点に割り当てる。割り当てられたラベル値は、「ラベルバッファ」としてRAMや記憶部12などに格納される。   In the label value assignment process 23, the label image 3 and the hidden surface buffer are used as input data. In the label value assignment process 23, when it is determined in the hidden surface determination process 22 that the reference position is not a hidden surface, the left label value or the right label value of the label image 3 is assigned to the sampling point to be processed (in this case, Since the left label value and the right label value are the same, either may be used.) Also, in the label value assignment process 23, when the hidden surface determination process 22 determines that the reference position is a hidden surface, which subject appears by the hidden surface and which subject hides the hidden surface. Identify what was happening. In other words, in the label value assignment process 23, the back-side subject and the near-side subject relating to the hidden surface are specified. In the label value assigning process 23, the label values of both of the specified subjects are assigned to the sampling points to be processed. The assigned label value is stored as “label buffer” in the RAM, the storage unit 12 or the like.

画素値割り当て処理24では、2次元画像2、ラベルバッファ、及び参照位置バッファなどを入力データとする。画素値割り当て処理24では、隠れ面判定処理22において参照位置が隠れ面ではないと判定された場合には、2次元画像2における参照位置の画素値をサンプリング点の画素値とし、隠れ面判定処理22において参照位置が隠れ面であると判定された場合には、サンプリング点の画素値を補償する画素値(補償画素値)を特定する処理である補償処理を実行する。
補償処理では、例えば、制御部11は、左隠れ面の場合には、隠れ面判定処理22による判定結果を左に参照していくことによって隠れ面境界位置を特定する。また、制御部11は、右隠れ面の場合には、隠れ面判定処理22による判定結果を右に参照していくことによって隠れ面境界位置を特定する。そして、制御部11は、隠れ面境界位置を基準として補償画素値を特定する。
画素値割り当て処理24によって割り当てられたサンプリング点の画素値の集合が、視差画像6である。
In the pixel value assignment process 24, the two-dimensional image 2, the label buffer, the reference position buffer, and the like are input data. In the pixel value assignment process 24, when it is determined in the hidden surface determination process 22 that the reference position is not a hidden surface, the pixel value at the reference position in the two-dimensional image 2 is set as the pixel value of the sampling point, and the hidden surface determination process If it is determined in 22 that the reference position is a hidden surface, a compensation process that is a process of specifying a pixel value (compensation pixel value) for compensating the pixel value of the sampling point is executed.
In the compensation processing, for example, in the case of the left hidden surface, the control unit 11 specifies the hidden surface boundary position by referring to the determination result by the hidden surface determination processing 22 to the left. In the case of the right hidden surface, the control unit 11 identifies the hidden surface boundary position by referring to the determination result of the hidden surface determination process 22 to the right. And the control part 11 specifies a compensation pixel value on the basis of a hidden surface boundary position.
A set of pixel values of sampling points assigned by the pixel value assignment process 24 is a parallax image 6.

以下では、図4〜図8を参照しながら、視差画像生成装置1の処理の詳細について説明する。
図4は、視差画像生成処理の詳細を示すフローチャートである。
Below, the detail of the process of the parallax image generation apparatus 1 is demonstrated, referring FIGS. 4-8.
FIG. 4 is a flowchart showing details of the parallax image generation processing.

視差画像生成装置1の制御部11は、処理対象とするXZ平面を特定するために、スクリーン面SにおけるY座標を決定する(S201)。以下、S201にて決定されたY座標をYとする。視差画像生成装置1は、YごとにS202〜S208の処理を繰り返す。すべてのY座標についてS202〜S208の処理を実行することにより、1つのカメラCについて、1つの2次元画像2の視差画像6が求まることになる。 The control unit 11 of the parallax image generation device 1 determines the Y coordinate on the screen surface S in order to specify the XZ plane to be processed (S201). Hereinafter, the Y coordinates determined in S201 and Y s. Parallax image generating device 1 repeats the process of S202~S208 each Y s. By executing the processing of S202 to S208 for all the Y coordinates, one parallax image 6 of the two-dimensional image 2 is obtained for one camera C.

制御部11は、スクリーン面Sにおける処理対象の画素、すなわちサンプリング点を決定する(S202)。但し、サンプリング点のY座標は、S201において決定されたYである。
次に、制御部11は、S202において決定されたサンプリング点に対して、S203〜S206の処理によって視差画像6の画素値を算出する処理を実行する。
The control unit 11 determines a pixel to be processed on the screen surface S, that is, a sampling point (S202). However, Y coordinates of the sampling points is the Y s determined in S201.
Next, the control part 11 performs the process which calculates the pixel value of the parallax image 6 by the process of S203-S206 with respect to the sampling point determined in S202.

制御部11は、参照位置特定処理21を行う(S203)。ここで、参照位置は、生成される視差画像6における各画素に対して、2次元画像2のどの位置が対応するかを示すものである。制御部11は、視差画像6における各画素について、対応する点の奥行き値、カメラ位置などの幾何的情報から、その画素に対応する2次元画像2における参照位置を計算する。   The control unit 11 performs the reference position specifying process 21 (S203). Here, the reference position indicates which position in the two-dimensional image 2 corresponds to each pixel in the generated parallax image 6. For each pixel in the parallax image 6, the control unit 11 calculates a reference position in the two-dimensional image 2 corresponding to the pixel from geometric information such as the depth value of the corresponding point and the camera position.

図5、図6は、参照位置特定処理を説明する図である。図5、図6では、スクリーン面Sにおける各奥行き値(デプス画像4の画素値)の画素位置をX座標、奥行き値自体をZ座標とし、奥行き分布情報を複数の黒丸をつなぐ奥行き分布曲線32によって図示している。スクリーン面Sでは、所定の間隔によってサンプリング点が決定される。また、2次元画像2は、最遠面Pの位置にあるものとする。   5 and 6 are diagrams for explaining the reference position specifying process. 5 and 6, the depth distribution curve 32 connecting the depth distribution information to a plurality of black circles with the pixel position of each depth value (the pixel value of the depth image 4) on the screen surface S as the X coordinate and the depth value itself as the Z coordinate. It is illustrated by On the screen surface S, sampling points are determined by a predetermined interval. It is assumed that the two-dimensional image 2 is at the position of the farthest surface P.

最初に、図5を参照しながら説明する。
制御部11は、サンプリング点のX座標Xと、処理対象のカメラ位置(CXi、CZi)(i=1、・・・、n)と、を通る視線直線31aを算出する。カメラ位置(CXi、CZi)は、前述した通り、パラメータ5のカメラ数n、カメラ間隔Ccamera_X及びカメラCからスクリーン面Sまでの奥行き値Ccamera_Zに基づいて設定されている。図5に示す例では、カメラCを処理対象としている。
First, a description will be given with reference to FIG.
Control unit 11 calculates the X-coordinate X s of the sampling points, the camera position to be processed (C Xi, C Zi) ( i = 1, ···, n) and the line of sight straight 31a passing. As described above, the camera position (C Xi , C Zi ) is set based on the number of cameras n of parameter 5, the camera interval C camera_X, and the depth value C camera_Z from the camera C i to the screen surface S. In the example shown in FIG. 5, and the camera C 3 processed.

次に、制御部11は、奥行き分布曲線32における奥行き値(黒丸)同士の区間の中で視線直線31aが通る区間である通過区間33aを特定する。そして、制御部11は、通過区間33aを採用区間とし、採用区間における左側の奥行き値である左奥行き値34a、及び、右側の奥行き値である右奥行き値35aのうち、より奥を示す方(Z座標の値が小さい方)のX座標位置を参照位置とする。図5に示す例では、左奥行き値34aのX座標位置が参照位置となる。左奥行き値34aのX座標をXとすると、XとXとの差がシフト量36である。シフト量36は、生成される視差画像6の画素位置と、対応する2次元画像2の画素位置との差である。
そして、制御部11は、左奥行き値34aのX座標の値Xを、サンプリング点Xに対する参照位置として、参照位置バッファに格納する。
制御部11は、以上の処理を全てのカメラC〜Cに対して実行し、各視差画像6における各画素(X,Y)のシフト量を算出する。
Next, the control unit 11 specifies a passage section 33a that is a section through which the line of sight line 31a passes among sections of depth values (black circles) in the depth distribution curve 32. And the control part 11 makes the passage area 33a an adoption area, and shows the back | inner side among the left depth value 34a which is the depth value of the left side in the adoption area, and the right depth value 35a which is a right depth value ( The X coordinate position of the smaller Z coordinate value is set as the reference position. In the example shown in FIG. 5, the X coordinate position of the left depth value 34a is the reference position. When the X-coordinate of the left depth values 34a and X k, the difference between X s and X k is the shift amount 36. The shift amount 36 is a difference between the pixel position of the generated parallax image 6 and the corresponding pixel position of the two-dimensional image 2.
Then, the control unit 11, the value X k of the X-coordinate of the left depth value 34a, as a reference position for the sampling point X s, and stores the reference position buffer.
The control unit 11 performs the above processing on all the cameras C 1 to C 8 and calculates the shift amount of each pixel (X s , Y s ) in each parallax image 6.

図6では、複数の通過区間33b、33c、33dが存在する例を示している。この場合、制御部11は、最もカメラC〜Cに近いものを採用区間とする。図6に示す例では、通過区間33bを採用区間とする。
そして、制御部11は、採用区間における左奥行き値34b及び右奥行き値35bのうち、より奥を示す方のX座標位置を参照位置とする。図6に示す例では、右奥行き値35bのX座標位置が参照位置となる。
FIG. 6 shows an example in which a plurality of passage sections 33b, 33c, and 33d exist. In this case, the control unit 11 sets the one closest to the cameras C 1 to C 8 as the adopted section. In the example shown in FIG. 6, the passage section 33 b is an adopted section.
And the control part 11 makes the X coordinate position which shows the back | inner side among the left depth value 34b and the right depth value 35b in an employment area the reference position. In the example shown in FIG. 6, the X coordinate position of the right depth value 35b is the reference position.

複数の通過区間33が存在する場合、最もカメラC〜Cに近いものが、最も手前の被写体である。従って、最もカメラC〜Cに近いものを採用区間とすることで、複数の被写体の配置関係が忠実に再現された視差画像6を生成することができる。 If multiple pass section 33 is present, the closest to the camera C 1 -C 8 is the closest to the object. Therefore, by using the section closest to the cameras C 1 to C 8 as the adopted section, it is possible to generate the parallax image 6 in which the arrangement relationship of a plurality of subjects is faithfully reproduced.

図7は、第1の処理例を示す図である。図7では、各サンプリング点Xに対して、参照位置特定処理21(S203)の処理結果である参照位置バッファ41、隠れ面判定処理22(S204)の処理結果である隠れ面バッファ42、ラベル値割り当て処理23(S205)の処理結果であるラベルバッファ43、及び画素値割り当て処理24(S206)の処理結果である生成結果バッファ44が示されている。図7の例では、2次元画像2のシーンを構成する被写体が、背景を含めて7つ存在する。背景にはラベル値「L0」、その他の物体には、ラベル値「L1」〜「L6」が対応付けられている。 FIG. 7 is a diagram illustrating a first processing example. In Figure 7, hidden plane buffer 42 as the processing result with respect to each sampling point X s, processing the results reference position buffer 41 of the reference position specifying process 21 (S203), the hidden surface determination process 22 (S204), the label A label buffer 43 that is the processing result of the value assignment processing 23 (S205) and a generation result buffer 44 that is the processing result of the pixel value assignment processing 24 (S206) are shown. In the example of FIG. 7, there are seven subjects that form the scene of the two-dimensional image 2 including the background. The label value “L0” is associated with the background, and the label values “L1” to “L6” are associated with the other objects.

図7の参照位置バッファ41には、サンプリング点Xが「1、2、3、4、5、6、7、8、・・・」の各々について、参照位置バッファ41には、「3、4、5、7、8、9、11、12、・・・」が格納されている。 The reference position buffer 41 in FIG. 7, the sampling point X s is "1,2,3,4,5,6,7,8, ..." for each of the reference position buffer 41 is "3, 4, 5, 7, 8, 9, 11, 12,... "Are stored.

図4の説明に戻る。
制御部11は、隠れ面判定処理22を行う(S204)。制御部11は、ラベル画像3を参照し、S203において特定された採用区間(図5の例では33a)の両端(左奥行き値34aと右奥行き値35a)が同一の被写体に属するのか、あるいは、異なる被写体に属するのかを判定する。
具体的には、制御部11は、左奥行き値34aの位置(デプス画像4の画素位置)に対応するラベル画像3の画素位置の画素値を左ラベル値とし、右奥行き値35aの位置(デプス画像4の画素位置)に対応するラベル画像3の画素位置の画素値を右ラベル値とする。そして、制御部11は、左ラベル値と右ラベル値を比較する。両者が同一の場合、視線直線(図5の例では31a)がそのラベル値で表わされる単一の被写体と交差することを意味するので、制御部11は、参照位置が隠れ面ではないと判定する。一方、両者が異なる場合、視線直線(図5の例では31a)が異なる複数の被写体の挟間を通過することを意味するので、制御部11は、参照位置が隠れ面であると判定する。
Returning to the description of FIG.
The control unit 11 performs a hidden surface determination process 22 (S204). The control unit 11 refers to the label image 3 and both ends (left depth value 34a and right depth value 35a) of the adopted section (33a in the example of FIG. 5) specified in S203 belong to the same subject, or It is determined whether the subject belongs to a different subject.
Specifically, the control unit 11 sets the pixel value of the pixel position of the label image 3 corresponding to the position of the left depth value 34a (pixel position of the depth image 4) as the left label value, and the position of the right depth value 35a (depth). The pixel value at the pixel position of the label image 3 corresponding to the pixel position of the image 4 is set as the right label value. Then, the control unit 11 compares the left label value with the right label value. When both are the same, it means that the line of sight (31a in the example of FIG. 5) intersects with a single subject represented by the label value, so the control unit 11 determines that the reference position is not a hidden surface. To do. On the other hand, if they are different, it means that the line of sight (31a in the example of FIG. 5) passes between different objects, and the control unit 11 determines that the reference position is a hidden surface.

制御部11は、隠れ面の判定結果を隠れ面バッファ42に格納する。より詳細には、制御部11は、(1)参照位置が隠れ面か否か、及び、(2)参照位置が隠れ面である場合には、参照位置が、手前の被写体を左から覗き込んだことにより生じる隠れ面(=左隠れ面)なのか、右から覗き込んだことにより生じる隠れ面(=右隠れ面)なのかを、隠れ面バッファ42に格納する。   The control unit 11 stores the hidden surface determination result in the hidden surface buffer 42. More specifically, the control unit 11 (1) determines whether or not the reference position is a hidden surface, and (2) when the reference position is a hidden surface, the reference position looks into the subject in front from the left. The hidden surface buffer 42 stores whether it is a hidden surface (= left hidden surface) caused by the above or a hidden surface (= right hidden surface) generated by looking into the right.

例えば、図5の例であれば、左奥行き値34a(参照位置の奥行き情報)が右奥行き値35aよりも奥にあることから、左奥行き値34aの位置(参照位置)が隠れ面である場合、制御部11は、この隠れ面を左隠れ面であると判定する。
また、例えば、図6の例であれば、右奥行き値35b(参照位置の奥行き情報)が左奥行き値34bよりも奥にあることから、右奥行き値35bの位置(参照位置)が隠れ面である場合、制御部11は、この隠れ面を右隠れ面であると判定する。
For example, in the example of FIG. 5, since the left depth value 34a (depth information of the reference position) is behind the right depth value 35a, the position (reference position) of the left depth value 34a is a hidden surface. The control unit 11 determines that this hidden surface is a left hidden surface.
For example, in the example of FIG. 6, the right depth value 35b (depth information of the reference position) is behind the left depth value 34b, so the position (reference position) of the right depth value 35b is a hidden surface. If there is, the control unit 11 determines that this hidden surface is a right hidden surface.

図7の隠れ面バッファ42には、参照位置バッファ42が「3、4、5」に対しては、右隠れ面であること(=「右」)が格納されている。また、参照位置バッファ42が「7、8、9、11、12」に対しては、隠れ面でないこと(=「非」)が格納されている。   The hidden surface buffer 42 of FIG. 7 stores that the reference position buffer 42 is a right hidden surface (= “right”) for “3, 4, 5”. The reference position buffer 42 stores “7, 8, 9, 11, 12” indicating that it is not a hidden surface (= “non”).

図4の説明に戻る。
次に、制御部11は、ラベル値割り当て処理23を行う(S205)。制御部11は、各参照位置に対してラベル値を割り当てて、ラベルバッファ43に格納する。このとき、参照位置が隠れ面である場合、制御部11は、参照位置を隠していた被写体(=手前側の被写体)のラベル値と、参照位置に現れるべき被写体(=奥側の被写体)のラベル値を格納する。
Returning to the description of FIG.
Next, the control unit 11 performs a label value assignment process 23 (S205). The control unit 11 assigns a label value to each reference position and stores it in the label buffer 43. At this time, when the reference position is a hidden surface, the control unit 11 determines the label value of the subject (= subject subject) that has hidden the reference position and the subject (= subject subject) that should appear at the reference position. Stores the label value.

例えば、図5の例であれば、隠れ面の判定結果において、左奥行き値34aの位置(参照位置)が隠れ面である場合、この隠れ面は、左隠れ面であると判定される。従って、制御部11は、左奥行き値34aの位置に対応する左ラベル値の被写体が、奥側の被写体であると判定し、参照位置に現れるべき被写体(=奥側の被写体)のラベル値として、左ラベル値を格納する。また、制御部11は、右奥行き値35aの位置に対応する右ラベル値の被写体が、手前側の被写体であると判定し、参照位置を隠していた被写体(=手前側の被写体)のラベル値として、右ラベル値を格納する。
また、例えば、図6の例であれば、隠れ面の判定結果において、右奥行き値35bの位置(参照位置)が隠れ面である場合、この隠れ面は、右隠れ面であると判定される。従って、制御部11は、右奥行き値35bの位置に対応する右ラベル値の被写体が、奥側の被写体であると判定し、参照位置に現れるべき被写体(=奥側の被写体)のラベル値として、右ラベル値を格納する。また、制御部11は、左奥行き値34bの位置に対応する左ラベル値の被写体が、手前側の被写体であると判定し、参照位置を隠していた被写体(=手前側の被写体)のラベル値として、左ラベル値を格納する。
For example, in the example of FIG. 5, when the position (reference position) of the left depth value 34a is a hidden surface in the hidden surface determination result, this hidden surface is determined to be the left hidden surface. Accordingly, the control unit 11 determines that the subject with the left label value corresponding to the position of the left depth value 34a is the subject on the back side, and uses it as the label value of the subject (= the subject on the back side) that should appear at the reference position. Stores the left label value. Further, the control unit 11 determines that the subject with the right label value corresponding to the position of the right depth value 35a is the subject on the near side, and the label value of the subject (= the subject on the near side) that has hidden the reference position. As the right label value.
For example, in the example of FIG. 6, when the position (reference position) of the right depth value 35 b is a hidden surface in the hidden surface determination result, this hidden surface is determined to be the right hidden surface. . Therefore, the control unit 11 determines that the subject with the right label value corresponding to the position of the right depth value 35b is the subject on the back side, and uses it as the label value of the subject (= the subject on the back side) that should appear at the reference position. Stores the right label value. Further, the control unit 11 determines that the subject of the left label value corresponding to the position of the left depth value 34b is the subject on the near side, and the label value of the subject (= the subject on the near side) that has hidden the reference position. As the left label value.

図7のラベルバッファ43には、各参照位置のラベル値が格納されている。参照位置バッファ42が「3、4、5」に対しては、参照位置を隠していた被写体のラベル値=L6/参照位置に現れるべき被写体のラベル値=L0が格納されている。また、参照位置X=7、8、9、11、12は隠れ面ではないので、ラベル値=L0のみが格納されている。 The label buffer 43 in FIG. 7 stores the label value at each reference position. When the reference position buffer 42 is “3, 4, 5”, the label value of the subject whose reference position is hidden = L6 / the label value of the subject to appear at the reference position = L0 is stored. Further, since the reference position X k = 7, 8, 9, 11, 12 is not a hidden surface, only the label value = L0 is stored.

次に、制御部11は、画素値割り当て処理24を行う(S206)。制御部11は、各サンプリング点Xについて隠れ面バッファ42を確認し、隠れ面判定の結果が隠れ面ではない場合(「非」の場合)、参照位置バッファ41を確認し、サンプリング点Xに対して、2次元画像2における参照位置Xの画素値を割り当てる。 Next, the control unit 11 performs a pixel value assignment process 24 (S206). The control unit 11 confirms the hidden surface buffer 42 for each sampling point X s , and if the result of the hidden surface determination is not a hidden surface (in the case of “non”), confirms the reference position buffer 41 and samples the sampling point X s. relative, assigning the pixel values of the reference position X k in the two-dimensional image 2.

図7に示す例では、サンプリング点Xが「4、5、6、7、8」の隠れ面バッファ42の値は「非」なので、制御部11は、それぞれ、参照位置バッファ41に格納されている参照位置X=7、8、9、11、12を生成結果バッファ44に格納する。つまり、制御部11は、参照位置バッファ41に格納されている参照位置Xの画素値を、そのままサンプリング点Xに対して割り当てる。 In the example shown in FIG. 7, since the value of the hidden surface buffer 42 at the sampling point X s “4, 5, 6, 7, 8” is “non-”, the control unit 11 is stored in the reference position buffer 41, respectively. The reference positions X k = 7, 8, 9, 11, and 12 are stored in the generation result buffer 44. That is, the control unit 11, the pixel values of the reference position X k stored in the reference position buffer 41, as it is assigned to the sampling point X s.

一方、制御部11は、各サンプリング点Xについて隠れ面バッファ42を確認し、隠れ面判定の結果が左隠れ面の場合(「左」の場合)、隠れ面バッファ42を左に参照していくことによって隠れ面境界位置を特定し、又は、隠れ面判定の結果が右隠れ面の場合(「右」の場合)、隠れ面バッファ42を右に参照していくことによって隠れ面境界位置を特定する。
そして、制御部11は、隠れ面境界位置を基準として、サンプリング点の画素値を補償する画素値(補償画素値)を特定する。
On the other hand, the control unit 11 checks the hidden plane buffer 42 for each sampling point X s, (in the case of "left") As a result of the determination hidden surface when left hidden face, with reference to the hidden plane buffer 42 to the left The hidden surface boundary position is specified by going, or when the result of the hidden surface determination is the right hidden surface (in the case of “right”), the hidden surface boundary position is determined by referring to the hidden surface buffer 42 to the right. Identify.
And the control part 11 specifies the pixel value (compensation pixel value) which compensates the pixel value of a sampling point on the basis of a hidden surface boundary position.

例えば、制御部11は、サンプリング点Xから隠れ面境界位置までの距離dを算出し、サンプリング点Xから2d−1の距離にあるサンプリング点X’に対する参照位置バッファ41の値を生成結果バッファ44に格納する。つまり、制御部11は、サンプリング点Xから2d−1の距離にあるサンプリング点X’に対する参照位置の画素値を、補償画素値として割り当てる。
この手法では、隠れ面境界位置を折り返し点として、画素値を折り返しコピーすることによって、サンプリング点Xの画素値を補償している。
For example, the control unit 11 generates a value of the reference position buffer 41 for calculating the distance d to the hidden surface boundary position from the sampling point X s, the sampling point X s with the sampling point X s at a distance of 2d-1 ' Store in the result buffer 44. That is, the control unit 11, the pixel values of the reference position for the sampling points X s' with the sampling point X s to 2d-1 of the distance is assigned as the compensation pixel value.
In this method, a point folding hidden surface boundary positions by copying folded pixel values, compensates for the pixel value of the sampling point X s.

図7に示す例では、サンプリング点Xが「1」の隠れ面バッファ42の値は「右」なので、制御部11は、サンプリング点Xから右に隠れ面バッファ42を参照していくことによって、隠れ面の境界位置が「4」であることを特定する。そして、制御部11は、サンプリング点X「1」から隠れ面の境界位置「4」までの距離L=4−1=3を算出し、サンプリング点X「1」から2d−1=2×3−1=5の距離にあるサンプリング点X’「6」に対する参照位置バッファ41の値「9」を生成結果バッファ44に格納する。
また、サンプリング点Xが「2」の隠れ面バッファ42の値も「右」なので、制御部11は、サンプリング点Xから右に隠れ面バッファ42を参照していくことによって、隠れ面の境界位置が「4」であることを特定する。そして、制御部11は、サンプリング点X「2」から隠れ面の境界位置「4」までの距離L=4−2=2を算出し、サンプリング点X「2」から2d−1=2×2−1=3の距離にあるサンプリング点X’「5」に対する参照位置バッファ41の値「8」を生成結果バッファ44に格納する。
また、サンプリング点Xが「3」の隠れ面バッファ42の値も「右」なので、制御部11は、サンプリング点Xから右に隠れ面バッファ42を参照していくことによって、隠れ面の境界位置が「4」であることを特定する。そして、制御部11は、サンプリング点X「3」から隠れ面の境界位置「4」までの距離L=4−3=1を算出し、サンプリング点X「3」から2d−1=2×1−1=1の距離にあるサンプリング点X’「4」に対する参照位置バッファ41の値「7」を生成結果バッファ44に格納する。
以上の処理により、隠れ面と判定された場合については、隠れ面境界位置を折り返し点とした画素値の折り返しコピーにより、多くの場合に合理的と考えられる画素値を割り当てることが可能になる。
In the example shown in FIG. 7, the value of the hidden surface buffer 42 whose sampling point X s is “1” is “right”, and therefore the control unit 11 refers to the hidden surface buffer 42 to the right from the sampling point X s. To specify that the boundary position of the hidden surface is “4”. Then, the control unit 11 calculates a distance L = 4-1 = 3 from the sampling point X s “1” to the boundary position “4” of the hidden surface, and 2d−1 = 2 from the sampling point X s “1”. The value “9” of the reference position buffer 41 for the sampling point X s ′ “6” at the distance of × 3−1 = 5 is stored in the generation result buffer 44.
Further, since the value of the hidden surface buffer 42 with the sampling point X s being “2” is also “right”, the control unit 11 refers to the hidden surface buffer 42 to the right from the sampling point X s , thereby It is specified that the boundary position is “4”. Then, the control unit 11 calculates a distance L = 4-2 = 2 from the sampling point X s “2” to the boundary position “4” of the hidden surface, and 2d−1 = 2 from the sampling point X s “2”. The value “8” of the reference position buffer 41 for the sampling point X s ′ “5” at the distance of x2−1 = 3 is stored in the generation result buffer 44.
Further, since the value of the hidden surface buffer 42 with the sampling point X s “3” is also “right”, the control unit 11 refers to the hidden surface buffer 42 to the right from the sampling point X s , thereby It is specified that the boundary position is “4”. Then, the control unit 11 calculates a distance L = 4-3 = 1 from the sampling point X s “3” to the boundary position “4” of the hidden surface, and 2d−1 = 2 from the sampling point X s “3”. The value “7” of the reference position buffer 41 for the sampling point X s ′ “4” at the distance of x1-1 = 1 is stored in the generation result buffer 44.
In the case where it is determined as a hidden surface by the above processing, it is possible to assign a pixel value that is considered to be reasonable in many cases by returning the pixel value with the hidden surface boundary position as the return point.

図7に示した例は、サンプリング点Xから2d−1の距離にあるサンプリング点X’のラベル値「L0」が、サンプリング点Xのラベル値「L0」と同一であったが、常に同一であるとは限らない。
そこで、図8を参照しながら、サンプリング点Xから2d−1の距離にあるサンプリング点X’のラベル値と、サンプリング点Xのラベル値とが異なる場合の例外処理について説明する。
Example shown in FIG. 7, the label value of the sampling point X s' with the sampling point X s at a distance of 2d-1 "L0" is was identical with the label value of the sampling point X s "L0", It is not always the same.
Therefore, with reference to FIG. 8, and the label value of the sampling point X s' with the sampling point X s at a distance of 2d-1, the exception process when the label value of the sampling point X s are different will be described.

図8に示す例では、サンプリング点X「1」から2d−1=5の距離にあるサンプリング画素位置X’「6」のラベル値が「L3」となっており、サンプリング点Xのラベル値「L0」と異なっている。このような場合、前述の手法では、他の被写体についての画素値を隠れ面補償として補うことになってしまい、不合理である。
そこで、制御部11は、折り返しコピーされる画素位置のラベル値が、サンプリング点の参照位置に現れるべき被写体のラベル値と一致するか否かを判定する。より詳しくは、制御部11は、サンプリング点Xから2d−1の距離にある画素のラベル値(ラベルバッファ43の値)が、サンプリング点Xの参照位置に現れるべき被写体のラベル値(ラベルバッファ43の2番目のラベル値)と一致するか否かを判定する。そして、制御部11は、一致する場合には、前述の折り返しコピーによる隠れ面補償処理を実行し、一致しない場合には、以下に説明する例外処理を実行する。
In the example illustrated in FIG. 8, the label value of the sampling pixel position X s ' “6” at a distance of 2d−1 = 5 from the sampling point X s “1” is “L3”, and the sampling point X s This is different from the label value “L0”. In such a case, the above-described method is irrational because the pixel values of other subjects are compensated as hidden surface compensation.
Therefore, the control unit 11 determines whether or not the label value of the pixel position to be copied by copying matches the label value of the subject that should appear at the reference position of the sampling point. More specifically, the control unit 11, the label values of pixels at the sampling point X s at a distance of 2d-1 (the value of the label buffer 43), the subject of the label value should appear in the reference position of the sampling point X s (label It is determined whether or not it matches the second label value of the buffer 43. Then, the control unit 11 executes the hidden surface compensation process by the above-described folded copy when they match, and executes the exception process described below when they do not match.

例外処理では、制御部11は、サンプリング点Xの参照位置に現れるべき被写体のラベル値(ラベルバッファ43の2番目のラベル値)と同一の一繋がりのサンプリング点群のなかで最も遠いサンプリング点X’’の参照位置バッファ41に格納されている参照位置の画素値を、サンプリング点Xの画素値として割り当てる。
図8に示す例では、サンプリング点Xが「1」の参照位置に現れるべき被写体のラベル値「L0」と同一の一繋がりのサンプリング点群は、「2」〜「5」となっている。そこで、制御部11は、サンプリング点群「2」〜「5」の中で最も遠いサンプリング点X’’「5」の参照位置バッファ41に格納されている参照位置「8」を、サンプリング点X「1」の生成結果バッファ44に格納する。
以上の例外処理により、他の被写体の画素値を隠れ面の画素値として補償することがなくなり、どのような場合であっても、合理的と考えられる画素値を割り当てることが可能になる。
In exception processing, the control unit 11, the label value of the object to appear at the reference position of the sampling point X s (2-th label value of the label buffer 43) farthest sampling point among the same single monolithic sampling point group the pixel values of X s 'see reference stored in the position buffer 41 position of' assigned as the pixel values of the sampling point X s.
In the example shown in FIG. 8, the label value sampling point group of the same single monolithic with "L0" of the object to the sampling point X s appears at the reference position "1", is "2" to "5" . Therefore, the control unit 11 uses the reference position “8” stored in the reference position buffer 41 of the farthest sampling point X s ″ “5” in the sampling point groups “2” to “5” as the sampling point. The generation result buffer 44 of X s “1” is stored.
Through the above exception processing, the pixel value of another subject is not compensated as the pixel value of the hidden surface, and in any case, it is possible to assign a reasonable pixel value.

そして、生成結果バッファ44に格納された最終的な参照位置に対応する2次元画像2の画素値を各サンプリング点Xの画素値として割り当てることにより、隠れ面が適切な画素値によって補償された視差画像6を得ることが可能になる。 Then, by assigning the generated results final pixel values of corresponding two-dimensional image 2 to the reference position stored in the buffer 44 as the pixel value of each sampling point X s, hidden surface is compensated for by appropriate pixel value The parallax image 6 can be obtained.

図4の説明に戻る。
制御部11は、全サンプリング点(但し、Y座標はYのみ)について処理が終了したかどうか確認する(S207)。処理が終了していない場合(S207のNo)、S202から処理を繰り返す。処理が終了している場合(S207のYes)、S208に進む。
Returning to the description of FIG.
Control unit 11, all the sampling points (where, Y coordinates Y s only) process to determine whether finished for (S207). If the process has not ended (No in S207), the process is repeated from S202. If the process has been completed (Yes in S207), the process proceeds to S208.

次に、制御部11は、全てのY座標について処理が終了したかどうか確認する(S208)。処理が終了していない場合(S208のNo)、S201から処理を繰り返す。処理が終了している場合(S208のYes)、S209に進む。   Next, the control part 11 confirms whether the process was complete | finished about all the Y coordinates (S208). If the process has not ended (No in S208), the process is repeated from S201. If the process has been completed (Yes in S208), the process proceeds to S209.

次に、制御部11は、S206において算出された画素値をカメラCごとに纏めて、視差画像6として記憶部12に保存する(S209)。カメラ数nが「8」の場合、制御部11は、S206において算出された画素値をカメラC〜Cごとに纏めて、8枚の視差画像6として記憶部12に記憶する。 Next, the control unit 11 collects the pixel values calculated in S206 for each camera C and saves them in the storage unit 12 as the parallax image 6 (S209). When the camera number n is “8”, the control unit 11 collects the pixel values calculated in S206 for each of the cameras C 1 to C 8 and stores them in the storage unit 12 as eight parallax images 6.

以上、本発明の実施の形態に係る視差画像生成装置1は、隠れ面が違和感なく補正された視差画像6を生成することができる。   As described above, the parallax image generation device 1 according to the embodiment of the present invention can generate the parallax image 6 in which the hidden surface is corrected without a sense of incongruity.

<変形例1>
画素値割り当て処理24(S206)の変形例1について説明する。
前述の手法では、隠れ面境界位置を折り返し点として、画素値を折り返しコピーすることによって、サンプリング点Xの画素値を補償している。この手法では、横方向の画素値のみを考慮していることから、参照位置に現れるべき被写体(=奥側の被写体)の階調変化が激しく、かつ、参照位置を隠していた被写体(=手前側の被写体)の輪郭が曲線のような場合には、隠れ面の領域において手前側の被写体の輪郭に沿った筋状の線が出現してしまうことがある。変形例1では、この現象を回避することができる。
<Modification 1>
Modification 1 of the pixel value assignment process 24 (S206) will be described.
In the above method, the point folding hidden surface boundary positions by copying folded pixel values, compensates for the pixel value of the sampling point X s. Since this method considers only the pixel values in the horizontal direction, the subject that should appear at the reference position (= subject object) has a large gradation change, and the subject that has hidden the reference position (= front side) When the contour of the subject on the side is a curve, a streak line along the contour of the subject on the near side may appear in the hidden surface area. In the first modification, this phenomenon can be avoided.

図9は、変形例1を説明する図である。図9に示す例では、2次元画像2のシーンを構成する被写体は、物体51及び背景52である。この例では、カメラ位置が正面よりも右である。そして、物体51と背景52との間に、隠れ面が生じている。
制御部11は、まず、連続する複数のY座標Y、Y’、Y
’、・・・について、参照位置特定処理21(S203)、隠れ面判定処理22(S204)、及びラベル値割り当て処理(S205)を実行する。
次に、制御部11は、隠れ面と判定された複数の参照位置が、連結している領域を隠れ面領域53(図9では「黒色」)として抽出する。
次に、制御部11は、隠れ面領域43のY方向に伸びる外接直線を折り返し線54として抽出する。この例では、隠れ面が右隠れ面であることから、隠れ面領域53の右側の外接直線を抽出する。一方、隠れ面が左隠れ面であれば、隠れ面領域53の左側の外接直線を抽出すれば良い。
そして、制御部11は、折り返し線54を基準として、画素値を折り返しコピーすることによって、サンプリング点Xの画素値を補償する。
FIG. 9 is a diagram for explaining the first modification. In the example shown in FIG. 9, the subjects constituting the scene of the two-dimensional image 2 are the object 51 and the background 52. In this example, the camera position is to the right of the front. A hidden surface is generated between the object 51 and the background 52.
First, the control unit 11 includes a plurality of continuous Y coordinates Y s , Y s ′, and Y s ′.
,..., A reference position specifying process 21 (S203), a hidden surface determining process 22 (S204), and a label value assigning process (S205) are executed.
Next, the control unit 11 extracts a region where a plurality of reference positions determined to be hidden surfaces are connected as a hidden surface region 53 (“black” in FIG. 9).
Next, the control unit 11 extracts a circumscribing straight line extending in the Y direction of the hidden surface area 43 as a folding line 54. In this example, since the hidden surface is the right hidden surface, a circumscribed straight line on the right side of the hidden surface region 53 is extracted. On the other hand, if the hidden surface is the left hidden surface, a circumscribed straight line on the left side of the hidden surface region 53 may be extracted.
Then, the control unit 11, based on the fold line 54, by copying folded pixel value to compensate for the pixel values of the sampling point X s.

変形例1によって、参照位置に現れるべき被写体(=奥側の被写体)の階調変化が激しく、かつ、参照位置を隠していた被写体(=手前側の被写体)の輪郭が曲線のような場合であっても、隠れ面の領域において横方向に筋状の線が出現してしまうことがない。   According to the first modification, the gradation of the subject that should appear at the reference position (= subject subject) is severe, and the contour of the subject (= subject subject) that has hidden the reference position is curved. Even if it exists, a streak line does not appear in the horizontal direction in the area of the hidden surface.

<変形例2>
画素値割り当て処理24(S206)の変形例2について説明する。変形例2では、折り返しコピーではない各種の手法について説明する。
<Modification 2>
A second modification of the pixel value assignment process 24 (S206) will be described. In the second modification, various methods that are not return copy will be described.

制御部11は、サンプリング点Xの画素値を補償する為に、以下に示すいずれかの値を算出又は取得する。
(1)参照位置に現れるべき被写体(=奥側の被写体)の全体の平均値
(2)参照位置に現れるべき被写体(=奥側の被写体)の中で、参照位置を隠していた被写体(=手前側の被写体)と隣接する画素群の平均値
(3)参照位置に現れるべき被写体(=奥側の被写体)の代表値(代表値については、予め、補償画素値として適切と考えられる値を記憶部12等に記憶しておく。)
そして、制御部11は、算出又は取得される(1)〜(3)の値を、補償画素値として割り当てる。
Control unit 11, in order to compensate for the pixel values of the sampling point X s, and calculates or acquires one of the values shown below.
(1) Overall average value of subjects that should appear at the reference position (= subject subject) (2) Among subjects (= subject subjects) that should appear at the reference position, subjects (= Average value of pixel group adjacent to (front subject) (3) Representative value of subject (= subject subject) that should appear at reference position (represented value that is considered appropriate as compensation pixel value in advance) (It is stored in the storage unit 12 etc.)
And the control part 11 allocates the value of (1)-(3) calculated or acquired as a compensation pixel value.

<変形例3>
変形例3では、図4に示すフローチャートを実行する前に、隠れ面が生じないように、2次元画像2を加工しておく手法について説明する。変形例3の手法は、背景を除いて被写体同士の重なり合いがほとんどないようなシーンの2次元画像2について有効である。
制御部11は、2次元画像2から背景領域を抽出し、テクスチャ生成技術によって、2次元画像2全体の画素位置に画素値を有する加工背景領域を生成する。そして、制御部11は、2次元画像2における背景を除いた被写体の領域に含まれる各画素について、対応する加工背景領域の画素値を対応付けて記憶部12等に記憶しておく。
そして、制御部11は、隠れ面判定処理22(S204)において、参照位置が隠れ面と判定された場合には、対応する加工背景領域の画素値を、サンプリング点Xの画素値として割り当てる。
<Modification 3>
In Modification 3, a method of processing the two-dimensional image 2 so as not to cause a hidden surface before executing the flowchart shown in FIG. 4 will be described. The method of the third modification is effective for a two-dimensional image 2 of a scene where there is almost no overlap between subjects except for the background.
The control unit 11 extracts a background region from the two-dimensional image 2 and generates a processed background region having a pixel value at the pixel position of the entire two-dimensional image 2 by a texture generation technique. Then, the control unit 11 stores the pixel value of the corresponding processed background region in association with each pixel included in the subject region excluding the background in the two-dimensional image 2 in the storage unit 12 or the like.
Then, the control unit 11, the hidden surface determination process 22 (S204), if a reference position is determined to be hidden face, the pixel values of the corresponding processed background area is assigned as the pixel values of the sampling point X s.

図10は、2次元画像2の一例を示す図である。図10に示す例では、2次元画像2は、グレースケール画像であり、円形の物体(=淡いグレー)、長方形の物体(=濃いグレー)、及び格子状の背景(=白と黒)によって構成されている。   FIG. 10 is a diagram illustrating an example of the two-dimensional image 2. In the example illustrated in FIG. 10, the two-dimensional image 2 is a grayscale image, and is configured by a circular object (= light gray), a rectangular object (= dark gray), and a grid-like background (= white and black). Has been.

図11は、図10の2次元画像2についてのデプス画像4の一例を示す図である。図11に示す例では、デプス画像4は、0〜255の階調を有するグレースケール画像である。
図11に示すデプス画像4では、図10の円形の物体の奥行き値が階調「0」、格子状の背景の奥行き値が階調「255」、長方形の物体の奥行き値が階調「128」である。つまり、円形の物体が最も手前にあり、格子状の背景が最も奥にあることを示している。
説明を分かり易くする為、図11に示すデプス画像4では、被写体ごとに単一の奥行き値とした。一般の被写体であれば、各部ごとに奥行き値が異なることが多い。
FIG. 11 is a diagram illustrating an example of the depth image 4 for the two-dimensional image 2 of FIG. In the example illustrated in FIG. 11, the depth image 4 is a grayscale image having a gradation of 0 to 255.
In the depth image 4 shown in FIG. 11, the depth value of the circular object in FIG. 10 is gradation “0”, the depth value of the grid-like background is gradation “255”, and the depth value of the rectangular object is gradation “128”. Is. That is, the circular object is in the foreground and the lattice-shaped background is in the back.
For easy understanding, the depth image 4 shown in FIG. 11 has a single depth value for each subject. For general subjects, the depth value is often different for each part.

図12は、図10の2次元画像2についてのラベル画像3の一例を示す図である。図12に示す例では、ラベル画像3は、0〜255の階調を有するグレースケール画像である。
図12に示すラベル画像3は、例えば、図10の円形の物体のラベル値が階調「0」、格子状の背景のラベル値が階調「255」、長方形の物体のラベル値が階調「128」である。
説明を分かり易くする為、図11と図12は、全く同一の画像とした。前述したように、一般の被写体であれば、各部ごとに奥行き値が異なることが多く、デプス画像4とラベル画像3は、異なる画像となる。
FIG. 12 is a diagram illustrating an example of a label image 3 for the two-dimensional image 2 of FIG. In the example illustrated in FIG. 12, the label image 3 is a grayscale image having a gradation of 0 to 255.
In the label image 3 shown in FIG. 12, for example, the label value of the circular object in FIG. 10 is gradation “0”, the label value of the grid-like background is gradation “255”, and the label value of the rectangular object is gradation. It is “128”.
For ease of explanation, FIGS. 11 and 12 are the same images. As described above, in the case of a general subject, the depth value is often different for each part, and the depth image 4 and the label image 3 are different images.

本実施例では、図10に示す2次元画像2、図11に示すデプス画像4、図12に示すラベル画像3を入力画像として、視差画像6を生成した。   In this embodiment, the parallax image 6 is generated using the two-dimensional image 2 shown in FIG. 10, the depth image 4 shown in FIG. 11, and the label image 3 shown in FIG. 12 as input images.

図13は、視線が左方向からの視差画像6の一例を示す図である。図13に示す例では、カメラ位置が図3におけるカメラCやCの位置である。
視線が左方向からの視差画像6を生成する際は、円形の物体の左側の輪郭と背景との間や、長方形の物体の左側の輪郭と背景との間に、隠れ面が生じる。
図13に示す例では、隠れ面が適切な画素値によって補償され、違和感なく補正されている。
FIG. 13 is a diagram illustrating an example of the parallax image 6 when the line of sight is from the left direction. In the example shown in FIG. 13, the camera position is the position of the camera C 3 or C 4 in FIG.
When generating the parallax image 6 with the line of sight from the left direction, a hidden surface is generated between the left outline of the circular object and the background, or between the left outline and the background of the rectangular object.
In the example shown in FIG. 13, the hidden surface is compensated with an appropriate pixel value and corrected without a sense of incongruity.

図14は、視線が右方向からの視差画像6の一例を示す図である。図14に示す例では、カメラ位置が図3におけるカメラCやCの位置である。図13に示す例では、カメラ位置が図3におけるカメラCやCの位置であったことから、図13に示す隠れ面の領域よりも、図14に示す隠れ面の領域の方が大きくなっている。
視線が右方向からの視差画像6を生成する際は、円形の物体の右側の輪郭と背景との間や、長方形の物体の右側の輪郭と背景との間に、隠れ面が生じる。
図14に示す例では、長方形の物体の右側の輪郭と背景との間の隠れ面については、適切な画素値によって補償され、違和感なく補正されている。
一方、円形の物体の右側の輪郭と背景との間の隠れ面については、正しく補償されていない。これは、参照位置に現れるべき被写体(=背景)の階調変化が激しく、かつ、参照位置を隠していた被写体(=円形の物体)の輪郭が曲線なので、隠れ面の領域において円形の物体の輪郭に沿った筋状の線が出現してしまっている。この現象については、前述したように、変形例1によって回避することができる。
FIG. 14 is a diagram illustrating an example of the parallax image 6 when the line of sight is from the right direction. In the example shown in FIG. 14, the camera position is the position of the camera C 7 and C 8 in FIG. In the example shown in FIG. 13, since the camera position is the position of the camera C 3 or C 4 in FIG. 3, the hidden surface area shown in FIG. 14 is larger than the hidden surface area shown in FIG. It has become.
When generating the parallax image 6 with the line of sight from the right direction, a hidden surface is generated between the right outline of the circular object and the background, or between the right outline and the background of the rectangular object.
In the example illustrated in FIG. 14, the hidden surface between the right outline of the rectangular object and the background is compensated by an appropriate pixel value and corrected without a sense of incongruity.
On the other hand, the hidden surface between the right outline of the circular object and the background is not correctly compensated. This is because the gradation of the subject (= background) that should appear at the reference position is sharp, and the contour of the subject (= circular object) that has hidden the reference position is curved. A streak line along the contour has appeared. This phenomenon can be avoided by the first modification as described above.

以上、添付図面を参照しながら、本発明に係る視差画像生成装置等の好適な実施形態について説明したが、本発明はかかる例に限定されない。当業者であれば、本願で開示した技術的思想の範疇内において、各種の変更例又は修正例に想到し得ることは明らかであり、それらについても当然に本発明の技術的範囲に属するものと了解される。   The preferred embodiments of the parallax image generating device and the like according to the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to such examples. It will be apparent to those skilled in the art that various changes or modifications can be conceived within the scope of the technical idea disclosed in the present application, and these naturally belong to the technical scope of the present invention. Understood.

1………視差画像生成装置
2………2次元画像
3………ラベル画像
4………デプス画像
5………パラメータ
6………視差画像
DESCRIPTION OF SYMBOLS 1 ......... Parallax image generation apparatus 2 ......... 2D image 3 ......... Label image 4 ......... Depth image 5 ......... Parameter 6 ......... Parallax image

Claims (7)

立体視を実現するための視差画像を生成する視差画像生成装置であって、
所望の2次元画像、前記2次元画像に係るカメラから被写体までの奥行き値を画素値に置き換えた画像であるデプス画像、及び、前記2次元画像のシーンを構成する被写体を識別するラベル値を画素値に置き換えた画像であるラベル画像を入力する画像入力手段と、
カメラ数、カメラ間隔、及び、カメラからスクリーン面までの奥行き値から成るパラメータを入力するパラメータ入力手段と、
スクリーン面のサンプリング点と、前記パラメータに基づいて設定されるカメラ位置と、を通る視線直線を算出し、前記奥行き値同士の区間の中で前記視線直線が通る区間である通過区間のいずれか1つを採用区間とし、前記採用区間における第1方向側の奥行き値である第1奥行き値、及び、前記第1方向とは異なる第2方向側の奥行き値である第2奥行き値のうち、より奥を示す方の位置を参照位置とする参照位置特定手段と、
前記第1奥行き値及び前記第2奥行き値の位置にそれぞれ対応する前記ラベル画像の第1ラベル値及び第2ラベル値が異なる場合に、前記参照位置が隠れ面であると判定する隠れ面判定手段と、
前記隠れ面判定手段によって前記参照位置が隠れ面でないと判定された場合には、前記2次元画像における前記参照位置の画素値を前記サンプリング点の画素値とし、前記隠れ面判定手段によって前記参照位置が隠れ面であると判定された場合には、前記隠れ面判定手段による判定結果を、前記第1奥行き値及び前記第2奥行き値のうち、より奥側を示す方向である第1方向側又は第2方向側に参照して、隠れ面境界位置を特定し、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより、前記サンプリング点の画素値を補償する画素値である補償画素値を割り当てる画素値割り当て手段と、
を具備することを特徴とする視差画像生成装置。
A parallax image generation device that generates a parallax image for realizing stereoscopic vision,
A desired two-dimensional image, a depth image that is an image obtained by replacing the depth value from the camera to the subject related to the two-dimensional image with a pixel value, and a label value that identifies a subject constituting the scene of the two-dimensional image An image input means for inputting a label image which is an image replaced with a value;
Parameter input means for inputting parameters consisting of the number of cameras, the camera interval, and the depth value from the camera to the screen surface;
The sampling point of the screen surface, both before and camera position is set based on Kipa parameters, it calculates the line of sight line passing through a passage section which is the line of sight straight line passing through the section in the depth values between the interval One of the adopted sections is a first depth value that is a depth value on the first direction side in the adopted section, and a second depth value that is a depth value on the second direction side different from the first direction. , A reference position specifying means for setting the position indicating the back as a reference position;
Hidden surface determination means for determining that the reference position is a hidden surface when the first label value and the second label value of the label image respectively corresponding to the positions of the first depth value and the second depth value are different. When,
When the hidden surface determination unit determines that the reference position is not a hidden surface, the pixel value of the reference position in the two-dimensional image is set as the pixel value of the sampling point, and the reference position is determined by the hidden surface determination unit. Is determined to be a hidden surface, the determination result by the hidden surface determination means is the first direction side that is the direction indicating the far side of the first depth value and the second depth value, or A compensation pixel value that is a pixel value that compensates for the pixel value of the sampling point by referring to the second direction side, specifying a hidden surface boundary position, and returning a pixel value with the hidden surface boundary position as a return position A pixel value assigning means for assigning
A parallax image generating apparatus comprising:
前記画素値割り当て手段は、折り返しコピーされる画素位置のラベル値が、前記参照位置に現れるべき被写体のラベル値と一致するか否かを判定し、
一致する場合には、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより前記補償画素値を割り当てて、
一致しない場合には、前記参照位置に現れるべき被写体のラベル値と同一の一繋がりのサンプリング点群のなかで最も遠い点に係る参照位置の画素値を、前記補償画素値として割り当てることを特徴とする請求項1に記載の視差画像生成装置。
The pixel value allocating means determines whether or not a label value of a pixel position to be copied by copying matches a label value of a subject to appear at the reference position;
If they match, assign the compensation pixel value by folding copy of the pixel value with the hidden surface boundary position as the folding position,
If they do not match, the pixel value of the reference position relating to the farthest point in the same sampling point group that is the same as the label value of the subject that should appear at the reference position is assigned as the compensation pixel value. The parallax image generation device according to claim 1.
前記隠れ面判定手段は、前記参照位置が隠れ面である場合に、更に、前記第1奥行き値が前記第2奥行き値よりも奥側の値を示す場合には、前記視線直線が前記第1方向から手前の被写体と奥の被写体との間を通ることによって前記第1方向から覗き込んだ1方向隠れ面が生じていると判定し、又は、前記第2奥行き値が前記第1奥行き値よりも奥側の値を示す場合には、前記視線直線が前記第2方向から手前の被写体と奥の被写体との間を通ることによって前記第2方向から覗き込んだ第2方向隠れ面が生じていると判定することを特徴とする請求項1に記載の視差画像生成装置。 When the reference position is a hidden surface, and when the first depth value indicates a value on the back side with respect to the second depth value, the hidden surface determination unit determines that the line of sight line is the first line. It is determined that a first direction hidden surface viewed from the first direction is generated by passing between the front subject and the back subject from the direction, or the second depth value is the first depth value. When the value on the far side is shown, the second direction hidden surface viewed from the second direction is generated by passing the line of sight between the subject in the foreground and the subject in the back from the second direction. The parallax image generation device according to claim 1, wherein the parallax image generation device is determined. 前記画素値割り当て手段は、前記第1方向隠れ面の場合には、前記隠れ面判定手段による判定結果を前記第1方向に参照していくことによって隠れ面境界位置を特定し、又は、前記第2方向隠れ面の場合には、前記隠れ面判定手段による判定結果を前記第2方向に参照していくことによって隠れ面境界位置を特定し、前記隠れ面境界位置を基準として前記補償画素値を特定することを特徴とする請求項3に記載の視差画像生成装置。   In the case of the first direction hidden surface, the pixel value assigning unit specifies a hidden surface boundary position by referring to the determination result by the hidden surface determination unit in the first direction, or In the case of a two-way hidden surface, the hidden surface boundary position is specified by referring to the determination result by the hidden surface determination means in the second direction, and the compensation pixel value is determined based on the hidden surface boundary position. The parallax image generation device according to claim 3, wherein the parallax image generation device is specified. 立体視を実現するための視差画像を生成する視差画像生成方法であって、
所望の2次元画像、前記2次元画像に係るカメラから被写体までの奥行き値を画素値に置き換えた画像であるデプス画像、及び、前記2次元画像のシーンを構成する被写体を識別するラベル値を画素値に置き換えた画像であるラベル画像を入力する画像入力ステップと、
カメラ数、カメラ間隔、及び、カメラからスクリーン面までの奥行き値から成るパラメータを入力するパラメータ入力ステップと、
スクリーン面のサンプリング点と、前記パラメータに基づいて設定されるカメラ位置と、を通る視線直線を算出し、前記奥行き値同士の区間の中で前記視線直線が通る区間である通過区間のいずれか1つを採用区間とし、前記採用区間における第1方向側の奥行き値である第1奥行き値、及び、前記第1方向とは異なる第2方向側の奥行き値である第2奥行き値のうち、より奥を示す方の位置を参照位置とする参照位置特定ステップと、
前記第1奥行き値及び前記第2奥行き値の位置にそれぞれ対応する前記ラベル画像の第1ラベル値及び第2ラベル値が異なる場合に、前記参照位置が隠れ面であると判定する隠れ面判定ステップと、
前記隠れ面判定ステップによって前記参照位置が隠れ面でないと判定された場合には、前記2次元画像における前記参照位置の画素値を前記サンプリング点の画素値とし、前記隠れ面判定ステップによって前記参照位置が隠れ面であると判定された場合には、前記隠れ面判定ステップによる判定結果を、前記第1奥行き値及び前記第2奥行き値のうち、より奥側を示す方向である第1方向側又は第2方向側に参照して、隠れ面境界位置を特定し、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより、前記サンプリング点の画素値を補償する画素値である補償画素値を割り当てる画素値割り当てステップと、
を含むことを特徴とする視差画像生成方法。
A parallax image generation method for generating a parallax image for realizing stereoscopic vision,
A desired two-dimensional image, a depth image that is an image obtained by replacing the depth value from the camera to the subject related to the two-dimensional image with a pixel value, and a label value that identifies a subject constituting the scene of the two-dimensional image An image input step for inputting a label image which is an image replaced with a value;
A parameter input step for inputting parameters consisting of the number of cameras, the camera interval, and the depth value from the camera to the screen surface;
The sampling point of the screen surface, both before and camera position is set based on Kipa parameters, it calculates the line of sight line passing through a passage section which is the line of sight straight line passing through the section in the depth values between the interval One of the adopted sections is a first depth value that is a depth value on the first direction side in the adopted section, and a second depth value that is a depth value on the second direction side different from the first direction. , A reference position specifying step with the position indicating the back as a reference position;
A hidden surface determination step of determining that the reference position is a hidden surface when the first label value and the second label value of the label image corresponding to the positions of the first depth value and the second depth value are different. When,
When it is determined by the hidden surface determination step that the reference position is not a hidden surface, the pixel value of the reference position in the two-dimensional image is set as the pixel value of the sampling point, and the reference position is determined by the hidden surface determination step. Is determined to be a hidden surface, the determination result of the hidden surface determination step is a first direction side that is a direction indicating a deeper side of the first depth value and the second depth value, or A compensation pixel value that is a pixel value that compensates for the pixel value of the sampling point by referring to the second direction side, specifying a hidden surface boundary position, and returning a pixel value with the hidden surface boundary position as a return position A pixel value assigning step for assigning
A parallax image generating method characterized by comprising:
コンピュータを、
所望の2次元画像、前記2次元画像に係るカメラから被写体までの奥行き値を画素値に置き換えた画像であるデプス画像、及び、前記2次元画像のシーンを構成する被写体を識別するラベル値を画素値に置き換えた画像であるラベル画像を入力する画像入力手段と、
カメラ数、カメラ間隔、及び、カメラからスクリーン面までの奥行き値から成るパラメータを入力するパラメータ入力手段と、
スクリーン面のサンプリング点と、前記パラメータに基づいて設定されるカメラ位置と、を通る視線直線を算出し、前記奥行き値同士の区間の中で前記視線直線が通る区間である通過区間のいずれか1つを採用区間とし、前記採用区間における第1方向側の奥行き値である第1奥行き値、及び、前記第1方向とは異なる第2方向側の奥行き値である第2奥行き値のうち、より奥を示す方の位置を参照位置とする参照位置特定手段と、
前記第1奥行き値及び前記第2奥行き値の位置にそれぞれ対応する前記ラベル画像の第1ラベル値及び第2ラベル値が異なる場合に、前記参照位置が隠れ面であると判定する隠れ面判定手段と、
前記隠れ面判定手段によって前記参照位置が隠れ面でないと判定された場合には、前記2次元画像における前記参照位置の画素値を前記サンプリング点の画素値とし、前記隠れ面判定手段によって前記参照位置が隠れ面であると判定された場合には、前記隠れ面判定手段による判定結果を、前記第1奥行き値及び前記第2奥行き値のうち、より奥側を示す方向である第1方向側又は第2方向側に参照して、隠れ面境界位置を特定し、前記隠れ面境界位置を折り返し位置とした画素値の折り返しコピーにより、前記サンプリング点の画素値を補償する画素値である補償画素値を割り当てる画素値割り当て手段と、
して機能させるためのプログラム。
Computer
A desired two-dimensional image, a depth image that is an image obtained by replacing the depth value from the camera to the subject related to the two-dimensional image with a pixel value, and a label value that identifies a subject constituting the scene of the two-dimensional image An image input means for inputting a label image which is an image replaced with a value;
Parameter input means for inputting parameters consisting of the number of cameras, the camera interval, and the depth value from the camera to the screen surface;
The sampling point of the screen surface, both before and camera position is set based on Kipa parameters, it calculates the line of sight line passing through a passage section which is the line of sight straight line passing through the section in the depth values between the interval One of the adopted sections is a first depth value that is a depth value on the first direction side in the adopted section, and a second depth value that is a depth value on the second direction side different from the first direction. , A reference position specifying means for setting the position indicating the back as a reference position;
Hidden surface determination means for determining that the reference position is a hidden surface when the first label value and the second label value of the label image respectively corresponding to the positions of the first depth value and the second depth value are different. When,
When the hidden surface determination unit determines that the reference position is not a hidden surface, the pixel value of the reference position in the two-dimensional image is set as the pixel value of the sampling point, and the reference position is determined by the hidden surface determination unit. Is determined to be a hidden surface, the determination result by the hidden surface determination means is the first direction side that is the direction indicating the far side of the first depth value and the second depth value, or A compensation pixel value that is a pixel value that compensates for the pixel value of the sampling point by referring to the second direction side, specifying a hidden surface boundary position, and returning a pixel value with the hidden surface boundary position as a return position A pixel value assigning means for assigning
Program to make it function.
請求項6に記載のプログラムを記憶したコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 6.
JP2011055878A 2011-03-14 2011-03-14 Parallax image generation device, parallax image generation method, program, and storage medium Active JP5782761B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011055878A JP5782761B2 (en) 2011-03-14 2011-03-14 Parallax image generation device, parallax image generation method, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011055878A JP5782761B2 (en) 2011-03-14 2011-03-14 Parallax image generation device, parallax image generation method, program, and storage medium

Publications (2)

Publication Number Publication Date
JP2012195626A JP2012195626A (en) 2012-10-11
JP5782761B2 true JP5782761B2 (en) 2015-09-24

Family

ID=47087168

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011055878A Active JP5782761B2 (en) 2011-03-14 2011-03-14 Parallax image generation device, parallax image generation method, program, and storage medium

Country Status (1)

Country Link
JP (1) JP5782761B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06265322A (en) * 1993-03-11 1994-09-20 Canon Inc Method for detecting parallax error from a plurality of images
JP3769850B2 (en) * 1996-12-26 2006-04-26 松下電器産業株式会社 Intermediate viewpoint image generation method, parallax estimation method, and image transmission method
JP2001004370A (en) * 1999-06-23 2001-01-12 Fuji Photo Film Co Ltd Parallax image picking-up device, and method therefor parallax image processing device and method therefor
JP2001359119A (en) * 2000-06-15 2001-12-26 Toshiba Corp Stereoscopic video image generating method
JP2011044828A (en) * 2009-08-19 2011-03-03 Fujifilm Corp Stereoscopic image generator, stereoscopic image printing device, and stereoscopic image generation method
JP2012039331A (en) * 2010-08-06 2012-02-23 Dainippon Printing Co Ltd Parallax image creation device, parallax image creation method, program, and storage medium

Also Published As

Publication number Publication date
JP2012195626A (en) 2012-10-11

Similar Documents

Publication Publication Date Title
JP4966431B2 (en) Image processing device
JP4052331B2 (en) Virtual viewpoint image generation method, three-dimensional image display method and apparatus
CN102474644B (en) Stereo image display system, parallax conversion equipment, parallax conversion method
EP3735677A1 (en) Fusing, texturing, and rendering views of dynamic three-dimensional models
KR102492971B1 (en) Method and apparatus for generating a three dimensional image
US20090219383A1 (en) Image depth augmentation system and method
CN103426163A (en) System and method for rendering affected pixels
TW201921318A (en) Apparatus and method for generating a tiled three-dimensional image representation of a scene
KR20080047673A (en) Apparatus for transforming 3d image and the method therefor
JP7476511B2 (en) Image processing system, image processing method and program
JP6898264B2 (en) Synthesizers, methods and programs
JP5782761B2 (en) Parallax image generation device, parallax image generation method, program, and storage medium
JP5807569B2 (en) Image processing apparatus, image processing method, and image processing program
JP5906033B2 (en) Image processing apparatus, image processing method, and program
JP5565126B2 (en) Three-dimensional printed material production support device, plug-in program, three-dimensional printed material production method, and three-dimensional printed material
JP6235926B2 (en) Information processing apparatus, generation method, program, and recording medium
EP2249312A1 (en) Layered-depth generation of images for 3D multiview display devices
KR20220128406A (en) Multiview style transition system and method
JP2012039331A (en) Parallax image creation device, parallax image creation method, program, and storage medium
CN112106115A (en) Method of estimating light for augmented reality and electronic device thereof
JP2015103960A (en) Method, program and apparatus for specifying image depth
JP5966837B2 (en) Depth production support apparatus, depth production support method, and program
JP2014216719A (en) Image processing apparatus, stereoscopic image display device, image processing method and program
JP5887966B2 (en) Image processing apparatus, image processing method, and image processing program
EP4258221A2 (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140110

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140708

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140828

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141209

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150127

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150623

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150706

R150 Certificate of patent or registration of utility model

Ref document number: 5782761

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150