JP2016119580A - Image processing apparatus, imaging apparatus, image processing method, and program - Google Patents

Image processing apparatus, imaging apparatus, image processing method, and program Download PDF

Info

Publication number
JP2016119580A
JP2016119580A JP2014258378A JP2014258378A JP2016119580A JP 2016119580 A JP2016119580 A JP 2016119580A JP 2014258378 A JP2014258378 A JP 2014258378A JP 2014258378 A JP2014258378 A JP 2014258378A JP 2016119580 A JP2016119580 A JP 2016119580A
Authority
JP
Japan
Prior art keywords
image
feature point
unit
virtual feature
images
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.)
Granted
Application number
JP2014258378A
Other languages
Japanese (ja)
Other versions
JP6421587B2 (en
JP2016119580A5 (en
Inventor
正雄 松原
Masao Matsubara
正雄 松原
達也 八木
Tatsuya Yagi
達也 八木
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 JP2014258378A priority Critical patent/JP6421587B2/en
Publication of JP2016119580A publication Critical patent/JP2016119580A/en
Publication of JP2016119580A5 publication Critical patent/JP2016119580A5/ja
Application granted granted Critical
Publication of JP6421587B2 publication Critical patent/JP6421587B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To execute camera shake correction in consideration of an influence of parallax with simple calculation.SOLUTION: A specification part 101 specifies one of a plurality of images constituting moving images. A fundamental matrix acquisition part 102 acquires a fundamental matrix representing a relationship with the specified image for each of the predetermined number of images of the plurality of images other than the image specified by the specification part 101. A selection part 103 selects, from the predetermined number of images, an image for performing epipolar projection to the specified image on the basis of the fundamental matrix acquired for each of the predetermined number of images by the fundamental matrix acquisition part 102. A virtual feature point generation part 104 performs epipolar projection to feature points in the selected image corresponding to each other or an image to which a virtual feature point is specified, on the basis of the fundamental matrix acquired for the image selected by the selection part 103, out of the fundamental matrices acquired by the fundamental matrix acquisition part 102 to generate a virtual feature point in the specified image.SELECTED DRAWING: Figure 2

Description

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

動画に対する手ぶれを補正する方法として、特徴点追跡方式と呼ばれる技術が知られている。特徴点追跡方式においては、動画に含まれる各フレームの画像から特徴点を抽出し、抽出した特徴点の移動ベクトルから構成したオプティカルフローを時間的に平滑化することにより、動画に対して手ぶれを補正する。   A technique called a feature point tracking method is known as a method for correcting camera shake for a moving image. In the feature point tracking method, a feature point is extracted from an image of each frame included in the moving image, and an optical flow composed of the extracted feature point movement vector is temporally smoothed, thereby causing a camera shake on the moving image. to correct.

しかし、特徴点追跡方式は三次元物体の視差の影響を考慮していないため、手ぶれ補正後の動画に不自然な歪みが生じることがあるという欠点があった。   However, since the feature point tracking method does not consider the influence of parallax of a three-dimensional object, there is a drawback in that an unnatural distortion may occur in a moving image after camera shake correction.

特徴点追跡方式が有する上述の欠点を克服する方法として、エピポーラ幾何を応用した手ぶれ補正の方法(以下、エピポーラ転送方式と呼ぶ)が知られている。例えば、非特許文献1は、エピポーラ転送方式で手ぶれを補正することにより、視差の影響を抑制し、手ぶれ補正後の動画に生じる不自然な歪みを軽減する技術を開示している。   As a method of overcoming the above-described drawbacks of the feature point tracking method, a method for correcting camera shake using epipolar geometry (hereinafter referred to as an epipolar transfer method) is known. For example, Non-Patent Document 1 discloses a technique that suppresses the influence of parallax by correcting camera shake using an epipolar transfer method, and reduces unnatural distortion that occurs in a moving image after camera shake correction.

Amit Goldstein and. Raanan Fattal, "Video Stabilization using Epipolar Geometry", ACM Transactions on Graphics (TOG), Volume 31, Issue 5, August 2012, Article No.126Amit Goldstein and. Raanan Fattal, "Video Stabilization using Epipolar Geometry", ACM Transactions on Graphics (TOG), Volume 31, Issue 5, August 2012, Article No.126

しかしながら、エピポーラ転送方式の手ぶれ補正は、手ぶれ補正の対象となる各フレームの画像について、例えば過去10フレームの画像との間でのオプティカルフローの計算、及び1フレーム当たり数千本から数万本に及ぶエピポーラ線の投影等、多くの座標計算を必要とする。このため、演算負荷が非常に大きかった。   However, the image stabilization of the epipolar transfer method is based on the calculation of the optical flow with respect to the image of the past 10 frames, for example, the image of each frame to be subjected to the image stabilization, and from thousands to tens of thousands per frame. Many coordinate calculations are required, such as projection of epipolar lines. For this reason, the calculation load was very large.

本発明は、上記の課題に鑑みてなされたものであり、視差の影響を考慮した手ぶれ補正を簡易な演算により実行可能な画像処理装置、撮像装置、画像処理方法、及びプログラムを提供することを目的とする。   The present invention has been made in view of the above problems, and provides an image processing apparatus, an imaging apparatus, an image processing method, and a program capable of performing camera shake correction in consideration of the influence of parallax by a simple calculation. Objective.

上記目的を達成するため、本発明に係る画像処理装置は、
動画を構成する複数の画像の中から1つを指定する指定部と、
前記複数の画像のうちの前記指定部によって指定された画像以外の所定数の画像のそれぞれについて、該指定された画像との関係を表す基礎行列を取得する基礎行列取得部と、
前記基礎行列取得部によって前記所定数の画像のそれぞれについて取得された基礎行列に基づいて、前記所定数の画像の中から、前記指定された画像にエピポーラ投影するための画像を選別する選別部と、
前記基礎行列取得部によって取得された基礎行列のうち、前記選別部によって選別された画像について取得された基礎行列に基づいて、該選別された画像内の互いに対応する特徴点又は仮想特徴点を前記指定された画像にエピポーラ投影することにより、前記指定された画像内における仮想特徴点を生成する仮想特徴点生成部と、
前記複数の画像の中から前記指定部が指定する画像を変えて、前記指定部、前記基礎行列取得部、前記選別部、及び前記仮想特徴点生成部の処理を繰り返すことにより、仮想特徴点軌道を構築する仮想特徴点軌道構築部と、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道を時間方向に平滑化する平滑化部と、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道と、前記平滑化部によって平滑化された仮想特徴点軌道と、の間の関係に基づいて、前記複数の画像のそれぞれを補正する補正部と、
を備えることを特徴とする。
In order to achieve the above object, an image processing apparatus according to the present invention provides:
A designating unit for designating one of a plurality of images constituting the video,
A basic matrix acquisition unit that acquires a basic matrix representing a relationship with the designated image for each of a predetermined number of images other than the image designated by the designation unit of the plurality of images;
A selection unit that selects an image for epipolar projection on the designated image from the predetermined number of images based on the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition unit; ,
Among the basic matrices acquired by the basic matrix acquisition unit, based on the basic matrix acquired for the image selected by the selection unit, the feature points or virtual feature points corresponding to each other in the selected image are A virtual feature point generation unit that generates a virtual feature point in the specified image by performing an epipolar projection on the specified image;
By changing the image designated by the designation unit from the plurality of images and repeating the processing of the designation unit, the basic matrix acquisition unit, the selection unit, and the virtual feature point generation unit, a virtual feature point trajectory A virtual feature point trajectory construction unit for constructing
A smoothing unit that smoothes the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit in the time direction;
Correction that corrects each of the plurality of images based on the relationship between the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit and the virtual feature point trajectory smoothed by the smoothing unit. And
It is characterized by providing.

本発明によれば、視差の影響を考慮した手ぶれ補正を簡易な演算により実行できる。   According to the present invention, camera shake correction in consideration of the influence of parallax can be executed by a simple calculation.

本発明の実施形態に係る撮像装置の構成を例示するブロック図である。It is a block diagram which illustrates the composition of the imaging device concerning the embodiment of the present invention. 本発明の実施形態に係る撮像装置及び画像処理装置の機能構成を例示するブロック図である。1 is a block diagram illustrating a functional configuration of an imaging apparatus and an image processing apparatus according to an embodiment of the present invention. エピポーラ幾何の概念を説明するための図である。It is a figure for demonstrating the concept of epipolar geometry. エピポーラ転送の概念を説明するための図である。It is a figure for demonstrating the concept of epipolar transfer. エピポーラ転送を利用した仮想特徴点軌道の構築を説明するための図である。It is a figure for demonstrating construction | assembly of the virtual feature point locus | trajectory using epipolar transfer. エピポーラ転送方式の手ぶれ補正の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the camera-shake correction of an epipolar transfer system. エピポーラ転送を利用した手ぶれ補正後の特徴点軌道の構築を説明するための図である。It is a figure for demonstrating construction | assembly of the feature point locus | trajectory after the camera-shake correction | amendment using epipolar transfer. 本発明の実施形態に係る画像処理装置が実行する手ぶれ補正処理を説明するためのフローチャートである。5 is a flowchart for explaining camera shake correction processing executed by the image processing apparatus according to the embodiment of the present invention. 本発明の実施形態に係る画像処理装置が実行するオプティカルフロー取得処理を説明するためのフローチャートである。It is a flowchart for demonstrating the optical flow acquisition process which the image processing apparatus which concerns on embodiment of this invention performs. 本発明の実施形態に係る画像処理装置が実行するオプティカルフロー取得処理を説明するための図である。It is a figure for demonstrating the optical flow acquisition process which the image processing apparatus which concerns on embodiment of this invention performs. 本発明の実施形態に係る画像処理装置が実行する基礎行列取得処理を説明するためのフローチャートである。It is a flowchart for demonstrating the basic matrix acquisition process which the image processing apparatus which concerns on embodiment of this invention performs. 本発明の実施形態に係る画像処理装置が実行するフレーム選別処理を説明するためのフローチャートである。It is a flowchart for demonstrating the frame selection process which the image processing apparatus which concerns on embodiment of this invention performs. 本発明の実施形態に係る画像処理装置が実行するフレーム選別処理を説明するための図である。It is a figure for demonstrating the frame selection process which the image processing apparatus which concerns on embodiment of this invention performs. 本発明の実施形態に係る画像処理装置が実行する仮想特徴点生成処理を説明するためのフローチャートである。It is a flowchart for demonstrating the virtual feature point production | generation process which the image processing apparatus which concerns on embodiment of this invention performs. 本発明の実施形態に係る画像処理装置が実行する仮想特徴点軌道準備処理を説明するためのフローチャートである。It is a flowchart for demonstrating the virtual feature point orbit preparation process which the image processing apparatus which concerns on embodiment of this invention performs.

以下、本発明の実施形態に係る画像処理装置、撮像装置、及び画像処理方法を、図面を参照しながら詳細に説明する。尚、図中同一又は同等の部分には同じ符号を付す。   Hereinafter, an image processing apparatus, an imaging apparatus, and an image processing method according to embodiments of the present invention will be described in detail with reference to the drawings. In the drawings, the same or equivalent parts are denoted by the same reference numerals.

撮像装置1は、図1に示すように、撮像部10と、データ処理部20と、ユーザインタフェース部30と、を備える。   As illustrated in FIG. 1, the imaging apparatus 1 includes an imaging unit 10, a data processing unit 20, and a user interface unit 30.

撮像部10は、光学レンズ11とイメージセンサ12とを含む。撮像部10は、後述する操作部32が受け付けたユーザの操作に従って被写体を撮像することにより、手ぶれ補正の対象となる動画を生成する。生成された動画は、時間的に連続して撮像された(連続する複数のフレームにわたって撮像された)複数の画像を含んでいる。   The imaging unit 10 includes an optical lens 11 and an image sensor 12. The imaging unit 10 generates a moving image to be subjected to camera shake correction by imaging a subject in accordance with a user operation received by the operation unit 32 described later. The generated moving image includes a plurality of images that are continuously captured in time (captured over a plurality of consecutive frames).

光学レンズ11は、被写体から射出された光を集光するレンズと、焦点、露出、ホワイトバランス等の撮像設定パラメータを調整するための周辺回路と、を備える。   The optical lens 11 includes a lens that collects light emitted from a subject, and a peripheral circuit for adjusting imaging setting parameters such as focus, exposure, and white balance.

イメージセンサ12は、例えば、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)等を備える。イメージセンサ12は、光学レンズ11が光を集光することによって結像した被写体の光学像を取得して、取得した光学像の電圧情報をアナログ/デジタル変換器(図示せず)によりデジタル画像データに変換する。そして、得られたデジタル画像データを後述する外部記憶部23に保存する。   The image sensor 12 includes, for example, a CCD (Charge Coupled Device), a CMOS (Complementary Metal Oxide Semiconductor), and the like. The image sensor 12 acquires an optical image of a subject formed by the optical lens 11 condensing light, and the voltage information of the acquired optical image is converted into digital image data by an analog / digital converter (not shown). Convert to Then, the obtained digital image data is stored in the external storage unit 23 described later.

データ処理部20は、主記憶部21と、出力部22と、外部記憶部23と、CPU(Central Processing Unit)24と、画像処理装置100と、を含む。   The data processing unit 20 includes a main storage unit 21, an output unit 22, an external storage unit 23, a CPU (Central Processing Unit) 24, and an image processing apparatus 100.

主記憶部21は、例えばRAM(Random Access Memory)等を備える。主記憶部21は、CPU24のワークメモリとして機能し、画像データやプログラムを一時的に記憶する。   The main storage unit 21 includes, for example, a RAM (Random Access Memory). The main storage unit 21 functions as a work memory for the CPU 24 and temporarily stores image data and programs.

出力部22は、主記憶部21や外部記憶部23に記憶された画像データを読み出し、この画像データに対応するRGB(R(Red、赤)、G(Green、緑)、B(Blue、青))信号を生成して、後述する表示部31に出力する。また、出力部22は、生成したRGB信号をCPU24や画像処理装置100へ供給する。   The output unit 22 reads out image data stored in the main storage unit 21 or the external storage unit 23, and RGB (R (Red, red), G (Green, green), B (Blue, blue) corresponding to the image data. )) A signal is generated and output to the display unit 31 described later. The output unit 22 supplies the generated RGB signal to the CPU 24 and the image processing apparatus 100.

外部記憶部23は、不揮発性メモリ(例えば、フラッシュメモリやハードディスク)を備え、撮像装置1全体の制御に必要な制御プログラムを含む種々のプログラム、種々の固定データ等を固定的に記憶する。外部記憶部23は、記憶しているプログラムやデータをCPU24や後述する画像処理装置100へ供給し、撮像部10が生成した動画を含む種々のデータを固定的に記憶する。   The external storage unit 23 includes a non-volatile memory (for example, a flash memory or a hard disk), and stores various programs including a control program necessary for controlling the entire imaging apparatus 1 and various fixed data. The external storage unit 23 supplies the stored program and data to the CPU 24 and the image processing apparatus 100 described later, and fixedly stores various data including moving images generated by the imaging unit 10.

CPU24は、外部記憶部23に記憶された制御プログラムを実行することにより撮像装置1全体を制御するとともに、外部記憶部23に記憶された種々のプログラムを実行する。   The CPU 24 controls the entire imaging apparatus 1 by executing a control program stored in the external storage unit 23 and executes various programs stored in the external storage unit 23.

画像処理装置100は、動画に対してエピポーラ転送方式の手ぶれ補正を施す。画像処理装置100は、図2に示すように、機能的に、指定部101、基礎行列取得部102、選別部103、仮想特徴点生成部104、仮想特徴点軌道構築部105、平滑化部106、補正部107、及び評価部108を備える。これら各部は、CPU24の機能によって実現される。   The image processing apparatus 100 performs camera shake correction using an epipolar transfer method on a moving image. As illustrated in FIG. 2, the image processing apparatus 100 functionally includes a designation unit 101, a basic matrix acquisition unit 102, a selection unit 103, a virtual feature point generation unit 104, a virtual feature point trajectory construction unit 105, and a smoothing unit 106. A correction unit 107 and an evaluation unit 108. These units are realized by the functions of the CPU 24.

尚、画像処理装置100は、通常の画像処理装置と同様に、トリミング機能や画像拡大・縮小機能等を有するが、以下では、本実施形態に特徴的な、エピポーラ転送方式の手ぶれ補正を動画に施す機能を中心に説明する。   The image processing apparatus 100 has a trimming function, an image enlargement / reduction function, and the like, as in a normal image processing apparatus. In the following, the epipolar transfer type camera shake correction characteristic of the present embodiment is converted into a moving image. The function to be performed will be mainly described.

指定部101は、手ぶれ補正対象の動画を構成する複数の画像の中から1つを指定する。基礎行列取得部102は、手ぶれ補正対象の動画を構成する複数の画像のうちの指定部101によって指定された画像以外の所定数(本実施形態では、10フレーム分)の画像のそれぞれについて、指定部101によって指定された画像との関係を表す基礎行列Fを取得する。   The designation unit 101 designates one of a plurality of images constituting a moving image to be corrected for camera shake. The basic matrix acquisition unit 102 designates each of a predetermined number of images (in this embodiment, 10 frames) other than the image designated by the designation unit 101 among the plurality of images constituting the image to be corrected for camera shake. The basic matrix F representing the relationship with the image specified by the unit 101 is acquired.

具体的には、基礎行列取得部102は、オプティカルフロー取得部102aを含み、オプティカルフロー取得部102aによって取得されたオプティカルフローに基づいて、基礎行列Fを取得する。   Specifically, the basic matrix acquisition unit 102 includes an optical flow acquisition unit 102a, and acquires the basic matrix F based on the optical flow acquired by the optical flow acquisition unit 102a.

オプティカルフロー取得部102aは、オプティカルフロー取得処理を実行することにより、画像間の特徴点pの移動ベクトルによって形成される画像間のオプティカルフローと、特徴点pの複数のフレームに亘る移動の軌跡である特徴点軌道pと、を取得する。 The optical flow acquisition unit 102a executes an optical flow acquisition process, thereby performing an optical flow between images formed by a movement vector of the feature point p i between images and a movement of the feature point p i over a plurality of frames. A feature point trajectory p that is a trajectory is acquired.

具体的には、オプティカルフロー取得部102aは、手ぶれ補正対象の動画に含まれる連続する複数のフレームの画像それぞれから互いに対応する特徴点pを抽出する(特徴点pの座標(例えば、同次座標)を取得する)。 Specifically, the optical flow acquisition unit 102a extracts feature points p i corresponding to each other from images of a plurality of consecutive frames included in the moving image to be corrected for camera shake (the coordinates of the feature points p i (for example, the same Next coordinate)).

以下、特徴点をp と表記する。iは特徴点を識別するためのインデックスであり、kは特徴点が含まれている画像がどのフレームの画像かを示すインデックスである。なお、どのフレームの画像であるか特定する必要がない場合は、インデックスkを省略してpと表記する。 Hereinafter, the feature point is expressed as p i k . i is an index for identifying a feature point, and k is an index indicating which frame an image including the feature point is. If it is not necessary to identify whether an image of which frame is denoted as p i to omit the index k.

三次元空間内の(被写体上の)単一の点が、第Eフレームの画像では特徴点p に投影され、第Fフレームの画像では特徴点p に投影されている場合、2つの特徴点p 、p は「互いに対応している」と表現する。 When a single point (on the subject) in the three-dimensional space is projected on the feature point p i E in the image of the E-th frame and is projected on the feature point p i F in the image of the F-th frame, 2 The two feature points p i E and p i F are expressed as “corresponding to each other”.

異なる1対のフレームの画像がそれぞれ含む互いに対応する1対の特徴点pの一方を始点として、他方を終点として有するベクトルを、これらの画像間の特徴点pの移動ベクトルという。特徴点pの移動ベクトルは、一方の画像における特徴点pが他方の画像においてどこへ移動しているかを示す。異なるフレームの画像間のオプティカルフローは、少なくとも1つ以上の特徴点pの、これらの画像間における移動ベクトルによって形成され、特徴点pの移動ベクトルの画像内における分布を示す。 A vector having one of a pair of feature points p i corresponding to each other included in images of different pairs of frames as a start point and the other as an end point is referred to as a movement vector of the feature points p i between these images. Moving vector of the feature point p i indicates which feature point p i in one image is moving anywhere in the other image. The optical flow between images of different frames is formed by movement vectors of at least one or more feature points p i between these images, and indicates the distribution of the movement vectors of the feature points p i in the image.

オプティカルフロー取得部102aは、手ぶれ補正対象の動画に含まれる各フレーム中の互いに対応する特徴点p、すなわち特徴点pの移動ベクトルの始点または終点、の座標を取得することにより、特徴点pの移動ベクトルと、これらの特徴点pの移動ベクトルが形成するオプティカルフローと、を取得する。 The optical flow acquisition unit 102a acquires the coordinates of feature points p i corresponding to each other in each frame included in the moving image subject to camera shake correction, that is, the start point or end point of the movement vector of the feature point p i. obtaining a movement vector of p i, and optical flow motion vectors of these characteristic points p i forms, the.

特徴点軌道pは、特徴点pの複数のフレームに亘る軌跡を示す。オプティカルフロー取得部102aは、オプティカルフロー取得処理を実行することにより、手ぶれ補正対象の動画が含む各フレームの画像から互いに対応する特徴点pを抽出し、抽出した特徴点pを追跡することにより特徴点軌道pを取得する。 Feature point trajectory p indicates a track over a plurality of frames of the feature point p i. The optical flow acquisition unit 102a performs an optical flow acquisition process to extract feature points p i corresponding to each other from images of each frame included in a moving image to be corrected for camera shake, and to track the extracted feature points p i To obtain the feature point trajectory p.

なお、オプティカルフロー取得部102aは、任意の公知技術を用いて複数のフレームの画像から互いに対応する特徴点pを抽出する。例えば、KLT法(KLTトラッキング)を用いることができる。KLT法を用いて特徴点pを抽出する技術は、非特許文献1に開示されているとおり、当該技術分野において周知であるため詳細な説明は省略する。 Note that the optical flow acquisition unit 102a extracts feature points p i corresponding to each other from images of a plurality of frames using any known technique. For example, the KLT method (KLT tracking) can be used. Since the technique for extracting the feature points p i using the KLT method is well known in the technical field as disclosed in Non-Patent Document 1, detailed description thereof is omitted.

オプティカルフロー取得部102aが実行するオプティカルフロー取得処理については、後に図9のフローチャートを参照しながら詳細に説明する。   The optical flow acquisition process executed by the optical flow acquisition unit 102a will be described in detail later with reference to the flowchart of FIG.

オプティカルフロー取得部102aによって取得されたオプティカルフローに基づいて、基礎行列取得部102は、基礎行列Fを取得する。基礎行列Fは、手ぶれ補正前の2つの画像間の幾何的関係(エピポーラ関係)を表す3行3列の行列である。   Based on the optical flow acquired by the optical flow acquisition unit 102a, the basic matrix acquisition unit 102 acquires the basic matrix F. The basic matrix F is a 3 × 3 matrix representing a geometric relationship (epipolar relationship) between two images before camera shake correction.

図3を参照して、エピポーラ幾何の概念を説明する。異なる時刻に撮像された第Qフレームの画像と第Rフレームの画像は、それぞれ、互いに異なる点C1と点C2とに配置された撮像装置1によって撮像された画像と見なすことができる。すなわち、第Qフレームの画像と第Rフレームの画像は、それぞれ、点C1と点C2とを投影中心とする投影面を表す画像と見なすことができる。点C1と点C2との位置の相違は、手ぶれ等の影響により撮像装置1の位置が変動したことに由来する。三次元空間内の単一の点Pは、第Qフレームの画像中では点m1に投射される一方、第Rフレームの画像中では点m2に投影される。すなわち、点m1と点m2は互いに対応する点である。   The concept of epipolar geometry will be described with reference to FIG. The Q-th frame image and the R-th frame image captured at different times can be regarded as images captured by the imaging devices 1 arranged at different points C1 and C2, respectively. That is, the image of the Qth frame and the image of the Rth frame can be regarded as images representing the projection planes having the points C1 and C2 as the projection centers, respectively. The difference in position between the point C1 and the point C2 is derived from the change in the position of the imaging device 1 due to the influence of camera shake or the like. A single point P in the three-dimensional space is projected to the point m1 in the image of the Qth frame, and is projected to the point m2 in the image of the Rth frame. That is, the points m1 and m2 correspond to each other.

三次元空間内の点Pと点C1とを結ぶ直線は、第Qフレームの画像上では点m1に投影される一方、第Rフレームの画像上では、点P、点C1、及び点C2を通る平面(エピポーラ面)と第Rフレームの画像との交線である線L1として投影される。線L1は、第Qフレームの画像中の点m1が第Rフレームの画像に投影するエピポーラ線である。同様に、線L2は、第Rフレームの画像中の点m2が第Qフレームの画像に投影するエピポーラ線である。   A straight line connecting the point P and the point C1 in the three-dimensional space is projected to the point m1 on the Qth frame image, and passes through the point P, the point C1, and the point C2 on the Rth frame image. Projected as a line L1 that is an intersection line between the plane (epipolar plane) and the image of the R-th frame. The line L1 is an epipolar line projected from the point m1 in the Qth frame image onto the Rth frame image. Similarly, the line L2 is an epipolar line projected from the point m2 in the R-th frame image onto the Q-th frame image.

第Qフレームの画像中の任意の点qが第Rフレームの画像に投影するエピポーラ線LQ、Rは、次の式(1)により表される。ここで、FQ,Rは、第Qフレームの画像と第Rフレームの画像との間のエピポーラ関係を表す基礎行列である。FQ,Rは、第Qフレームの画像中の任意の点m1と、点m1に対応する第Rフレームの画像中の点m2と、を用いて次の式(2)で表される。

Figure 2016119580
Figure 2016119580
Epipolar lines LQ and R projected from an arbitrary point q in the image of the Qth frame to the image of the Rth frame are expressed by the following equation (1). Here, F Q, R is a basic matrix representing an epipolar relationship between the image of the Qth frame and the image of the Rth frame. F Q, R is expressed by the following equation (2) using an arbitrary point m1 in the image of the Qth frame and a point m2 in the image of the Rth frame corresponding to the point m1.
Figure 2016119580
Figure 2016119580

式(2)から明らかなように、基礎行列Fは、f11からf32までの8個の未知数を有するため、少なくとも8組の対応する点m1、m2に基づいて求めることができる。すなわち、8箇所の対応点が与えられれば基礎行列Fを算出することができる。 As is apparent from the equation (2), the basic matrix F has eight unknowns from f 11 to f 32, and therefore can be obtained based on at least eight sets of corresponding points m 1 and m 2. That is, if eight corresponding points are given, the basic matrix F can be calculated.

基礎行列取得部102は、指定部101によって指定された画像と指定部101によって指定された画像の直前10フレーム分の画像とからそれぞれオプティカルフロー取得部102aが抽出した8組の互いに対応する特徴点pの座標に基づき、標準的な8ポイントアルゴリズムと誤差を最小化するためのRANSAC(RANdom SAmple Consensus)法とを用いて基礎行列Fを取得する。8ポイントアルゴリズムとRANSAC法を用いて基礎行列Fを取得する方法は、非特許文献1に開示されているとおり、当該技術分野において周知であるため詳細な説明は省略する。 The basic matrix acquisition unit 102 includes eight sets of feature points corresponding to each other extracted by the optical flow acquisition unit 102a from the image specified by the specification unit 101 and the image for the last 10 frames of the image specified by the specification unit 101. Based on the coordinates of p i , the basic matrix F is obtained using a standard 8-point algorithm and a RANSAC (RANdom Sample Consensus) method for minimizing errors. As disclosed in Non-Patent Document 1, the method for obtaining the basic matrix F using the 8-point algorithm and the RANSAC method is well known in the technical field, and thus detailed description thereof is omitted.

基礎行列取得部102が実行する基礎行列取得処理については、後に図11のフローチャートを参照しながら詳細に説明する。   The basic matrix acquisition process executed by the basic matrix acquisition unit 102 will be described in detail later with reference to the flowchart of FIG.

選別部103は、基礎行列取得部102によって取得された基礎行列に基づいて、指定部101によって指定された画像より前の所定数(本実施形態では、10フレーム分)の画像の中から、指定された画像にエピポーラ投影するための画像を選別する。具体的には、選別部103は、画像の選別のために、評価部108による基礎行列の類似度の評価結果を参酌する。   Based on the basic matrix acquired by the basic matrix acquisition unit 102, the selection unit 103 specifies a predetermined number of images (10 frames in the present embodiment) before the image specified by the specifying unit 101. An image for epipolar projection is selected on the obtained image. Specifically, the selection unit 103 refers to the evaluation result of the similarity of the basic matrix by the evaluation unit 108 for image selection.

基礎行列の類似度とは、異なる2つの基礎行列が類似しているか否かの度合いを示す指標である。例えば、第Qフレームの画像と第Rフレームの画像との間のエピポーラ関係を表す基礎行列FQ,Rと、第Qフレームの画像と第Sフレームの画像との間のエピポーラ関係を表す基礎行列FQ,Sと、が類似している場合、第Rフレームの画像と第Sフレームの画像とが類似していることを意味する。ここで、異なる2フレームの画像が互いに類似している場合、これら2つの画像中の仮想特徴点vの座標はほぼ同じである。そのため、これら2つの画像中の仮想特徴点vがそれぞれ投影する2本のエピポーラ線はほぼ平行であり、これらのエピポーラ線が与える交点(エピポーラ交点)は信頼性に欠ける。 The similarity between basic matrices is an index indicating the degree of whether two different basic matrices are similar. For example, a basic matrix F Q, R representing the epipolar relationship between the Q-th frame image and the R-th frame image, and a basic matrix representing the epipolar relationship between the Q-th frame image and the S-th frame image. When FQ and S are similar, it means that the image of the Rth frame and the image of the Sth frame are similar. Here, if the image of two different frames are similar to each other, the coordinates of the virtual feature point v i in the two images are similar. Therefore, the two epipolar lines projected by the virtual feature points v i in these two images are almost parallel, and the intersection (epipolar intersection) given by these epipolar lines is not reliable.

そこで、選別部103は、類似している複数の基礎行列を発見した場合、そのうち何れか1つの基礎行列のみを、エピポーラ投影に用いる基礎行列として選別する。すなわち、選別部103は、評価部による評価の結果、所定数の画像の中に互いに類似している2以上の画像がある場合、該2以上の画像のうちのいずれか1つ以外の画像を、指定部101によって指定された画像にエピポーラ投影するための画像から除外する。これにより、類似度が高い複数の画像が含む仮想特徴点vからそれぞれエピポーラ線が投影され、信頼性に欠けるエピポーラ交点が生成されることを防止することができる。 Therefore, when a plurality of similar basic matrices are found, the selection unit 103 selects only one of them as a basic matrix used for epipolar projection. That is, as a result of the evaluation by the evaluation unit, when there are two or more images that are similar to each other in the predetermined number of images, the selection unit 103 selects an image other than any one of the two or more images. And excluded from the image for epipolar projection on the image specified by the specifying unit 101. Thereby, it is possible to prevent epipolar lines from being projected from virtual feature points v i included in a plurality of images having a high degree of similarity, and to prevent generation of epipolar intersections lacking in reliability.

選別部103が実行する選別処理については、後に図12のフローチャートを参照しながら詳細に説明する。   The sorting process executed by the sorting unit 103 will be described in detail later with reference to the flowchart of FIG.

評価部108は、指定部101によって指定された画像より前の所定数の画像のそれぞれについて基礎行列取得部102によって取得された基礎行列の類似度を評価する。具体的には、評価部108は、異なる2つの基礎行列の間において、一方の基礎行列に含まれる各要素と、他方の基礎行列に含まれる各要素と、を比較することにより、この2つの基礎行列の類似度を評価する。類似度は、2つの基礎行列に含まれる要素同士を比較した結果を様々に用いて、取得することができる。   The evaluation unit 108 evaluates the similarity of the basic matrix acquired by the basic matrix acquisition unit 102 for each of a predetermined number of images prior to the image specified by the specifying unit 101. Specifically, the evaluation unit 108 compares the two elements in one basic matrix with each element included in the other basic matrix between two different basic matrices, thereby comparing the two basic matrices. Evaluate the similarity of the base matrix. The similarity can be obtained by using various results obtained by comparing elements included in the two basic matrices.

例えば、評価部108は、異なる2つの基礎行列の間において、一方の基礎行列を正規化した行列に含まれる各要素と、他方の基礎行列を正規化した行列における対応する要素と、の差分をとった値がいずれも閾値以下である場合に、この2つの基礎行列が類似していると評価する。   For example, the evaluation unit 108 calculates a difference between each element included in a matrix obtained by normalizing one basic matrix and a corresponding element in a matrix obtained by normalizing the other basic matrix between two different basic matrices. When both of the values taken are equal to or less than the threshold value, it is evaluated that the two basic matrices are similar.

すなわち、基礎行列は3行3列の行列であって9つの要素を有するため、評価部108は、比較対象の一方の基礎行列に含まれる9つの要素と他方の基礎行列に含まれる9つの要素との同じ位置にある要素同士での差分をとる。そして、得られた9つの差分値を、それぞれ予め定められた9つの閾値と比較する。これは、比較対象の一方の基礎行列と他方の基礎行列との差分をとった3行3列の差分行列を計算し、得られた差分行列を、予め定められた9つの閾値を要素として有する3行3列の閾行列と比較することと同じである。9つの差分値と比較する9つの閾値は、全て同じ値であってもよいし、互いに異なってもよい。比較の結果、9つの差分値全てが閾値以下である場合に、評価部108は、この2つの基礎行列が類似していると評価する。   That is, since the base matrix is a matrix of 3 rows and 3 columns and has nine elements, the evaluation unit 108 includes nine elements included in one base matrix to be compared and nine elements included in the other base matrix. The difference between elements at the same position as is taken. Then, the obtained nine difference values are compared with nine predetermined threshold values. This calculates a difference matrix of 3 rows and 3 columns taking the difference between one base matrix to be compared and the other base matrix, and the obtained difference matrix has nine predetermined threshold values as elements. This is the same as comparing with a 3 × 3 threshold matrix. The nine threshold values to be compared with the nine difference values may all be the same value or may be different from each other. As a result of the comparison, when all nine difference values are equal to or less than the threshold value, the evaluation unit 108 evaluates that the two basic matrices are similar.

或いは、評価部108は、異なる2つの基礎行列の間において、一方の基礎行列を正規化した行列に含まれる各要素と、他方の基礎行列を正規化した行列における対応する要素と、の差分の2乗和をとった値が閾値以下である場合に、この2つの基礎行列が類似していると評価してもよい。   Alternatively, the evaluation unit 108 calculates a difference between each element included in a matrix obtained by normalizing one basic matrix and a corresponding element in a matrix obtained by normalizing the other basic matrix between two different basic matrices. When the value obtained by taking the square sum is equal to or less than the threshold value, it may be evaluated that the two basic matrices are similar.

この場合、評価部108は、比較対象の一方の基礎行列に含まれる9つの要素と他方の基礎行列に含まれる9つの要素との同じ位置にある要素同士での差分をとり、得られた9つの差分値のそれぞれを2乗して加算する。そして、得られた加算値を予め定められた1つの閾値と比較して、加算値が閾値以下である場合に、評価部108は、この2つの基礎行列が類似していると評価する。   In this case, the evaluation unit 108 obtains the difference between the elements at the same position of the nine elements included in one base matrix to be compared and the nine elements included in the other base matrix and obtains the obtained 9 Each of the two difference values is squared and added. Then, the obtained addition value is compared with a predetermined threshold value, and when the addition value is equal to or less than the threshold value, the evaluation unit 108 evaluates that the two basic matrices are similar.

このように、評価部108は、指定部101によって指定された画像より前の所定数の画像のそれぞれについて取得された所定数の基礎行列の中に、互いに類似している複数の基礎行列があるか否かを評価する。そして、選別部103は、評価部108による評価結果に基づいて、所定数の画像の中から指定された画像にエピポーラ投影するための画像を選別する。   As described above, the evaluation unit 108 includes a plurality of basic matrices similar to each other among the predetermined number of basic matrices acquired for each of the predetermined number of images prior to the image specified by the specifying unit 101. Evaluate whether or not. Based on the evaluation result by the evaluation unit 108, the selection unit 103 selects an image for epipolar projection from a predetermined number of images to a designated image.

仮想特徴点生成部104は、仮想特徴点生成処理を実行し、基礎行列取得部102によって取得された基礎行列のうち、選別部103によって選別された画像について取得された基礎行列に基づいて、選別部103によって選別された画像内の互いに対応する特徴点p又は仮想特徴点vを指定部101により指定された画像にエピポーラ投影することにより、指定された画像内における仮想特徴点vを生成する。 The virtual feature point generation unit 104 executes virtual feature point generation processing, and selects based on the basic matrix acquired for the images selected by the selection unit 103 among the basic matrices acquired by the basic matrix acquisition unit 102 by epipolar projected to the designated image by specifying unit 101 the feature point p i or virtual feature points v i corresponding to each other in the image that has been selected by section 103, a virtual feature point v i within the specified image Generate.

具体的には、仮想特徴点生成部104は、画像間のエピポーラ関係を表す基礎行列Fに基づいて、対応点を生成するエピポーラ転送という方法により仮想特徴点vを生成する。 Specifically, the virtual feature point generation unit 104 generates virtual feature points v i by a method called epipolar transfer that generates corresponding points based on the basic matrix F that represents the epipolar relationship between images.

図4を参照して、エピポーラ転送の概念を説明する。第Xフレームの画像と第Yフレームの画像とにおける互いに対応する点m3、m4がそれぞれ第Zフレームの画像に投影するエピポーラ線L3、L4は、第Zフレームの画像中の、点m3及び点m4に対応する点m5で交わる。エピポーラ線L3、L4及びその交点である点m5は、画像間のエピポーラ関係を表す基礎行列FX、Z、FY、Zに基づいて算出できる。すなわち、第Zフレーム中の対応点である点m5を、画像間のエピポーラ関係を表す基礎行列Fに基づいて生成できる。 The concept of epipolar transfer will be described with reference to FIG. The epipolar lines L3 and L4 that the corresponding points m3 and m4 in the image of the Xth frame and the image of the Yth frame respectively project on the image of the Zth frame are the points m3 and m4 in the image of the Zth frame. At the point m5 corresponding to. The epipolar lines L3 and L4 and the intersection m5 can be calculated based on the basic matrices F X, Z , F Y and Z representing the epipolar relationship between images. That is, the point m5 which is a corresponding point in the Zth frame can be generated based on the basic matrix F representing the epipolar relationship between images.

仮想特徴点生成部104は、このエピポーラ転送を用いて、指定された画像内における仮想特徴点vを生成する。 Virtual feature point generation unit 104 uses the epipolar transfer, it generates the virtual feature point v i at the designated within an image.

図4に示すように、少なくとも2本のエピポーラ線があればその交点を仮想特徴点vとして取得できるものの、実際にはノイズやトラッキングエラー、モデリングエラー等の影響により交点の信頼性は損なわれている。そこで、仮想特徴点生成部104は、最大10本のエピポーラ線のうち組み合わせ可能な異なる2本のエピポーラ線の交点(最大で10=45個の交点)を求め、求めた交点の座標の平均を求めることにより、より正確な特徴点vを取得する。 As shown in FIG. 4, although the ability to retrieve the intersection if at least two epipolar lines as a virtual feature point v i, actually noise and tracking error, the intersection of the reliability due to the influence of such modeling error impaired ing. Therefore, the virtual feature point generation unit 104 obtains intersections of two different epipolar lines that can be combined among a maximum of ten epipolar lines (up to 10 C 2 = 45 intersections), and calculates the coordinates of the obtained intersection points. By obtaining the average, a more accurate feature point v i is obtained.

具体的には、図5に示すように、仮想特徴点生成部104は、第tフレームの画像に、この画像の直前に撮像された連続する10フレーム分の画像(第(t−10)フレームから第(t−1)フレームまでの過去10フレーム)に含まれる仮想特徴点v t−1〜v t−10がそれぞれ投影する10本のエピポーラ線を、基礎行列取得部102によって取得された基礎行列Ft、t−1〜Ft、t−10に基づいて求める。そして、求めた10本のエピポーラ線の交点の平均を、第tフレームの画像中の仮想特徴点v として取得する。 Specifically, as illustrated in FIG. 5, the virtual feature point generation unit 104 adds an image of ten consecutive frames ((t−10) frames captured immediately before this image to the image of the t th frame. the first (t-1) virtual feature points included in the past 10 frames) to the frame v i t-1 ~v i 10 pieces of epipolar lines t-10 is projected respectively, it is acquired by the fundamental matrix acquisition unit 102 from Obtained based on the basic matrix F t, t-1 to F t, t-10 . Then, the average of the obtained intersections of the ten epipolar lines is acquired as a virtual feature point v i t in the image of the t-th frame.

仮想特徴点生成部104が実行する仮想特徴点生成処理については、後に図14のフローチャートを参照しながら詳細に説明する。   The virtual feature point generation processing executed by the virtual feature point generation unit 104 will be described in detail later with reference to the flowchart of FIG.

仮想特徴点軌道構築部105は、手ぶれ補正対象の動画を構成する複数の画像の中から指定部101が指定する画像を変えて、指定部101、基礎行列取得部102、選別部103、及び仮想特徴点生成部104の処理を繰り返すことにより、仮想特徴点軌道vを構築する。   The virtual feature point trajectory construction unit 105 changes the image designated by the designation unit 101 from among a plurality of images constituting the image to be corrected for camera shake, and designates the designation unit 101, the basic matrix acquisition unit 102, the selection unit 103, and the virtual By repeating the process of the feature point generation unit 104, a virtual feature point trajectory v is constructed.

仮想特徴点軌道vは、仮想特徴点vの複数のフレームに亘る軌跡である。仮想特徴点軌道構築部105は、仮想特徴点生成部104に、手ぶれ補正対象の動画を構成する各フレームの画像において仮想特徴点vを生成させることにより仮想特徴点vを時間的に追跡し(複数のフレームに亘って追跡し)、仮想特徴点軌道vを構築する。 Virtual feature point trajectory v is a trajectory over a plurality of frames of the virtual feature point v i. Virtual feature point trajectory construction unit 105, a virtual feature point generation unit 104, time tracking virtual feature point v i by generating a virtual feature point v i in the image of each frame constituting the video image stabilization target (Tracking over a plurality of frames) to construct a virtual feature point trajectory v.

仮想特徴点軌道vは、図6に示すように、手ぶれ補正前の(手ぶれの影響を受けた)撮像装置1の動きを表している。   As shown in FIG. 6, the virtual feature point trajectory v represents the movement of the imaging device 1 before the camera shake correction (affected by the camera shake).

特徴点軌道pが画像からKLT法を用いて抽出された特徴点pによって構成されるのに対し、仮想特徴点軌道vはエピポーラ転送により生成された仮想特徴点vによって構成される。 While the feature point trajectory p is constituted by the feature point p i extracted with KLT method from the image, the virtual feature point trajectory v is constituted by the virtual feature point v i generated by the epipolar transfer.

三次元空間内の被写体の一部分が、あるフレームの画像において物体の影に隠れてしまったり、撮像装置1の視野から外れてしまったりした場合、この部分に含まれる点の、当該フレームの画像における投影点である特徴点pをKLT法により抽出することはできない。しかし、このフレームの画像内の仮想特徴点vは、過去のフレームの画像内の対応する仮想特徴点vをエピポーラ転送することにより生成できる。また、KLT法ではトラッキングエラーとなり特徴点pが抽出できない場合でも、エピポーラ転送によれば仮想特徴点vを生成することができる。 When a part of the subject in the three-dimensional space is hidden in the shadow of the object in the image of a certain frame or deviated from the field of view of the imaging device 1, the point included in this part of the image of the frame The feature point p i that is a projection point cannot be extracted by the KLT method. However, the virtual feature point v i in the image of this frame can be generated by epipolar transfer of the corresponding virtual feature point v i in the image of the past frame. Further, even when the KLT method results in a tracking error and the feature point p i cannot be extracted, the virtual feature point v i can be generated by epipolar transfer.

このため、仮想特徴点軌道vは、特徴点軌道pよりも長く(多くのフレームにわたって)連続している。   For this reason, the virtual feature point trajectory v is longer (over many frames) than the feature point trajectory p.

仮想特徴点軌道構築部105が実行する仮想特徴点軌道vの構築処理については、後に図8のフローチャートを参照しながら詳細に説明する。   The construction process of the virtual feature point trajectory v executed by the virtual feature point trajectory construction unit 105 will be described in detail later with reference to the flowchart of FIG.

平滑化部106は、仮想特徴点軌道構築部105によって構築された仮想特徴点軌道vを時間方向に平滑化することにより、平滑化された仮想特徴点軌道〜vを取得する。   The smoothing unit 106 acquires the smoothed virtual feature point trajectory to v by smoothing the virtual feature point trajectory v constructed by the virtual feature point trajectory construction unit 105 in the time direction.

具体的には、平滑化部106は、下記の式(3)を用い、仮想特徴点軌道vを構成する仮想特徴点vそれぞれの座標とガウシアンカーネルとの畳み込みを作ることにより、平滑化された仮想特徴点軌道〜vを構成する手ぶれ補正後の仮想特徴点〜v の座標を取得する。ここで、gは下記の式(4)で表されるガウシアンカーネルである。

Figure 2016119580
Figure 2016119580
Specifically, the smoothing unit 106, using Equation (3) below, by making the convolution between the virtual feature point v i respective coordinates and Gaussian kernel to configure the virtual feature point trajectory v, is smoothed to obtain the coordinates of the virtual feature point to v i t after image stabilization composing the virtual feature point trajectory to v were. Here, g is a Gaussian kernel represented by the following formula (4).
Figure 2016119580
Figure 2016119580

本実施形態では、σ=50のガウシアンカーネルを用いて仮想特徴点軌道vを平滑化する。   In this embodiment, the virtual feature point trajectory v is smoothed using a Gaussian kernel with σ = 50.

仮想特徴点軌道vが手ぶれ補正前の(手ぶれの影響を受けた)撮像装置1の動きを表していたのに対し、平滑化された仮想特徴点軌道〜vは、図6に示すように、手ぶれ補正後の(手ぶれの影響を除去した)撮像装置1の動きを表す。   While the virtual feature point trajectory v represents the movement of the imaging apparatus 1 before the camera shake correction (affected by the camera shake), the smoothed virtual feature point trajectory ~ v is as shown in FIG. It represents the movement of the imaging apparatus 1 after camera shake correction (the effect of camera shake has been removed).

具体的には図6に示すように、手ぶれ補正後の動画を構成する各フレームの画像は、平滑化された仮想特徴点軌道〜vによって定義される。すなわち、手ぶれ補正前の動画を構成する各フレームの画像と手ぶれ補正後の動画を構成する各フレームの画像との間の関係は、仮想特徴点軌道vと平滑化された仮想特徴点軌道〜vとの間の関係によって定義される。   Specifically, as shown in FIG. 6, the image of each frame constituting the moving image after camera shake correction is defined by the smoothed virtual feature point trajectory ~ v. That is, the relationship between the image of each frame composing the moving image before camera shake correction and the image of each frame composing the moving image after camera shake correction is as follows: virtual feature point trajectory v and smoothed virtual feature point trajectory ~ v Defined by the relationship between

補正部107は、仮想特徴点軌道構築部105によって構築された仮想特徴点軌道vと、平滑化部106によって平滑化された仮想特徴点軌道〜vと、の間の関係に基づいて、手ぶれ補正対象の動画を構成する複数の画像それぞれを補正する。   The correcting unit 107 corrects camera shake based on the relationship between the virtual feature point trajectory v constructed by the virtual feature point trajectory constructing unit 105 and the virtual feature point trajectory to v smoothed by the smoothing unit 106. Each of a plurality of images constituting the target moving image is corrected.

具体的には、補正部107は、手ぶれ補正前の動画が含む各フレームの画像に対し、手ぶれ補正前の画像が含む特徴点pを手ぶれ補正後の画像が含む手ぶれ補正後の特徴点〜pへ移すような射影変換を施すことにより、手ぶれ補正を実行する。 Specifically, the correction unit 107, image stabilization on the image of each frame before the video contains feature points after image stabilization comprising the image after image stabilization feature point p i where camera shake correction previous image contains ~ by performing projective transformation such as move to p i, it executes image stabilization.

例えば、補正部107は、手ぶれ補正前の動画を構成する各フレームの画像に対し、各フレームの画像における任意の点(x、y)を次の式(5)を満たす点(x’、y’)へ移す射影変換を施すことにより、手ぶれ補正後の画像を取得する。ここで、式(5)中の射影変換パラメータa〜hは、下記の式(6)を用いて求めることができる。

Figure 2016119580
Figure 2016119580
For example, the correction unit 107 replaces an arbitrary point (x, y) in the image of each frame with a point (x ′, y) that satisfies the following expression (5) with respect to the image of each frame constituting the moving image before camera shake correction. The image after camera shake correction is acquired by performing the projective transformation to '). Here, the projective transformation parameters a to h in the equation (5) can be obtained using the following equation (6).
Figure 2016119580
Figure 2016119580

式(6)から明らかなように、射影変換パラメータa〜hは、少なくとも4組の対応点(x1,y1)と(x1’、y1’)〜(x4,y4)と(x4’とy4’)が与えられれば求めることができる。補正部107は、手ぶれ補正前の各フレームの画像に含まれる特徴点pと、これに対応する手ぶれ補正後のフレームの画像に含まれる手ぶれ補正後の特徴点〜pと、を式(6)に代入することにより、射影変換パラメータa〜hを取得し、射影変換を行う。 As is clear from the equation (6), the projective transformation parameters a to h include at least four pairs of corresponding points (x1, y1), (x1 ′, y1 ′) to (x4, y4), (x4 ′ and y4 ′). ) Can be obtained. Correcting unit 107, the feature point p i included in the image of each frame before camera shake compensation, a feature point ~p i after image stabilization included in the image frame after image stabilization corresponding thereto, of formula ( By substituting in 6), the projective transformation parameters a to h are acquired and the projective transformation is performed.

手ぶれ補正後の画像が手ぶれ補正後の撮像装置1の動きを表す平滑化された仮想特徴点軌道〜vによって定義されるため、手ぶれ補正後の特徴点〜pは、仮想特徴点軌道vと平滑化された仮想特徴点軌道〜vとの間の関係に基づいて取得することができる。 Since the image after camera shake correction is defined by the virtual feature point trajectory ~v smoothed representing the motion of the imaging apparatus 1 after image stabilization feature point ~p i after camera shake correction, a virtual feature point trajectory v Based on the relationship between the smoothed virtual feature point trajectory ~ v.

具体的には、図6に示すように、手ぶれ補正前の画像と手ぶれ補正後の画像との間のエピポーラ関係を表す基礎行列〜Fが、仮想特徴点軌道vと平滑化された仮想特徴点軌道〜vとの間の関係に基づいて取得される。そして、図7に示すように、手ぶれ補正後の各フレームの画像に、前後5フレーム分の手ぶれ補正前の画像に含まれる特徴点pを、取得された基礎行列〜Fに基づいてエピポーラ転送することにより、手ぶれ補正後の特徴点〜pが生成される。 Specifically, as shown in FIG. 6, the basic matrix to F representing the epipolar relationship between the image before camera shake correction and the image after camera shake correction are virtual feature points smoothed with the virtual feature point trajectory v. Acquired based on the relationship between the trajectories ~ v. Then, as shown in FIG. 7, the image of each frame after camera shake compensation, a feature point p i included before and after 5 frames of image stabilization previous image, on the basis of the obtained fundamental matrix ~F epipolar transfer by feature points ~p i after camera shake correction is generated.

このように、補正部107は、仮想特徴点軌道vと平滑化された仮想特徴点軌道〜vとの間の関係に基づいて求めた射影変換パラメータを用いて射影変換を行うことにより、手ぶれ補正対象の動画を構成する各フレームの画像に手ぶれ補正を施す。上述したとおり、エピポーラ転送を用いて構築される仮想特徴点軌道vは長く(多くのフレームにわたって)連続しているため、大規模なフィルタを適用し(σ=50の大きなガウシアンカーネルを用いて時間方向に平滑化し)、手ぶれ補正後の画像を定義することができる。   As described above, the correction unit 107 performs the camera shake correction by performing the projective transformation using the projective transformation parameter obtained based on the relationship between the virtual feature point trajectory v and the smoothed virtual feature point trajectory to v. Camera shake correction is applied to each frame image constituting the target moving image. As described above, since the virtual feature point trajectory v constructed using epipolar transfer is long and continuous (over many frames), a large-scale filter is applied (time using a large Gaussian kernel with σ = 50). Smoothed in the direction), and an image after camera shake correction can be defined.

図1に戻って、ユーザインタフェース部30は、表示部31と、操作部32と、外部インタフェース33と、を含む。   Returning to FIG. 1, the user interface unit 30 includes a display unit 31, an operation unit 32, and an external interface 33.

表示部31は、例えばLCD(Liquid Crystal Displey)やCRT(Cathode Ray Tube)、有機EL(Electro Luminescence)ディスプレイ等を備え、出力部22から供給されたRGB信号に基づいて、撮像部10により生成され、外部記憶部23により記憶されている手ぶれ補正対象の動画、画像処理装置100が手ぶれ補正対象の動画に手ぶれ補正処理を施すことにより生成した動画等を含む種々の動画像を表示する。   The display unit 31 includes, for example, an LCD (Liquid Crystal Display), a CRT (Cathode Ray Tube), an organic EL (Electro Luminescence) display, and the like. The display unit 31 is generated by the imaging unit 10 based on the RGB signal supplied from the output unit 22. Various moving images including a moving image to be subjected to camera shake correction stored in the external storage unit 23 and a moving image generated by the image processing apparatus 100 performing camera shake correction processing on the moving image to be subjected to camera shake correction are displayed.

操作部32は、ユーザからの操作指示を受け付ける。操作部32は、撮像装置1の電源スイッチ、シャッタボタン、撮像装置1の種々の機能を選択するためのボタン等、各種の操作ボタンを備える。操作部32は、ユーザから操作指示を受け付けると、受け付けた指示情報を撮像部10やデータ処理部20のCPU24等に供給する。   The operation unit 32 receives an operation instruction from the user. The operation unit 32 includes various operation buttons such as a power switch of the image pickup apparatus 1, a shutter button, and buttons for selecting various functions of the image pickup apparatus 1. When receiving an operation instruction from the user, the operation unit 32 supplies the received instruction information to the imaging unit 10, the CPU 24 of the data processing unit 20, and the like.

なお、表示部31と操作部32とは、互いに重畳して配置されたいわゆるタッチパネルによって構成されるものであってもよい。   In addition, the display part 31 and the operation part 32 may be comprised by what is called a touch panel arrange | positioned mutually superimposed.

外部インタフェース33は、撮像装置1の外部の機器とデータをやり取りするためのインタフェースである。例えば、外部インタフェース33は、画像処理装置100が手ぶれ補正対象の動画に手ぶれ補正処理を施すことによって生成した動画を、USB(Universal Serial Bus)規格のデータに変換して、USBケーブルを介して外部の機器との間でデータを送受信する。   The external interface 33 is an interface for exchanging data with an external device of the imaging apparatus 1. For example, the external interface 33 converts a moving image generated by the image processing apparatus 100 performing a camera shake correction process on a moving image to be subjected to image stabilization to USB (Universal Serial Bus) standard data, and externally transmits the data via a USB cable. Send data to and receive data from other devices.

以下、撮像装置1及び画像処理装置100が動画に手ぶれ補正を施す動作の詳細を、図8〜図15を参照しながら説明する。   Hereinafter, details of the operation of the image capturing apparatus 1 and the image processing apparatus 100 for performing camera shake correction on a moving image will be described with reference to FIGS. 8 to 15.

撮像装置1が備える撮像部10は、予め、被写体を撮像することにより、手ぶれ補正対象の動画を生成している。当該動画は、時間的に連続して撮像された複数フレームの画像を含んでいる。生成された動画は、外部記憶部23によって記憶される。   The imaging unit 10 included in the imaging apparatus 1 generates a moving image to be subjected to camera shake correction by imaging a subject in advance. The moving image includes a plurality of frames of images captured continuously in time. The generated moving image is stored in the external storage unit 23.

ユーザは、動画の手ぶれを補正することを所望する場合、操作部32を操作することにより、手ぶれ補正対象の動画のデータを主記憶部21に展開する。そして、撮像装置1が備える複数の動作モードの1つである「手ぶれ補正モード」を選択する。   When the user desires to correct the camera shake of the moving image, the user operates the operation unit 32 to develop the moving image data to be corrected in the main storage unit 21. Then, the “camera shake correction mode” which is one of a plurality of operation modes provided in the imaging apparatus 1 is selected.

操作部32が、ユーザによる「手ぶれ補正モード」を選択する操作を受け付けると、CPU24は、特徴点抽出プログラムや画像処理プログラムを含む、図8のフローチャートに示す手ぶれ補正処理を実行するためのプログラムを外部記憶部23から読み出し、主記憶部21に展開する。   When the operation unit 32 receives an operation for selecting the “camera shake correction mode” by the user, the CPU 24 executes a program for executing the camera shake correction process shown in the flowchart of FIG. 8, including a feature point extraction program and an image processing program. Read from the external storage unit 23 and expand in the main storage unit 21.

このような状態において、ユーザが、操作部32を操作して手ぶれ補正の開始を指示すると、画像処理装置100が、図8のフローチャートに示す手ぶれ補正処理を開始する。   In such a state, when the user operates the operation unit 32 to instruct the start of camera shake correction, the image processing apparatus 100 starts the camera shake correction process shown in the flowchart of FIG.

手ぶれ補正処理を開始すると、まず、指定部101が、手ぶれ補正開始フレームを指定する(ステップS1)。手ぶれ補正開始フレームは、手ぶれ補正対象の動画に含まれる複数のフレームのうち最初の(撮像時刻が最も古い)フレームである。以下、指定部101により指定されたフレームを、第tフレームと表記する。   When the camera shake correction process is started, the designation unit 101 first designates a camera shake correction start frame (step S1). The camera shake correction start frame is the first frame (having the oldest imaging time) among a plurality of frames included in a moving image to be subjected to camera shake correction. Hereinafter, the frame designated by the designation unit 101 is referred to as a t-th frame.

オプティカルフロー取得部102aは、オプティカルフロー取得処理を実行する(ステップS2)。これにより、オプティカルフロー取得部102aは、第tフレームより以前の10フレーム(第(t−1)フレーム〜第(t−10)フレーム)分の画像それぞれから互いに対応する特徴点pを抽出する。そして、画像間の特徴点pの移動ベクトルによって形成される画像間のオプティカルフローを取得すると共に、特徴点軌道pを取得する。 The optical flow acquisition unit 102a executes an optical flow acquisition process (step S2). As a result, the optical flow acquisition unit 102a extracts feature points p i corresponding to each other from images for 10 frames (the (t−1) th frame to the (t−10) th frame) before the tth frame. . Then, obtains the optical flow between images formed by the movement vector of the feature point p i between images, it obtains the feature point trajectory p.

以下、ステップS2のオプティカルフロー取得処理の詳細を、図9のフローチャートを参照しながら説明する。   Details of the optical flow acquisition process in step S2 will be described below with reference to the flowchart of FIG.

ステップS2のオプティカルフロー取得処理を開始すると、オプティカルフロー取得部102aは、まず、図8のフローチャートのステップS1において指定部101により指定されたフレーム(第tフレーム)を第Aフレームとして設定し(ステップS201)、第(t−10)フレーム(第tフレームの10フレーム前のフレーム)を第Bフレームとして設定する(ステップS202)。   When the optical flow acquisition process of step S2 is started, the optical flow acquisition unit 102a first sets the frame (tth frame) specified by the specification unit 101 in step S1 of the flowchart of FIG. S201), the (t-10) th frame (the frame 10 frames before the tth frame) is set as the Bth frame (step S202).

次に、オプティカルフロー取得部102aは、第Aフレームの画像と第Bフレームの画像との間のオプティカルフローが、以前に実行されたオプティカルフロー取得処理によって取得済みであるか否かを判別する(ステップS203)。   Next, the optical flow acquisition unit 102a determines whether or not the optical flow between the image of the Ath frame and the image of the Bth frame has been acquired by the previously executed optical flow acquisition process ( Step S203).

取得済みであると判別すると(ステップS203;YES)、処理はステップS208へ移る。これにより、既に取得したオプティカルフローを重複して取得することを防止できる。   If it is determined that it has been acquired (step S203; YES), the process proceeds to step S208. Thereby, it is possible to prevent the already acquired optical flows from being acquired in duplicate.

オプティカルフローが未取得であると判別すると(ステップS203;NO)、オプティカルフロー取得部102aは、第Aフレームの画像から、KLT法を用いて特徴点pを抽出する(ステップS204)。 When optical flows is determined to be in non-acquired (step S203; NO), the optical flow obtaining unit 102a, the image of the A-frame, extracts feature points p i using KLT method (step S204).

そして、オプティカルフロー取得部102aは、第Bフレームの画像から、ステップS204で第Aフレームの画像から抽出した各特徴点pに対応する特徴点pを、KLT法を用いて抽出する(ステップS205)。 Then, the optical flow acquisition unit 102a extracts feature points p i corresponding to the feature points p i extracted from the image of the A frame in step S204 from the image of the B frame using the KLT method (step S204). S205).

ステップS204及びステップS205で互いに対応する特徴点pを抽出すると、オプティカルフロー取得部102aは、抽出した特徴点p間のベクトル(特徴点pの移動ベクトル)を取得することにより、これらの移動ベクトルによって形成される、第Aフレームの画像と第Bフレームの画像との間のオプティカルフローを取得する(ステップS206)。また、オプティカルフロー取得部102aは、ステップS204及びステップS205で抽出した特徴点pによって構成される特徴点軌道pを作成する(ステップS207)。 When the feature points p i corresponding to each other are extracted in step S204 and step S205, the optical flow acquisition unit 102a acquires these vectors between the extracted feature points p i (movement vectors of the feature points p i ), thereby An optical flow between the image of the Ath frame and the image of the Bth frame formed by the movement vector is acquired (step S206). Also, the optical flow obtaining unit 102a creates a feature point trajectory p constituted by the feature point p i extracted in step S204 and step S205 (step S207).

オプティカルフローと特徴点軌道pとを取得した後、オプティカルフロー取得部102aは、値Bを1だけインクリメントする(ステップS208)。すなわち、オプティカルフロー取得部102aは、ステップS203〜S207の処理対象となる第Bフレームを、次の(次に撮像時刻が新しい)フレームに移す。例えば、直前に実行したステップS203〜S207の処理において、第(t−10)フレームが第Bフレームとして設定されていた場合、ステップS208において、第(t−10)フレームの次のフレームである第(t−9)フレームが、新たに第Bフレームとして設定される。   After acquiring the optical flow and the feature point trajectory p, the optical flow acquisition unit 102a increments the value B by 1 (step S208). That is, the optical flow acquisition unit 102a moves the B-th frame to be processed in steps S203 to S207 to the next (next imaging time is the newest) frame. For example, if the (t-10) th frame is set as the Bth frame in the processing of steps S203 to S207 executed immediately before, the next frame after the (t-10) frame is set in step S208. (T-9) A frame is newly set as the Bth frame.

値Bをインクリメントした後、オプティカルフロー取得部102aは、インクリメントされた後の値Bが値Aに一致するか否か(第Bフレームと第Aフレームとが同一であるか否か)を判別する(ステップS209)。   After incrementing the value B, the optical flow acquisition unit 102a determines whether the incremented value B matches the value A (whether the Bth frame and the Ath frame are the same). (Step S209).

インクリメント後の値Bが値Aに一致しない(第Bフレームと第Aフレームとが同一ではない)と判別すると(ステップS209;NO)、処理はステップS203へ戻る。   If it is determined that the incremented value B does not match the value A (the Bth frame and the Ath frame are not the same) (step S209; NO), the process returns to step S203.

すなわち、オプティカルフロー取得部102aは、値Bを1ずつインクリメントしながら、インクリメント後の値Bが値Aに一致する(第Bフレームと第Aフレームとが同一である)と判別するまで(ステップS209においてYESと判別されるまで)ステップS203〜S208の処理を繰り返す。これにより、特徴点軌道pを取得すると共に、図10に示すように、第Aフレームの画像と、第tフレーム直前の10フレームのうち第Aフレームより以前のフレームの画像と、の間のオプティカルフローを取得する。   That is, the optical flow acquisition unit 102a increments the value B by 1 and determines that the incremented value B matches the value A (the Bth frame and the Ath frame are the same) (step S209). Steps S203 to S208 are repeated. As a result, the feature point trajectory p is obtained and, as shown in FIG. 10, an optical between the image of the Ath frame and the image of the frame before the Ath frame among the 10 frames immediately before the tth frame. Get the flow.

最終的に、インクリメント後の値Bが値Aに一致する(第Bフレームと第Aフレームとが同一である)と判別すると(ステップS209;YES)、オプティカルフロー取得部102aは、値Aを1だけディクリメントする(ステップS210)。すなわち、ステップS202〜S209の処理対象となる第Aフレームを、直前の(次に撮像時刻が古い)フレームに移す。例えば、直前に実行したステップS202〜S209の処理において、第tフレームが第Aフレームとして設定されていた場合、ステップS210において、第tフレームの直前のフレームである第(t−1)フレームが、新たに第Aフレームとして設定される。   When it is finally determined that the incremented value B matches the value A (the B-th frame and the A-th frame are the same) (step S209; YES), the optical flow acquisition unit 102a sets the value A to 1. Only decrement (step S210). That is, the Ath frame to be processed in steps S202 to S209 is moved to the immediately preceding frame (the next imaging time is the oldest). For example, if the t-th frame is set as the A-th frame in the processing of steps S202 to S209 executed immediately before, the (t−1) -th frame that is the frame immediately before the t-th frame is determined in step S210. A new frame A is set.

ステップS210で値Aを1だけディクリメントした後、オプティカルフロー取得部102aは、ディクリメント後の値Aが値(t−10)に一致するか否かを判別する(ステップS211)。   After decrementing the value A by 1 in step S210, the optical flow acquisition unit 102a determines whether or not the decremented value A matches the value (t-10) (step S211).

ディクリメント後の値Aが値(t−10)に一致しないと判別すると(ステップS211;NO)、処理はステップS202へ戻る。   If it is determined that the decremented value A does not match the value (t−10) (step S211; NO), the process returns to step S202.

すなわち、オプティカルフロー取得部102aは、値Aを1ずつディクリメントしながら、ディクリメント後の値Aが値(t−10)に一致すると判別するまで(ステップS211においてYESと判別するまで)、ステップS202〜S210の処理を繰り返す。これにより、特徴点軌道pを取得すると共に、図10に示すように、第tフレーム及び第tフレームの直前の10フレームそれぞれについて、各フレームの画像と、各フレームより以前のフレームの画像と、の間のオプティカルフローを取得する。   That is, the optical flow acquisition unit 102a decrements the value A by 1 until it is determined that the decremented value A matches the value (t-10) (until YES in step S211). The processes of S202 to S210 are repeated. As a result, the feature point trajectory p is acquired, and as shown in FIG. 10, for each of the 10 frames immediately before the t-th frame and the t-th frame, an image of each frame, an image of a frame before each frame, Get the optical flow between.

ディクリメント後の値Aが値(t−10)に一致すると判別すると(ステップS211;YES)、オプティカルフロー取得部102aは、オプティカルフロー取得処理を終了する。   When it is determined that the decremented value A matches the value (t-10) (step S211; YES), the optical flow acquisition unit 102a ends the optical flow acquisition process.

図8のフローチャートに戻って、ステップS2のオプティカルフロー取得処理終了後、基礎行列取得部102は、基礎行列取得処理を実行する(ステップS3)。   Returning to the flowchart of FIG. 8, after the optical flow acquisition process of step S <b> 2 ends, the basic matrix acquisition unit 102 executes the basic matrix acquisition process (step S <b> 3).

以下、ステップS3の基礎行列取得処理の詳細を、図11のフローチャートを参照しながら説明する。   Hereinafter, the details of the basic matrix acquisition process of step S3 will be described with reference to the flowchart of FIG.

ステップS3の基礎行列取得処理を開始すると、基礎行列取得部102は、まず、第(t−10)フレーム(第tフレームより10フレーム前のフレーム)を第Gフレームとして設定する(ステップS301)。   When the basic matrix acquisition process in step S3 is started, the basic matrix acquisition unit 102 first sets the (t-10) th frame (a frame 10 frames before the tth frame) as the Gth frame (step S301).

次に、基礎行列取得部102は、オプティカルフロー取得処理により取得された、第tフレームの画像と第Gフレームの画像との間のオプティカルフローに基づいて、第Gフレームの画像と第tフレームの画像との間のエピポーラ関係を表す基礎行列FG,tを取得する(ステップS302)。 Next, based on the optical flow between the t-th frame image and the G-th frame image acquired by the optical flow acquisition process, the basic matrix acquisition unit 102 performs the G-th frame image and the t-th frame. A basic matrix F G, t representing an epipolar relationship with an image is acquired (step S302).

具体的には、基礎行列取得部102は、第Gフレームの画像と第tフレームの画像との間のオプティカルフローを形成する特徴点pの移動ベクトルのうち、複数の特徴点pの移動ベクトルの始点と終点の座標(例えば、同次座標)を対応点として用い、8ポイントアルゴリズムとRANSAC法により上述の式(2)で表される基礎行列Fの各パラメータを求める。 Specifically, the basic matrix acquisition unit 102 moves a plurality of feature points p i out of the movement vectors of the feature points p i that form an optical flow between the G-th frame image and the t-th frame image. Using the coordinates of the start point and end point of the vector (for example, homogeneous coordinates) as corresponding points, each parameter of the basic matrix F expressed by the above equation (2) is obtained by the 8-point algorithm and the RANSAC method.

ステップS302において基礎行列FG,tを取得した後、基礎行列取得部102は、値Gを1だけインクリメントし(ステップS303)、インクリメント後の値Gが値tに一致するか否かを判別する(ステップS304)。一致しないと判別された場合(ステップS304;NO)、処理はステップS302へ戻る。 After acquiring the basic matrix F G, t in step S302, the basic matrix acquisition unit 102 increments the value G by 1 (step S303), and determines whether or not the incremented value G matches the value t. (Step S304). If it is determined that they do not match (step S304; NO), the process returns to step S302.

すなわち、基礎行列取得部102は、値Gを1ずつインクリメントしながら、インクリメント後の値Gが値tに一致すると判別されるまで(ステップS304においてYESと判別されるまで)、ステップS302〜S303の処理を繰り返す。これにより、指定部101によって指定された第tフレームの画像と、指定されたフレームの画像の直前10フレーム分の画像それぞれと、の間のエピポーラ関係を表す基礎行列Ft-10,t〜Ft-1,tを取得する。 That is, the basic matrix acquisition unit 102 increments the value G by 1 until it is determined that the incremented value G matches the value t (until determined as YES in step S304), steps S302 to S303. Repeat the process. As a result, the basic matrix F t-10, t to F representing the epipolar relationship between the image of the t-th frame specified by the specifying unit 101 and each of the 10 frames immediately before the image of the specified frame. Get t-1, t .

インクリメント後の値Gが値tに一致すると判別した場合(ステップS304;YES)、基礎行列取得部102は、基礎行列取得処理を終了する。   When it is determined that the incremented value G matches the value t (step S304; YES), the basic matrix acquisition unit 102 ends the basic matrix acquisition process.

図8のフローチャートに戻って、ステップS3の基礎行列取得処理が終了した後、選別部103は、フレーム選別処理を実行する(ステップS4)。   Returning to the flowchart of FIG. 8, after the basic matrix acquisition process in step S3 is completed, the selection unit 103 executes a frame selection process (step S4).

以下、ステップS4のフレーム選別処理の詳細について、図12のフローチャートを参照しながら説明する。   Details of the frame selection process in step S4 will be described below with reference to the flowchart of FIG.

ステップS4のフレーム選別処理を開始すると、選別部103は、指定部101が指定したフレーム(第tフレーム)の10フレーム前のフレーム(第(t−10)フレーム)を第Cフレームとして設定する(ステップS401)。   When the frame selection process in step S4 is started, the selection unit 103 sets the frame (the (t-10) frame) 10 frames before the frame (the t-th frame) specified by the specification unit 101 as the C-th frame ( Step S401).

次に、評価部108が、基礎行列取得処理によって取得された基礎行列のうち、第Cフレームの画像と第tフレームの画像と間の関係を表す基礎行列FC,tと、第tフレームの画像との関係を表す他の基礎行列FC+1,t〜Ft-1,tとの類似性を評価する(ステップS402)。 Next, the evaluation unit 108 selects the basic matrix F C, t representing the relationship between the C-th frame image and the t-th frame image among the basic matrices acquired by the basic matrix acquisition process , and the t-th frame. The similarity with other basic matrices F C + 1, t to F t−1, t representing the relationship with the image is evaluated (step S402).

具体的には図13に示すように、評価部108は、第Cフレームの画像と第tフレームの画像との間の関係を表す基礎行列FC,tと、第tフレームより以前の10フレームのうち第Cフレームより後に撮像された(t−C−1)個の各フレームの画像と第tフレームの画像との間の関係を表す基礎行列FC+1,t〜Ft-1,tと、が類似しているか否かを順次判別していく。そして、基礎行列FC+1,t〜Ft-1,tの中に、基礎行列FC,tと類似しているものがあるか否かを評価する。評価部108による基礎行列の類似度の評価は、具体的には上述したように、異なる2つの基礎行列の間において、一方の基礎行列に含まれる各要素と、他方の基礎行列に含まれる各要素と、を比較することによって得られる。 Specifically, as illustrated in FIG. 13, the evaluation unit 108 calculates a basic matrix F C, t representing the relationship between the C-th frame image and the t-th frame image, and 10 frames before the t-th frame. Among the basic matrices F C + 1, t to F t−1 representing the relationship between (t−C−1) frames of images taken after the C frame and images of the t frame . It is sequentially determined whether or not t is similar. Then, it is evaluated whether or not any of the basic matrices F C + 1, t to F t−1 , t is similar to the basic matrix F C, t . Specifically, as described above, the evaluation of the similarity of the base matrix by the evaluation unit 108 is performed between each element included in one base matrix and each base matrix included between two different base matrices. Obtained by comparing the elements.

類似性の評価の結果、選別部103は、基礎行列FC,tと類似している基礎行列があるか否かを判別する(ステップS403)。判別の結果、基礎行列FC,tと類似している基礎行列がある場合(ステップS403;YES)、選別部103は、第Cフレームを、第tフレームの画像へのエピポーラ転送をスキップするフレームとして、RAM等のメモリに一時的に保存する(ステップS404)。 As a result of the similarity evaluation, the selection unit 103 determines whether there is a basic matrix similar to the basic matrix F C, t (step S403). As a result of the determination, if there is a basic matrix similar to the basic matrix F C, t (step S403; YES), the selection unit 103 skips the epipolar transfer of the Cth frame to the image of the tth frame. Is temporarily stored in a memory such as a RAM (step S404).

一方、基礎行列FC,tと類似している基礎行列がない場合(ステップS403;NO)、選別部103は、第Cフレームはスキップするフレームではないと判別する。そのため、ステップS404の処理を実行せず、第Cフレームをスキップするフレームとしては保存しない。 On the other hand, when there is no basic matrix similar to the basic matrix F C, t (step S403; NO), the selection unit 103 determines that the C-th frame is not a skipped frame. For this reason, the process of step S404 is not executed, and the C-th frame is not saved as a skipped frame.

このように第Cフレームをスキップするか否かを決定すると、選別部103は、値Cを1だけインリメントする(ステップS405)。そして、インクリメント後の値Cが値(t−1)に一致するか否かを判別する(ステップS406)。一致しないと判別した場合(ステップS406;NO)、処理はステップS402へ戻る。   When determining whether or not to skip the C-th frame in this way, the selecting unit 103 increments the value C by 1 (step S405). Then, it is determined whether or not the incremented value C matches the value (t−1) (step S406). If it is determined that they do not match (step S406; NO), the process returns to step S402.

すなわち、選別部103は、値Cを1ずつインクリメントしながら、インクリメント後の値Cが値(t−1)に達するまで、ステップS402〜S405の処理を繰り返す。これにより、図13に示すように、第tフレームの直前の10フレーム分それぞれについて、第Cフレームより後に撮像された各フレームの画像と第tフレームの画像との間の関係を表す基礎行列FC+1,t〜Ft-1,tと、が類似しているか否かを順次判別していく。そして、基礎行列FC+1,t〜Ft-1,tの中に基礎行列FC,tと類似しているものがある場合に、第Cフレームを、第tフレームの画像へのエピポーラ転送をスキップするフレームとして保存していく。 That is, the selection unit 103 increments the value C by 1 and repeats the processes of steps S402 to S405 until the incremented value C reaches the value (t−1). As a result, as shown in FIG. 13, for each of the 10 frames immediately before the t-th frame, a basic matrix F representing the relationship between the image of each frame captured after the C-th frame and the image of the t-th frame. It is sequentially determined whether or not C + 1, t to F t-1, t are similar. Then, if there is something similar to the basic matrix F C, t among the basic matrices F C + 1, t to F t-1, t , the C-th frame is converted to an epipolar to the image of the t-th frame. Save as a frame to skip the transfer.

最終的に、値Cが値(t−1)に一致すると(ステップS406;YES)、第Cフレームが第(t−1)フレームにまで達したため、基礎行列FC,tとの類似度を評価する基礎行列がなくなる。そのため、選別部103は、フレーム選別処理を終了する。 Finally, when the value C matches the value (t−1) (step S406; YES), since the Cth frame has reached the (t−1) th frame, the similarity with the basic matrix F C, t is determined. There is no basis matrix to evaluate. Therefore, the selection unit 103 ends the frame selection process.

図8のフローチャートに戻って、ステップS4のフレーム選別処理が終了した後、仮想特徴点生成部104は、仮想特徴点生成処理を実行する(ステップS5)。これにより、基礎行列取得処理によって取得された基礎行列Fに基づいて、ステップS1で指定部101によって指定されたフレーム(第tフレーム)より前の10フレーム分の画像内の互いに対応する仮想特徴点vを第tフレームの画像にエピポーラ転送することにより、第tフレームの画像内における仮想特徴点vを生成する。 Returning to the flowchart of FIG. 8, after the frame selection process in step S4 is completed, the virtual feature point generation unit 104 executes the virtual feature point generation process (step S5). Thereby, based on the basic matrix F acquired by the basic matrix acquisition process, the virtual feature points corresponding to each other in the image for 10 frames before the frame (t-th frame) specified by the specifying unit 101 in step S1. The virtual feature points v i in the t-th frame image are generated by epipolar transfer of v i to the t-th frame image.

以下、ステップS5の仮想特徴点生成処理の詳細について、図14のフローチャートを参照しながら説明する。   Hereinafter, the details of the virtual feature point generation processing in step S5 will be described with reference to the flowchart of FIG.

仮想特徴点生成処理においては、第tフレームより前の10フレーム分の画像が含む仮想特徴点vが第tフレームへ投影するエピポーラ線を求める必要がある。しかし、手ぶれ補正処理の初期段階においては、エピポーラ線の投影元となるべき過去のフレームの画像に含まれる仮想特徴点vが未だ生成されていないことがある。そこで、仮想特徴点生成処理を開始すると、仮想特徴点生成部104は、まず、仮想特徴点軌道準備処理を実行する(ステップS501)。 In the virtual feature point generation process is a virtual feature point v i which image contains 10 frames before the t-th frame is necessary to obtain the epipolar line to be projected to the t frame. However, in the initial stage of the image stabilization process, it is the virtual feature point v i included in the image of the past frame to be the projection source epipolar line is not generated yet. Thus, when the virtual feature point generation process is started, the virtual feature point generation unit 104 first executes a virtual feature point trajectory preparation process (step S501).

以下、ステップS501の仮想特徴点軌道準備処理の詳細について、図15のフローチャートを参照しながら説明する。   Details of the virtual feature point trajectory preparation process in step S501 will be described below with reference to the flowchart of FIG.

仮想特徴点軌道準備処理を開始すると、仮想特徴点生成部104は、まず、第tフレームより以前のフレームにおいて構築された仮想特徴点軌道vのうち何れか1つを選択する(ステップS501a)。   When the virtual feature point trajectory preparation process is started, the virtual feature point generation unit 104 first selects one of the virtual feature point trajectories v constructed in the frame before the t-th frame (step S501a).

そして、仮想特徴点生成部104は、選択した仮想特徴点軌道vが第(t−1)フレームまで伸びているか否かを判別する(ステップS501b)。すなわち、仮想特徴点生成部104は、選択した仮想特徴点軌道vが第(t−1)フレームより前のフレームから、第(t−1)フレームまで連続しているか否かを判別する。   Then, the virtual feature point generation unit 104 determines whether or not the selected virtual feature point trajectory v extends to the (t−1) th frame (step S501b). In other words, the virtual feature point generation unit 104 determines whether or not the selected virtual feature point trajectory v is continuous from the frame before the (t−1) frame to the (t−1) frame.

仮想特徴点軌道vが第(t−1)フレームまで伸びていると判別した場合(ステップS501b;YES)、仮想特徴点生成部104は、選択した仮想特徴点軌道vを仮想特徴点生成のための初期軌道として用いることができるので、処理はステップS501dへ移る。   If it is determined that the virtual feature point trajectory v extends to the (t−1) th frame (step S501b; YES), the virtual feature point generation unit 104 uses the selected virtual feature point trajectory v to generate a virtual feature point. Therefore, the process moves to step S501d.

一方、仮想特徴点軌道vが第(t−1)フレームまで伸びていないと判別された場合(ステップS501b;NO)、仮想特徴点生成部104は、第tフレームの直前に撮像された5フレーム分の画像から取得された特徴点軌道pを仮想特徴点軌道vにコピーする(ステップS501c)。すなわち、仮想特徴点生成部104は、第(t−1)〜第(t−5)フレームの画像から抽出済みの特徴点pを、これらの画像中の仮想特徴点vと見なし、仮想特徴点生成のための初期軌道を取得する。 On the other hand, when it is determined that the virtual feature point trajectory v does not extend to the (t−1) th frame (step S501b; NO), the virtual feature point generation unit 104 captures the five frames captured immediately before the tth frame. The feature point trajectory p acquired from the minute image is copied to the virtual feature point trajectory v (step S501c). That is, the virtual feature point generation unit 104 regards the feature points p i already extracted from the images of the (t−1) th to (t-5) th frames as the virtual feature points v i in these images, Get initial trajectory for feature point generation.

本実施形態では、100本の仮想特徴点軌道vにより、手ぶれ補正前の撮像装置1の動きを定義する(手ぶれ補正前の各フレームの画像を定義する)。そこで、ステップS501dにおいて、仮想特徴点生成部104は、100個の仮想特徴点軌道vに対してステップS501b〜S501cの処理を施したか否か判別する(ステップS501d)。100個の仮想特徴点軌道vに処理を施していないと判別すると(ステップS501d;NO)、処理はステップS501aへ戻り、仮想特徴点生成部104は、別の仮想特徴点軌道vを選択してステップS501b〜S501cの処理を実行する。   In this embodiment, the motion of the imaging device 1 before camera shake correction is defined by 100 virtual feature point trajectories v (an image of each frame before camera shake correction is defined). Therefore, in step S501d, the virtual feature point generation unit 104 determines whether or not the processing of steps S501b to S501c has been performed on 100 virtual feature point trajectories v (step S501d). If it is determined that the process has not been performed on 100 virtual feature point trajectories v (step S501d; NO), the process returns to step S501a, and the virtual feature point generation unit 104 selects another virtual feature point trajectory v. Steps S501b to S501c are executed.

最終的に、100個の仮想特徴点軌道vに処理を施したと判別すると(ステップS501d;YES)、仮想特徴点生成部104は、仮想特徴点軌道準備処理を終了する。   When it is finally determined that 100 virtual feature point trajectories v have been processed (step S501d; YES), the virtual feature point generation unit 104 ends the virtual feature point trajectory preparation process.

図14のフローチャートに戻って、ステップS501の仮想特徴点軌道準備処理を終了した後、仮想特徴点生成部104は、仮想特徴点軌道準備処理を施された100本の仮想特徴点軌道vのうち何れか1つを選択する(ステップS502)。   Returning to the flowchart of FIG. 14, after the virtual feature point trajectory preparation process in step S <b> 501 is completed, the virtual feature point generation unit 104 out of the 100 virtual feature point trajectories v subjected to the virtual feature point trajectory preparation process. Either one is selected (step S502).

次に、仮想特徴点生成部104は、第(t−10)フレーム(第tフレームより10フレーム前のフレーム)を第Hフレームとして設定し(ステップS503)、第Hフレームが、ステップS4におけるフレーム選別処理において、非スキップ対象と評価されたか否かを判別する(ステップS504)。   Next, the virtual feature point generation unit 104 sets the (t-10) th frame (a frame 10 frames before the tth frame) as the Hth frame (step S503), and the Hth frame is the frame in step S4. In the sorting process, it is determined whether or not it is evaluated as a non-skip target (step S504).

第Hフレームの画像と第tフレームの画像との間の関係を表す基礎行列が、第Hフレームから第tフレームまでの他のフレームの画像と第tフレームの画像との関係を表す基礎行列の何れかに類似している場合、第Hフレームは、フレーム選別処理により、スキップ対象と評価されている。この場合、仮想特徴点生成部104は、第Hフレームを非スキップ対象と評価されていないと判別し(ステップS504;NO)、処理はステップS506へ移る。   The basic matrix representing the relationship between the image of the Hth frame and the image of the tth frame is a basic matrix representing the relationship between the image of the other frame from the Hth frame to the tth frame and the image of the tth frame. If they are similar to any of them, the H-th frame is evaluated as a skip target by the frame selection process. In this case, the virtual feature point generation unit 104 determines that the H-th frame is not evaluated as a non-skip target (step S504; NO), and the process proceeds to step S506.

第Hフレームの画像と第tフレームの画像との間の関係を表す基礎行列が、第Hフレームから第tフレームまでの他のフレームの画像と第tフレームの画像との関係を表す基礎行列の何れにも類似していなかった場合、第Hフレームは、フレーム選別処理により、非スキップ対象と評価されている。この場合、仮想特徴点生成部104は、非スキップ対象と評価されていると判別する(ステップS504;YES)。そして、仮想特徴点生成部104は、ステップS3における基礎行列取得処理によって取得された、第tフレームの画像と第Hフレームの画像との間のエピポーラ関係を表す基礎行列Ft、Hに基づいて、選択した仮想特徴点軌道vに含まれる第Hフレームの画像の仮想特徴点vから、第tフレームの画像へ、エピポーラ線を投影する(ステップS505)。 The basic matrix representing the relationship between the image of the Hth frame and the image of the tth frame is a basic matrix representing the relationship between the image of the other frame from the Hth frame to the tth frame and the image of the tth frame. If they are not similar to each other, the H-th frame is evaluated as a non-skip target by the frame selection process. In this case, the virtual feature point generation unit 104 determines that it is evaluated as a non-skip target (step S504; YES). Then, the virtual feature point generation unit 104 is based on the basic matrices F t and H representing the epipolar relationship between the image of the t th frame and the image of the H frame acquired by the basic matrix acquisition process in step S3. , from the virtual feature point v i of the image of the H frame included in the virtual feature point trajectory v selected, the image of the t frame, projecting the epipolar line (step S505).

エピポーラ線を取得した後、仮想特徴点生成部104は、値Hを1だけインクリメントし(ステップS506)、インクリメント後の値Hが値tに一致するか否かを判別する(ステップS507)。一致しないと判別すると(ステップS507;NO)、処理はステップS504へ戻る。   After acquiring the epipolar line, the virtual feature point generation unit 104 increments the value H by 1 (step S506), and determines whether the incremented value H matches the value t (step S507). If it is determined that they do not match (step S507; NO), the process returns to step S504.

すなわち、仮想特徴点生成部104は、値Hを1ずつインクリメントしながら、インクリメント後の値Hが値tに一致すると判別されるまで(ステップS507においてYESと判別されるまで)、ステップS504〜S506の処理を繰り返す。これにより、第tフレームより前の10フレームのうち非スキップ対象と判別された各フレームの画像に含まれる仮想特徴点vから第tフレームの画像へ、順次エピポーラ線を投影する。 That is, the virtual feature point generation unit 104 increments the value H by 1 until it is determined that the incremented value H matches the value t (until determined as YES in step S507), steps S504 to S506. Repeat the process. Thus, from the virtual feature point v i included in the image of each frame is determined as a non-skipped among the 10 frames before the t-th frame to the image of the t frame, projecting the sequential epipolar line.

最終的に、インクリメント後の値Hが値tに一致すると判別した場合(ステップS507;YES)、仮想特徴点生成部104は、第tフレームの画像に投影した複数のエピポーラ線から任意の1組を選択する(ステップS508)。そして、選択した1組のエピポーラ線が互いに成す角が1.5°以上であるか否かを判別する(ステップS509)。   Finally, when it is determined that the incremented value H matches the value t (step S507; YES), the virtual feature point generation unit 104 selects an arbitrary set from a plurality of epipolar lines projected on the image of the t-th frame. Is selected (step S508). Then, it is determined whether or not the angle formed by the selected pair of epipolar lines is 1.5 ° or more (step S509).

1組のエピポーラ線が平行に近いほど、これらのエピポーラ線が与える交点の信頼度は低い。そこで、仮想特徴点生成部104は、一定以上に大きな角を成すエピポーラ線の組が与える交点の座標のみを取得することにより、信頼性の低い交点を排除する。   The closer a pair of epipolar lines are to parallel, the lower the reliability of the intersection given by these epipolar lines. Therefore, the virtual feature point generation unit 104 eliminates intersections with low reliability by acquiring only the coordinates of the intersections given by a pair of epipolar lines that form a corner larger than a certain angle.

具体的には、成す角が1.5°を下回ると判別すると(ステップS509;NO)、処理はステップS511へ移る。一方、成す角が1.5°以上であると判別すると(ステップS509;YES)、仮想特徴点生成部104は、これらのエピポーラ線の交点の座標を取得し(ステップS510)、処理はステップS511へ移る。   Specifically, if it is determined that the formed angle is less than 1.5 ° (step S509; NO), the process proceeds to step S511. On the other hand, if it is determined that the formed angle is 1.5 ° or more (step S509; YES), the virtual feature point generation unit 104 acquires the coordinates of the intersections of these epipolar lines (step S510), and the process proceeds to step S511. Move on.

ステップS511において、仮想特徴点生成部104は、第tフレームの画像に投影した複数のエピポーラ線から選択可能な全ての組み合わせを選択したか否かを判別する(ステップS511)。選択されていない組み合わせがあると判別すると(ステップS511;NO)、処理はステップS508へ戻り、仮想特徴点生成部104は、未だ選択されていない組み合わせを選択して、同様の処理を実行する。   In step S511, the virtual feature point generation unit 104 determines whether all selectable combinations have been selected from the plurality of epipolar lines projected on the image of the t-th frame (step S511). If it is determined that there is a combination that has not been selected (step S511; NO), the process returns to step S508, and the virtual feature point generation unit 104 selects a combination that has not yet been selected and executes the same process.

選択可能な全ての組み合わせが選択されたと判別すると(ステップS511;YES)、仮想特徴点生成部104は、取得された全ての交点座標の平均値を求め、この平均値と、取得された全ての交点座標の中央値と、の間の距離が5画素より小さいか否か判別する(ステップS512)。   When it is determined that all selectable combinations have been selected (step S511; YES), the virtual feature point generation unit 104 obtains an average value of all the acquired intersection coordinates, and this average value and all the acquired It is determined whether or not the distance between the median value of the intersection coordinates is smaller than 5 pixels (step S512).

具体的には、平均値と中央値との間の距離が5画素より小さいと判別すると(ステップS512;YES)、仮想特徴点生成部104は、平均値を第tフレーム中の仮想特徴点vの座標として取得し(ステップS513)、処理はステップS514へ移る。 Specifically, when it is determined that the distance between the average value and the median value is smaller than 5 pixels (step S512; YES), the virtual feature point generation unit 104 determines the average value as the virtual feature point v in the t-th frame. Obtained as the coordinates of i (step S513), and the process proceeds to step S514.

平均値が中央値から5画素以上離れていると判別すると(ステップS512;NO)、処理はステップS514へ移る。すなわち、交点座標の平均値が中央値から5画素以上離れている場合、トラッキングエラーである可能性が高い。そこで、中央値から5画素以上離れている平均値の取得をスキップすることにより、信頼性に欠ける交点を排除する。   If it is determined that the average value is 5 pixels or more away from the median value (step S512; NO), the process proceeds to step S514. That is, when the average value of the intersection coordinates is 5 pixels or more away from the median value, there is a high possibility of a tracking error. Therefore, by skipping the acquisition of an average value that is 5 pixels or more away from the median value, intersections lacking in reliability are eliminated.

ステップS514において、仮想特徴点生成部104は、ステップS501の仮想特徴点軌道準備処理により処理された100本の仮想特徴点軌道v全てが選択されたか否かを判別する(ステップS514)。未だ選択されていない仮想特徴点軌道vがあると判別すると(ステップS514;NO)、処理はステップS502へ戻り、仮想特徴点生成部104は、未選択の仮想特徴点軌道vのうち何れか1本を選択して、同様の仮想特徴点生成処理を実行する。   In step S514, the virtual feature point generation unit 104 determines whether all 100 virtual feature point trajectories v processed by the virtual feature point trajectory preparation process in step S501 have been selected (step S514). If it is determined that there is an unselected virtual feature point trajectory v (step S514; NO), the process returns to step S502, and the virtual feature point generation unit 104 selects any one of the unselected virtual feature point trajectories v. A book is selected and a similar virtual feature point generation process is executed.

最終的に、全ての仮想特徴点軌道vが選択済みであると判別すると(ステップS514;YES)、仮想特徴点生成部104は、仮想特徴点生成処理を終了する。   Finally, when it is determined that all the virtual feature point trajectories v have been selected (step S514; YES), the virtual feature point generation unit 104 ends the virtual feature point generation process.

図8のフローチャートに戻って、ステップS5の仮想特徴点生成処理が終了した後、仮想特徴点軌道構築部105は、仮想特徴点生成処理によって生成された仮想特徴点vを、仮想特徴点軌道vを構成する点に追加することにより、仮想特徴点軌道vを延長する(ステップS6)。 Returning to the flowchart of FIG. 8, after the virtual feature point generation process in step S5 is completed, the virtual feature point trajectory construction unit 105, a virtual feature point v i generated by the virtual feature point generation process, the virtual feature point trajectory By adding to the points constituting v, the virtual feature point trajectory v is extended (step S6).

そして、仮想特徴点軌道構築部105は、指定部101が指定したフレーム(第tフレーム)が手ぶれ補正終了フレームであるか否かを判別する(ステップS7)。手ぶれ補正終了フレームは、手ぶれ補正対象の動画が含む複数のフレームのうち最後の(撮像時刻が最も新しい)フレームである。   Then, the virtual feature point trajectory construction unit 105 determines whether or not the frame (tth frame) designated by the designation unit 101 is a camera shake correction end frame (step S7). The camera shake correction end frame is the last frame (the latest imaging time) among a plurality of frames included in the moving image to be corrected for camera shake.

第tフレームが手ぶれ補正終了フレームではないと判別すると(ステップS7;NO)、仮想特徴点軌道構築部105は、指定部101に、直前に実行されたステップS2〜S6の処理において第tフレームとして設定されていたフレームの次の(次に撮像時刻が新しい)フレームを、新たな第tフレームとして設定させ(ステップS13)、処理はステップS2へ戻る。   When it is determined that the t-th frame is not the camera shake correction end frame (step S7; NO), the virtual feature point trajectory construction unit 105 causes the designation unit 101 to execute the t-th frame as the t-th frame in the processing of steps S2 to S6 executed immediately before. The frame next to the set frame (the next imaging time is the newest) is set as a new t-th frame (step S13), and the process returns to step S2.

すなわち、仮想特徴点軌道構築部105は、手ぶれ補正対象の動画が含む複数フレームの画像の中から指定部101が指定する画像を変えて、ステップS2〜S6の処理を繰り返す。これにより、仮想特徴点軌道構築部105は、仮想特徴点軌道vを構築する。   That is, the virtual feature point trajectory constructing unit 105 changes the image designated by the designation unit 101 from among a plurality of frames included in the moving image subject to camera shake correction, and repeats the processes of steps S2 to S6. Thereby, the virtual feature point trajectory construction unit 105 constructs a virtual feature point trajectory v.

第tフレームが手ぶれ補正終了フレームであると判別されると(ステップS7;YES)、平滑化部106が、構築された仮想特徴点軌道vをσ=50のガウシアンカーネルにより時間方向に平滑化し、平滑化された仮想特徴点軌道〜vを取得する(ステップS8)。   If it is determined that the t-th frame is a camera shake correction end frame (step S7; YES), the smoothing unit 106 smoothes the constructed virtual feature point trajectory v in the time direction by a Gaussian kernel with σ = 50, The smoothed virtual feature point trajectory ~ v is acquired (step S8).

そして、補正部107は、仮想特徴点軌道vと平滑化された仮想特徴点軌道〜vとの間の関係に基づいて、手ぶれ補正前の各フレームの画像と手ぶれ補正後の各フレームの画像との間のエピポーラ関係を表す基礎行列〜Fを取得する(ステップS9)。   Then, the correcting unit 107, based on the relationship between the virtual feature point trajectory v and the smoothed virtual feature point trajectory ~ v, the image of each frame before camera shake correction and the image of each frame after camera shake correction, Basic matrix ~ F representing the epipolar relationship between the two is acquired (step S9).

具体的には、補正部107は、仮想特徴点軌道vを形成する仮想特徴点vと、平滑化された仮想特徴点軌道〜vを形成する手ぶれ補正後の仮想特徴点〜vと、を対応点として用い、8ポイントアルゴリズムとRANSAC法により基礎行列〜Fを求める。 Specifically, the correction unit 107, a virtual feature point v i to form a virtual feature point trajectory v, and a virtual feature point to v i after image stabilization to form a virtual feature point trajectory to v smoothed, Are used as corresponding points, and the basic matrix ~ F is obtained by the 8-point algorithm and the RANSAC method.

そして、補正部107は、ステップS9で取得した基礎行列〜Fに基づいてエピポーラ転送を行うことにより、手ぶれ補正後の特徴点軌道〜pを取得する(ステップS10)。   And the correction | amendment part 107 acquires the feature point trajectory -p after camera-shake correction | amendment by performing epipolar transfer based on the basic matrix -F acquired at step S9 (step S10).

具体的には、補正部107は、手ぶれ補正後の各フレームの画像に、手ぶれ補正前の前後5フレームの画像に含まれる特徴点pが投影するエピポーラ線を、基礎行列〜Fに基づいて取得する。そして、図6に示すように、エピポーラ線の交点により定まる点を、手ぶれ補正後の各フレームの画像が含む手ぶれ補正後の特徴点〜pとして取得する。手ぶれ補正後の特徴点軌道〜pは、手ぶれ補正後の特徴点〜pによって構成される軌道として取得される。 Specifically, the correction unit 107 calculates epipolar lines projected by the feature points p i included in the images of the five frames before and after the camera shake correction on the image of each frame after the camera shake correction based on the basic matrixes ~ F. get. Then, as shown in FIG. 6, the point determined by the intersection of the epipolar line, obtained as feature points ~p i after anti-shake image of each frame after image stabilization can contain. Feature point trajectory ~p after image stabilization is obtained as a track constituted by the feature point ~p i after camera shake compensation.

補正部107は、取得された手ぶれ補正後の特徴点軌道〜pをσ=6のガウシアンカーネルを用いて時間方向に平滑化することにより、高周波ジッタを除去する(ステップS11)。   The correction unit 107 removes high-frequency jitter by smoothing the acquired feature point trajectory to p after camera shake correction using the Gaussian kernel with σ = 6 in the time direction (step S11).

補正部107は、手ぶれ補正対象の動画が含む各フレームの画像に対し、特徴点軌道pと手ぶれ補正後の特徴点軌道〜pとの間の関係に基づいて射影変換を実行することにより手ぶれを補正する(ステップS12)。以上により、図8のフローチャートに示した手ぶれ補正処理を終了する。   The correction unit 107 performs the camera shake by performing projective transformation on the image of each frame included in the image to be corrected for camera shake based on the relationship between the feature point trajectory p and the feature point trajectory to p after the camera shake correction. Correction is performed (step S12). Thus, the camera shake correction process shown in the flowchart of FIG. 8 ends.

具体的には、補正部107は、特徴点軌道pを構成する特徴点pの座標と、手ぶれ補正後の特徴点軌道〜pを構成する手ぶれ補正後の特徴点〜pの座標と、を対応点として式(6)に代入することにより射影変換パラメータを求める。そして、手ぶれ補正対象の動画を構成する複数の画像それぞれを射影変換し、射影変換された複数の画像によって構成される動画を、手ぶれを補正した動画として生成する。 Specifically, the correction unit 107, the coordinates of the feature point p i that make up the feature point trajectory p, and the feature point ~p i of coordinates after camera shake compensation constituting the feature point trajectory ~p after camera shake compensation, Is assigned to the equation (6) as a corresponding point to obtain a projective transformation parameter. Then, each of a plurality of images constituting the moving image subject to camera shake correction is subjected to projective transformation, and a moving image composed of the plurality of images subjected to the projective transformation is generated as a moving image in which camera shake is corrected.

以上説明したように、本実施形態に係る撮像装置1及び画像処理装置100は、エピポーラ幾何を利用することにより、視差の影響を考慮した手ぶれ補正を動画に対して施すことができる。   As described above, the imaging apparatus 1 and the image processing apparatus 100 according to the present embodiment can perform camera shake correction in consideration of the influence of parallax on a moving image by using epipolar geometry.

さらに、本実施形態に係る撮像装置1及び画像処理装置100は、手ぶれ補正対象の動画を構成する各画像間の関係を表す基礎行列の類似度を評価して、評価結果に基づいてエピポーラ投影の計算を実行する画像を選別している。これにより、精度の良くないエピポーラ転送を行うフレームを事前に選別して、エピポーラ転送の計算をスキップできるため、計算量を削減できる。そのため、手ぶれ補正処理の時間短縮につながる。   Furthermore, the imaging apparatus 1 and the image processing apparatus 100 according to the present embodiment evaluate the similarity of the basic matrix that represents the relationship between the images constituting the image to be corrected for camera shake, and perform epipolar projection based on the evaluation result. The images to be calculated are selected. As a result, it is possible to select in advance a frame for performing epipolar transfer with low accuracy and skip the calculation of epipolar transfer, thereby reducing the amount of calculation. As a result, the camera shake correction processing time is shortened.

以上に本発明の実施形態について説明したが、これらの実施形態は一例であり、本発明の適用範囲はこれに限られない。すなわち、本発明の実施形態は種々の応用が可能であり、あらゆる実施の形態が本発明の範囲に含まれる。   Although the embodiments of the present invention have been described above, these embodiments are merely examples, and the scope of application of the present invention is not limited thereto. That is, the embodiments of the present invention can be applied in various ways, and all the embodiments are included in the scope of the present invention.

上記実施形態において、画像処理装置100は、撮像装置1の内部に具備されていた。しかし、本発明に係る画像処理装置は、撮像装置から独立した装置であってもよい。例えば、コンピュータ等の情報処理装置が、本発明に係る画像処理装置として機能することができる。この場合、画像処理装置は、外部の撮像装置が撮像した動画を手ぶれ補正対象の動画として取得し、上述の手ぶれ補正を施せばよい。   In the above embodiment, the image processing apparatus 100 is provided inside the imaging apparatus 1. However, the image processing apparatus according to the present invention may be an apparatus independent of the imaging apparatus. For example, an information processing apparatus such as a computer can function as the image processing apparatus according to the present invention. In this case, the image processing apparatus may acquire a moving image captured by an external imaging device as a moving image to be subjected to camera shake correction, and perform the above-described camera shake correction.

上記実施形態において、画像処理装置100は、撮像部10が被写体を撮像することにより生成し外部記憶部23に記憶されていた動画を、外部記憶部23から手ぶれ補正の対象として取得した。撮像装置1は、外部記憶部23からではなく、外部の画像入力装置(例えば、デジタルカメラやメモリカード、ネットワーク)から手ぶれ補正対象の動画を予め取得し、記憶しておいてもよい。   In the above-described embodiment, the image processing apparatus 100 acquires, from the external storage unit 23, a camera shake correction target as a moving image generated by the imaging unit 10 capturing an image of a subject and stored in the external storage unit 23. The imaging device 1 may acquire and store in advance a camera shake correction target moving image from an external image input device (for example, a digital camera, a memory card, or a network) instead of from the external storage unit 23.

上記実施形態では、KLT法を用いて各フレームの画像から互いに対応する特徴点pを抽出した。しかし、本発明では、KLT法以外の方法を用いて特徴点pを抽出してもよい。例えば、Harrisオペレータ、SUSANオペレータ、Foerstnerオペレータ、Sojakオペレータ、SIFT等を用いることができる。 In the above embodiment, feature points p i corresponding to each other are extracted from the image of each frame using the KLT method. However, in the present invention, the feature points p i may be extracted using a method other than the KLT method. For example, a Harris operator, a SUSAN operator, a Forersner operator, a Sojak operator, SIFT, or the like can be used.

上記実施形態では、仮想特徴点軌道vをガウシアンカーネルで平滑化することにより、平滑化された仮想特徴点軌道〜vを取得した。しかし、本発明では、平滑化は、ガウシアンカーネル以外の関数(例えば、ラプラシアンフィルタ)を用いて行ってもよい。   In the above-described embodiment, the virtual feature point trajectory v is smoothed by the Gaussian kernel to obtain the smoothed virtual feature point trajectory to v. However, in the present invention, smoothing may be performed using a function other than the Gaussian kernel (for example, a Laplacian filter).

上記実施形態では、手ぶれ補正対象の画像全体に対して一括して射影変換を施すことにより手ぶれ補正を実行した。しかし、本発明では、画像が含む複数の画像領域それぞれに射影変換を施し、射影変換後の画像領域を再結合することにより手ぶれ補正を施すこともできる。   In the embodiment described above, camera shake correction is performed by performing projective transformation on the entire image to be corrected for camera shake in a lump. However, in the present invention, it is also possible to perform camera shake correction by performing projective transformation on each of a plurality of image regions included in an image and recombining the image regions after the projective transformation.

上記実施形態では、本発明に係る画像処理装置、撮像装置及び画像処理方法を、撮像装置1及び画像処理装置100を例に用いて説明した。本発明に係る画像処理装置、撮像装置、及び画像処理方法は、コンピュータ、携帯電話機、デジタルカメラ、PDA(Personal Digital Assistance)等の任意の電子機器によって実現することができる。   In the above embodiment, the image processing apparatus, the imaging apparatus, and the image processing method according to the present invention have been described using the imaging apparatus 1 and the image processing apparatus 100 as examples. The image processing apparatus, the imaging apparatus, and the image processing method according to the present invention can be realized by an arbitrary electronic device such as a computer, a mobile phone, a digital camera, or a PDA (Personal Digital Assistance).

具体的には、コンピュータ、携帯電話機、デジタルカメラ、PDA等を本発明に係る撮像装置及び画像処理装置として動作させるためのプログラムを、これらの電子機器が読み取り可能な記録媒体(例えば、メモリカードやCD−ROM(Compact Disc Read−Only Memory)、DVD−ROM(Digital Versatile Disc Read−Only Memory)等)に格納して配布し、インストールすることにより本発明に係る撮像装置及び画像処理装置を実現することができる。   Specifically, a program for causing a computer, a mobile phone, a digital camera, a PDA, etc. to operate as an imaging apparatus and an image processing apparatus according to the present invention is recorded on a recording medium (for example, a memory card or An image pickup apparatus and an image processing apparatus according to the present invention are realized by storing, distributing, and installing on a CD-ROM (Compact Disc Read-Only Memory), DVD-ROM (Digital Versatile Disc Read-Only Memory), and the like. be able to.

あるいは、上記プログラムを、インターネット等の通信ネットワーク上のサーバ装置が有する記憶装置(例えば、ディスク装置等)に格納しておき、コンピュータ、携帯電話機、デジタルカメラ、PDA等がこのプログラムをダウンロードすることによって本発明に係る撮像装置及び画像処理装置を実現してもよい。   Alternatively, the above program is stored in a storage device (for example, a disk device) included in a server device on a communication network such as the Internet, and the computer, mobile phone, digital camera, PDA, or the like downloads this program. You may implement | achieve the imaging device and image processing apparatus which concern on this invention.

また、本発明に係る撮像装置及び画像処理装置の機能を、オペレーティングシステム(OS:Operating System)とアプリケーションプログラムとの協働又は分担により実現する場合には、アプリケーションプログラム部分のみを記録媒体や記憶装置に格納してもよい。   Further, when the functions of the imaging apparatus and the image processing apparatus according to the present invention are realized by cooperation or sharing of an operating system (OS) and an application program, only the application program portion is recorded on a recording medium or a storage device. May be stored.

また、アプリケーションプログラムを搬送波に重畳し、通信ネットワークを介して配信してもよい。例えば、通信ネットワーク上の掲示板(BBS:Bulletin Board System)にアプリケーションプログラムを掲示し、ネットワークを介してアプリケーションプログラムを配信してもよい。そして、このアプリケーションプログラムをコンピュータにインストールして起動し、OSの制御下で、他のアプリケーションプログラムと同様に実行することにより、本発明に係る撮像装置及び画像処理装置を実現してもよい。   Further, the application program may be superimposed on a carrier wave and distributed via a communication network. For example, an application program may be posted on a bulletin board (BBS: Bulletin Board System) on a communication network, and the application program may be distributed via the network. Then, the imaging apparatus and the image processing apparatus according to the present invention may be realized by installing and starting up the application program in a computer and executing the application program in the same manner as other application programs under the control of the OS.

以上、本発明の好ましい実施形態について説明したが、本発明は係る特定の実施形態に限定されるものではなく、本発明には、特許請求の範囲に記載された発明とその均等の範囲が含まれる。以下に、本願出願当初の特許請求の範囲に記載された発明を付記する。   As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to the specific embodiment which concerns, This invention includes the invention described in the claim, and its equivalent range It is. The invention described in the scope of claims at the beginning of the present application will be appended.

(付記1)
動画を構成する複数の画像の中から1つを指定する指定部と、
前記複数の画像のうちの前記指定部によって指定された画像以外の所定数の画像のそれぞれについて、該指定された画像との関係を表す基礎行列を取得する基礎行列取得部と、
前記基礎行列取得部によって前記所定数の画像のそれぞれについて取得された基礎行列に基づいて、前記所定数の画像の中から、前記指定された画像にエピポーラ投影するための画像を選別する選別部と、
前記基礎行列取得部によって取得された基礎行列のうち、前記選別部によって選別された画像について取得された基礎行列に基づいて、該選別された画像内の互いに対応する特徴点又は仮想特徴点を前記指定された画像にエピポーラ投影することにより、前記指定された画像内における仮想特徴点を生成する仮想特徴点生成部と、
前記複数の画像の中から前記指定部が指定する画像を変えて、前記指定部、前記基礎行列取得部、前記選別部、及び前記仮想特徴点生成部の処理を繰り返すことにより、仮想特徴点軌道を構築する仮想特徴点軌道構築部と、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道を時間方向に平滑化する平滑化部と、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道と、前記平滑化部によって平滑化された仮想特徴点軌道と、の間の関係に基づいて、前記複数の画像のそれぞれを補正する補正部と、
を備えることを特徴とする画像処理装置。
(Appendix 1)
A designating unit for designating one of a plurality of images constituting the video,
A basic matrix acquisition unit that acquires a basic matrix representing a relationship with the designated image for each of a predetermined number of images other than the image designated by the designation unit of the plurality of images;
A selection unit that selects an image for epipolar projection on the designated image from the predetermined number of images based on the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition unit; ,
Among the basic matrices acquired by the basic matrix acquisition unit, based on the basic matrix acquired for the image selected by the selection unit, the feature points or virtual feature points corresponding to each other in the selected image are A virtual feature point generation unit that generates a virtual feature point in the specified image by performing an epipolar projection on the specified image;
By changing the image designated by the designation unit from the plurality of images and repeating the processing of the designation unit, the basic matrix acquisition unit, the selection unit, and the virtual feature point generation unit, a virtual feature point trajectory A virtual feature point trajectory construction unit for constructing
A smoothing unit that smoothes the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit in the time direction;
Correction that corrects each of the plurality of images based on the relationship between the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit and the virtual feature point trajectory smoothed by the smoothing unit. And
An image processing apparatus comprising:

(付記2)
前記基礎行列取得部によって前記所定数の画像のそれぞれについて取得された基礎行列の類似度を評価する評価部をさらに備え、
前記選別部は、前記評価部による評価結果に基づいて、前記所定数の画像の中から前記指定された画像にエピポーラ投影するための画像を選別する、
ことを特徴とする付記1に記載の画像処理装置。
(Appendix 2)
An evaluation unit that evaluates the similarity of the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition unit;
The selecting unit selects an image for epipolar projection on the designated image from the predetermined number of images based on the evaluation result by the evaluating unit.
The image processing apparatus according to appendix 1, wherein:

(付記3)
前記選別部は、前記評価部による評価の結果、前記所定数の画像の中に互いに類似している2以上の画像がある場合、該2以上の画像のうちのいずれか1つ以外の画像を、前記指定された画像にエピポーラ投影するための画像から除外する、
ことを特徴とする付記2に記載の画像処理装置。
(Appendix 3)
When there are two or more images that are similar to each other in the predetermined number of images as a result of the evaluation by the evaluation unit, the selecting unit selects an image other than any one of the two or more images. Exclude from the image for epipolar projection to the specified image,
The image processing apparatus according to Supplementary Note 2, wherein

(付記4)
前記評価部は、異なる2つの基礎行列の間において、一方の基礎行列を正規化した行列に含まれる各要素と、他方の基礎行列を正規化した行列における対応する要素と、の差分をとった値がいずれも閾値以下である場合に、該2つの基礎行列が類似していると評価する、
ことを特徴とする付記2又は3に記載の画像処理装置。
(Appendix 4)
The evaluation unit takes a difference between each element included in a matrix obtained by normalizing one basic matrix and a corresponding element in a matrix obtained by normalizing the other basic matrix between two different basic matrices. Evaluates that the two base matrices are similar if both values are below a threshold,
The image processing apparatus according to appendix 2 or 3, characterized by the above.

(付記5)
前記評価部は、異なる2つの基礎行列の間において、一方の基礎行列を正規化した行列に含まれる各要素と、他方の基礎行列を正規化した行列における対応する要素と、の差分の2乗和をとった値が閾値以下である場合に、該2つの基礎行列が類似していると評価する、
ことを特徴とする付記2又は3に記載の画像処理装置。
(Appendix 5)
The evaluation unit squares a difference between each element included in a matrix obtained by normalizing one basic matrix and a corresponding element in a matrix obtained by normalizing the other basic matrix between two different basic matrices. If the sum is less than or equal to the threshold, the two base matrices are evaluated as being similar,
The image processing apparatus according to appendix 2 or 3, characterized by the above.

(付記6)
付記1乃至5の何れか1つに記載の画像処理装置と、
被写体を撮像することにより、前記動画を構成する画像を生成する撮像部と、
を備えることを特徴とする撮像装置。
(Appendix 6)
The image processing apparatus according to any one of appendices 1 to 5,
An imaging unit that generates an image constituting the moving image by imaging a subject;
An imaging apparatus comprising:

(付記7)
動画を構成する複数の画像の中から1つを指定する指定処理と、
前記複数の画像のうちの前記指定処理によって指定された画像以外の所定数の画像のそれぞれについて、該指定された画像との関係を表す基礎行列を取得する基礎行列取得処理と、
前記基礎行列取得処理によって前記所定数の画像のそれぞれについて取得された基礎行列に基づいて、前記所定数の画像の中から、前記指定された画像にエピポーラ投影するための画像を選別する選別処理と、
前記基礎行列取得処理によって取得された基礎行列のうち、前記選別処理によって選別された画像について取得された基礎行列に基づいて、該選別された画像内の互いに対応する特徴点又は仮想特徴点を前記指定された画像にエピポーラ投影することにより、前記指定された画像内における仮想特徴点を生成する仮想特徴点生成処理と、
前記複数の画像の中から前記指定処理が指定する画像を変えて、前記指定処理、前記基礎行列取得処理、前記選別処理、及び前記仮想特徴点生成処理を繰り返すことにより、仮想特徴点軌道を構築する仮想特徴点軌道構築処理と、
前記仮想特徴点軌道構築処理によって構築された仮想特徴点軌道を時間方向に平滑化する平滑化処理と、
前記仮想特徴点軌道構築処理によって構築された仮想特徴点軌道と、前記平滑化部によって平滑化された仮想特徴点軌道と、の間の関係に基づいて、前記複数の画像のそれぞれを補正する補正処理と、
を含むことを特徴とする画像処理方法。
(Appendix 7)
A designation process for designating one of a plurality of images constituting a movie;
A basic matrix acquisition process for acquiring a basic matrix representing a relationship with the specified image for each of a predetermined number of images other than the image specified by the specifying process among the plurality of images;
A selection process for selecting an image for epipolar projection on the designated image from the predetermined number of images based on the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition process; ,
Among the basic matrices acquired by the basic matrix acquisition process, based on the basic matrix acquired for the image selected by the selection process, the feature points or virtual feature points corresponding to each other in the selected image are A virtual feature point generation process for generating a virtual feature point in the specified image by performing an epipolar projection on the specified image;
A virtual feature point trajectory is constructed by changing the image designated by the designation processing from the plurality of images and repeating the designation processing, the basic matrix acquisition processing, the selection processing, and the virtual feature point generation processing. Virtual feature point trajectory construction processing,
Smoothing processing for smoothing the virtual feature point trajectory constructed by the virtual feature point trajectory construction processing in the time direction;
Correction that corrects each of the plurality of images based on the relationship between the virtual feature point trajectory constructed by the virtual feature point trajectory construction process and the virtual feature point trajectory smoothed by the smoothing unit. Processing,
An image processing method comprising:

(付記8)
コンピュータを、
動画を構成する複数の画像の中から1つを指定する指定部、
前記複数の画像のうちの前記指定部によって指定された画像以外の所定数の画像のそれぞれについて、該指定された画像との関係を表す基礎行列を取得する基礎行列取得部、
前記基礎行列取得部によって前記所定数の画像のそれぞれについて取得された基礎行列に基づいて、前記所定数の画像の中から、前記指定された画像にエピポーラ投影するための画像を選別する選別部、
前記基礎行列取得部によって取得された基礎行列のうち、前記選別部によって選別された画像について取得された基礎行列に基づいて、該選別された画像内の互いに対応する特徴点又は仮想特徴点を前記指定された画像にエピポーラ投影することにより、前記指定された画像内における仮想特徴点を生成する仮想特徴点生成部、
前記複数の画像の中から前記指定部が指定する画像を変えて、前記指定部、前記基礎行列取得部、前記選別部、及び前記仮想特徴点生成部の処理を繰り返すことにより、仮想特徴点軌道を構築する仮想特徴点軌道構築部、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道を時間方向に平滑化する平滑化部、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道と、前記平滑化部によって平滑化された仮想特徴点軌道と、の間の関係に基づいて、前記複数の画像のそれぞれを補正する補正部、
として機能させることを特徴とするプログラム。
(Appendix 8)
Computer
A designating part for designating one of a plurality of images constituting the video,
A basic matrix acquisition unit that acquires a basic matrix representing a relationship with the designated image for each of a predetermined number of images other than the image designated by the designation unit among the plurality of images;
Based on the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition unit, a selection unit that selects an image for epipolar projection on the specified image from the predetermined number of images,
Among the basic matrices acquired by the basic matrix acquisition unit, based on the basic matrix acquired for the image selected by the selection unit, the feature points or virtual feature points corresponding to each other in the selected image are A virtual feature point generation unit that generates a virtual feature point in the specified image by performing an epipolar projection on the specified image;
By changing the image designated by the designation unit from the plurality of images and repeating the processing of the designation unit, the basic matrix acquisition unit, the selection unit, and the virtual feature point generation unit, a virtual feature point trajectory A virtual feature point trajectory construction unit,
A smoothing unit that smoothes the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit in the time direction;
Correction that corrects each of the plurality of images based on the relationship between the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit and the virtual feature point trajectory smoothed by the smoothing unit. Part,
A program characterized by functioning as

1…撮像装置、10…撮像部、11…光学レンズ、12…イメージセンサ、20…データ処理部、21…主記憶部、22…出力部、23…外部記憶部、24…CPU、30…ユーザインタフェース部、31…表示部、32…操作部、33…外部インタフェース、100…画像処理装置、101…指定部、102…基礎行列取得部、102a…オプティカルフロー取得部、103…選別部、104…仮想特徴点生成部、105…仮想特徴点軌道構築部、106…平滑化部、107…補正部、108…評価部 DESCRIPTION OF SYMBOLS 1 ... Imaging device, 10 ... Imaging part, 11 ... Optical lens, 12 ... Image sensor, 20 ... Data processing part, 21 ... Main memory part, 22 ... Output part, 23 ... External storage part, 24 ... CPU, 30 ... User Interface unit 31 ... Display unit 32 ... Operation unit 33 ... External interface 100 ... Image processing apparatus 101 ... Designation unit 102 ... Basic matrix acquisition unit 102a ... Optical flow acquisition unit 103 ... Selection unit 104 ... Virtual feature point generation unit 105 ... Virtual feature point trajectory construction unit 106 106 Smoothing unit 107 107 Correction unit 108 Evaluation unit

Claims (8)

動画を構成する複数の画像の中から1つを指定する指定部と、
前記複数の画像のうちの前記指定部によって指定された画像以外の所定数の画像のそれぞれについて、該指定された画像との関係を表す基礎行列を取得する基礎行列取得部と、
前記基礎行列取得部によって前記所定数の画像のそれぞれについて取得された基礎行列に基づいて、前記所定数の画像の中から、前記指定された画像にエピポーラ投影するための画像を選別する選別部と、
前記基礎行列取得部によって取得された基礎行列のうち、前記選別部によって選別された画像について取得された基礎行列に基づいて、該選別された画像内の互いに対応する特徴点又は仮想特徴点を前記指定された画像にエピポーラ投影することにより、前記指定された画像内における仮想特徴点を生成する仮想特徴点生成部と、
前記複数の画像の中から前記指定部が指定する画像を変えて、前記指定部、前記基礎行列取得部、前記選別部、及び前記仮想特徴点生成部の処理を繰り返すことにより、仮想特徴点軌道を構築する仮想特徴点軌道構築部と、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道を時間方向に平滑化する平滑化部と、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道と、前記平滑化部によって平滑化された仮想特徴点軌道と、の間の関係に基づいて、前記複数の画像のそれぞれを補正する補正部と、
を備えることを特徴とする画像処理装置。
A designating unit for designating one of a plurality of images constituting the video,
A basic matrix acquisition unit that acquires a basic matrix representing a relationship with the designated image for each of a predetermined number of images other than the image designated by the designation unit of the plurality of images;
A selection unit that selects an image for epipolar projection on the designated image from the predetermined number of images based on the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition unit; ,
Among the basic matrices acquired by the basic matrix acquisition unit, based on the basic matrix acquired for the image selected by the selection unit, the feature points or virtual feature points corresponding to each other in the selected image are A virtual feature point generation unit that generates a virtual feature point in the specified image by performing an epipolar projection on the specified image;
By changing the image designated by the designation unit from the plurality of images and repeating the processing of the designation unit, the basic matrix acquisition unit, the selection unit, and the virtual feature point generation unit, a virtual feature point trajectory A virtual feature point trajectory construction unit for constructing
A smoothing unit that smoothes the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit in the time direction;
Correction that corrects each of the plurality of images based on the relationship between the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit and the virtual feature point trajectory smoothed by the smoothing unit. And
An image processing apparatus comprising:
前記基礎行列取得部によって前記所定数の画像のそれぞれについて取得された基礎行列の類似度を評価する評価部をさらに備え、
前記選別部は、前記評価部による評価結果に基づいて、前記所定数の画像の中から前記指定された画像にエピポーラ投影するための画像を選別する、
ことを特徴とする請求項1に記載の画像処理装置。
An evaluation unit that evaluates the similarity of the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition unit;
The sorting unit sorts an image for epipolar projection on the designated image from the predetermined number of images based on the evaluation result by the evaluation unit.
The image processing apparatus according to claim 1.
前記選別部は、前記評価部による評価の結果、前記所定数の画像の中に互いに類似している2以上の画像がある場合、該2以上の画像のうちのいずれか1つ以外の画像を、前記指定された画像にエピポーラ投影するための画像から除外する、
ことを特徴とする請求項2に記載の画像処理装置。
When there are two or more images that are similar to each other in the predetermined number of images as a result of the evaluation by the evaluation unit, the selecting unit selects an image other than any one of the two or more images. Exclude from the image for epipolar projection to the specified image,
The image processing apparatus according to claim 2.
前記評価部は、異なる2つの基礎行列の間において、一方の基礎行列を正規化した行列に含まれる各要素と、他方の基礎行列を正規化した行列における対応する要素と、の差分をとった値がいずれも閾値以下である場合に、該2つの基礎行列が類似していると評価する、
ことを特徴とする請求項2又は3に記載の画像処理装置。
The evaluation unit takes a difference between each element included in a matrix obtained by normalizing one basic matrix and a corresponding element in a matrix obtained by normalizing the other basic matrix between two different basic matrices. Evaluates that the two base matrices are similar if both values are below a threshold,
The image processing apparatus according to claim 2, wherein the image processing apparatus is an image processing apparatus.
前記評価部は、異なる2つの基礎行列の間において、一方の基礎行列を正規化した行列に含まれる各要素と、他方の基礎行列を正規化した行列における対応する要素と、の差分の2乗和をとった値が閾値以下である場合に、該2つの基礎行列が類似していると評価する、
ことを特徴とする請求項2又は3に記載の画像処理装置。
The evaluation unit squares a difference between each element included in a matrix obtained by normalizing one basic matrix and a corresponding element in a matrix obtained by normalizing the other basic matrix between two different basic matrices. If the sum is less than or equal to the threshold, the two base matrices are evaluated as being similar,
The image processing apparatus according to claim 2, wherein the image processing apparatus is an image processing apparatus.
請求項1乃至5の何れか1項に記載の画像処理装置と、
被写体を撮像することにより、前記動画を構成する画像を生成する撮像部と、
を備えることを特徴とする撮像装置。
An image processing apparatus according to any one of claims 1 to 5,
An imaging unit that generates an image constituting the moving image by imaging a subject;
An imaging apparatus comprising:
動画を構成する複数の画像の中から1つを指定する指定処理と、
前記複数の画像のうちの前記指定処理によって指定された画像以外の所定数の画像のそれぞれについて、該指定された画像との関係を表す基礎行列を取得する基礎行列取得処理と、
前記基礎行列取得処理によって前記所定数の画像のそれぞれについて取得された基礎行列に基づいて、前記所定数の画像の中から、前記指定された画像にエピポーラ投影するための画像を選別する選別処理と、
前記基礎行列取得処理によって取得された基礎行列のうち、前記選別処理によって選別された画像について取得された基礎行列に基づいて、該選別された画像内の互いに対応する特徴点又は仮想特徴点を前記指定された画像にエピポーラ投影することにより、前記指定された画像内における仮想特徴点を生成する仮想特徴点生成処理と、
前記複数の画像の中から前記指定処理が指定する画像を変えて、前記指定処理、前記基礎行列取得処理、前記選別処理、及び前記仮想特徴点生成処理を繰り返すことにより、仮想特徴点軌道を構築する仮想特徴点軌道構築処理と、
前記仮想特徴点軌道構築処理によって構築された仮想特徴点軌道を時間方向に平滑化する平滑化処理と、
前記仮想特徴点軌道構築処理によって構築された仮想特徴点軌道と、前記平滑化部によって平滑化された仮想特徴点軌道と、の間の関係に基づいて、前記複数の画像のそれぞれを補正する補正処理と、
を含むことを特徴とする画像処理方法。
A designation process for designating one of a plurality of images constituting a movie;
A basic matrix acquisition process for acquiring a basic matrix representing a relationship with the specified image for each of a predetermined number of images other than the image specified by the specifying process among the plurality of images;
A selection process for selecting an image for epipolar projection on the designated image from the predetermined number of images based on the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition process; ,
Among the basic matrices acquired by the basic matrix acquisition process, based on the basic matrix acquired for the image selected by the selection process, the feature points or virtual feature points corresponding to each other in the selected image are A virtual feature point generation process for generating a virtual feature point in the specified image by performing an epipolar projection on the specified image;
A virtual feature point trajectory is constructed by changing the image designated by the designation processing from the plurality of images and repeating the designation processing, the basic matrix acquisition processing, the selection processing, and the virtual feature point generation processing. Virtual feature point trajectory construction processing,
Smoothing processing for smoothing the virtual feature point trajectory constructed by the virtual feature point trajectory construction processing in the time direction;
Correction that corrects each of the plurality of images based on the relationship between the virtual feature point trajectory constructed by the virtual feature point trajectory construction process and the virtual feature point trajectory smoothed by the smoothing unit. Processing,
An image processing method comprising:
コンピュータを、
動画を構成する複数の画像の中から1つを指定する指定部、
前記複数の画像のうちの前記指定部によって指定された画像以外の所定数の画像のそれぞれについて、該指定された画像との関係を表す基礎行列を取得する基礎行列取得部、
前記基礎行列取得部によって前記所定数の画像のそれぞれについて取得された基礎行列に基づいて、前記所定数の画像の中から、前記指定された画像にエピポーラ投影するための画像を選別する選別部、
前記基礎行列取得部によって取得された基礎行列のうち、前記選別部によって選別された画像について取得された基礎行列に基づいて、該選別された画像内の互いに対応する特徴点又は仮想特徴点を前記指定された画像にエピポーラ投影することにより、前記指定された画像内における仮想特徴点を生成する仮想特徴点生成部、
前記複数の画像の中から前記指定部が指定する画像を変えて、前記指定部、前記基礎行列取得部、前記選別部、及び前記仮想特徴点生成部の処理を繰り返すことにより、仮想特徴点軌道を構築する仮想特徴点軌道構築部、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道を時間方向に平滑化する平滑化部、
前記仮想特徴点軌道構築部によって構築された仮想特徴点軌道と、前記平滑化部によって平滑化された仮想特徴点軌道と、の間の関係に基づいて、前記複数の画像のそれぞれを補正する補正部、
として機能させることを特徴とするプログラム。
Computer
A designating part for designating one of a plurality of images constituting the video,
A basic matrix acquisition unit that acquires a basic matrix representing a relationship with the designated image for each of a predetermined number of images other than the image designated by the designation unit among the plurality of images;
Based on the basic matrix acquired for each of the predetermined number of images by the basic matrix acquisition unit, a selection unit that selects an image for epipolar projection on the specified image from the predetermined number of images,
Among the basic matrices acquired by the basic matrix acquisition unit, based on the basic matrix acquired for the image selected by the selection unit, the feature points or virtual feature points corresponding to each other in the selected image are A virtual feature point generation unit that generates a virtual feature point in the specified image by performing an epipolar projection on the specified image;
By changing the image designated by the designation unit from the plurality of images and repeating the processing of the designation unit, the basic matrix acquisition unit, the selection unit, and the virtual feature point generation unit, a virtual feature point trajectory A virtual feature point trajectory construction unit,
A smoothing unit that smoothes the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit in the time direction;
Correction that corrects each of the plurality of images based on the relationship between the virtual feature point trajectory constructed by the virtual feature point trajectory construction unit and the virtual feature point trajectory smoothed by the smoothing unit. Part,
A program characterized by functioning as
JP2014258378A 2014-12-22 2014-12-22 Image processing apparatus, imaging apparatus, image processing method, and program Active JP6421587B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014258378A JP6421587B2 (en) 2014-12-22 2014-12-22 Image processing apparatus, imaging apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014258378A JP6421587B2 (en) 2014-12-22 2014-12-22 Image processing apparatus, imaging apparatus, image processing method, and program

Publications (3)

Publication Number Publication Date
JP2016119580A true JP2016119580A (en) 2016-06-30
JP2016119580A5 JP2016119580A5 (en) 2018-01-25
JP6421587B2 JP6421587B2 (en) 2018-11-14

Family

ID=56243224

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014258378A Active JP6421587B2 (en) 2014-12-22 2014-12-22 Image processing apparatus, imaging apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP6421587B2 (en)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
AMIT GOLDSTEIN AND RAANAN FATTAL: "Video Stabilization Using Epipolar Geometry", ACM TRANSACTIONS ON GRAPHICS, vol. Vol.31, No.5, Article 126, JPN7018003226, August 2012 (2012-08-01) *

Also Published As

Publication number Publication date
JP6421587B2 (en) 2018-11-14

Similar Documents

Publication Publication Date Title
JP5980294B2 (en) Data processing apparatus, imaging apparatus, and data processing method
CN106257910B (en) Image processing apparatus, image processing method, and recording medium
KR20180019709A (en) Distortion correction method and terminal
CN112019768A (en) Video generation method and device and electronic equipment
CN110611767B (en) Image processing method and device and electronic equipment
JP2019215622A5 (en)
US20160379052A1 (en) Image processing apparatus, display state determination apparatus, and image processing method
JP2022500792A (en) Image processing methods and devices, electronic devices and storage media
JP2008217526A (en) Image processor, image processing program, and image processing method
KR20160066425A (en) Method and apparatus for blurring an image
US11625816B2 (en) Learning device, image generation device, learning method, image generation method, and program
JP2019096222A (en) Image processor, method for processing image, and computer program
JP6451300B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
CN103685854A (en) Image processing apparatus, image processing method, and program
JP6221333B2 (en) Image processing apparatus, image processing circuit, and image processing method
JP6421587B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
US9270883B2 (en) Image processing apparatus, image pickup apparatus, image pickup system, image processing method, and non-transitory computer-readable storage medium
JP6369461B2 (en) Image processing apparatus, image processing method, and program
JP6952298B2 (en) Line-of-sight conversion device and line-of-sight conversion method
JP6155349B2 (en) Method, apparatus and computer program product for reducing chromatic aberration in deconvolved images
US20170163903A1 (en) Method and electronic device for processing image
JP2006285655A (en) Image processor, image processing method and image processing program
US9454801B2 (en) Image processing apparatus, method for processing image, and program
US11202000B2 (en) Learning apparatus, image generation apparatus, learning method, image generation method, and program
US11900258B2 (en) Learning device, image generating device, learning method, image generating method, and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171207

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20171207

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180910

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180918

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181001

R150 Certificate of patent or registration of utility model

Ref document number: 6421587

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150