JP6854629B2 - Image processing device, image processing method - Google Patents
Image processing device, image processing method Download PDFInfo
- Publication number
- JP6854629B2 JP6854629B2 JP2016228295A JP2016228295A JP6854629B2 JP 6854629 B2 JP6854629 B2 JP 6854629B2 JP 2016228295 A JP2016228295 A JP 2016228295A JP 2016228295 A JP2016228295 A JP 2016228295A JP 6854629 B2 JP6854629 B2 JP 6854629B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- optical flow
- image processing
- difference
- 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.)
- Active
Links
Images
Landscapes
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
本発明は、画像間のオプティカルフローを求めるための技術に関するものである。 The present invention relates to a technique for obtaining an optical flow between images.
近年、画像間の各画素の対応付けを行う技術の重要性が高まっている。対応とは、基準画像の画素と同一であるとみなす参照画像の画素との関係であり、二点の座標で表現できる。ステレオ画像や多視点画像を入力した場合は、画素の対応関係から被写体の奥行きを算出できるため、3次元画像処理に応用することも可能である。また、連続して撮像された画像(動画)を入力し、その対応関係を相対座標として表現すれば、それは動きベクトルとなる。画素ごとの動きベクトル(以下オプティカルフローと称する)を利用することによって、動体追跡、動画の防振などが可能となる。 In recent years, the importance of a technique for associating each pixel between images has increased. Correspondence is the relationship with the pixels of the reference image which are considered to be the same as the pixels of the reference image, and can be expressed by the coordinates of two points. When a stereo image or a multi-viewpoint image is input, the depth of the subject can be calculated from the correspondence of pixels, so that it can be applied to three-dimensional image processing. Further, if images (moving images) captured continuously are input and the correspondence is expressed as relative coordinates, it becomes a motion vector. By using a motion vector for each pixel (hereinafter referred to as an optical flow), it is possible to track a moving object, isolate a moving image, and the like.
オプティカルフローを取得する代表的な手法としては勾配法がある。勾配法では、画素の時空間の輝度変化の方向と大きさから、オプティカルフローを算出する。勾配法は大きく2種類に分けることができる。一つ目の勾配法では、着目画素の周辺の画素は同じ動きであると仮定し、着目画素を中心とするパッチ内の画素の平均的な時空間の輝度変化からオプティカルフローを算出する(以下、パッチベースの手法と呼称する)。二つ目の勾配法では、画素ごとに画像間の輝度差と、オプティカルフローの滑らかさを表す平滑化項を重みづけして加算し、すべての画素で総和をとったものをエネルギーとして、エネルギーを最適化する(以下、エネルギー最適化法と呼称する)。 The gradient method is a typical method for acquiring optical flow. In the gradient method, the optical flow is calculated from the direction and magnitude of the spatiotemporal luminance change of the pixel. The gradient method can be roughly divided into two types. In the first gradient method, it is assumed that the pixels around the pixel of interest have the same movement, and the optical flow is calculated from the average spatiotemporal brightness change of the pixels in the patch centered on the pixel of interest (hereinafter). , Called a patch-based method). In the second gradient method, the brightness difference between images and the smoothing term representing the smoothness of the optical flow are weighted and added for each pixel, and the sum of all the pixels is used as energy. (Hereinafter referred to as energy optimization method).
パッチベースの手法の代表的なものには、非特許文献1に記載のLucas Kanade法(以下、LK法と呼称する)があり、特許文献1でも同様の考え方が用いられている。特許文献2では、エネルギー最適化法が用いられている。 A typical patch-based method is the Lucas-Kanade method (hereinafter referred to as the LK method) described in Non-Patent Document 1, and the same concept is used in Patent Document 1. In Patent Document 2, an energy optimization method is used.
しかしながら、特許文献2に代表されるエネルギー最適化法では、エネルギー最適化のための反復計算が必要となり、演算量が増大するという課題がある。一方、非特許文献1に代表されるパッチベースの手法では、反復計算が不要なため、高速にオプティカルフローを推定できる。しかし、拘束条件が明確に考慮されていないため、正解値から外れたフローベクトルが推定される可能性が高くなり、推定が不安定になるという課題がある。 However, the energy optimization method represented by Patent Document 2 requires iterative calculation for energy optimization, and has a problem that the amount of calculation increases. On the other hand, the patch-based method represented by Non-Patent Document 1 does not require iterative calculation, so that the optical flow can be estimated at high speed. However, since the constraint conditions are not clearly considered, there is a high possibility that a flow vector deviating from the correct answer value is estimated, and there is a problem that the estimation becomes unstable.
特許文献1の手法は、階層処理の中で、推定したオプティカルフローを平滑化するようパッチベースの手法を改良したものである。このことにより、正解から外れたフローベクトルの出現を抑制できるが、テクスチャが少ない領域では、推定値が不安定になるという課題がある。 The method of Patent Document 1 is an improvement of the patch-based method so as to smooth the estimated optical flow in the hierarchical processing. As a result, the appearance of the flow vector deviating from the correct answer can be suppressed, but there is a problem that the estimated value becomes unstable in the region where the texture is small.
本発明はこのような問題に鑑みてなされたものであり、少ない演算量で高精度にオプティカルフローを推定するための技術を提供する。 The present invention has been made in view of such a problem, and provides a technique for estimating an optical flow with high accuracy with a small amount of calculation.
本発明の一様態は、第1の画像及び該第1の画像を規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第1の集合と、第2の画像及び該第2の画像を前記規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第2の集合と、を取得する取得手段と、前記第2の集合に属する画像を画像サイズが小さい順に選択する選択手段と、前記選択手段が今回選択した選択画像の各画素を、前記選択手段が前回選択した画像に対応するオプティカルフローを該選択画像のサイズに応じて変換した変換済みオプティカルフローに従って移動させた移動済み選択画像を生成する生成手段と、前記第1の集合に属する画像のうち前記選択画像と同サイズの画像と前記移動済み選択画像との差分である第1の差分と、前記変換済みオプティカルフローと該変換済みオプティカルフローに対して平滑化処理を施した処理済みオプティカルフローとの差分である第2の差分と、に基づく評価値を極小化するオプティカルフローを、前記選択画像に対応するオプティカルフローとして求める計算手段と、前記計算手段が求めた、前記第2の画像に対応するオプティカルフローを出力する出力手段とを備えることを特徴とする。 The uniformity of the present invention comprises a first set of elements of a first image and a plurality of reduced images obtained by recursively reducing the first image at a specified reduction ratio, a second image, and the second image. A second set having a plurality of reduced images recursively reduced at the specified reduction rate, an acquisition means for acquiring the image, and an image belonging to the second set are selected in ascending order of image size. The selection means to be selected and each pixel of the selected image selected by the selection means this time are moved according to the converted optical flow obtained by converting the optical flow corresponding to the image previously selected by the selection means according to the size of the selected image. The generation means for generating the moved selected image, the first difference between the image belonging to the first set and the image having the same size as the selected image and the moved selected image, and the converted image. The second difference, which is the difference between the optical flow and the processed optical flow obtained by smoothing the converted optical flow, and the optical flow that minimizes the evaluation value based on the second difference correspond to the selected image. It is characterized by including a calculation means obtained as an optical flow and an output means for outputting the optical flow corresponding to the second image obtained by the calculation means.
本発明の構成によれば、少ない演算量で高精度にオプティカルフローを推定することができる。 According to the configuration of the present invention, the optical flow can be estimated with high accuracy with a small amount of calculation.
以下、添付図面を参照し、本発明の実施形態について説明する。なお、以下説明する実施形態は、本発明を具体的に実施した場合の一例を示すもので、特許請求の範囲に記載した構成の具体的な実施例の1つである。 Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In addition, the embodiment described below shows an example when the present invention is concretely implemented, and is one of the specific examples of the configuration described in the claims.
[第1の実施形態]
本実施形態では、次のような構成を有する画像処理装置の一例について説明する。この画像処理装置は、第1の画像及び該第1の画像を規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第1の集合と、第2の画像及び該第2の画像を上記規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第2の集合と、を取得する。そして画像処理装置は、第2の集合に属する画像を画像サイズが小さい順に選択する。そして画像処理装置は、今回選択した選択画像の各画素を、前回選択した画像に対応するオプティカルフローを該選択画像のサイズに応じて変換した変換済みオプティカルフローに従って移動させた移動済み選択画像を生成する。そして画像処理装置は、第1の集合に属する画像のうち選択画像と同サイズの画像と移動済み選択画像との差分である第1の差分と、変換済みオプティカルフローと該変換済みオプティカルフローに対して平滑化処理を施した処理済みオプティカルフローとの差分である第2の差分と、に基づく評価値を極小化するオプティカルフローを、選択画像に対応するオプティカルフローとして求める(計算)。そして画像処理装置は、この計算により求めた、第2の画像に対応するオプティカルフローを出力する。
[First Embodiment]
In this embodiment, an example of an image processing apparatus having the following configuration will be described. This image processing device includes a first set having a first image and a plurality of reduced images recursively reduced at a predetermined reduction ratio as elements, a second image, and the second image. A second set having a plurality of reduced images obtained by recursively reducing the images at the above-specified reduction ratio is acquired. Then, the image processing device selects the images belonging to the second set in ascending order of image size. Then, the image processing device generates a moved selected image in which each pixel of the selected image selected this time is moved according to the converted optical flow in which the optical flow corresponding to the previously selected image is converted according to the size of the selected image. To do. Then, the image processing device relates to the first difference, which is the difference between the image having the same size as the selected image and the moved selected image among the images belonging to the first set, and the converted optical flow and the converted optical flow. The second difference, which is the difference from the processed optical flow that has undergone the smoothing process, and the optical flow that minimizes the evaluation value based on the difference are obtained as the optical flow corresponding to the selected image (calculation). Then, the image processing device outputs the optical flow corresponding to the second image obtained by this calculation.
先ず、本実施形態を含む以下の各実施形態において用いる様々な定義について説明する。以下の説明における「オプティカルフロー」(以下、OFと称する場合がある)とは、基準画像に対する対象画像の動きベクトルを画素毎に登録したマップ画像である。つまり、オプティカルフローは対象画像と同じ解像度(縦横の画素数)を有し、対象画像の各画素に対応するオプティカルフローの要素は二次元ベクトルとなっている。 First, various definitions used in each of the following embodiments including the present embodiment will be described. The "optical flow" (hereinafter, may be referred to as OF) in the following description is a map image in which the motion vector of the target image with respect to the reference image is registered for each pixel. That is, the optical flow has the same resolution (the number of pixels in the vertical and horizontal directions) as the target image, and the element of the optical flow corresponding to each pixel of the target image is a two-dimensional vector.
以下では、画像をIと表記した場合、該画像上の画素位置(x、y)における画素値はI(x,y)と表記する。オプティカルフローにおいて、基準画像I上の画素位置(x、y)に対応する要素は(u(x,y),v(x,y))と表記する。u(x,y)は、基準画像Iの画素位置(x、y)に対応する動きベクトルの水平方向成分(X成分)を表し、v(x,y)は、基準画像Iの画素位置(x、y)に対応する動きベクトルの垂直方向成分(Y成分)を表している。 In the following, when the image is expressed as I, the pixel value at the pixel position (x, y) on the image is expressed as I (x, y). In the optical flow, the element corresponding to the pixel position (x, y) on the reference image I is expressed as (u (x, y), v (x, y)). u (x, y) represents the pixel position of the reference image I (x, y) the horizontal component (X component) of the motion vector corresponding to, v (x, y) is the pixel position of the reference image I ( It represents the vertical component (Y component) of the motion vector corresponding to x, y).
オプティカルフローについて図2を例にとり説明する。図2では、画像201に対する画像202のオプティカルフローについて説明する。画像201は、人物203が移動しているシーンを撮像装置を動かしながら撮像した動画像中のN(Nは1以上の整数)フレーム目の画像であり、画像202は該動画像における(N+N’)(N’は1以上の整数)フレーム目の画像である。画像201及び画像202には被写体として人物203と家204とが含まれている。動きベクトル205は、画像201中の人物203から画像202中の人物203への動きベクトルを表しており、動きベクトル206は、画像201中の家204から画像202中の家204への動きベクトルを表している。一般的に、画像中の人物203(家204)の領域を構成するそれぞれの画素に対する動きベクトルは全く同じではないが、図2では説明を簡単にするために、オブジェクト内の各画素の動きベクトルは全て同じであるものとする。つまり図2では、画像201中の人物203の領域内の各画素の動きベクトルは全て動きベクトル205とし、画像201中の家204の領域内の各画素の動きベクトルは全てベクトル206としている。ここで、動きベクトル205の成分を(10,5)、動きベクトル206の成分を(−5,0)とする。このとき、画像201上の画素位置(x、y)が人物203の領域に含まれている場合、画像201に対するオプティカルフローにおいて画素位置(x、y)に対応する要素(u(x,y),v(x,y))=(10,5)となる。また、画像201上の画素位置(x、y)が家204の領域に含まれている場合、画像201に対するオプティカルフローにおいて画素位置(x、y)に対応する要素(u(x,y),v(x,y))=(−5,0)となる。なお、画像201上の画素位置(x、y)が背景領域(人物203及び家204以外の領域)に含まれている場合、画像201に対するオプティカルフローにおいて画素位置(x、y)に対応する要素(u(x,y),v(x,y))=(0,0)とする。
The optical flow will be described by taking FIG. 2 as an example. FIG. 2 describes the optical flow of the
本実施形態では、単一の撮像装置において互いに異なる時刻に撮像された第1の画像及び第2の画像(第1の画像の撮像時刻は第2の撮像時刻よりも早い)を取得し、該第1の画像に対する該第2の画像のオプティカルフローを生成する。なお、第1の画像及び第2の画像は単一の撮像装置において互いに異なる時刻に撮像された画像に限らず、複数台の撮像装置において同時刻に撮像された画像であっても良いし、複数台の撮像装置において互いに異なる時刻に撮像された画像であっても良い。 In the present embodiment, the first image and the second image (the imaging time of the first image is earlier than the second imaging time) captured at different times by a single imaging device are acquired, and the image is taken. Generate an optical flow of the second image with respect to the first image. The first image and the second image are not limited to images captured at different times by a single imaging device, and may be images captured at the same time by a plurality of imaging devices. Images may be captured at different times by a plurality of image pickup devices.
次に、本実施形態に係る画像処理装置の機能構成例及びその動作について、画像処理装置の機能構成例を示すブロック図である図3、画像処理装置がオプティカルフローを生成するために行う処理のフローチャートを示す図4、を用いて説明する。なお、図面においてOFはオプティカルフローを表す。また、図4に示したフローチャートに従った処理は、1枚の画像に対するオプティカルフローを求めるための処理である。然るに、例えば、複数枚の画像のそれぞれについてオプティカルフローを求める場合には、該複数の画像のそれぞれについて図4のフローチャートに従った処理を行えばよい。 Next, regarding the functional configuration example of the image processing device and its operation according to the present embodiment, FIG. 3, which is a block diagram showing the functional configuration example of the image processing device, the processing performed by the image processing device to generate the optical flow. This will be described with reference to FIG. 4, which shows a flowchart. In the drawings, OF represents an optical flow. Further, the process according to the flowchart shown in FIG. 4 is a process for obtaining an optical flow for one image. However, for example, when obtaining an optical flow for each of a plurality of images, processing may be performed for each of the plurality of images according to the flowchart of FIG.
ステップS401では、画像データ取得部301は、上記の第1の画像及び第2の画像を取得する。以下では、2枚の画像のみを取得する場合について説明するが、複数枚の画像や動画像を取得しても構わない。画像が3枚以上ある場合や動画像の場合は、対象となる2枚の画像、もしくはフレームを選択して以降の処理を進める。
In step S401, the image
ステップS402では、画像縮小部302は、第1の画像I1を縮小率scale_factor(以下sfと呼称する:0<sf<1)に従って再帰的に縮小して複数枚の縮小画像を生成する。更に画像縮小部302は、第2の画像I2を縮小率sfに従って再帰的に縮小して複数枚の縮小画像を生成する。具体的には、画像縮小部302は先ず、I1及びI2から生成する縮小画像の枚数である最大階層数(max_lv)を取得する。最大階層数max_lvは予め画像処理装置100に設定されていたものであっても良いし、ユーザに入力させても良い。本実施形態では、I1(I2)を縮小率sfに従ってmax_lv回縮小した縮小画像のサイズ(縦及び/又は横サイズ)がI1(I2)のサイズ(縦及び/又は横サイズ)の5%以下となるまで縮小を行うものとした。然るにこの場合、以下の式1に示す如く、max_lv=5となる。
In step S402, the
以下では、I1を縮小率sfに従ってlv(lvは0〜max_lvを満たす整数)回縮小した縮小画像をI1[lv]と表記する。また、I2を縮小率sfに従ってlv回縮小した縮小画像をI2[lv]と表記する。つまり、I1=I1[0]、I2=I2[0]である。I1に対するI1[lv]の縮小率s(I2に対するI2[lv]の縮小率s)は以下の式2で表される。 In the following, a reduced image obtained by reducing I 1 by lv (where lv is an integer satisfying 0 to max_lv) according to the reduction ratio sf is referred to as I 1 [lv]. Further, a reduced image obtained by reducing lv times according reduction ratio sf the I 2 is expressed as I 2 [lv]. That is, I 1 = I 1 [0] and I 2 = I 2 [0]. Reduction ratio of I 1 [lv] for I 1 s (reduction ratio s of I 2 [lv] for I 2) is expressed by the following equation 2.
つまり、I1を縮小率sに従って縮小することでI1[lv]が得られ、I2を縮小率sに従って縮小することでI2[lv]が得られる。以下では一例として、sf=0.5であるものとするが、sfの値は0より大きく1未満であれば如何なる値であっても良い。なお、I1[max_lv](I2[max_lv])のサイズは、画像間の動き検出対象の動きが大きいほど小さく設定すべきであるが、処理時間など様々な要素によって応じて最適な設定をすることが望ましい。また、画像の縮小処理の際には、バイキュービック法を用いても良いし、Lanczos 3−lobed法などの方法を用いてもよい。 That is, I 1 [lv] is obtained by reducing I 1 according to the reduction ratio s, and I 2 [lv] is obtained by reducing I 2 according to the reduction ratio s. In the following, as an example, it is assumed that sf = 0.5, but any value may be used as long as the value of sf is greater than 0 and less than 1. The size of I 1 [max_lv] (I 2 [max_lv]) should be set smaller as the movement of the motion detection target between images is larger, but the optimum setting should be made according to various factors such as the processing time. It is desirable to do. Further, in the image reduction processing, a bicubic method may be used, or a method such as the Lanczos 3-loved method may be used.
ステップS403では、制御部399は、変数lvの値にmax_lvを設定する。以下では、I1[lv]及びI2[lv]を階層lvにおける画像、I1[0]及びI2[0]は最小階層における画像、I1[max_lv]及びI2[max_lv]は最大階層における画像と称する場合がある。
In step S403, the
ステップS404では、制御部399は、lv<max_lvであるか否かを判断する。この判断の結果、lv<max_lvであれば、処理はステップS405に進み、lv=max_lvであれば、処理はステップS408に進む。
In step S404, the
ステップS408では、OF初期化部303は、階層max_lvにおけるオプティカルフローの全ての要素の値を0に初期化する。以下では、階層lvにおけるオプティカルフローをOF[lv]と表記する。OF[lv]の解像度はI1[lv]、I2[lv]の解像度と同じである。そして処理はステップS409に進む。
In step S408, the
一方、ステップS405でOF拡大部307は、最近求めたオプティカルフロー(OF[lv+1])の各要素の値(動きベクトルの成分値)を1/sf倍してから、該オプティカルフローの縦横サイズを1/sf倍に拡大したOF’[lv+1]を生成する。拡大では、RGB画像の拡大においてR、G,Bそれぞれの成分を独立して処理するのと同様に、動きベクトルのX成分、Y成分を独立して処理する。この拡大には、バイリニア補間を用いても良いし、バイキュービック法等の他の方法を採用しても良い。OF[lv+1]における要素u(x,y)、v(x,y)とOF’[lv+1]における要素u’(x,y)、v’(x,y)との関係を以下の式3に示す。
On the other hand, in step S405, the
ステップS406では、画像変形部305は、I2[0]〜I2[max_lv]のうちI2[lv]を選択し、該選択したI2[lv]内の各画素を、OF’[lv+1]に従って移動(ワーピング)させた画像I2w[lv]を生成する。つまり、以下の式4に示す如く、I2[lv]内の画素位置(x、y)における画素を、OF’[lv+1]内のu’(x,y)、v’(x,y)によって規定される動きベクトルの方向に、該動きベクトルの長さだけ移動させた画像I2w[lv]を生成する。 In step S406, the image transforming unit 305 selects I 2 [lv] from I 2 [0] to I 2 [max_lv], and sets each pixel in the selected I 2 [lv] to OF'[lv + 1]. ], The image I 2w [lv] moved (warping) is generated. That is, as shown in the following equation 4, the pixels at the pixel positions (x, y) in I 2 [lv] are the u'(x, y), v'(x, y) in OF'[lv + 1]. The image I 2w [lv] is generated by moving the motion vector in the direction defined by the motion vector by the length of the motion vector.
ステップS407では、OF平滑化部304は、ステップS405で生成したオプティカルフローOF’[lv+1]に対して平滑化フィルタを適用して、平滑化処理済みのオプティカルフローOF”[lv+1]を生成する。平滑化フィルタとしては、例えば、平均フィルタや、ジョイントバイラテラルフィルタなどを用いることができる。ジョイントバイラテラルフィルタを用いる場合は、I1[lv]の画素値を参照することで、被写体境界の再現性を向上させることができる。また、メディアンフィルタなどの非線形フィルタを用いてもよい。つまり、オプティカルフローOF’[lv+1]を平滑化できる手法であれば、如何なる手法を用いても構わない。本実施形態では、フィルタサイズが7x7の平均フィルタを用いてオプティカルフローOF’[lv+1]に対する平滑化処理を行うものとする。
In step S407, the OF smoothing
ステップS409では、エネルギー関数生成部306は、I1[lv]とI2w[lv]との差分である第1の差分と、OF’[lv+1]とOF”[lv+1]との差分である第2の差分と、に基づく関数であるエネルギー関数を生成する。ステップS409における処理の詳細については後述する。
In step S409, the energy
ステップS410では、OF算出部308は、ステップS409で生成したエネルギー関数を極小化するようなオプティカルフローOF[lv]を生成する。ステップS410における処理の詳細については後述する。
In step S410, the OF
ステップS411では、制御部399は、変数lvの値が0であるか否かを判断する。この判断の結果、変数lvの値が0であれば、OF算出部308は、ステップS410で生成したオプティカルフローOF[0]を、画像I1を基準とする画像I2のオプティカルフローとして出力する。OF算出部308によるオプティカルフローOF[0]の出力先については画像処理装置100内のメモリや外部のメモリ、外部の装置など、特定の出力先に限るものではない。そして図4のフローチャートに従った処理は終了する。
In step S411, the
一方、変数lvの値が0ではない場合には、処理はステップS412に進む。ステップS412では、制御部399は、変数lvの値を1つデクリメントし、その後、処理はステップS404に進む。
On the other hand, if the value of the variable lv is not 0, the process proceeds to step S412. In step S412, the
次に、上記のステップS409における処理の詳細について説明する。エネルギー関数を最小化するようにオプティカルフローを推定する方法は、一般的に勾配法と呼ばれる。基本となるのはデータタームと呼ばれる項であり、データタームは以下の式で定義される。 Next, the details of the process in step S409 will be described. The method of estimating the optical flow so as to minimize the energy function is generally called the gradient method. The basis is a term called a data term, and the data term is defined by the following formula.
fは、I1とI2wとの差分を求める関数であり、I1とI2wとの差の絶対値を求める関数であっても良いし、I1とI2wとの差の二乗を求める関数であっても良い。勾配法のエネルギー関数は主に2種類に分類することができる。 f is a function for obtaining the difference between I 1 and I 2w, may be a function for obtaining the absolute value of the difference between I 1 and I 2w, obtains the square of the difference between I 1 and I 2w It may be a function. The energy functions of the gradient method can be classified into two main types.
一つ目は、データタームをあるパッチの範囲で総和をとったものをエネルギー関数と定義するタイプであり、以下の式6で定義される。以下、この手法をパッチベースの手法と呼称する。パッチベースの手法では、画素ごとに以下のエネルギー関数を最小にするオプティカルフローを算出する。 The first is a type in which the sum of data terms in a certain patch range is defined as an energy function, which is defined by the following equation 6. Hereinafter, this method will be referred to as a patch-based method. In the patch-based method, the optical flow that minimizes the following energy function is calculated for each pixel.
ここで、Bは画素位置(x、y)を中心としたパッチ領域を表しており、例えば7×7のパッチを考えた場合、pはx−3からx+3まで、qはy−3からy+3までの整数値をとる。この手法の利点は、ρとして例えば差分2乗を採用した場合、最小となるオプティカルフローを解析的に求めることができる点である。一方で、推定されるオプティカルフローは正解から外れた値になることが多く、高精度に推定することが困難である。 Here, B represents a patch region centered on the pixel position (x, y). For example, when considering a 7 × 7 patch, p is from x-3 to x + 3, and q is from y-3 to y + 3. Takes an integer value up to. The advantage of this method is that the minimum optical flow can be obtained analytically when, for example, the difference square is adopted as ρ. On the other hand, the estimated optical flow often deviates from the correct answer, and it is difficult to estimate it with high accuracy.
二つ目は、上記の問題を解決するために、拘束条件として、オプティカルフローを滑らかにするための平滑化項を追加する。エネルギー関数は以下の式で定義されることが多い。 Second, in order to solve the above problem, a smoothing term for smoothing the optical flow is added as a constraint condition. The energy function is often defined by the following equation.
ここで、λは適当な重み係数であり、∇u,∇vはオプティカルフローの勾配である。パッチベースの手法では、Σはパッチ領域内の和をとっていたが、ここでは全体画素の和をとる。gは平滑化項であり、TVノルムや、L2ノルムを用いることが多い。勾配は、例えば以下の式で算出される。 Here, λ is an appropriate weighting coefficient, and ∇u and ∇v are the gradients of the optical flow. In the patch-based method, Σ is the sum within the patch area, but here it is the sum of all pixels. g is a smoothing term, and a TV norm or an L2 norm is often used. The gradient is calculated by, for example, the following formula.
平滑化項を用いた手法では、式7で表されるような画像全体のエネルギー関数を最小化するように全ての画素のオプティカルフローを最適化する。以下、この手法をエネルギー最適化法と呼称する。エネルギー最適化法は、精度のよいオプティカルフローを求めることができる一方で、最適化を行うために反復計算が必要となり、演算量が増大するという課題がある。 In the method using the smoothing term, the optical flow of all pixels is optimized so as to minimize the energy function of the entire image as represented by Equation 7. Hereinafter, this method is referred to as an energy optimization method. While the energy optimization method can obtain an accurate optical flow, it has a problem that iterative calculation is required to perform the optimization and the amount of calculation increases.
本実施形態では、パッチベースの手法、エネルギー最適化法のそれぞれの問題点に鑑み、パッチベースの手法に擬似的な平滑化項を追加してエネルギー最適化法の考え方を取り入れつつ、パッチベースの手法とほぼ同等の演算量でオプティカルフローを推定する。本実施形態に係るエネルギー関数を以下の式9に示す。 In this embodiment, in view of the problems of the patch-based method and the energy optimization method, a pseudo-smoothing term is added to the patch-based method to incorporate the concept of the energy optimization method, and the patch-based method is used. Estimate the optical flow with almost the same amount of calculation as the method. The energy function according to this embodiment is shown in Equation 9 below.
式9のエネルギー関数は、画素位置(x、y)に対するものである。なお、式9ではφ()についてはパッチ内の総和を計算していないが、ρ()と同様にパッチ内の総和を計算しても良い。式9におけるρ()、φ()を、以下の式10に示す。 The energy function of Equation 9 is for pixel positions (x, y). In Equation 9, the sum in the patch is not calculated for φ (), but the sum in the patch may be calculated in the same manner as in ρ (). Ρ () and φ () in Equation 9 are shown in Equation 10 below.
式10においてp、qは、画素位置(x、y)を中心とするパッチ領域内のx座標値、y座標値を示す。ステップS410では、E(x、y)が極小(最小)となるdu[lv](x、y)、dv[lv](x、y)を、画像I2[lv]に対応するオプティカルフローにおいて、画像I2[lv]中の画素位置(x、y)に対する動きベクトルのX成分及びY成分として求める。 In Equation 10, p and q indicate the x-coordinate value and the y-coordinate value in the patch region centered on the pixel position (x, y). In step S410, du [lv] (x, y) and dv [lv] (x, y) in which E (x, y) becomes the minimum (minimum) are set in the optical flow corresponding to the image I 2 [lv]. , Obtained as the X and Y components of the motion vector with respect to the pixel position (x, y) in the image I 2 [lv].
ρ(p、q)は、画像I2w[lv]中の画素位置(p、q)からdu[lv](x、y)、dv[lv](x、y)によって規定される動きベクトルの分だけ移動させた画素位置の画素値と、画像I1[lv]中の画素位置(p、q)における画素値との差の二乗を表している。なお、ρ()は、差の二乗に限らず、差の絶対値等、「画像I2w[lv]中の画素位置(p、q)からdu[lv](x、y)、dv[lv](x、y)によって規定される動きベクトルの分だけ移動させた画素位置の画素値と、画像I1[lv]中の画素位置(p、q)における画素値との差」を表す様々な式を適用しても構わない。 ρ (p, q) is a motion vector defined by du [lv] (x, y) and dv [lv] (x, y) from the pixel position (p, q) in the image I 2w [lv]. It represents the square of the difference between the pixel value of the pixel position moved by the minute and the pixel value at the pixel position (p, q) in the image I 1 [lv]. Note that ρ () is not limited to the square of the difference, but the absolute value of the difference, etc., is "du [lv] (x, y), dv [lv] from the pixel position (p, q) in the image I 2w [lv]. ] (X, y), the difference between the pixel value of the pixel position moved by the motion vector and the pixel value at the pixel position (p, q) in the image I 1 [lv] ”. Expression may be applied.
式10においてφ(x、y)は、OP’[lv+1]におけるX成分であるu’(x、y)にdu[lv](x、y)を加えたものと、OP”[lv+1]におけるX成分であるuave(x、y)と、の差の二乗と、OP’[lv+1]におけるY成分であるv’(x、y)にdv[lv](x、y)を加えたものと、OP”[lv+1]におけるY成分であるvave(x、y)と、の差の二乗と、の和を表している。なお、φ()は、差の二乗和に限らず、例えば、前者の差の絶対値と後者の差の絶対値との和であっても良い。 In Equation 10, φ (x, y) is the sum of u'(x, y), which is the X component in OP'[lv + 1], plus du [lv] (x, y), and in OP'[lv + 1]. The square of the difference between u ave (x, y), which is the X component, and v'(x, y), which is the Y component in OP'[lv + 1], plus dv [lv] (x, y). It represents the sum of and the square of the difference between v ave (x, y), which is the Y component in OP ”[lv + 1]. Note that φ () is not limited to the sum of squares of differences, and may be, for example, the sum of the absolute value of the former difference and the absolute value of the latter difference.
エネルギー関数にφ()の項を加えることで、uave(x、y)、vave(x、y)はもともとのオプティカルフローに比べて滑らかで、外れ値が抑制された結果となるので、u’とuaveの値が乖離しないように推定値が算出され、この項が平滑化項としての役割を果たす。これはvについても同様である。 By adding the term φ () to the energy function, u ave (x, y) and v ave (x, y) are smoother than the original optical flow, resulting in suppressed outliers. Estimated values are calculated so that the values of u'and u ave do not deviate, and this term serves as a smoothing term. This also applies to v.
上記の式9においてλ=0の場合は、階層型のLucasーKanade法に帰着する。ここで、上記のdu、dvが小さいとして、ρをテイラー展開すると、以下の式11が得られる。 When λ = 0 in the above equation 9, it is reduced to the hierarchical Lucas-Kanade method. Here, assuming that the above du and dv are small, the Taylor expansion of ρ gives the following equation 11.
ここで、I2xwは、式4におけるI2の代わりに画像I2wのx方向の1次偏微分画像、式4におけるI2wの代わりにI2xwを当てはめて計算されるものである。同様に、I2ywは、式4におけるI2の代わりに画像I2wのy方向の1次偏微分画像、式4におけるI2wの代わりにI2ywを当てはめて計算されるものである。画像Iの1次偏微分は、例えば以下の式12で求めることが可能である。 Here, I 2Xw are those calculated by applying 1 Tsugihen differential image in the x direction of the image I 2w instead of I 2 in Formula 4, the I 2Xw instead of I 2w in Equation 4. Similarly, I 2Yw are those calculated by applying 1 Tsugihen differential image in the y direction of the image I 2w instead of I 2 in Formula 4, the I 2Yw instead of I 2w in Equation 4. The first partial differential of the image I can be obtained, for example, by the following equation 12.
それ以外にも、水平、垂直のSobelフィルタなどを作用させて求めてもよい。求めるべき解析解du、dvは以下の連立方程式を満たす。なお、式14、15は階層によらないため、階層表記は省いている。 In addition to that, a horizontal or vertical Sobel filter or the like may be applied to obtain the result. The analytical solutions du and dv to be obtained satisfy the following simultaneous equations. Since equations 14 and 15 do not depend on the hierarchy, the hierarchy notation is omitted.
式13の両辺にAの逆行列をかけることで、du、dvを求めることができる。このように、本実施形態によれば、前の階層のオプティカルフローに対して平滑化した結果と、算出するオプティカルフローとの差分が小さくなるようにエネルギーを極小化することで、演算量を増加させることなく、精度を向上させることができる。 By multiplying both sides of Equation 13 by the inverse matrix of A, du and dv can be obtained. As described above, according to the present embodiment, the amount of calculation is increased by minimizing the energy so that the difference between the smoothed result of the optical flow of the previous layer and the calculated optical flow becomes small. The accuracy can be improved without causing the problem.
[第2の実施形態]
以下では、第1の実施形態との差分について重点的に説明し、以下で特に触れない限りは第1の実施形態と同様であるものとする。第1の実施形態では、エネルギー関数に使用するオプティカルフローは、現階層lvよりも1つ上の階層(lv+1)におけるオプティカルフローを使用した。これに対し、本実施形態では、現フレームよりも1つ前のフレームの画像について求めたオプティカルフローをエネルギー関数に使用する。以下では、現フレームの画像I2に対するオプティカルフローを、該フレームよりも1フレーム前の画像I1について求めたオプティカルフローを使用して求める例について説明する。
[Second Embodiment]
In the following, the differences from the first embodiment will be mainly described, and unless otherwise specified below, the same as the first embodiment. In the first embodiment, the optical flow used for the energy function is the optical flow in the layer (lv + 1) one level higher than the current layer lv. On the other hand, in the present embodiment, the optical flow obtained for the image of the frame immediately before the current frame is used for the energy function. In the following, an example will be described in which the optical flow for the image I 2 of the current frame is obtained by using the optical flow obtained for the image I 1 one frame before the frame.
本実施形態に係る画像処理装置の機能構成例、画像I2に対するオプティカルフローを求めるために画像処理装置100が行う処理について、図5のブロック図、図6のフローチャートを用いて説明する。なお、図5において、図3に示した機能部と同じ機能部には同じ参照番号を付しており、該機能部に係る説明は省略する。また、図6のフローチャートにおいて、図4に示した処理ステップと同じ処理ステップには同じステップ番号を付しており、該処理ステップに係る説明は省略する。なお、図6に示したフローチャートに従った処理は、1枚の画像に対するオプティカルフローを求めるための処理である。然るに、例えば、複数枚の画像のそれぞれについてオプティカルフローを求める場合には、該複数の画像のそれぞれについて図6のフローチャートに従った処理を行えばよい。 An example of the functional configuration of the image processing apparatus according to the present embodiment and the processing performed by the image processing apparatus 100 for obtaining the optical flow for the image I 2 will be described with reference to the block diagram of FIG. 5 and the flowchart of FIG. In FIG. 5, the same functional unit as the functional unit shown in FIG. 3 is assigned the same reference number, and the description relating to the functional unit will be omitted. Further, in the flowchart of FIG. 6, the same processing step as the processing step shown in FIG. 4 is assigned the same step number, and the description relating to the processing step will be omitted. The process according to the flowchart shown in FIG. 6 is a process for obtaining an optical flow for one image. However, for example, when obtaining an optical flow for each of a plurality of images, processing may be performed for each of the plurality of images according to the flowchart of FIG.
ステップS601では、OF変形部501は、画像I1について過去に求めたオプティカルフローを、画像I2のオプティカルフローを生成するためのエネルギー関数に使用する参考オプティカルフローに変換する。この変換方法には様々な方法が考えられる。
In step S601, the
例えば、画像I1について求めたオプティカルフローは、画像I1よりも1フレーム前の画像I0に対する画像I1のオプティカルフローであり、該オプティカルフローの要素は、画像I0からの動きベクトルを表している。ここで、フレーム間の時間間隔が充分に短い場合、画像中のオブジェクトの動きは等速直線運動と見なせるため、画像I1について求めたオプティカルフローの各要素を、該オプティカルフローの要素が示す動きベクトルに従って移動させたものを、上記の参考オプティカルフローとして使用することができる。この移動により、参考オプティカルフローには、動きベクトルが格納されない要素が存在する可能性があるため、そのような要素はフィルタ処理などによって周囲の動きベクトルから穴埋めする。 For example, the optical flow obtained for the image I 1 is the optical flow of the image I 1 with respect to the image I 0 one frame before the image I 1 , and the element of the optical flow represents the motion vector from the image I 0. ing. Here, when the time interval between frames is sufficiently short, the movement of the object in the image can be regarded as a constant velocity linear motion. Therefore, each element of the optical flow obtained for the image I 1 is the movement indicated by the element of the optical flow. The one moved according to the vector can be used as the above reference optical flow. Due to this movement, there may be an element in the reference optical flow in which the motion vector is not stored. Therefore, such an element is filled in from the surrounding motion vector by filtering or the like.
なお、画像I1を基準とした画像I0のオプティカルフローが得られている場合には、このオプティカルフローの要素の符号を逆にしたものを上記の参考オプティカルフローとしても良い。 In the case where the optical flow of the image I 0 relative to the image I 1 has been obtained, those in which the sign of the elements of this optical flow in the opposite may be the above references optical flow.
参考オプティカルフローを得るための処理について、図7を例にとり説明する。画像701〜703はそれぞれ画像I0〜I2であり、何れの画像にも人物203及び家204が含まれている。
Reference The process for obtaining the optical flow will be described by taking FIG. 7 as an example.
画像I0を基準とした画像I1における人物203の動きベクトル713を該動きベクトル713の分だけ移動させた動きベクトルを、画像I1を基準とした画像I2における人物203の動きベクトル707として求める。もし、画像I1を基準とした画像I0における人物203の動きベクトル705が得られている場合には、これを反転させたものを動きベクトル707としても良い。画像I0を基準とした画像I1における家204の動きベクトル704を該動きベクトル704の分だけ移動させた動きベクトルを、画像I1を基準とした画像I2における家204の動きベクトル708として求める。もし、画像I1を基準とした画像I0における家204の動きベクトル706が得られている場合には、これを反転させたものを動きベクトル708としても良い。このようにして求めた動きベクトル707,708が上記の参考オプティカルフローとなる。
By the amount motion vector obtained by the movement of the
図6に戻って、次にステップS602では、OF平滑化部304は、ステップS601で生成した参考オプティカルフローに対して、第1の実施形態で説明したオプティカルフローに対する平滑化処理を行う。
Returning to FIG. 6, next, in step S602, the OF smoothing
ステップS603では、OF縮小部502は、ステップS602で平滑化処理を施した参考オプティカルフローの各要素の値をsflv倍してから、該参考オプティカルフローの縦横サイズをsflv倍に縮小したオプティカルフローを生成する。
In step S603, the
そして以降は、ステップS603で生成したオプティカルフローのu(x,y)、v(x,y)をuave(x,y)、vave(x,y)として使用してエネルギー関数を構成する以外は第1の実施形態と同様である。なお、図6のフローチャートでは、全ての階層について、ステップS603で生成したオプティカルフローのu(x,y)、v(x,y)をuave(x,y)、vave(x,y)として使用してエネルギー関数を構成している。しかし、特定の階層、例えば、最終回層以外の階層については第1の実施形態と同様にしてエネルギー関数を構成し、最終階層については、ステップS603で生成したオプティカルフローのu(x,y)、v(x,y)をuave(x,y)、vave(x,y)として使用してエネルギー関数を構成しても良い。 After that, the u (x, y) and v (x, y) of the optical flow generated in step S603 are used as u ave (x, y) and v ave (x, y) to construct an energy function. Other than that, it is the same as that of the first embodiment. In the flowchart of FIG. 6, u (x, y) and v (x, y) of the optical flow generated in step S603 are set to u ave (x, y) and v ave (x, y) for all layers. To construct an energy function. However, for a specific layer, for example, a layer other than the final layer, the energy function is configured in the same manner as in the first embodiment, and for the final layer, u (x, y) of the optical flow generated in step S603. , V (x, y) may be used as u ave (x, y), v ave (x, y) to construct an energy function.
なお、第1の実施形態と同様に、前の階層のオプティカルフローを平滑化した結果をエネルギー関数に追加してもよい。ステップS603で生成したオプティカルフローのu(x,y)、v(x,y)のそれぞれをuave1(x、y)、vave1(x、y)、OP”[lv+1]におけるX成分、Y成分のそれぞれをuave2(x、y)、vave2(x、y)とすると、エネルギー関数は以下のようになる。 As in the first embodiment, the result of smoothing the optical flow of the previous layer may be added to the energy function. Each of u (x, y) and v (x, y) of the optical flow generated in step S603 is u ave1 (x, y), vave1 (x, y), the X component in OP "[lv + 1], Y. Assuming that each of the components is uave2 (x, y) and vave2 (x, y), the energy function is as follows.
なお、式16ではφ1()、φ2()についてはパッチ内の総和を計算していないが、ρ()と同様にパッチ内の総和を計算しても良い。本実施形態によれば、オプティカルフローの時間的な連続性も考慮しつつ、演算量を抑えて高精度にオプティカルフローを算出することができる。なお、図4,6に示した全てのステップは上記の説明の通り上から順に実行されることに限らず、一部の処理ステップで順番を入れ替えても良いし、一部の処理ステップを並列に実行しても良い。 In Equation 16, the sum in the patch is not calculated for φ 1 () and φ 2 (), but the sum in the patch may be calculated in the same manner as in ρ (). According to this embodiment, it is possible to calculate the optical flow with high accuracy while suppressing the amount of calculation while considering the temporal continuity of the optical flow. Note that all the steps shown in FIGS. 4 and 6 are not limited to being executed in order from the top as described above, and the order may be changed in some processing steps, or some processing steps may be performed in parallel. You may execute it.
[第3の実施形態]
第1,2の実施形態で説明したオプティカルフローの生成処理によって生成されたオプティカルフローは様々な用途に装用できる。オプティカルフローを算出することで、動いている被写体の特定や、カメラが動いている方向を推定することができる。このことにより、被写体の追跡や動画の防振など様々な用途に適用することが可能である。また、撮影した画像や動画に対し、映像効果を付与することも可能である。例えば、撮影した画像に対して、オプティカルフローの方向にブラーを付けることで、動きのある被写体を強調した躍動感のある画像を生成することができる。以下では、動画の防振と、ある特定のフレームに対して動きに基づいたブラーを付与する場合について説明する。
[Third Embodiment]
The optical flow generated by the optical flow generation process described in the first and second embodiments can be worn for various purposes. By calculating the optical flow, it is possible to identify a moving subject and estimate the direction in which the camera is moving. This makes it possible to apply it to various applications such as tracking a subject and vibration isolation of a moving image. It is also possible to add a video effect to the captured image or moving image. For example, by adding a blur in the direction of the optical flow to the captured image, it is possible to generate a dynamic image that emphasizes a moving subject. In the following, vibration isolation of moving images and a case of applying motion-based blur to a specific frame will be described.
動画の防振にオプティカルフローを用いる画像処理装置の機能構成例について、図8のブロック図を用いて説明する。図8の画像処理装置800は、上記の画像処理装置100内に納められた装置であっても良い。
An example of a functional configuration of an image processing device that uses an optical flow for vibration isolation of moving images will be described with reference to the block diagram of FIG. The
OFデータ取得部801は、上記の画像処理装置100が生成して出力したオプティカルフローを取得する。OFデータ取得部801によるオプティカルフローの取得方法については特定の取得方法に限らない。例えば、画像処理装置100から無線若しくは有線のネットワーク、若しくは有線と無線の組み合わせによるネットワークを介してオプティカルフローを取得しても良いし、外部の記憶装置に格納されているオプティカルフローを取得しても良い。
The OF
算出部802は、OFデータ取得部801が取得したオプティカルフローを用いてグローバルモーションを算出する。グローバルモーションとは、画像全体に対して最も支配的な動きの方向であり、一つのベクトルで表される。グローバルモーションは、例えばオプティカルフローのヒストグラムを生成して最頻値を取得することにより算出することが可能である。なお、画像全体の動きを算出することができれば、別の手法で算出しても構わない。
The
平滑部803は、グローバルモーションの時間方向の高周波成分を除去する。これは、時間方向に対する、動画の振動を除去するためである。例えば、時間方向にフーリエ変換して高周波を除去したり、時間方向に平滑化フィルタを作用させることで実現することができる。
The smoothing
防振部804は、各時刻のグローバルモーションに基づいて、画像データ取得部805が取得する各フレームの画像のうち対応する時刻の画像を電子的にシフトして位置合わせする。
The
次に、動きに基づいたブラーを付与する画像処理装置の機能構成例について、図9のブロック図を用いて説明する。図9の画像処理装置900は、上記の画像処理装置100内に納められた装置であっても良い。図9において図8と同じ機能部には同じ参照番号を付しており、該機能部に係る説明は省略する。なお、以下では処理対象の画像を画像1として説明する。
Next, an example of a functional configuration of an image processing device that imparts blur based on movement will be described with reference to the block diagram of FIG. The
画像変形部901は、k=1〜n−1としたとき、OFデータ取得部801が取得したオプティカルフロー内の各要素(動きベクトルの成分)をk/n倍した動きベクトルを用いて、式4に従って画像1をシフトしたシフト画像を生成する。例えば、n=10とすると、k=1〜9に対して、n−1枚分のシフトしたシフト画像を生成する。画像合成部902は、n−1枚の変形画像と画像1とを画素毎に合成した合成画像を生成し、該合成画像の各画素の画素値をnで除算することにより、ブラーが付与された画像を生成する。動きの大きな被写体ほどオプティカルフローベクトルが大きく、静止している被写体は、オプティカルフローベクトルが0になるため、動きが大きいほどブラーが発生した画像が生成される。本実施形態では、nとして固定値を用いたが、画像中のオプティカルフローの長さの最大値から決めてもよい。例えば、オプティカルフローの長さの最大値が50pixであれば、n=50とする。また、ユーザーがブラーの強度を指定できる場合は、強度に応じてオプティカルフローをリスケールし、同様の処理を行ってもよい。例えば、ブラーの効果を強くする場合は、元のオプティカルフローを何倍かして処理を行えばよい。本実施形態によれば、オプティカルフローを用いることで、カメラ機能を高速化・高精度化したり、映像効果を付与することが可能になる。また、異なる撮像装置で同一時刻に撮影された画像の場合は、オプティカルフローから被写体の奥行きを算出することも可能である。
When k = 1 to n-1, the
[第4の実施形態]
図3,5に示した画像処理装置100を構成する各機能部は何れもハードウェアで実装しても良いが、ソフトウェア(コンピュータプログラム)で実装しても良い。後者の場合、このコンピュータプログラムを実行可能なプロセッサを有するコンピュータ装置は、上記の画像処理装置100に適用することができる。画像処理装置100に適用可能なコンピュータ装置のハードウェア構成例について、図1のブロック図を用いて説明する。
[Fourth Embodiment]
Each of the functional units constituting the
CPU101は、RAM102やROM103に格納されているコンピュータプログラムやデータを用いて各種の処理を実行する。これによりCPU101は、コンピュータ装置全体の動作制御を行うと共に、画像処理装置100が行うものとして上述した各処理を実行若しくは制御する。
The
RAM102は、ROM103や記憶部104からロードされたコンピュータプログラムやデータを格納するためのエリアを有する。更にRAM102は、CPU101が各種の処理を実行する際に用いるワークエリアを有する。このようにRAM102は、各種のエリアを適宜提供することができる。ROM103には、書き換え不要の設定データやブートプログラムなどが格納されている。
The
記憶部104は、ハードディスクドライブ装置に代表される大容量情報記憶装置である。記憶部104には、OS(オペレーティングシステム)や、画像処理装置100が行うものとして上述した各処理をCPU101に実行させるためのコンピュータプログラムやデータが保存されている。記憶部104に保存されているコンピュータプログラムには、図3,5に示した各機能部の機能をCPU101に実行させるためのコンピュータプログラムが含まれている。また、記憶部104に保存されているデータには、上記の説明において既知の情報として説明したものや、処理対象となる画像や動画像のデータが含まれている。記憶部104に保存されているコンピュータプログラムやデータは、CPU101による制御に従って適宜RAM102にロードされ、CPU101による処理対象となる。
The
なお、記憶部104としては、ハードディスクドライブ装置以外にも、CD−ROMやDVD−ROM等の記憶媒体から情報を読み取る機器、フラッシュメモリ、USBメモリなどのメモリ装置を適用することもできる。
In addition to the hard disk drive device, the
出力インターフェース106には表示装置109が接続されている。表示装置109は、CRTや液晶画面、プロジェクタ装置などにより構成されており、CPU101による処理結果を画像や文字などでもって表示もしくは投影することができる。
A
CPU101、RAM102、ROM103、記憶部104、出力インターフェース106は何れもバス107に接続されている。なお、図1に示した構成は、画像処理装置100に適用可能なコンピュータ装置の構成の一例に過ぎない。
The
また、図8,9に示した画像処理装置800,900の各機能部についても同様で、何れもハードウェアで実装しても良いが、ソフトウェア(コンピュータプログラム)で実装しても良い。後者の場合、このコンピュータプログラムを実行可能なプロセッサを有するコンピュータ装置は、上記の画像処理装置800,900として機能するので、このコンピュータ装置に図1に示した構成を適用可能であることはいうまでもない。また、画像処理装置800や画像処理装置900を画像処理装置100内に納めた場合には、図1のコンピュータ装置は、画像処理装置800や画像処理装置900の機能をも実現することになる。
The same applies to the functional units of the
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other Examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
301:画像データ取得部 302:画像縮小部 303:OF初期化部 304:OF平滑化部 305:画像変形部 306:エネルギー関数生成部 307:OF拡大部 308:OF算出部 301: Image data acquisition unit 302: Image reduction unit 303: OF initialization unit 304: OF smoothing unit 305: Image deformation unit 306: Energy function generation unit 307: OF enlargement unit 308: OF calculation unit
Claims (11)
前記第2の集合に属する画像を画像サイズが小さい順に選択する選択手段と、
前記選択手段が今回選択した選択画像の各画素を、前記選択手段が前回選択した画像に対応するオプティカルフローを該選択画像のサイズに応じて変換した変換済みオプティカルフローに従って移動させた移動済み選択画像を生成する生成手段と、
前記第1の集合に属する画像のうち前記選択画像と同サイズの画像と前記移動済み選択画像との差分である第1の差分と、前記変換済みオプティカルフローと該変換済みオプティカルフローに対して平滑化処理を施した処理済みオプティカルフローとの差分である第2の差分と、に基づく評価値を極小化するオプティカルフローを、前記選択画像に対応するオプティカルフローとして求める計算手段と、
前記計算手段が求めた、前記第2の画像に対応するオプティカルフローを出力する出力手段と
を備えることを特徴とする画像処理装置。 A first set having a first image and a plurality of reduced images recursively reduced at a specified reduction rate as elements, and a second image and the second image reduced by the specified reduction. A second set whose elements are a plurality of reduced images recursively reduced by a rate, an acquisition means for acquiring, and an acquisition means.
A selection means for selecting images belonging to the second set in ascending order of image size, and
A moved selection image in which each pixel of the selected image selected by the selection means is moved according to a converted optical flow in which the optical flow corresponding to the image previously selected by the selection means is converted according to the size of the selected image. And the generation means to generate
Among the images belonging to the first set, the first difference, which is the difference between the image having the same size as the selected image and the moved selected image, and smoothing with respect to the converted optical flow and the converted optical flow. A calculation means for obtaining the second difference, which is the difference from the processed optical flow that has undergone the conversion process, and the optical flow that minimizes the evaluation value based on the optical flow, as the optical flow corresponding to the selected image.
An image processing apparatus including an output means for outputting an optical flow corresponding to the second image, which is obtained by the calculation means.
前記第2の集合に属する画像を画像サイズが小さい順に選択する選択手段と、
前記選択手段が今回選択した選択画像の各画素を、前記選択手段が前回選択した画像に対応するオプティカルフローを該選択画像のサイズに応じて変換した変換済みオプティカルフローに従って移動させた移動済み選択画像を生成する生成手段と、
前記第1の集合に属する画像のうち前記選択画像と同サイズの画像と前記移動済み選択画像との差分である第1の差分と、前記変換済みオプティカルフローと前記第1の画像に対するオプティカルフローを前記選択画像のサイズに応じて変換してから平滑化処理を施した処理済みオプティカルフローとの差分である第2の差分と、に基づく評価値を極小化するオプティカルフローを、前記選択画像に対応するオプティカルフローとして求める計算手段と、
前記計算手段が求めた、前記第2の画像に対応するオプティカルフローを出力する出力手段と
を備えることを特徴とする画像処理装置。 A first set having a first image and a plurality of reduced images recursively reduced at a specified reduction rate as elements, and a second image and the second image reduced by the specified reduction. A second set whose elements are a plurality of reduced images recursively reduced by a rate, an acquisition means for acquiring, and an acquisition means.
A selection means for selecting images belonging to the second set in ascending order of image size, and
A moved selection image in which each pixel of the selected image selected by the selection means is moved according to a converted optical flow in which the optical flow corresponding to the image previously selected by the selection means is converted according to the size of the selected image. And the generation means to generate
Among the images belonging to the first set, the first difference, which is the difference between the image having the same size as the selected image and the moved selected image, and the converted optical flow and the optical flow for the first image are shown. The second difference, which is the difference from the processed optical flow that has been converted according to the size of the selected image and then smoothed, and the optical flow that minimizes the evaluation value based on the second difference correspond to the selected image. The calculation method to be calculated as the optical flow to be performed,
An image processing apparatus including an output means for outputting an optical flow corresponding to the second image, which is obtained by the calculation means.
前記出力手段が出力したオプティカルフローを用いて画像中のグローバルモーションを求め、該求めたグローバルモーションに基づいて画像をシフトする防振手段を備えることを特徴とする請求項1乃至4の何れか1項に記載の画像処理装置。 In addition
Any one of claims 1 to 4, wherein the global motion in the image is obtained by using the optical flow output by the output means, and the vibration isolating means for shifting the image based on the obtained global motion is provided. The image processing apparatus according to the section.
前記出力手段が出力したオプティカルフローから複数のオプティカルフローを生成し、画像を該複数のオプティカルフローを用いてシフトした複数のシフト画像を生成し、該画像及び複数のシフト画像を合成する手段を備えることを特徴とする請求項1乃至4の何れか1項に記載の画像処理装置。 In addition
A means for generating a plurality of optical flows from the optical flows output by the output means, generating a plurality of shift images obtained by shifting the images using the plurality of optical flows, and synthesizing the images and the plurality of shift images. The image processing apparatus according to any one of claims 1 to 4, wherein the image processing apparatus is characterized by the above.
前記画像処理装置の取得手段が、第1の画像及び該第1の画像を規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第1の集合と、第2の画像及び該第2の画像を前記規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第2の集合と、を取得する取得工程と、
前記画像処理装置の選択手段が、前記第2の集合に属する画像を画像サイズが小さい順に選択する選択工程と、
前記画像処理装置の生成手段が、前記選択工程で今回選択した選択画像の各画素を、前記選択工程で前回選択した画像に対応するオプティカルフローを該選択画像のサイズに応じて変換した変換済みオプティカルフローに従って移動させた移動済み選択画像を生成する生成工程と、
前記画像処理装置の計算手段が、前記第1の集合に属する画像のうち前記選択画像と同サイズの画像と前記移動済み選択画像との差分である第1の差分と、前記変換済みオプティカルフローと該変換済みオプティカルフローに対して平滑化処理を施した処理済みオプティカルフローとの差分である第2の差分と、に基づく評価値を極小化するオプティカルフローを、前記選択画像に対応するオプティカルフローとして求める計算工程と、
前記画像処理装置の出力手段が、前記計算工程で求めた、前記第2の画像に対応するオプティカルフローを出力する出力工程と
を備えることを特徴とする画像処理方法。 This is an image processing method performed by an image processing device.
The acquisition means of the image processing apparatus includes a first set including a first image and a plurality of reduced images in which the first image is recursively reduced at a predetermined reduction rate, a second image, and the like. An acquisition step of acquiring a second set whose elements are a plurality of reduced images obtained by recursively reducing the second image at the specified reduction ratio.
A selection step in which the selection means of the image processing device selects images belonging to the second set in ascending order of image size.
The generation means of the image processing apparatus has converted each pixel of the selected image selected this time in the selection step into an optical flow corresponding to the image previously selected in the selection step according to the size of the selected image. A generation process that generates a moved selected image that has been moved according to the flow,
The calculation means of the image processing apparatus includes a first difference, which is a difference between an image having the same size as the selected image and the moved selected image among the images belonging to the first set, and the converted optical flow. The second difference, which is the difference between the converted optical flow and the processed optical flow that has been smoothed, and the optical flow that minimizes the evaluation value based on the second difference, are used as the optical flow corresponding to the selected image. The required calculation process and
An image processing method characterized in that the output means of the image processing apparatus includes an output step of outputting an optical flow corresponding to the second image obtained in the calculation step.
前記画像処理装置の取得手段が、第1の画像及び該第1の画像を規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第1の集合と、第2の画像及び該第2の画像を前記規定の縮小率で再帰的に縮小した複数の縮小画像を要素とする第2の集合と、を取得する取得工程と、
前記画像処理装置の選択手段が、前記第2の集合に属する画像を画像サイズが小さい順に選択する選択工程と、
前記画像処理装置の生成手段が、前記選択工程で今回選択した選択画像の各画素を、前記選択工程で前回選択した画像に対応するオプティカルフローを該選択画像のサイズに応じて変換した変換済みオプティカルフローに従って移動させた移動済み選択画像を生成する生成工程と、
前記画像処理装置の計算手段が、前記第1の集合に属する画像のうち前記選択画像と同サイズの画像と前記移動済み選択画像との差分である第1の差分と、前記変換済みオプティカルフローと前記第1の画像に対するオプティカルフローを前記選択画像のサイズに応じて変換してから平滑化処理を施した処理済みオプティカルフローとの差分である第2の差分と、に基づく評価値を極小化するオプティカルフローを、前記選択画像に対応するオプティカルフローとして求める計算工程と、
前記画像処理装置の出力手段が、前記計算工程で求めた、前記第2の画像に対応するオプティカルフローを出力する出力工程と
を備えることを特徴とする画像処理方法。 This is an image processing method performed by an image processing device.
The acquisition means of the image processing apparatus includes a first set including a first image and a plurality of reduced images in which the first image is recursively reduced at a predetermined reduction rate, a second image, and the like. An acquisition step of acquiring a second set whose elements are a plurality of reduced images obtained by recursively reducing the second image at the specified reduction ratio.
A selection step in which the selection means of the image processing device selects images belonging to the second set in ascending order of image size.
The generation means of the image processing apparatus has converted each pixel of the selected image selected this time in the selection step into an optical flow corresponding to the image previously selected in the selection step according to the size of the selected image. A generation process that generates a moved selected image that has been moved according to the flow,
The calculation means of the image processing apparatus includes a first difference, which is a difference between an image having the same size as the selected image and the moved selected image among the images belonging to the first set, and the converted optical flow. The evaluation value based on the second difference, which is the difference between the optical flow for the first image and the processed optical flow that has been subjected to the smoothing process after being converted according to the size of the selected image, is minimized. A calculation process for obtaining the optical flow as an optical flow corresponding to the selected image, and
An image processing method characterized in that the output means of the image processing apparatus includes an output step of outputting an optical flow corresponding to the second image obtained in the calculation step.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016228295A JP6854629B2 (en) | 2016-11-24 | 2016-11-24 | Image processing device, image processing method |
US15/818,006 US10818018B2 (en) | 2016-11-24 | 2017-11-20 | Image processing apparatus, image processing method, and non-transitory computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016228295A JP6854629B2 (en) | 2016-11-24 | 2016-11-24 | Image processing device, image processing method |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2018084997A JP2018084997A (en) | 2018-05-31 |
JP2018084997A5 JP2018084997A5 (en) | 2020-01-16 |
JP6854629B2 true JP6854629B2 (en) | 2021-04-07 |
Family
ID=62238457
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016228295A Active JP6854629B2 (en) | 2016-11-24 | 2016-11-24 | Image processing device, image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6854629B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109816611B (en) * | 2019-01-31 | 2021-02-12 | 北京市商汤科技开发有限公司 | Video repair method and device, electronic equipment and storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003067752A (en) * | 2001-08-28 | 2003-03-07 | Yazaki Corp | Vehicle periphery monitoring device |
JP2005506626A (en) * | 2001-10-25 | 2005-03-03 | コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ | Motion estimation unit and method, and image processing apparatus having such a motion estimation unit |
KR101498532B1 (en) * | 2008-10-15 | 2015-03-04 | 스피넬라 아이피 홀딩스, 인코포레이티드 | Digital processing method and system for determination of optical flow |
-
2016
- 2016-11-24 JP JP2016228295A patent/JP6854629B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018084997A (en) | 2018-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10818018B2 (en) | Image processing apparatus, image processing method, and non-transitory computer-readable storage medium | |
JP5385969B2 (en) | Method and apparatus for super-resolution of images | |
CA2745380C (en) | Devices and methods for processing images using scale space | |
US11062464B2 (en) | Image processing apparatus, method, and storage medium to derive optical flow | |
KR20070093995A (en) | Motion vector calculation method and image stabilization device, image pickup device, and video generation device using the method | |
JP7032871B2 (en) | Image processing equipment and image processing methods, programs, storage media | |
KR101987079B1 (en) | Method for removing noise of upscaled moving picture with dynamic parameter based on machine learning | |
JP5225313B2 (en) | Image generating apparatus, image generating method, and program | |
JP2006311480A (en) | Method, apparatus and program for generating interpolation frame | |
JP2007000205A (en) | Image processing apparatus, image processing method, and image processing program | |
KR20150145725A (en) | Method and apparatus for dynamic range expansion of ldr video sequence | |
CN107146197A (en) | A kind of reduced graph generating method and device | |
JP6904842B2 (en) | Image processing device, image processing method | |
CN108271022A (en) | A kind of method and device of estimation | |
JP6854629B2 (en) | Image processing device, image processing method | |
JP2012169701A (en) | Image processing device, image processing method, and program | |
CN103618904B (en) | Motion estimation method and device based on pixels | |
JP6938282B2 (en) | Image processing equipment, image processing methods and programs | |
JP2018180964A (en) | Image processing apparatus and image processing method | |
KR101227524B1 (en) | Method and apparatus for processing image | |
JP7005338B2 (en) | Information processing equipment and its control method and program | |
JPWO2016111239A1 (en) | Video processing apparatus, video processing method, and program | |
JP2015148965A (en) | Image processing apparatus, imaging apparatus, and image processing method | |
KR101097779B1 (en) | A motion-compensated frame interpolation method using the symmetry-based motion estimation | |
CN109754370B (en) | Image denoising method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20191125 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20191125 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20210103 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210113 |
|
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: 20210215 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210316 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6854629 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |