JP2010002273A - Image processing method - Google Patents

Image processing method Download PDF

Info

Publication number
JP2010002273A
JP2010002273A JP2008160687A JP2008160687A JP2010002273A JP 2010002273 A JP2010002273 A JP 2010002273A JP 2008160687 A JP2008160687 A JP 2008160687A JP 2008160687 A JP2008160687 A JP 2008160687A JP 2010002273 A JP2010002273 A JP 2010002273A
Authority
JP
Japan
Prior art keywords
reference point
distance
information
normal
dimensional image
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.)
Withdrawn
Application number
JP2008160687A
Other languages
Japanese (ja)
Inventor
Jun Hasegawa
純 長谷川
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2008160687A priority Critical patent/JP2010002273A/en
Publication of JP2010002273A publication Critical patent/JP2010002273A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing method can reduce the quantity of data on a three-dimensional image. <P>SOLUTION: This method includes a step S11 for finding a normal line direction concerning a reference point whose distance from a view point is known in a two-dimensional image, and a step S12 for finding a distance from the view point and a normal line direction on the basis of an illumination difference obtained by using the reference point as a reference concerning a non-reference point whose distance from the view point is unknown in the two-dimensional image. Three-dimensional image information of the two-dimensional image is represented by the two-dimensional image, the distance and the normal line direction at the reference point, and the distance and the normal line direction at the non-reference point. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

この発明は、画像処理方法に関するもので、例えば三次元立体画像に関する画像処理手法に関する。   The present invention relates to an image processing method, for example, an image processing method related to a three-dimensional stereoscopic image.

従来、三次元画像(三次元空間の画像であり、立体画像を意味する。以下同じ)を表現するためには、複数の画像、例えば視差に相当する距離にある2つの視点から得られた2枚の画像を用いている(例えば、特許文献1参照)。   Conventionally, in order to express a three-dimensional image (an image in a three-dimensional space, meaning a stereoscopic image; the same applies hereinafter), a plurality of images, for example, two obtained from two viewpoints at a distance corresponding to parallax. One image is used (for example, refer to Patent Document 1).

そして複数の二次元画像(二次元空間の画像であり、平面画像を意味する。以下同じ)を記憶し、立体画像を復元する際にはこの複数の二次元画像を使用する。その結果、三次元画像のデータ量が非常に大きくなるという問題があった。
特開2007−096951号公報
A plurality of two-dimensional images (a two-dimensional space image, which means a planar image; the same applies hereinafter) are stored, and the plurality of two-dimensional images are used when restoring a stereoscopic image. As a result, there is a problem that the data amount of the three-dimensional image becomes very large.
JP 2007-096951 A

この発明は、立体画像のデータ量を削減出来る画像処理方法を提供する。   The present invention provides an image processing method capable of reducing the data amount of a stereoscopic image.

この発明の一態様に係る画像処理方法は、二次元画像において、視点からの距離が既知である基準点につき、法線方向を求めるステップと、前記二次元画像において、視点からの距離が未知である非基準点につき、前記基準点を基準にした照度差に基づいて、視点からの距離及び法線方向を求めるステップとを具備し、前記二次元画像と、前記基準点における前記距離及び法線方向、並びに前記非基準点における前記距離及び法線方向とにより、該二次元画像の立体画像情報が表現される。   An image processing method according to an aspect of the present invention includes a step of obtaining a normal direction for a reference point whose distance from a viewpoint is known in a two-dimensional image, and the distance from the viewpoint is unknown in the two-dimensional image. Obtaining a distance from a viewpoint and a normal direction based on an illuminance difference with respect to the reference point for a non-reference point, the two-dimensional image, and the distance and normal at the reference point The stereoscopic image information of the two-dimensional image is represented by the direction and the distance and normal direction at the non-reference point.

この発明によれば、立体画像のデータ量を削減出来る画像処理方法を提供できる。   According to the present invention, it is possible to provide an image processing method capable of reducing the data amount of a stereoscopic image.

以下、この発明の実施形態を、図面を参照して説明する。この説明に際し、全図にわたり、共通する部分には共通する参照符号を付す。   Embodiments of the present invention will be described below with reference to the drawings. In the description, common parts are denoted by common reference symbols throughout the drawings.

[第1の実施形態]
この発明の第1の実施形態に係る画像処理方法について、図1を用いて説明する。図1は、本実施形態に係る画像処理方法のフローチャートであり、カメラにより撮影して得た二次元画像に立体情報を含める方法を示している。
[First Embodiment]
An image processing method according to the first embodiment of the present invention will be described with reference to FIG. FIG. 1 is a flowchart of an image processing method according to this embodiment, and shows a method of including stereoscopic information in a two-dimensional image obtained by photographing with a camera.

図示するように、まず二次元画像において基準点と非基準点とを決定する(ステップS10)。基準点とは、視点(カメラ)からの距離が既知である点のことであり、非基準点は距離が未知であるそれ以外の点のことである。また、基準点及び非基準点は、それぞれ二次元画像の各画素に対応しても良いし、または複数の画素の集合を単位とする領域に対応しても良い。以下では、各画素に対応する場合を例に説明する。   As shown in the figure, first, a reference point and a non-reference point are determined in the two-dimensional image (step S10). The reference point is a point whose distance from the viewpoint (camera) is known, and the non-reference point is another point whose distance is unknown. Further, the reference point and the non-reference point may correspond to each pixel of the two-dimensional image, or may correspond to an area having a set of a plurality of pixels as a unit. Hereinafter, a case corresponding to each pixel will be described as an example.

基準点を得るためには、距離が把握されなければならない。距離の把握は、合焦による測距、赤外線等を用いた測距、または複数の二次元画像を用いたステレオ対応点探索法やモーション推定により可能である。   To get a reference point, the distance must be known. The distance can be grasped by distance measurement by focusing, distance measurement using infrared rays, or the like, a stereo correspondence point search method using a plurality of two-dimensional images, or motion estimation.

そして、基準点の法線方向を求める(ステップS11)。基準点における物体の法線方向を求める。基準点の法線方向は、その周囲の近傍三点の基準点から求めることが出来る。すなわち、近傍三点の三次元座標を用いた外積演算により、法線方向を求めることが出来る。更には、照度差ステレオ法によって求めることも可能である。   Then, the normal direction of the reference point is obtained (step S11). The normal direction of the object at the reference point is obtained. The normal direction of the reference point can be obtained from three reference points in the vicinity. That is, the normal direction can be obtained by outer product calculation using the three-dimensional coordinates of the three neighboring points. Further, it can be obtained by the illuminance difference stereo method.

更に、非基準点の視点からの距離と法線方向とを求める(ステップS12)。本ステップで求められる非基準点の距離と法線方向の算出は、求めようとする非基準点と十分に位置が近接し、且つ求めようとする非基準点と同一の連続的な曲面または平面上にあると推定出来る基準点を元にして行われる。以下、非基準点の距離と法線方向の算出方法について、図2を用いて説明する。図2は、非基準点の距離及び法線方向の算出方法のフローチャートである。   Further, the distance from the viewpoint of the non-reference point and the normal direction are obtained (step S12). The calculation of the distance and normal direction of the non-reference point obtained in this step is a continuous curved surface or plane that is sufficiently close to the non-reference point to be obtained and is the same as the non-reference point to be obtained. This is done based on a reference point that can be estimated to be above. Hereinafter, a method for calculating the distance and normal direction of the non-reference point will be described with reference to FIG. FIG. 2 is a flowchart of a non-reference point distance and normal direction calculation method.

図示するように、基準点における法線方向と光源との角度差を照度差ステレオ法により求め、また非基準点における法線方向と光源との角度差を照度差ステレオ法により求める(ステップS20)。この時点では非基準点の法線方向は未知であるが、照度差ステレオ法によれば、法線方向と光源との角度差を算出することは可能である。そして、基準点と非基準点との間における、上記光源との角度差の差分は、基準点と非基準点との間における法線方向の角度差とみなすことが出来る(ステップS21)。従って、ステップS20で得られた角度差と、基準点または法線が既に推定された非基準点の法線方向とに基づいて、非基準点の法線方向を推定出来る(ステップS22)。引き続き、基準点と非基準点とが同一の曲面または平面上にあると仮定した場合の、曲率中心からの角度差を求める(ステップS23)。すると、ステップS23で求めた角度差に基づいて、非基準点の距離を求めることが出来る(ステップS24)。   As shown in the figure, the angle difference between the normal direction at the reference point and the light source is obtained by the illuminance difference stereo method, and the angle difference between the normal direction at the non-reference point and the light source is obtained by the illuminance difference stereo method (step S20). . At this time, the normal direction of the non-reference point is unknown, but according to the illuminance difference stereo method, it is possible to calculate the angle difference between the normal direction and the light source. The difference in angular difference between the reference point and the non-reference point with respect to the light source can be regarded as an angular difference in the normal direction between the reference point and the non-reference point (step S21). Accordingly, the normal direction of the non-reference point can be estimated based on the angle difference obtained in step S20 and the normal direction of the non-reference point whose reference point or normal has already been estimated (step S22). Subsequently, an angle difference from the center of curvature is calculated when it is assumed that the reference point and the non-reference point are on the same curved surface or plane (step S23). Then, the distance of the non-reference point can be obtained based on the angle difference obtained in step S23 (step S24).

以上の非基準点における視点からの距離及び法線方向の算出方法につき、具体例を用いて説明する。図3は、撮影対象となる物体と光源とを示す模式図である。図示するように、ある物体が円柱形状を有しており、それに対して光源Lから光が照射されている。なお、物体に対して光源Lの位置は無限遠と近似できるものとする。そして、カメラによって撮影される画像は、X方向とこれに直交するY方向とを含む二次元画像(XY平面)であり、その奥行き方向がZ方向である。   A method for calculating the distance from the viewpoint and the normal direction at the non-reference point will be described using a specific example. FIG. 3 is a schematic diagram showing an object to be imaged and a light source. As shown in the figure, an object has a cylindrical shape, and light is emitted from a light source L to the object. Note that the position of the light source L with respect to the object can be approximated to infinity. And the image image | photographed with a camera is a two-dimensional image (XY plane) containing X direction and the Y direction orthogonal to this, The depth direction is a Z direction.

図4は、図3におけるYZ平面を示し、特に円柱の表面と光源との関係について示す模式図である。上記ステップS20により、円柱表面におけるある基準点Qの法線方向(法線ベクトルn1の向き)と光源との角度差θ1と、円柱表面におけるある非基準点Pの法線方向(法線ベクトルn2の向き)と光源との角度差θ2とが、照度差ステレオ法によって求められる。角度差θ1は、光源Lと基準点Qとを結ぶ直線L1と、法線ベクトルn1の向きとの角度差である。また角度差θ2は、光源Lと非基準点Pとを結ぶ直線L2と、法線ベクトルn2の向きとの角度差である。基準点Qと非基準点Pとが十分に近接している場合には、相対的に光源Lは無限遠であると近似することが出来る。光源Lが無限遠であるとすれば、直線L1と直線L2とは平行であると見ることが出来る。そして、角度差θ1からの角度差θ2への変化量Δθ1(=θ2−θ1)が、法線ベクトルn2の向きの、法線ベクトルn1の向きに対する角度の変化とみなすことが出来る(ステップS21)。   FIG. 4 is a schematic diagram showing the YZ plane in FIG. 3 and particularly showing the relationship between the surface of the cylinder and the light source. By the above step S20, the angle difference θ1 between the normal direction of a certain reference point Q on the cylinder surface (the direction of the normal vector n1) and the light source, and the normal direction of the non-reference point P on the cylinder surface (normal vector n2) The angle difference θ2 between the light source and the light source is obtained by the illuminance difference stereo method. The angle difference θ1 is an angle difference between the straight line L1 connecting the light source L and the reference point Q and the direction of the normal vector n1. The angle difference θ2 is an angle difference between the straight line L2 connecting the light source L and the non-reference point P and the direction of the normal vector n2. When the reference point Q and the non-reference point P are sufficiently close, it can be approximated that the light source L is relatively infinite. If the light source L is at infinity, it can be seen that the straight line L1 and the straight line L2 are parallel. The amount of change Δθ1 (= θ2−θ1) from the angle difference θ1 to the angle difference θ2 can be regarded as a change in angle of the direction of the normal vector n2 with respect to the direction of the normal vector n1 (step S21). .

例えば光源が無限遠にあると仮定し、直立する円柱を考えると、基準点の上下方向にある非基準点の光源との角度(縦成分)は変化しないが、左右方向にある非基準点の光源との角度(横方向)は変化する。そして、その角度が法線の横方向の変化と推定出来る。斜め方向にある非基準点の場合には、縦成分と横成分の変化のベクトル和が、角度差として現れる。   For example, assuming that the light source is at infinity and considering an upright cylinder, the angle (vertical component) between the light source of the non-reference point in the vertical direction of the reference point does not change, but the non-reference point in the left-right direction does not change The angle (lateral direction) with the light source changes. The angle can be estimated as a change in the horizontal direction of the normal. In the case of a non-reference point in an oblique direction, the vector sum of changes in the vertical and horizontal components appears as an angular difference.

すると、法線ベクトルn1の向きは既知であるから、Δθ1に基づいて法線ベクトルn2の向きを求めることが出来る(ステップS22)。引き続き、基準点と非基準点の、曲率中心からの角度差Δθ2を求める(ステップS23)。この角度差Δθ2は、θ1及びθ2から求めることが出来る。   Then, since the direction of the normal vector n1 is known, the direction of the normal vector n2 can be obtained based on Δθ1 (step S22). Subsequently, an angle difference Δθ2 from the center of curvature between the reference point and the non-reference point is obtained (step S23). This angle difference Δθ2 can be obtained from θ1 and θ2.

次に、非基準点Pの視点からの距離を、上記角度差Δθ2から求める方法について、図5を用いて説明する。図5も図4と同様にYZ平面を示している。なお、基準点Qと非基準点Pとは、同一の連続的な曲面または平面上にあると推定出来、且つ十分に位置が近接していることを前提とする。図示するように、ステップS23で求めた角度差Δθ2は、円柱形状を有する物体の曲率中心Oからの、基準点Q及び非基準点Pまでの角度差である。すなわち、線分OPと線分OQとの角度に相当する。   Next, a method for obtaining the distance from the viewpoint of the non-reference point P from the angle difference Δθ2 will be described with reference to FIG. FIG. 5 also shows the YZ plane as in FIG. Note that it is assumed that the reference point Q and the non-reference point P can be estimated to be on the same continuous curved surface or plane and are sufficiently close in position. As shown in the figure, the angle difference Δθ2 obtained in step S23 is an angle difference from the center of curvature O of the cylindrical object to the reference point Q and the non-reference point P. That is, it corresponds to the angle between the line segment OP and the line segment OQ.

すると、基準点Qと非基準点Pとは同じ曲率半径であるので、基準点Qと非基準点Pとを結ぶ線分QPを考えると、∠OQPと∠OPQは等しい。これを角度αとする。また、非基準点Pを、XY平面に平行であって且つ基準点Qがある平面に正射影した点を点Rとし、曲率中心Oから基準点Qに達する直線を更に延長した点を点Sとすれば、基準点Qの法線の立体角が既知であるので、∠RQSの角度βも既知である。その結果、∠RQP=角度γ=π−(α+β)となる。   Then, since the reference point Q and the non-reference point P have the same radius of curvature, considering the line segment QP connecting the reference point Q and the non-reference point P, ∠OQP and ∠OPQ are equal. This is the angle α. A point obtained by orthogonally projecting the non-reference point P onto a plane parallel to the XY plane and having the reference point Q is defined as a point R, and a point obtained by further extending a straight line extending from the center of curvature O to the reference point Q is defined as a point S. Then, since the solid angle of the normal line of the reference point Q is known, the angle β of ∠RQS is also known. As a result, ∠RQP = angle γ = π− (α + β).

そして、線分RQは、点R、QのY座標の差として求められる。従って線分RPは、RP=RQ/tan γで求められる。つまり、基準点QのZ座標をz1、非基準点PのZ座標をz2とすれば、z2=z1+RPとなる。そして、非基準点PのZ座標の値z2が求まれば、その視点からの距離を容易に求めることが出来る(ステップS24)。なお、視点の位置はXYZ座標の原点と考えることが出来る。   The line segment RQ is obtained as the difference between the Y coordinates of the points R and Q. Therefore, the line segment RP is obtained by RP = RQ / tan γ. That is, if the Z coordinate of the reference point Q is z1, and the Z coordinate of the non-reference point P is z2, z2 = z1 + RP. Then, if the Z coordinate value z2 of the non-reference point P is obtained, the distance from the viewpoint can be easily obtained (step S24). The viewpoint position can be considered as the origin of the XYZ coordinates.

以上のようにして、基準点及び非基準点における視点からの距離と法線の方向とを求めて、立体画像を二次元画像、視点からの距離、及び法線方向により表現する(ステップS13)。そして、二次元画像、距離、及び法線方向を圧縮して、記憶装置に格納する(ステップS14)。距離及び法線方向は、二次元画像の画素、または画素の時間的範囲and/or空間的範囲の集合(以下、基本画素単位と呼ぶ)に対応づけられて、記憶装置に格納される。   As described above, the distance from the viewpoint and the direction of the normal line at the reference point and the non-reference point are obtained, and the stereoscopic image is represented by the two-dimensional image, the distance from the viewpoint, and the normal direction (step S13). . Then, the two-dimensional image, distance, and normal direction are compressed and stored in the storage device (step S14). The distance and the normal direction are stored in a storage device in association with a pixel of a two-dimensional image or a set of temporal ranges and / or spatial ranges of pixels (hereinafter referred to as basic pixel units).

<効果>
以上のように、この発明の第1の実施形態に係る画像処理方法であると、下記(1)、(2)の効果が得られる。
<Effect>
As described above, with the image processing method according to the first embodiment of the present invention, the following effects (1) and (2) can be obtained.

(1)立体画像についてのデータ量を削減出来る。
本実施形態に係る画像処理方法であると、二次元画像、距離情報、及び法線情報によって、三次元画像を表現している。すなわち、二次元画像に含まれる各物体の立体情報を直接使用している。従って、従来のように同一のシーンに対して異なる方向から撮影した複数枚の二次元画像を保持する必要が無く、立体画像についてのデータ量を削減出来る。また立体情報を直接使用することで、二次元画像に含まれる立体オブジェクトの取り扱いが容易となる。
(1) The amount of data about a stereoscopic image can be reduced.
In the image processing method according to this embodiment, a three-dimensional image is expressed by a two-dimensional image, distance information, and normal information. That is, the three-dimensional information of each object included in the two-dimensional image is directly used. Accordingly, there is no need to hold a plurality of two-dimensional images taken from different directions for the same scene as in the conventional case, and the data amount of the stereoscopic image can be reduced. Further, by directly using the three-dimensional information, it becomes easy to handle the three-dimensional object included in the two-dimensional image.

(2)テクスチャの乏しい面についても、容易に立体形状を把握出来る。
視点からの距離を測定する方法としては、合焦による測距、赤外線等を用いた測距、または複数の二次元画像を用いたステレオ対応点探索法等が一般的に知られている。しかし、テクスチャの乏しいオブジェクト(例えば同じ色で、模様が無く、また表面形状の変化が殆ど無い平面または曲面)では特徴点が殆ど存在しない。従って、ステレオ対応点探索法や、合焦による測距で距離を推定することは困難であり、推定出来たとしても精度が低くなりがちである。従って、このようなオブジェクトの距離を測定するためには、レーザや赤外線を用いて測距を行う必要がある。しかし、このような方法であると、装置が大規模化するという問題がある。
(2) A three-dimensional shape can be easily grasped even on a surface with poor texture.
As a method for measuring the distance from the viewpoint, a distance measurement by focusing, a distance measurement using infrared rays, or a stereo corresponding point search method using a plurality of two-dimensional images is generally known. However, an object with poor texture (for example, a plane or curved surface having the same color, no pattern, and almost no change in surface shape) has few feature points. Therefore, it is difficult to estimate the distance by a stereo correspondence point search method or distance measurement by focusing, and even if it can be estimated, the accuracy tends to be low. Therefore, in order to measure the distance of such an object, it is necessary to perform distance measurement using a laser or infrared rays. However, this method has a problem that the apparatus becomes large-scale.

しかし、本実施形態に係る方法であると、非基準点の視点からの距離及び法線方向を、照度差ステレオ法を用いて算出している。従って、テクスチャの乏しいオブジェクトの表面であっても、言い換えれば、模様や形状の変化に乏しい面であっても、その面における各点の距離及び法線を精度よく算出出来、容易に立体形状を把握出来る。   However, in the method according to the present embodiment, the distance from the viewpoint of the non-reference point and the normal direction are calculated using the illuminance difference stereo method. Therefore, even on the surface of an object with poor texture, in other words, even on a surface with poor pattern or shape change, the distance and normal of each point on the surface can be calculated with high accuracy, and the three-dimensional shape can be easily obtained. I can grasp.

すなわち、照度差ステレオ法を用いることで、テクスチャにかかわらず、例えば複数の点において照度差が一定であれば、それが平面であることが分かる。そして平面であれば、その平面にある点の法線と距離は同一であることが分かる。また、複数の点において照度差が一定に変化すれば、それが曲面であることが分かる。曲面であるから、法線方向も徐々に変化していく。そして、法線方向の変化によって、曲面の曲率を求めることが出来、その結果、曲面上のいずれかの基準点を基にして、非基準点の各点につき、視点からの距離を求めることが出来る。   That is, by using the illuminance difference stereo method, regardless of the texture, for example, if the illuminance difference is constant at a plurality of points, it can be seen that it is a plane. And if it is a plane, it turns out that the normal and distance of the point in the plane are the same. Further, if the difference in illuminance changes at a plurality of points, it is understood that it is a curved surface. Since it is a curved surface, the normal direction also changes gradually. Then, the curvature of the curved surface can be obtained by changing the normal direction, and as a result, the distance from the viewpoint can be obtained for each point of the non-reference point based on any reference point on the curved surface. I can do it.

図6は、本実施形態に係る距離測定方法を模式的に示す図であり、円柱形状の表面の距離を求める様子を示している。例えば、円柱と背景部分の境界の距離が、例えばステレオ対応点探索法等により推定出来たとする。すると、この点Qは基準点となる。基準点Qの法線ベクトルをn1とする。   FIG. 6 is a diagram schematically illustrating the distance measuring method according to the present embodiment, and illustrates how the distance of a cylindrical surface is obtained. For example, it is assumed that the distance between the boundary between the cylinder and the background portion can be estimated by, for example, a stereo correspondence point search method. Then, this point Q becomes a reference point. The normal vector of the reference point Q is n1.

すると、照度差ステレオ法によって、基準点Qに近い非基準点Pの法線ベクトルn2の向きが分かる。よって、法線ベクトルn1、n2から、非基準点Pの距離を求めることが出来る。次に非基準点Pに近い非基準点Rの距離を求める際には、非基準点Pを基にして求めることが出来る。つまり、非基準点Pの法線ベクトルn2と距離とを求められた結果、非基準点Pを基準点に組み入れることが出来る。非基準点Rの法線ベクトルn3は照度差ステレオ法により求めることが出来るから、距離が分かれば非基準点Rも基準点に組み入れることが出来る。同様にして、非基準点Sの距離は、非基準点Rを基にして求めることが出来る。   Then, the direction of the normal vector n2 of the non-reference point P close to the reference point Q is known by the illuminance difference stereo method. Therefore, the distance of the non-reference point P can be obtained from the normal vectors n1 and n2. Next, when the distance of the non-reference point R close to the non-reference point P is obtained, it can be obtained based on the non-reference point P. That is, as a result of obtaining the normal vector n2 and the distance of the non-reference point P, the non-reference point P can be incorporated into the reference point. Since the normal vector n3 of the non-reference point R can be obtained by the illuminance difference stereo method, if the distance is known, the non-reference point R can also be incorporated into the reference point. Similarly, the distance of the non-reference point S can be obtained based on the non-reference point R.

なお、上記方法により距離を求める点(非基準点)は、基準点が存在する曲面または平面と同一の連続的な曲面または平面上にあると推定出来、且つ基準点と十分に位置が近接している点である。同一の連続的な曲面または平面上にあるか否かについては、法線方向が同一であるか、または連続的に変化しているか、更にはエッジに囲まれた同じ特徴量の領域にあるか否か、等によって判断出来る。また位置が近接しているか否かについては、特徴量の近接度や、XY方向の位置から判断出来る。   Note that the point (non-reference point) for which the distance is obtained by the above method can be estimated to be on the same continuous curved surface or plane as the curved surface or plane on which the reference point exists, and the position is sufficiently close to the reference point. It is a point. Whether they are on the same continuous curved surface or plane, whether the normal direction is the same, is continuously changing, or is in the same feature region surrounded by edges It can be judged by whether or not. Whether or not the positions are close can be determined from the proximity of the feature amount and the position in the XY direction.

また、基準点が物体の頂点や稜線を構成している場合がある。このような場合には、頂点や稜線の近傍の点を基準点に用いて、非基準点の法線を求めることが望ましい。これは、頂点や稜線においては、法線が定義出来ないからである。更に、図4及び図5では直交座標系を用いる場合について説明したが、これは説明を容易にするためであって、その他の座標系であっても、座標変換を用いることで同様に計算可能である。   In some cases, the reference point constitutes a vertex or a ridgeline of the object. In such a case, it is desirable to obtain the normal of the non-reference point by using a point in the vicinity of the vertex or ridge line as the reference point. This is because normals cannot be defined for vertices and edges. Furthermore, in FIG. 4 and FIG. 5, the case where the orthogonal coordinate system is used has been described, but this is for ease of explanation, and even in other coordinate systems, the same calculation can be performed by using coordinate transformation. It is.

[第2の実施形態]
次に、この発明の第2の実施形態に係る画像処理方法について説明する。本実施形態は、上記第1の実施形態で説明したステップS14の詳細に関するものである。従って、その他のステップにおける処理は第1の実施形態で説明した通りであるので、その説明は省略する。
[Second Embodiment]
Next explained is an image processing method according to the second embodiment of the invention. The present embodiment relates to details of step S14 described in the first embodiment. Accordingly, the processing in the other steps is as described in the first embodiment, and the description thereof is omitted.

<距離情報の圧縮>
まず、距離情報の圧縮方法について図7を用いて説明する。図7は、距離情報の圧縮方法を示すフローチャートである。
<Compression of distance information>
First, the distance information compression method will be described with reference to FIG. FIG. 7 is a flowchart showing a distance information compression method.

視点からの距離が増大すれば、それに伴って視差も減少し、無限遠の位置では視差はゼロとなる。従って、距離を表現する距離情報も、距離の増大に従って精度が低下する。そこで、距離情報を、視点からの距離に従って情報量が少なくなるような手法により表現出来る。すなわち距離情報を、例えば非線形関数(これを以下、距離関数と呼ぶ、ステップS30)で表現する。距離関数としては、例えば対数関数類似や、指数関数の組み合わせが考え得る。その一例としては、距離をD(i,j)とすれば、距離情報をδ(i,j)=log(1/D(i,j))で表現することが出来る。なお(i,j)は、二次元画像(XY平面)内の座標を示す。そしてD(i,j)及びδ(i,j)は、i、jの関数である。   As the distance from the viewpoint increases, the parallax decreases accordingly, and the parallax becomes zero at a position at infinity. Therefore, the accuracy of the distance information expressing the distance decreases as the distance increases. Therefore, the distance information can be expressed by a method in which the amount of information decreases according to the distance from the viewpoint. That is, the distance information is expressed by, for example, a non-linear function (hereinafter referred to as a distance function, step S30). As the distance function, for example, a logarithmic function similarity or a combination of exponential functions can be considered. As an example, if the distance is D (i, j), the distance information can be expressed as δ (i, j) = log (1 / D (i, j)). Note that (i, j) indicates coordinates in the two-dimensional image (XY plane). D (i, j) and δ (i, j) are functions of i and j.

また、一定程度の遠距離になると、無限遠とほとんど区別がつかなくなる。従って、一定程度以上の距離の情報は無限遠とみなして、値を飽和させる距離関数を使用しても良い。更に、被写界深度より一定程度の近距離になると、画像の焦点が合わなくなり、距離の分解能が低下する。従って、被写界深度より一定程度の近距離については、一定値に値が飽和する距離関数としても良い。これらの無限遠とみなす距離や、被写界深度からの距離については、被写界深度や照度等、周囲の状況に合わせて変化させても良い。   Also, at a certain distance, it becomes almost indistinguishable from infinity. Therefore, it is also possible to use a distance function that saturates a value, assuming that distance information above a certain level is at infinity. Furthermore, when the distance is a certain distance from the depth of field, the image is not focused and the distance resolution is reduced. Therefore, for a short distance that is a certain degree from the depth of field, a distance function that saturates to a constant value may be used. The distance regarded as infinity and the distance from the depth of field may be changed according to the surrounding conditions such as the depth of field and illuminance.

ステップS30で圧縮処理を完了しても良いが、引き続き距離情報δ(i,j)を符号化しても良い(ステップS31)。符号化の一例は、例えば変換符号化等である。変換符号化を行う場合には、ステップS30で求めた距離情報δ(i,j)を、離散フーリエ変換や離散コサイン変換して係数群Fd(u,v)を得る。そして、分散の大きい係数に長い符号を割り当て、分散の小さい係数に短い符号を割り当てる。言い換えれば、出現頻度の低い係数に長い符号を割り当て、出現頻度の高い符号に短い符号を割り当てる。通常、低周波成分の分散が大きく、高周波成分の分散が小さいので、低周波成分の係数に長い符号を割り当て、高周波成分の係数に短い符号を割り当てることとなる。このように係数毎に適切な符号長を定めて割り当てることで、変換符号化された距離情報Fds(u,v)が得られる。   Although the compression process may be completed in step S30, the distance information δ (i, j) may be continuously encoded (step S31). An example of encoding is transform encoding, for example. When transform coding is performed, the distance information δ (i, j) obtained in step S30 is subjected to discrete Fourier transform or discrete cosine transform to obtain a coefficient group Fd (u, v). A long code is assigned to a coefficient having a large variance, and a short code is assigned to a coefficient having a small variance. In other words, a long code is assigned to a coefficient having a low appearance frequency, and a short code is assigned to a code having a high appearance frequency. Usually, since the dispersion of the low frequency component is large and the dispersion of the high frequency component is small, a long code is assigned to the coefficient of the low frequency component and a short code is assigned to the coefficient of the high frequency component. Thus, by determining and assigning an appropriate code length for each coefficient, transform-coded distance information Fds (u, v) can be obtained.

勿論、ステップS30での符号化は変換符号化に限られるものでは無く、種々の手法を用いることが出来る。そして符号化の際には、距離関数と同様に視覚特性や被写界深度に応じて、割り当てる符号長を変えても良い(ステップS32)。すなわち、被写界深度内では分解能が高いため、割り当てる符号長を大きくする。また、距離が増大するに従って、割り当てる符号を少なくしても良い。または、距離や被写界深度に応じて、距離関数や符号長の組み合わせを選択し、被写界深度内について多くの符号を割り当てるようにしても良い。   Of course, the encoding in step S30 is not limited to transform encoding, and various methods can be used. At the time of encoding, the allocated code length may be changed according to the visual characteristics and the depth of field in the same manner as the distance function (step S32). That is, since the resolution is high within the depth of field, the assigned code length is increased. Further, the code to be assigned may be reduced as the distance increases. Alternatively, a combination of a distance function and a code length may be selected according to the distance and the depth of field, and many codes may be assigned within the depth of field.

<法線情報の圧縮>
次に、法線情報の圧縮方法について図8を用いて説明する。図8は、法線情報の圧縮方法を示すフローチャートである。
<Compression of normal information>
Next, a normal information compression method will be described with reference to FIG. FIG. 8 is a flowchart showing a normal information compression method.

まず、法線情報を例えば極座標(r、θ、φ)で表現する(ステップS40)。但し、rは法線の長さであり、θは法線の極角であり、φは法線の方位角である。このように、極座標を用いることで角度と長さが分離され、情報の扱い方が容易となる。なお、法線情報は、法線の長さ情報を省いて(θ、φ)で表現しても良い。また、法線の長さ情報については、長さr(i,j)の代わりに、ステップS30で説明した距離関数δ(i,j)を用いて表現しても良い。そして、二次元画像上の点(i,j)に対応した法線情報は、i、jの関数f(i,j)として表すことが出来る。   First, normal information is expressed by, for example, polar coordinates (r, θ, φ) (step S40). Where r is the length of the normal, θ is the polar angle of the normal, and φ is the azimuth of the normal. In this way, using polar coordinates separates the angle and length, making it easier to handle information. The normal information may be expressed by (θ, φ) without the normal length information. The normal length information may be expressed using the distance function δ (i, j) described in step S30 instead of the length r (i, j). The normal information corresponding to the point (i, j) on the two-dimensional image can be expressed as a function f (i, j) of i and j.

ステップS40で圧縮処理を完了しても良いが、引き続き法線情報f(i,j)を符号化しても良い(ステップS41)。符号化の一例は、例えばエントロピー符号化、変換符号化、またはベクトル量子化等である。これらの符号化について、以下説明する。勿論、法線情報の符号化手法は、これらに限定されるものでは無い。   Although the compression process may be completed in step S40, the normal vector information f (i, j) may be continuously encoded (step S41). An example of encoding is entropy encoding, transform encoding, vector quantization, or the like. These encodings will be described below. Of course, the encoding method of normal line information is not limited to these.

<<エントロピー符号化>>
まずエントロピー符号化について説明する。エントロピー符号化は、符号化の際に法線情報をエントロピーの小さい他のシンボルに変換するものである。
<< Entropy coding >>
First, entropy coding will be described. Entropy coding converts normal information into another symbol with low entropy at the time of coding.

すなわち、注目する法線情報f(i,j)と、これに隣接する法線情報f(i-1,j)との差分d(i,j)を考える。つまり、d(i,j)=f(i,j)−f(i-1,j)である。この際の演算は、ステップS40で得た(r、θ、φ)、または法線の長さにつき距離関数を用いた(δ、θ、φ)についての三次元演算、または長さ情報を省いた(θ、φ)についての二次元演算である。更に、角度情報θ、φについての演算は、2π周期での演算となる。   That is, consider the difference d (i, j) between the normal information f (i, j) of interest and the normal information f (i−1, j) adjacent thereto. That is, d (i, j) = f (i, j) −f (i−1, j). The calculation at this time is a three-dimensional calculation for (r, θ, φ) obtained in step S40, or (δ, θ, φ) using a distance function for the length of the normal, or length information is omitted. This is a two-dimensional calculation for (θ, φ). Furthermore, the calculation for the angle information θ and φ is performed in a 2π cycle.

エントロピー符号化された法線情報は、d(i,j)と、既に復号化されたf(i-1,j)を基にして復号出来る。すなわち、f(i,j)=f(i-1,j)+d(i,j)の計算を行うことで、法線情報f(i,j)を復号出来る。   The entropy-coded normal line information can be decoded based on d (i, j) and already decoded f (i-1, j). That is, normal information f (i, j) can be decoded by calculating f (i, j) = f (i−1, j) + d (i, j).

エントロピー符号化によれば、隣接した法線情報との差分のみを記憶すれば良く、情報を圧縮出来る。なお、動画の場合には、フレーム間で同様の符号化が可能である。すなわち、時間的に連続する2枚の二次元画像(フレーム)間におけるf(i,j)の差分を求め、これを記憶させても良い。例えば、時刻t1における法線情報がf(i,j,t1)であり、時刻t1に連続する時刻t2における法線情報がf(i,j,t2)であったとする。この場合、両者の差分d(i,j)=f(i,j,t1)−f(i,j,t2)を求めることで、法線情報を圧縮する。復号化する場合には、f(i,j,t2)=f(i,j,t1)−d(i,j)なる計算を行えば良い。   According to entropy coding, only the difference from adjacent normal line information needs to be stored, and the information can be compressed. In the case of a moving image, the same encoding can be performed between frames. That is, the difference of f (i, j) between two temporally continuous two-dimensional images (frames) may be obtained and stored. For example, it is assumed that the normal information at time t1 is f (i, j, t1), and the normal information at time t2 subsequent to time t1 is f (i, j, t2). In this case, the normal information is compressed by obtaining the difference d (i, j) = f (i, j, t1) −f (i, j, t2). In the case of decoding, a calculation of f (i, j, t2) = f (i, j, t1) −d (i, j) may be performed.

<<変換符号化>>
次に変換符号化について説明する。変換符号化は、上記した距離情報の場合と同様である。すなわち、ステップS40で得たf(i,j)につき、離散フーリエ変換または離散コサイン変換等を行い、係数群Fn(u,v)を得る。そして、距離情報の場合と同様に、出現頻度の高い係数に短い符号を割り当て、出現頻度の低い係数に長い符号を割り当てることで、法線情報Fns(u,v)を得る。
<< Transform coding >>
Next, transform coding will be described. Transform coding is the same as in the case of the distance information described above. That is, discrete Fourier transform or discrete cosine transform is performed on f (i, j) obtained in step S40 to obtain a coefficient group Fn (u, v). Then, as in the case of distance information, normal information Fns (u, v) is obtained by assigning a short code to a coefficient having a high appearance frequency and assigning a long code to a coefficient having a low appearance frequency.

復号化する際には、符号の割り当て方に基づいて、Fns(u,v)からFn(u,v)を求め、更にこれを逆変換符号化すれば良い。その結果、f(i,j)が得られる。   In decoding, Fn (u, v) is obtained from Fns (u, v) based on the code allocation method, and this is further subjected to inverse transform coding. As a result, f (i, j) is obtained.

<<ベクトル量子化>>
次に、ベクトル量子化について説明する。ベクトル量子化では、個々の法線情報毎に符号化を行うのではなく、複数の法線の集まりを、法線情報を要素とするベクトルで表現し、符号化する。ベクトル量子化の方法について、図9を用いて説明する。図9は、ベクトル量子化の処理の流れを示すフローチャートである。
<< Vector quantization >>
Next, vector quantization will be described. In vector quantization, encoding is not performed for each piece of normal information, but a collection of a plurality of normals is expressed by a vector having normal information as an element and encoded. A vector quantization method will be described with reference to FIG. FIG. 9 is a flowchart showing the flow of vector quantization processing.

図示するように、まず法線情報を部分空間に分割する(ステップS50)。すなわち、二次元画像を、複数の法線情報の集合である複数の部分空間(ブロック)に分割する。部分空間は、複数の画素の集合と言い換えることも出来る。そして、各ブロックにおける法線情報の平均値(平均ベクトル)を求める(ステップS51)。次に各部分空間において、各画素単位の法線情報と、ステップS51で求めた平均値との差分を表す差分ベクトルを求める(ステップS52)。引き続き、予め容易されたコードブックのなかから、ステップS52で求めた差分ベクトルに最も類似した代表ベクトルを抽出する(ステップS53)。コードブックには複数の代表ベクトルが蓄えられている。そして、コードブックの何番目の代表ベクトルであるかという情報であるインデックスが、符号となる。そして、ステップS51で求めた平均ベクトルと、ステップS53で抽出したインデックスとを、二次元画像の法線情報として出力する(ステップS53)。   As shown in the figure, first, normal information is divided into partial spaces (step S50). That is, the two-dimensional image is divided into a plurality of partial spaces (blocks) that are a set of a plurality of normal line information. The subspace can be rephrased as a set of a plurality of pixels. Then, an average value (average vector) of normal line information in each block is obtained (step S51). Next, in each partial space, a difference vector representing the difference between the normal information of each pixel unit and the average value obtained in step S51 is obtained (step S52). Subsequently, a representative vector that is most similar to the difference vector obtained in step S52 is extracted from a previously facilitated codebook (step S53). A code book stores a plurality of representative vectors. Then, an index that is information indicating what number representative vector of the code book is a code. And the average vector calculated | required by step S51 and the index extracted by step S53 are output as normal-line information of a two-dimensional image (step S53).

以上の具体例を、図10を用いて説明する。図10は、(4×4)画素を有する二次元画像について、法線情報をベクトル量子化する手順を順次示す模式図である。   A specific example of the above will be described with reference to FIG. FIG. 10 is a schematic diagram sequentially illustrating a procedure for vector quantization of normal information for a two-dimensional image having (4 × 4) pixels.

図示するように、まず(4×4)画素の二次元画像に含まれる16個の画素を、それぞれ画素P0〜P15と呼ぶ。また、各画素における法線情報を、それぞれ法線情報f0〜f15と呼ぶ。そして、この二次元画像を(2×2)画素を含む4つの部分空間BLK0〜BLK3に分割する。部分空間BLK0には画素P0〜P3が含まれ、部分空間BLK1には画素P4〜P7が含まれ、部分空間BLK2には画素P8〜P11が含まれ、部分空間BLK3には画素P12〜P15が含まれる。   As shown in the drawing, first, 16 pixels included in the two-dimensional image of (4 × 4) pixels are referred to as pixels P0 to P15, respectively. Further, the normal line information in each pixel is referred to as normal line information f0 to f15, respectively. Then, the two-dimensional image is divided into four partial spaces BLK0 to BLK3 including (2 × 2) pixels. The partial space BLK0 includes pixels P0 to P3, the partial space BLK1 includes pixels P4 to P7, the partial space BLK2 includes pixels P8 to P11, and the partial space BLK3 includes pixels P12 to P15. It is.

次に、各部分空間BLK0〜BLK3における平均ベクトルfave0〜fave3を求める。平均ベクトルfave0は法線情報f0〜f3の平均値であり、平均ベクトルfave1は法線情報f4〜f7の平均値であり、平均ベクトルfave2は法線情報f8〜f11の平均値であり、平均ベクトルfave3は法線情報f12〜f15の平均値である。平均ベクトルfave0〜fave3からなる画像を平均値画像と呼ぶ。   Next, average vectors fave0 to fave3 in the partial spaces BLK0 to BLK3 are obtained. The average vector fave0 is the average value of the normal information f0 to f3, the average vector fave1 is the average value of the normal information f4 to f7, the average vector fave2 is the average value of the normal information f8 to f11, and the average vector fave3 is an average value of the normal line information f12 to f15. An image composed of the average vectors fave0 to fave3 is called an average value image.

次に、各部分空間BLK0〜BLK3において、平均ベクトルfave0〜fave3と、各画素の法線情報との差分ベクトルd0〜d15を求める。すなわち、d0=fave0−f0であり、d1=fave0−f1であり、d2=fave0−f2であり、d3=fave0−f3である。また、d4=fave1−f4であり、d5=fave1−f5であり、d6=fave1−f6であり、d7=fave1−f7である。更に、d8=fave2−f8であり、d9=fave2−f9であり、d10=fave2−f10であり、d11=fave2−f11である。更に、d12=fave3−f12であり、d13=fave3−f13であり、d14=fave3−f14であり、d15=fave3−f15である。差分ベクトルd0〜d15からなる画像を差分画像と呼ぶ。   Next, in each of the partial spaces BLK0 to BLK3, difference vectors d0 to d15 between the average vectors fave0 to fave3 and the normal line information of each pixel are obtained. That is, d0 = fave0-f0, d1 = fave0-f1, d2 = fave0-f2, and d3 = fave0-f3. Further, d4 = fave1-f4, d5 = fave1-f5, d6 = fave1-f6, and d7 = fave1-f7. Furthermore, d8 = fave2-f8, d9 = fave2-f9, d10 = fave2-f10, and d11 = fave2-f11. Furthermore, d12 = fave3-f12, d13 = fave3-f13, d14 = fave3-f14, and d15 = fave3-f15. An image composed of the difference vectors d0 to d15 is called a difference image.

次に、コードブックを参照する。コードブックには、代表となる差分ベクトル(代表ベクトル)が例えば8個含まれており、それぞれにインデックス0〜7が割り当てられている。各代表ベクトルは、例えば4つの差分ベクトルが含まれる。これは、部分空間BLK0〜BLK3の各々が4つの法線情報を含むからである。   Next, reference is made to the code book. The code book includes, for example, eight differential vectors (representative vectors) as representatives, and indexes 0 to 7 are assigned to each. Each representative vector includes, for example, four difference vectors. This is because each of the partial spaces BLK0 to BLK3 includes four pieces of normal information.

そして、差分画像を得るために最適な代表ベクトルを、各部分空間毎にコードブックから選択する。図9の例では、ブロックBLK0〜BLK3に最適な代表ベクトルは、それぞれインデックス0、2、4、6である。   Then, the optimum representative vector for obtaining the difference image is selected from the code book for each partial space. In the example of FIG. 9, the optimum representative vectors for the blocks BLK0 to BLK3 are the indexes 0, 2, 4, and 6, respectively.

以上のようにして求めた平均値画像とインデックス0、2、4、6が、ベクトル量子化による符号として出力される。   The average value image and indexes 0, 2, 4, and 6 obtained as described above are output as codes by vector quantization.

復号化は、平均値画像とインデックスとを用いて行われる。すなわち、まずインデックスを用いてコードブックを参照し、部分空間毎に代表ベクトルを抽出する。次に、代表ベクトルを差分ベクトルとして、平均値画像に含まれる平均ベクトルあら、部分空間の法線情報を算出する。そして、部分空間の法線情報から、二次元画像全体の法線情報を統合する。   Decoding is performed using the average image and the index. That is, first, a code book is referenced using an index, and a representative vector is extracted for each partial space. Next, using the representative vector as a difference vector, the normal vector information of the subspace is calculated from the average vector included in the average image. Then, the normal information of the entire two-dimensional image is integrated from the normal information of the partial space.

図10の例であると、インデックスとして0、2、4、6が与えられるので、コードブックからこれらのインデックスに相当する代表ベクトルを抽出する。そして、各代表ベクトルと平均ベクトルfave0〜fave3とを加算して、法線情報f0〜f15を得る。すなわち、部分空間BLK0においては、平均ベクトルfave0と差分ベクトルd0〜d3とをそれぞれ加算し、法線情報f0〜f3を得る。部分空間BLK1においては、平均ベクトルfave1と差分ベクトルd4〜d7とをそれぞれ加算し、法線情報f4〜f7を得る。部分空間BLK2、BLK3も同様である。そして、得られた法線情報f0〜f15を統合すれば、(4×4)画素の二次元画像全体の法線情報が得られる。   In the example of FIG. 10, 0, 2, 4, and 6 are given as indexes, so representative vectors corresponding to these indexes are extracted from the codebook. Then, each representative vector and the average vectors fave0 to fave3 are added to obtain normal information f0 to f15. That is, in the partial space BLK0, the average vector fave0 and the difference vectors d0 to d3 are added to obtain normal line information f0 to f3. In the partial space BLK1, the average vector fave1 and the difference vectors d4 to d7 are added to obtain normal line information f4 to f7. The same applies to the partial spaces BLK2 and BLK3. Then, by integrating the obtained normal line information f0 to f15, normal line information of the whole (4 × 4) pixel two-dimensional image can be obtained.

<三次元オブジェクトの抽出>
なお、符号化の際には、単に各画素における距離情報及び法線情報を符号化するのみならず、被写体から対象物となる立体オブジェクトを把握、抽出し、これを二次元画像に対応させて符号化しても良い。
<Extraction of 3D objects>
At the time of encoding, not only the distance information and normal line information at each pixel is encoded, but also a solid object as an object is grasped and extracted from the subject, and this is associated with the two-dimensional image. It may be encoded.

<<平面オブジェクトの抽出>>
まず始めに、平面オブジェクトの抽出方法について、図11及び図12を用いて説明する。図11は抽出方法を示すフローチャートであり、図12は直方体オブジェクトを示す模式図である。
<< Plain object extraction >>
First, a planar object extraction method will be described with reference to FIGS. 11 and 12. FIG. 11 is a flowchart showing an extraction method, and FIG. 12 is a schematic diagram showing a rectangular parallelepiped object.

まず、二次元画像内において法線方向が類似している領域を抽出する(ステップS60)。例えば図12の例であると、直方体の正面の平面F1(図12において斜線を付した領域)では、全ての点で法線は正面を向いている。従って面F1は、法線方向が類似した領域として抽出される。これにより、この面F1の形状を示す境界情報が得られる。すなわち図12の場合、他の2つの面F2、F3と接する2つの辺と、背景と接する2つの辺とが、境界情報として得られる。境界情報は、例えば二次元画像における座標で表現される。   First, a region having a similar normal direction in the two-dimensional image is extracted (step S60). For example, in the example of FIG. 12, in the plane F1 in front of the rectangular parallelepiped (the hatched area in FIG. 12), the normals face the front at all points. Accordingly, the surface F1 is extracted as a region having a similar normal direction. Thereby, boundary information indicating the shape of the surface F1 is obtained. That is, in the case of FIG. 12, two sides in contact with the other two surfaces F2 and F3 and two sides in contact with the background are obtained as boundary information. The boundary information is expressed by coordinates in a two-dimensional image, for example.

次に、ステップS60で抽出した面における代表点の位置と法線情報とを選択する(ステップS61)。図12の例では、例えば面F1に含まれる点のいずれかを代表点として選択する。代表点は特徴のある点であることが望ましい。そして、この代表点位置と代表点における法線情報(これらを代表点情報と呼ぶ)とにより、この面F1を表現する。   Next, the position of the representative point and the normal information on the surface extracted in step S60 are selected (step S61). In the example of FIG. 12, for example, one of the points included in the surface F1 is selected as the representative point. The representative point is preferably a characteristic point. The plane F1 is expressed by the representative point position and the normal information at the representative point (these are referred to as representative point information).

二次元画像を記憶させる際には、ステップS60で抽出した領域の画像情報と視点の位置(撮影位置)とを、ステップS60、S61で得た境界情報及び代表点情報とに関連付ける(ステップS62)。なお、図12では面F1を抽出する場合を例に説明したが、面F2、F3を抽出する場合も同様である。   When storing a two-dimensional image, the image information of the region extracted in step S60 and the viewpoint position (shooting position) are associated with the boundary information and representative point information obtained in steps S60 and S61 (step S62). . In FIG. 12, the case where the surface F1 is extracted has been described as an example, but the same applies to the case where the surfaces F2 and F3 are extracted.

<<曲面オブジェクトの抽出>>
次に、曲面オブジェクトの抽出方法について、図13及び図14を用いて説明する。図13は抽出方法を示すフローチャートであり、図14は半円筒オブジェクトを示す模式図である。
<< Extraction of curved surface object >>
Next, a method for extracting a curved object will be described with reference to FIGS. FIG. 13 is a flowchart showing an extraction method, and FIG. 14 is a schematic diagram showing a semi-cylindrical object.

まず、二次元画像内において曲率半径が類似し、且つ曲率中心が連続的な曲線または点となる領域を抽出する(ステップS70)。図14の例であると、半円筒の正面の曲面は、曲率中心が連続的な直線L1であって、且つ曲率半径rが等しい。従って、曲面F4が抽出され、曲面F4の形状を示す境界情報が得られる。すなわち図14の場合、半円筒の上面F5と接する1つの辺と、背景と接するが3つの辺とが、境界情報として得られる。   First, a region in which the radius of curvature is similar in the two-dimensional image and the center of curvature is a continuous curve or point is extracted (step S70). In the example of FIG. 14, the curved surface in front of the semi-cylindrical is a straight line L1 having a continuous center of curvature and the same radius of curvature r. Accordingly, the curved surface F4 is extracted, and boundary information indicating the shape of the curved surface F4 is obtained. That is, in the case of FIG. 14, one side in contact with the upper surface F5 of the half cylinder and three sides in contact with the background are obtained as boundary information.

次に、ステップS70で抽出した面の曲率中心がなす曲線と曲率半径とを記憶する(ステップS71)。図14の例では、曲率中心の直線L1がなす曲線(または点)と、曲率半径rとが記憶される。曲率半径は、曲線上にある2つの点の距離と法線の角度差から求まり、曲率中心は2点の座標と曲率半径から、曲率円の連立方程式を解くことで求まる。こうして得られた曲線と曲率半径(これらを曲面情報と呼ぶ)とにより、曲面F4が表現される。   Next, the curve formed by the curvature center of the surface extracted in step S70 and the curvature radius are stored (step S71). In the example of FIG. 14, the curve (or point) formed by the straight line L1 at the center of curvature and the radius of curvature r are stored. The radius of curvature is obtained from the distance between two points on the curve and the angle difference between the normals, and the center of curvature is obtained by solving simultaneous equations of curvature circles from the coordinates of the two points and the radius of curvature. The curved surface F4 is expressed by the curve and the radius of curvature (these are called curved surface information) thus obtained.

二次元画像を記憶させる際には、ステップS70で抽出した領域の画像情報と視点の位置(撮影位置)とを、ステップS70、S71で得た境界情報及び曲面情報とに関連付ける(ステップS72)。なお、図14における上面F5は、図11及び図12で説明した方法により抽出出来る。   When storing the two-dimensional image, the image information of the region extracted in step S70 and the viewpoint position (shooting position) are associated with the boundary information and curved surface information obtained in steps S70 and S71 (step S72). Note that the upper surface F5 in FIG. 14 can be extracted by the method described with reference to FIGS.

<効果>
以上のように、この発明の第2の実施形態に係る画像処理方法であると、上記第1の実施形態で説明した(1)、(2)の効果に加えて、下記(3)の効果が得られる。
<Effect>
As described above, the image processing method according to the second embodiment of the present invention has the following effect (3) in addition to the effects (1) and (2) described in the first embodiment. Is obtained.

(3)立体画像についてのデータ量を更に削減出来る。
本実施形態に係る方法であると、距離情報及び法線情報を、種々の手法により圧縮している。従って、三次元画像情報のデータ量をより削減出来る。また、三次元オブジェクトを抽出することで、動画の場合、背景画像は一度記録すれば改めて記録する必要が無く、面積の小さい三次元オブジェクト(対象物体)のみを記憶すれば良く、高い圧縮率が得られる。
(3) The amount of data about the stereoscopic image can be further reduced.
In the method according to the present embodiment, distance information and normal information are compressed by various methods. Therefore, the data amount of the 3D image information can be further reduced. In addition, by extracting a three-dimensional object, in the case of a moving image, once the background image is recorded, it is not necessary to record it again. Only a three-dimensional object (target object) with a small area needs to be stored, and a high compression rate can get.

なお、符号化は上記の手法に限られるものでは無い。例えば、距離感に応じて距離情報に階調(距離情報についての1階調の範囲)に差異を設けても良い。すなわち、例えば二次元画像における背景は非常に遠距離であることが通常であり、その距離は人間の目では良く分からないことが多い。従って、このような領域については階調を粗くする。逆に、近景は人間にとって距離感をつかみやすい。従って、このような領域については階調を細かくする。このように、距離情報の階調に、距離別に差をつけることによっても、全体の情報量を圧縮出来る。   Note that encoding is not limited to the above method. For example, the distance information may be provided with a difference in gradation (range of one gradation for the distance information) according to the sense of distance. That is, for example, the background in a two-dimensional image is usually a very long distance, and the distance is often not well understood by human eyes. Therefore, the gradation is roughened in such a region. Conversely, a close-up view is easy for humans to grasp the sense of distance. Therefore, the gradation is made finer in such a region. Thus, the total amount of information can also be compressed by making a difference for each distance in the gradation of distance information.

また、三次元オブジェクトを抽出する際、距離の差異に着目しても良い。すなわち、距離の変化が大きい点が、オブジェクトの境界であるとみなす。または距離が不連続である点が境界であり、連続していれば面であるとみなす。これにより、三次元オブジェクトの輪郭が把握出来、また法線情報から表面形状を把握出来る。三次元オブジェクトを抽出する際には、オブジェクトを微小な平面の集合として取り扱う。そして、距離関数が線形であり、または法線の向きが類似であれば、その領域が平面であることが分かる。   Moreover, when extracting a three-dimensional object, you may pay attention to the difference in distance. That is, the point where the change in distance is large is regarded as the boundary of the object. Alternatively, a point where the distance is discontinuous is a boundary, and if it is continuous, it is regarded as a surface. Thereby, the outline of the three-dimensional object can be grasped, and the surface shape can be grasped from the normal line information. When extracting a three-dimensional object, the object is handled as a set of minute planes. If the distance function is linear or the directions of the normals are similar, it can be seen that the region is a plane.

また、フレーム間において画面内に動きがある場合、すなわち動画の場合には、動き補償符号化を行っても良い。すなわち、三次元オブジェクトのフレーム内での動きを推定し、それを用いて予測値を求め、予測結果と実際の結果との差分を求める。そして、求めた差分を記憶する。より具体的には、2つのフレームにつき三次元オブジェクトを抽出する。次に、フレーム間で類似した三次元オブジェクトを探索する。そして、オブジェクトが平面の場合には、代表点を目印にして平面情報の探索を行い、その変化を算出する。曲面の場合には、曲面情報を探索して、その変化を算出する。この際、曲面上にある特徴点とその曲率中心を目印にして探索を行う。またテクスチャの変化は、三次元オブジェクトに画像情報を視点方向から投射(テクスチャの貼り付け)し、それを位置変化(移動、回転、拡大、縮小等の物理的位置関係の変化)させたものを予測値とし、実際のテクスチャの画像情報との差分を求める。すなわち、三次元オブジェクトに重なる背景部分が、過去または未来のフレームから補間され、オブジェクトが存在しない状態での背景を予測出来る。そして、これらのフレーム間の差分を保持することによって情報量を圧縮出来る。またこの際には、オブジェクト全体では無く微小領域単位で差分を考えることで、扱いが容易となる。このようにして得た2フレーム間の変化情報を用いて次のフレームでの変化を予測し、実際の値との差分を求める。   In addition, when there is motion in the screen between frames, that is, in the case of a moving image, motion compensation coding may be performed. That is, the motion of the three-dimensional object in the frame is estimated, a prediction value is obtained using the estimated motion, and a difference between the prediction result and the actual result is obtained. Then, the obtained difference is stored. More specifically, a three-dimensional object is extracted for every two frames. Next, a similar three-dimensional object is searched between frames. If the object is a plane, the plane information is searched using the representative point as a mark, and the change is calculated. In the case of a curved surface, the curved surface information is searched and the change is calculated. At this time, the search is performed using the feature points on the curved surface and the center of curvature thereof as landmarks. Also, the texture change is the projection of image information from the viewpoint direction on the 3D object (texture pasting), and the position change (change in physical positional relationship such as movement, rotation, enlargement, reduction, etc.) A difference from the actual texture image information is obtained as a predicted value. That is, the background portion overlapping the three-dimensional object is interpolated from the past or future frame, and the background in the state where the object does not exist can be predicted. The amount of information can be compressed by holding the difference between these frames. In this case, the handling is facilitated by considering the difference in units of minute areas rather than the entire object. Using the change information between the two frames obtained in this way, a change in the next frame is predicted, and a difference from the actual value is obtained.

更に、三次元オブジェクトの視界から見えない部分の予測は、次のような方法によっても可能である。すなわち、抽出したオブジェクトを典型的な形状(直方体や球等の基本的な立体や、直線、平面、無限円等)と比較し、類似した形状を探索する。そして、オブジェクトに類似した典型形状を用いて、予測画像計算に用いる。または、三次元オブジェクトの表面の距離変化または法線方向の変化を関数で表し、その関数的性質から、比較する典型的形状を選択しても良い。例えば、隣接する画素単位の距離変化が、ある面積のある範囲にわたって線形的であれば、それらの集合を平面と推定出来る。面積の無い範囲にわたって線形的であれば、直線であると推定出来る。   Furthermore, the prediction of the part that cannot be seen from the field of view of the three-dimensional object is also possible by the following method. That is, the extracted object is compared with a typical shape (basic solid such as a rectangular parallelepiped or a sphere, a straight line, a plane, an infinite circle, etc.), and a similar shape is searched. Then, a typical shape similar to the object is used for predictive image calculation. Alternatively, a change in the distance or normal direction of the surface of the three-dimensional object may be expressed as a function, and a typical shape to be compared may be selected from the functional property. For example, if the change in the distance between adjacent pixels is linear over a certain area, the set can be estimated as a plane. If it is linear over a range with no area, it can be estimated that it is a straight line.

また、三次元オブジェクト毎に形状とテクスチャを記憶する際、撮影装置の置かれている三次元の環境(視点とオブジェクトとの位置関係や角度)をあわせて記憶することで、撮影装置が移動したり角度が変化したりした場合に、視界にどのようなオブジェクトが現れるかを予測することも出来る。   In addition, when storing the shape and texture for each 3D object, the 3D environment (positional relationship and angle between the viewpoint and the object) where the imaging device is located is also stored, so that the imaging device moves. It is also possible to predict what objects will appear in the field of view when the angle changes.

更に、遠景は近景に比して変化が少ない。従って、予測のための参照画像の時間差を、距離によって変化させても良い。また、抽出した三次元オブジェクトの時系列における距離変化(接近または離反)に応じて、オブジェクトの拡大・縮小を予測しても良い。また、抽出した三次元オブジェクトと視点との位置関係の推移から、その前後の時間の位置関係を予測することも出来る。そして、予測した三次元オブジェクトをレンダリングし、実際の画像との差分を情報として記憶しても良い。   Further, the distant view has less change than the close view. Therefore, the time difference between the reference images for prediction may be changed depending on the distance. Further, the expansion / reduction of the object may be predicted in accordance with the distance change (approach or separation) in the time series of the extracted three-dimensional object. In addition, the positional relationship between the time before and after that can be predicted from the transition of the positional relationship between the extracted three-dimensional object and the viewpoint. Then, the predicted three-dimensional object may be rendered, and the difference from the actual image may be stored as information.

[第3の実施形態]
次に、この発明の第4の実施形態に係る画像処理方法について説明する。本実施形態は、上記第1、第2の実施形態で説明した画像処理方法を実現する撮像装置及び再生装置に関するものである。
[Third Embodiment]
Next explained is an image processing method according to the fourth embodiment of the invention. The present embodiment relates to an imaging device and a playback device that realize the image processing method described in the first and second embodiments.

<撮像装置>
まず、撮像装置について説明する。撮像装置は、上記第1、第2の実施形態に係る画像処理方法に従って、二次元画像の立体情報を生成・圧縮する。図15は撮像装置のブロック図であり、その一例はカメラである。図示するように撮像装置1は、画像入力部2、測距部3、演算部4、及び伝送/蓄積部5を備えている。
<Imaging device>
First, the imaging device will be described. The imaging apparatus generates and compresses stereoscopic information of a two-dimensional image according to the image processing method according to the first and second embodiments. FIG. 15 is a block diagram of an imaging apparatus, and an example thereof is a camera. As illustrated, the imaging device 1 includes an image input unit 2, a distance measuring unit 3, a calculation unit 4, and a transmission / storage unit 5.

画像入力部2は撮像部を含み、撮像部によって対象物体を撮影して二次元画像を得る。なお、画像入力部2自身が撮像部を含む必要は必ずしも無く、撮像装置1外部のカメラで撮影された二次元画像が画像入力部2に入力されても良い。   The image input unit 2 includes an imaging unit, and captures a target object by the imaging unit to obtain a two-dimensional image. Note that the image input unit 2 itself does not necessarily include the imaging unit, and a two-dimensional image captured by a camera outside the imaging device 1 may be input to the image input unit 2.

測距部3は、対象物体の距離を測定する。すなわち第1の実施形態で説明したように、合焦や、赤外線、レーザ等を用いて距離を測定し、または画像入力部2から与えられる複数の二次元画像を用いたステレオ対応点探索法等によって距離を推定する。   The distance measuring unit 3 measures the distance of the target object. That is, as described in the first embodiment, the distance is measured using focusing, infrared rays, laser, or the like, or a stereo corresponding point search method using a plurality of two-dimensional images given from the image input unit 2 or the like To estimate the distance.

演算部4は、画像入力部2から二次元画像を受け取り、測距部3から距離を受け取る。そして演算部4は、撮影された二次元画像の立体情報を生成・圧縮する。演算部4の詳細は後述する。   The calculation unit 4 receives a two-dimensional image from the image input unit 2 and receives a distance from the distance measurement unit 3. Then, the calculation unit 4 generates and compresses stereoscopic information of the captured two-dimensional image. Details of the calculation unit 4 will be described later.

伝送/蓄積部5は、例えばハードディスクドライブや、またはフラッシュメモリ等の半導体メモリである。この場合、伝送/蓄積部5はLAN等の通信装置を含み、記憶したデータをこれらの通信装置によって再生装置へ伝送する。また伝送/蓄積部5は、撮像装置に挿抜可能なメモリカード等であっても良い。この場合には、メモリカードがデータの伝送手段且つ蓄積手段となる。   The transmission / storage unit 5 is a semiconductor memory such as a hard disk drive or a flash memory, for example. In this case, the transmission / accumulation unit 5 includes a communication device such as a LAN, and transmits the stored data to the playback device through these communication devices. Further, the transmission / storage unit 5 may be a memory card that can be inserted into and removed from the imaging apparatus. In this case, the memory card serves as data transmission means and storage means.

<<演算部4の詳細>>
次に、上記演算部4の詳細について説明する。図示するように演算部4は、二次元画像圧縮部6、付加情報計算部7、及び付加情報圧縮部8を備えている。
<< Details of Calculation Unit 4 >>
Next, the detail of the said calculating part 4 is demonstrated. As shown in the figure, the calculation unit 4 includes a two-dimensional image compression unit 6, an additional information calculation unit 7, and an additional information compression unit 8.

二次元画像圧縮部6は、画像入力部2から与えられる二次元画像を、周知の手法により圧縮する。そして、圧縮した二次元画像を、二次元画像圧縮データとして伝送/蓄積部5に記憶させる。   The two-dimensional image compression unit 6 compresses the two-dimensional image given from the image input unit 2 by a known method. Then, the compressed two-dimensional image is stored in the transmission / accumulation unit 5 as two-dimensional image compression data.

付加情報計算部7は、二次元画像を構成する画素につき、距離と法線方向とを計算する。付加情報計算部7は、第1付加情報計算部10、照度差計算部11、光源角度差計算部12、及び第2付加情報計算部13を備えている。   The additional information calculation unit 7 calculates the distance and the normal direction for the pixels constituting the two-dimensional image. The additional information calculation unit 7 includes a first additional information calculation unit 10, an illuminance difference calculation unit 11, a light source angle difference calculation unit 12, and a second additional information calculation unit 13.

第1付加情報計算部10は、基準点における法線方向を算出する。すなわち、測距部3から与えられる距離情報を元に基準点を定め、基準点について第1の実施形態で説明したステップS11の処理を行い、基準点における法線方向を算出する。   The first additional information calculation unit 10 calculates the normal direction at the reference point. That is, a reference point is determined based on the distance information given from the distance measuring unit 3, and the process of step S11 described in the first embodiment is performed on the reference point to calculate the normal direction at the reference point.

照度差計算部11は、画像入力部2から与えられる二次元画像について、照度差を計算する。照度差計算部12は、二次元画像を構成する画素につき、隣接する画素との照度差を計算する。   The illuminance difference calculation unit 11 calculates the illuminance difference for the two-dimensional image given from the image input unit 2. The illuminance difference calculation unit 12 calculates the illuminance difference between adjacent pixels for each pixel constituting the two-dimensional image.

光源角度差計算部12は、非基準点における光源との角度差を求める。すなわち、二次元画像を構成する画素を順次選択し、その点が非基準点であれば、照度差計算部11で算出した照度差に基づいて、法線方向の光源との角度差を求める。選択された画素が基準点か非基準点であるかの情報は、第1付加情報計算部10から与えられる。   The light source angle difference calculation unit 12 obtains an angle difference with the light source at the non-reference point. That is, the pixels constituting the two-dimensional image are sequentially selected, and if the point is a non-reference point, the angle difference from the light source in the normal direction is obtained based on the illuminance difference calculated by the illuminance difference calculation unit 11. Information about whether the selected pixel is a reference point or a non-reference point is given from the first additional information calculation unit 10.

第2付加情報計算部13は、第1付加情報計算部10から与えられる基準点における距離及び法線方向と、光源角度差計算部12から与えられる角度差に基づいて、非基準点における距離及び法線方向を計算する。非基準点における距離及び法線方向の算出方法は、第1の実施形態で説明した図2のフローの通りである。   Based on the distance and normal direction at the reference point given from the first additional information calculation unit 10 and the angle difference given from the light source angle difference calculation unit 12, the second additional information calculation unit 13 Calculate the normal direction. The calculation method of the distance and the normal direction at the non-reference point is as shown in the flow of FIG. 2 described in the first embodiment.

付加情報圧縮部8は、付加情報計算部7で求められた基準点及び非基準点における距離と法線方向とを、第2の実施形態で説明した種々の方法により符号化して圧縮する。そして、圧縮した距離と法線方向とを、付加情報圧縮データとして伝送/蓄積部5に記憶させる。   The additional information compression unit 8 encodes and compresses the distance and normal direction at the reference point and the non-reference point obtained by the additional information calculation unit 7 by the various methods described in the second embodiment. Then, the compressed distance and normal direction are stored in the transmission / accumulation unit 5 as additional information compressed data.

<再生装置>
次に、再生装置について説明する。再生装置は、上記第1、第2の実施形態に係る画像処理方法に従って、二次元画像の立体情報を伸張・再生する。図16は再生装置のブロック図であり、その一例はパーソナルコンピュータ(PC)である。図示するように再生装置1は、伝送/蓄積部21、演算部22、表示部23、及び入力部24を備えている。
<Reproducing device>
Next, the playback device will be described. The reproduction device expands and reproduces the stereoscopic information of the two-dimensional image according to the image processing method according to the first and second embodiments. FIG. 16 is a block diagram of a playback apparatus, and an example thereof is a personal computer (PC). As illustrated, the playback device 1 includes a transmission / storage unit 21, a calculation unit 22, a display unit 23, and an input unit 24.

伝送/蓄積部21は、撮像装置1の伝送/蓄積部5から伝送された二次元画像圧縮データ及び付加情報圧縮データを受け取り、蓄積する。   The transmission / storage unit 21 receives and stores the two-dimensional image compressed data and the additional information compressed data transmitted from the transmission / storage unit 5 of the imaging device 1.

演算部22は、伝送/蓄積部21から二次元画像圧縮データ及び付加情報圧縮データを受け取り、二次元画像を再生すると共に、この立体画像を生成する。演算部22の詳細については後述する。   The calculation unit 22 receives the compressed two-dimensional image data and the additional information compressed data from the transmission / storage unit 21, reproduces the two-dimensional image, and generates this stereoscopic image. Details of the calculation unit 22 will be described later.

表示部23は、演算部で得られた二次元画像及び立体画像を表示する。   The display unit 23 displays the two-dimensional image and the stereoscopic image obtained by the calculation unit.

入力部24は、例えばマウスやキーボードであって、立体画像の再生に必要な情報(例えば視点、注視点、被写界深度等)を受け付ける。   The input unit 24 is a mouse or a keyboard, for example, and receives information (for example, a viewpoint, a gazing point, a depth of field, etc.) necessary for reproducing a stereoscopic image.

<<演算部22の詳細>>
次に、上記演算部22の詳細について説明する。図示するように演算部22は、二次元画像伸張部30、付加情報伸張部31、立体形状復元部32、及びレンダリング部33を備えている。
<< Details of Calculation Unit 22 >>
Next, the detail of the said calculating part 22 is demonstrated. As shown in the figure, the calculation unit 22 includes a two-dimensional image expansion unit 30, an additional information expansion unit 31, a three-dimensional shape restoration unit 32, and a rendering unit 33.

二次元画像伸張部30は、伝送/蓄積部21から与えられる二次元画像圧縮データを、周知の手法により復号化して、二次元画像を得る。この二次元画像が、表示部23で表示される。   The two-dimensional image expansion unit 30 decodes the two-dimensional image compression data given from the transmission / accumulation unit 21 by a known method to obtain a two-dimensional image. This two-dimensional image is displayed on the display unit 23.

付加情報伸張部31は、伝送/蓄積部21から与えられる付加情報圧縮データを、第2の実施形態で説明した手法により復号化して、基準点及び非基準点における距離と法線の方向とを得る。   The additional information decompression unit 31 decodes the additional information compressed data provided from the transmission / accumulation unit 21 by the method described in the second embodiment, and determines the distances at the reference points and the non-reference points and the directions of the normals. obtain.

立体形状復元部32は、付加情報伸張部31で得られた距離と法線方向とを、二次元画像伸張部30で得られた二次元画像に関連付けることで、二次元画像の立体形状を生成する。   The three-dimensional shape restoration unit 32 generates the three-dimensional shape of the two-dimensional image by associating the distance and the normal direction obtained by the additional information decompression unit 31 with the two-dimensional image obtained by the two-dimensional image decompression unit 30. To do.

レンダリング部33は、立体形状復元部32で得られた立体形状を、入力部24で受け付けた情報に従ってレンダリングして、目的とする物体を生成する。そしてレンダリング部33で得られた物体が、表示部23に表示される。   The rendering unit 33 renders the three-dimensional shape obtained by the three-dimensional shape restoration unit 32 according to the information received by the input unit 24 to generate a target object. The object obtained by the rendering unit 33 is displayed on the display unit 23.

以上のような装置により、上記第1、第2の実施形態を実現出来る。なお、本実施形態における演算部4、22は、ソフトウェアによって実現しても良い。すなわち、撮像装置1はCPU等の演算装置を含み、演算装置をソフトウェアによって二次元画像圧縮部6、付加情報計算部7、及び付加情報圧縮部8として機能させても良い。演算部22も同様である。   With the above apparatus, the first and second embodiments can be realized. Note that the arithmetic units 4 and 22 in the present embodiment may be realized by software. That is, the imaging device 1 may include a calculation device such as a CPU, and the calculation device may function as the two-dimensional image compression unit 6, the additional information calculation unit 7, and the additional information compression unit 8 by software. The calculation unit 22 is the same.

更に、本実施形態のように撮像装置1と再生装置20とを分離させることが好ましい。通常、撮像装置1としてのカメラには可搬性が要求され、またカメラが高度な画像処理能力を有することは希だからである。そしてこの場合、撮像装置1から再生装置20へデータを伝送する必要があるため、三次元画像のデータ量を圧縮することが重要となる。   Furthermore, it is preferable to separate the imaging device 1 and the playback device 20 as in this embodiment. This is because the camera as the imaging apparatus 1 is normally required to be portable and the camera rarely has a high image processing capability. In this case, since it is necessary to transmit data from the imaging apparatus 1 to the reproduction apparatus 20, it is important to compress the data amount of the three-dimensional image.

また、上記撮像装置1及び再生装置20は、三次元地図作成装置として応用することが出来る。この場合、撮像装置1の演算部4は三次元地図作成部と三次元地図圧縮部とを更に備える。三次元地図作成部は、第2付加情報計算部13から、基準点及び非基準点における距離と法線方向とを受け取る。すなわち、二次元画像についての立体情報を受け取る。そして三次元地図作成部は、二次元画像を三次元に投射し、三次元地図情報を作成する。この際、テクスチャもあわせて統合する。そして三次元地図圧縮部は、三次元地図作成部で作成された三次元地図情報を圧縮して、三次元地図情報圧縮データとして、伝送/蓄積部5に記憶させる。   Further, the imaging device 1 and the playback device 20 can be applied as a three-dimensional map creation device. In this case, the calculation unit 4 of the imaging device 1 further includes a 3D map creation unit and a 3D map compression unit. The three-dimensional map creation unit receives distances and normal directions at the reference point and the non-reference point from the second additional information calculation unit 13. That is, stereoscopic information about a two-dimensional image is received. The 3D map creation unit then projects the 2D image into 3D to create 3D map information. At this time, the texture is also integrated. Then, the 3D map compression unit compresses the 3D map information created by the 3D map creation unit and stores it in the transmission / accumulation unit 5 as 3D map information compressed data.

また再生装置20の演算部22は、三次元地図伸張部及び三次元地図作成部を更に備える。三次元地図伸張部は、伝送/蓄積部21から受け取った三次元地図情報圧縮データを伸張し、これに基づいて三次元地図作成部が三次元地図を作成する。そして立体形状復元部32において、三次元地図における立体形状が復元される。   The calculation unit 22 of the playback device 20 further includes a 3D map decompression unit and a 3D map creation unit. The 3D map decompression unit decompresses the 3D map information compressed data received from the transmission / accumulation unit 21, and based on this, the 3D map creation unit creates a 3D map. Then, in the three-dimensional shape restoration unit 32, the three-dimensional shape in the three-dimensional map is restored.

上記のように、この発明の第1乃至第3の実施形態に係る画像処理方法によれば、二次元画像において、基準点の法線方向を求めるステップと、基準点を基準にした照度差に基づいて、非基準点の距離及び法線方向を求めるステップとを具備する。そして二次元画像と、基準点及び非基準点における距離及び法線方向とにより、二次元画像の立体画像情報を表現する。つまり、立体情報を直接利用して、三次元画像を取り扱うことが出来る。従って、必要な画像データは1枚の二次元画像だけで良く、三次元画像のデータ量を削減出来る。   As described above, according to the image processing method according to the first to third embodiments of the present invention, in the two-dimensional image, the step of obtaining the normal direction of the reference point and the illuminance difference based on the reference point are obtained. And determining the distance and normal direction of the non-reference point based on the step. Then, the stereoscopic image information of the two-dimensional image is expressed by the two-dimensional image and the distance and normal direction at the reference point and the non-reference point. That is, it is possible to handle a three-dimensional image by directly using stereoscopic information. Therefore, only one two-dimensional image is necessary, and the data amount of the three-dimensional image can be reduced.

この方法を、図17乃至図19を用いて概略的に再度、説明する。図17は二次元画像の模式図である。図示するように、背景上に円柱形状の前景物体が存在する。図中におけるハッチングは影(明るさ)を示す。このような二次元画像について、距離を測定出来た点を基準点とする。図18は、図17の二次元画像の基準点をバツ印で示すものである。図示するように、背景や前景物体の輪郭部分は距離が推定し易く、基準点となりやすい。その他のバツ印の無い領域は全て非基準点となる。そして、照度差と基準点の法線方向に基づき、非基準点の法線方向を求める。この様子を図19に示す。図示するように、背景は床と2つの壁の3つの平面であることが照度差から分かり、これらの法線ベクトルn1〜n3の方向を求めることが出来る。また前景物体が円柱形状であることも照度差から分かり、円柱上面の法線ベクトルn4の方向が分かり、また側面の法線ベクトルn5、n6、n7、…の方向が分かる。そして法線が分かることで、第1の実施形態で説明した図5等の方法により、非基準点の距離を求めることが出来る。   This method will be schematically described again with reference to FIGS. FIG. 17 is a schematic diagram of a two-dimensional image. As shown in the figure, a cylindrical foreground object exists on the background. The hatching in the figure indicates a shadow (brightness). For such a two-dimensional image, a point at which the distance can be measured is set as a reference point. FIG. 18 shows the reference points of the two-dimensional image in FIG. 17 by cross marks. As shown in the figure, the outline of the background and the foreground object is easy to estimate the distance, and easily becomes a reference point. All other areas without cross marks are non-reference points. Then, based on the illuminance difference and the normal direction of the reference point, the normal direction of the non-reference point is obtained. This is shown in FIG. As shown in the figure, it can be seen from the difference in illuminance that the background is three planes of the floor and two walls, and the directions of these normal vectors n1 to n3 can be obtained. It can also be seen from the difference in illuminance that the foreground object has a cylindrical shape, the direction of the normal vector n4 on the upper surface of the cylinder, and the direction of the normal vectors n5, n6, n7,. By knowing the normal line, the distance between the non-reference points can be obtained by the method shown in FIG. 5 described in the first embodiment.

非基準点の距離及び法線方向の算出は、次のような方法を用いることが出来る。すなわち、図5及び図6に示したように、まず基準点の法線方向と光源との角度差である第1角度差θ1を、照度差ステレオ法により求める。また、基準点に十分に近接し、且つ基準点と同一の連続する曲面または平面上にあると推定出来る非基準点の法線方向と光源との角度差である第2角度差θ2を、照度差ステレオ法により求める。次に、基準点の法線方向と、第1角度差θ1と第2角度差θ2との差である第3角度差Δθ1とに基づいて、非基準点における法線方向を求める。更に、第1角度差θ1と第2角度差θ2とに基づいて、基準点と非基準点との、曲率中心からの角度差である第4角度差Δθ2を求める。これにより、基準点の距離と第4角度差Δθ2とに基づいて、非基準点の距離を求めることが出来る。   The following method can be used to calculate the distance and normal direction of the non-reference point. That is, as shown in FIGS. 5 and 6, first, a first angle difference θ1 which is an angle difference between the normal direction of the reference point and the light source is obtained by the illuminance difference stereo method. Further, the second angle difference θ2, which is the angle difference between the normal direction of the non-reference point that can be estimated to be sufficiently close to the reference point and on the same continuous curved surface or plane as the reference point, and the light source is expressed as illuminance. Obtained by the difference stereo method. Next, the normal direction at the non-reference point is obtained based on the normal direction of the reference point and the third angle difference Δθ1 that is the difference between the first angle difference θ1 and the second angle difference θ2. Further, based on the first angle difference θ1 and the second angle difference θ2, a fourth angle difference Δθ2 that is an angle difference from the center of curvature between the reference point and the non-reference point is obtained. Accordingly, the distance between the non-reference points can be obtained based on the distance between the reference points and the fourth angle difference Δθ2.

以上のように、照度差を利用することで、表面に変化の少ない物体であっても、その法線及び距離を求めることが容易となる。なお上記方法では、2点(基準点と、この基準点を元にして距離及び法線方向を求めたい非基準点)の法線方向と光源との角度差を、法線方向の角度差と近似している。従って、光源と2点とを結ぶ線分の角度差が法線角度の誤差となる。そのため、この誤差が許容出来る範囲内となるように、2点が近接していれば良い。つまり、光源からの距離と、法線角度の精度要請とに基づいて、2点が十分に近接しているかどうかを決めることが出来る。   As described above, by using the illuminance difference, it is easy to obtain the normal line and distance even for an object with little change on the surface. In the above method, the angle difference between the normal direction of the two points (the reference point and the non-reference point for which the distance and the normal direction are to be obtained based on the reference point) and the light source is expressed as the angle difference in the normal direction. Approximate. Therefore, the angle difference between the line segments connecting the light source and the two points becomes the normal angle error. Therefore, it is sufficient that the two points are close to each other so that this error is within an allowable range. That is, it is possible to determine whether or not the two points are sufficiently close based on the distance from the light source and the accuracy requirement of the normal angle.

なお、本願発明は上記実施形態に限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で種々に変形することが可能である。更に、上記実施形態には種々の段階の発明が含まれており、開示される複数の構成要件における適宜な組み合わせにより種々の発明が抽出されうる。例えば、実施形態に示される全構成要件からいくつかの構成要件が削除されても、発明が解決しようとする課題の欄で述べた課題が解決でき、発明の効果の欄で述べられている効果が得られる場合には、この構成要件が削除された構成が発明として抽出されうる。   Note that the present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the scope of the invention in the implementation stage. Furthermore, the above embodiments include inventions at various stages, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, even if some constituent requirements are deleted from all the constituent requirements shown in the embodiment, the problem described in the column of the problem to be solved by the invention can be solved, and the effect described in the column of the effect of the invention Can be extracted as an invention.

この発明の第1実施形態に係る画像処理方法のフローチャート。1 is a flowchart of an image processing method according to the first embodiment of the present invention. この発明の第1実施形態に係る画像処理方法における、非基準点の距離及び法線方向の算出方法を示すフローチャート。6 is a flowchart showing a method for calculating a distance and a normal direction of a non-reference point in the image processing method according to the first embodiment of the present invention. 三次元オブジェクトの模式図。A schematic diagram of a three-dimensional object. この発明の第1実施形態に係る非基準点の距離及び法線方向の算出方法を示す概念図。The conceptual diagram which shows the calculation method of the distance of a non-reference | standard point and normal direction which concerns on 1st Embodiment of this invention. この発明の第1実施形態に係る非基準点の距離算出方法を示す概念図。The conceptual diagram which shows the distance calculation method of the non-reference | standard point which concerns on 1st Embodiment of this invention. 三次元オブジェクトの模式図であり、この発明の第1実施形態に係る非基準点の距離及び法線方向の算出方法を説明する図。It is a schematic diagram of a three-dimensional object, and is a diagram for explaining a method for calculating the distance and normal direction of a non-reference point according to the first embodiment of the present invention. この発明の第2実施形態に係るデータ圧縮方法のフローチャート。The flowchart of the data compression method which concerns on 2nd Embodiment of this invention. この発明の第2実施形態に係るデータ圧縮方法のフローチャート。The flowchart of the data compression method which concerns on 2nd Embodiment of this invention. この発明の第2実施形態に係るデータ圧縮方法のフローチャート。The flowchart of the data compression method which concerns on 2nd Embodiment of this invention. この発明の第2実施形態に係るデータ圧縮方法を説明するための模式図。The schematic diagram for demonstrating the data compression method which concerns on 2nd Embodiment of this invention. この発明の第2実施形態に係るオブジェクト抽出方法のフローチャート。The flowchart of the object extraction method which concerns on 2nd Embodiment of this invention. 三次元オブジェクトの模式図であり、この発明の第2実施形態に係るオブジェクト抽出方法のフローチャート。It is a schematic diagram of a three-dimensional object, and is a flowchart of the object extraction method according to the second embodiment of the present invention. この発明の第2実施形態に係るオブジェクト抽出方法のフローチャート。The flowchart of the object extraction method which concerns on 2nd Embodiment of this invention. 三次元オブジェクトの模式図であり、この発明の第2実施形態に係るオブジェクト抽出方法のフローチャート。It is a schematic diagram of a three-dimensional object, and is a flowchart of the object extraction method according to the second embodiment of the present invention. この発明の第3実施形態に係る撮像装置のブロック図。The block diagram of the imaging device which concerns on 3rd Embodiment of this invention. この発明の第3実施形態に係る再生装置のブロック図。The block diagram of the reproducing | regenerating apparatus concerning 3rd Embodiment of this invention. 二次元画像の模式図。The schematic diagram of a two-dimensional image. この発明の第1乃至第3実施形態に係る画像処理方法により、基準点における法線の方向を求める様子を示す模式図。The schematic diagram which shows a mode that the direction of the normal line in a reference point is calculated | required with the image processing method which concerns on 1st thru | or 3rd Embodiment of this invention. この発明の第1乃至第3実施形態に係る画像処理方法により、非基準点における距離及び法線の方向を求める様子を示す模式図。The schematic diagram which shows a mode that the distance in a non-reference | standard point and the direction of a normal line are calculated | required with the image processing method which concerns on 1st thru | or 3rd Embodiment of this invention.

符号の説明Explanation of symbols

1…撮像装置、2…画像入力部、3…測距部、4、22…演算部、5、21…伝送/蓄積部、6…二次元画像圧縮部、7…付加情報計算部、8…付加情報圧縮部、10…第1付加情報計算部、11…照度差計算部、12…光源角度差計算部、13…第2付加情報計算部、20…再生装置、23…表示部、24…入力部、30…二次元画像伸張部、31…付加情報伸張部、32…立体形状復元部、33…レンダリング部   DESCRIPTION OF SYMBOLS 1 ... Imaging device, 2 ... Image input part, 3 ... Distance measuring part, 4, 22 ... Operation part, 5, 21 ... Transmission / accumulation part, 6 ... Two-dimensional image compression part, 7 ... Additional information calculation part, 8 ... Additional information compression unit, 10 ... first additional information calculation unit, 11 ... illuminance difference calculation unit, 12 ... light source angle difference calculation unit, 13 ... second additional information calculation unit, 20 ... reproduction device, 23 ... display unit, 24 ... Input unit 30... 2D image decompression unit 31. Additional information decompression unit 32. Solid shape restoration unit 33 33 Rendering unit

Claims (5)

二次元画像において、視点からの距離が既知である基準点につき、法線方向を求めるステップと、
前記二次元画像において、視点からの距離が未知である非基準点につき、前記基準点を基準にした照度差に基づいて、視点からの距離及び法線方向を求めるステップと
を具備し、前記二次元画像と、前記基準点における前記距離及び法線方向、並びに前記非基準点における前記距離及び法線方向とにより、該二次元画像の立体画像情報が表現される
ことを特徴とする画像処理方法。
Obtaining a normal direction for a reference point whose distance from the viewpoint is known in a two-dimensional image;
Obtaining a distance from the viewpoint and a normal direction based on an illuminance difference with reference to the reference point for a non-reference point whose distance from the viewpoint is unknown in the two-dimensional image, and 3D image information of the two-dimensional image is represented by a three-dimensional image, the distance and normal direction at the reference point, and the distance and normal direction at the non-reference point. .
前記非基準点につき前記距離及び法線方向を求めるステップは、前記基準点における前記法線方向と光源との角度差である第1角度差を、照度差ステレオ法により求めるステップと、
前記非基準点における前記法線方向と前記光源との角度差である第2角度差を、前記照度差ステレオ法により求めるステップと、
前記基準点における前記法線方向と、前記第1角度差と前記第2角度差との差である第3角度差とに基づいて、非基準点における前記法線方向を求めるステップと、
前記第1角度差と前記第2角度差に基づいて、前記基準点と前記非基準点との、曲率中心からの角度差である第4角度差を求めるステップと、
前記基準点の前記距離と、前記第4角度差とに基づいて、前記非基準点の前記距離を求めるステップと
を備えることを特徴とする請求項1記載の画像処理方法。
Obtaining the distance and the normal direction for the non-reference point, obtaining a first angle difference that is an angle difference between the normal direction and the light source at the reference point by an illuminance difference stereo method;
Obtaining a second angle difference which is an angle difference between the normal direction at the non-reference point and the light source by the illuminance difference stereo method;
Obtaining the normal direction at a non-reference point based on the normal direction at the reference point and a third angle difference that is a difference between the first angle difference and the second angle difference;
Obtaining a fourth angle difference that is an angle difference from the center of curvature between the reference point and the non-reference point based on the first angle difference and the second angle difference;
The image processing method according to claim 1, further comprising: calculating the distance of the non-reference point based on the distance of the reference point and the fourth angle difference.
前記距離の求められた前記非基準点は、新たな基準点とされる
ことを特徴とする請求項1または2記載の画像処理方法。
The image processing method according to claim 1, wherein the non-reference point for which the distance is obtained is a new reference point.
前記二次元画像を圧縮するステップと、
前記基準点及び非基準点における前記法線方向を、極座標で表現することにより圧縮するステップと、
前記基準点及び非基準点における前記距離を、逆数を対数に取ることにより圧縮するステップと
を更に備えることを特徴とする請求項1または2記載の画像処理方法。
Compressing the two-dimensional image;
Compressing the normal direction at the reference point and the non-reference point by expressing them in polar coordinates;
The image processing method according to claim 1, further comprising: compressing the distance between the reference point and the non-reference point by taking a reciprocal number as a logarithm.
前記基準点及び前記非基準点における前記距離及び前記法線方向を求めた後、
前記二次元画像において、前記法線の方向が類似している領域を抽出するステップと、
抽出した前記領域が平面である場合、該平面における代表点を決定し、該代表点の前記距離と前記法線方向とにより該平面を表現し、抽出した前記領域が曲面である場合、該曲面における曲率半径及び曲率中心から構成される曲線により該曲面を表現するステップと
を更に備えることを特徴とする請求項1または2記載の画像処理方法。
After determining the distance and the normal direction at the reference point and the non-reference point,
Extracting a region in which the direction of the normal is similar in the two-dimensional image;
When the extracted area is a plane, a representative point in the plane is determined, the plane is expressed by the distance and the normal direction of the representative point, and when the extracted area is a curved surface, the curved surface The image processing method according to claim 1, further comprising: expressing the curved surface by a curve composed of a radius of curvature and a center of curvature.
JP2008160687A 2008-06-19 2008-06-19 Image processing method Withdrawn JP2010002273A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008160687A JP2010002273A (en) 2008-06-19 2008-06-19 Image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008160687A JP2010002273A (en) 2008-06-19 2008-06-19 Image processing method

Publications (1)

Publication Number Publication Date
JP2010002273A true JP2010002273A (en) 2010-01-07

Family

ID=41584125

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008160687A Withdrawn JP2010002273A (en) 2008-06-19 2008-06-19 Image processing method

Country Status (1)

Country Link
JP (1) JP2010002273A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011196860A (en) * 2010-03-19 2011-10-06 Optex Co Ltd Object dimension measuring method and object dimension measuring device using distance image camera
JP2014156120A (en) * 2014-03-27 2014-08-28 Seiko Epson Corp Data conversion device, data conversion method and molding device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011196860A (en) * 2010-03-19 2011-10-06 Optex Co Ltd Object dimension measuring method and object dimension measuring device using distance image camera
JP2014156120A (en) * 2014-03-27 2014-08-28 Seiko Epson Corp Data conversion device, data conversion method and molding device

Similar Documents

Publication Publication Date Title
CN110115037B (en) Spherical projection motion estimation/compensation and mode decision
KR102424140B1 (en) Method and apparatus for omni-directional video coding and decoding by adaptive intra prediction
EP3043320B1 (en) System and method for compression of 3d computer graphics
US8433157B2 (en) System and method for three-dimensional object reconstruction from two-dimensional images
CA2650557C (en) System and method for three-dimensional object reconstruction from two-dimensional images
RU2431938C2 (en) Efficient multiple types encoding
US7463778B2 (en) Motion estimation for compressing multiple view images
US20210352323A1 (en) Three-dimensional data encoding method, three-dimensional data decoding method, three-dimensional data encoding device, and three-dimensional data decoding device
US20120176478A1 (en) Forming range maps using periodic illumination patterns
US20120176380A1 (en) Forming 3d models using periodic illumination patterns
US20130335535A1 (en) Digital 3d camera using periodic illumination
KR101817140B1 (en) Coding Method and Device for Depth Video Plane Modeling
US20160255357A1 (en) Feature-based image set compression
KR20210096234A (en) Point cloud coding using homography transformation
JP2001186516A (en) Method and system for coding decoding image data
JP6575999B2 (en) Lighting information acquisition device, lighting restoration device, and programs thereof
JP2010002273A (en) Image processing method
CN108989682B (en) Active light field depth imaging method and system
CN111052746B (en) Method and apparatus for encoding and decoding omni-directional video
US10375398B2 (en) Lightfield compression for per-pixel, on-demand access by a graphics processing unit
JP4722055B2 (en) Method for changing the scale of a three-dimensional model and scale changing unit
JP2014164497A (en) Information processor, image processing method and program
CN113706692A (en) Three-dimensional image reconstruction method, three-dimensional image reconstruction device, electronic device, and storage medium
Schuster et al. RTI compression for mobile devices
JP6600609B2 (en) Spatial image reproduction apparatus, method, and program

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20110906