JP2018081640A - Image processing device, image processing method, program and storage medium - Google Patents
Image processing device, image processing method, program and storage medium Download PDFInfo
- Publication number
- JP2018081640A JP2018081640A JP2016225370A JP2016225370A JP2018081640A JP 2018081640 A JP2018081640 A JP 2018081640A JP 2016225370 A JP2016225370 A JP 2016225370A JP 2016225370 A JP2016225370 A JP 2016225370A JP 2018081640 A JP2018081640 A JP 2018081640A
- Authority
- JP
- Japan
- Prior art keywords
- feature point
- image
- divided
- feature
- grid
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Studio Devices (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Image Analysis (AREA)
Abstract
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 on video shot using an imaging device such as a digital still camera or digital video camera, it is necessary to detect the amount of motion between frame images and align multiple images. There is. 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.
フレーム画像を用いて動き量を推定する方法は従来から種々提案されているが、その代表的なものとしてテンプレートマッチングによる動きベクトル検出がある。テンプレートマッチングでは、まず映像中のある2枚のフレーム画像の一方を原画像、もう一方を参照画像とする。そして、原画像上に配置した所定の大きさの矩形領域をテンプレートブロックとし、参照画像の各位置においてテンプレートブロック内の画素値の分布との相関を求める。このとき、参照画像中で最も相関が高くなる位置がテンプレートブロックの移動先であり、原画像上でのテンプレートブロックの位置を基準とした時の移動先への向きと移動量が動きベクトルとなる。 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. In template matching, first, one of two frame images in a video is used as an original image and the other is used as a reference image. Then, a rectangular area having a predetermined size arranged on the original image is used as a template block, and a correlation with a distribution of pixel values in the template block is obtained at each position of the reference image. At this time, the position where the correlation is highest in the reference image is the destination of the template block, and the direction and amount of movement to the destination when the position of the template block on the original image is used as a reference is the motion vector. .
動きベクトルの検出率を向上させるため、特徴点を抽出し、抽出した特徴点にテンプレートブロックを配置し、フレーム画像間でテンプレートマッチングを行う技術がある。ここで、画像全体に対して特徴点抽出を行うと、特徴点の分布は不均一になることが多い。不均一な特徴点に対して得られた動きベクトルを像ブレ補正の用途で使用する場合、特徴の集中した領域が主となる像ブレ補正となってしまう。 In order to improve the detection rate of motion vectors, there is a technique for extracting feature points, placing template blocks at the extracted feature points, and performing template matching between frame images. Here, when feature points are extracted from the entire image, the distribution of feature points is often non-uniform. When motion vectors obtained for non-uniform feature points are used for image blur correction, a region where features are concentrated is the main image blur correction.
この問題を解決するため、特許文献1では、特徴点を均一に分布させるために、画像をグリッド状に分割して、特徴の大きさを表す特徴値を画素ごとに計算し、各グリッド内で特徴値が最も大きい画素を特徴点として抽出している。
In order to solve this problem, in
図10は、特許文献1に記載されている技術に基づいて、各グリッド内で特徴点を求めて、その特徴点にテンプレートブロックを配置し、テンプレートマッチングを行う例を示した図である。図10において、1001は画像、1002−1はグリッド、1010−1はグリッド内の特徴点、1003はテンプレート、1004はテンプレートに対するサーチ範囲を示す。グリッド1002−1においては、特徴点1010−1を重心としたテンプレート1003に基づいて、テンプレートマッチングが行われる。また、1020−2は、グリッド1002−2内の被写体1020から求められた特徴点である。このようにグリッド毎に特徴点を求めてテンプレートマッチングを行い、動きベクトルを検出して像ブレ補正が行われる。グリッド毎に被写体の特徴点を求めることにより、特徴の集中した領域に偏らずに特徴点の分布を均一にすることができる。
FIG. 10 is a diagram illustrating an example in which feature points are obtained in each grid based on the technique described in
しかし、1つの被写体が複数のグリッドの境界にまたがった場合、複数のグリッドで同一被写体に対する特徴点を検出することになる。例えば、図10において、被写体1030が4つのグリッド1002−3〜1002−6にまたがった場合、4つのグリッド1002−3〜1002−6のそれぞれで1つの被写体1030に対する特徴点1030−3〜1030−6を検出することになる。ここで被写体1030が手振れとは異なる動きの動体等であった場合、手振れとは異なる動きベクトルを複数誤検出することになり、像ブレ補正精度が低下してしまうという課題がある。
However, when one subject extends over the boundaries of a plurality of grids, feature points for the same subject are detected by the plurality of grids. For example, in FIG. 10, when a
本発明は上述した課題に鑑みてなされたものであり、その目的は、グリッド分割を用いた動きベクトルの検出において、動きベクトルの誤検出を抑制することである。 The present invention has been made in view of the above-described problems, and an object thereof is to suppress erroneous detection of a motion vector in detection of a motion vector using grid division.
本発明に係わる画像処理装置は、1つの画像を複数の領域に分割する領域分割手段と、前記領域分割手段により分割された分割領域ごとに画素の特徴値を算出して、特徴点を選択する特徴点選択手段と、前記分割領域ごとの特徴点に基づいてマッチング処理に使用する画像領域を決定し、動きベクトルを算出する動きベクトル算出手段と、を備え、前記特徴点選択手段は、複数の前記分割領域のうちの1つである第1の分割領域における特徴点と、該第1の分割領域に隣接する第2の分割領域における特徴点の距離が所定距離以上となるように、前記分割領域ごとに特徴点を選択することを特徴とする。 An image processing apparatus according to the present invention selects a feature point by calculating a feature value of a pixel for each of the divided regions divided by the region dividing unit, and a region dividing unit that divides one image into a plurality of regions. A feature point selection unit; and a motion vector calculation unit that determines an image region to be used for the matching process based on the feature point for each of the divided regions and calculates a motion vector. The feature point selection unit includes a plurality of feature points. The division is performed such that the distance between the feature point in the first divided area, which is one of the divided areas, and the feature point in the second divided area adjacent to the first divided area is equal to or greater than a predetermined distance. A feature point is selected for each region.
本発明によれば、グリッド分割を用いた動きベクトルの検出において、動きベクトルの誤検出を抑制することが可能となる。 According to the present invention, it is possible to suppress erroneous detection of motion vectors in detection of motion vectors using grid division.
以下、本発明の実施形態について、添付図面を参照して詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
<第1の実施形態>
図1は、本発明の第1の実施形態に係わる画像処理装置の構成を示す図である。図1において、結像光学系201は、レンズや絞り等からなり、フォーカス調節や露出調節を行う。撮像素子202は、CCD、CMOSセンサ等からなり、光学像を電気信号に変換する。A/D変換回路203は、撮像素子202から出力されるアナログ画像信号をデジタル画像データに変換する。CPU204は、バスを介して画像処理装置全体の各種制御を司る。メモリであるDRAM212は、データを格納する。動きベクトル検出部210は、連続する少なくとも2つのフレーム画像信号から動きベクトルを検出し、検出結果をCPU204に通知する。画像処理部211は、画像信号に対して、レンズ歪の補正処理、動きベクトル検出部210が検出した動きベクトルに基づく像ブレ補正処理、等の各種画像処理を施す。表示部205は、画像処理部211で生成された画像データを液晶ディスプレイ等に表示する。記録部206は、画像処理部211で生成された画像データをメディア等に記録する。
<First Embodiment>
FIG. 1 is a diagram showing a configuration of an image processing apparatus according to the first embodiment of the present invention. In FIG. 1, an imaging
図2は、本実施形態における画像信号のグリッド分割(領域分割)を示す図である。図2では、画像信号550を、水平方向に6個、垂直方向に4個の領域(グリッド)に分割している。グリッド分割数、グリッド画像サイズは、CPU204によって動きベクトル検出部210に対して設定される。以降の処理では、グリッド501について特徴点503を求め、求めた特徴点に応じて、テンプレート画像504の位置(画像領域)とサーチ画像505の位置(画像領域)を決定して、テンプレートマッチングを行う。
FIG. 2 is a diagram showing grid division (region division) of the image signal in the present embodiment. In FIG. 2, the
特徴点503の座標は、グリッド501内の座標となる。テンプレート画像504とサーチ画像505は、特徴点503の位置によってグリッド501をはみ出す場合がある。そのため、テンプレート画像504、及びサーチ画像505がグリッド501の上側にはみ出した場合に参照される上側余分領域506が必要になる。グリッド508−5に対しては、特徴点513を求め、求めた特徴点に応じて、テンプレート画像514の位置と、サーチ画像515を決定して、テンプレートマッチングを行う。本実施形態においては、グリッド508−5内の特徴点513は、グリッド501内の特徴点503との距離がCPU204で設定された隣接座標閾値以上となる点の中から決定される。
The coordinates of the
図3は、分割された画像信号の処理順序を示す図である。まず、左上端の余分領域508−1の画像信号を読み出したら、次に、その右隣の余分領域508−2の画像信号を読み出し、その後も右隣の余分領域の画像信号を読み出す。上端の余分領域の画像信号を全て読み出し終えたら、グリッド501に対する左端の余分領域508−4の画像信号を読み出し、その後に、グリッド501の画像信号を読み出す。グリッド501の画像信号を読み出し終えたら、グリッド508−5、グリッド508−10の順で、水平方向のグリッドの画像信号を読み出していく。
FIG. 3 is a diagram illustrating a processing order of the divided image signals. First, after the image signal of the extra area 508-1 at the upper left end is read, the image signal of the extra area 508-2 on the right is read out, and the image signal of the extra area on the right is read thereafter. When all the image signals of the extra area at the upper end have been read out, the image signal of the extra area 508-4 at the left end with respect to the
図4は、本実施形態における動きベクトル検出部210の構成を示す図である。グリッド分割部101は、CPU204により設定されたグリッド分割情報に基づいて画像を複数領域(本実施形態ではグリッドと呼ぶ)に分割する。グリッド分割部101は、後段のベクトル検出画像生成部102に対し、画像信号550を前述した余分領域を含めた分割領域単位で出力する。ベクトル検出画像生成部102は、ベクトル検出用の画像(ベクトル算出画像)を生成する。生成されたベクトル検出画像は、DRAM212に格納される。DRAM212には、現時点のベクトル検出画像と、1フレーム前のベクトル検出画像の、2フレーム分のベクトル検出画像が記憶されている。本実施形においては、現時点のベクトル検出画像をテンプレート画像とし、1フレーム前のベクトル検出画像をサーチ画像として、テンプレートマッチングを行う。
FIG. 4 is a diagram illustrating a configuration of the motion
特徴点算出部(特徴点選択部)103は、画像信号の特徴点を算出する。特徴点算出部103は、グリッドのみが処理対象となるため、余分領域は含まないグリッド単位の画像信号のみが入力される。また、グリッド分割部101から、画像信号がどのグリッド領域の画像であるかを判別するためのグリッド番号、及び画像信号におけるグリッド左上の原点の座標が入力される。本実施形態では、グリッド501のグリッド番号を1、グリッド508−5のグリッド番号を2としており、各グリッドに識別可能な番号を割り当てている。特徴点算出部103は、グリッド分割部101からのグリッド単位の画像信号、グリッド番号、グリッド原点座標、CPU204から設定されたグリッド分割情報、隣接座標閾値、に基づいてグリッド毎の特徴点を算出する。メモリアドレス生成部106は、特徴点の検出結果に応じて、DRAM212からのテンプレート画像とサーチ画像の読み出し位置を決定する。マッチング処理部105は、DRAM212から読み出したテンプレート画像とサーチ画像を用いてテンプレートマッチング処理を行う。テンプレート画像の水平、垂直サイズ、サーチ画像の水平、垂直サイズは、CPU204によってメモリアドレス生成部106、マッチング処理部105に設定されている。
A feature point calculation unit (feature point selection unit) 103 calculates a feature point of the image signal. Since only the grid is processed, the feature
図5は、特徴点算出部103の構成を示した図である。特徴点算出部103は、特徴フィルタ部401、特徴評価部402、座標算出部403、特徴点決定部404、特徴点決定部404がアクセスするSRAM0405を備えて構成されている。
FIG. 5 is a diagram illustrating a configuration of the feature
特徴フィルタ部401は、例えば、バンドパスフィルタ、水平微分フィルタ、垂直微分フィルタ、平滑化フィルタなど、複数のフィルタから構成される。本実施形態においては、バンドパスフィルタで不要な画像信号の高周波成分と低周波成分をカットし、水平方向の微分フィルタ処理を施した信号と、垂直方向の微分フィルタ処理を施した信号、それぞれに対して、平滑化フィルタ処理を施した信号を出力する。
The
特徴評価部402は、特徴フィルタ部401によりフィルタ処理されたグリッドの画像信号に対し、画素ごとに2つのエッジの交点や曲率が極大である曲線状の点など画素の周辺の微分値が多方向に大きい点を特徴評価式により特徴値として算出する。本実施形態では、例えば、Shi and Tomasiの手法を用いる場合について説明する。水平微分フィルタと垂直微分フィルタを施した結果から、自己相関行列Hを作成する。自己相関行列Hの式を(式1)に示す。
The
(式1)において、Ixは水平微分フィルタを施した結果、Iyは垂直微分フィルタを施した結果を表しており、ガウシアンフィルタGを畳み込む。Shi and Tomasiの特徴評価式を(式2)に示す。 In (Equation 1), Ix represents the result of applying the horizontal differential filter, Iy represents the result of applying the vertical differential filter, and convolves the Gaussian filter G. Shi and Tomasi's characteristic evaluation formula is shown in (Formula 2).
Shi and Tomashi = min(λ1,λ2) (式2)
(式2)は、(式1)の自己相関行列Hの固有値λ1,λ2のうち小さい方の固有値を特徴値とすることを示す。
Shi and Tomashi = min (λ1, λ2) (Formula 2)
(Expression 2) indicates that the smaller eigenvalue of the eigenvalues λ1 and λ2 of the autocorrelation matrix H of (Expression 1) is used as the feature value.
座標算出部403は、グリッドの原点座標とグリッド単位の画像信号から、処理している画素の画像信号における絶対座標を算出する。特徴点決定部404は、グリッド毎に特徴点を決定し、グリッド番号と特徴点座標をSRAM405に格納する。本実施形態においては、特徴点決定部404は、グリッド501に対して、特徴評価部402によって算出された特徴値がグリッド501内で最も大きい画素を特徴点としている。また、特徴点決定部404は、SRAM405に格納した各グリッドの特徴点座標をSRAM405から読み出すことが可能である。
The coordinate
特徴点決定部404は、現在処理中のグリッド番号、及びCPU204に設定されたグリッド分割情報から隣接グリッド番号を算出し、SRAM405から隣接グリッドの特徴点座標を読み出す。本実施形態では、特徴点決定部404は、グリッド508−5の特徴点算出時において、既に特徴点を算出した隣接グリッド501の特徴点座標をSRAM405から読み出す。また、特徴点決定部404はグリッド508−5の特徴点算出時において、隣接グリッド501の特徴点座標との距離がCPU204から設定された隣接座標閾値以上(所定距離以上)となる画素の中で、特徴値が最も大きい画素を特徴点とする。
The feature
以降同様に、他のグリッドの特徴点算出時において、隣接グリッドの特徴点座標との距離が隣接座標閾値以上となる画素の中で、特徴値が最も大きい画素を特徴点とする。グリッド508−5にとって、既に特徴点を算出した隣接グリッドは左隣のグリッド501のみであるが、他のグリッドでは、最大で左上・上・右上・左隣の4つのグリッドが既に特徴点を算出した隣接グリッドになる。その場合、4つの隣接グリッドの特徴点座標との距離が隣接座標閾値以上となる画素の中で、特徴値が最も大きい画素を特徴点とする。また、特徴点決定部404は、マッチング処理部105が対応するグリッドのテンプレートマッチング処理を開始する時に、メモリアドレス生成部106へ特徴点座標を出力する。
Similarly, when calculating the feature points of other grids, the pixel having the largest feature value among the pixels whose distance from the feature point coordinates of the adjacent grid is equal to or greater than the adjacent coordinate threshold is set as the feature point. For the grid 508-5, the only adjacent grid whose feature points have already been calculated is the left
図6は、本実施形態における特徴点決定方法及びベクトル検出方法を説明する図である。502はグリッド501の原点座標であり、画素503の座標(PX,PY)は、グリッド原点502からの相対座標である。本実施形態では、座標が(PX,PY)である画素503がグリッド501内において特徴値の最も大きい画素であるとする。503は特徴点座標、504はテンプレート画像、505はサーチ画像、506はテンプレート画像読み出し開始座標、507はサーチ画像読み出し開始座標となる。508−1,2,3,4,6,11はテンプレートマッチング処理に必要となる余分画素領域である。
FIG. 6 is a diagram for explaining a feature point determination method and a vector detection method in the present embodiment.
特徴点503(PX,PY)は、グリッドの原点座標を(GSX,GSY)とした場合に、画像信号内の絶対座標(GPX,GPY)として以下の式で表現される。 The feature point 503 (PX, PY) is expressed by the following expression as absolute coordinates (GPX, GPY) in the image signal when the origin coordinate of the grid is (GSX, GSY).
(GPX,GPY)=(GSX+PX,GSY+PY) (式3)
テンプレート画像は、特徴点が中心となるように配置される。従って、テンプレート画像の読み出し開始位置(GTX,GTY)は、テンプレート画像の水平サイズをTX、垂直サイズをTYとした場合、以下の式で表現される。
(GPX, GPY) = (GSX + PX, GSY + PY) (Formula 3)
The template image is arranged so that the feature point is at the center. Accordingly, the reading start position (GTX, GTY) of the template image is expressed by the following expression when the horizontal size of the template image is TX and the vertical size is TY.
(GTX,GTY)=(GPX−TX/2,GPY−TY/2) (式4)
サーチ画像は、画像の中心をテンプレート画像の中心に揃えて配置する。従って、サーチ画像の読み出し開始位置(GMX,GMY)は、サーチ画像の水平サイズをSX、垂直サイズをSYとした場合、以下の式で表現される。
(GTX, GTY) = (GPX−TX / 2, GPY−TY / 2) (Formula 4)
The search image is arranged with the center of the image aligned with the center of the template image. Accordingly, the search image read start position (GMX, GMY) is expressed by the following expression when the horizontal size of the search image is SX and the vertical size is SY.
(GMX,GMY)=(GPX−SX/2,GPY−SY/2) (式5)
メモリアドレス生成部106は、DRAM212に配置された、現フレームのベクトル検出画像に対して、テンプレート画像として、座標(GTX,GTY)から水平サイズTX、垂直サイズTYの矩形領域を読み出すよう、メモリアドレスを発行する。また、同様に、DRAM212に配置された1フレーム前のベクトル検出画像に対して、サーチ画像として、座標(GMX,GMY)から水平サイズSX、垂直サイズSYの矩形領域を読み出すよう、メモリアドレスを発行する。テンプレート画像の水平、垂直サイズ、サーチ画像の水平、垂直サイズは、CPU204によってメモリアドレス生成部106、マッチング処理部105に対して設定されている。
(GMX, GMY) = (GPX-SX / 2, GPY-SY / 2) (Formula 5)
The memory
マッチング処理部105は、DRAM212から読み出されたテンプレート画像とサーチ画像を用いて相関値を算出し、その相関値からベクトル値を算出する。例えば、相関値の算出方法の一例として差分絶対値和(Sum of Absolute Difference、以下SADと略す)を使用する。
The matching
…(式6)
(式6)において、f(i,j)はテンプレート画像504内の座標(i,j)における画素値を表しており、g(i,j)はサーチ画像505において相関値算出の対象となる領域内の各画素値を表す。相関値算出対象領域は、テンプレート画像504と同じ大きさである。そしてSADでは、両ブロック内の各画素値f(i,j)及びg(i,j)について差の絶対値を計算し、その総和を求めることで相関値S_SADを得ることが出来る。従って、相関値S_SADの値が小さいほど両ブロック間の輝度値の差分が小さい、つまりテンプレート画像504と相関値算出領域内のテクスチャが類似していることを表している。なお、本実施形態では、相関値の一例としてSADを使用しているが、これに限られるものではなく、差分二乗和(SSD)や正規化相互相関(NCC)等の他の相関値を用いてもよい。そして、相関値の最小値の位置(MVX,MVY)を、グリッドの動きベクトル値として出力する。
... (Formula 6)
In (Expression 6), f (i, j) represents the pixel value at the coordinates (i, j) in the
他のグリッドに対しても同様に動きベクトル値を算出する。本実施形態では、グリッド内の特徴点の決定時において、隣接するグリッドの特徴点座標との距離がCPU204から設定された隣接座標閾値以上となる画素の中で、特徴値の最も大きい画素を特徴点とする。本実施形態では、グリッド508−5内で特徴値の最も大きい画素が509、グリッド508−10内で特徴値の最も大きい画素が512、グリッド508−7内で特徴値の最も大きい画素が510であるものとする。そして、本実施形態では、グリッド501,508−5,508−10,508−7において、特徴値の最も大きい画素同士の距離は、CPU204から設定された隣接座標閾値以上とする。よって、それぞれのグリッドで特徴値の最も大きい画素が特徴点となる。
Similarly, motion vector values are calculated for other grids. In the present embodiment, when determining the feature point in the grid, the pixel having the largest feature value among the pixels whose distance from the feature point coordinate of the adjacent grid is equal to or larger than the adjacent coordinate threshold set by the
一方、グリッド508−8内においては、特徴値の最も大きい画素が画素511−1(PX2,PY2)、2番目に大きい画素が画素511−2(PX3,PY3)であるとする。この場合、特徴点決定部404は、グリッド508−8の特徴点決定時において、隣接グリッドの特徴点との距離がCPU204から設定された隣接座標閾値以上となる画素の中で、特徴値の最も大きい画素を特徴点とする。本実施形態では、隣接グリッドの特徴点との水平距離または垂直距離のどちらかが隣接座標閾値以上となる画素の中で、特徴値の最も大きい画素を特徴点とする。そして、本実施形態の場合、画素511−1(PX2,PY2)と、左隣接グリッド508−7の特徴点510(PX1,PY1)の水平距離DX1、垂直距離DY1は共に隣接座標閾値未満であるとする。よって本実施形態では、画素511−1(PX2,PY2)は、グリッド508−8の特徴点として選択されない。
On the other hand, in the grid 508-8, it is assumed that the pixel having the largest feature value is the pixel 511-1 (PX2, PY2) and the second largest pixel is the pixel 511-2 (PX3, PY3). In this case, the feature
(DX1,DY1)=(|PX2−PX1|,|PY2−PY1|) …(式7)
また、画素511−2(PX3,PY3)と、左隣接グリッド508−7の特徴点510(PX1,PY1)の水平距離DX2、垂直距離DY2は共に隣接座標閾値以上であるとする。よって本実施形態では、画素511−2(PX3,PY3)をグリッド508−8の特徴点として選択する。
(DX1, DY1) = (| PX2-PX1 |, | PY2-PY1 |) (Formula 7)
Further, it is assumed that the horizontal distance DX2 and the vertical distance DY2 of the pixel 511-2 (PX3, PY3) and the feature point 510 (PX1, PY1) of the left adjacent grid 508-7 are both equal to or greater than the adjacent coordinate threshold. Therefore, in this embodiment, the pixel 511-2 (PX3, PY3) is selected as a feature point of the grid 508-8.
(DX2,DY2)=(|PX3−PX1|,|PY3−PY1|) …(式8)
図7は、本実施形態における動きベクトルの検出動作を示すフローチャートである。CPU204は、グリッド分割部101にグリッド分割数、グリッド画像サイズ、余分領域サイズを設定する(S701)。CPU204は、メモリアドレス生成部106、マッチング処理部105にテンプレート画像の水平・垂直サイズ、サーチ画像の水平・垂直サイズを設定する(S702)。CPU204は、特徴点算出部103に隣接座標閾値を設定する(S703)。CPU204は、結像光学系201、撮像素子202に画像信号の取得、動きベクトル検出部210に動きベクトル検出開始を指示する(S704)。CPU204は、動きベクトル検出部210から検出完了の通知を受けたら(S705)、検出された動きベクトルデータを取得する(S706)。
(DX2, DY2) = (| PX3-PX1 |, | PY3-PY1 |) (Formula 8)
FIG. 7 is a flowchart showing the motion vector detection operation in the present embodiment. The
以上説明したように、第1の実施形態におけるベクトル検出処理により、被写体が複数のグリッドにまたがった場合においても、各グリッドで異なる被写体の動きベクトルを検出できる。そのため、動体の被写体検出による像ブレ補正精度の劣化を防ぐことが出来る。 As described above, by the vector detection process in the first embodiment, even when the subject extends over a plurality of grids, motion vectors of different subjects can be detected in each grid. Therefore, it is possible to prevent deterioration in image blur correction accuracy due to detection of a moving subject.
なお、本実施形態では、入力画像を水平方向6個、垂直方向4個のグリッドに分割したが、分割数はこの値に限定されるものではない。また、画像信号の読み出し順は必ずしも本実施形態と同じでなくてもよい。また、各グリッドの特徴点と、隣接グリッドの特徴点との距離の算出式は、必ずしも本実施形態と同じでなくてもよい。 In the present embodiment, the input image is divided into six horizontal grids and four vertical grids, but the number of divisions is not limited to this value. Further, the reading order of the image signals is not necessarily the same as in the present embodiment. Further, the calculation formula for the distance between the feature point of each grid and the feature point of the adjacent grid is not necessarily the same as that of the present embodiment.
<第2の実施形態>
以下、本発明の第2の実施形態について説明する。第2の実施形態の画像処理装置の構成、グリッド分割方法、分割画像信号の処理順序、動きベクトル検出部の構成、動きベクトル検出シーケンスは第1の実施形態と同様であるため、説明を省略する。第2の実施形態では、特徴点算出部の構成、及び特徴点の決定方法が第1の実施形態と異なる。
<Second Embodiment>
Hereinafter, a second embodiment of the present invention will be described. The configuration of the image processing apparatus, the grid division method, the processing order of the divided image signals, the configuration of the motion vector detection unit, and the motion vector detection sequence according to the second embodiment are the same as those in the first embodiment, and thus description thereof is omitted. . In the second embodiment, the configuration of the feature point calculation unit and the feature point determination method are different from those in the first embodiment.
図8は、本実施形態における特徴点算出部の構成を示した図である。特徴フィルタ部401、特徴評価部402、座標算出部403は、第1の実施形態と同様であるため、説明を省略する。第2の実施形態では、特徴点決定部801、特徴点決定部801がSRAM802にアクセスする情報が第1の実施形態と異なる。
FIG. 8 is a diagram illustrating a configuration of the feature point calculation unit in the present embodiment. Since the
特徴点決定部801は、グリッド毎に特徴点を決定し、グリッド番号、特徴点の第1候補である第1特徴点座標、第2候補である第2特徴点座標、第2特徴点の評価値をSRAM802に格納する。本実施形態ではグリッド501に対して、グリッド内で一番特徴値の大きい画素の座標を第1特徴点座標、第1特徴点座標との距離がCPU204から設定された隣接座標閾値以上となる画素の中で、グリッド内で特徴値が一番大きい座標を第2特徴点座標とする。特徴点決定部801は、SRAM802に格納した各グリッドの第1特徴点座標、第2特徴点座標、第2特徴点の評価値をSRAM802から読み出すことが可能である。
The feature
本実施形態では、隣接グリッド間の第1特徴点座標同士(特徴点候補同士)の距離が隣接座標閾値未満の場合、隣接グリッド間の第2特徴点評価値を比較して、第2特徴点評価値の大きい方のグリッドについては、第1特徴点座標を第2特徴点座標に変更する。第2特徴点評価値が小さい方のグリッドは、第1特徴点座標を変更しない。これにより、各グリッド間の特徴点座標の距離が隣接座標閾値以上となり、更に第1の実施形態よりも、各グリッドでより評価値の高い座標を特徴点として選択することが出来る。 In the present embodiment, when the distance between the first feature point coordinates between adjacent grids (feature point candidates) is less than the adjacent coordinate threshold value, the second feature point evaluation value between the adjacent grids is compared and the second feature point is compared. For the grid having the larger evaluation value, the first feature point coordinates are changed to the second feature point coordinates. The grid with the smaller second feature point evaluation value does not change the first feature point coordinates. Thereby, the distance of the feature point coordinate between each grid becomes more than an adjacent coordinate threshold value, and also the coordinate with a higher evaluation value in each grid can be selected as the feature point than in the first embodiment.
第1特徴点座標を第2特徴点座標に変更する場合、特徴点決定部801は、SRAM802から読み出した第2特徴点座標を第1特徴点座標としてSRAM802に上書きする。この時、特徴点決定部801は、第2特徴点評価値を最小値で上書きする。これは以降のグリッドの特徴点算出時に、既に第1特徴点座標を第2特徴点座標に変更したグリッドの特徴点座標が更に変更されないようにするためである。
When changing the first feature point coordinates to the second feature point coordinates, the feature
なお、本実施形態では、第2特徴点座標、第2特徴点評価値をSRAM802に書き出したが、更に多くの特徴点座標、特徴点評価値をSRAM802に書き出しても良い。例えば、隣接するグリッドは最大8つあるため(左上・上・右上・左・右・左下・下・右下)、9つの特徴点座標、特徴点評価値をSRAM802に書き出してもよい。9つの特徴点座標、特徴点評価値をSRAM802に書き出せば、1つのグリッドに対して第1特徴点座標を最大8回変更することが出来る。特徴点決定部801は、決定した各グリッドの特徴点座標を、マッチング処理部105が対応するグリッドのテンプレートマッチング処理を開始する時に、メモリアドレス生成部106へ出力する。
In the present embodiment, the second feature point coordinates and the second feature point evaluation values are written in the
図9は、本実施形態における特徴点の決定方法を説明するための図である。テンプレート画像、サーチ画像、余分画素領域、絶対座標の算出方法は第1の実施形態と同じである。本実施形態では、各グリッドで第1特徴点座標と第2特徴点座標の2つの特徴点座標を算出する点が第1の実施形態と異なる。本実施形態では、画素503(PX,PY)がグリッド501内で特徴値の最も大きい画素、画素503−2(PX4,PY4)がグリッド501内で特徴値の2番目に大きい画素であるとする。
FIG. 9 is a diagram for explaining a feature point determination method according to this embodiment. The template image, search image, extra pixel area, and absolute coordinate calculation method are the same as in the first embodiment. This embodiment is different from the first embodiment in that two feature point coordinates, that is, a first feature point coordinate and a second feature point coordinate are calculated in each grid. In the present embodiment, it is assumed that the pixel 503 (PX, PY) is the pixel having the largest feature value in the
本実施形態では、第1特徴点座標との水平距離・垂直距離のどちらかがCPU204から設定された隣接座標閾値以上となる画素の中で、特徴値の最も大きい画素を第2特徴点とする。本実施形態では、画素503(PX,PY)と画素503−2(PX4,PY4)の水平距離DX3、垂直距離DY3は共にCPU204から設定された隣接座標閾値以上であるとする。よって、画素503(PX,PY)を第1特徴点座標、画素503−2(PX4,PY4)を第2特徴点座標として選択する。
In the present embodiment, the pixel having the largest feature value among the pixels whose horizontal distance or vertical distance from the first feature point coordinate is equal to or greater than the adjacent coordinate threshold set by the
(DX3,DY3)=(|PX4−PX|,|PY4−PY|) …(式9)
他のグリッドに対しても同様に第1特徴点座標、第2特徴点座標を算出する。グリッド508−5内における第1特徴点が509、グリッド508−10内における第1特徴点が512であるとする。また、グリッド508−7内における第1特徴点510の座標が(PX5,PY5)、第2特徴点510−2の座標が(PX6,PY6)、グリッド508−8内における第1特徴点511の座標が(PX7,PY7)、第2特徴点511−2の座標が(PX8,PY8)であるとする。
(DX3, DY3) = (| PX4-PX |, | PY4-PY |) (Formula 9)
Similarly, the first feature point coordinates and the second feature point coordinates are calculated for the other grids. It is assumed that the first feature point in the grid 508-5 is 509 and the first feature point in the grid 508-10 is 512. The coordinates of the
本実施形態では、グリッド508−7内の第1特徴点510、及び第2特徴点510−2は、隣接グリッドの特徴点503−2、509からの距離が、CPU204から設定された隣接座標閾値以上であるとする。また、グリッド508−8内の第1特徴点511、及び第2特徴点511−2は、隣接グリッドの特徴点503−2,509,512からの距離が、CPU204から設定された隣接座標閾値以上であるとする。また、画素510(PX5,PY5)と画素511(PX7,PY7)の水平距離DX4、垂直距離DY4は共にCPU204から設定された隣接座標閾値未満であるとする。
In the present embodiment, the
(DX4,DY4)=(|PX7−PX5|,|PY7−PY5|) …(式10)
本実施形態では、グリッド508−7、グリッド508−8に対して、第2特徴点評価値の大きい方のグリッドは第1特徴点座標を第2特徴点座標に変更し、第2特徴点評価値の小さい方のグリッドは第1特徴点座標を変更しないものとする。本実施形態では、グリッド508−7の第2特徴点510−2(PX6,PY6)の評価値の方が、グリッド508−8の第2特徴点511−2(PX8,PY8)の評価値より大きいとする。よって、グリッド508−7の第1特徴点を第2の特徴点510−2(PX6,PY6)に変更し、グリッド508−8の第1特徴点は画素511(PX7,PY7)のまま変更しない。これにより、第1特徴点座標を第2特徴点座標に変更する際、より評価値の大きな第2特徴点座標を特徴点として選択することが出来る。
(DX4, DY4) = (| PX7-PX5 |, | PY7-PY5 |) (Formula 10)
In the present embodiment, the grid with the larger second feature point evaluation value is changed from the first feature point coordinate to the second feature point coordinate with respect to the grid 508-7 and the grid 508-8, and the second feature point evaluation is performed. It is assumed that the grid with the smaller value does not change the first feature point coordinates. In the present embodiment, the evaluation value of the second feature point 510-2 (PX6, PY6) of the grid 508-7 is more than the evaluation value of the second feature point 511-2 (PX8, PY8) of the grid 508-8. Suppose it's big. Therefore, the first feature point of the grid 508-7 is changed to the second feature point 510-2 (PX6, PY6), and the first feature point of the grid 508-8 remains unchanged as the pixel 511 (PX7, PY7). . Accordingly, when the first feature point coordinates are changed to the second feature point coordinates, the second feature point coordinates having a larger evaluation value can be selected as the feature points.
以上説明したように、本実施形態の制御により、第1実施形態より評価値の大きい座標を特徴点として選択出来るため、より像ブレ補正精度の劣化を防ぐことが出来る。これにより、被写体が複数のグリッドにまたがった場合においても、各グリッドで異なる被写体の動きベクトルを検出し、動体の被写体検出による像ブレ補正精度の劣化をより防ぐことが出来る。 As described above, the control of the present embodiment can select coordinates having a larger evaluation value than that of the first embodiment as feature points, and thus can further prevent deterioration in image blur correction accuracy. Thereby, even when the subject extends over a plurality of grids, motion vectors of different subjects can be detected in each grid, and deterioration in image blur correction accuracy due to detection of a moving subject can be further prevented.
なお、本実施形態では、入力画像を水平方向6個、垂直方向4個のグリッドに分割したが、分割数はこの値に限定されるものではない。また、画像信号の読み出し順は必ずしも本実施形態と同じでなくてもよい。また、各グリッドの特徴点と、隣接グリッドの特徴点との距離の算出式は、必ずしも本実施形態と同じでなくてもよい。また、本実施形態では各グリッドで記憶する特徴点座標の数は2つであるが、必ずしも2つでなくてもよい。 In the present embodiment, the input image is divided into six horizontal grids and four vertical grids, but the number of divisions is not limited to this value. Further, the reading order of the image signals is not necessarily the same as in the present embodiment. Further, the calculation formula for the distance between the feature point of each grid and the feature point of the adjacent grid is not necessarily the same as that of the present embodiment. Further, in the present embodiment, the number of feature point coordinates stored in each grid is two, but the number is not necessarily two.
(その他の実施形態)
本発明は、上述の実施形態の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:特徴点算出部、105:マッチング処理部、106:メモリアドレス生成部、210:動きベクトル検出部、212:DRAM 101: Grid division unit, 102: Vector detection image generation unit, 103: Feature point calculation unit, 105: Matching processing unit, 106: Memory address generation unit, 210: Motion vector detection unit, 212: DRAM
Claims (12)
前記領域分割手段により分割された分割領域ごとに画素の特徴値を算出して、特徴点を選択する特徴点選択手段と、
前記分割領域ごとの特徴点に基づいてマッチング処理に使用する画像領域を決定し、動きベクトルを算出する動きベクトル算出手段と、を備え、
前記特徴点選択手段は、複数の前記分割領域のうちの1つである第1の分割領域における特徴点と、該第1の分割領域に隣接する第2の分割領域における特徴点の距離が所定距離以上となるように、前記分割領域ごとに特徴点を選択することを特徴とする画像処理装置。 Area dividing means for dividing one image into a plurality of areas;
Calculating a feature value of a pixel for each divided region divided by the region dividing unit, and selecting a feature point; and
A motion vector calculating means for determining an image region to be used for matching processing based on a feature point for each of the divided regions and calculating a motion vector;
The feature point selection means has a predetermined distance between a feature point in a first divided area that is one of the plurality of divided areas and a feature point in a second divided area adjacent to the first divided area. An image processing apparatus, wherein a feature point is selected for each of the divided regions so as to be equal to or greater than a distance.
前記領域分割工程により分割された分割領域ごとに画素の特徴値を算出して、特徴点を選択する特徴点選択工程と、
前記分割領域ごとの特徴点に基づいてマッチング処理に使用する画像領域を決定し、動きベクトルを算出する動きベクトル算出工程と、を有し、
前記特徴点選択工程では、複数の前記分割領域のうちの1つである第1の分割領域における特徴点と、該第1の分割領域に隣接する第2の分割領域における特徴点の距離が所定距離以上となるように、前記分割領域ごとに特徴点を選択することを特徴とする画像処理方法。 A region dividing step of dividing one image into a plurality of regions;
Calculating a feature value of a pixel for each divided region divided by the region dividing step, and selecting a feature point; and
A motion vector calculation step of determining an image region to be used for matching processing based on a feature point for each divided region and calculating a motion vector;
In the feature point selection step, a distance between a feature point in the first divided region that is one of the plurality of divided regions and a feature point in a second divided region adjacent to the first divided region is predetermined. An image processing method, wherein a feature point is selected for each of the divided regions so as to be equal to or greater than a distance.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016225370A JP2018081640A (en) | 2016-11-18 | 2016-11-18 | Image processing device, image processing method, program and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016225370A JP2018081640A (en) | 2016-11-18 | 2016-11-18 | Image processing device, image processing method, program and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2018081640A true JP2018081640A (en) | 2018-05-24 |
Family
ID=62198874
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016225370A Pending JP2018081640A (en) | 2016-11-18 | 2016-11-18 | Image processing device, image processing method, program and storage medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2018081640A (en) |
-
2016
- 2016-11-18 JP JP2016225370A patent/JP2018081640A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10366504B2 (en) | Image processing apparatus and image processing method for performing three-dimensional reconstruction of plurality of images | |
JP6570296B2 (en) | Image processing apparatus, image processing method, and program | |
US9183634B2 (en) | Image processing apparatus and image processing method | |
US20180336688A1 (en) | Image processing apparatus and image processing method, and storage medium | |
US9942477B2 (en) | Image processing apparatus and method | |
US20160005158A1 (en) | Image processing device and image processing method | |
WO2019123554A1 (en) | Image processing device, image processing method, and recording 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 | |
US20190306417A1 (en) | Image processing apparatus, image capturing apparatus, image processing method, and storage medium | |
JP6576179B2 (en) | Image processing apparatus, image processing method, and program | |
US9270883B2 (en) | Image processing apparatus, image pickup apparatus, image pickup system, image processing method, and non-transitory computer-readable storage medium | |
JP6178646B2 (en) | Imaging apparatus and image shake correction processing method | |
JP2019067169A (en) | Moving vector calculation method, device, program, and moving vector calculation method including noise cancellation processing | |
WO2017187935A1 (en) | Information processing apparatus, information processing method, and program | |
JP6579816B2 (en) | Image processing apparatus, image processing method, and program | |
JP2018081640A (en) | Image processing device, image processing method, program and storage medium | |
JP7077115B2 (en) | Image processing equipment, image processing methods, and programs | |
JP2019192048A (en) | Imaging apparatus | |
JP2019176261A (en) | Image processor | |
JP2018072941A (en) | Image processing device, image processing method, program, and storage medium | |
JP2018072942A (en) | Image processing apparatus, image processing method, program, and storage medium | |
JP2018067058A (en) | Image processing device, image processing method, program, and recording medium | |
JP6624841B2 (en) | Image processing apparatus, image processing method, and program | |
JP6831792B2 (en) | Imaging device and imaging system | |
JP2021107976A (en) | Image processing device, image processing method, and program |