JP2018072942A - Image processing apparatus, image processing method, program, and storage medium - Google Patents

Image processing apparatus, image processing method, program, and storage medium Download PDF

Info

Publication number
JP2018072942A
JP2018072942A JP2016208842A JP2016208842A JP2018072942A JP 2018072942 A JP2018072942 A JP 2018072942A JP 2016208842 A JP2016208842 A JP 2016208842A JP 2016208842 A JP2016208842 A JP 2016208842A JP 2018072942 A JP2018072942 A JP 2018072942A
Authority
JP
Japan
Prior art keywords
motion vector
image
reliability
template
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2016208842A
Other languages
Japanese (ja)
Inventor
優 成田
Masaru Narita
優 成田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2016208842A priority Critical patent/JP2018072942A/en
Publication of JP2018072942A publication Critical patent/JP2018072942A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus capable of improving detection performance for a motion vector.SOLUTION: An image processing apparatus 100 of a digital camera 10 comprises: a hierarchical image generation unit 104 which generates images in respective hierarchies with a plurality of different resolutions with respect to each of a standard image and a reference image as input images; a template region setting unit 110 which sets a position and size of a template region for a standard image in each hierarchy; a search region setting unit 111 which sets a position and size of a search region for a reference image in each hierarchy; a motion vector calculation unit 106 which calculates a motion vector by correlation value operation on the template region and the search region; and a reliability calculation unit 107 which calculates reliability of the motion vector. The size of the template region and the position and size of the search region are set on the basis of reliability of a motion vector calculated for images in a hierarchy with a lower resolution.SELECTED DRAWING: Figure 1

Description

本発明は、複数のフレーム画像間で動きベクトルを検出する画像処理装置に関するものである。   The present invention relates to an image processing apparatus that detects a motion vector between a plurality of frame images.

デジタルスチルカメラやデジタルビデオカメラ等の撮像装置を用いて撮影された映像に対して像ブレ補正やダイナミックレンジ拡大処理を施すためには、フレーム画像間の動き量を検出して複数枚の画像の位置合わせを行う必要がある。フレーム画像間の動き量を検出する方法としては、ジャイロセンサのような外部機器の情報を用いたり、撮影されたフレーム画像から動き量を推定したりする方法等がある。   In order to perform image blur correction and dynamic range expansion processing on video shot using an imaging device such as a digital still camera or digital video camera, the amount of motion between frame images is detected and multiple images are captured. Need to align. As a method for detecting the amount of motion between frame images, there are a method of using information of an external device such as a gyro sensor, a method of estimating the amount of motion from a captured frame image, and the like.

フレーム画像を用いて動き量を推定する方法は従来から種々提案されているが、その代表的なものとしてテンプレートマッチングによる動きベクトル検出がある。動きベクトルの検出方法としては、次のような階層動きベクトル検出方法が知られている。階層動きベクトル検出では、入力された画像から解像度が互いに異なる複数の階層画像を生成する。そして、まず最も低解像度の階層画像から動きベクトルを検出し、低解像度の階層画像で検出された動きベクトルを参照しながら高解像度の階層画像で動きベクトルを検出する。   Various methods for estimating the amount of motion using a frame image have been proposed in the past. A typical example is motion vector detection by template matching. As a motion vector detection method, the following hierarchical motion vector detection method is known. In hierarchical motion vector detection, a plurality of hierarchical images having different resolutions are generated from an input image. First, a motion vector is detected from the lowest resolution hierarchical image, and a motion vector is detected from the high resolution hierarchical image while referring to the motion vector detected from the low resolution hierarchical image.

階層動きベクトル検出の利点は、低解像度の階層画像で検出された動きベクトルを参照することにより、高解像度の階層画像におけるサーチ領域を小さくし、テンプレート領域とサーチ領域の輝度分布の相関を算出するための演算を短縮できることである。一方欠点は、低解像度の階層画像で動きベクトルが正しく検出されなかった場合、高解像度の階層画像で誤った動きベクトルを参照することになり、最終的に正しい動きベクトルが得られないことである。   The advantage of hierarchical motion vector detection is that by referring to the motion vector detected in the low-resolution hierarchical image, the search area in the high-resolution hierarchical image is reduced, and the correlation between the luminance distribution of the template area and the search area is calculated. It is possible to shorten the calculation for this. On the other hand, if the motion vector is not correctly detected in the low resolution hierarchical image, the wrong motion vector is referred to in the high resolution hierarchical image, and the correct motion vector cannot be finally obtained. .

このような階層画像間における誤検出の伝搬を防ぐ方法として、特許文献1及び特許文献2には、動きベクトルの信頼度を判定し、信頼度の低い動きベクトルを、周囲の信頼度の高い動きベクトルを用いて修正する技術が開示されている。   As a method for preventing such false detection propagation between hierarchical images, Patent Document 1 and Patent Document 2 determine the reliability of a motion vector, and use a motion vector with low reliability as a surrounding motion with high reliability. A technique for correcting using a vector is disclosed.

特開2001−148012号公報Japanese Patent Laid-Open No. 2001-148012 特開2009−282762号公報JP 2009-282762 A

しかしながら、低解像度の階層画像で信頼度の低い動きベクトルを修正するだけでは、階層動きベクトル検出における検出性能を十分に引き出せない問題がある。   However, there is a problem that the detection performance in the hierarchical motion vector detection cannot be sufficiently obtained only by correcting the motion vector with low reliability in the low-resolution hierarchical image.

テンプレートマッチングでは、テンプレート内の画角が小さいほど、テンプレート内に特徴的なテクスチャを含む確率が低くなり、信頼度の高い動きベクトルを検出できる可能性が低くなる。一方で、画角が大きいほど、特徴点以外の周辺領域の動きの影響を受けやすくなり、動きベクトルの検出精度は低下してしまう。   In template matching, the smaller the angle of view in the template, the lower the probability of including a characteristic texture in the template, and the lower the possibility that a highly reliable motion vector can be detected. On the other hand, the larger the angle of view, the more easily affected by the motion of the surrounding area other than the feature points, and the motion vector detection accuracy decreases.

したがって、階層動きベクトル検出においては、両者の関係を考慮した上で、テンプレート領域の大きさを制御する必要がある。この点、特許文献1および特許文献2に開示されている方法では、そのような各階層画像のテンプレート領域の大きさについては言及されていない。   Therefore, in the hierarchical motion vector detection, it is necessary to control the size of the template region in consideration of the relationship between the two. In this regard, the methods disclosed in Patent Literature 1 and Patent Literature 2 do not mention the size of the template region of each hierarchical image.

本発明は、上述した課題に鑑みてなされたものであり、その目的は、入力された画像から解像度の異なる複数の階層画像を生成して動きベクトルを検出する場合に、動きベクトルの検出性能を向上させることができる画像処理装置を提供することである。   The present invention has been made in view of the above-described problems, and an object of the present invention is to improve motion vector detection performance when detecting a motion vector by generating a plurality of hierarchical images having different resolutions from an input image. An object of the present invention is to provide an image processing apparatus that can be improved.

本発明に係わる画像処理装置は、入力画像としての基準画像および参照画像のそれぞれに対して複数の異なる解像度の各階層の画像を生成する階層画像生成手段と、前記階層画像生成手段により生成された各階層の基準画像に対して、テンプレート領域の位置および大きさを設定するテンプレート領域設定手段と、前記階層画像生成手段により生成された各階層の参照画像に対して、サーチ領域の位置および大きさを設定するサーチ領域設定手段と、前記テンプレート領域と前記サーチ領域の相関値演算によって動きベクトルを算出する動きベクトル算出手段と、前記動きベクトルの信頼度を算出する信頼度算出手段と、を備え、前記テンプレート領域設定手段は、より低解像度の階層の画像について算出された前記動きベクトルの信頼度に基づいて前記テンプレート領域の大きさを設定するとともに、前記サーチ領域設定手段は、前記より低解像度の階層の画像について算出された前記動きベクトルの信頼度に基づいて前記サーチ領域の位置および大きさを設定することを特徴とする。   An image processing apparatus according to the present invention generates hierarchical image generation means for generating images of a plurality of different resolutions for each of a standard image and a reference image as input images, and the hierarchical image generation means Template area setting means for setting the position and size of the template area with respect to the standard image of each hierarchy, and the position and size of the search area with respect to the reference image of each hierarchy generated by the hierarchy image generating means A search area setting means for setting a motion vector calculation means for calculating a motion vector by calculating a correlation value between the template area and the search area, and a reliability calculation means for calculating the reliability of the motion vector, The template region setting means determines the reliability of the motion vector calculated for an image of a lower resolution hierarchy. And setting the size of the template area, and the search area setting means determines the position and size of the search area based on the reliability of the motion vector calculated for the image of the lower resolution hierarchy. It is characterized by setting.

本発明によれば、入力された画像から解像度の異なる複数の階層画像を生成して動きベクトルを検出する場合に、動きベクトルの検出性能を向上させることができる画像処理装置を提供することが可能となる。   According to the present invention, it is possible to provide an image processing apparatus capable of improving motion vector detection performance when generating a plurality of hierarchical images having different resolutions from an input image and detecting a motion vector. It becomes.

本発明の画像処理装置の第1の実施形態であるデジタルカメラの構成を示すブロック図。1 is a block diagram showing the configuration of a digital camera that is a first embodiment of an image processing apparatus of the present invention. 第1の実施形態のデジタルカメラの動作を示すフローチャート。5 is a flowchart showing the operation of the digital camera of the first embodiment. 動きベクトルの信頼度とテンプレート領域の関係を説明する図。The figure explaining the relationship between the reliability of a motion vector, and a template area | region. 動きベクトルの信頼度に基づくテンプレート領域を示す図。The figure which shows the template area | region based on the reliability of a motion vector. 動きベクトルの信頼度が低い場合のテンプレートサイズを説明する図。The figure explaining the template size when the reliability of a motion vector is low. 動きベクトルの信頼度が高い場合のテンプレートサイズを説明する図。The figure explaining template size in case the reliability of a motion vector is high. 動きベクトルの信頼度とサーチ領域の関係を説明する図。The figure explaining the relationship between the reliability of a motion vector, and a search area | region. テンプレートマッチングを説明する図。The figure explaining template matching. 相関値マップを説明する図。The figure explaining a correlation value map. 相関値マップの表現方法を説明する図。The figure explaining the expression method of a correlation value map. 動きベクトルの信頼度を表わす相関値指標を説明する図。The figure explaining the correlation value parameter | index showing the reliability of a motion vector. 動きベクトルの信頼度の算出方法を説明する図。The figure explaining the calculation method of the reliability of a motion vector. 第2の実施形態のデジタルカメラの構成を示すブロック図。The block diagram which shows the structure of the digital camera of 2nd Embodiment. 第2の実施形態のデジタルカメラの動作を示すフローチャート。9 is a flowchart showing the operation of the digital camera of the second embodiment. 第2の実施形態における領域分割処理を説明する図。The figure explaining the area division | segmentation process in 2nd Embodiment.

以下、本発明の実施形態について、添付図面を参照して詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

<第1の実施形態>
図1は、本発明の画像処理装置の第1の実施形態であるデジタルカメラ(撮像装置)10の構成を示すブロック図である。図1において、撮影光学系101はレンズおよび絞りなどを備えており、撮影の際、フォーカス調節および露出調節を行い、撮像素子102に光学像を結像させる。撮像素子102は、光学像を電気信号(アナログ画像信号)に変換する光電変換機能を有し、CCDやCMOSセンサ等で構成される。
<First Embodiment>
FIG. 1 is a block diagram showing a configuration of a digital camera (imaging device) 10 which is a first embodiment of an image processing device of the present invention. In FIG. 1, the photographing optical system 101 includes a lens, a diaphragm, and the like, and performs focus adjustment and exposure adjustment at the time of photographing to form an optical image on the image sensor 102. The image sensor 102 has a photoelectric conversion function for converting an optical image into an electrical signal (analog image signal), and is configured by a CCD, a CMOS sensor, or the like.

カメラ信号処理部103は、不図示のA/D変換部、オートゲイン制御部(AGC)およびオートホワイトバランス部を含み、撮像素子102から出力されたアナログ電気信号からデジタル映像信号(以下、入力画像という)を生成する。撮像素子102およびカメラ信号処理部103により、撮像により入力画像を生成する撮像部が構成される。また、図1中に破線で囲んだ部分により画像処理装置100が構成される。   The camera signal processing unit 103 includes an A / D conversion unit, an auto gain control unit (AGC), and an auto white balance unit (not shown), and converts a digital video signal (hereinafter referred to as an input image) from an analog electric signal output from the image sensor 102. Generated). The imaging element 102 and the camera signal processing unit 103 constitute an imaging unit that generates an input image by imaging. Further, the image processing apparatus 100 is configured by a portion surrounded by a broken line in FIG.

階層画像生成部104は、入力画像に対して周波数帯域制限のためのフィルタ処理とダウンサンプリングを行い、入力画像よりも解像度が段階的に低い複数の画像データ(以下、階層画像という)を生成する。なお、入力画像自体も1つの階層画像(最も高解像度の階層画像)として取得される。その結果、入力画像を用いて、入力画像を含む複数の階層画像が取得される。階層画像生成部104は、これら互いに異なる解像度の階層画像を階層画像保持部105 に格納する。   The hierarchical image generation unit 104 performs filter processing and downsampling on the input image to limit the frequency band, and generates a plurality of image data (hereinafter referred to as a hierarchical image) whose resolution is lower than the input image in stages. . The input image itself is also acquired as one hierarchical image (highest resolution hierarchical image). As a result, a plurality of hierarchical images including the input image are acquired using the input image. The hierarchical image generation unit 104 stores the hierarchical images having different resolutions in the hierarchical image holding unit 105.

動きベクトル検出部(動きベクトル算出部)106は、階層画像生成部104および階層画像保持部105から入力される2つの同一解像度の階層画像(以下、一方を基準画像、もう一方を参照画像という)から、例えばテンプレートマッチングにより動きベクトルを検出する。信頼度算出部107は、動きベクトル検出部106から入力される動きベクトルに対して信頼度を算出する。   The motion vector detection unit (motion vector calculation unit) 106 receives two hierarchical images having the same resolution input from the hierarchical image generation unit 104 and the hierarchical image holding unit 105 (hereinafter, one is referred to as a reference image and the other is referred to as a reference image). From, for example, the motion vector is detected by template matching. The reliability calculation unit 107 calculates the reliability for the motion vector input from the motion vector detection unit 106.

動きベクトル検出部106で検出された動きベクトルおよび信頼度算出部107で算出された信頼度(以下、動きベクトルとその動きベクトルの信頼度をまとめて動きベクトル情報という)を動きベクトル情報保持部108に格納する。動きベクトル制御部109は、テンプレート領域設定部110およびサーチ領域設定部111を有し、動きベクトル情報保持部108が保持する動きベクトル情報に基づいて動きベクトル検出部106を制御する。   The motion vector detected by the motion vector detection unit 106 and the reliability calculated by the reliability calculation unit 107 (hereinafter, the motion vector and the reliability of the motion vector are collectively referred to as motion vector information) are referred to as a motion vector information holding unit 108. To store. The motion vector control unit 109 includes a template region setting unit 110 and a search region setting unit 111, and controls the motion vector detection unit 106 based on the motion vector information held by the motion vector information holding unit 108.

テンプレート領域設定部110は、動きベクトル検出部106に入力される基準画像に対して、所定の位置に所定の大きさの矩形領域をテンプレート領域として設定する。サーチ領域設定部111は、動きベクトル検出部106に入力される参照画像に対して、所定の位置に所定の大きさの矩形領域をサーチ領域として設定する。   The template area setting unit 110 sets a rectangular area of a predetermined size at a predetermined position as a template area with respect to the reference image input to the motion vector detection unit 106. The search area setting unit 111 sets a rectangular area of a predetermined size at a predetermined position as a search area for the reference image input to the motion vector detection unit 106.

これらの構成要素104〜111を含む画像処理装置100は、CPUやMPU等の画像処理用コンピュータにより構成され、図2にフローチャートで示す画像処理をコンピュータプログラムとしての画像処理プログラムに従って実行する。以下、画像処理装置100の動作について、図2のフローチャートを参照して説明する。   The image processing apparatus 100 including these components 104 to 111 is configured by an image processing computer such as a CPU or MPU, and executes the image processing shown in the flowchart in FIG. 2 according to an image processing program as a computer program. Hereinafter, the operation of the image processing apparatus 100 will be described with reference to the flowchart of FIG.

ステップS201では、画像処理装置100の階層画像生成部104は複数の階層画像を生成する。以下の説明では、階層画像生成部104が、入力画像(1/1画像)としての高解像度画像から、入力画像に対する1/2縮小画像である低解像度画像を生成するものとする。   In step S201, the hierarchical image generation unit 104 of the image processing apparatus 100 generates a plurality of hierarchical images. In the following description, it is assumed that the hierarchical image generation unit 104 generates a low resolution image that is a 1/2 reduced image with respect to the input image from a high resolution image as an input image (1/1 image).

ステップS202では、動きベクトル制御部109は処理対象となる階層画像を選択する。本実施形態では、低解像度画像から高解像度画像に順次処理するよう選択する。ステップS203では、ステップS202で選択した階層画像に対し、テンプレート領域設定部110がテンプレート領域を設定する。テンプレート領域の位置は、固定的に決めてもよいが、特徴点のようなベクトル検出に適したテクスチャを含むよう配置することが好ましい。例えば、階層画像保持部105から得られる階層画像を用いて特徴抽出を行い、抽出された特徴点を中心にテンプレート領域を配置する。   In step S202, the motion vector control unit 109 selects a hierarchical image to be processed. In this embodiment, it is selected to sequentially process from a low resolution image to a high resolution image. In step S203, the template area setting unit 110 sets a template area for the hierarchical image selected in step S202. The position of the template region may be fixedly determined, but is preferably arranged so as to include a texture suitable for vector detection such as a feature point. For example, feature extraction is performed using a hierarchical image obtained from the hierarchical image holding unit 105, and a template region is arranged around the extracted feature points.

特徴点の抽出方法としては、例えばHarris corner検出器もしくはShi and Tomasiの手法を用いる。これらの手法では、画像の画素(x,y)における輝度値をI(x,y)と表現し、画像に対して水平および垂直の1次微分フィルタを適用した結果Ix,Iyから、式(1)で示す自己相関行列Hを作成する。   As a feature point extraction method, for example, Harris corner detector or Shi and Tomasi method is used. In these methods, the luminance value at the pixel (x, y) of the image is expressed as I (x, y), and from the results Ix and Iy obtained by applying horizontal and vertical first-order differential filters to the image, An autocorrelation matrix H shown in 1) is created.

Figure 2018072942
Figure 2018072942

式(1)において、Gは式(2)に示すガウス分布による平滑化を表す。 In Expression (1), G represents smoothing by the Gaussian distribution shown in Expression (2).

Figure 2018072942
Figure 2018072942

Harris検出器は、式(3)に示す特徴評価式により、特徴量が大きくなる画素を特徴点として抽出する。 The Harris detector extracts a pixel having a large feature amount as a feature point using the feature evaluation formula shown in Formula (3).

Harris=det(H)−α(tr(H))2 …(3)
(α=0.04〜0.15)
式(3)において、detは行列式を、trは対角成分の和を表す。また、αは定数であり、実験的に0.04〜0.15の値が良いとされている。
Harris = det (H) −α (tr (H)) 2 (3)
(Α = 0.04-0.15)
In Expression (3), det represents a determinant, and tr represents the sum of diagonal components. Further, α is a constant, and a value of 0.04 to 0.15 is experimentally good.

一方、Shi and Tomasiは、式(4)に示す特徴評価式を用いる。   On the other hand, Shi and Tomasi use the feature evaluation formula shown in Formula (4).

Shi and Tomasi=min(λ1,λ2) …(4)
式(4)は、式(1)の自己相関行列Hの固有値λ1,λ2のうち小さい方の固有値を特徴量とすることを表す。Shi and Tomasiを用いる場合でも、特徴量が大きくなる画素を特徴点として抽出する。
Shi and Tomasi = min (λ1, λ2) (4)
Equation (4) represents that the smaller eigenvalue of the eigenvalues λ1 and λ2 of the autocorrelation matrix H in equation (1) is used as the feature quantity. Even when Shi and Tomasi are used, pixels with large feature values are extracted as feature points.

テンプレート領域の大きさは、より低解像度の階層画像で検出された動きベクトルの信頼度に応じて設定することが好ましい。図3に動きベクトルの信頼度とテンプレート領域の大きさの関係を示す。なお、最も低解像度の階層画像では動きベクトルの信頼度とは無関係に所定の大きさを設定すれば良い。   The size of the template region is preferably set according to the reliability of the motion vector detected in the lower resolution hierarchical image. FIG. 3 shows the relationship between the reliability of the motion vector and the size of the template area. In the lowest resolution hierarchical image, a predetermined size may be set regardless of the reliability of the motion vector.

図3において、301は処理対象の階層画像、302は特徴点の座標、303はより低解像度の階層画像で設定されたテンプレート領域を示している。304,306,308はそれぞれより低解像度の階層で検出された動きベクトルを、処理対象の階層画像サイズに合わせて変倍した動きベクトルである。ここでは、動きベクトルの信頼度をベクトル304<ベクトル306<ベクトル308と仮定する。305,307,309は処理対象の階層画像におけるテンプレート領域であり、低解像度画像の動きベクトルの信頼度が高くなるほど、テンプレート領域の大きさを小さくする。   In FIG. 3, 301 is a hierarchical image to be processed, 302 is the coordinates of feature points, and 303 is a template region set by a lower resolution hierarchical image. Reference numerals 304, 306, and 308 denote motion vectors obtained by scaling the motion vectors detected in the lower resolution layer according to the size of the layer image to be processed. Here, it is assumed that the reliability of the motion vector is vector 304 <vector 306 <vector 308. Reference numerals 305, 307, and 309 denote template areas in the hierarchical image to be processed, and the size of the template area is reduced as the reliability of the motion vector of the low-resolution image increases.

つまり、信頼度が低い場合は、図3(a)のように、テンプレート領域305を、低解像度画像のテンプレート領域303よりも大きくする(305>303)。信頼度が中程度の場合は、図3(b)のように、テンプレート領域307を、低解像度画像のテンプレート領域303と同じにする(307=303)。信頼度が高い場合は、図3(c)のように、テンプレート領域309を、低解像度画像のテンプレート領域303よりも小さくする(309<303)。   That is, when the reliability is low, the template area 305 is made larger than the template area 303 of the low-resolution image as shown in FIG. 3A (305> 303). When the reliability is medium, as shown in FIG. 3B, the template area 307 is made the same as the template area 303 of the low-resolution image (307 = 303). When the reliability is high, the template area 309 is made smaller than the template area 303 of the low-resolution image as shown in FIG. 3C (309 <303).

図3(d)は、横軸を信頼度、縦軸をテンプレート領域サイズとして、信頼度とテンプレート領域サイズの関係をグラフ化した図である。図3(d)ではテンプレート領域サイズを、信頼度に対して線形に変化させているが、非線形に変化させても良い。   FIG. 3D is a graph showing the relationship between the reliability and the template region size, with the horizontal axis representing the reliability and the vertical axis representing the template region size. In FIG. 3D, the template region size is changed linearly with respect to the reliability, but may be changed nonlinearly.

このように、低解像度画像の動きベクトルの信頼度が高くなるほど、テンプレート領域の大きさを小さくする効果について、図4、図5、図6を用いて説明する。   As described above, the effect of reducing the size of the template region as the reliability of the motion vector of the low-resolution image becomes higher will be described with reference to FIGS. 4, 5, and 6.

図4は、低解像度画像で検出される動きベクトルの信頼度に関わらず、高解像度画像において低解像度画像と同じ大きさのテンプレート領域を設定する場合を示している。図4において、401は低解像度画像、404は高解像度画像、402,405はそれぞれ特徴点、403,406はそれぞれテンプレート領域である。   FIG. 4 shows a case where a template area having the same size as that of the low resolution image is set in the high resolution image regardless of the reliability of the motion vector detected in the low resolution image. In FIG. 4, 401 is a low resolution image, 404 is a high resolution image, 402 and 405 are feature points, and 403 and 406 are template regions.

いま高解像度画像のテンプレート領域406は、低解像度画像のテンプレート領域403と同じ大きさに設定されている。すると、図4から分かるように、テンプレート領域406の画角はテンプレート領域403の画角よりも、低解像度画像と高解像度画像の比率だけ小さくなる。仮に低解像度画像で検出された動きベクトルの信頼度が高い場合は、高解像度画像でテンプレート領域の画角を小さくしたとしても、テンプレート内に含まれるテクスチャの情報量はまだ十分にあり、信頼度の高い動きベクトルを検出できると考えられる。むしろ、特徴点以外の周辺領域の動きの影響を受けにくくなり、高解像度画像において動きベクトルの検出精度が向上することが期待できる。   Now, the template area 406 of the high resolution image is set to the same size as the template area 403 of the low resolution image. Then, as can be seen from FIG. 4, the angle of view of the template area 406 is smaller than the angle of view of the template area 403 by the ratio of the low resolution image and the high resolution image. If the reliability of the motion vector detected in the low-resolution image is high, the amount of texture information contained in the template is still sufficient even if the angle of view of the template area is reduced in the high-resolution image. It is considered that a high motion vector can be detected. Rather, it is less likely to be affected by the movement of the peripheral area other than the feature points, and it can be expected that the detection accuracy of the motion vector is improved in the high resolution image.

しかし、低解像度画像で検出された動きベクトルの信頼度が低い場合は、高解像度画像でテンプレート領域の画角が小さくなることで、テンプレート内に含まれるテクスチャの情報量が不足する。そして、高解像度画像においても信頼度の高い動きベクトルを検出できる可能性は低いと考えられる。したがって、低解像度画像の動きベクトルの信頼度に応じて、高解像度画像のテンプレート領域の大きさを制御することが必要である。   However, when the reliability of the motion vector detected in the low-resolution image is low, the angle of view of the template region in the high-resolution image becomes small, so that the amount of texture information included in the template is insufficient. And it is considered that the possibility that a highly reliable motion vector can be detected even in a high-resolution image is low. Therefore, it is necessary to control the size of the template region of the high resolution image according to the reliability of the motion vector of the low resolution image.

図5は、低解像度画像で検出される動きベクトルの信頼度が低い場合におけるテンプレート領域の大きさの変化を示している。501は低解像度画像、504は高解像度画像、502,505はそれぞれ特徴点、503,506はそれぞれテンプレート領域である。   FIG. 5 shows a change in the size of the template region when the reliability of the motion vector detected in the low resolution image is low. 501 is a low-resolution image, 504 is a high-resolution image, 502 and 505 are feature points, and 503 and 506 are template regions.

いま低解像度画像で検出される動きベクトルの信頼度が低いと仮定する。この場合、図3(a)に従えば、高解像度画像のテンプレート領域506は、低解像度画像のテンプレート領域503よりも大きく設定される。すると、図5から分かるように、テンプレート領域506では、テンプレート領域503に含まれる画角が維持される。その結果、テンプレート内に含まれるテクスチャの情報量を維持したまま高解像度画像で動きベクトル検出を行うことができるため、高解像度画像において信頼度の高い動きベクトルを検出できる可能性を向上できる。   Assume that the reliability of the motion vector detected in the low-resolution image is low. In this case, according to FIG. 3A, the template region 506 of the high resolution image is set larger than the template region 503 of the low resolution image. Then, as can be seen from FIG. 5, the angle of view included in the template region 503 is maintained in the template region 506. As a result, motion vector detection can be performed on a high-resolution image while maintaining the amount of texture information included in the template, so that the possibility of detecting a highly reliable motion vector in the high-resolution image can be improved.

図6は低解像度画像で検出される動きベクトルの信頼度が高い場合におけるテンプレート領域の大きさの変化を示している。601は低解像度画像、604は高解像度画像、602,605はそれぞれ特徴点、603,606はそれぞれテンプレート領域である。   FIG. 6 shows a change in the size of the template region when the reliability of the motion vector detected in the low resolution image is high. 601 is a low-resolution image, 604 is a high-resolution image, 602 and 605 are feature points, and 603 and 606 are template regions.

いま低解像度画像で検出される動きベクトルの信頼度が高いと仮定する。この場合、図3(c)に従えば、高解像度画像のテンプレート領域606は、低解像度画像のテンプレート領域603よりも小さく設定される。すると、図6から分かるように、テンプレート領域605に含まれる画角は、テンプレート領域603に含まれる画角よりも小さくなる。その結果、高解像度画像におけるテンプレートマッチングにおいて、特徴点以外の周辺領域の動きの影響を受けにくくなるため、高解像度画像における動きベクトルの検出精度を向上できる。   Assume that the reliability of the motion vector detected in the low-resolution image is high. In this case, according to FIG. 3C, the template region 606 of the high resolution image is set smaller than the template region 603 of the low resolution image. Then, as can be seen from FIG. 6, the angle of view included in the template region 605 is smaller than the angle of view included in the template region 603. As a result, the template matching in the high-resolution image is less affected by the movement of the peripheral area other than the feature points, so that the motion vector detection accuracy in the high-resolution image can be improved.

続いて、ステップS204では、ステップS202で選択した階層画像に対し、サーチ領域設定部111はサーチ領域を設定する。サーチ領域の位置および大きさは、より低解像度の階層画像で検出された動きベクトルとその信頼度に応じて設定することが好ましい。   Subsequently, in step S204, the search area setting unit 111 sets a search area for the hierarchical image selected in step S202. The position and size of the search area are preferably set according to the motion vector detected in the lower resolution hierarchical image and its reliability.

図7は、動きベクトルの信頼度とサーチ領域の関係を示す図である。なお、最も低解像度の階層画像ではテンプレート領域を上下左右均等に包含するように所定の大きさのサーチ領域を設定すれば良い。   FIG. 7 is a diagram showing the relationship between the reliability of the motion vector and the search area. In the lowest resolution hierarchical image, a search area of a predetermined size may be set so as to evenly include the template area vertically and horizontally.

図7において、701は処理対象の階層画像、702は特徴点の座標を示している。703,706,709はそれぞれより低解像度の階層画像で検出された動きベクトルを、処理対象の階層画像サイズに合わせて変倍した動きベクトルである。ここでは、動きベクトルの信頼度をベクトル703<ベクトル706<ベクトル709と仮定する。   In FIG. 7, reference numeral 701 denotes a hierarchical image to be processed, and reference numeral 702 denotes the coordinates of feature points. Reference numerals 703, 706, and 709 denote motion vectors obtained by scaling the motion vectors detected in the lower resolution hierarchical images in accordance with the processing target hierarchical image size. Here, it is assumed that the reliability of the motion vector is vector 703 <vector 706 <vector 709.

704,707,710はそれぞれテンプレート領域であり、図3を用いて説明したように、低解像度画像の動きベクトルの信頼度が高いほど、大きさを小さく設定している。705,708,711はサーチ領域であり、低解像度画像の動きベクトルの信頼度が高くなるほど、サーチ領域の大きさを小さくする。つまり、サーチ領域705>サーチ領域708>サーチ領域711とする。   Reference numerals 704, 707, and 710 denote template regions. As described with reference to FIG. 3, the size is set smaller as the reliability of the motion vector of the low-resolution image is higher. Reference numerals 705, 708, and 711 denote search areas. The higher the reliability of the motion vector of the low-resolution image, the smaller the search area. That is, search area 705> search area 708> search area 711.

またサーチ領域の位置については、以下のように設定することが好ましい。信頼度が低い場合は、図7(a)のように、サーチ領域705の中心を、動きベクトル703の始点の位置に設定する。信頼度が中程度の場合は、図7(b)のように、サーチ領域708の中心を、動きベクトル706の始点から終点の間の位置に設定する。信頼度が高い場合は、図7(c)のように、サーチ領域711の中心を、動きベクトル709の終点の位置に設定する。   The position of the search area is preferably set as follows. If the reliability is low, the center of the search area 705 is set to the position of the start point of the motion vector 703 as shown in FIG. When the reliability is medium, the center of the search area 708 is set to a position between the start point and the end point of the motion vector 706 as shown in FIG. When the reliability is high, the center of the search area 711 is set to the end point position of the motion vector 709 as shown in FIG.

図7(d)は、横軸を信頼度、縦軸をサーチ領域サイズとして、信頼度とサーチ領域サイズの関係をグラフ化した図である。図7(d)では、サーチ領域サイズを信頼度に対して線形に変化させているが、非線形に変化させても良い。このようにサーチ領域を設定することで、階層動きベクトル検出における低解像度画像の動きベクトルの寄与度を、その動きベクトルの信頼度に応じて制御することができる。   FIG. 7D is a graph showing the relationship between the reliability and the search area size, with the horizontal axis representing the reliability and the vertical axis representing the search area size. In FIG. 7D, the search area size is changed linearly with respect to the reliability, but may be changed nonlinearly. By setting the search area in this way, the contribution of the motion vector of the low-resolution image in the hierarchical motion vector detection can be controlled according to the reliability of the motion vector.

次に、ステップS205では、動きベクトル検出部106は、ステップS203、ステップS204で設定されたテンプレート領域およびサーチ領域を用いて動きベクトルの検出を行う。   In step S205, the motion vector detection unit 106 detects a motion vector using the template region and the search region set in steps S203 and S204.

動きベクトル検出部106は、テンプレートマッチングにより動きベクトルを検出する。図8は、テンプレートマッチングの概要を示す図である。図8(a)は2つのベクトル検出画像のうちの一方である基準画像を示し、図8(b)は他方である参照画像を示している。ベクトル検出画像として用いられる階層画像は、階層画像保持部105に保持されているフレーム画像と階層画像生成部104から直接入力される画像データである。   The motion vector detection unit 106 detects a motion vector by template matching. FIG. 8 is a diagram showing an outline of template matching. FIG. 8A shows a standard image that is one of the two vector detection images, and FIG. 8B shows a reference image that is the other. The hierarchical image used as the vector detection image is a frame image held in the hierarchical image holding unit 105 and image data directly input from the hierarchical image generation unit 104.

動きベクトル検出部106は、基準画像にテンプレート領域801、参照画像にサーチ領域802を配置し、テンプレート領域801とサーチ領域802との相関値を算出する(相関値演算)。本実施形態では、相関値の算出方法として、差分絶対値和(Sum of Absolute Difference:以下、SADと略す)を使用する。SADの計算式を式(5)に示す。   The motion vector detection unit 106 arranges the template area 801 in the base image and the search area 802 in the reference image, and calculates a correlation value between the template area 801 and the search area 802 (correlation value calculation). In this embodiment, a sum of absolute differences (hereinafter abbreviated as SAD) is used as a correlation value calculation method. A formula for calculating SAD is shown in Formula (5).

Figure 2018072942
Figure 2018072942

式(5)において、f(i,j)はテンプレート領域801内の座標(i,j)での輝度値を示している。また、g(i,j)はサーチ領域802内において相関値の算出対象となる領域(以下、相関値算出領域という)803内の各座標での輝度値を示す。SADでは、両領域802,803内の輝度値f(i,j),g(i,j)の差の絶対値を計算し、その総和を求めることで相関値S_SADを得る。相関値S_SADの値が小さいほど、テンプレート領域801と相関値算出領域803のテクスチャの類似度が高いことを表す。なお、相関値の算出にSAD以外の方法を用いてもよく、例えば差分二乗和(SSD)や正規化相互相関(NCC)を用いてもよい。   In equation (5), f (i, j) represents the luminance value at the coordinates (i, j) in the template region 801. Further, g (i, j) represents a luminance value at each coordinate in a region 803 for which a correlation value is to be calculated (hereinafter referred to as a correlation value calculation region) in the search region 802. In SAD, the correlation value S_SAD is obtained by calculating the absolute value of the difference between the luminance values f (i, j) and g (i, j) in both regions 802 and 803 and obtaining the sum thereof. The smaller the correlation value S_SAD, the higher the texture similarity between the template area 801 and the correlation value calculation area 803. Note that a method other than SAD may be used to calculate the correlation value, and for example, sum of squared differences (SSD) or normalized cross correlation (NCC) may be used.

動きベクトル検出部106は、サーチ領域802の全域において相関値算出領域803を移動させて相関値を算出する。これにより、サーチ領域802に対して図9に示すような相関値マップを作成する。   The motion vector detection unit 106 calculates the correlation value by moving the correlation value calculation area 803 over the entire search area 802. Thereby, a correlation value map as shown in FIG. 9 is created for the search area 802.

図9(a)において、X軸とY軸は相関値マップ内(つまりはサーチ領域802内)での座標を表しており、Z軸は各座標での相関値の大きさを表している。また図9(b)は、図9(a)の等高線を示したものである。図9(a)および図9(b)において、相関値が最も小さいのは極小値901であり、サーチ領域802内で極小値901が算出された領域にはテンプレート領域801と非常に類似したテクスチャが存在していると判定できる。902は二番目の極小値、903は三番目の極小値を表わしており、これらは901に次いで類似したテクスチャが存在していることを意味する。   In FIG. 9A, the X axis and the Y axis represent coordinates in the correlation value map (that is, in the search area 802), and the Z axis represents the magnitude of the correlation value at each coordinate. FIG. 9B shows the contour lines of FIG. 9A. In FIGS. 9A and 9B, the minimum value 901 has the smallest correlation value, and a texture very similar to the template region 801 is found in the region where the minimum value 901 is calculated in the search region 802. Can be determined to exist. 902 represents the second minimum value and 903 represents the third minimum value, which means that a texture similar to 901 exists.

このように、動きベクトル検出部106は、テンプレート領域801とサーチ領域802との間で相関値を算出し、その値が最も小さくなる相関値算出領域803の位置を判定する。これにより、基準画像上のテンプレート領域801の参照画像上での移動先を特定することができる。そして、基準画像上でのテンプレート領域の位置を基準とした参照画像上での移動先への方向および移動量を方向および大きさとした動きベクトルを検出することができる。   As described above, the motion vector detection unit 106 calculates the correlation value between the template region 801 and the search region 802, and determines the position of the correlation value calculation region 803 where the value is the smallest. Thereby, the movement destination on the reference image of the template region 801 on the standard image can be specified. Then, it is possible to detect a motion vector in which the direction and the amount of movement to the movement destination on the reference image based on the position of the template region on the standard image are set as the direction and size.

ステップS206では、信頼度算出部107は、ステップS205で得られた動きベクトルの信頼度を算出する。動きベクトルの信頼度の算出には二次元の相関値マップを用いる。図10(a)は、図9で示したような相関値マップを上から見た様子を模式的に表した図である。二次元の相関値マップ1001において、1002は図9の極小値に対応する位置である。この二次元相関値マップにおける相関値を、矢印1003で示すようにラスター順に並べ一次元で表わしたものが図10(b)である。図10(b)の縦軸は相関値、横軸は相関値マップのX座標とY座標により一意に定まる画素アドレスである。以降、動きベクトルの信頼度を算出するため、この図10(b)の表現を用いることにする。 図11は、動きベクトルの信頼度を表わす相関値の指標の一例を示す図である。図11の横軸は画素のアドレス、縦軸は相関値である。図11(a)では、指標として相関値の最小値と最大値の差分Daを用いている。Daは相関値マップのレンジを表わしており、Daの値が小さい場合、テクスチャのコントラストが低いことが考えられ、信頼度が低いことを示す。   In step S206, the reliability calculation unit 107 calculates the reliability of the motion vector obtained in step S205. A two-dimensional correlation value map is used to calculate the reliability of the motion vector. FIG. 10A is a diagram schematically showing a state where the correlation value map as shown in FIG. 9 is viewed from above. In the two-dimensional correlation value map 1001, reference numeral 1002 denotes a position corresponding to the minimum value in FIG. FIG. 10B shows the correlation values in this two-dimensional correlation value map arranged in raster order as indicated by an arrow 1003 and expressed in one dimension. In FIG. 10B, the vertical axis represents the correlation value, and the horizontal axis represents the pixel address uniquely determined by the X coordinate and the Y coordinate of the correlation value map. Hereinafter, this expression of FIG. 10B is used to calculate the reliability of the motion vector. FIG. 11 is a diagram illustrating an example of a correlation value index representing the reliability of a motion vector. The horizontal axis in FIG. 11 is the pixel address, and the vertical axis is the correlation value. In FIG. 11A, the difference Da between the minimum value and the maximum value of the correlation value is used as an index. Da represents the range of the correlation value map. When the value of Da is small, it is considered that the contrast of the texture is low and the reliability is low.

図11(b)では、指標として相関値の最小値と最大値の差分Aと、最小値と平均値の差分Bとの比率Db(=B/A)を用いている。Dbは相関値ピークの急峻性を表わしており、Dbが小さい場合、テンプレート領域とサーチ領域の類似度が低いと考えられ、信頼度が低いことを示す。   In FIG. 11B, the ratio Db (= B / A) between the difference A between the minimum value and the maximum value of the correlation value and the difference B between the minimum value and the average value is used as an index. Db represents the steepness of the correlation value peak. When Db is small, it is considered that the similarity between the template area and the search area is low, and the reliability is low.

図11(c)では、指標として相関値の極小値と二番目の極小値の差分Dcを用いている。ここで、110,1102,1103は、それぞれ図9の相関値901,902,903と対応している。よって、図11(c)は、図9(b)の等高線において、相関値の最小値と類似した極小値が存在しないかを確認することを意味している。Dcは相関値マップの周期性を表わし、Dcが小さい場合、テクスチャが繰り返しパターンやエッジなどであることが考えられ、信頼度が低いことを示す。なお、ここでは極小値と二番目の極小値を選択したが、相関値マップの周期性を判定できれば良いため、その他の極小値を選択しても良い。   In FIG. 11C, the difference Dc between the minimum value of the correlation value and the second minimum value is used as an index. Here, 110, 1102, and 1103 correspond to the correlation values 901, 902, and 903 in FIG. 9, respectively. Therefore, FIG. 11C means that it is confirmed whether or not there is a local minimum similar to the minimum value of the correlation value in the contour line of FIG. 9B. Dc represents the periodicity of the correlation value map. When Dc is small, it is considered that the texture is a repetitive pattern or an edge, and the reliability is low. Although the minimum value and the second minimum value are selected here, it is only necessary to determine the periodicity of the correlation value map, so other minimum values may be selected.

図11(d)では、指標として相関値の最小値Ddを用いている。Ddが大きい場合、テンプレート領域とサーチ領域の類似度が低いと考えられ、信頼度が低いことを表わす。Ddと信頼度は反比例の関係にあるため、Ddの逆数(1/Dd)を指標とする。   In FIG. 11D, the minimum correlation value Dd is used as an index. When Dd is large, it is considered that the similarity between the template area and the search area is low, and the reliability is low. Since Dd and the reliability are inversely proportional, the reciprocal of Dd (1 / Dd) is used as an index.

上記で説明した相関値の指標はそのまま信頼度として用いることができるが、例えば図12のように相関値指標と信頼度の対応付けを行っても良い。図12の横軸は相関値指標(上述のDa,Db,Dc,1/Ddのいずれか)、縦軸は信頼度である。この例では、二つの閾値T1,T2を設けており、相関値指標がT1以下なら信頼度を0、T2以上なら信頼度を1としている。閾値は各相関値指標で変更しても良い。また閾値T1とT2の間の区間は、相関値指標と信頼度を非線形に対応付けても良い。以降の説明では、各相関値指標Da,Db,Dc,1/Ddから得られる信頼度をRa,Rb,Rc,Rdと表現する。   Although the correlation value index described above can be used as the reliability as it is, for example, the correlation value index and the reliability may be associated as shown in FIG. The horizontal axis of FIG. 12 is a correlation value index (any one of the above-mentioned Da, Db, Dc, 1 / Dd), and the vertical axis is the reliability. In this example, two threshold values T1 and T2 are provided, and if the correlation value index is T1 or less, the reliability is 0, and if the correlation value index is T2 or more, the reliability is 1. The threshold value may be changed for each correlation value index. In the section between the threshold values T1 and T2, the correlation value index and the reliability may be associated non-linearly. In the following description, the reliability obtained from each correlation value index Da, Db, Dc, 1 / Dd is expressed as Ra, Rb, Rc, Rd.

最終的な動きベクトルの信頼度Rは、これらRa,Rb,Rc,Rdを組み合わせて算出すればよい。ここでは、重み付け加算(加重加算)と優先順位に基づく組み合わせ方法について説明する。重み付け加算による組み合わせでは、Ra,Rb,Rc,Rdの重みをそれぞれWa,Wb,Wc,Wdとすれば、信頼度Rは式(6)のように計算される。   The final motion vector reliability R may be calculated by combining these Ra, Rb, Rc, and Rd. Here, a combination method based on weighted addition (weighted addition) and priority will be described. In the combination by weighted addition, assuming that the weights of Ra, Rb, Rc, and Rd are Wa, Wb, Wc, and Wd, respectively, the reliability R is calculated as shown in Equation (6).

R=Wa×Ra+Wb×Rb+Wc×Rc+Wd×Rd …(6)
例えば重みをWa=0.4,Wb=0.3,Wc=0.2,Wd=0.1とする。全ての信頼度が十分に高く、Ra=Rb=Rc=Rd=1の場合には、式(6)よりR=1.0となる。またRa=0.6,Rb=0.5,Rc=0.7,Rd=0.7のような場合には、式(6)よりR=0.6となる。
R = Wa * Ra + Wb * Rb + Wc * Rc + Wd * Rd (6)
For example, the weights are set to Wa = 0.4, Wb = 0.3, Wc = 0.2, and Wd = 0.1. When all the reliability levels are sufficiently high and Ra = Rb = Rc = Rd = 1, R = 1.0 is obtained from the equation (6). When Ra = 0.6, Rb = 0.5, Rc = 0.7, Rd = 0.7, R = 0.6 from equation (6).

一方、優先順位に基づく組み合わせでは、Ra,Rb,Rc,Rdのいずれかを優先して、信頼度Rを決定する。例えば、階層動きベクトル検出では、低解像度階層の動きベクトルを利用し、サーチ領域を絞り込んで動きベクトルを検出するため、相関値が小さくなる領域(テンプレート領域とサーチ領域の類似度が高い領域)を集中的に探索することになる。そのため、正しい動きベクトルが検出できたとしても、相関値マップは全体的に相関値が小さいものになり、Rdは高くなるものの、RaやRb、Rcは低くなる傾向がある。特に複数の極小値を用いるRcは低くなりやすくなる。そこで、例えばRd>Ra=Rb>Rcのように優先度を設定する。この場合の信頼度算出の一例を以下に説明する。   On the other hand, in the combination based on the priority order, the reliability R is determined by giving priority to one of Ra, Rb, Rc, and Rd. For example, in the hierarchical motion vector detection, a motion vector is detected by narrowing down the search area using the motion vector of the low resolution hierarchy, so that an area where the correlation value is small (an area where the similarity between the template area and the search area is high) is selected. You will search intensively. Therefore, even if a correct motion vector can be detected, the correlation value map as a whole has a small correlation value, and although Rd increases, Ra, Rb, and Rc tend to decrease. In particular, Rc using a plurality of minimum values tends to be low. Therefore, for example, the priority is set as Rd> Ra = Rb> Rc. An example of reliability calculation in this case will be described below.

まずRdが所定の値よりも高いかを判定し、高い場合はその時点で信頼度を1.0と判定する。仮にRdが所定の値よりも低い場合は、次にRa、Rbがそれぞれ所定の値よりも高いかを判定し、いずれかが高い場合は、その時点で信頼度を0.5と判定する。仮にRaおよびRbが所定の値よりも低い場合は、最後にRcが所定の値よりも高いかを判定し、高い場合は信頼度を0.3、低い場合は信頼度を0のように判定する。このように、優先度を高く設定した信頼度から順に所定の値と比較し、その大小関係に応じて信頼度を決めることができる。   First, it is determined whether Rd is higher than a predetermined value. If it is higher, the reliability is determined to be 1.0 at that time. If Rd is lower than a predetermined value, it is next determined whether Ra and Rb are higher than a predetermined value. If either is higher, the reliability is determined to be 0.5 at that time. If Ra and Rb are lower than a predetermined value, it is finally determined whether Rc is higher than a predetermined value. If it is higher, the reliability is determined to be 0.3, and if it is lower, the reliability is determined to be 0. To do. In this way, the reliability can be determined in accordance with the magnitude relationship by comparing with a predetermined value in order from the reliability set with a high priority.

最後のステップS207では、動きベクトル制御部109は、処理階層が最終階層まで達したか否かを判定する。最終階層まで達していない場合はステップS202に戻り、ステップS202〜ステップS207を繰り返す。   In the last step S207, the motion vector control unit 109 determines whether the processing hierarchy has reached the final hierarchy. If the final hierarchy has not been reached, the process returns to step S202, and steps S202 to S207 are repeated.

以上説明したように、本実施形態では、それぞれの階層画像のテンプレート領域の大きさを動きベクトルの信頼度に応じて変更することで、階層動きベクトル検出の検出性能を向上させることができる。   As described above, in the present embodiment, the detection performance of the hierarchical motion vector detection can be improved by changing the size of the template area of each hierarchical image according to the reliability of the motion vector.

<第2の実施形態>
図13は、本発明の画像処理装置の第2の実施形態であるデジタルカメラ20の構成を示すブロック図である。図13のデジタルカメラ20の構成要素において、図1に示したデジタルカメラ10の構成要素と同じものには図1中の符号と同符号を付す。また、図13のデジタルカメラ20の構成要素のうち、図1に示したデジタルカメラ10の構成要素に対応する(同じではないが類似する)ものには図1中の符号の末尾に「a」を付す。本実施形態のデジタルカメラも画像処理装置200を含む。画像処理装置200は、領域分割部1301を有する。以下では、第1の実施形態と異なる部分を中心に説明する。
<Second Embodiment>
FIG. 13 is a block diagram showing a configuration of a digital camera 20 which is the second embodiment of the image processing apparatus of the present invention. 13 that are the same as those of the digital camera 10 shown in FIG. 1 are denoted by the same reference numerals as those in FIG. Further, among the components of the digital camera 20 of FIG. 13, those corresponding to the components of the digital camera 10 shown in FIG. Is attached. The digital camera of this embodiment also includes an image processing apparatus 200. The image processing apparatus 200 includes an area dividing unit 1301. Below, it demonstrates centering on a different part from 1st Embodiment.

第1の実施形態では、フレーム画像単位での処理について説明した。しかし動きベクトルの信頼度は領域毎に異なり得る。このため、本実施形態では、階層画像を複数の画像領域に分割し、画像領域ごとに動きベクトルを検出し、信頼度を算出し、その信頼度に基づいて画像領域単位でテンプレート領域およびサーチ領域を制御する。   In the first embodiment, the processing in units of frame images has been described. However, the reliability of motion vectors can vary from region to region. Therefore, in the present embodiment, the hierarchical image is divided into a plurality of image areas, a motion vector is detected for each image area, a reliability is calculated, and a template area and a search area are calculated for each image area based on the reliability. To control.

図14は、本実施形態のデジタルカメラの動作を示すフローチャートである。図14において、図2に示したフローチャートと同じものには図2中の符号と同符号を付す。また、図14において、図2に示したフローと対応する(同じではないが類似する)ものには図2中の符号の末尾に「a」を付す。   FIG. 14 is a flowchart showing the operation of the digital camera of this embodiment. 14, the same symbols as those in FIG. 2 are attached to the same components as those in the flowchart shown in FIG. Further, in FIG. 14, “a” is added to the end of the reference numerals in FIG. 2 corresponding to the flow shown in FIG.

ステップS1401では、画像処理装置200において、領域分割部(分割手段)1301は、動きベクトル制御部109aに対して、各階層画像を複数の画像領域に分割するための分割情報を出力する。各画像領域の形状は任意であるが、本実施形態では図15(a)に示すように、階層画像を格子状に分割する。   In step S1401, in the image processing apparatus 200, the region dividing unit (dividing unit) 1301 outputs division information for dividing each hierarchical image into a plurality of image regions to the motion vector control unit 109a. Although the shape of each image area is arbitrary, in this embodiment, as shown in FIG. 15A, the hierarchical image is divided into a grid pattern.

ステップS1402では、動きベクトル制御部109は処理対象となる分割領域を選択する。なお、ステップS1401とS201およびステップS1402とS202の順序を入れ替え、階層画像を生成した後に、領域分割を行うようにしても良い。その場合は、後述するステップS207とS1403も同時に入れ替える必要がある。   In step S1402, the motion vector control unit 109 selects a divided region to be processed. It should be noted that region division may be performed after the order of steps S1401 and S201 and steps S1402 and S202 is changed to generate a hierarchical image. In that case, steps S207 and S1403, which will be described later, need to be replaced at the same time.

ステップS203aでは、テンプレート領域設定部110aは、まず領域分割部1301からの分割情報に基づいて、画像領域ごとに所定数(複数)の特徴点を抽出する。具体的には、画像領域ごとに、式(3)または式(4)により画素の特徴量を算出し、特徴量が高い方から所定数の画素を特徴点として抽出する。図15(b)には、格子状に分割された画像領域ごとに1つの特徴点1501が抽出された様子を示している。   In step S203a, the template region setting unit 110a first extracts a predetermined number (multiple) of feature points for each image region based on the division information from the region division unit 1301. Specifically, for each image region, the feature amount of the pixel is calculated by the equation (3) or the equation (4), and a predetermined number of pixels are extracted as feature points from the higher feature amount. FIG. 15B shows a state in which one feature point 1501 is extracted for each image area divided in a grid pattern.

さらにテンプレート領域設定部110aは、領域毎に抽出された特徴点に基づいて、テンプレート領域の位置を決定する。また低解像度階層の分割領域ごとに検出された動きベクトルの信頼度に基づいて、第1の実施形態と同様にテンプレート領域の大きさを決定する。   Furthermore, the template area setting unit 110a determines the position of the template area based on the feature points extracted for each area. Further, based on the reliability of the motion vector detected for each divided region of the low resolution hierarchy, the size of the template region is determined as in the first embodiment.

ステップS204において、サーチ領域設定部111aは、より低解像度の階層の分割領域ごとに検出された動きベクトルとその信頼度に基づいて、第1の実施形態と同様にサーチ領域を設定する。   In step S204, the search area setting unit 111a sets a search area in the same manner as in the first embodiment, based on the motion vector detected for each divided area of the lower resolution hierarchy and its reliability.

最後にステップS1403では、動きベクトル制御部109aは、処理した分割領域が最後の領域であるか否かを判定する。最後の分割領域まで達していない場合はステップS1402に戻り、ステップS1402〜S1403を繰り返す。   Finally, in step S1403, the motion vector control unit 109a determines whether or not the processed divided area is the last area. If the last divided area has not been reached, the process returns to step S1402, and steps S1402 to S1403 are repeated.

本実施形態では、画像領域ごとに検出された動きベクトルの信頼度を算出し、その信頼度に基づいて画像領域単位でテンプレート領域およびサーチ領域を制御できるため、第1の実施形態よりもさらに階層動きベクトル検出の性能を向上させることができる。   In this embodiment, the reliability of the motion vector detected for each image area is calculated, and the template area and the search area can be controlled in units of image areas based on the reliability. Therefore, the hierarchy is further increased than in the first embodiment. The performance of motion vector detection can be improved.

(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

101:撮影光学系、102:撮像素子、103:カメラ信号処理部、104:階層画像生成部、105:階層画像保持部、106:動きベクトル検出部、107:信頼度算出部、108:動きベクトル情報保持部、109:動きベクトル制御部、110:テンプレート領域設定部、111:サーチ領域設定部、1301:領域分割部 101: Imaging optical system, 102: Image sensor, 103: Camera signal processing unit, 104: Hierarchical image generation unit, 105: Hierarchical image holding unit, 106: Motion vector detection unit, 107: Reliability calculation unit, 108: Motion vector Information holding unit, 109: motion vector control unit, 110: template region setting unit, 111: search region setting unit, 1301: region dividing unit

Claims (15)

入力画像としての基準画像および参照画像のそれぞれに対して複数の異なる解像度の各階層の画像を生成する階層画像生成手段と、
前記階層画像生成手段により生成された各階層の基準画像に対して、テンプレート領域の位置および大きさを設定するテンプレート領域設定手段と、
前記階層画像生成手段により生成された各階層の参照画像に対して、サーチ領域の位置および大きさを設定するサーチ領域設定手段と、
前記テンプレート領域と前記サーチ領域の相関値演算によって動きベクトルを算出する動きベクトル算出手段と、
前記動きベクトルの信頼度を算出する信頼度算出手段と、
を備え、
前記テンプレート領域設定手段は、より低解像度の階層の画像について算出された前記動きベクトルの信頼度に基づいて前記テンプレート領域の大きさを設定するとともに、前記サーチ領域設定手段は、前記より低解像度の階層の画像について算出された前記動きベクトルの信頼度に基づいて前記サーチ領域の位置および大きさを設定することを特徴とする画像処理装置。
Hierarchical image generation means for generating a plurality of different resolution images for each of the standard image and the reference image as input images;
Template area setting means for setting the position and size of the template area for the reference image of each hierarchy generated by the hierarchy image generating means;
Search area setting means for setting the position and size of the search area for the reference image of each hierarchy generated by the hierarchy image generating means;
A motion vector calculating means for calculating a motion vector by calculating a correlation value between the template region and the search region;
Reliability calculation means for calculating the reliability of the motion vector;
With
The template area setting means sets the size of the template area based on the reliability of the motion vector calculated for an image of a lower resolution hierarchy, and the search area setting means has the lower resolution resolution. An image processing apparatus, wherein the position and size of the search area are set based on the reliability of the motion vector calculated for a hierarchical image.
前記各階層の画像を複数の画像領域に分割する分割手段をさらに備え、前記テンプレート領域設定手段は、前記画像領域ごとに算出された前記動きベクトルの信頼度に基づいて画像領域ごとに前記テンプレート領域の大きさを設定するとともに、前記画像領域ごとに算出された前記動きベクトルの信頼度に基づいて画像領域ごとに前記サーチ領域の位置および大きさを設定することを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus further includes a dividing unit that divides the image of each layer into a plurality of image regions, and the template region setting unit includes the template region for each image region based on the reliability of the motion vector calculated for each image region. The position and size of the search area are set for each image area based on the reliability of the motion vector calculated for each image area. Image processing apparatus. 前記信頼度算出手段は、前記動きベクトル算出手段から得られる相関値演算の結果に基づいて、前記動きベクトルの信頼度を算出することを特徴とする請求項1又は2に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the reliability calculation unit calculates the reliability of the motion vector based on a correlation value calculation result obtained from the motion vector calculation unit. 前記信頼度算出手段は、複数の動きベクトルの信頼度を加重加算することにより、最終的な動きベクトルの信頼度を算出することを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the reliability calculation means calculates the reliability of a final motion vector by weighted addition of the reliability of a plurality of motion vectors. 前記信頼度算出手段は、複数の動きベクトルの信頼度の優先度に応じて、最終的な動きベクトルの信頼度を算出することを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the reliability calculation unit calculates a reliability of a final motion vector according to a priority of reliability of a plurality of motion vectors. 前記信頼度算出手段は、前記動きベクトル算出手段から得られる相関値の最大値が大きくなるにつれて、前記動きベクトルの信頼度を高く算出することを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the reliability calculation unit calculates the reliability of the motion vector higher as the maximum correlation value obtained from the motion vector calculation unit increases. 前記信頼度算出手段は、前記動きベクトル算出手段から得られる相関値の最大値と最小値との差分が大きくなるにつれて、前記動きベクトルの信頼度を高く算出することを特徴とする請求項3に記載の画像処理装置。   The reliability calculation unit calculates the reliability of the motion vector higher as the difference between the maximum value and the minimum value of the correlation values obtained from the motion vector calculation unit increases. The image processing apparatus described. 前記信頼度算出手段は、前記動きベクトル算出手段から得られる相関値の最大値と最小値との差分に対する、相関値の最大値と平均値との差分の比率が大きくなるにつれて、前記動きベクトルの信頼度を高く算出することを特徴とする請求項3に記載の画像処理装置。   The reliability calculation means increases the ratio of the difference between the maximum value and the average value of the correlation values to the difference between the maximum value and the minimum value of the correlation values obtained from the motion vector calculation means. The image processing apparatus according to claim 3, wherein the reliability is calculated to be high. 前記信頼度算出手段は、前記動きベクトル算出手段から得られる相関値の最大値と、少なくとも一つの相関値の極小値との差分が大きくなるにつれて、前記動きベクトルの信頼度を高く算出することを特徴とする請求項3に記載の画像処理装置。   The reliability calculation means calculates the reliability of the motion vector higher as the difference between the maximum correlation value obtained from the motion vector calculation means and the minimum value of at least one correlation value increases. The image processing apparatus according to claim 3. 前記テンプレート領域設定手段は、前記動きベクトルの信頼度が高くなるにつれて、次に処理する階層の基準画像に対するテンプレート領域の大きさを、1つ前に処理した階層の基準画像に対するテンプレート領域の大きさよりも小さく設定することを特徴とする請求項1に記載の画像処理装置。   As the reliability of the motion vector becomes higher, the template area setting means sets the size of the template area for the reference image of the next layer to be processed than the size of the template area for the reference image of the previous layer processed. The image processing apparatus according to claim 1, wherein the image processing apparatus is set to be smaller. 前記サーチ領域設定手段は、前記動きベクトルの信頼度が高くなるにつれて、次に処理する階層の参照画像に対するサーチ領域の大きさを、1つ前に処理した階層の参照画像に対するサーチ領域の大きさよりも小さく設定することを特徴とする請求項1に記載の画像処理装置。   As the reliability of the motion vector increases, the search area setting means sets the size of the search area for the reference image of the next layer to be processed from the size of the search area for the reference image of the previous layer processed. The image processing apparatus according to claim 1, wherein the image processing apparatus is set to be smaller. 前記サーチ領域設定手段は、前記動きベクトルの信頼度が高くなるにつれて、次に処理する階層の参照画像に対するサーチ領域の位置を、前記動きベクトルの方向に沿って、前記テンプレート領域の中心からより遠い位置に設定することを特徴とする請求項1に記載の画像処理装置。   As the reliability of the motion vector increases, the search region setting means moves the position of the search region with respect to a reference image of the next layer to be processed further from the center of the template region along the direction of the motion vector. The image processing apparatus according to claim 1, wherein the position is set to a position. 入力画像としての基準画像および参照画像のそれぞれに対して複数の異なる解像度の各階層の画像を生成する階層画像生成工程と、
前記階層画像生成工程により生成された各階層の基準画像に対して、テンプレート領域の位置および大きさを設定するテンプレート領域設定工程と、
前記階層画像生成工程により生成された各階層の参照画像に対して、サーチ領域の位置および大きさを設定するサーチ領域設定工程と、
前記テンプレート領域と前記サーチ領域の相関値演算によって動きベクトルを算出する動きベクトル算出工程と、
前記動きベクトルの信頼度を算出する信頼度算出工程と、
を有し、
前記テンプレート領域設定工程では、より低解像度の階層の画像について算出された前記動きベクトルの信頼度に基づいて前記テンプレート領域の大きさを設定するとともに、前記サーチ領域設定工程では、前記より低解像度の階層の画像について算出された前記動きベクトルの信頼度に基づいて前記サーチ領域の位置および大きさを設定することを特徴とする画像処理方法。
A hierarchical image generation step of generating images of each hierarchy of a plurality of different resolutions for each of the standard image and the reference image as an input image;
A template region setting step for setting the position and size of the template region for the reference image of each layer generated by the layer image generation step;
A search region setting step for setting the position and size of the search region for the reference image of each layer generated by the layer image generation step;
A motion vector calculating step of calculating a motion vector by calculating a correlation value between the template region and the search region;
A reliability calculation step of calculating the reliability of the motion vector;
Have
In the template area setting step, the size of the template area is set based on the reliability of the motion vector calculated for an image of a lower resolution hierarchy, and in the search area setting step, the lower resolution is set. An image processing method comprising: setting a position and a size of the search area based on a reliability of the motion vector calculated for a hierarchy image.
請求項13に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラム。   A program for causing a computer to execute each step of the image processing method according to claim 13. 請求項13に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラムを記憶したコンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute each step of the image processing method according to claim 13.
JP2016208842A 2016-10-25 2016-10-25 Image processing apparatus, image processing method, program, and storage medium Pending JP2018072942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016208842A JP2018072942A (en) 2016-10-25 2016-10-25 Image processing apparatus, image processing method, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016208842A JP2018072942A (en) 2016-10-25 2016-10-25 Image processing apparatus, image processing method, program, and storage medium

Publications (1)

Publication Number Publication Date
JP2018072942A true JP2018072942A (en) 2018-05-10

Family

ID=62112751

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016208842A Pending JP2018072942A (en) 2016-10-25 2016-10-25 Image processing apparatus, image processing method, program, and storage medium

Country Status (1)

Country Link
JP (1) JP2018072942A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111860161A (en) * 2020-06-16 2020-10-30 成都浩孚科技有限公司 Target shielding detection method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111860161A (en) * 2020-06-16 2020-10-30 成都浩孚科技有限公司 Target shielding detection method
CN111860161B (en) * 2020-06-16 2023-11-10 成都浩孚科技有限公司 Target shielding detection method

Similar Documents

Publication Publication Date Title
JP5284048B2 (en) Image processing apparatus, imaging apparatus, and image processing method
TWI496105B (en) Image synthesis device and computer program for image synthesis
JP6577703B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP2015035658A (en) Image processing apparatus, image processing method, and imaging apparatus
JP5374119B2 (en) Distance information acquisition device, imaging device, and program
JP2018151689A (en) Image processing apparatus, control method thereof, program and storage medium
US10839529B2 (en) Image processing apparatus and image processing method, and storage medium
US10210619B2 (en) Image processing apparatus for selecting an object image to be processed based on a determination result of correlation, image pickup apparatus, and storage medium for storing image processing program
JP6282133B2 (en) Imaging device, control method thereof, and control program
US9270883B2 (en) Image processing apparatus, image pickup apparatus, image pickup system, image processing method, and non-transitory computer-readable storage medium
JP6057629B2 (en) Image processing apparatus, control method thereof, and control program
JP6178646B2 (en) Imaging apparatus and image shake correction processing method
WO2017187935A1 (en) Information processing apparatus, information processing method, and program
US11164286B2 (en) Image processing apparatus, image processing method, and storage medium
JP6579816B2 (en) Image processing apparatus, image processing method, and program
JP7025237B2 (en) Image processing equipment and its control method and program
JP2018072942A (en) Image processing apparatus, image processing method, program, and storage medium
JP2018018425A (en) Image processing device and image processing method
JP6604783B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP6378496B2 (en) Image processing apparatus, control method, and recording medium
JP6381212B2 (en) Imaging apparatus and control method thereof
JP6639155B2 (en) Image processing apparatus and image processing method
JP2019176261A (en) Image processor
JP7009253B2 (en) Image processing equipment, image processing methods and programs
JP2019192048A (en) Imaging apparatus