JP2011160354A - Image processing device, image processing method, and program therefor - Google Patents
Image processing device, image processing method, and program therefor Download PDFInfo
- Publication number
- JP2011160354A JP2011160354A JP2010022429A JP2010022429A JP2011160354A JP 2011160354 A JP2011160354 A JP 2011160354A JP 2010022429 A JP2010022429 A JP 2010022429A JP 2010022429 A JP2010022429 A JP 2010022429A JP 2011160354 A JP2011160354 A JP 2011160354A
- Authority
- JP
- Japan
- Prior art keywords
- image data
- divided image
- divided
- correction
- subject
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Processing (AREA)
- Studio Circuits (AREA)
- Editing Of Facsimile Originals (AREA)
- Studio Devices (AREA)
Abstract
【課題】複数の分割画像データ間のつなぎあわせの精度を向上させ、従来よりも高精度なパノラマ画像データを生成する。
【解決手段】画像処理装置は、被写体の全景画像データを取得し(ステップS201)、被写体の分割画像データを取得する(ステップS202)。そして、画像処理装置は、各分割画像データと、当該分割画像データに対応する領域の前記全景画像データとの差分を算出し(ステップS206)、差分に応じた補正処理を各分割画像データに対して実行する(ステップS207)。次に画像処理装置は、補正後の各分割画像データを合成してパノラマ画像データを生成する(ステップS212)。
【選択図】図5An object of the present invention is to improve the accuracy of splicing between a plurality of divided image data and generate panoramic image data with higher accuracy than before.
An image processing apparatus acquires panoramic image data of a subject (step S201) and acquires divided image data of the subject (step S202). Then, the image processing apparatus calculates a difference between each divided image data and the whole-view image data in an area corresponding to the divided image data (step S206), and performs a correction process according to the difference on each divided image data. (Step S207). Next, the image processing apparatus generates panoramic image data by combining the corrected divided image data (step S212).
[Selection] Figure 5
Description
本発明は、複数の画像データを用いてパノラマ画像データを生成するための技術に関するものである。 The present invention relates to a technique for generating panoramic image data using a plurality of image data.
従来、複数の画像の画像データを用いてパノラマ合成処理を実行するものとしては、合成対象の複数の画像データ間での対応点を抽出し、対応点同士を結ぶことで合成する技術が知られている(例えば、特許文献1参照)。また、予め被写体の全景を撮影しておくことで、被写体の部分画像に対応する複数の画像データの大まかな位置を自動的に決定する技術も存在する(例えば、特許文献2参照)。 Conventionally, as a technique for executing panorama synthesis processing using image data of a plurality of images, a technique for extracting corresponding points between a plurality of image data to be combined and combining the corresponding points is known. (For example, refer to Patent Document 1). In addition, there is a technique for automatically determining a rough position of a plurality of pieces of image data corresponding to a partial image of a subject by photographing an entire view of the subject in advance (see, for example, Patent Document 2).
しかしながら、特許文献1に開示されるような対応点を抽出する手法では、パノラマ合成に失敗するケースも存在する。これは、ある特定のパターン(模様)が連続する被写体を撮影した際に起こりうる。つまり、撮影画像データに同じようなパターンが複数存在するため、撮影した2枚の画像データ間で対応点の相関が取れなくなる。そのため、間違った対応点同士をつないでしまい、パノラマ画像データが大きく歪んでしまうという課題があった。また、特許文献2に開示される手法を用いて、各撮影画像データの配置が決まっても、被写体を斜め方向から撮影する際の歪みや樽型ひずみや糸巻き型ひずみのようなレンズの歪みがあるため、精度よく合成することは難しい。
However, in the method of extracting corresponding points as disclosed in
そこで、本発明の目的は、複数の分割画像データ間のつなぎあわせの精度を向上させ、従来よりも高精度なパノラマ画像データを生成することにある。 Therefore, an object of the present invention is to improve the accuracy of joining between a plurality of divided image data, and to generate panoramic image data with higher accuracy than before.
本発明に係る画像処理装置は、被写体の全景画像データを取得する第1の取得手段と、前記被写体の分割画像データを取得する第2の取得手段と、前記第2の取得手段により取得された各分割画像データと、当該分割画像データに対応する領域の前記全景画像データとの差分値を算出する算出手段と、前記算出手段により算出された差分値に応じた補正処理を前記各分割画像データに対して実行する補正手段と、前記補正手段により補正された前記各分割画像データを合成してパノラマ画像データを生成する生成手段とを有することを特徴とする。 The image processing apparatus according to the present invention is acquired by a first acquisition unit that acquires panoramic image data of a subject, a second acquisition unit that acquires divided image data of the subject, and the second acquisition unit. A calculation unit that calculates a difference value between each divided image data and the panoramic image data in an area corresponding to the divided image data, and a correction process according to the difference value calculated by the calculation unit And a generating unit that generates panoramic image data by combining the divided image data corrected by the correcting unit.
本発明によれば、被写体の全景画像データを用いることで、複数の分割画像データ間のつなぎあわせの精度を向上させることが可能となり、従来よりも高精度なパノラマ画像データを生成することができる。 According to the present invention, by using the panoramic image data of the subject, it is possible to improve the accuracy of joining between a plurality of divided image data, and it is possible to generate panoramic image data with higher accuracy than before. .
以下、本発明を適用した好適な実施形態を、添付図面を参照しながら詳細に説明する。 DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments to which the invention is applied will be described in detail with reference to the accompanying drawings.
先ず、第1の実施形態について説明する。本実施形態では、全景画像データを基にパノラマ画像データを生成する手法について説明する。 First, the first embodiment will be described. In the present embodiment, a method for generating panoramic image data based on full-view image data will be described.
図1は、第1の実施形態に係る画像処理装置のシステム構成を示すブロック図である。入力装置101は、ユーザからの指示やデータを入力する装置であり、キーボードやマウス等のポインティングシステムを含む。表示装置102は、GUI等を表示する装置であり、通常はCRTや液晶ディスプレイ等のモニタを表す。蓄積装置103は、画像データやプログラムを蓄積する装置であり、通常はハードディスクが用いられる。104は、CPUであり、上述した各構成の処理の全てに関わる制御を実行する。RAM106は、その処理に必要なプログラム、データ、作業領域等をCPU104に提供する。また、以降のフローチャートの処理に必要な制御プログラムは、蓄積装置103に格納されているものとし、一旦RAM106に読み込まれてから実行される。カメラ装置105は、デジタルカメラ等と接続し、入力画像データを取得する。なお、システム構成については、上記以外にも様々な構成要素が存在するが、説明は省略する。
FIG. 1 is a block diagram illustrating a system configuration of the image processing apparatus according to the first embodiment. The
図2−1及び図2−2は、パノラマ画像の撮影動作の概略を説明するための図である。図2−1(a)は、パノラマ画像データを生成する際の被写体を示している。本実施形態では、図2−1(a)のような絵画を対象とした、高解像度パノラマ画像データを生成することとする。図2−1(b)は、図2−1(a)に示す被写体の全景画像を撮影する方法を表している。この場合、被写体全域がカメラの画角に収まるようにカメラを被写体から離れた位置に設置するか、カメラのレンズを広角よりのレンズに交換して撮影する。図2−1(c)は分割画像を撮影する方法を表している。先ず、被写体の中央部分を捉えるようにカメラを設置する。そして、被写体の必要な領域を撮影できるようにレンズの望遠を調整するか、レンズの交換を行って撮影を行う。このときの画角は、作成したいパノラマ画像データの解像度に依存する。パノラマ画像データの解像度が高い場合、撮影時の分割数が増加する。そのため、画角を小さくする必要がある。逆にパノラマ画像データの解像度が低い場合、撮影時の分割数は少なくてよいので画角は大きくする。次にカメラを2つの回転軸に沿って回転させる。実際にはカメラを回転可能な旋回台に設置して旋回台を回転させることにより、カメラを回転させる。旋回台には回転計が設置されているため、カメラの回転角度も取得できる。カメラの回転により、被写体の中央部分のみでなく、被写体全域を撮影できるようになる。具体的には、被写体の左上から撮影を始め、徐々に回転させながら、被写体全域の撮影を行う。このときの回転角は、前述した撮影時の分割数に依存し、分割数が少ない場合、回転角は大きくなり、分割数が多い場合、回転角は小さくなる。このとき、隣接する分割画像同士でオーバーラップ領域(重複領域)ができるように回転角を調整しておく。調整の具体例を以下に示す。 FIGS. 2A and 2B are diagrams for explaining an outline of the panoramic image shooting operation. FIG. 2-1 (a) shows a subject when generating panoramic image data. In the present embodiment, high-resolution panoramic image data for a picture as shown in FIG. FIG. 2-1 (b) shows a method for capturing a panoramic image of the subject shown in FIG. 2-1 (a). In this case, the camera is placed at a position away from the subject so that the entire area of the subject is within the angle of view of the camera, or the camera lens is replaced with a lens with a wider angle. FIG. 2-1 (c) shows a method for capturing a divided image. First, a camera is installed so as to capture the center of the subject. Then, the telephoto of the lens is adjusted so that the necessary area of the subject can be photographed, or the lens is exchanged for photographing. The angle of view at this time depends on the resolution of the panoramic image data to be created. When the resolution of panoramic image data is high, the number of divisions at the time of shooting increases. Therefore, it is necessary to reduce the angle of view. Conversely, when the resolution of panoramic image data is low, the number of divisions at the time of shooting may be small, so the angle of view is increased. Next, the camera is rotated along two rotation axes. Actually, the camera is rotated by installing the camera on a rotatable turntable and rotating the turntable. Since the turntable is equipped with a tachometer, the rotation angle of the camera can also be acquired. By rotating the camera, it is possible to photograph not only the central part of the subject but also the entire subject. Specifically, shooting is started from the upper left of the subject, and the entire subject is shot while gradually rotating. The rotation angle at this time depends on the number of divisions at the time of shooting described above. When the number of divisions is small, the rotation angle is large, and when the number of divisions is large, the rotation angle is small. At this time, the rotation angle is adjusted so that overlapping regions (overlapping regions) are formed between adjacent divided images. A specific example of adjustment is shown below.
ここでは、例として所望のパノラマ画像データの解像度が7000×5000であり、カメラの解像度が3000×3000、且つオーバーラップ領域として、分割画像データの1/3を用いる場合を考える。このとき、2枚の分割画像データを横方向に合成すると、図2−2(d)のように分割画像データ301及び302が1/3(1000ピクセル)だけ重なり、オーバーラップ領域303ができる。この結果、合成画像データのサイズは5000×3000になる。このサイズに基づいて分割数を計算すると、分割結果304のように、分割画像数は6枚となる。また、本実施形態では、カメラを回転させることで、被写体全域の撮影を行うが、カメラ自体がレール等によって、上下左右に平行移動するような撮影システムでも構わないし、被写体が平行移動するようなシステムでも構わない。図2−2(a)は、図2−1(b)の方法を用いて全景画像の撮影を行った結果である。この場合、樽型歪みや糸巻き型歪みと呼ばれるレンズの歪みがあるので、その歪みは既存の手法を用いて予め補正しておく。なお、全景画像を一枚の画像データに収めているので、全景画像データの解像度は分割画像データの解像度に比べて高くはない。 Here, as an example, consider the case where the desired panoramic image data resolution is 7000 × 5000, the camera resolution is 3000 × 3000, and 1/3 of the divided image data is used as the overlap region. At this time, when the two pieces of divided image data are combined in the horizontal direction, the divided image data 301 and 302 overlap each other by 1/3 (1000 pixels) as shown in FIG. As a result, the size of the composite image data is 5000 × 3000. When the number of divisions is calculated based on this size, the number of divided images is six as in the division result 304. In this embodiment, the entire area of the subject is photographed by rotating the camera. However, an imaging system in which the camera itself translates vertically and horizontally by a rail or the like may be used. It does not matter even if it is a system. FIG. 2-2 (a) shows the result of taking a panoramic image using the method of FIG. 2-1 (b). In this case, since there is lens distortion called barrel distortion or pincushion distortion, the distortion is corrected in advance using an existing method. It should be noted that since the panoramic image is stored in one piece of image data, the resolution of the panoramic image data is not higher than the resolution of the divided image data.
図2−2(b)は、図2−1(c)の方法を用いて分割画像の撮影を行った結果を示している。縦横それぞれ3分割で撮影された分割画像を示す。各分割画像データは、全景画像データと同様にレンズ歪みが発生しているため、既存の手法を用いて予め補正しておく必要がある。また、図2−2(c)の右図に示すように、各分割画像データでは縦線や横線が斜め方向に歪んだ現象が見られる。これは、カメラの回転により、被写体を斜め方向から撮影しているためである。また、被写体とカメラが平行に設置できていない場合にもこのような歪みが発生する。このような歪みを補正する処理をパース補正と呼び、パース補正を行うことにより、分割された複数の画像を精度よく合成することができる。また、パース補正のみでは、補正しきれない被写体の微小な動きの影響を取り除くため、各分割画像データをメッシュ分割し、メッシュを微小変形させるメッシュ補正処理も実行する必要がある。 FIG. 2-2 (b) shows the result of taking a divided image using the method of FIG. 2-1 (c). A divided image taken in three vertical and horizontal divisions is shown. Since each piece of divided image data has a lens distortion similar to the whole-view image data, it is necessary to correct in advance using an existing method. Further, as shown in the right diagram of FIG. 2-2 (c), in each divided image data, a phenomenon in which vertical lines and horizontal lines are distorted in an oblique direction is seen. This is because the subject is photographed from an oblique direction by rotating the camera. Such distortion also occurs when the subject and the camera cannot be installed in parallel. A process for correcting such distortion is called a parse correction. By performing the parse correction, a plurality of divided images can be synthesized with high accuracy. Further, in order to remove the influence of the minute movement of the subject that cannot be corrected only by the perspective correction, it is necessary to execute mesh correction processing for dividing each divided image data into meshes and minutely deforming the mesh.
図3−1及び図3−2は、パース補正処理及びメッシュ補正処理の概要を説明するための図である。図3−1(a)は、パース補正処理を表している。403は被写体であり、カメラ401で被写体403を撮影する場合を考える。カメラ401は、斜め方向から被写体403を撮影している。このときの画像データの画素位置と被写体位置との関係は、以下の式1で表すことができる。
ImagePos(X,Y)=Screen(Proj*View*Pos(x,y,z))・・・式1
ここで、Pos(x,y,z)は被写体の3次元的な位置を示している。Viewは視点変換行列であり、カメラ401の位置、撮影方向を示す。Projは、3次元から2次元への射影行列であり、カメラの画角を示す。Screen()は、座標系を変換するのに用いられる関数である。X、Yは、画像データの2次元的な配置を示しており、整数値で表される。402は仮想カメラであり、被写体403に対して正面方向に設置されている。仮想カメラ402で撮影される画像データの再現を図ることにより、パース補正処理を実施できる。仮想カメラ402においても、画像データの画素位置と被写体位置との関係を、以下の式2で表すことができる。
ImageVPos(X,Y)=Screen(Proj*ViewV*Pos(x,y,z))・・・式2
ViewVは視点変換行列であり、仮想カメラ402の位置、撮影方向を示す。ViewV以外のパラメータは式1と同じである。ここで、式1と式2とをマージすることにより、
ImageVPos(X,Y)=Func(ImagePos(X0,Y0))・・・式3
が得られる。Func()は、ImageVPos()とImagePos()とを対応付ける関数であり、式1及び式2より得られる。X0、Y0は、X、Yに対応するカメラ401の画像データの座標であり、実数値をとる。これで、ImagePos(X0,Y0)の画素値がわかれば、ImageVPos(X,Y)の画素値を設定できる。即ち、仮想カメラ402の撮像画像データを再現することができる。このとき、X0,Y0は実数値であるので、画素値を取得する場合は実数値間において補間処理が必要となる。
FIGS. 3A and 3B are diagrams for explaining the outline of the perspective correction process and the mesh correction process. FIG. 3A illustrates the perspective correction process. Reference numeral 403 denotes a subject, and a case where the subject 401 is photographed by the camera 401 is considered. The camera 401 is photographing the subject 403 from an oblique direction. The relationship between the pixel position of the image data and the subject position at this time can be expressed by the following
ImagePos (X, Y) = Screen (Proj * View * Pos (x, y, z))
Here, Pos (x, y, z) indicates the three-dimensional position of the subject. View is a viewpoint conversion matrix and indicates the position of the camera 401 and the shooting direction. Proj is a projection matrix from 3D to 2D, and indicates the angle of view of the camera. Screen () is a function used to convert the coordinate system. X and Y indicate a two-dimensional arrangement of image data and are represented by integer values. A virtual camera 402 is installed in the front direction with respect to the subject 403. The perspective correction process can be performed by reproducing the image data captured by the virtual camera 402. Also in the virtual camera 402, the relationship between the pixel position of the image data and the subject position can be expressed by the following
ImageVPos (X, Y) = Screen (Proj * ViewV * Pos (x, y, z))
ViewV is a viewpoint conversion matrix, and indicates the position and shooting direction of the virtual camera 402. Parameters other than ViewV are the same as those in
ImageVPos (X, Y) = Func (ImagePos (X 0 , Y 0 ))...
Is obtained. Func () is a function that associates ImageVPos () with ImagePos (), and is obtained from
図3−1(b)において、カメラ画像データ404は、カメラ401で撮影された画像データである。図中において被写体領域であるグレーの領域が台形状に歪んでいる。これを、式3を用いて、仮想カメラ402により撮影される撮影画像データを再現した結果が仮想カメラ画像データ405である。被写体領域の歪みが補正されていることがわかる。理論的には、レンズ補正、パース補正が行われれば、画像データの合成は分割画像データを配置するだけで可能になる。しかし、実際には旋回台の回転誤差等が原因で、そのまま合成することはできない。そのため、パース補正時のカメラ回転角度等のパラメータを、最適な値に修正する必要がある。更に、被写体の微小な動きの影響を取り除くため、図3−2(a)に示すメッシュ補正が必要となる。メッシュ補正は、各分割画像データを微小変形させる処理である。分割画像データを細かいメッシュ状に分け、メッシュの各格子点を任意の方向に移動させることにより、合成時の細かいずれを補正する。図3−2(b)は、分割画像の撮影位置を取得する方法を示している。カメラと被写体との距離がLで、カメラの回転度数が横方向にθ、縦方向にφであるとする。このとき、分割画像の中心は点(L×tanθ,L×tanφ)を向いているため、これらの値を用いて撮影位置を決定することができる。また同時に、全景画像との位置の対応付けを行うこともできる。
In FIG. 3B, camera image data 404 is image data captured by the camera 401. In the figure, the gray region which is the subject region is distorted in a trapezoidal shape. The virtual camera image data 405 is obtained by reproducing the captured image data photographed by the virtual camera 402 using
図4−1及び図4−2は、パース補正処理及びメッシュ補正処理において、最適なパラメータを検出する手法について説明するための図である。処理全体の流れとしては、初めにパース補正で大まかな補正を行い、次にメッシュ補正で微調整を行う流れとなる。そのため先ず図4−1において、CPU104はパース補正の最適パラメータを決定する。分割画像データ1102と、分割画像データ1102に対応する全景画像データ1101とがあった場合を考える。まず、CPU104は、旋回台の回転計から得られたカメラの回転角度や、レーザ測定等により取得した被写体とカメラとの距離情報をパラメータとして入力し、分割画像データ1102に対してパース補正を実行し、分割画像データ1104を生成する。そして、CPU104は、分割画像データ1104と全景画像データ1101との差分をとった、差分画像データ1103を生成する。差分画像データ1103において、黒い領域は差分値が0、黒以外の領域は差分値が0でないことを示している。理論上はパース補正を行うことにより、差分画像データは全て黒い領域になるはずである。しかし、実際には旋回台の精度が悪い場合などは、回転角度にずれが生じるため、黒以外の領域も発生する。そのため、ずれが生じた分の回転に対して修正する必要がある。そこで、CPU104は、旋回台の回転計から得られたカメラの回転角度に対し、その前後に回転角度が振れるようにパラメータを変更させ、ずれを補正していく。
FIGS. 4A and 4B are diagrams for explaining a technique for detecting an optimum parameter in the perspective correction process and the mesh correction process. As a flow of the entire processing, first, rough correction is performed by the perspective correction, and then fine adjustment is performed by the mesh correction. Therefore, first in FIG. 4A, the
先ず、CPU104は、ある変更したパラメータを用いて、分割画像データ1102に対してパース補正を実行し、分割画像データ1105を生成する。同時に、CPU104は、分割画像データ1105と全景画像データ1101との差分をとった、差分画像データ1106を生成する。すると、差分画像データ1106は、差分画像データ1103と比較すると黒い領域が増えていることがわかる。つまり、差分値の総和が差分画像データ1106の方が小さくなっている。後は、パラメータを変えながらパース補正を繰り返し、差分値の総和が一番小さくなるパラメータを決定すれば、回転角度のずれを修正できる。大抵の場合は、この状態で差分画像データは全て黒い領域になる。しかし、被写体が空調の風等により、微小に動いている場合には、パース補正を行っても黒以外の領域が発生することがある。そのため、図4−2のようなメッシュ補正を実施する。左図がメッシュ補正前で、全景画像データと分割画像データとを重ねた状態である。また、縦線と横線が交わる各点がメッシュの格子点となっており、各格子点の位置は分割画像データの位置から計算できる。左図では、分割画像データの輪郭1107と全景画像データの輪郭1108とにずれがある。そのため、この状態で差分画像データを生成すると、差分値の総和は大きくなる。そこで、輪郭がずれている箇所の近くのメッシュの格子点1109を右図のように移動させると、分割画像データと全景画像データの輪郭が一致するようになる。つまり、差分値の総和が小さくなる。このように、各メッシュの格子点を動かしながら、差分値の総和が最も小さくなる格子点位置を決定すれば、被写体が微小に動いている影響を補正できる。このようにして、各補正の差分値が最小になるように調整すると、合成の精度を向上させることができる。
First, the
図5は、本実施形態におけるパノラマ画像データ合成処理を示すフローチャートである。ステップS201において、CPU104は、図2−1で説明した手法により全景画像の撮影をカメラ装置105に実行させる。全景画像データはカメラ装置105から入力され、RAM106上に展開される。このときCPU104は全景画像データに対してレンズ歪み補正を実施する。ステップS202において、CPU104は所望のパノラマ画像データの解像度から分割数Nを決定し、図2−1で説明した手法によりN枚分の分割画像データの撮影を行う。分割画像データ群もカメラ装置105から入力され、RAM106上に展開される。このときCPU104は分割画像データに対してレンズ歪み補正を実施する。ステップS203において、CPU104は実施する補正処理を決定する。補正処理としてはパース補正処理、メッシュ補正処理があり、パース補正処理で大まかな補正を行い、メッシュ補正処理で微調整を行う流れとなる。そのため、1回目の処理はパース補正処理を選択し、2回目の処理はメッシュ補正処理を選択することになる。ステップS204において、CPU104はRAM106上に変数iを生成し、0に初期化する。また、CPU104は各補正に用いるパラメータもここで初期化する。例えばパース補正の場合に用いられるパラメータは、カメラ位置(XC,YC,ZC)、カメラと被写体との距離L、カメラの回転角(θ,φ)であり、撮影時にレーザ距離計や回転計等で測定した測定値が存在する。さらに、CPU104は、測定値から各パラメータを変化させる範囲を決めておき、その最小値で各パラメータを初期化しておく。メッシュ補正の場合も、各メッシュの座標値(Xm,Ym,Zm)がパラメータであるので、CPU104は撮影時のパラメータから変化する範囲を決めておき、最小値で初期化しておく。また、CPU104は、同時に各パラメータに対し、それぞれ一定のインクリメント値を決めておく。なお、ステップS201は第1の取得手段の処理例であり、ステップS202は第2の取得手段の処理例である。
FIG. 5 is a flowchart showing the panoramic image data synthesis process in the present embodiment. In step S <b> 201, the
ステップS205において、CPU104はi番目の分割画像データに対し、指定されたパラメータを用いてステップS203で選択した補正処理を行う。補正結果は、RAM106上の別の領域に保管される。ステップS206において、CPU104は補正処理を行ったi番目の分割画像データと、それに対応する全景画像データの部分領域との差分値を計算する。このとき、図3−2(b)のように、分割画像データの撮影領域を求めることで、分割画像データと全景画像データとの対応を取ることができる。全景画像データと分割画像データでは解像度が異なるので、差分値が計算できるように、CPU104は全景画像データを分割画像データに合わせて拡大しておく。そして、CPU104は画素毎の差分値を足し合わせて差分値の総和を取り、RAM106上に保管しておく。なお、ステップS205は補正手段の処理例であり、ステップS206は算出手段の処理例である。
In step S205, the
ステップS207において、CPU104は各補正で用いるパラメータに対し、変化する範囲内の全てのパラメータで差分値が計算されたかを判断する。Yesの場合は、ステップS208に進み、Noの場合は、ステップS205に戻り、CPU104は各補正処理のパラメータに対し、ステップS204で算出したインクリメント値を足し合わせ、再度補正処理を実行する。ステップS208において、CPU104はステップS206で計算した差分値の中から最小のものを選択し、その際の補正パラメータを最適パラメータとして決定する。ステップS209において、CPU104はiを1インクリメントし、ステップS210に進む。ステップS210において、CPU104は全分割画像データに対し、補正処理を行ったかどうかを判断する。Yesの場合は、ステップS211に進み、Noの場合は、ステップS205に戻り、CPU104は次の分割画像データを処理する。ステップS211において、CPU104はパース補正処理、メッシュ補正処理の全ての処理を行ったかどうかを判断する。Yesの場合は、ステップS212に進み、Noの場合は、ステップS203に戻り、CPU104は次の補正処理に移る。ステップS212において、CPU104は全ての分割画像データに対して最適パラメータ群を用いて全ての補正処理を行う。そして、CPU104は補正後の各分割画像データ群をつなぎあわせ、パノラマ画像データを生成する。ここでのつなぎあわせ処理は、単純に分割画像データ群を重ね合わせるだけでよく、図3−2(b)のように、CPU104は分割画像データの撮影領域を求め、その位置に分割画像データを重ねていく。以上説明した処理制御を行うことで、高精度なパノラマ画像データを合成することが可能となる。なお、ステップS212は生成手段の処理例である。
In step S207, the
なお、本実施形態では、取りうる全てのパラメータを用いて各補正処理を実行し、その中から最適なパラメータを決定しているが、例えば、遺伝的アルゴリズム等を用いて効率的に最適なパラメータを決定することもできる。また、被写体として絵画等の文化物を用いて説明したが、一般的な広視野の風景等を用いて実現しても同様の効果を得ることができる。 In the present embodiment, each correction process is executed using all possible parameters, and the optimum parameter is determined from among them. For example, the optimum parameter is efficiently used using a genetic algorithm or the like. Can also be determined. In addition, although the description has been made using a cultural object such as a picture as a subject, the same effect can be obtained even if it is realized using a general wide-view landscape.
次に、第2の実施形態について説明する。本実施形態では、パノラマ合成処理を繰り返すことによって、精度と解像度を向上させる手法について説明する。本実施形態のシステム構成、画像の撮影方法及び画像の補正方法については、第1の実施形態と同じであるため、説明を省略する。 Next, a second embodiment will be described. In the present embodiment, a method for improving accuracy and resolution by repeating panorama synthesis processing will be described. Since the system configuration, the image capturing method, and the image correction method of the present embodiment are the same as those of the first embodiment, description thereof will be omitted.
具体的に、3000×2000ピクセルの解像度で撮影可能なカメラを用いて、30000×20000ピクセルのパノラマ画像データを生成する場合を考える。ここでは説明の簡単のため、オーバーラップ領域は考えないものとする。このとき、単純に考えれば、分割数は10×10の100となるが、全景画像データは3000×2000ピクセルの解像度で撮影されるため、分割画像データに比べると解像度が1/10になってしまう。この状態で、全景画像データと分割画像データとの差分値を求めても、全景画像データは10倍に拡大された状態なので十分な精度が出ない。 Specifically, let us consider a case where 30000 × 20000 pixel panoramic image data is generated using a camera capable of photographing at a resolution of 3000 × 2000 pixels. Here, for simplicity of explanation, the overlap region is not considered. At this time, if considered simply, the number of divisions is 10 × 10, but since the panoramic image data is captured with a resolution of 3000 × 2000 pixels, the resolution is 1/10 compared to the divided image data. End up. In this state, even if the difference value between the panoramic image data and the divided image data is obtained, the panoramic image data has been enlarged ten times, so that sufficient accuracy cannot be obtained.
この現象について図6を用いて説明する。まず、分割画像データ1201と、それに対応する全景画像データ1203とがあった場合を考える。ここで、両画像データの差分値を計算するには、分割画像データ1201を拡大し、両画像データのサイズを合わせる必要がある。そこで、CPU104は分割画像データ1201を拡大し、分割拡大画像データ1202を得るが、分割拡大画像データ1202は、拡大処理のためエッジがつぶれてしまい、全景画像データ1203と直接比較するのは難しい。そこでCPU104は、先ず分割数を2×2の4として、パノラマ合成データP(0)を生成する。この場合、差分値の計算においても、全景画像データの拡大率は2倍なので精度上の問題はほとんどない。次にCPU104は、生成したP(0)を全景画像データとして用いて、分割数16(4×4)のパノラマ合成処理を行い、パノラマ合成データP(1)を得る。この場合、前回と同様に、全景画像データP(0)の拡大率は2倍なので、精度上の問題はない。次にCPU104は、生成したP(1)を全景画像データとして用いて、分割数64(8×8)のパノラマ合成処理を行い、パノラマ合成データP(2)を得る。この場合も、前回と同様に、全景画像データP(1)の拡大率は2倍なので精度上の問題はない。最後にCPU104は、生成したP(2)を全景画像データとして用いて、分割数100(10×10)のパノラマ合成処理を行い、パノラマ合成データP(3)を得る。P(3)がこの場合における最終出力パノラマ画像データとなり、解像度と精度を向上させることができる。
This phenomenon will be described with reference to FIG. First, consider the case where there is divided image data 1201 and corresponding
図7は、上述した第2の実施形態における処理をまとめて示したフローチャートである。ステップS501において、第1の実施形態と同様に、CPU104は被写体の全景画像データの撮影をカメラ装置105に実行させる。ステップS502において、CPU104はパノラマ合成処理の実行回数Mと、それぞれの合成処理における分割数N(i)を決定する。上記の例では、Mが4で、N(i)=[4,16,64,100]となる。ステップS503において、CPU104は変数iを0に初期化する。ステップS504において、CPU104はi番目の分割画像データの撮影を行う。ここでN(i)枚の画像データを取得する。ステップS505において、CPU104は、撮影した分割画像データを用いて、第1の実施形態と同様の手法でパノラマ画像データP(i)を生成する。ステップS506において、CPU104は全景画像データをP(i)と差し替える。ステップS507において、CPU104はiを1インクリメントする。ステップS508において、CPU104はi=M−1かどうかの判断を行う。Yesの場合は処理を終了し、最終的なパノラマ合成データとして、P(M−1)が得られる。Noの場合は、ステップS504に戻り、処理を続行する。以上説明した処理制御を行うことで、より高精度且つ高解像度なパノラマ画像データを合成することが可能となる。なお、ステップS506は差替え手段の処理例である。
FIG. 7 is a flowchart collectively showing the processes in the second embodiment described above. In step S501, as in the first embodiment, the
次に、第3の実施形態について説明する。本実施形態では、プロジェクタを用いてパノラマ画像データを生成する手法について説明する。本実施形態のシステム構成、画像の撮影方法及び画像の補正方法については、第1の実施形態と同様であるため、説明を省略する。 Next, a third embodiment will be described. In this embodiment, a method for generating panoramic image data using a projector will be described. Since the system configuration, the image capturing method, and the image correction method of the present embodiment are the same as those of the first embodiment, description thereof will be omitted.
図8は、プロジェクタ投影システムの概略を説明するための図である。パノラマ合成等の画像処理を実行する情報端末605に、パノラマ画像投影用のプロジェクタ603と、投影結果をキャプチャするためのキャプチャカメラ604とが接続されている。また、プロジェクタ603からの投影結果は、被写体601に重ねるように投影領域602に投影する。このとき、プロジェクタのレンズ性能や設置誤差に起因する、投影時の歪みを修正するためキャリブレーション処理を行っておく。
FIG. 8 is a diagram for explaining the outline of the projector projection system. A panorama
図9は、本実施形態のパノラマ画像データの合成処理を示すフローチャートである。ステップS901において、情報端末605のCPU104は所望のパノラマ画像データの解像度から分割数Nを決定し、図2−1及び図2−2で説明した手法でN枚分の分割画像データの撮影を行う。撮影された分割画像データはカメラ装置105から入力され、情報端末605のRAM106上に展開される。ステップS902において、CPU104はRAM106上に変数iを生成し、0に初期化する。また、CPU104はパース補正処理、メッシュ補正処理の各補正処理に対し、パラメータを初期値に設定する。さらに、CPU104は各補正のパラメータに対し、それぞれ一定のインクリメント値を設定しておく。初期化処理については、第1の実施形態で説明しているため、詳細は省略する。ステップS903において、CPU104は分割画像データ群を合成し、パノラマ画像データをRAM106上に生成する。このときの処理を具体的に説明する。
FIG. 9 is a flowchart showing panorama image data synthesis processing according to this embodiment. In step S901, the
まず、CPU104は各補正の指定されたパラメータを用いて補正処理を行う。そして、図3−2(b)のように、CPU104は分割画像データの撮影領域を取得し、その位置に分割画像データを単純に重ね合わせる。これによって、パノラマ合成データを生成することができる。ステップS904において、CPU104は生成したパノラマ画像データを、プロジェクタ603を用いて被写体に投影する。ステップS905において、CPU104は投影結果をキャプチャカメラ604を用いて撮影し、キャプチャ画像データを得る。ステップS906において、CPU104はキャプチャ画像データに対してエッジ抽出処理を行う。エッジ抽出処理は、例えばラプラシアンフィルタやハイパスフィルタ等を用いる。このときの結果を図10(a)に示す。ステップS907において、CPU104はエッジ比較処理を行う。これは、あるエッジの近辺を走査し、類似するエッジを検出する。エッジの類似度としては、エッジをn次曲線に近似した際のパラメータや、エッジを細かい線分に分割した際のそれぞれの傾きと長さ等を用いる。
First, the
ここで、例えば図10(b)に示すように、エッジ701及びエッジ702が検出されたとする。このとき、CPU104は2本のエッジの距離を計算し、エッジ間距離703を算出する。CPU104はこの処理を全エッジに対し実行し、その総和値を求める。ステップS908において、CPU104は各補正で用いるパラメータに対し、変化する範囲内の全てのパラメータでエッジ総和値が計算されたかを判断する。Yesの場合は、ステップS909に進み、Noの場合は、ステップS903に戻り、CPU104は各補正処理のパラメータに対し、ステップS902で算出したインクリメント値を加え、再度パノラマ合成処理を実行する。ステップS909において、CPU104はステップS907で計算したエッジ総和値の中から最小のものを選択し、その際の補正パラメータを最適パラメータとして決定する。ステップS910において、CPU104はiを1インクリメントし、ステップS911に進む。ステップS911において、CPU104は全分割画像データに対し、各補正処理を行ったかどうか(i=N−1かどうか)を判断する。Yesの場合はステップS912に進み、Noの場合は、ステップS903に戻り、次の分割画像データを処理する。ステップS912において、CPU104は各分割画像データに対し、最適パラメータ群を用いて各補正処理を行い、パノラマ合成データを生成する。
Here, for example, as shown in FIG. 10B, it is assumed that an edge 701 and an edge 702 are detected. At this time, the
以上説明した処理制御を行うことで、高精度なパノラマ画像データを合成することが可能となる。さらに、実際の被写体上に合成結果を投影するので、被写体に対する忠実再現度が一見してわかる。 By performing the processing control described above, it is possible to synthesize high-accuracy panoramic image data. Furthermore, since the synthesis result is projected onto the actual subject, the faithful reproducibility for the subject can be seen at a glance.
次に、第4の実施形態について説明する。本実施形態では、プロジェクタの投影領域を変化させることによって、精度と解像度を向上させる手法について説明する。本実施形態のシステム構成、画像の撮影方法及び画像の補正方法については、第1の実施形態と同様であるため、説明を省略する。 Next, a fourth embodiment will be described. In this embodiment, a method for improving accuracy and resolution by changing the projection area of the projector will be described. Since the system configuration, the image capturing method, and the image correction method of the present embodiment are the same as those of the first embodiment, description thereof will be omitted.
3000×2000ピクセルの解像度で投影可能なプロジェクタを用いて、30000×20000ピクセルのパノラマ画像データを生成する場合を考える。ここでは、分かりやすいようにオーバーラップ領域は考えないものとする。単純に、被写体全域にプロジェクタで投影を行った場合、投影画像の解像度は3000×2000ピクセルのため、生成後のパノラマ画像データに比べると解像度が1/10になってしまう。この状態でエッジ間の距離を求めても、投影画像は10倍に拡大された状態なので十分な精度が出ない。この現象については第2の実施形態と同様であるので、詳細な説明は省略する。そこで、CPU104はプロジェクタの投影領域を、10×10の100個の領域に分割する。そして、CPU104は、それぞれの領域において、対応するパノラマ画像データの一部を投影する。この様子を、図11(a)に示す。プロジェクタ803は、投影領域802を絞り込んで投影している。このとき、投影する画像は、図11(b)のように、パノラマ画像データ805の中の投影領域802に対応する領域である投影画像806となる。あとは、投影領域を上下左右に移動しながら、投影画像を変化させ、第3の実施形態と同様の処理を繰り返す。
Consider a case where panoramic image data of 30000 × 20000 pixels is generated using a projector capable of projecting at a resolution of 3000 × 2000 pixels. Here, it is assumed that the overlap region is not considered for easy understanding. Simply, when the projection is performed on the entire object by the projector, the resolution of the projected image is 3000 × 2000 pixels, so that the resolution is 1/10 compared to the generated panoramic image data. Even if the distance between the edges is obtained in this state, the projection image is magnified 10 times, so that sufficient accuracy cannot be obtained. Since this phenomenon is the same as in the second embodiment, a detailed description thereof is omitted. Therefore, the
図12は、上述した第4の実施形態における処理をまとめて示したフローチャートである。ステップS1001において、CPU104はパノラマ合成処理nの分割数Nと、それに対応するプロジェクタ投影領域R(i)を設定する。ステップS1002において、CPU104は変数iを0に初期化する。ステップS1003において、CPU104は分割画像データの撮影をカメラ装置105に実行させる。ここで、N枚の分割画像データを取得する。ステップS1004において、CPU104は撮影した分割画像データを用いて、パノラマ画像データを生成する。ステップS1005において、CPU104は投影領域R(i)に対応するパノラマ画像データの一部を、プロジェクタに投影する。ステップS1006において、CPU104は第3の実施形態と同様の各補正処理を行う。ステップS1007において、CPU104はiを1インクリメントする。ステップS1008において、CPU104はi=N−1かどうかの判断を行う。Yesの場合は処理を終了し、最終的なパノラマ画像データが得られる。Noの場合は、ステップS1005に戻り、処理を続行する。
FIG. 12 is a flowchart collectively showing the processes in the above-described fourth embodiment. In step S1001, the
以上説明した処理制御を行うことで、より高精度且つ高解像度なパノラマ画像データを合成することが可能となる。さらに、実際の被写体上に合成結果を投影するので、被写体に対する忠実再現度が一見してわかる。 By performing the processing control described above, it is possible to synthesize panoramic image data with higher accuracy and higher resolution. Furthermore, since the synthesis result is projected onto the actual subject, the faithful reproducibility for the subject can be seen at a glance.
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。 The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
Claims (6)
前記被写体の分割画像データを取得する第2の取得手段と、
前記第2の取得手段により取得された各分割画像データと、当該分割画像データに対応する領域の前記全景画像データとの差分値を算出する算出手段と、
前記算出手段により算出された差分値に応じた補正処理を前記各分割画像データに対して実行する補正手段と、
前記補正手段により補正された前記各分割画像データを合成してパノラマ画像データを生成する生成手段とを有することを特徴とする画像処理装置。 First acquisition means for acquiring panoramic image data of a subject;
Second acquisition means for acquiring divided image data of the subject;
Calculation means for calculating a difference value between each divided image data acquired by the second acquisition means and the whole-view image data in an area corresponding to the divided image data;
Correction means for executing correction processing according to the difference value calculated by the calculation means for each of the divided image data;
An image processing apparatus comprising: generating means for generating panoramic image data by combining the divided image data corrected by the correcting means.
前記第2の取得手段は、前記差替え手段により差し替えされた前記パノラマ画像データを分割した分割画像データを取得することを特徴とする請求項1に記載の画像処理装置。 A replacement means for replacing the panoramic image data with the panoramic image data;
The image processing apparatus according to claim 1, wherein the second acquisition unit acquires divided image data obtained by dividing the panoramic image data replaced by the replacement unit.
被写体の全景画像データを取得する第1の取得ステップと、
前記被写体の分割画像データを取得する第2の取得ステップと、
前記第2の取得ステップにより取得された各分割画像データと、当該分割画像データに対応する領域の前記全景画像データとの差分値を算出する算出ステップと、
前記算出ステップにより算出された差分値に応じた補正処理を前記各分割画像データに対して実行する補正ステップと、
前記補正ステップにより補正された前記各分割画像データを合成してパノラマ画像データを生成する生成ステップとを含むことを特徴とする画像処理方法。 An image processing method by an image processing apparatus,
A first acquisition step of acquiring panoramic image data of a subject;
A second acquisition step of acquiring divided image data of the subject;
A calculation step of calculating a difference value between each of the divided image data acquired by the second acquisition step and the whole-view image data of an area corresponding to the divided image data;
A correction step of executing correction processing corresponding to the difference value calculated in the calculation step for each of the divided image data;
And a generating step of generating panoramic image data by combining the divided image data corrected in the correcting step.
前記被写体の分割画像データを取得する第2の取得ステップと、
前記第2の取得ステップにより取得された各分割画像データと、当該分割画像データに対応する領域の前記全景画像データとの差分値を算出する算出ステップと、
前記算出ステップにより算出された差分値に応じた補正処理を前記各分割画像データに対して実行する補正ステップと、
前記補正ステップにより補正された前記各分割画像データを合成してパノラマ画像データを生成する生成ステップとをコンピュータに実行させるためのプログラム。 A first acquisition step of acquiring panoramic image data of a subject;
A second acquisition step of acquiring divided image data of the subject;
A calculation step of calculating a difference value between each of the divided image data acquired by the second acquisition step and the whole-view image data of an area corresponding to the divided image data;
A correction step of executing correction processing corresponding to the difference value calculated in the calculation step for each of the divided image data;
A program for causing a computer to execute a generation step of generating panoramic image data by combining the divided image data corrected in the correction step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010022429A JP2011160354A (en) | 2010-02-03 | 2010-02-03 | Image processing device, image processing method, and program therefor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010022429A JP2011160354A (en) | 2010-02-03 | 2010-02-03 | Image processing device, image processing method, and program therefor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011160354A true JP2011160354A (en) | 2011-08-18 |
Family
ID=44591895
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010022429A Pending JP2011160354A (en) | 2010-02-03 | 2010-02-03 | Image processing device, image processing method, and program therefor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011160354A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017152931A (en) * | 2016-02-24 | 2017-08-31 | 株式会社Tbwa Hakuhodo | Photographing system and program |
JP2017200118A (en) * | 2016-04-28 | 2017-11-02 | 中国電力株式会社 | Obstacle confirmation device and obstacle confirmation method |
-
2010
- 2010-02-03 JP JP2010022429A patent/JP2011160354A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017152931A (en) * | 2016-02-24 | 2017-08-31 | 株式会社Tbwa Hakuhodo | Photographing system and program |
JP2017200118A (en) * | 2016-04-28 | 2017-11-02 | 中国電力株式会社 | Obstacle confirmation device and obstacle confirmation method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5906028B2 (en) | Image processing apparatus and image processing method | |
JP6568223B2 (en) | Projection device, projection method, and projection program | |
JP4010754B2 (en) | Image processing apparatus, image processing method, and computer-readable recording medium | |
KR100914211B1 (en) | Distortion image correction device and method | |
JP5445461B2 (en) | Pixel position correspondence specifying system, pixel position correspondence specifying method, and pixel position correspondence specifying program | |
TWI387935B (en) | Image generation method, program therefor, and storage medium for storing the program | |
EP2138976A2 (en) | Synthesis of a panoramic high-resolution image from multiple images | |
JP2012185808A (en) | Image processing device, image processing method, computer program and imaging apparatus | |
JP5984493B2 (en) | Image processing apparatus, image processing method, imaging apparatus, and program | |
JP6253280B2 (en) | Imaging apparatus and control method thereof | |
JP2009037301A (en) | Generation method of free viewpoint image by local region segmentation | |
JP4871820B2 (en) | Video display system and parameter generation method for the system | |
JP6594170B2 (en) | Image processing apparatus, image processing method, image projection system, and program | |
JP2014010783A (en) | Image processing apparatus, image processing method, and program | |
JP5566199B2 (en) | Image processing apparatus, control method therefor, and program | |
JP2005063041A (en) | Three-dimensional modeling apparatus, method, and program | |
JP5151922B2 (en) | Pixel position correspondence specifying system, pixel position correspondence specifying method, and pixel position correspondence specifying program | |
JP2011160354A (en) | Image processing device, image processing method, and program therefor | |
JP2008003683A (en) | Image generating apparatus and method, and recording medium | |
JP5340021B2 (en) | Image processing apparatus, image processing method, and program | |
JP6972089B2 (en) | Image processing equipment, image processing methods, and programs | |
JP7541862B2 (en) | Image processing device and image processing method | |
JP6320165B2 (en) | Image processing apparatus, control method therefor, and program | |
JP2018191050A (en) | Image processing apparatus, image processing method, and program | |
JP2017162313A (en) | Image processing device, image processing method and program |