JP2020057182A - Image processing device, image processing method, and program - Google Patents

Image processing device, image processing method, and program Download PDF

Info

Publication number
JP2020057182A
JP2020057182A JP2018187089A JP2018187089A JP2020057182A JP 2020057182 A JP2020057182 A JP 2020057182A JP 2018187089 A JP2018187089 A JP 2018187089A JP 2018187089 A JP2018187089 A JP 2018187089A JP 2020057182 A JP2020057182 A JP 2020057182A
Authority
JP
Japan
Prior art keywords
image
feature point
conversion matrix
calculated
conversion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2018187089A
Other languages
Japanese (ja)
Inventor
八幡 尚
Takashi Hachiman
尚 八幡
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2018187089A priority Critical patent/JP2020057182A/en
Publication of JP2020057182A publication Critical patent/JP2020057182A/en
Pending legal-status Critical Current

Links

Images

Abstract

To enable obtainment of a natural video even when frames of multiple videos are connected to each other at ends thereof.SOLUTION: An image processing device 100 includes an image acquisition unit 11 that acquires, in units of frame, a first image and a second image that has an end shared with the first image, a conversion matrix calculation unit 15 that calculates a conversion matrix on the basis of the correspondence between features in the respective images, an error calculation unit 17 that calculates an error when conversion using the conversion matrix is performed, a conversion matrix selection unit 18 that selects a conversion matrix in which the error calculated in a prescribed frame by the error calculating means satisfies a prescribed condition, and an image generation unit 19 that generates an image obtained by connecting the first image and the second image to each other using the selected conversion matrix. The conversion matrix selection unit 18 selects the conversion matrix in which the prescribed condition is satisfied, from among a conversion matrix selected in a frame preceding the prescribed frame and a plurality of conversion matrixes calculated in the prescribed frame.SELECTED DRAWING: Figure 1

Description

本発明は、画像処理装置、画像処理方法及びプログラムに関する。   The present invention relates to an image processing device, an image processing method, and a program.

複数の画像をつなぎ合わせて大きな画像を生成する技術が知られている。例えば、特許文献1には、魚眼レンズで撮影されたような比較的歪み量の大きな画像であっても、歪み補正パラメータを使い分けることによって高精度につなぎ合わせることを可能にした画像処理技術が開示されている。   A technique for connecting a plurality of images to generate a large image is known. For example, Patent Literature 1 discloses an image processing technology that enables high-accuracy splicing of images having relatively large distortion amounts, such as those shot with a fisheye lens, by properly using distortion correction parameters. ing.

特開2016−27744号公報JP 2016-27744 A

特許文献1に開示されている画像処理技術においては、つなぎ合わせる画像は静止画であることを前提としており、動画像をつなぎ合わせることは想定されていない。もっとも、動画像もフレーム単位で見れば静止画なので、動画像をフレーム単位で扱うことによって、特許文献1に開示されている画像処理技術を用いて、動画像をフレーム単位でつなぎ合わせることは可能である。しかし、そのような処理を行うと、処理はフレーム毎に完結し、フレーム間の関係を考慮することができないため、不自然な動画像が得られてしまう場合がある。例えば、フレーム単位では自然なつなぎ合わせが行われていても、フレーム間では画像が微妙にずれてしまう場合があり、この場合、動画像としてはブレが生じる不自然な動画像になってしまう。   In the image processing technology disclosed in Patent Literature 1, it is assumed that images to be connected are still images, and it is not assumed to connect moving images. However, since moving images are still images when viewed in frame units, it is possible to connect moving images in frame units by using the image processing technology disclosed in Patent Document 1 by treating moving images in frame units. It is. However, if such processing is performed, the processing is completed for each frame, and the relationship between frames cannot be considered, so that an unnatural moving image may be obtained. For example, even if natural splicing is performed on a frame-by-frame basis, the image may be slightly shifted between frames, and in this case, the moving image becomes an unnatural moving image in which blur occurs.

本発明は、上記実情に鑑みてなされたものであり、複数の動画像について、各動画像のフレーム同士をその端部でつなぎ合わせる場合であっても、自然な動画像を得ることができる画像処理装置、画像処理方法及びプログラムを提供することを目的とする。   The present invention has been made in view of the above-described circumstances, and, for a plurality of moving images, an image that can obtain a natural moving image even when frames of each moving image are connected at their ends. It is an object to provide a processing device, an image processing method, and a program.

上記目的を達成するため、本発明の画像処理装置は、
第1の画像と、前記第1の画像と互いに端部が共通する第2の画像と、をそれぞれフレーム単位で取得する画像取得手段と、
前記画像取得手段が取得した前記第1の画像と前記第2の画像とで共通する領域である共通領域を特定する共通領域特定手段と、
前記共通領域特定手段により特定された前記共通領域において、前記第1の画像と前記第2の画像とで対応する特徴点のペアを特定する特徴点特定手段と、
前記特徴点特定手段により特定された特徴点のペアに基づき、前記第1の画像中の第1の特徴点を始点とし、前記第1の特徴点に対応する前記第2の画像中の第2の特徴点を終点とする、移動ベクトルを複数算出する移動ベクトル算出手段と、
前記移動ベクトル算出手段により算出された複数の移動ベクトルから選定された選定移動ベクトルに基づいて変換行列を算出する変換行列算出手段と、
前記変換行列算出手段により算出された変換行列を用いて、前記第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出する変換手段と、
前記第2の特徴点の位置と前記変換手段により算出された前記移動後特徴点の位置との間の誤差を算出する誤差算出手段と、
所定のフレームにおいて、前記変換行列算出手段により算出された複数の変換行列の中から、前記誤差算出手段により算出された誤差が所定の条件を満たす変換行列を選出する変換行列選出手段と、
前記変換行列選出手段が選出した変換行列を用いて前記第1の画像と前記第2の画像とをつなぎ合わせた画像を生成する画像生成手段と、
を備え、
前記変換行列選出手段は、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて前記変換行列算出手段で算出された複数の変換行列の中から、所定の条件を満たす変換行列を選出する。
In order to achieve the above object, an image processing apparatus according to the present invention includes:
Image acquisition means for acquiring each of the first image and the second image having an end common to the first image in frame units;
Common area specifying means for specifying a common area that is an area common between the first image and the second image obtained by the image obtaining means;
A feature point specifying unit that specifies a pair of corresponding feature points in the first image and the second image in the common region specified by the common region specifying unit;
Based on a pair of feature points specified by the feature point specifying means, a first feature point in the first image is set as a starting point, and a second feature point in the second image corresponding to the first feature point is set. A movement vector calculation unit that calculates a plurality of movement vectors, ending with the feature point of
Conversion matrix calculation means for calculating a conversion matrix based on a selected movement vector selected from the plurality of movement vectors calculated by the movement vector calculation means,
A conversion unit that calculates a position of a post-movement feature point that is a position obtained by converting the position of the first feature point in the first image, using the conversion matrix calculated by the conversion matrix calculation unit;
Error calculation means for calculating an error between the position of the second feature point and the position of the moved feature point calculated by the conversion means;
In a predetermined frame, from among the plurality of conversion matrices calculated by the conversion matrix calculation unit, a conversion matrix selection unit that selects a conversion matrix whose error calculated by the error calculation unit satisfies a predetermined condition,
Image generation means for generating an image obtained by joining the first image and the second image using the conversion matrix selected by the conversion matrix selection means;
With
The conversion matrix selection unit is a conversion matrix that satisfies a predetermined condition from a conversion matrix selected in a frame before the predetermined frame and a plurality of conversion matrices calculated by the conversion matrix calculation unit in the predetermined frame. Select a matrix.

本発明によれば、複数の動画像について、各動画像のフレーム同士をその端部でつなぎ合わせる場合であっても、自然な動画像を得ることができる。   According to the present invention, a natural moving image can be obtained for a plurality of moving images even when frames of the moving images are connected at their ends.

実施形態1に係る画像処理装置の機能構成を示す図である。FIG. 2 is a diagram illustrating a functional configuration of the image processing apparatus according to the first embodiment. 実施形態1に係る画像処理のフローチャートである。3 is a flowchart of image processing according to the first embodiment. 真上方向の半天球画像と真下方向の半天球画像における共通領域を説明する図である。It is a figure explaining the common area | region in the hemispherical image of a head-on direction and the hemispherical image of a head-down direction. 真上方向の半天球画像中の共通領域を極座標展開した図である。It is the figure which expanded the common area | region in the semi-celestial sphere image of the top direction in polar coordinates. 真下方向の半天球画像中の共通領域を極座標展開した図である。It is the figure which expanded the common area | region in the semi-celestial sphere image of the downward direction in polar coordinates. 真上方向の半天球画像と真下方向から5度ずれた状態の半天球画像における共通領域を説明する図である。It is a figure explaining the common area | region in the semi-celestial sphere image of the state which shifted | deviated 5 degrees from the semi-celestial sphere image of a head-on direction and the head-down direction. 真上方向の半天球画像中の共通領域を極座標展開した図である。It is the figure which expanded the common area | region in the semi-celestial sphere image of the top direction in polar coordinates. 真下方向から5度ずれた状態の半天球画像中の共通領域を極座標展開した図である。It is the figure which expanded the common area | region in the semi-celestial sphere image in the state shifted | deviated from right below by 5 degrees in polar coordinates. 移動ベクトルを説明する図である。It is a figure explaining a movement vector. 移動ベクトルと変換後ベクトルとを重ねて表示した図である。It is the figure which superimposedly displayed the movement vector and the vector after conversion. 第1の画像と第2の画像がつなぎ合わされる例を説明する図である。FIG. 5 is a diagram illustrating an example in which a first image and a second image are joined. 第1の画像と第2の画像をそのままつなぎ合わせた例を説明する図である。FIG. 7 is a diagram illustrating an example in which a first image and a second image are directly connected. 第1の画像を変換してから第2の画像とつなぎ合わせた例を説明する図である。FIG. 9 is a diagram illustrating an example in which a first image is converted and then connected to a second image. あるフレームにおいて第1の画像と第2の画像をつなぎ合わせて生成した画像の一例である。5 is an example of an image generated by joining a first image and a second image in a certain frame. 次のフレームにおいて前フレームでの変換行列を考慮せずに第1の画像と第2の画像をつなぎ合わせて生成した画像の一例である。13 is an example of an image generated by joining a first image and a second image in a next frame without considering a transformation matrix in a previous frame. 不自然な動画が生成される例を説明する図である。FIG. 4 is a diagram illustrating an example in which an unnatural moving image is generated. 変形例4に係る画像処理のフローチャートである。14 is a flowchart of image processing according to Modification Example 4. 変形例5に係る画像処理のフローチャートである。15 is a flowchart of image processing according to Modification Example 5. 変形例6に係る画像処理のフローチャートである。15 is a flowchart of image processing according to Modification 6.

以下、本発明の実施形態に係る画像処理装置について、図表を参照して説明する。なお、図中同一又は相当部分には同一符号を付す。   Hereinafter, an image processing apparatus according to an embodiment of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts have the same reference characters allotted.

(実施形態1)
本発明の実施形態1に係る画像処理装置は、複数の動画像について、各動画像のフレーム同士をその端部でつなぎ合わせることにより、全天球画像やパノラマ画像のような広範囲画像の自然な動画像を生成する装置である。
(Embodiment 1)
The image processing apparatus according to the first embodiment of the present invention connects natural image frames of a wide range image such as a celestial sphere image or a panoramic image by connecting frames of each moving image at an end of the plurality of moving images. This is a device that generates a moving image.

図1に示すように、本発明の実施形態1に係る画像処理装置100は、制御部10、記憶部20、第1撮像部31、第2撮像部32、を備える。   As shown in FIG. 1, the image processing apparatus 100 according to the first embodiment of the present invention includes a control unit 10, a storage unit 20, a first imaging unit 31, and a second imaging unit 32.

制御部10は、CPU(Central Processing Unit)等で構成され、記憶部20に記憶されたプログラムを実行することにより、後述する各部(画像取得部11、共通領域特定部12、特徴点特定部13、移動ベクトル算出部14、変換行列算出部15、変換部16、誤差算出部17、変換行列選出部18、画像生成部19)の機能を実現する。   The control unit 10 is configured by a CPU (Central Processing Unit) or the like, and executes programs stored in the storage unit 20 to thereby control each unit (an image acquisition unit 11, a common area identification unit 12, a feature point identification unit 13) described later. , The functions of the motion vector calculation unit 14, the conversion matrix calculation unit 15, the conversion unit 16, the error calculation unit 17, the conversion matrix selection unit 18, and the image generation unit 19).

記憶部20は、ROM(Read Only Memory)、RAM(Random Access Memory)等で構成される。ROMには制御部10のCPUが実行するプログラム及びプログラムを実行する上で予め必要なデータが記憶されている。RAMには、プログラム実行中に作成されたり変更されたりするデータが記憶される。   The storage unit 20 includes a ROM (Read Only Memory), a RAM (Random Access Memory), and the like. The ROM stores a program to be executed by the CPU of the control unit 10 and data necessary for executing the program in advance. The RAM stores data created or changed during the execution of the program.

第1撮像部31及び第2撮像部32は、それぞれ単眼の撮像装置(カメラ)を備える。第1撮像部31は、例えば30fps(frames per second)で第1の画像(フレーム単位で撮影される動画像)を撮影する。第2撮像部32も、例えば30fpsで第2の画像(フレーム単位で撮影される動画像)を撮影する。第1撮像部31が撮影した第1の画像と第2撮像部32が撮影した第2の画像とは、それぞれの端部の少なくとも一部が共通するように、第1撮像部31及び第2撮像部32の撮影方向が設定される。   The first imaging unit 31 and the second imaging unit 32 each include a monocular imaging device (camera). The first imaging unit 31 captures a first image (a moving image captured in frame units) at, for example, 30 fps (frames per second). The second imaging unit 32 also captures a second image (moving image captured in frame units) at, for example, 30 fps. The first image captured by the first image capturing unit 31 and the second image captured by the second image capturing unit 32 are configured such that the first image capturing unit 31 and the second image The shooting direction of the imaging unit 32 is set.

例えば、第1撮像部31も第2撮像部32も画角200度の半天球画像を撮影する魚眼レンズを搭載した撮像装置で、第1撮像部31と第2撮像部32とはお互いに真逆方向(例えば第1撮像部31は真上方向、第2撮像部32は真下方向)を撮影するように設置される。   For example, both the first imaging unit 31 and the second imaging unit 32 are imaging devices equipped with a fisheye lens that captures a semi-celestial sphere image with an angle of view of 200 degrees, and the first imaging unit 31 and the second imaging unit 32 are opposite to each other. The camera is installed so as to shoot in a direction (for example, the first imaging unit 31 is in a direction directly above, and the second imaging unit 32 is in a direction directly below).

次に、画像処理装置100の制御部10の機能的構成について説明する。制御部10は、画像取得部11、共通領域特定部12、特徴点特定部13、移動ベクトル算出部14、変換行列算出部15、変換部16、誤差算出部17、変換行列選出部18、画像生成部19、の機能を実現する。   Next, a functional configuration of the control unit 10 of the image processing apparatus 100 will be described. The control unit 10 includes an image acquisition unit 11, a common region identification unit 12, a feature point identification unit 13, a movement vector calculation unit 14, a conversion matrix calculation unit 15, a conversion unit 16, an error calculation unit 17, a conversion matrix selection unit 18, an image The function of the generation unit 19 is realized.

画像取得部11は、第1撮像部31が撮影した画像を第1の画像としてフレーム単位で取得し、第2撮像部32が撮影した画像を第2の画像としてフレーム単位で取得する。なお、画像取得部11は、第1撮像部31が撮影した画像や第2撮像部32が撮影した画像をリアルタイムで取得してもよいし、リアルタイムで取得しなくてもよい。リアルタイムに取得しない場合は、例えば、第1撮像部31が撮影した画像や第2撮像部32が撮影した画像は記憶部20に保存されるようになっており、撮影が終了してから、画像取得部11が、記憶部20から第1撮像部31が撮影した画像や第2撮像部32が撮影した画像を取得するようにしてもよい。画像取得部11は、画像取得手段として機能する。   The image acquisition unit 11 acquires an image captured by the first imaging unit 31 as a first image in frame units, and acquires an image captured by the second imaging unit 32 as a second image in frame units. Note that the image acquisition unit 11 may or may not acquire the image captured by the first imaging unit 31 or the image captured by the second imaging unit 32 in real time. When the image is not acquired in real time, for example, the image captured by the first imaging unit 31 and the image captured by the second imaging unit 32 are stored in the storage unit 20. The acquisition unit 11 may acquire an image captured by the first imaging unit 31 or an image captured by the second imaging unit 32 from the storage unit 20. The image obtaining unit 11 functions as an image obtaining unit.

共通領域特定部12は、画像取得部11が取得した(第1撮像部31が撮影した)第1の画像と(第2撮像部32が撮影した)第2の画像とで共通する撮影領域(共通領域)を特定する。上述したように、第1の画像と第2の画像とは、それぞれの端部の少なくとも一部が共通しているが、この共通している端部が共通領域である。共通領域特定部12は、この共通領域を特定する。共通領域特定部12は共通領域特定手段として機能する。例えば、第1撮像部と第2撮像部に地磁気センサや加速度センサを設けておいて、共通領域特定部12は、撮影時の第1撮像部31と第2撮像部32の向きに関する情報をこれらのセンサから取得する。そして、共通領域特定部12は、予め記憶しておいた第1撮像部31と第2撮像部32との画角の範囲情報と、第1撮像部31と第2撮像部32の向きに関する情報とに基づいて共通領域を特定するようにしてもよい。   The common area specifying unit 12 is configured to capture an image area common to the first image acquired by the image acquisition unit 11 (taken by the first imaging unit 31) and the second image (taken by the second imaging unit 32). Common area). As described above, the first image and the second image have at least a part of their respective ends in common, and the common end is a common area. The common area specifying unit 12 specifies the common area. The common area specifying unit 12 functions as a common area specifying unit. For example, a geomagnetic sensor or an acceleration sensor is provided in the first imaging unit and the second imaging unit, and the common area specifying unit 12 transmits information on the orientation of the first imaging unit 31 and the second imaging unit 32 at the time of shooting. From the sensor. Then, the common area specifying unit 12 stores the information on the angle of view range of the first imaging unit 31 and the second imaging unit 32 stored in advance and the information on the orientation of the first imaging unit 31 and the second imaging unit 32. The common area may be specified based on the above.

特徴点特定部13は、共通領域特定部12が特定した共通領域において、第1の画像中の特徴点と、第2の画像中の特徴点と、の対応付けを行い、対応する特徴点のペアを特定する。特徴点とは、画像中のエッジ、角、模様等の特徴的な部分のことを言う。特徴点特定部13は、例えば、第1の画像から抽出した特徴点の特徴量に基づいて、該特徴点と特徴量が類似する特徴点を第2の画像から探索することによって、第1の画像中の特徴点と第2の画像中の特徴点との対応付けを行う。特徴点特定部13は特徴点特定手段として機能する。   The feature point identifying unit 13 associates the feature points in the first image with the feature points in the second image in the common area identified by the common area identifying unit 12, and sets the corresponding feature points. Identify the pair. The feature points refer to characteristic portions such as edges, corners, and patterns in the image. The feature point specifying unit 13 searches the second image for a feature point having a feature amount similar to the feature point based on the feature amount of the feature point extracted from the first image, for example. The feature points in the image are associated with the feature points in the second image. The feature point specifying unit 13 functions as a feature point specifying unit.

移動ベクトル算出部14は、特徴点特定部13により特定された特徴点のペアに基づき、第1の画像中の第1の特徴点を始点とし、第1の特徴点に対応する第2の画像中の第2の特徴点を終点とする、移動ベクトルを算出する。この移動ベクトルは、特徴点特定部13により特定された特徴点のペアの数だけ存在するので、移動ベクトル算出部14は、第1移動ベクトルを複数(特定された特徴点のペアの数)算出する。移動ベクトル算出部14は、移動ベクトル算出手段として機能する。   The movement vector calculation unit 14 uses the first feature point in the first image as a starting point based on the pair of feature points identified by the feature point identification unit 13, and generates a second image corresponding to the first feature point. A movement vector having the second feature point therein as an end point is calculated. Since the number of motion vectors is equal to the number of pairs of feature points specified by the feature point specifying unit 13, the motion vector calculation unit 14 calculates a plurality of first motion vectors (the number of pairs of specified feature points). I do. The movement vector calculation unit 14 functions as a movement vector calculation unit.

変換行列算出部15は、移動ベクトル算出部14により算出された複数の移動ベクトルの中から規定数(2次元空間上での変換行列を算出するなら4、3次元空間上での変換行列を算出するなら5)のベクトル(選定移動ベクトル)を選定し、この選定した選定移動ベクトルに基づいて、変換行列(射影変換行列)を算出する。選定移動ベクトルの選定を変更することによって、変換行列算出部15は、複数の変換行列を算出することができる。変換行列算出部15は変換行列算出手段として機能する。   The conversion matrix calculation unit 15 calculates a specified number (for calculating a conversion matrix in a two-dimensional space, a conversion matrix in a three-dimensional space) from a plurality of movement vectors calculated by the movement vector calculation unit 14. If so, the vector (selected movement vector) of 5) is selected, and a transformation matrix (projection transformation matrix) is calculated based on the selected movement vector. By changing the selection of the selected movement vector, the conversion matrix calculation unit 15 can calculate a plurality of conversion matrices. The transformation matrix calculator 15 functions as a transformation matrix calculator.

変換部16は、変換行列算出部15により算出された変換行列を用いて、第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出する。変換部16は変換手段として機能する。   The conversion unit 16 uses the conversion matrix calculated by the conversion matrix calculation unit 15 to calculate the position of the moved feature point, which is the position obtained by converting the position of the first feature point in the first image. The conversion unit 16 functions as a conversion unit.

誤差算出部17は、第1の特徴点に対応する第2の画像中の第2の特徴点の位置と変換部16により算出された移動後特徴点の位置との間の誤差を算出する。第2の特徴点は第1の特徴点のそれぞれに対応する形で複数存在し、変換部16により算出された移動後特徴点も第1の特徴点のそれぞれに対応する形で複数存在するので、各特徴点について誤差が得られる。誤差算出部17は、これらの誤差を評価する値として、後述する種々の評価値を算出する。誤差算出部17は、誤差算出手段として機能する。   The error calculation unit 17 calculates an error between the position of the second feature point in the second image corresponding to the first feature point and the position of the moved feature point calculated by the conversion unit 16. Since a plurality of second feature points exist in a form corresponding to each of the first feature points, and a plurality of post-movement feature points calculated by the conversion unit 16 also exist in a form corresponding to each of the first feature points. , An error is obtained for each feature point. The error calculating unit 17 calculates various evaluation values described later as values for evaluating these errors. The error calculator 17 functions as an error calculator.

変換行列選出部18は、変換行列算出部15により算出された複数の変換行列の中から、誤差算出部17により算出された誤差が所定の条件を満たす変換行列を選出する。変換行列選出部18は、変換行列選出手段として機能する。   The transformation matrix selection unit 18 selects a transformation matrix whose error calculated by the error calculation unit 17 satisfies a predetermined condition from among the plurality of transformation matrices calculated by the conversion matrix calculation unit 15. The transformation matrix selection unit 18 functions as a transformation matrix selection unit.

画像生成部19は、変換行列選出部18が選出した変換行列を用いて第1の画像と第2の画像とをつなぎ合わせた画像を生成する。画像生成部19は、画像生成手段として機能する。   The image generation unit 19 generates an image by joining the first image and the second image using the conversion matrix selected by the conversion matrix selection unit 18. The image generator 19 functions as an image generator.

以上、画像処理装置100の機能構成について説明した。次に、画像処理装置100による画像処理について図2を参照して説明する。この画像処理は、ユーザの指示によって開始される。   The functional configuration of the image processing apparatus 100 has been described above. Next, image processing by the image processing apparatus 100 will be described with reference to FIG. This image processing is started by a user's instruction.

まず、画像取得部11は、第1撮像部31が撮影した動画像の最初のフレーム(後述するステップS113から戻ってきた時は、次のフレーム)を第1の画像として取得し、第2撮像部32が撮影した動画像の最初のフレーム(後述するステップS113から戻ってきた時は、次のフレーム)を第2の画像として取得する(ステップS101)。   First, the image acquisition unit 11 acquires the first frame of the moving image captured by the first imaging unit 31 (the next frame when returning from step S113 to be described later) as the first image, and The first frame of the moving image captured by the unit 32 (the next frame when returning from step S113 described later) is acquired as a second image (step S101).

例えば図3に示すように、第1撮像部31は真上方向の半天球画像51を画角200度で撮影する魚眼レンズを搭載した撮像装置で、第2撮像部32は真下方向の半天球画像52を画角200度で撮影する魚眼レンズを搭載した撮像装置であるとする。この場合、画像取得部11は、第1の画像として第1撮像部31が撮影した半天球画像51を取得し、第2の画像として第2撮像部32が撮影した半天球画像52を取得する。ただし、上述したように、この画像取得はリアルタイムに行う必要はなく、予め第1撮像部31及び第2撮像部32が撮影した画像を記憶部20に保存しておく場合は、画像取得部11は、記憶部20からこれらの画像を取得する。   For example, as shown in FIG. 3, the first imaging unit 31 is an imaging device equipped with a fish-eye lens that captures a directly-upward semispherical image 51 at an angle of view of 200 degrees, and the second imaging unit 32 is a directly-downward semispherical image. It is assumed that the imaging device 52 is equipped with a fisheye lens for photographing at an angle of view of 200 degrees. In this case, the image acquisition unit 11 acquires the semi-celestial sphere image 51 photographed by the first imaging unit 31 as the first image, and acquires the semi-celestial sphere image 52 photographed by the second imaging unit 32 as the second image. . However, as described above, the image acquisition does not need to be performed in real time, and when the images captured by the first imaging unit 31 and the second imaging unit 32 are stored in the storage unit 20 in advance, the image acquisition unit 11 Acquires these images from the storage unit 20.

図2に戻り、次に、共通領域特定部12は、第1の画像と第2の画像とで共通する領域である共通領域を特定する(ステップS102)。例えば、図3で、各撮像部のレンズ中心からの角度が80度から100度の範囲(撮影された画像の端部)は、お互いに共通の被写体が撮影された領域(共通領域)である。したがって、共通領域特定部12は、レンズ中心からの角度が80度から100度の範囲に入っている領域を共通領域として特定する。(図3ではレンズ中心からの角度が100度の円周の線を実線53で示し、レンズ中心からの角度が80度の円周の線を点線54で示している。また、地平線を点線55で示している。図3では、地平線はレンズ中心からの角度が90度の円周の線と一致する。)   Returning to FIG. 2, next, the common area specifying unit 12 specifies a common area that is a common area between the first image and the second image (Step S102). For example, in FIG. 3, the range of the angle from the lens center of each imaging unit in the range of 80 degrees to 100 degrees (the end of the captured image) is an area in which a common subject is captured (a common area). . Therefore, the common region specifying unit 12 specifies a region whose angle from the lens center falls within a range of 80 degrees to 100 degrees as a common region. (In FIG. 3, a solid line at an angle of 100 degrees from the center of the lens is indicated by a solid line 53, and a line at an angle of 80 degrees from the center of the lens is indicated by a dotted line 54. A horizon is indicated by a dotted line 55. In FIG. 3, the horizon coincides with a circumferential line having an angle of 90 degrees from the lens center.)

このような共通領域には、共通の被写体(同じ物体等)が撮影されているので、共通領域においてそれぞれの画像から特徴点(被写体のエッジ、角、模様等の特徴的な部分)を抽出すると、第1の画像からも第2の画像からも、被写体の同じ部分を示す特徴点が抽出できる。これを対応する特徴点と言う。つまり、被写体上の特徴的な部分を介して、第1の画像中の該部分を表す第1の特徴点と、第2の画像中の該部分を表す第2の特徴点が存在することになる。この時、この第1の特徴点と第2の特徴点とは対応しており、第1の特徴点と第2の特徴点とは対応する特徴点のペアとなる。なお、実際にはまず第1の画像から特徴点を抽出し、その特徴点に類似する特徴点を第2の画像から探すことによって、特徴点のペアを見つける。   Since a common subject (the same object or the like) is photographed in such a common area, a feature point (a characteristic portion such as an edge, a corner, or a pattern of the subject) is extracted from each image in the common area. The feature points indicating the same part of the subject can be extracted from both the first image and the second image. This is called a corresponding feature point. That is, there is a first feature point representing the portion in the first image and a second feature point representing the portion in the second image via the characteristic portion on the subject. Become. At this time, the first feature point and the second feature point correspond to each other, and the first feature point and the second feature point form a pair of corresponding feature points. In practice, first, feature points are extracted from the first image, and a feature point similar to the feature point is searched for in the second image to find a pair of feature points.

例えば、図3の半天球画像51の共通領域を極座標展開すると、図4に示すように、レンズ中心からの角度θと、その角度θでの円周の所定の位置(例えば図3の半天球画像の左端)を0度とした時の角度φと、による長方形の領域として表すことができる。同様に、図3の半天球画像52の共通領域を極座標展開すると図5に示すように、レンズ中心からの角度θと、その角度θでの円周の所定の位置(例えば図3の半天球画像の左端)を0度とした時の角度φと、による長方形の領域として表すことができる。   For example, when the common region of the hemisphere image 51 of FIG. 3 is developed in polar coordinates, as shown in FIG. 4, an angle θ from the lens center and a predetermined position of the circumference at the angle θ (for example, the hemisphere of FIG. 3) It can be represented as a rectangular area by the angle φ when the left end of the image is set to 0 degree. Similarly, when the common area of the hemisphere image 52 in FIG. 3 is developed in polar coordinates, as shown in FIG. 5, an angle θ from the lens center and a predetermined position on the circumference at the angle θ (for example, the hemisphere in FIG. 3) It can be represented as a rectangular area by the angle φ when the left end of the image is set to 0 degree.

第1撮像部31が正確に真上方向の半天球画像51を撮影し、第2撮像部32が正確に真下方向の半天球画像52を撮影しているならば、地平線を示す点線55はθ=90度の円周の線に一致し、図4に示す長方形の領域と図5に示す長方形の領域とには同じ被写体が撮影されることになる。したがって、この場合は撮影された両画像の特徴点の位置は一致し、これらの特徴点の位置が一致するように重ね合わせて両画像をつなぎ合わせれば、自然な全天球画像が生成できることになる。   If the first imaging unit 31 accurately captures the semi-celestial sphere image 51 in the direction directly above and the second imaging unit 32 accurately captures the semi-celestial sphere image 52 in the downward direction, the dotted line 55 indicating the horizon becomes θ = 90 °, and the same subject is photographed in the rectangular area shown in FIG. 4 and the rectangular area shown in FIG. Therefore, in this case, the positions of the feature points of both captured images match, and if the two images are overlapped and connected so that the positions of these feature points match, a natural spherical image can be generated. Become.

しかし、実際には第1撮像部31と第2撮像部32とが正確に真逆の方向に設置できることはほとんどないし、両撮像部のカメラの諸特性は微妙に異なっていることが多い。したがって、通常は、共通領域をそのまま重ね合わせて両画像をつなぎ合わせることはできない。例えば、図6に示す例では、第1撮像部31は正確に真上方向の半天球画像51を撮影しているが、第2撮像部32は真下方向から5度ずれた状態で半天球画像52を撮影している場合を示している。すると、半天球画像52において地平線を示す点線55は、レンズ中心からの角度が90度の円周を示す点線56とずれることになる。   However, in practice, the first imaging unit 31 and the second imaging unit 32 can hardly be installed in exactly opposite directions, and the characteristics of the cameras of the two imaging units are often slightly different. Therefore, normally, it is not possible to join the two images by overlapping the common area as it is. For example, in the example illustrated in FIG. 6, the first imaging unit 31 accurately captures the semi-celestial sphere image 51 right above, but the second imaging unit 32 shifts the semi-celestial sphere image 5 degrees from directly below. 52 shows a case where an image 52 is being taken. Then, the dotted line 55 indicating the horizon in the semi-celestial sphere image 52 deviates from the dotted line 56 indicating the circumference having an angle of 90 degrees from the lens center.

この場合、図6の半天球画像51の共通領域を極座標展開すると、図4と同様に、図7に示す長方形の領域として表すことができる。しかし、図6の半天球画像52の共通領域を極座標展開すると、図8に示すように、地平線を示す点線55が、θ=90度の円周を示す点線56と波状に交わることになる。つまり、図7に示す長方形の領域と図8に示す長方形の領域とは、共通領域ではあるが、そのまま重ね合わせることはできない。   In this case, if the common area of the semi-celestial sphere image 51 in FIG. 6 is developed in polar coordinates, it can be represented as a rectangular area shown in FIG. 7, as in FIG. However, when the common area of the hemisphere image 52 in FIG. 6 is developed in polar coordinates, as shown in FIG. 8, a dotted line 55 indicating the horizon intersects a dotted line 56 indicating the circumference of θ = 90 degrees in a wave shape. That is, the rectangular area shown in FIG. 7 and the rectangular area shown in FIG. 8 are common areas, but cannot be overlapped as they are.

通常の環境ではこのような状況になる。この場合、まず一方の長方形の領域から特徴点を抽出し、その特徴点に類似する特徴点を他方の長方形の領域から探すことによって特徴点のペア(対応する特徴点)を見つけ、この対応する特徴点同士(特徴点のペア)の位置を一致させるような射影変換行列を算出し、この行列を用いて一方の画像を変形し、他方の画像と共通領域を重ね合わせて、つなぎ合わせれば、全天球画像を生成することができる。射影変換行列の算出の際には精度を高めるために、RANSAC(Random Sample Consensus)アルゴリズムを用いることができる。また、動画像を対象とする場合、このような2つの画像のつなぎ合わせをフレーム毎に行う。   This is the situation under normal circumstances. In this case, first, a feature point is extracted from one rectangular area, and a feature point similar to the feature point is searched for in the other rectangular area to find a pair of feature points (corresponding feature point). If a projective transformation matrix that matches the positions of feature points (pairs of feature points) is calculated, one image is deformed using this matrix, and the other image and the common region are overlapped and connected, A spherical image can be generated. When calculating the projection transformation matrix, a RANSAC (Random Sample Consensus) algorithm can be used to increase the accuracy. In addition, when a moving image is targeted, such two images are joined for each frame.

このような処理について、図2に戻って順に説明する。ステップS102で共通領域特定部12により共通領域が特定されているが、共通領域が2次元画像で表される場合は、共通領域に対応する第1の画像及び第2の画像をそれぞれ所定の数(例えば8×8)のマスに区切る。そして、特徴点特定部13は、各マスにおいて、第1の画像と第2の画像との間で対応する特徴点のペアを特定する(ステップS103)。例えば、第1の画像中のあるマス(a,b)内の特徴点A(マス内の座標が(c,d)であるとする)に対応する第2の画像中の特徴点Bを探す場合、まず、第2の画像中のマス(a,b)内の座標(c、d)を中心にして、その近傍から周辺に向かって特徴量が特徴点Aの特徴量と類似する点を検索する。この検索は例えば、類似度が所定の閾値以上である点を見つけたら、該点を特徴点Aと対応する第2の画像中の特徴点Bとしてもよいし、第2の画像中のマス(a,b)内の全ての点について特徴点Aとの類似度を計算して、最も類似する点を特徴点Aと対応する第2の画像中の特徴点Bとしてもよい。特徴点特定部13は例えばこのようにして対応する特徴点のペア(特徴点Aと特徴点B)を特定する。   Returning to FIG. 2, such processing will be described in order. Although the common area is specified by the common area specifying unit 12 in step S102, if the common area is represented by a two-dimensional image, the first image and the second image corresponding to the common area are respectively set to a predetermined number. (For example, 8 × 8). Then, the feature point specifying unit 13 specifies a pair of feature points corresponding to the first image and the second image in each cell (step S103). For example, a feature point B in a second image corresponding to a feature point A in a certain cell (a, b) in the first image (assuming that coordinates in the cell are (c, d)) is searched for. In this case, first, with respect to the coordinates (c, d) in the cell (a, b) in the second image, a point whose feature amount is similar to the feature amount of the feature point A from the vicinity to the periphery is determined. Search for. In this search, for example, when a point whose similarity is equal to or more than a predetermined threshold value is found, the point may be set as a feature point B in the second image corresponding to the feature point A, or a square ( The similarity to the feature point A may be calculated for all the points in a, b), and the most similar point may be set as the feature point B in the second image corresponding to the feature point A. The feature point specifying unit 13 specifies a pair of corresponding feature points (feature point A and feature point B) in this way, for example.

そして、移動ベクトル算出部14は、特徴点特定部13が特定した特徴点のペア(第1の画像中の特徴点及び第2の画像中の特徴点)について、このペアを構成する2つの特徴点の位置のずれをベクトル(移動ベクトル)として算出する(ステップS104)。移動ベクトル算出部14が算出したこの移動ベクトルは、図9に示すように、各マスにおいて、第1の画像中の特徴点の位置を始点として、その特徴点に対応する第2の画像中の特徴点がどこに移動しているか(終点)を示すベクトルとなる。図9の例では、マスの数は8×8=64なので、移動ベクトルも64本算出される。   Then, for the pair of the feature points identified by the feature point identification unit 13 (the feature point in the first image and the feature point in the second image), the movement vector calculation unit 14 calculates the two features constituting the pair. The deviation of the position of the point is calculated as a vector (movement vector) (step S104). As shown in FIG. 9, the movement vector calculated by the movement vector calculation unit 14 starts from the position of the feature point in the first image in each cell, and corresponds to the position in the second image corresponding to the feature point. A vector indicating where the feature point has moved (end point). In the example of FIG. 9, since the number of cells is 8 × 8 = 64, 64 movement vectors are calculated.

図2に戻り、次に、変換行列選出部18は、最適な変換行列を格納するための変数である「選出変換行列」を初期化する(ステップS105)。そして、変換行列算出部15は、移動ベクトル算出部14が算出した複数の移動ベクトルに基づき、第1の画像中の特徴点の位置を、対応する第2の画像中の特徴点に移動させる変換行列を算出する(ステップS106)。この変換行列は例えば射影変換行列である。第1の画像及び第2の画像が2次元画像の場合、射影変換行列は4本の移動ベクトルから算出できる。   Returning to FIG. 2, next, the transformation matrix selection unit 18 initializes a “selection transformation matrix” that is a variable for storing an optimal transformation matrix (step S105). Then, based on the plurality of movement vectors calculated by the movement vector calculation unit 14, the conversion matrix calculation unit 15 converts the position of the feature point in the first image to a corresponding feature point in the second image. A matrix is calculated (step S106). This transformation matrix is, for example, a projective transformation matrix. When the first image and the second image are two-dimensional images, the projective transformation matrix can be calculated from four movement vectors.

したがって、変換行列算出部15は、64本の移動ベクトルの中からこの4本の移動ベクトルをランダムに選定し、選定した移動ベクトル(選定移動ベクトル)を用いて射影変換行列を算出する。例えば、図9において、丸61で囲った移動ベクトル4本がランダムに選定された選定移動ベクトルであるとすると、変換行列算出部15はこの4つの移動ベクトルの値から連立方程式を解くことによって変換行列を算出する。   Therefore, the transformation matrix calculation unit 15 randomly selects these four movement vectors from the 64 movement vectors, and calculates a projection transformation matrix using the selected movement vectors (selected movement vectors). For example, assuming that four movement vectors surrounded by a circle 61 in FIG. 9 are randomly selected movement vectors, the transformation matrix calculator 15 solves the simultaneous equations from the values of the four movement vectors to solve the simultaneous equations. Calculate the matrix.

なお、第1の画像及び第2の画像から抽出した移動ベクトルが3次元の場合に射影変換行列を算出するには、5本の移動ベクトルが必要である。本実施形態1では、第1の画像及び第2の画像はどちらも半天球画像なので、特徴点特定部13が第1の画像中の第1の特徴点と第2の画像中の第2の特徴点を特定した後、移動ベクトル算出部14は、第1の特徴点とそれに対応する第2の特徴点とをそれぞれ半径1の球面に投影し、投影して得られた各特徴点の3次元座標を用いて3次元の移動ベクトルを算出する。そして、変換行列算出部15は、この3次元の移動ベクトルを5つ用いて連立方程式を解くことによって変換行列を算出する。   In addition, when the motion vectors extracted from the first image and the second image are three-dimensional, five motion vectors are required to calculate the projective transformation matrix. In the first embodiment, since the first image and the second image are both hemispherical images, the feature point specifying unit 13 determines whether the first feature point in the first image and the second feature point in the second image are the same. After specifying the feature points, the movement vector calculation unit 14 projects the first feature point and the corresponding second feature point onto a spherical surface having a radius of 1, and calculates the 3rd of each feature point obtained by projection. A three-dimensional movement vector is calculated using the dimensional coordinates. Then, the conversion matrix calculation unit 15 calculates a conversion matrix by solving a simultaneous equation using the five three-dimensional movement vectors.

図2に戻り、次に、変換部16は、変換行列算出部15が算出した変換行列を用いて、第1の画像中の特徴点の位置を変換し、変換後の位置を移動後特徴点の位置として算出する(ステップS107)。例えば、図10は、第1の画像中の特徴点の位置を始点として、その特徴点の位置を変換部16が変換した移動後特徴点の位置を終点とするベクトル(変換後ベクトル)を、図9に示す移動ベクトル(ただし選定移動ベクトルを除く)と重ねて表示した図である。理想的には、移動ベクトルと変換後ベクトルとは一致する(少なくとも選定移動ベクトルを選択したマスにおいては、一致する)が、実際には図10に示すようにずれが生じる。   Returning to FIG. 2, next, the conversion unit 16 converts the position of the feature point in the first image using the conversion matrix calculated by the conversion matrix calculation unit 15, and changes the position after the conversion to the shifted feature point. (Step S107). For example, FIG. 10 illustrates a vector (converted vector) having the position of a feature point in the first image as a start point and the position of the moved feature point obtained by converting the position of the feature point by the conversion unit 16 as an end point, FIG. 10 is a diagram superimposed and displayed with the movement vector (excluding the selected movement vector) shown in FIG. 9. Ideally, the motion vector matches the vector after conversion (at least in the cell in which the selected motion vector is selected), but actually, a shift occurs as shown in FIG.

図2に戻り、誤差算出部17は、このずれを誤差として算出する(ステップS108)。この評価対象となる移動ベクトル(及び変換後ベクトル)は複数(図10に示す例では64本の移動ベクトルから4本の選定移動ベクトルを除いた60本)あるが、ここでは、誤差を評価する値として、3種類の評価値を算出する。ここに挙げる評価値はいずれも、値が大きいほど誤差が小さい(つまりより良い変換行列である)ことを意味する。   Returning to FIG. 2, the error calculation unit 17 calculates this deviation as an error (step S108). Although there are a plurality of movement vectors (and converted vectors) to be evaluated (in the example shown in FIG. 10, 60 movement vectors excluding four selected movement vectors from the 64 movement vectors), the error is evaluated here. As the values, three types of evaluation values are calculated. In any of the evaluation values listed here, the larger the value, the smaller the error (that is, the better the transformation matrix).

第1の評価値は量子化代表クラスであり、これを評価値1とする。評価値1を求めるには、誤差算出部17は、まず各ベクトルの差(移動ベクトルと変換後ベクトルの差)の絶対値の2乗を求め、SD(Squared Difference)値とする。図10に示す例では60個のSD値が求められる。そして、誤差算出部17は、この複数(ここでは60個)のSD値を所定のクラス数(例えば20)の段階(クラス)に量子化(分類)する。   The first evaluation value is a quantization representative class, which is referred to as evaluation value 1. In order to obtain the evaluation value 1, the error calculating unit 17 first obtains the square of the absolute value of the difference between the vectors (the difference between the moving vector and the converted vector), and sets the squared value as the SD (Squared Difference) value. In the example shown in FIG. 10, 60 SD values are obtained. Then, the error calculator 17 quantizes (classifies) the plurality (here, 60) of the SD values into stages (classes) of a predetermined number of classes (for example, 20).

量子化の方法は任意だが、例えば、あるサポート範囲閾値Aを規定し、SD値がAより大きければクラス0に分類、A以下かつA/2より大きければクラス1に分類、A/2以下かつA/2より大きければクラス2に分類、・・・、A/217以下かつA/218より大きければクラス18に分類、A/218以下ならクラス19に分類、とすることで20段階に量子化することができる。 The quantization method is arbitrary, but, for example, a certain support range threshold value A is defined. If the SD value is larger than A, it is classified into class 0; if the SD value is smaller than A and larger than A / 2, it is classified into class 1, a / 2 2 classification if the class 2 is greater than, · · ·, a / 2 17 or less and classified in class 18 is greater than a / 2 18, classified into a / 2 18 or less if the class 19, to the 20 It can be quantized in stages.

そして、誤差算出部17は、複数(ここでは60個)のSD値の中の中央値が含まれるクラスを代表クラスとする。例えば、SD値の中央値がA/2なら、代表クラスはクラス3となる。そして、誤差算出部17は、この代表クラスの番号(例えばSD値の中央値がA/2なら、3)を評価値1とする。 Then, the error calculator 17 sets a class including a median value among a plurality (here, 60) of SD values as a representative class. For example, the median of the SD values if A / 2 2, a representative class Class 3. Then, the error calculating unit 17 sets the representative class number (for example, 3 if the median SD value is A / 2 22) as the evaluation value 1.

第2の評価値は、サポート範囲内のSD値の個数であり、これを評価値2とする。これも、まず各ベクトルの差(移動ベクトルと変換後ベクトルの差)の絶対値の2乗を求め、SD値とする。そして、あるサポート範囲閾値Aを規定し、複数(ここでは60個)のSD値のうち、A以下となるSD値の個数を評価値2とする。   The second evaluation value is the number of SD values within the support range, which is referred to as evaluation value 2. In this case, first, the square of the absolute value of the difference between the respective vectors (the difference between the movement vector and the converted vector) is obtained, and is set as the SD value. Then, a certain support range threshold value A is defined, and the number of SD values equal to or smaller than A among a plurality of (60 in this case) SD values is set as the evaluation value 2.

第3の評価値は、1つ前のフレームで選出された変換行列を用いて算出される評価値のうち、サポート範囲内のSD値の個数で表す評価値であり、これを評価値3とする。例えば、まず、今回のフレームの第1の画像中の特徴点の位置を始点として、その特徴点の位置を1つ前のフレームで選出された変換行列によって変換した位置(前フレーム移動後特徴点の位置)を終点とするベクトル(前フレーム変換後ベクトル)を求める。そして、このベクトル(前フレーム変換後ベクトル)と今回のフレームの移動ベクトルとの差の絶対値の2乗を求め、SD値とする。そして、あるサポート範囲閾値Aを規定し、複数(ここでは60個)のSD値のうち、A以下となるSD値の個数を評価値3とする。   The third evaluation value is an evaluation value represented by the number of SD values within the support range among evaluation values calculated using the transformation matrix selected in the immediately preceding frame. I do. For example, first, the position of the feature point in the first image of the current frame is set as a starting point, and the position of the feature point is converted by the conversion matrix selected in the immediately preceding frame (the feature point after moving the previous frame). (The position after the previous frame) with the end point of (the position of the previous frame) as the end point. Then, the square of the absolute value of the difference between this vector (the vector after the previous frame conversion) and the movement vector of the current frame is obtained, and is set as the SD value. Then, a certain support range threshold value A is defined, and the number of SD values equal to or smaller than A among a plurality (here, 60) of SD values is set as the evaluation value 3.

以上の3つの評価値のうち、評価値1及び評価値2は、今回のフレーム(現フレーム)での誤差を評価する値なので、現フレーム誤差とも呼ぶ。また、評価値3は前フレームでの誤差を評価する値なので、前フレーム誤差とも呼ぶ。   Of the above three evaluation values, evaluation value 1 and evaluation value 2 are values for evaluating an error in the current frame (current frame), and are therefore also referred to as current frame errors. Since the evaluation value 3 is a value for evaluating an error in the previous frame, it is also called a previous frame error.

そして、変換行列選出部18は、誤差算出部17が算出した誤差が所定の条件を満たすか否かを判定する(ステップS109)。この判定は、上述した3つの評価値により行う。まず、評価値1が同一ループ(ステップS106からステップS111までのループ)中でのそれまでの評価値1より大きければ「誤差が所定の条件を満たす」とする。そして、評価値1がそれまでの評価値1より小さければ「誤差が所定の条件を満たさない」とする。そして、評価値1がそれまでの評価値1と等しいなら、評価値2+評価値3の値がそれまでの評価値2+評価値3の値より大きければ「誤差が所定の条件を満たす」とし、評価値2+評価値3の値がそれまでの評価値2+評価値3の値以下なら「誤差が所定の条件を満たさない」とする。   Then, the transformation matrix selection unit 18 determines whether or not the error calculated by the error calculation unit 17 satisfies a predetermined condition (Step S109). This determination is made based on the three evaluation values described above. First, if the evaluation value 1 is larger than the previous evaluation value 1 in the same loop (the loop from step S106 to step S111), it is determined that “the error satisfies a predetermined condition”. If the evaluation value 1 is smaller than the previous evaluation value 1, it is determined that "the error does not satisfy the predetermined condition". If the evaluation value 1 is equal to the evaluation value 1 so far, if the value of the evaluation value 2 + the evaluation value 3 is larger than the value of the evaluation value 2 + the evaluation value 3 so far, it is determined that “the error satisfies a predetermined condition”, If the value of the evaluation value 2 + the evaluation value 3 is equal to or less than the value of the evaluation value 2 + the evaluation value 3 so far, it is determined that “the error does not satisfy the predetermined condition”.

誤差が所定の条件を満たすなら(ステップS109;Yes)、変換行列選出部18は、今回のループで(ステップS106で)算出された変換行列で変数「選出変換行列」を更新し(ステップS110)、ステップS106に戻る。   If the error satisfies the predetermined condition (Step S109; Yes), the conversion matrix selection unit 18 updates the variable “selection conversion matrix” with the conversion matrix calculated in this loop (Step S106) (Step S110). Then, the process returns to step S106.

誤差が所定の条件を満たさないなら(ステップS109;No)、変換行列選出部18は、変数「選出変換行列」の更新無しで(ステップS110に行かずに)規定回数(例えば50回)ステップS106での変換行列算出を繰り返したか否かを判定する(ステップS111)。   If the error does not satisfy the predetermined condition (Step S109; No), the conversion matrix selection unit 18 performs the specified number of times (for example, 50) without updating the variable “selection conversion matrix” (without going to Step S110) (Step S106). It is determined whether or not the calculation of the transformation matrix in step (1) is repeated (step S111).

規定回数繰り返していなければ(ステップS111;No)、ステップS106に戻る。規定回数繰り返したなら(ステップS111;Yes)、画像生成部19は、変数「選出変換行列」に格納されている変換行列(変換行列選出部18が選出した変換行列)で第1の画像を変換し、共通領域を第2の画像と重ね合わせることにより、第1の画像と第2の画像とをつなぎ合わせた画像を生成する(ステップS112)。   If it has not been repeated the specified number of times (step S111; No), the process returns to step S106. If it has been repeated the specified number of times (Step S111; Yes), the image generation unit 19 converts the first image using the conversion matrix (the conversion matrix selected by the conversion matrix selection unit 18) stored in the variable “selection conversion matrix”. Then, an image in which the first image and the second image are connected is generated by overlapping the common area with the second image (step S112).

そして、制御部10は、動画像の全てのフレームについて処理を終了したか否かを判定する(ステップS113)。まだ全ては終了していないなら(ステップS113;No)、ステップS101に戻って、次のフレームの画像を取得して、これまでの処理を繰り返す。全てのフレームについて処理を終了したなら(ステップS113;Yes)、画像処理を終了する。   Then, the control unit 10 determines whether the processing has been completed for all frames of the moving image (Step S113). If all of the processing has not been completed yet (step S113; No), the process returns to step S101 to acquire an image of the next frame and repeat the processing up to this point. When the processing has been completed for all the frames (step S113; Yes), the image processing ends.

以上、画像処理の処理内容について説明した。次に、上述の画像処理によって、第1の画像と第2の画像がつなぎ合わされる例を図11に示す画像を例にして説明する。   The processing content of the image processing has been described above. Next, an example in which the first image and the second image are joined by the above-described image processing will be described with reference to the image shown in FIG.

図11では、第1の画像の右端及び第2の画像の左端がそれぞれ共通領域71及び共通領域72になっている。そして、第1の画像と第2の画像とは、縦方向の位置が少しずれているため、そのまま共通領域71及び共通領域72を重ね合わせて2つの画像をつなぎ合わせると、図12に示すように、つなぎ目の領域73で段差が生じる不自然な画像が生成されてしまう。(ここでは、共通領域71に共通領域72を上書きして2つの画像をつなぎ合わせた場合を想定している。)   In FIG. 11, the right end of the first image and the left end of the second image are a common area 71 and a common area 72, respectively. Since the first image and the second image are slightly shifted in the vertical direction, if the two images are joined by overlapping the common area 71 and the common area 72 as shown in FIG. In addition, an unnatural image having a step in the joint region 73 is generated. (Here, it is assumed that two images are connected by overwriting the common area 71 with the common area 72.)

上述した画像処理を行うと、このような段差が生じないように画像を変換する変換行列を変換行列算出部15が算出し、画像生成部19がその変換行列で第1の画像を変換してから第2の画像とつなぎ合わせた画像を生成する。すると、図13に示すように、つなぎ目の領域74で第1の画像と第2の画像とがぴったり重なり、自然な画像が生成される。   When the above-described image processing is performed, the conversion matrix calculation unit 15 calculates a conversion matrix for converting an image so that such a step does not occur, and the image generation unit 19 converts the first image using the conversion matrix. To generate an image joined with the second image. Then, as shown in FIG. 13, the first image and the second image exactly overlap in the joint region 74, and a natural image is generated.

動画像の中のある1フレームだけに着目した場合には、図13に示すような自然な画像が生成されるので、特に問題は無いように見える。しかし、フレーム間での変換行列の違いを全く考慮しない場合は、例えば画像生成部19は、あるフレームでは図14に示すような画像を生成し、次のフレームでは図15に示すような画像を生成することが考えられる。この場合、それぞれのフレームでは自然な画像が生成されているが、図14に示す画像と図15に示す画像とは上下方向にずれがある。わかりやすくするため、図14に示す画像と図15に示す画像とを重ね合わせた画像を図16に示す。したがって、これを動画像として再生した場合には、上下方向にブレが生じる不自然な動画像になってしまう。   If attention is paid only to a certain frame in the moving image, a natural image as shown in FIG. 13 is generated, and it seems that there is no particular problem. However, when the difference in the transformation matrix between frames is not considered at all, for example, the image generation unit 19 generates an image as shown in FIG. 14 in a certain frame, and generates an image as shown in FIG. 15 in the next frame. Can be generated. In this case, a natural image is generated in each frame, but the image shown in FIG. 14 and the image shown in FIG. 15 are vertically displaced. For easier understanding, FIG. 16 shows an image obtained by superimposing the image shown in FIG. 14 and the image shown in FIG. Therefore, when this is reproduced as a moving image, an unnatural moving image in which blur occurs in the vertical direction.

そこで、上述した画像処理では、誤差算出部17が1つ前のフレームで算出された変換行列も用いて評価値3を算出し、変換行列選出部18が評価値3も用いて最適な変換行列を選出するようにしているので、フレーム間で不自然さが生じるような変換行列が選出されてしまう可能性を少なくすることができる。   Therefore, in the above-described image processing, the error calculation unit 17 calculates the evaluation value 3 also using the conversion matrix calculated in the immediately preceding frame, and the conversion matrix selection unit 18 uses the evaluation value 3 to calculate the optimal conversion matrix. Is selected, it is possible to reduce the possibility of selecting a transformation matrix that causes unnaturalness between frames.

このように、画像処理装置100では、最適な変換行列を選出する際に、1つ前のフレームで選出された変換行列による評価も加味することにより、1つ前のフレームで選出された変換行列と類似した変換行列が選出されやすくなる。そうすることにより、複数の動画像について、各動画像のフレーム同士をその端部でつなぎ合わせた広範囲画像からなる動画像を生成する際にも、動画像の時間的な不連続性によって引き起こされる不自然な動画像が生成される可能性を低くすることができる。   As described above, in the image processing apparatus 100, when selecting the optimal conversion matrix, the evaluation based on the conversion matrix selected in the previous frame is also taken into consideration, so that the conversion matrix selected in the previous frame is considered. A transformation matrix similar to is easily selected. By doing so, the temporal discontinuity of the moving images causes a plurality of moving images to generate a moving image composed of a wide range of images in which frames of each moving image are connected at their ends. The possibility that an unnatural moving image is generated can be reduced.

(変形例1)
実施形態1では、画像処理(図2)のステップS109で、変換行列選出部18は、誤差算出部17が算出した評価値1がそれまでの評価値1と等しいなら、評価値2+評価値3の値がそれまでの評価値2+評価値3の値より大きければ「誤差が所定の条件を満たす」とし、評価値2+評価値3の値がそれまでの評価値2+評価値3の値以下なら「誤差が所定の条件を満たさない」とした。しかしこれに限られない。評価値2は今回のフレームにおけるサポート範囲内のSD値の個数で、評価値3は1つ前のフレームで選出された変換行列を用いて算出されるSD値のうちサポート範囲内のSD値の個数であるが、例えば、変形例1として、これらに係数を掛けて重み付けをしてから加算した値を比較してもよい。
(Modification 1)
In the first embodiment, in step S109 of the image processing (FIG. 2), if the evaluation value 1 calculated by the error calculation unit 17 is equal to the evaluation value 1 up to that point, the conversion matrix selection unit 18 evaluates the evaluation value 2 + the evaluation value 3 Is larger than the previous evaluation value 2 + evaluation value 3, it is determined that the error satisfies the predetermined condition. If the evaluation value 2 + evaluation value 3 is equal to or less than the previous evaluation value 2 + evaluation value 3, "The error does not satisfy the predetermined condition." However, it is not limited to this. The evaluation value 2 is the number of SD values within the support range in the current frame, and the evaluation value 3 is the number of SD values within the support range among SD values calculated using the transformation matrix selected in the previous frame. As for the number, for example, as a first modified example, these values may be multiplied by a coefficient, weighted, and the added value may be compared.

この変形例1では、評価値2に掛ける係数をW2、評価値3に掛ける係数をW3とする。すると、画像処理(図2)のステップS109では、変換行列選出部18は、誤差算出部17が算出した評価値1がそれまでの評価値1と等しいなら、W2×評価値2+W3×評価値3の値がそれまでのW2×評価値2+W3×評価値3の値より大きければ「誤差が所定の条件を満たす」とし、W2×評価値2+W3×評価値3の値がそれまでのW2×評価値2+W3×評価値3の値以下なら「誤差が所定の条件を満たさない」とする。   In the first modification, the coefficient by which the evaluation value 2 is multiplied is W2, and the coefficient by which the evaluation value 3 is multiplied is W3. Then, in step S109 of the image processing (FIG. 2), if the evaluation value 1 calculated by the error calculation unit 17 is equal to the evaluation value 1 up to that point, the conversion matrix selection unit 18 determines that W2 × evaluation value 2 + W3 × evaluation value 3 Is larger than the previous value of W2 × Evaluation value 2 + W3 × Evaluation value 3, it is determined that the error satisfies a predetermined condition, and the value of W2 × Evaluation value 2 + W3 × Evaluation value 3 is W2 × Evaluation value If it is equal to or less than 2 + W3 × evaluation value 3, it is determined that “the error does not satisfy the predetermined condition”.

変形例1では、評価値2及び評価値3にそれぞれ係数を掛けることにより、1つ前のフレームで選出された変換行列の影響度合いを調整することができる。   In the first modification, by multiplying the evaluation value 2 and the evaluation value 3 by respective coefficients, it is possible to adjust the degree of influence of the transformation matrix selected in the immediately preceding frame.

(変形例2)
また、実施形態1では、画像処理(図2)のステップS108で、誤差算出部17は、上述の3種類の評価値を算出したが、これに限られない。例えば、変形例2として、誤差算出部17は、4つ目の評価値として、1つ前のフレームで選出された変換行列を用いて算出される評価値のうち、量子化代表クラスで表す評価値を算出してもよい。この評価値を評価値4とする。
(Modification 2)
Further, in the first embodiment, in step S108 of the image processing (FIG. 2), the error calculation unit 17 calculates the above-described three types of evaluation values, but is not limited thereto. For example, as a second modified example, the error calculation unit 17 determines, as a fourth evaluation value, an evaluation value represented by a quantization representative class among evaluation values calculated using a transformation matrix selected in the immediately preceding frame. The value may be calculated. This evaluation value is referred to as evaluation value 4.

誤差算出部17は、評価値3を算出した時と同様、まず、今回のフレームの第1の画像中の特徴点の位置を始点として、その特徴点の位置を1つ前のフレームで選出された変換行列によって変換した位置(前フレーム移動後特徴点の位置)を終点とするベクトル(前フレーム変換後ベクトル)を求める。そして、誤差算出部17は、このベクトル(前フレーム変換後ベクトル)と今回のフレームの移動ベクトルとの差の絶対値の2乗を求め、SD値とする。このSD値は評価値1を算出した時と同様、複数(図10に示す例では60個)求められる。   As in the case of calculating the evaluation value 3, the error calculation unit 17 first selects the position of a feature point in the first image of the current frame as a start point and selects the position of the feature point in the immediately preceding frame. A vector (post-frame converted vector) having the position converted by the converted matrix (position of the feature point after moving the previous frame) as the end point is obtained. Then, the error calculator 17 calculates the square of the absolute value of the difference between this vector (the vector after the previous frame conversion) and the movement vector of the current frame, and sets the square as the SD value. As in the case of calculating the evaluation value 1, a plurality of SD values (60 in the example shown in FIG. 10) are obtained.

そして、誤差算出部17は、この複数(ここでは60個)のSD値を所定のクラス数(例えば20)の段階(クラス)に量子化(分類)する。ここでの量子化の方法も任意であり、例えば上述の(評価値1を求める際の)量子化の方法を用いることができる。そして、誤差算出部17は、複数(ここでは60個)のSD値の中の中央値が含まれるクラスを代表クラスとする。そして、誤差算出部17は、この代表クラスの番号を評価値4とする。   Then, the error calculator 17 quantizes (classifies) the plurality (here, 60) of the SD values into stages (classes) of a predetermined number of classes (for example, 20). The quantization method here is also arbitrary. For example, the above-described quantization method (when obtaining the evaluation value 1) can be used. Then, the error calculator 17 sets a class including a median value among a plurality (here, 60) of SD values as a representative class. Then, the error calculating unit 17 sets the representative class number as the evaluation value 4.

そして、画像処理(図2)のステップS109では、変換行列選出部18は、所定の閾値を基準クラス閾値として定めておき、評価値4−評価値1≦基準クラス閾値なら、「誤差が所定の条件を満たさない」(ステップS109;No)として、ステップS111に進む。これにより、今回のループ(ステップS106からステップS111のループ)で変換行列を算出する際に選定された選定移動ベクトルと、1つ前のフレームでの選出された変換行列を算出する際に選定された選定移動ベクトルとの違いが大きい場合には、すぐに次のループに進むことができる。選定移動ベクトルが大きく異なる場合には、1つ前のフレームで算出された変換行列と今回のフレームで算出される変換行列とが大きく異なると想定されるため、今回のループで算出される変換行列を棄却しているのである。   Then, in step S109 of the image processing (FIG. 2), the transformation matrix selection unit 18 determines a predetermined threshold value as a reference class threshold value, and if the evaluation value−the evaluation value 1 ≦ the reference class threshold value, “the error is a predetermined value” The condition is not satisfied "(step S109; No), and the process proceeds to step S111. As a result, the selected movement vector selected when calculating the conversion matrix in the current loop (the loop from step S106 to step S111) and the selected movement vector selected when calculating the selected conversion matrix in the previous frame are calculated. When the difference from the selected movement vector is large, the process can immediately proceed to the next loop. If the selected movement vectors are significantly different, it is assumed that the transformation matrix calculated in the immediately preceding frame and the transformation matrix calculated in the current frame are significantly different, so the transformation matrix calculated in the current loop Is rejected.

変形例2では、このようにすることにより、1つ前のフレームで選出された変換行列と大きく異なる変換行列が算出される可能性が高い場合には、その変換行列を棄却することにより、より適切な変換行列が選出される可能性を高めている。   In the second modification, by doing so, when there is a high possibility that a transformation matrix significantly different from the transformation matrix selected in the previous frame is calculated, the transformation matrix is rejected, and This increases the probability that an appropriate transformation matrix will be selected.

(変形例3)
また、実施形態1では、画像処理(図2)のステップS108で、誤差算出部17は、上述の3種類の評価値を算出したが、これに限られない。例えば、変形例3として、誤差算出部17は、これら3種類の評価値の代わりに、次の2つの評価値(ここでは評価値5及び評価値6とする)を算出することにしてもよい。
(Modification 3)
Further, in the first embodiment, in step S108 of the image processing (FIG. 2), the error calculation unit 17 calculates the above-described three types of evaluation values, but is not limited thereto. For example, as a third modification, the error calculating unit 17 may calculate the following two evaluation values (here, evaluation values 5 and 6) instead of these three types of evaluation values. .

変形例3では、誤差算出部17は、各ベクトルの差(移動ベクトルと変換後ベクトルの差)の絶対値の2乗を求め、SD(Squared Difference)値とし、さらに、SD値の総和であるSSD(Sum of Squared Difference)を求め、これを評価値5とする。   In the third modification, the error calculation unit 17 obtains the square of the absolute value of the difference between the vectors (the difference between the movement vector and the converted vector), sets the squared value as an SD (Squared Difference) value, and further calculates the sum of the SD values. An SSD (Sum of Squared Difference) is obtained, and this is set as an evaluation value 5.

また、評価値6を求める場合には、誤差算出部17は、まず、今回のフレームの第1の画像中の特徴点の位置を始点として、その特徴点の位置を1つ前のフレームで選出された変換行列によって変換した位置(前フレーム移動後特徴点の位置)を終点とするベクトル(前フレーム変換後ベクトル)を求める。そして、このベクトル(前フレーム変換後ベクトル)と今回のフレームの移動ベクトルとの差の絶対値の2乗を求め、SD値とし、さらにSD値の総和であるSSDを求め、これを評価値6とする。なお、評価値5及び評価値6は、上述の評価値と異なり、値が小さいほど誤差が小さい(つまりより良い変換行列である)ことを意味する。   When calculating the evaluation value 6, the error calculating unit 17 first selects the position of a feature point in the first image of the current frame as a start point and selects the position of the feature point in the immediately preceding frame. A vector (a vector after the previous frame conversion) having the position converted by the obtained conversion matrix (the position of the feature point after the previous frame movement) as the end point is obtained. Then, the square of the absolute value of the difference between this vector (the vector after the previous frame conversion) and the movement vector of the current frame is obtained, the SD value is obtained, and the SSD which is the sum of the SD values is further obtained. And Note that the evaluation values 5 and 6 are different from the above-described evaluation values, and the smaller the value, the smaller the error (that is, the better the conversion matrix).

そして、変換行列選出部18は、画像処理(図2)のステップS109で、評価値5+評価値6がそれまでの評価値5+評価値6より小さければ「誤差が所定の条件を満たす」とする。そして、評価値5+評価値6がそれまでの評価値5+評価値6より大きければ「誤差が所定の条件を満たさない」とする。なお、上述の変形例1と同様に、各評価値に係数を掛ける(例えば、評価値5にW5を掛け、評価値6にW6を掛ける)ことによって、1つ前のフレームで選出された変換行列の影響度合いを調整してもよい。   Then, in step S109 of the image processing (FIG. 2), if the evaluation value 5 + the evaluation value 6 is smaller than the previous evaluation value 5 + the evaluation value 6, the conversion matrix selection unit 18 determines that “the error satisfies the predetermined condition”. . If the evaluation value 5 + the evaluation value 6 is larger than the previous evaluation value 5 + the evaluation value 6, it is determined that “the error does not satisfy the predetermined condition”. Note that, similarly to the above-described first modification example, by multiplying each evaluation value by a coefficient (for example, multiplying the evaluation value 5 by W5 and multiplying the evaluation value 6 by W6), the conversion selected in the immediately preceding frame is performed. The degree of influence of the matrix may be adjusted.

変形例3では、誤差の評価値としてSSDを用いることにより、SD値を複数のクラスに量子化したり、サポート範囲内のSD値の個数を求めたりする必要がなくなり、より簡単に評価値を求めることができる。   In the third modification, by using the SSD as the error evaluation value, it is not necessary to quantize the SD value into a plurality of classes, or to calculate the number of SD values within the support range. be able to.

(変形例3の変形例1)
さらに、変形例3の変形例1として、画像処理(図2)のステップS108で、誤差算出部17が評価値5及び評価値6を求めた上で、所定の閾値として基準SSD閾値を定めておいて、ステップS109では、変換行列選出部18は、評価値6が基準SSD閾値以上なら、「誤差が所定の条件を満たさない」(ステップS109;No)として、ステップS111に進むようにしてもよい。
(Modification 1 of Modification 3)
Further, as a first modification of the third modification, in step S108 of the image processing (FIG. 2), the error calculating unit 17 determines the evaluation value 5 and the evaluation value 6, and then determines the reference SSD threshold as a predetermined threshold. In step S109, if the evaluation value 6 is equal to or larger than the reference SSD threshold, the conversion matrix selection unit 18 may determine that “the error does not satisfy a predetermined condition” (step S109; No) and proceed to step S111.

このようにすることにより、今回のループ(ステップS106からステップS111のループ)で変換行列を算出する際に選定された選定移動ベクトルと、1つ前のフレームでの選出された変換行列を算出する際に選定された選定移動ベクトルとの違いが大きい場合には、今回のループで算出された変換行列を棄却して、すぐに次のループに進むことができる。   By doing so, the selected movement vector selected when calculating the conversion matrix in the current loop (the loop from step S106 to step S111) and the conversion matrix selected in the previous frame are calculated. When the difference from the selected movement vector is large, the transformation matrix calculated in the current loop is rejected, and the process can immediately proceed to the next loop.

変形例3の変形例1では、このようにすることにより、1つ前のフレームで選出された変換行列と大きく異なる変換行列が算出される可能性が高い場合には、その変換行列を棄却することにより、より適切な変換行列が選出される可能性を高めている。   In the first modification of the third modification, by doing so, if there is a high possibility that a transformation matrix significantly different from the transformation matrix selected in the previous frame is likely to be calculated, the transformation matrix is rejected. This increases the possibility that a more appropriate transformation matrix is selected.

(変形例3の変形例2)
上述の変形例3の変形例1においては、画像処理(図2)のステップS109で、変換行列選出部18は、評価値6が基準SSD閾値以上なら、「誤差が所定の条件を満たさない」と判定することとしたが、これに限られない。例えば、変形例3の変形例2として、所定の割合として基準SSD割合(n%)を定めておいて、ステップS109で、変換行列選出部18は、評価値6が評価値5の基準SSD割合以上なら、「誤差が所定の条件を満たさない」(ステップS109;No)として、ステップS111に進むようにしてもよい。
(Modification 2 of Modification 3)
In the first modification of the third modification, in step S109 of the image processing (FIG. 2), if the evaluation value 6 is equal to or larger than the reference SSD threshold, the conversion matrix selecting unit 18 determines that “the error does not satisfy the predetermined condition”. However, the present invention is not limited to this. For example, as a second modification of the third modification, a reference SSD ratio (n%) is set as a predetermined ratio, and in step S109, the conversion matrix selecting unit 18 determines that the evaluation value 6 is the reference SSD ratio of the evaluation value 5 In this case, it may be determined that “the error does not satisfy the predetermined condition” (Step S109; No), and the process may proceed to Step S111.

このようにすることにより、今回のループ(ステップS106からステップS111のループ)で変換行列を算出する際に選定された選定移動ベクトルと、1つ前のフレームでの選出された変換行列を算出する際に選定された選定移動ベクトルとの違いが大きい場合には、今回のループで算出された変換行列を棄却して、すぐに次のループに進むことができる。   By doing so, the selected movement vector selected when calculating the conversion matrix in the current loop (the loop from step S106 to step S111) and the conversion matrix selected in the previous frame are calculated. When the difference from the selected movement vector is large, the transformation matrix calculated in the current loop is rejected, and the process can immediately proceed to the next loop.

変形例3の変形例2では、このようにすることにより、1つ前のフレームで選出された変換行列と大きく異なる変換行列が算出される可能性が高い場合には、その変換行列を棄却することにより、より適切な変換行列が選出される可能性を高めている。   In the second modification of the third modification, by doing so, if there is a high possibility that a transformation matrix significantly different from the transformation matrix selected in the previous frame is likely to be calculated, the transformation matrix is rejected. This increases the possibility that a more appropriate transformation matrix is selected.

(変形例4)
実施形態1では、画像処理(図2)のステップS105で(つまり変換行列を変化させて最適な変換行列を選出するループに入る直前で)選出変換行列を初期化していたが、この処理をしなくてもよい。例えば、変形例4として、図17に示すように、ステップS105の処理の代わりに、前回の選出変換行列を初期化せずに、前回の選出変換行列を用いて誤差算出部17が誤差(各評価値)を算出しておく(ステップS121)ことにしてもよい。このようにすると、その後の(ステップS106からステップS111の)ループでは、前回の選出変換行列が初期値として扱われることになる。
(Modification 4)
In the first embodiment, the selected transformation matrix is initialized in step S105 of the image processing (FIG. 2) (that is, immediately before entering a loop in which the transformation matrix is changed to select an optimal transformation matrix). It is not necessary. For example, as a fourth modification, as shown in FIG. 17, instead of the process of step S105, the error calculating unit 17 uses the previous selected conversion matrix without initializing the previous selected conversion matrix, (Evaluation value) may be calculated (step S121). In this way, in the subsequent loop (from step S106 to step S111), the previous selected transformation matrix is treated as an initial value.

すると、ステップS106で前回の選出変換行列とあまりにかけ離れた変換行列が算出されたとしてもそれはすぐに棄却されることになるので、より適切な変換行列が選出される可能性が高くなる。   Then, even if a transformation matrix that is too far from the previous selected transformation matrix is calculated in step S106, it is immediately rejected, and the possibility that a more appropriate transformation matrix is selected is increased.

(変形例5)
さらに、変形例5として、図18に示すように、ステップS121で算出した誤差(各評価値)が所定の条件を満たすか否かを判定(ステップS122)してもよい。具体的には、所定の基準閾値を設定して、各評価値がその基準閾値より高ければ、変換行列選出部18は「前回のフレームでの選出変換行列は、今回のフレームでも問題無く利用できる」と判断して、選出変換行列を更新しない(前回のフレームでの値のままにする)。
(Modification 5)
Further, as a fifth modification, as shown in FIG. 18, it may be determined whether or not the error (each evaluation value) calculated in step S121 satisfies a predetermined condition (step S122). Specifically, a predetermined reference threshold is set, and if each evaluation value is higher than the reference threshold, the conversion matrix selection unit 18 determines that “the selection conversion matrix in the previous frame can be used in the current frame without any problem. And does not update the selection conversion matrix (leave the value in the previous frame).

つまり、変形例5では、ステップ122で、変換行列選出部18が、誤差が所定の条件を満たすと判定したら(ステップS122;Yes)、ステップS112に行き、画像生成部19は、前回のフレームでの選出変換行列を用いて画像生成する。誤差が所定の条件を満たさないと判定したら(ステップS122;No)、ステップS106に行き、今回のフレームでの変換行列を選出するループに入る。誤差が所定の条件を満たすとは、例えば、誤差が所定の閾値より小さい場合である。   That is, in the fifth modification, when the transformation matrix selection unit 18 determines in step 122 that the error satisfies the predetermined condition (step S122; Yes), the process proceeds to step S112, and the image generation unit 19 performs the processing in the previous frame. An image is generated using the selection transformation matrix of. If it is determined that the error does not satisfy the predetermined condition (Step S122; No), the process goes to Step S106, and enters a loop for selecting a transformation matrix in the current frame. The error satisfies the predetermined condition, for example, when the error is smaller than a predetermined threshold.

変形例5では、前回のフレームでの選出変換行列を利用可能な場合には、今回のフレームで変換行列を算出する処理を省略することができるので、処理負荷を軽くすることができる。   In the fifth modification, when the selected transformation matrix in the previous frame can be used, the process of calculating the transformation matrix in the current frame can be omitted, so that the processing load can be reduced.

(変形例6)
また、実施形態1では、画像処理(図2)のステップS101でそのフレームの画像を取得したら、毎回変換行列を算出する処理を行っていたが、状況によってはこの処理をしなくてもよい。例えば、変形例6として、図19に示すように、ステップS101の後で、制御部10は状況を取得し(ステップS131)、状況に変化があるかを判定する(ステップS132)ようにしてもよい。
(Modification 6)
Further, in the first embodiment, when the image of the frame is obtained in step S101 of the image processing (FIG. 2), the process of calculating the transformation matrix is performed every time. However, this process may not be performed depending on the situation. For example, as a sixth modification, as shown in FIG. 19, after step S101, the control unit 10 may acquire a situation (step S131) and determine whether there is a change in the situation (step S132). Good.

ここで、状況とは、周囲の環境や撮像部の動きである。例えば、撮像部に加速度センサを付け、制御部10が加速度センサから得られる値を確認することにより、撮像部が動いたか否かを判定することができる。また、加速度センサを用いなくても、撮影した画像を前フレームで撮影した画像と比較することにより、状況の変化を判定できる。これは、具体的には、制御部10が、前回のフレームと今回のフレームとで画像自体の差を算出(例えば、ピクセル単位で画素値の差の絶対値を出し、その絶対値の全ピクセルでの総和を算出)し、算出した値が所定の閾値よりも小さければ、状況に変化はないと判定し、算出した値が該閾値以上なら状況に変化ありと判定する。   Here, the situation is a surrounding environment or a movement of the imaging unit. For example, by attaching an acceleration sensor to the imaging unit and checking the value obtained from the acceleration sensor by the control unit 10, it can be determined whether or not the imaging unit has moved. Also, without using an acceleration sensor, a change in the situation can be determined by comparing the captured image with the image captured in the previous frame. Specifically, the control unit 10 calculates the difference between the images themselves between the previous frame and the current frame (for example, calculates the absolute value of the pixel value difference in pixel units, Is calculated, and if the calculated value is smaller than a predetermined threshold, it is determined that there is no change in the situation, and if the calculated value is equal to or greater than the threshold, it is determined that there is a change in the situation.

制御部10は、状況に変化がないと判定したら(ステップS132;No)、ステップS112に行き、画像生成部19は、前回のフレームでの選出変換行列を用いて画像生成する。状況に変化ありと判定したら(ステップS132;Yes)、ステップS102に行き、今回のフレームで、新たに変換行列を選出する処理に入る。なお、上述のステップS131及びステップS132において、制御部10は、状況判定手段として機能する。   When the control unit 10 determines that there is no change in the situation (step S132; No), the process proceeds to step S112, and the image generation unit 19 generates an image using the selection conversion matrix in the previous frame. If it is determined that there is a change in the situation (step S132; Yes), the process proceeds to step S102, and a process for selecting a new transformation matrix in the current frame is started. In steps S131 and S132 described above, the control unit 10 functions as a situation determination unit.

変形例6では、状況が変化した時だけ変換行列の算出を行うので、処理負荷を軽くすることができる。   In the sixth modification, the conversion matrix is calculated only when the situation changes, so that the processing load can be reduced.

(変形例7)
上述の実施形態及び変形例では、変換行列選出部18は、今回のフレームで算出された変換行列での評価値と1つ前のフレームで算出された変換行列での評価値とを用いて最適な変換行列の選出を行っているが、これに限られない。例えば、変形例7として、1つ前のフレームだけで無く、2つ前のフレームで算出された変換行列での評価値も用いて最適な変換行列の選出を行ってもよい。さらには、3つ前やそれ以上前のフレームで算出された変換行列での評価値も用いて最適な変換行列の選出を行ってもよい。
(Modification 7)
In the above-described embodiment and the modified example, the transformation matrix selection unit 18 optimizes using the evaluation value in the transformation matrix calculated in the current frame and the evaluation value in the transformation matrix calculated in the immediately preceding frame. Selection of a suitable transformation matrix is performed, but the present invention is not limited to this. For example, as a seventh modification, an optimal conversion matrix may be selected using not only the immediately preceding frame but also the evaluation value of the conversion matrix calculated in the two preceding frames. Furthermore, an optimal conversion matrix may be selected using the evaluation values of the conversion matrix calculated in the frame three or more frames before.

変形例7では、過去のフレームでの評価値を複数用いることで、より適切な変換行列が選出される可能性を高めることができる。   In Modification 7, the possibility of selecting a more appropriate transformation matrix can be increased by using a plurality of evaluation values in past frames.

なお、上述の実施形態及び変形例では、画像処理装置100は、撮像部を2つ(第1撮像部31及び第2撮像部32)備えていた。しかし、例えば、他の装置から動画像を取得したり、記憶部20に記憶された動画像を取得したりして、画像取得部11が複数の動画像を取得できる場合には、画像処理装置は撮像部を備えなくてもよい。   In the above-described embodiment and the modification, the image processing apparatus 100 includes two imaging units (the first imaging unit 31 and the second imaging unit 32). However, for example, when the image acquiring unit 11 can acquire a plurality of moving images by acquiring a moving image from another device or acquiring a moving image stored in the storage unit 20, the image processing apparatus Need not include an imaging unit.

また、上述の実施形態及び変形例では、画像処理装置100は、第1の画像と第2の画像をつなぎ合わせていたが、つなぎ合わせる画像の数は2つに限られない。画像処理装置は、3以上の画像をそれぞれ隣り合う画像との共通領域に基づいてつなぎ合わせた画像を生成してもよい。   Further, in the above-described embodiment and the modified example, the image processing apparatus 100 connects the first image and the second image. However, the number of images to be connected is not limited to two. The image processing apparatus may generate an image in which three or more images are connected based on a common area with each of the adjacent images.

なお、上述の実施形態1及び各変形例は適宜組み合わせることができる。例えば、変形例4(図17)に変形例6(図19)を組み合わせると、状況に変化がなければ前回の選出変換行列が今回の選出変換行列になり、状況に変化があれば前回の選出変換行列が今回の変換行列の初期値として扱われるので、処理負荷を軽減しつつ、より適切な変換行列が選出される可能性を高めることができる。   The above-described first embodiment and each of the modifications can be appropriately combined. For example, when Modification Example 4 (FIG. 17) is combined with Modification Example 6 (FIG. 19), if there is no change in the situation, the previous selected transformation matrix becomes the current selected transformation matrix. Since the transformation matrix is treated as the initial value of the current transformation matrix, it is possible to reduce the processing load and increase the possibility of selecting a more appropriate transformation matrix.

また、変形例5(図18)に変形例6(図19)を組み合わせると、状況に変化がなければ前回の選出変換行列が今回の選出変換行列になり、状況に変化があっても前回の選出変換行列での誤差が小さければ前回の選出変換行列が今回の選出変換行列になり、それ以外の場合に前回の選出変換行列が今回の変換行列の初期値として扱われるので、さらに処理負荷を軽減しつつ、より適切な変換行列が選出される可能性を高めることができる。   Also, when Modification 6 (FIG. 19) is combined with Modification 5 (FIG. 18), if there is no change in the situation, the previous selected transformation matrix becomes the current selected transformation matrix. If the error in the selected transformation matrix is small, the previous selected transformation matrix will be the current selected transformation matrix, otherwise the previous selected transformation matrix will be treated as the initial value of the current transformation matrix, so the processing load will be further reduced. It is possible to increase the possibility that a more appropriate transformation matrix is selected while reducing the number.

なお、画像処理装置100の各機能は、通常のPC(Personal Computer)等のコンピュータによっても実施することができる。具体的には、上記実施形態では、画像処理装置100が行う画像処理等のプログラムが、記憶部20のROMに予め記憶されているものとして説明した。しかし、プログラムを、フレキシブルディスク、CD−ROM(Compact Disc Read Only Memory)、DVD(Digital Versatile Disc)、MO(Magneto−Optical Disc)、メモリカード、USB(Universal Serial Bus)メモリ等のコンピュータ読み取り可能な記録媒体に格納して配布し、そのプログラムをコンピュータに読み込んでインストールすることにより、上述の各機能を実現することができるコンピュータを構成してもよい。   Note that each function of the image processing apparatus 100 can also be performed by a computer such as a normal PC (Personal Computer). Specifically, in the above-described embodiment, the description has been given assuming that the program of the image processing performed by the image processing apparatus 100 is stored in the ROM of the storage unit 20 in advance. However, the program may be stored in a flexible disk, a compact disc read only memory (CD-ROM), a digital versatile disc (DVD), a magneto-optical disc (MO), a memory card, a USB (Universal Serial Readable Memory) memory such as a computer. A computer capable of realizing the above-described functions by storing and distributing the program in a recording medium, reading the program into the computer, and installing the program may be configured.

以上、本発明の好ましい実施形態について説明したが、本発明は係る特定の実施形態に限定されるものではなく、本発明には、特許請求の範囲に記載された発明とその均等の範囲が含まれる。以下に、本願出願の当初の特許請求の範囲に記載された発明を付記する。   As described above, the preferred embodiments of the present invention have been described, but the present invention is not limited to the specific embodiments, and the present invention includes the inventions described in the claims and equivalents thereof. It is. Hereinafter, the inventions described in the claims of the present application will be additionally described.

(付記1)
第1の画像と、前記第1の画像と互いに端部が共通する第2の画像と、をそれぞれフレーム単位で取得する画像取得手段と、
前記画像取得手段が取得した前記第1の画像と前記第2の画像とで共通する領域である共通領域を特定する共通領域特定手段と、
前記共通領域特定手段により特定された前記共通領域において、前記第1の画像と前記第2の画像とで対応する特徴点のペアを特定する特徴点特定手段と、
前記特徴点特定手段により特定された特徴点のペアに基づき、前記第1の画像中の第1の特徴点を始点とし、前記第1の特徴点に対応する前記第2の画像中の第2の特徴点を終点とする、移動ベクトルを複数算出する移動ベクトル算出手段と、
前記移動ベクトル算出手段により算出された複数の移動ベクトルから選定された選定移動ベクトルに基づいて変換行列を算出する変換行列算出手段と、
前記変換行列算出手段により算出された変換行列を用いて、前記第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出する変換手段と、
前記第2の特徴点の位置と前記変換手段により算出された前記移動後特徴点の位置との間の誤差を算出する誤差算出手段と、
所定のフレームにおいて、前記変換行列算出手段により算出された複数の変換行列の中から、前記誤差算出手段により算出された誤差が所定の条件を満たす変換行列を選出する変換行列選出手段と、
前記変換行列選出手段が選出した変換行列を用いて前記第1の画像と前記第2の画像とをつなぎ合わせた画像を生成する画像生成手段と、
を備え、
前記変換行列選出手段は、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて前記変換行列算出手段で算出された複数の変換行列の中から、所定の条件を満たす変換行列を選出する、
画像処理装置。
(Appendix 1)
Image acquisition means for acquiring each of the first image and the second image having an end common to the first image in frame units;
Common area specifying means for specifying a common area that is an area common between the first image and the second image obtained by the image obtaining means;
A feature point specifying unit that specifies a pair of corresponding feature points in the first image and the second image in the common region specified by the common region specifying unit;
Based on a pair of feature points specified by the feature point specifying means, a first feature point in the first image is set as a starting point, and a second feature point in the second image corresponding to the first feature point is set. A movement vector calculation unit that calculates a plurality of movement vectors, ending with the feature point of
Conversion matrix calculation means for calculating a conversion matrix based on a selected movement vector selected from the plurality of movement vectors calculated by the movement vector calculation means,
A conversion unit that calculates a position of a post-movement feature point that is a position obtained by converting the position of the first feature point in the first image, using the conversion matrix calculated by the conversion matrix calculation unit;
Error calculation means for calculating an error between the position of the second feature point and the position of the moved feature point calculated by the conversion means;
In a predetermined frame, from among the plurality of conversion matrices calculated by the conversion matrix calculation unit, a conversion matrix selection unit that selects a conversion matrix whose error calculated by the error calculation unit satisfies a predetermined condition,
Image generation means for generating an image obtained by joining the first image and the second image using the conversion matrix selected by the conversion matrix selection means;
With
The conversion matrix selection unit is a conversion matrix that satisfies a predetermined condition from a conversion matrix selected in a frame before the predetermined frame and a plurality of conversion matrices calculated by the conversion matrix calculation unit in the predetermined frame. Select a matrix,
Image processing device.

(付記2)
さらに状況を判定する状況判定手段を備え、
前記変換行列選出手段は、前記状況判定手段が状況に変化はないと判定したら、前記所定のフレームの前のフレームにおいて選出された変換行列を前記所定のフレームにおける変換行列として選出する、
付記1に記載の画像処理装置。
(Appendix 2)
Further provided is a situation determination means for determining a situation,
The conversion matrix selection unit, when the situation determination unit determines that there is no change in the situation, selects a conversion matrix selected in a frame before the predetermined frame as a conversion matrix in the predetermined frame,
The image processing device according to supplementary note 1.

(付記3)
前記変換手段は、前記所定のフレームの前のフレームにおいて選出された変換行列と、前記所定のフレームにおいて前記変換行列選出手段が選出した変換行列の、それぞれを用いて前記第1の画像中の第1の特徴点の位置を変換して移動後特徴点の位置を算出し、
前記誤差算出手段は、前記変換手段が算出した移動後特徴点の位置に基づき、前記所定のフレームの前のフレームにおいて選出された変換行列に基づく誤差である前フレーム誤差と、前記所定のフレームで選出された変換行列に基づく誤差である現フレーム誤差と、を算出し、
前記変換行列選出手段は、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて前記変換行列算出手段で算出された複数の変換行列の中から、前記前フレーム誤差及び前記現フレーム誤差が所定の条件を満たす変換行列を選出する、
付記1又は2に記載の画像処理装置。
(Appendix 3)
The conversion unit uses a conversion matrix selected in a frame before the predetermined frame and a conversion matrix selected by the conversion matrix selection unit in the predetermined frame, and uses the conversion matrix in the first image. The position of the feature point is calculated by converting the position of the first feature point,
The error calculation means is based on the position of the post-movement feature point calculated by the conversion means, a previous frame error which is an error based on a conversion matrix selected in a frame before the predetermined frame, and The current frame error, which is an error based on the selected transformation matrix, is calculated,
The conversion matrix selection unit, from among a plurality of conversion matrices calculated by the conversion matrix calculation unit in the predetermined frame and the conversion matrix selected in the frame before the predetermined frame, the previous frame error and the Selecting a transformation matrix whose current frame error satisfies a predetermined condition,
3. The image processing apparatus according to claim 1 or 2.

(付記4)
前記変換行列選出手段は、前記前フレーム誤差が所定の閾値より小さい場合には、前記所定のフレームの前のフレームにおいて選出された変換行列を前記所定のフレームにおける変換行列として選出する、
付記3に記載の画像処理装置。
(Appendix 4)
When the previous frame error is smaller than a predetermined threshold, the conversion matrix selection unit selects a conversion matrix selected in a frame before the predetermined frame as a conversion matrix in the predetermined frame.
An image processing device according to attachment 3.

(付記5)
前記第1の画像と前記第2の画像は半天球画像であって、それを合成することで全天球画像を生成する、
付記1から4のいずれか1つに記載の画像処理装置。
(Appendix 5)
The first image and the second image are hemispherical images, and generate a full spherical image by combining them.
The image processing device according to any one of supplementary notes 1 to 4.

(付記6)
第1の画像と、前記第1の画像と互いに端部が共通する第2の画像と、をそれぞれフレーム単位で取得し、
前記取得した前記第1の画像と前記第2の画像とで共通する領域である共通領域を特定し、
前記特定された前記共通領域において、前記第1の画像と前記第2の画像とで対応する特徴点のペアを特定し、
前記特定された特徴点のペアに基づき、前記第1の画像中の第1の特徴点を始点とし、前記第1の特徴点に対応する前記第2の画像中の第2の特徴点を終点とする、移動ベクトルを複数算出し、
前記算出された複数の移動ベクトルから選定された選定移動ベクトルに基づいて変換行列を算出し、
前記算出された変換行列を用いて、前記第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出し、
前記第2の特徴点の位置と前記算出された前記移動後特徴点の位置との間の誤差を算出し、
所定のフレームにおいて、前記算出された複数の変換行列の中から、前記算出された誤差が所定の条件を満たす変換行列を選出し、
前記選出した変換行列を用いて前記第1の画像と前記第2の画像とをつなぎ合わせた画像を生成する、
画像処理方法であって、
前記変換行列の選出において、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて算出された複数の変換行列の中から、所定の条件を満たす変換行列を選出する、
画像処理方法。
(Appendix 6)
Acquiring a first image and a second image having an end common to the first image in frame units,
Specifying a common area that is a common area between the obtained first image and the second image;
In the specified common area, a pair of feature points corresponding to the first image and the second image is specified,
Based on the identified pair of feature points, a first feature point in the first image is set as a start point, and a second feature point in the second image corresponding to the first feature point is set as an end point. , Calculate a plurality of movement vectors,
Calculating a transformation matrix based on the selected movement vector selected from the plurality of calculated movement vectors,
Using the calculated transformation matrix, calculate the position of the moved feature point, which is the position obtained by converting the position of the first feature point in the first image,
Calculating an error between the position of the second feature point and the calculated position of the moved feature point;
In a predetermined frame, from the plurality of calculated conversion matrices, the calculated error selects a conversion matrix that satisfies a predetermined condition,
Using the selected transformation matrix, generate an image obtained by joining the first image and the second image,
An image processing method,
In the selection of the transformation matrix, from a plurality of transformation matrices calculated in the predetermined frame and the transformation matrix selected in the frame before the predetermined frame, to select a conversion matrix that satisfies a predetermined condition,
Image processing method.

(付記7)
コンピュータに、
第1の画像と、前記第1の画像と互いに端部が共通する第2の画像と、をそれぞれフレーム単位で取得し、
前記取得した前記第1の画像と前記第2の画像とで共通する領域である共通領域を特定し、
前記特定された前記共通領域において、前記第1の画像と前記第2の画像とで対応する特徴点のペアを特定し、
前記特定された特徴点のペアに基づき、前記第1の画像中の第1の特徴点を始点とし、前記第1の特徴点に対応する前記第2の画像中の第2の特徴点を終点とする、移動ベクトルを複数算出し、
前記算出された複数の移動ベクトルから選定された選定移動ベクトルに基づいて変換行列を算出し、
前記算出された変換行列を用いて、前記第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出し、
前記第2の特徴点の位置と前記算出された前記移動後特徴点の位置との間の誤差を算出し、
所定のフレームにおいて、前記算出された複数の変換行列の中から、前記算出された誤差が所定の条件を満たす変換行列を選出し、
前記選出した変換行列を用いて前記第1の画像と前記第2の画像とをつなぎ合わせた画像を生成する、
処理を実行させるためのプログラムであって、
前記変換行列の選出において、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて算出された複数の変換行列の中から、所定の条件を満たす変換行列を選出する、
プログラム。
(Appendix 7)
On the computer,
Acquiring a first image and a second image having an end common to the first image in frame units,
Specifying a common area that is a common area between the obtained first image and the second image;
In the specified common area, a pair of feature points corresponding to the first image and the second image is specified,
Based on the identified pair of feature points, a first feature point in the first image is set as a start point, and a second feature point in the second image corresponding to the first feature point is set as an end point. , Calculate a plurality of movement vectors,
Calculating a transformation matrix based on the selected movement vector selected from the plurality of calculated movement vectors,
Using the calculated transformation matrix, calculate the position of the moved feature point, which is the position obtained by converting the position of the first feature point in the first image,
Calculating an error between the position of the second feature point and the calculated position of the moved feature point;
In a predetermined frame, from the plurality of calculated conversion matrices, the calculated error selects a conversion matrix that satisfies a predetermined condition,
Using the selected transformation matrix, generate an image obtained by joining the first image and the second image,
A program for executing a process,
In the selection of the transformation matrix, from a plurality of transformation matrices calculated in the predetermined frame and the transformation matrix selected in the frame before the predetermined frame, to select a conversion matrix that satisfies a predetermined condition,
program.

10…制御部、11…画像取得部、12…共通領域特定部、13…特徴点特定部、14…移動ベクトル算出部、15…変換行列算出部、16…変換部、17…誤差算出部、18…変換行列選出部、19…画像生成部、20…記憶部、31…第1撮像部、32…第2撮像部、51,52…半天球画像、53…実線、54,55,56…点線、61…丸、71,72…共通領域、73,74…領域、100…画像処理装置 DESCRIPTION OF SYMBOLS 10 ... Control part, 11 ... Image acquisition part, 12 ... Common area specification part, 13 ... Feature point specification part, 14 ... Movement vector calculation part, 15 ... Conversion matrix calculation part, 16 ... Conversion part, 17 ... Error calculation part, 18: transformation matrix selection unit, 19: image generation unit, 20: storage unit, 31: first imaging unit, 32: second imaging unit, 51, 52: semi-celestial sphere image, 53: solid line, 54, 55, 56 ... Dotted line, 61: circle, 71, 72: common area, 73, 74: area, 100: image processing apparatus

Claims (7)

第1の画像と、前記第1の画像と互いに端部が共通する第2の画像と、をそれぞれフレーム単位で取得する画像取得手段と、
前記画像取得手段が取得した前記第1の画像と前記第2の画像とで共通する領域である共通領域を特定する共通領域特定手段と、
前記共通領域特定手段により特定された前記共通領域において、前記第1の画像と前記第2の画像とで対応する特徴点のペアを特定する特徴点特定手段と、
前記特徴点特定手段により特定された特徴点のペアに基づき、前記第1の画像中の第1の特徴点を始点とし、前記第1の特徴点に対応する前記第2の画像中の第2の特徴点を終点とする、移動ベクトルを複数算出する移動ベクトル算出手段と、
前記移動ベクトル算出手段により算出された複数の移動ベクトルから選定された選定移動ベクトルに基づいて変換行列を算出する変換行列算出手段と、
前記変換行列算出手段により算出された変換行列を用いて、前記第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出する変換手段と、
前記第2の特徴点の位置と前記変換手段により算出された前記移動後特徴点の位置との間の誤差を算出する誤差算出手段と、
所定のフレームにおいて、前記変換行列算出手段により算出された複数の変換行列の中から、前記誤差算出手段により算出された誤差が所定の条件を満たす変換行列を選出する変換行列選出手段と、
前記変換行列選出手段が選出した変換行列を用いて前記第1の画像と前記第2の画像とをつなぎ合わせた画像を生成する画像生成手段と、
を備え、
前記変換行列選出手段は、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて前記変換行列算出手段で算出された複数の変換行列の中から、所定の条件を満たす変換行列を選出する、
画像処理装置。
Image acquisition means for acquiring each of the first image and the second image having an end common to the first image in frame units;
Common area specifying means for specifying a common area that is an area common between the first image and the second image obtained by the image obtaining means;
A feature point specifying unit that specifies a pair of corresponding feature points in the first image and the second image in the common region specified by the common region specifying unit;
Based on a pair of feature points specified by the feature point specifying means, a first feature point in the first image is set as a starting point, and a second feature point in the second image corresponding to the first feature point is set. A movement vector calculation unit that calculates a plurality of movement vectors, ending with the feature point of
Conversion matrix calculation means for calculating a conversion matrix based on a selected movement vector selected from the plurality of movement vectors calculated by the movement vector calculation means,
A conversion unit that calculates a position of a post-movement feature point that is a position obtained by converting the position of the first feature point in the first image, using the conversion matrix calculated by the conversion matrix calculation unit;
Error calculation means for calculating an error between the position of the second feature point and the position of the moved feature point calculated by the conversion means;
In a predetermined frame, from among the plurality of conversion matrices calculated by the conversion matrix calculation unit, a conversion matrix selection unit that selects a conversion matrix whose error calculated by the error calculation unit satisfies a predetermined condition,
Image generation means for generating an image obtained by joining the first image and the second image using the conversion matrix selected by the conversion matrix selection means;
With
The conversion matrix selection unit is a conversion matrix that satisfies a predetermined condition from a conversion matrix selected in a frame before the predetermined frame and a plurality of conversion matrices calculated by the conversion matrix calculation unit in the predetermined frame. Select a matrix,
Image processing device.
さらに状況を判定する状況判定手段を備え、
前記変換行列選出手段は、前記状況判定手段が状況に変化はないと判定したら、前記所定のフレームの前のフレームにおいて選出された変換行列を前記所定のフレームにおける変換行列として選出する、
請求項1に記載の画像処理装置。
Further provided is a situation determination means for determining a situation,
The conversion matrix selection unit, when the situation determination unit determines that there is no change in the situation, selects a conversion matrix selected in a frame before the predetermined frame as a conversion matrix in the predetermined frame,
The image processing device according to claim 1.
前記変換手段は、前記所定のフレームの前のフレームにおいて選出された変換行列と、前記所定のフレームにおいて前記変換行列選出手段が選出した変換行列の、それぞれを用いて前記第1の画像中の第1の特徴点の位置を変換して移動後特徴点の位置を算出し、
前記誤差算出手段は、前記変換手段が算出した移動後特徴点の位置に基づき、前記所定のフレームの前のフレームにおいて選出された変換行列に基づく誤差である前フレーム誤差と、前記所定のフレームで選出された変換行列に基づく誤差である現フレーム誤差と、を算出し、
前記変換行列選出手段は、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて前記変換行列算出手段で算出された複数の変換行列の中から、前記前フレーム誤差及び前記現フレーム誤差が所定の条件を満たす変換行列を選出する、
請求項1又は2に記載の画像処理装置。
The conversion unit uses a conversion matrix selected in a frame before the predetermined frame and a conversion matrix selected by the conversion matrix selection unit in the predetermined frame, and uses the conversion matrix in the first image. The position of the feature point is calculated by converting the position of the first feature point,
The error calculation means is based on the position of the post-movement feature point calculated by the conversion means, a previous frame error which is an error based on a conversion matrix selected in a frame before the predetermined frame, and The current frame error, which is an error based on the selected transformation matrix, is calculated,
The conversion matrix selection unit, from among a plurality of conversion matrices calculated by the conversion matrix calculation unit in the predetermined frame and the conversion matrix selected in the frame before the predetermined frame, the previous frame error and the Selecting a transformation matrix whose current frame error satisfies a predetermined condition,
The image processing device according to claim 1.
前記変換行列選出手段は、前記前フレーム誤差が所定の閾値より小さい場合には、前記所定のフレームの前のフレームにおいて選出された変換行列を前記所定のフレームにおける変換行列として選出する、
請求項3に記載の画像処理装置。
When the previous frame error is smaller than a predetermined threshold, the conversion matrix selection unit selects a conversion matrix selected in a frame before the predetermined frame as a conversion matrix in the predetermined frame.
The image processing device according to claim 3.
前記第1の画像と前記第2の画像は半天球画像であって、それを合成することで全天球画像を生成する、
請求項1から4のいずれか1項に記載の画像処理装置。
The first image and the second image are hemispherical images, and generate a full spherical image by combining them.
The image processing apparatus according to claim 1.
第1の画像と、前記第1の画像と互いに端部が共通する第2の画像と、をそれぞれフレーム単位で取得し、
前記取得した前記第1の画像と前記第2の画像とで共通する領域である共通領域を特定し、
前記特定された前記共通領域において、前記第1の画像と前記第2の画像とで対応する特徴点のペアを特定し、
前記特定された特徴点のペアに基づき、前記第1の画像中の第1の特徴点を始点とし、前記第1の特徴点に対応する前記第2の画像中の第2の特徴点を終点とする、移動ベクトルを複数算出し、
前記算出された複数の移動ベクトルから選定された選定移動ベクトルに基づいて変換行列を算出し、
前記算出された変換行列を用いて、前記第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出し、
前記第2の特徴点の位置と前記算出された前記移動後特徴点の位置との間の誤差を算出し、
所定のフレームにおいて、前記算出された複数の変換行列の中から、前記算出された誤差が所定の条件を満たす変換行列を選出し、
前記選出した変換行列を用いて前記第1の画像と前記第2の画像とをつなぎ合わせた画像を生成する、
画像処理方法であって、
前記変換行列の選出において、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて算出された複数の変換行列の中から、所定の条件を満たす変換行列を選出する、
画像処理方法。
Acquiring a first image and a second image having an end common to the first image in frame units,
Specifying a common area that is a common area between the obtained first image and the second image;
In the specified common area, a pair of feature points corresponding to the first image and the second image is specified,
Based on the identified pair of feature points, a first feature point in the first image is set as a start point, and a second feature point in the second image corresponding to the first feature point is set as an end point. , Calculate a plurality of movement vectors,
Calculating a transformation matrix based on the selected movement vector selected from the plurality of calculated movement vectors,
Using the calculated transformation matrix, calculate the position of the moved feature point, which is the position obtained by converting the position of the first feature point in the first image,
Calculating an error between the position of the second feature point and the calculated position of the moved feature point;
In a predetermined frame, from the plurality of calculated conversion matrices, the calculated error selects a conversion matrix that satisfies a predetermined condition,
Using the selected transformation matrix, generate an image obtained by joining the first image and the second image,
An image processing method,
In the selection of the transformation matrix, from a plurality of transformation matrices calculated in the predetermined frame and the transformation matrix selected in the frame before the predetermined frame, to select a conversion matrix that satisfies a predetermined condition,
Image processing method.
コンピュータに、
第1の画像と、前記第1の画像と互いに端部が共通する第2の画像と、をそれぞれフレーム単位で取得し、
前記取得した前記第1の画像と前記第2の画像とで共通する領域である共通領域を特定し、
前記特定された前記共通領域において、前記第1の画像と前記第2の画像とで対応する特徴点のペアを特定し、
前記特定された特徴点のペアに基づき、前記第1の画像中の第1の特徴点を始点とし、前記第1の特徴点に対応する前記第2の画像中の第2の特徴点を終点とする、移動ベクトルを複数算出し、
前記算出された複数の移動ベクトルから選定された選定移動ベクトルに基づいて変換行列を算出し、
前記算出された変換行列を用いて、前記第1の画像中の第1の特徴点の位置を変換した位置である移動後特徴点の位置を算出し、
前記第2の特徴点の位置と前記算出された前記移動後特徴点の位置との間の誤差を算出し、
所定のフレームにおいて、前記算出された複数の変換行列の中から、前記算出された誤差が所定の条件を満たす変換行列を選出し、
前記選出した変換行列を用いて前記第1の画像と前記第2の画像とをつなぎ合わせた画像を生成する、
処理を実行させるためのプログラムであって、
前記変換行列の選出において、前記所定のフレームの前のフレームにおいて選出された変換行列と前記所定のフレームにおいて算出された複数の変換行列の中から、所定の条件を満たす変換行列を選出する、
プログラム。
On the computer,
Acquiring a first image and a second image having an end common to the first image in frame units,
Specifying a common area that is a common area between the obtained first image and the second image;
In the specified common area, a pair of feature points corresponding to the first image and the second image is specified,
Based on the identified pair of feature points, a first feature point in the first image is set as a start point, and a second feature point in the second image corresponding to the first feature point is set as an end point. , Calculate a plurality of movement vectors,
Calculating a transformation matrix based on the selected movement vector selected from the plurality of calculated movement vectors,
Using the calculated transformation matrix, calculate the position of the moved feature point, which is the position obtained by converting the position of the first feature point in the first image,
Calculating an error between the position of the second feature point and the calculated position of the moved feature point;
In a predetermined frame, from the plurality of calculated conversion matrices, the calculated error selects a conversion matrix that satisfies a predetermined condition,
Using the selected transformation matrix, generate an image obtained by joining the first image and the second image,
A program for executing a process,
In the selection of the transformation matrix, from a plurality of transformation matrices calculated in the predetermined frame and the transformation matrix selected in the frame before the predetermined frame, to select a conversion matrix that satisfies a predetermined condition,
program.
JP2018187089A 2018-10-02 2018-10-02 Image processing device, image processing method, and program Pending JP2020057182A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018187089A JP2020057182A (en) 2018-10-02 2018-10-02 Image processing device, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018187089A JP2020057182A (en) 2018-10-02 2018-10-02 Image processing device, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2020057182A true JP2020057182A (en) 2020-04-09

Family

ID=70107369

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018187089A Pending JP2020057182A (en) 2018-10-02 2018-10-02 Image processing device, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2020057182A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022101998A1 (en) * 2020-11-10 2022-05-19 日本電気株式会社 Planar projective transformation matrix generation device, control method, and computer-readable medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010128820A (en) * 2008-11-27 2010-06-10 Fujifilm Corp Apparatus, method and program for processing three-dimensional image, and three-dimensional imaging apparatus
US20120249536A1 (en) * 2011-03-28 2012-10-04 Sony Corporation Image processing device, image processing method, and program
WO2015015542A1 (en) * 2013-07-29 2015-02-05 株式会社日立製作所 Vehicle-mounted stereo camera system and calibration method therefor
JP2016040670A (en) * 2014-08-12 2016-03-24 株式会社リコー Image processing system, image processor, program and imaging system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010128820A (en) * 2008-11-27 2010-06-10 Fujifilm Corp Apparatus, method and program for processing three-dimensional image, and three-dimensional imaging apparatus
US20120249536A1 (en) * 2011-03-28 2012-10-04 Sony Corporation Image processing device, image processing method, and program
WO2015015542A1 (en) * 2013-07-29 2015-02-05 株式会社日立製作所 Vehicle-mounted stereo camera system and calibration method therefor
JP2016040670A (en) * 2014-08-12 2016-03-24 株式会社リコー Image processing system, image processor, program and imaging system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NIE, YONGWEI ET AL.: "Dynamic Video Stitching via Shakiness Removing", IEEE TRANSACTIONS ON IMAGE PROCESSING, vol. Volume: 27, Issue: 1, JPN6022040362, January 2018 (2018-01-01), pages 164 - 178, ISSN: 0004881035 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022101998A1 (en) * 2020-11-10 2022-05-19 日本電気株式会社 Planar projective transformation matrix generation device, control method, and computer-readable medium
JP7448034B2 (en) 2020-11-10 2024-03-12 日本電気株式会社 Planar projection transformation matrix generation device, control method, and program

Similar Documents

Publication Publication Date Title
US11232593B2 (en) Calibration apparatus, calibration system, and calibration method
US10789676B2 (en) Image processing device, image processing method, and program
US10972661B2 (en) Apparatus and methods for image alignment
KR102227583B1 (en) Method and apparatus for camera calibration based on deep learning
US10210622B2 (en) Image processing device, image processing method, and recording medium storing program
JP5960595B2 (en) Image processing apparatus, image processing method, program, and photographing apparatus
US8417059B2 (en) Image processing device, image processing method, and program
JP7211621B2 (en) Image generation device and image generation program
JPWO2012063468A1 (en) Image processing apparatus, image processing method, and program
JP6518115B2 (en) IMAGE PROCESSING APPARATUS, IMAGING APPARATUS, CONTROL METHOD OF IMAGE PROCESSING APPARATUS, AND PROGRAM
JP2003178298A (en) Image processor, image processing method, storage medium and computer program
US9413952B2 (en) Image processing apparatus, distance measuring apparatus, imaging apparatus, and image processing method
US11715218B2 (en) Information processing apparatus and information processing method
JP2020057182A (en) Image processing device, image processing method, and program
JP2019009643A (en) Image processing apparatus, image processing method and program
US20230148125A1 (en) Image processing apparatus and method, and image capturing apparatus
CN116245734A (en) Panoramic image generation method, device, equipment and storage medium
WO2018150086A2 (en) Methods and apparatuses for determining positions of multi-directional image capture apparatuses
JP5239991B2 (en) Image processing apparatus and image processing system
WO2018100230A1 (en) Method and apparatuses for determining positions of multi-directional image capture apparatuses
JP6451300B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP6769357B2 (en) Image processing equipment, image processing method and imaging equipment
CN109214983B (en) Image acquisition device and image splicing method thereof
JP7009252B2 (en) Image processing equipment, image processing methods and programs
JP3452188B2 (en) Tracking method of feature points in 2D video

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210917

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220810

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220927

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221122

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20230314

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230609

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20230621

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20230825

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240403