JP2018081640A - Image processing device, image processing method, program and storage medium - Google Patents

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

Info

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
Application number
JP2016225370A
Other languages
Japanese (ja)
Inventor
総一郎 鈴木
Soichiro Suzuki
総一郎 鈴木
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 JP2016225370A priority Critical patent/JP2018081640A/en
Publication of JP2018081640A publication Critical patent/JP2018081640A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To suppress erroneous detection of a motion vector in detection of the motion vector using grid division.SOLUTION: An image processing device comprises: an area division unit that divides one image into a plurality of areas; a feature point selection unit that calculates a feature value of a pixel for each divided area divided by the area division unit to select a feature point; and a motion vector calculation unit that determines an image area to use in matching processing based on the feature point for each divided area, and calculates a motion vector. The feature point selection unit selects the feature point for each divided area such that a distance between the feature point in a first divided area being one of the plurality of divided areas and the feature point in a second divided area being adjacent to the first divided area is more than or equal to a predetermined distance.SELECTED DRAWING: Figure 4

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 Patent Document 1, in order to uniformly distribute feature points, an image is divided into grids, and feature values representing the size of the features are calculated for each pixel. A pixel having the largest feature value is extracted as a feature point.

図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 Patent Document 1, template blocks are arranged at the feature points, and template matching is performed. In FIG. 10, 1001 is an image, 1002-1 is a grid, 1010-1 is a feature point in the grid, 1003 is a template, and 1004 is a search range for the template. In the grid 1002-1, template matching is performed based on the template 1003 with the feature point 1010-1 as the center of gravity. Also, 1020-2 is a feature point obtained from the subject 1020 in the grid 1002-2. In this way, feature points are obtained for each grid, template matching is performed, motion vectors are detected, and image blur correction is performed. By obtaining the feature points of the subject for each grid, the distribution of the feature points can be made uniform without being biased to the region where the features are concentrated.

特開2008−192060号公報JP 2008-192060 A

しかし、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 subject 1030 extends over four grids 1002-3 to 1002-6, feature points 1030-3 to 1030-for one subject 1030 in each of the four grids 1002-3 to 1002-6. 6 will be detected. Here, when the subject 1030 is a moving body having a motion different from the camera shake, a plurality of motion vectors different from the camera shake are erroneously detected, and there is a problem that the image blur correction accuracy is lowered.

本発明は上述した課題に鑑みてなされたものであり、その目的は、グリッド分割を用いた動きベクトルの検出において、動きベクトルの誤検出を抑制することである。   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.

本発明の第1の実施形態に係わる画像処理装置の構成を示す図。1 is a diagram showing a configuration of an image processing apparatus according to a first embodiment of the present invention. 画像信号のグリッド分割方法を示す図。The figure which shows the grid division | segmentation method of an image signal. 分割された画像信号の処理順序を示す図。The figure which shows the processing order of the divided image signal. 動きベクトル検出部の構成を示す図。The figure which shows the structure of a motion vector detection part. 第1の実施形態における特徴点算出部の構成を示す図。The figure which shows the structure of the feature point calculation part in 1st Embodiment. 第1の実施形態における特徴点決定方法を説明する図。The figure explaining the feature point determination method in 1st Embodiment. 第1の実施形態における動きベクトル検出動作を示す図。The figure which shows the motion vector detection operation | movement in 1st Embodiment. 第2の実施形態における特徴点算出部の構成を示す図。The figure which shows the structure of the feature point calculation part in 2nd Embodiment. 第2の実施形態における特徴点決定方法を説明する図。The figure explaining the feature point determination method in 2nd Embodiment. 従来の動きベクトル検出方法を説明する図。The figure explaining the conventional motion vector detection method.

以下、本発明の実施形態について、添付図面を参照して詳細に説明する。   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 optical system 201 includes a lens, a diaphragm, and the like, and performs focus adjustment and exposure adjustment. The image sensor 202 is composed of a CCD, a CMOS sensor, or the like, and converts an optical image into an electrical signal. The A / D conversion circuit 203 converts an analog image signal output from the image sensor 202 into digital image data. The CPU 204 manages various controls of the entire image processing apparatus via the bus. The DRAM 212, which is a memory, stores data. The motion vector detection unit 210 detects a motion vector from at least two consecutive frame image signals and notifies the CPU 204 of the detection result. The image processing unit 211 performs various types of image processing such as lens distortion correction processing and image blur correction processing based on the motion vector detected by the motion vector detection unit 210 on the image signal. The display unit 205 displays the image data generated by the image processing unit 211 on a liquid crystal display or the like. The recording unit 206 records the image data generated by the image processing unit 211 on a medium or the like.

図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 image signal 550 is divided into six regions (grids) in the horizontal direction and four in the vertical direction. The number of grid divisions and the grid image size are set for the motion vector detection unit 210 by the CPU 204. In subsequent processing, a feature point 503 is obtained for the grid 501, and the position (image region) of the template image 504 and the position (image region) of the search image 505 are determined according to the obtained feature point, and template matching is performed. .

特徴点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 feature point 503 are the coordinates in the grid 501. The template image 504 and the search image 505 may protrude from the grid 501 depending on the position of the feature point 503. Therefore, an upper extra area 506 that is referred to when the template image 504 and the search image 505 protrude beyond the grid 501 is necessary. For the grid 508-5, a feature point 513 is obtained, and the position of the template image 514 and the search image 515 are determined according to the obtained feature point, and template matching is performed. In the present embodiment, the feature point 513 in the grid 508-5 is determined from points where the distance from the feature point 503 in the grid 501 is equal to or greater than the adjacent coordinate threshold set by the CPU 204.

図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 grid 501 is read out, and then the image signal of the grid 501 is read out. When the image signal of the grid 501 is read out, the image signal of the horizontal grid is read out in the order of the grid 508-5 and the grid 508-10.

図4は、本実施形態における動きベクトル検出部210の構成を示す図である。グリッド分割部101は、CPU204により設定されたグリッド分割情報に基づいて画像を複数領域(本実施形態ではグリッドと呼ぶ)に分割する。グリッド分割部101は、後段のベクトル検出画像生成部102に対し、画像信号550を前述した余分領域を含めた分割領域単位で出力する。ベクトル検出画像生成部102は、ベクトル検出用の画像(ベクトル算出画像)を生成する。生成されたベクトル検出画像は、DRAM212に格納される。DRAM212には、現時点のベクトル検出画像と、1フレーム前のベクトル検出画像の、2フレーム分のベクトル検出画像が記憶されている。本実施形においては、現時点のベクトル検出画像をテンプレート画像とし、1フレーム前のベクトル検出画像をサーチ画像として、テンプレートマッチングを行う。   FIG. 4 is a diagram illustrating a configuration of the motion vector detection unit 210 in the present embodiment. The grid division unit 101 divides an image into a plurality of regions (referred to as grids in the present embodiment) based on grid division information set by the CPU 204. The grid division unit 101 outputs the image signal 550 to the subsequent vector detection image generation unit 102 in units of divided regions including the above-described extra regions. The vector detection image generation unit 102 generates an image for vector detection (vector calculation image). The generated vector detection image is stored in the DRAM 212. The DRAM 212 stores a vector detection image for two frames, a current vector detection image and a vector detection image one frame before. In this embodiment, template matching is performed using the current vector detection image as a template image and the vector detection image one frame before as a search image.

特徴点算出部(特徴点選択部)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 point calculation unit 103 receives only the image signal of the grid unit that does not include the extra area. Also, a grid number for determining which grid area the image signal is an image and the coordinates of the origin at the upper left of the grid in the image signal are input from the grid dividing unit 101. In this embodiment, the grid number of the grid 501 is 1, and the grid number of the grid 508-5 is 2, and an identifiable number is assigned to each grid. The feature point calculation unit 103 calculates a feature point for each grid based on the grid unit image signal from the grid division unit 101, the grid number, the grid origin coordinates, the grid division information set by the CPU 204, and the adjacent coordinate threshold value. . The memory address generation unit 106 determines the reading position of the template image and the search image from the DRAM 212 according to the detection result of the feature point. The matching processing unit 105 performs template matching processing using the template image read from the DRAM 212 and the search image. The horizontal and vertical sizes of the template image and the horizontal and vertical sizes of the search image are set in the memory address generation unit 106 and the matching processing unit 105 by the CPU 204.

図5は、特徴点算出部103の構成を示した図である。特徴点算出部103は、特徴フィルタ部401、特徴評価部402、座標算出部403、特徴点決定部404、特徴点決定部404がアクセスするSRAM0405を備えて構成されている。   FIG. 5 is a diagram illustrating a configuration of the feature point calculation unit 103. The feature point calculation unit 103 includes a feature filter unit 401, a feature evaluation unit 402, a coordinate calculation unit 403, a feature point determination unit 404, and an SRAM 0405 that is accessed by the feature point determination unit 404.

特徴フィルタ部401は、例えば、バンドパスフィルタ、水平微分フィルタ、垂直微分フィルタ、平滑化フィルタなど、複数のフィルタから構成される。本実施形態においては、バンドパスフィルタで不要な画像信号の高周波成分と低周波成分をカットし、水平方向の微分フィルタ処理を施した信号と、垂直方向の微分フィルタ処理を施した信号、それぞれに対して、平滑化フィルタ処理を施した信号を出力する。   The feature filter unit 401 includes a plurality of filters such as a band pass filter, a horizontal differential filter, a vertical differential filter, and a smoothing filter, for example. In the present embodiment, a high-frequency component and a low-frequency component of an unnecessary image signal are cut by a band-pass filter, and a signal subjected to horizontal differential filter processing and a signal subjected to vertical differential filter processing are respectively applied to On the other hand, a signal subjected to smoothing filter processing is output.

特徴評価部402は、特徴フィルタ部401によりフィルタ処理されたグリッドの画像信号に対し、画素ごとに2つのエッジの交点や曲率が極大である曲線状の点など画素の周辺の微分値が多方向に大きい点を特徴評価式により特徴値として算出する。本実施形態では、例えば、Shi and Tomasiの手法を用いる場合について説明する。水平微分フィルタと垂直微分フィルタを施した結果から、自己相関行列Hを作成する。自己相関行列Hの式を(式1)に示す。   The feature evaluation unit 402 has a multi-directional differential value around a pixel such as an intersection of two edges or a curved point having a maximum curvature for each pixel with respect to the grid image signal filtered by the feature filter unit 401. Is calculated as a feature value by a feature evaluation formula. In the present embodiment, for example, a case where the Shi and Tomasi method is used will be described. An autocorrelation matrix H is created from the result of applying the horizontal differential filter and the vertical differential filter. An expression of the autocorrelation matrix H is shown in (Expression 1).

Figure 2018081640
Figure 2018081640

(式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 calculation unit 403 calculates absolute coordinates in the image signal of the pixel being processed from the origin coordinates of the grid and the image signal in grid units. The feature point determination unit 404 determines a feature point for each grid, and stores the grid number and the feature point coordinates in the SRAM 405. In the present embodiment, the feature point determination unit 404 uses the pixel having the largest feature value calculated by the feature evaluation unit 402 in the grid 501 as the feature point. The feature point determination unit 404 can read out the feature point coordinates of each grid stored in the SRAM 405 from the SRAM 405.

特徴点決定部404は、現在処理中のグリッド番号、及びCPU204に設定されたグリッド分割情報から隣接グリッド番号を算出し、SRAM405から隣接グリッドの特徴点座標を読み出す。本実施形態では、特徴点決定部404は、グリッド508−5の特徴点算出時において、既に特徴点を算出した隣接グリッド501の特徴点座標をSRAM405から読み出す。また、特徴点決定部404はグリッド508−5の特徴点算出時において、隣接グリッド501の特徴点座標との距離がCPU204から設定された隣接座標閾値以上(所定距離以上)となる画素の中で、特徴値が最も大きい画素を特徴点とする。   The feature point determination unit 404 calculates the adjacent grid number from the currently processed grid number and the grid division information set in the CPU 204, and reads the feature point coordinates of the adjacent grid from the SRAM 405. In the present embodiment, the feature point determination unit 404 reads from the SRAM 405 the feature point coordinates of the adjacent grid 501 whose feature points have already been calculated at the time of calculating the feature points of the grid 508-5. In addition, the feature point determination unit 404 calculates a feature point of the grid 508-5 among pixels whose distance from the feature point coordinates of the adjacent grid 501 is equal to or greater than the adjacent coordinate threshold set by the CPU 204 (more than a predetermined distance). The pixel having the largest feature value is defined as a feature point.

以降同様に、他のグリッドの特徴点算出時において、隣接グリッドの特徴点座標との距離が隣接座標閾値以上となる画素の中で、特徴値が最も大きい画素を特徴点とする。グリッド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 adjacent grid 501, but in the other grids, the maximum four upper left, upper, upper right, and left adjacent grids have already calculated feature points. Will become the adjacent grid. In this case, the pixel having the largest feature value among the pixels whose distance from the feature point coordinates of the four adjacent grids is equal to or greater than the adjacent coordinate threshold is set as the feature point. Further, the feature point determination unit 404 outputs the feature point coordinates to the memory address generation unit 106 when the matching processing unit 105 starts the template matching process of the corresponding grid.

図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. Reference numeral 502 denotes an origin coordinate of the grid 501, and coordinates (PX, PY) of the pixel 503 are relative coordinates from the grid origin 502. In the present embodiment, it is assumed that the pixel 503 whose coordinates are (PX, PY) is the pixel having the largest feature value in the grid 501. 503 is a feature point coordinate, 504 is a template image, 505 is a search image, 506 is a template image read start coordinate, and 507 is a search image read start coordinate. Reference numerals 508-1, 2, 3, 4, 6, and 11 are extra pixel areas necessary for the template matching process.

特徴点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 address generation unit 106 reads the rectangular area of the horizontal size TX and the vertical size TY from the coordinates (GTX, GTY) as a template image for the vector detection image of the current frame arranged in the DRAM 212. Issue. Similarly, a memory address is issued so that a rectangular area having a horizontal size SX and a vertical size SY is read from the coordinates (GMX, GMY) as a search image for the vector detection image one frame before arranged in the DRAM 212. To do. The horizontal and vertical sizes of the template image and the horizontal and vertical sizes of the search image are set for the memory address generation unit 106 and the matching processing unit 105 by the CPU 204.

マッチング処理部105は、DRAM212から読み出されたテンプレート画像とサーチ画像を用いて相関値を算出し、その相関値からベクトル値を算出する。例えば、相関値の算出方法の一例として差分絶対値和(Sum of Absolute Difference、以下SADと略す)を使用する。   The matching processing unit 105 calculates a correlation value using the template image read from the DRAM 212 and the search image, and calculates a vector value from the correlation value. For example, a sum of absolute difference (hereinafter abbreviated as SAD) is used as an example of a correlation value calculation method.

Figure 2018081640
Figure 2018081640

…(式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 template image 504, and g (i, j) is the target of correlation value calculation in the search image 505. Represents each pixel value in the region. The correlation value calculation target area is the same size as the template image 504. In SAD, the absolute value of the difference is calculated for each pixel value f (i, j) and g (i, j) in both blocks, and the correlation value S_SAD can be obtained by obtaining the sum. Therefore, the smaller the correlation value S_SAD, the smaller the difference in luminance value between the two blocks, that is, the template image 504 and the texture in the correlation value calculation region are similar. In the present embodiment, SAD is used as an example of a correlation value, but the present invention is not limited to this, and other correlation values such as sum of squares of differences (SSD) and normalized cross correlation (NCC) are used. May be. Then, the position (MVX, MVY) of the minimum value of the correlation value is output as a grid motion vector value.

他のグリッドに対しても同様に動きベクトル値を算出する。本実施形態では、グリッド内の特徴点の決定時において、隣接するグリッドの特徴点座標との距離が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 CPU 204 is characterized. Let it be a point. In this embodiment, the pixel having the largest feature value in the grid 508-5 is 509, the pixel having the largest feature value in the grid 508-10 is 512, and the pixel having the largest feature value in the grid 508-7 is 510. It shall be. In the present embodiment, in the grids 501, 508-5, 508-10, and 508-7, the distance between the pixels having the largest feature value is equal to or greater than the adjacent coordinate threshold set by the CPU 204. Therefore, the pixel having the largest feature value in each grid is a feature point.

一方、グリッド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 point determination unit 404, when determining the feature point of the grid 508-8, has the largest feature value among the pixels whose distance from the feature point of the adjacent grid is equal to or greater than the adjacent coordinate threshold set by the CPU 204. A large pixel is a feature point. In the present embodiment, the pixel having the largest feature value among the pixels in which either the horizontal distance or the vertical distance from the feature point of the adjacent grid is equal to or greater than the adjacent coordinate threshold is set as the feature point. In this embodiment, the horizontal distance DX1 and the vertical distance DY1 of the pixel 511-1 (PX2, PY2) and the feature point 510 (PX1, PY1) of the left adjacent grid 508-7 are both less than the adjacent coordinate threshold. And Therefore, in this embodiment, the pixel 511-1 (PX2, PY2) is not selected as a feature point of the grid 508-8.

(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 CPU 204 sets the number of grid divisions, the grid image size, and the extra area size in the grid division unit 101 (S701). The CPU 204 sets the horizontal / vertical size of the template image and the horizontal / vertical size of the search image in the memory address generation unit 106 and the matching processing unit 105 (S702). The CPU 204 sets an adjacent coordinate threshold value in the feature point calculation unit 103 (S703). The CPU 204 instructs the imaging optical system 201 and the image sensor 202 to acquire an image signal, and instructs the motion vector detection unit 210 to start motion vector detection (S704). When the CPU 204 receives a notification of detection completion from the motion vector detection unit 210 (S705), the CPU 204 acquires the detected motion vector data (S706).

以上説明したように、第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 feature filter unit 401, the feature evaluation unit 402, and the coordinate calculation unit 403 are the same as those in the first embodiment, description thereof is omitted. In the second embodiment, the feature point determination unit 801 and the information for the feature point determination unit 801 to access the SRAM 802 are different from those in the first embodiment.

特徴点決定部801は、グリッド毎に特徴点を決定し、グリッド番号、特徴点の第1候補である第1特徴点座標、第2候補である第2特徴点座標、第2特徴点の評価値をSRAM802に格納する。本実施形態ではグリッド501に対して、グリッド内で一番特徴値の大きい画素の座標を第1特徴点座標、第1特徴点座標との距離がCPU204から設定された隣接座標閾値以上となる画素の中で、グリッド内で特徴値が一番大きい座標を第2特徴点座標とする。特徴点決定部801は、SRAM802に格納した各グリッドの第1特徴点座標、第2特徴点座標、第2特徴点の評価値をSRAM802から読み出すことが可能である。   The feature point determination unit 801 determines a feature point for each grid, and evaluates the grid number, the first feature point coordinate that is the first candidate of the feature point, the second feature point coordinate that is the second candidate, and the second feature point. The value is stored in the SRAM 802. In this embodiment, with respect to the grid 501, the coordinates of the pixel having the largest feature value in the grid are the first feature point coordinates, and the distance between the first feature point coordinates and the adjacent coordinate threshold set by the CPU 204 is greater than or equal to the pixel. The coordinate having the largest feature value in the grid is defined as the second feature point coordinate. The feature point determination unit 801 can read out the first feature point coordinates, the second feature point coordinates, and the evaluation values of the second feature points of each grid stored in the SRAM 802 from the SRAM 802.

本実施形態では、隣接グリッド間の第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 point determination unit 801 overwrites the SRAM 802 with the second feature point coordinates read from the SRAM 802 as the first feature point coordinates. At this time, the feature point determination unit 801 overwrites the second feature point evaluation value with the minimum value. This is to prevent further change of the feature point coordinates of the grid that has already been changed from the first feature point coordinates to the second feature point coordinates when calculating the feature points of the grid thereafter.

なお、本実施形態では、第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 SRAM 802. However, more feature point coordinates and feature point evaluation values may be written in the SRAM 802. For example, since there are eight adjacent grids (upper left, upper, upper right, left, right, lower left, lower, lower right), nine feature point coordinates and feature point evaluation values may be written to the SRAM 802. If nine feature point coordinates and feature point evaluation values are written in the SRAM 802, the first feature point coordinates can be changed a maximum of eight times for one grid. The feature point determination unit 801 outputs the determined feature point coordinates of each grid to the memory address generation unit 106 when the matching processing unit 105 starts template matching processing of the corresponding grid.

図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 grid 501 and the pixel 503-2 (PX4, PY4) is the second largest pixel in the grid 501. .

本実施形態では、第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 CPU 204 is set as the second feature point. . In the present embodiment, it is assumed that the horizontal distance DX3 and the vertical distance DY3 between the pixel 503 (PX, PY) and the pixel 503-2 (PX4, PY4) are both equal to or larger than the adjacent coordinate threshold set by the CPU 204. Therefore, the pixel 503 (PX, PY) is selected as the first feature point coordinate, and the pixel 503-2 (PX4, PY4) is selected as the second feature point coordinate.

(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 first feature point 510 in the grid 508-7 are (PX5, PY5), the coordinates of the second feature point 510-2 are (PX6, PY6), and the first feature point 511 in the grid 508-8 is Assume that the coordinates are (PX7, PY7) and the coordinates of the second feature point 511-2 are (PX8, PY8).

本実施形態では、グリッド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 first feature point 510 and the second feature point 510-2 in the grid 508-7 are adjacent coordinates threshold values set by the CPU 204 with distances from the feature points 503-2 and 509 of the adjacent grid. Suppose that it is above. Further, the first feature point 511 and the second feature point 511-2 in the grid 508-8 have a distance from the adjacent grid feature points 503-2, 509, and 512 equal to or greater than the adjacent coordinate threshold set by the CPU 204. Suppose that Further, it is assumed that the horizontal distance DX4 and the vertical distance DY4 between the pixel 510 (PX5, PY5) and the pixel 511 (PX7, PY7) are both less than the adjacent coordinate threshold set by the CPU 204.

(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の分割領域における特徴点と、該第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に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the feature point selection unit causes the storage unit to store one feature point for each of the divided regions. 前記特徴点選択手段は、前記分割領域ごとに、複数の特徴点候補の画素の座標と該複数の特徴点候補の画素の特徴値とを記憶手段に記憶させることを特徴とする請求項1に記載の画像処理装置。   2. The feature point selecting means stores, for each of the divided regions, the coordinates of a plurality of feature point candidate pixels and the feature values of the plurality of feature point candidate pixels in a storage means. The image processing apparatus described. 前記特徴点選択手段は、前記分割領域ごとに、少なくとも、前記特徴値が最も大きい第1の特徴点候補と、前記特徴値が2番目に大きい第2の特徴点候補とを記憶手段に記憶させることを特徴とする請求項3に記載の画像処理装置。   The feature point selection unit stores, for each divided region, at least a first feature point candidate having the largest feature value and a second feature point candidate having the second largest feature value in a storage unit. The image processing apparatus according to claim 3. 前記特徴点選択手段は、前記第1の分割領域における前記第1の特徴点候補と、前記第2の分割領域における前記第1の特徴点候補の距離が所定距離より小さかった場合に、前記記憶手段に記憶した前記第1及び第2の分割領域それぞれにおける前記第2の特徴点候補の特徴値を比較することにより、特徴点を選択することを特徴とする請求項4に記載の画像処理装置。   The feature point selection means stores the memory when the distance between the first feature point candidate in the first divided region and the first feature point candidate in the second divided region is smaller than a predetermined distance. 5. The image processing apparatus according to claim 4, wherein a feature point is selected by comparing feature values of the second feature point candidates in each of the first and second divided regions stored in the means. . 前記特徴点選択手段は、前記第1及び第2の分割領域のうち、第2の特徴点候補の特徴値が大きい方の分割領域において、前記第1の特徴点候補の代わりに前記第2の特徴点候補を特徴点として選択することを特徴とする請求項5に記載の画像処理装置。   The feature point selection means is configured to replace the second feature point in place of the first feature point candidate in a divided region having a larger feature value of the second feature point candidate out of the first and second divided regions. 6. The image processing apparatus according to claim 5, wherein a feature point candidate is selected as a feature point. 前記特徴点選択手段は、前記分割領域ごとに記憶する複数の特徴点候補同士の距離が前記所定距離以上となるように、前記特徴点候補を選択することを特徴とする請求項3乃至6のいずれか1項に記載の画像処理装置。   The feature point selection unit selects the feature point candidates so that a distance between a plurality of feature point candidates stored for each divided region is equal to or greater than the predetermined distance. The image processing apparatus according to any one of the above. 前記ベクトル算出手段は、連続する2つのフレームの画像に対して前記マッチング処理を行うことにより、前記動きベクトルを算出することを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。   8. The image processing according to claim 1, wherein the vector calculation unit calculates the motion vector by performing the matching process on images of two consecutive frames. 9. apparatus. 前記動きベクトルは、像ブレの補正に用いられることを特徴とする請求項1乃至8のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the motion vector is used for image blur correction. 1つの画像を複数の領域に分割する領域分割工程と、
前記領域分割工程により分割された分割領域ごとに画素の特徴値を算出して、特徴点を選択する特徴点選択工程と、
前記分割領域ごとの特徴点に基づいてマッチング処理に使用する画像領域を決定し、動きベクトルを算出する動きベクトル算出工程と、を有し、
前記特徴点選択工程では、複数の前記分割領域のうちの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.
請求項9に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラム。   A program for causing a computer to execute each step of the image processing method according to claim 9. 請求項9に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラムを記憶したコンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute each step of the image processing method according to claim 9.
JP2016225370A 2016-11-18 2016-11-18 Image processing device, image processing method, program and storage medium Pending JP2018081640A (en)

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)

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