JP2015056043A - Image processor, control method thereof, and control program - Google Patents

Image processor, control method thereof, and control program Download PDF

Info

Publication number
JP2015056043A
JP2015056043A JP2013189326A JP2013189326A JP2015056043A JP 2015056043 A JP2015056043 A JP 2015056043A JP 2013189326 A JP2013189326 A JP 2013189326A JP 2013189326 A JP2013189326 A JP 2013189326A JP 2015056043 A JP2015056043 A JP 2015056043A
Authority
JP
Japan
Prior art keywords
image
motion vector
block
target
target block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2013189326A
Other languages
Japanese (ja)
Other versions
JP2015056043A5 (en
JP6207311B2 (en
Inventor
松岡 正明
Masaaki Matsuoka
正明 松岡
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 JP2013189326A priority Critical patent/JP6207311B2/en
Publication of JP2015056043A publication Critical patent/JP2015056043A/en
Publication of JP2015056043A5 publication Critical patent/JP2015056043A5/ja
Application granted granted Critical
Publication of JP6207311B2 publication Critical patent/JP6207311B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To improve the accuracy of a deviation correction parameter even when the reliability of a motion vector is low.SOLUTION: A reliability determination part 201 compares a first target block in a first image with a reference block in a second image corresponding to the first target block, and determines a reference block with a feature pattern existing. Then, the reliability determination part together with a motion vector detection part 202 sets a reference block corresponding to a second target block in the first image with the reference block with the feature pattern existing as the second target block, and calculates a correlation value between the second target block and the reference block in the first image to detect a motion vector.

Description

本発明は、画像処理装置、その制御方法、および制御プログラムに関し、特に、画像処理装置の1つである撮像装置の動きに起因して生じる被写体像のずれを補正する手法に関する。   The present invention relates to an image processing apparatus, a control method thereof, and a control program, and more particularly, to a method for correcting a shift of a subject image caused by a movement of an imaging apparatus that is one of image processing apparatuses.

一般に、画像処理装置の1つとしてデジタルカメラなどの撮像装置が知られている。撮像装置においては、撮像の際にユーザの手ぶれなどに起因する撮像装置の動きによって被写体像がぶれてしまうことがある。このような被写体像のぶれを防止するため、撮像装置には手ぶれ補正機能が備えられている。   In general, an imaging apparatus such as a digital camera is known as one of image processing apparatuses. In the imaging apparatus, the subject image may be blurred due to the movement of the imaging apparatus due to a user's camera shake or the like during imaging. In order to prevent such blurring of the subject image, the imaging apparatus is provided with a camera shake correction function.

手ぶれ補正機能には、大きく分けて光学式手ぶれ補正機能と電子式手ぶれ補正機能とがある。そして、電子式手ぶれ補正機能では撮像の結果得られた複数の画像における被写体像のずれを画像処理によって補正している。   The camera shake correction function is roughly classified into an optical camera shake correction function and an electronic camera shake correction function. The electronic camera shake correction function corrects subject image shifts in a plurality of images obtained as a result of imaging by image processing.

例えば、撮像の結果得られた2つの画像において特徴パターンのマッチング処理を行って複数の動きベクトルを検出して、これら動きベクトルに応じてずれ補正パラメータを推定し被写体像のずれを補正するようにした撮像装置がある(特許文献1参照)。さらに、ここでは、動きベクトルについて信頼性指標値を算出して、信頼性が低い動きベクトルを除外してずれ補正パラメータを推定することによって、信頼性の高いずれ補正パラメータを推定することが行われている。   For example, a feature pattern matching process is performed on two images obtained as a result of imaging to detect a plurality of motion vectors, and a shift correction parameter is estimated according to these motion vectors to correct a shift in a subject image. There is an imaging device (see Patent Document 1). Further, here, a highly reliable correction parameter is estimated by calculating a reliability index value for the motion vector and estimating a deviation correction parameter by excluding a motion vector with low reliability. ing.

特開2009−258868号公報JP 2009-258868 A

ところが、特許文献1に記載の手法では、信頼性が高い動きベクトルを検出することができる状況であっても、次のように信頼性が低いと判定されてしまい、結果的に動きベクトルの検出ができないことがある。   However, in the method described in Patent Document 1, even if a motion vector with high reliability can be detected, it is determined that the reliability is low as follows, and as a result, motion vector detection is performed. May not be possible.

図14は、従来の撮像装置における動きベクトル検出処理の一例を説明するための図である。   FIG. 14 is a diagram for explaining an example of motion vector detection processing in a conventional imaging apparatus.

図14において、ここでは、繰り返しパターン被写体に対する動きベクトルの検出が示されており、動きベクトル検出の基準となるターゲットフレーム(ターゲット画像又は目標画像ともいう)913および動きベクトルを検出する対象となる参照フレーム(参照画像)914が示されている。領域915および916の各々にはフレーム毎の繰り返しパターンが存在する。   In FIG. 14, here, detection of a motion vector for a repetitive pattern subject is shown, and a target frame (also referred to as a target image or target image) 913 serving as a reference for motion vector detection and a reference for detecting a motion vector. A frame (reference image) 914 is shown. In each of the areas 915 and 916, there is a repeating pattern for each frame.

ブロックマッチングの基準となるターゲットブロック(目標ブロック)917を用いて、参照フレームに設定されるサーチ範囲918についてブロックマッチング処理を行って差分絶対値和テーブル(SADテーブル)を生成する。これによって、例えば、SADテーブル919が生成される。SADテーブル919において、白い部分はSAD値(つまり、相関値)が高いことを示し、黒い部分はSAD値が低いことを示している。   Using a target block (target block) 917 which is a block matching reference, block matching processing is performed on the search range 918 set in the reference frame to generate a difference absolute value sum table (SAD table). Thereby, for example, the SAD table 919 is generated. In the SAD table 919, a white portion indicates that the SAD value (that is, a correlation value) is high, and a black portion indicates that the SAD value is low.

ターゲットブロック917は丸型の模様を含んでおり、サーチ範囲918上でその模様が繰り返されているので、SADテーブル919はサーチ範囲918上の丸型模様が存在する箇所において低いSAD値(SAD極小値)を示す。これによって、上記の特許文献1に記載の手法では、信頼性指標値が小さくなって、信頼性が低いと判定されることになる。   Since the target block 917 includes a circular pattern and the pattern is repeated on the search range 918, the SAD table 919 has a low SAD value (SAD minimum value) at a location where the circular pattern exists on the search range 918. Indicates. As a result, in the method described in Patent Document 1 described above, the reliability index value becomes small and it is determined that the reliability is low.

しかしながら、図示の例では、サーチ範囲918上に丸型模様ではない数字の模様が存在する。このため、近傍に動きベクトル検出に有効な模様があるにも拘わらず、動きベクトルが破棄される結果、動きベクトル検出が行われないことになってしまう。   However, in the illustrated example, there is a numerical pattern that is not a circular pattern on the search range 918. For this reason, although there is a pattern effective for motion vector detection in the vicinity, motion vector detection is not performed as a result of the motion vector being discarded.

図15は、従来の撮像装置における動きベクトル検出処理の他の例を説明するための図である。   FIG. 15 is a diagram for explaining another example of motion vector detection processing in a conventional imaging apparatus.

図15において、ここでは、線状の被写体に対する動きベクトルの検出が示されており、動きベクトル検出の基準となるターゲットフレーム(ターゲット画像)901および動きベクトルを検出する対象である参照フレーム(参照画像)902が示されている。ブロックマッチングの基準となるターゲットブロック903を用いて、参照フレームに設定されるサーチ範囲904についてブロックマッチング処理を行って差分絶対値和テーブル(SADテーブル)を生成する。   FIG. 15 shows the detection of a motion vector with respect to a linear object, and a target frame (target image) 901 serving as a reference for motion vector detection and a reference frame (reference image) that is a target for detecting a motion vector. ) 902 is shown. Using the target block 903 serving as a block matching criterion, a block matching process is performed on the search range 904 set in the reference frame to generate a difference absolute value sum table (SAD table).

図16は、図15に示す手法で生成されたSADテーブルを示す図である。また、図17は図16に示すSADテーブルを3次元的に表現したSADテーブルを示す図である。   FIG. 16 is a diagram showing an SAD table generated by the method shown in FIG. FIG. 17 is a diagram showing an SAD table that three-dimensionally represents the SAD table shown in FIG.

ターゲットブロック903は線状の模様であるので、参照フレーム902上のサーチ範囲904において同様の模様が線状の被写体に沿って数多く検出されることになる。このため、サーチ範囲904において対応するブロックを特定することができず、結果的に、正しく動きベクトルを検出することができない。   Since the target block 903 is a linear pattern, many similar patterns are detected along the linear object in the search range 904 on the reference frame 902. For this reason, a corresponding block cannot be specified in the search range 904, and as a result, a motion vector cannot be detected correctly.

つまり、SADテーブルにおいては、図17に示すように、SAD値が低い部分(相関が高い部分)が溝状に現れる。このため、これら溝のいずれの位置が正しい対応ブロックの位置か特定できず、正しく動きベクトルを検出することができないことになる。   That is, in the SAD table, as shown in FIG. 17, a portion having a low SAD value (a portion having a high correlation) appears in a groove shape. For this reason, it is impossible to specify which position of these grooves is the correct corresponding block position, and it is impossible to correctly detect the motion vector.

上述のような状況においても、SADテーブルに溝状の相関値分布があるか否かを判定することによって、動きベクトルの信頼性を判定することができる。そして、動きベクトルの信頼性が判定できれば、信頼性が低い動きベクトルを除外してずれ補正パラメータを推定して、信頼性の高いずれ補正パラメータを得ることができる。   Even in the situation as described above, it is possible to determine the reliability of the motion vector by determining whether or not there is a groove-like correlation value distribution in the SAD table. If the reliability of the motion vector can be determined, it is possible to obtain a highly reliable correction parameter by estimating a shift correction parameter by excluding a motion vector with low reliability.

図18は、従来の撮像装置における動きベクトル検出処理のさらに他の例を説明するための図である。   FIG. 18 is a diagram for explaining still another example of motion vector detection processing in a conventional imaging apparatus.

図18において、ここでは、ターゲットブロック903の右隣のターゲットブロック910に係る動きベクトルの検出が示されており、ここでも、同様の理由によって検出される動きベクトルの信頼性が低くなる。そして、サーチ範囲911上に線分の途切れが存在し、近傍に動きベクトル検出に有効な模様があるにも拘わらず、動きベクトルが破棄される結果、動きベクトル検出が行われないことになってしまう。   In FIG. 18, here, the detection of the motion vector related to the target block 910 on the right side of the target block 903 is shown, and again, the reliability of the detected motion vector is lowered for the same reason. Then, although there is a line segment break on the search range 911 and there is a pattern effective for motion vector detection in the vicinity, the motion vector is discarded, so that motion vector detection is not performed. End up.

そこで、本発明の目的は、動きベクトルの信頼性が低い場合においてもずれ補正パラメータの精度を向上させることができる画像処理装置、その制御方法、および制御プログラムを提供することである。   Accordingly, an object of the present invention is to provide an image processing apparatus, a control method thereof, and a control program that can improve the accuracy of a deviation correction parameter even when the reliability of a motion vector is low.

上記の目的を達成するため、本発明による画像処理装置は、第1の画像と第2の画像との間の動きベクトルを求める画像処理装置であって、前記第1の画像における第1のターゲットブロックと前記第1のターゲットブロックに対応する前記第2の画像における参照ブロックを比較し、特徴パターンが存在する参照ブロックを判定する判定手段と、前記判定手段によって前記特徴パターンが存在すると判定された前記参照ブロックを第2のターゲットブロックとし、前記第1の画像において前記第2のターゲットブロックに対応する参照ブロックを設定して、前記第2のターゲットブロックと前記第1の画像における参照ブロックとの相関値を求めて動きベクトルを検出する動きベクトル検出手段と、を有することを特徴とする。   In order to achieve the above object, an image processing apparatus according to the present invention is an image processing apparatus for obtaining a motion vector between a first image and a second image, wherein the first target in the first image is obtained. A determination unit for comparing a reference block in the second image corresponding to the first target block with a block and determining a reference block in which a feature pattern exists; and the determination unit determines that the feature pattern exists The reference block is a second target block, a reference block corresponding to the second target block is set in the first image, and the second target block and the reference block in the first image are Motion vector detection means for obtaining a correlation value and detecting a motion vector.

本発明による制御方法は、第1の画像と第2の画像との間の動きベクトルを求める画像処理装置の制御方法であって、前記第1の画像における第1のターゲットブロックと前記第1のターゲットブロックに対応する前記第2の画像における参照ブロックを比較し、特徴パターンが存在する参照ブロックを判定する判定ステップと、前記判定ステップで前記特徴パターンが存在すると判定された前記参照ブロックを第2のターゲットブロックとし、前記第1の画像において前記第2のターゲットブロックに対応する参照ブロックを設定して、前記第2のターゲットブロックと前記第1の画像における参照ブロックとの相関値を求めて動きベクトルを検出する動きベクトル検出ステップと、を有することを特徴とする。   A control method according to the present invention is a control method of an image processing apparatus for obtaining a motion vector between a first image and a second image, wherein the first target block and the first image in the first image A reference step in which the reference block in the second image corresponding to the target block is compared to determine a reference block in which a feature pattern exists, and the reference block in which the feature pattern is determined to exist in the determination step A reference block corresponding to the second target block is set in the first image, and a correlation value between the second target block and the reference block in the first image is determined to move. A motion vector detecting step for detecting a vector.

本発明による制御プログラムは、第1の画像と第2の画像との間の動きベクトルを求める画像処理装置で用いられる制御プログラムであって、前記画像処理装置が備えるコンピュータに、前記第1の画像における第1のターゲットブロックと前記第1のターゲットブロックに対応する前記第2の画像における参照ブロックを比較し、特徴パターンが存在する参照ブロックを判定する判定ステップと、前記判定ステップで前記特徴パターンが存在すると判定された前記参照ブロックを第2のターゲットブロックとし、前記第1の画像において前記第2のターゲットブロックに対応する参照ブロックを設定して、前記第2のターゲットブロックと前記第1の画像における参照ブロックとの相関値を求めて動きベクトルを検出する動きベクトル検出ステップと、を実行させることを特徴とする。   A control program according to the present invention is a control program used in an image processing apparatus for obtaining a motion vector between a first image and a second image, and the first image is stored in a computer included in the image processing apparatus. A determination step of comparing a reference block in the second image corresponding to the first target block and the second target block corresponding to the first target block to determine a reference block in which a feature pattern exists; The reference block determined to exist is set as a second target block, a reference block corresponding to the second target block is set in the first image, and the second target block and the first image are set. Vector detection to detect the motion vector by obtaining the correlation value with the reference block in Characterized in that to execute a step, the.

本発明によれば、特徴パターンが存在すると判定された参照ブロックを第2のターゲットブロックとし、第1の画像において第2のターゲットブロックに対応する参照ブロックを設定して、第2のターゲットブロックと第1の画像における参照ブロックとの相関値を求めて動きベクトルを検出するようにしたので、動きベクトルの信頼性が低い場合には、信頼性の高い動きベクトルが再検出されることが可能となって、ずれ補正パラメータの精度を向上させることできる。   According to the present invention, a reference block determined to have a feature pattern is set as a second target block, a reference block corresponding to the second target block is set in the first image, and the second target block Since the motion vector is detected by obtaining the correlation value with the reference block in the first image, the motion vector with high reliability can be redetected when the motion vector is low in reliability. Thus, the accuracy of the deviation correction parameter can be improved.

本発明の第1の実施形態による画像処理装置を備える撮像装置の一例を示すブロック図である。It is a block diagram which shows an example of an imaging device provided with the image processing apparatus by the 1st Embodiment of this invention. 図1に示す画像処理部107の構成についてその一例を示すブロック図である。It is a block diagram which shows the example about the structure of the image process part 107 shown in FIG. 図2に示す信頼性判定部の動作を説明するためのフローチャートである。It is a flowchart for demonstrating operation | movement of the reliability determination part shown in FIG. 図2に示す信頼性判定部で生成されるSADテーブルの一例を示す図である。It is a figure which shows an example of the SAD table produced | generated by the reliability determination part shown in FIG. 図1に示すカメラにおいてX方向のずれ量に対する評価値をプロットした図である。It is the figure which plotted the evaluation value with respect to the deviation | shift amount of a X direction in the camera shown in FIG. 図5において第1の閾値以上で第2の閾値未満である評価値の頻度をX方向のずれ量毎にプロットした図である。FIG. 6 is a diagram in which the frequency of evaluation values that are greater than or equal to the first threshold and less than the second threshold in FIG. 5 is plotted for each amount of deviation in the X direction. 図18に示すSADテーブルによるX方向のずれ量に対する評価値をプロットした図である。It is the figure which plotted the evaluation value with respect to the deviation | shift amount of the X direction by the SAD table shown in FIG. 図7において第1の閾値以上で第2の閾値未満である評価値の頻度をX方向のずれ量毎にプロットした図である。It is the figure which plotted the frequency of the evaluation value which is more than a 1st threshold value and less than a 2nd threshold value for every deviation | shift amount of a X direction in FIG. 図18に示すターゲットブロックに対する動きベクトルの再検出処理を説明するための図である。It is a figure for demonstrating the redetection process of the motion vector with respect to the target block shown in FIG. 本発明の第2の実施形態による画像処理装置を備えるカメラにおいて信頼性判定部の動作を説明するためのフローチャートである。It is a flowchart for demonstrating operation | movement of the reliability determination part in the camera provided with the image processing apparatus by the 2nd Embodiment of this invention. 本発明の第2の実施形態による画像処理装置を備えるカメラにおいてSADテーブルによるX方向のずれ量に対する評価値をプロットした図である。It is the figure which plotted the evaluation value with respect to the deviation | shift amount of the X direction by a SAD table in the camera provided with the image processing apparatus by the 2nd Embodiment of this invention. 図11において第1の極小値から評価閾値までの範囲に存在する極小値の頻度をX方向のずれ量毎にプロットした図である。It is the figure which plotted the frequency of the minimum value which exists in the range from a 1st minimum value to an evaluation threshold value for every deviation | shift amount of a X direction in FIG. 本発明の第2の実施形態による画像処理装置を備えるカメラにおける動きベクトルの再検出処理を説明するための図である。It is a figure for demonstrating the redetection process of the motion vector in a camera provided with the image processing apparatus by the 2nd Embodiment of this invention. 従来の撮像装置における動きベクトル検出処理の一例を説明するための図である。It is a figure for demonstrating an example of the motion vector detection process in the conventional imaging device. 従来の撮像装置における動きベクトル検出処理の他の例を説明するための図である。It is a figure for demonstrating the other example of the motion vector detection process in the conventional imaging device. 図15に示す手法で生成されたSADテーブルを示す図である。It is a figure which shows the SAD table produced | generated by the method shown in FIG. 図16に示すSADテーブルを3次元的に表現したSADテーブルを示す図である。It is a figure which shows the SAD table which expressed the SAD table shown in FIG. 16 three-dimensionally. 従来の撮像装置における動きベクトル検出処理のさらに他の例を説明するための図である。It is a figure for demonstrating the further another example of the motion vector detection process in the conventional imaging device.

以下、本発明の実施の形態による画像処理装置の一例について図面を参照して説明する。   Hereinafter, an example of an image processing apparatus according to an embodiment of the present invention will be described with reference to the drawings.

なお、ここでは、本発明の実施の形態による画像処理装置をデジタルカメラなどの撮像装置に備えて、撮像装置による撮像の結果得られた画像において被写体像のずれを補正する場合について説明する。   Here, a case will be described in which the image processing apparatus according to the embodiment of the present invention is provided in an imaging apparatus such as a digital camera, and the shift of a subject image is corrected in an image obtained as a result of imaging by the imaging apparatus.

[第1の実施形態]
図1は、本発明の第1の実施形態による画像処理装置を備える撮像装置の一例を示すブロック図である。
[First Embodiment]
FIG. 1 is a block diagram illustrating an example of an imaging apparatus including an image processing apparatus according to the first embodiment of the present invention.

図示の撮像装置は、例えば、デジタルカメラ(以下単にカメラと呼ぶ)であり、制御部101を有している。制御部101は、例えば、CPUであり、R0M102から動作プログラムを読み出して、当該動作プログラムをRAM103に展開して実行することによってカメラ100全体の制御を行う。   The illustrated imaging apparatus is, for example, a digital camera (hereinafter simply referred to as a camera) and includes a control unit 101. The control unit 101 is, for example, a CPU, and controls the entire camera 100 by reading an operation program from the R0M 102, developing the operation program in the RAM 103, and executing the program.

ROM102は、書き換え可能な不揮発性メモリであって、前述の動作プログラムに加えて、カメラの動作に必要なパラメータなどが記憶されている。RAM103は、書き換え可能な揮発性メモリであって、カメラ100の動作において出力された各種データの一時的な記憶領域として用いられる。ここでは、RAM103には、カメラ100の動きに起因して生じる画像(参照画像という)における被写体像のずれを検出するために必要となるターゲット画像および補正前の参照画像などが一時的に記憶される。   The ROM 102 is a rewritable nonvolatile memory, and stores parameters necessary for the operation of the camera in addition to the above-described operation program. The RAM 103 is a rewritable volatile memory, and is used as a temporary storage area for various data output in the operation of the camera 100. Here, the RAM 103 temporarily stores a target image, a reference image before correction, and the like necessary for detecting a shift of a subject image in an image (referred to as a reference image) caused by the movement of the camera 100. The

撮像部105は、例えば、CCD又はCMOSセンサなどの撮像素子を備えている。撮像部105は、光電変換によって光学系104を介して撮像素子に結像した光学像に応じたアナログ画像信号をA/D変換部106に出力する。A/D変換部106は、アナログ画像信号に対してA/D変換処理を行ってデジタル画像信号(画像データ)を得て、当該画像データをRAM103に記憶する。   The imaging unit 105 includes an imaging element such as a CCD or CMOS sensor, for example. The imaging unit 105 outputs an analog image signal corresponding to the optical image formed on the imaging element via the optical system 104 by photoelectric conversion to the A / D conversion unit 106. The A / D conversion unit 106 performs A / D conversion processing on the analog image signal to obtain a digital image signal (image data), and stores the image data in the RAM 103.

図示のカメラ100では、画像処理部107が撮像の結果得られた画像データについて各種の画像処理を行う。例えば、画像処理部107はカメラ100の動きに起因して生じた被写体像のずれを補正する補正処理を行う。   In the illustrated camera 100, the image processing unit 107 performs various types of image processing on image data obtained as a result of imaging. For example, the image processing unit 107 performs a correction process for correcting a shift in the subject image caused by the movement of the camera 100.

図2は、図1に示す画像処理部107の構成についてその一例を示すブロック図である。   FIG. 2 is a block diagram showing an example of the configuration of the image processing unit 107 shown in FIG.

図示の画像処理部107には、被写体像のずれを検出する対象である参照画像(第2の画像)が入力されるとともに、補正際の基準となるターゲット画像(第1の画像)が入力される。なお、ターゲット画像および参照画像は、制御部101によってRAM103から読み出されて画像処理部107に与えられるものとする。   The illustrated image processing unit 107 receives a reference image (second image) that is a target for detecting a shift in the subject image and a target image (first image) that serves as a reference for correction. The Note that the target image and the reference image are read from the RAM 103 by the control unit 101 and given to the image processing unit 107.

画像処理部107は動きベクトル検出部202を有しており、動きベクトル検出部202は、ターゲット画像におけるターゲットブロック(ここでは、第1のターゲットブロック)毎に、参照画像における参照ブロック(ここでは、第1の参照ブロック)毎に被写体像の動きベクトルを検出する。例えば、動きベクトル検出部202はターゲット画像と参照画像との近傍の領域において被写体像を比較する。ここでは、動きベクトル検出部202は所謂ブロックマッチング手法を用いて、ターゲット画像と参照画像との間における同一のパターンの移動に応じて動きベクトルを検出する。   The image processing unit 107 includes a motion vector detection unit 202, and the motion vector detection unit 202 performs a reference block (here, a reference block) in a reference image for each target block (here, a first target block) in the target image. The motion vector of the subject image is detected for each first reference block). For example, the motion vector detection unit 202 compares subject images in a region near the target image and the reference image. Here, the motion vector detection unit 202 detects a motion vector according to the movement of the same pattern between the target image and the reference image using a so-called block matching method.

信頼性判定部201は、動きベクトル検出部202で検出された各ブロックの動きベクトルが線状又は線形状の被写体(線形状の部分)において検出されたか否かを判定する。動きベクトルが線状の被写体において検出されたものでないと、信頼性判定部201は当該動きベクトルをそのまま出力する。一方、動きベクトルが線状の被写体で検出されたものであると、信頼性判定部201はその周辺において動きベクトル検出に有効な模様があれば動きベクトルの再検出を行い、有効な縞模様がなければ当該動きベクトルを排除する。   The reliability determination unit 201 determines whether or not the motion vector of each block detected by the motion vector detection unit 202 has been detected in a linear or linear object (linear part). If the motion vector is not detected in the linear subject, the reliability determination unit 201 outputs the motion vector as it is. On the other hand, if the motion vector is detected in a linear object, the reliability determination unit 201 performs re-detection of the motion vector if there is a pattern effective for motion vector detection in the vicinity, and an effective stripe pattern is detected. If not, the motion vector is excluded.

前述の図15を参照すると、ここでは、ターゲット画像901は、6×6=36個のターゲットブロック901aが存在する。動きベクトル検出部202はターゲットブロック901aの各々に対応する36個の動きベクトルを検出する。   Referring to FIG. 15 described above, here, the target image 901 includes 6 × 6 = 36 target blocks 901a. The motion vector detection unit 202 detects 36 motion vectors corresponding to each of the target blocks 901a.

図15において右半分に位置する18個のターゲットブロック901aについては線状の被写体が存在しないので、信頼性判定部201は動きベクトル検出部202によって検出された動きベクトルをそのまま出力することになる。一方、左半分に位置する18個のターゲットブロック901aについては線状の被写体が存在するので、信頼性判定部201は動きベクトルの再検出を行うか又は当該動きベクトルを排除される。   In FIG. 15, since there is no linear subject for the 18 target blocks 901a located in the right half, the reliability determination unit 201 outputs the motion vector detected by the motion vector detection unit 202 as it is. On the other hand, since there are linear objects for the 18 target blocks 901a located in the left half, the reliability determination unit 201 performs redetection of the motion vector or excludes the motion vector.

図15に示す例では、左から3列目の6個のターゲットブロック901aについては対応するサーチ範囲904に線分の途切れが存在するので、信頼性判定部201は動きベクトルの再検出を行うが、それ以外の12個のターゲットブロック901aについては動きベクトルを排除する。   In the example illustrated in FIG. 15, for the six target blocks 901a in the third column from the left, there is a line segment break in the corresponding search range 904, so the reliability determination unit 201 performs redetection of the motion vector. For the other 12 target blocks 901a, motion vectors are excluded.

アフィン係数算出部203は、ターゲット画像が有する複数のターゲットブロックの各々の動きベクトルを用いて、各領域(ブロック)の補正に用いる座標変換係数であるアフィン係数を算出する(座標変換係数算出)。なお、アフィン係数算出手法については、例えば、前出の特許文献1に記載の手法が用いられる。そして、アフィン変換部207はアフィン係数を用いて参照画像の位置ずれを補正して、補正後の参照画像を出力する。   The affine coefficient calculation unit 203 calculates an affine coefficient, which is a coordinate conversion coefficient used for correcting each region (block), using the motion vectors of each of the plurality of target blocks included in the target image (coordinate conversion coefficient calculation). As the affine coefficient calculation method, for example, the method described in Patent Document 1 is used. Then, the affine transformation unit 207 corrects the positional deviation of the reference image using the affine coefficient, and outputs the corrected reference image.

図3は、図2に示す信頼性判定部201の動作(信頼性判定)を説明するためのフローチャートである。動きベクトル検出部202からのブロック毎の動きベクトルに基づいて信頼性判定部201によって以下の処理が行われる。   FIG. 3 is a flowchart for explaining the operation (reliability determination) of the reliability determination unit 201 shown in FIG. Based on the motion vector for each block from the motion vector detection unit 202, the reliability determination unit 201 performs the following processing.

信頼性判定を開始すると、信頼性判定部201は、まず列方向について、後述する1次元線判定を行い(ステップS101)、続いて、行方向について、後述する1次元線判定を行う(ステップS102)。そして、信頼性判定部201は列方向および行方向ともに線(線分)でないか否かを判定する(ステップS103)。   When reliability determination is started, the reliability determination unit 201 first performs one-dimensional line determination to be described later for the column direction (step S101), and then performs one-dimensional line determination to be described later for the row direction (step S102). ). Then, the reliability determination unit 201 determines whether both the column direction and the row direction are lines (line segments) (step S103).

列方向および行方向ともに線でないと判定すると(ステップS103において、YES)、信頼性判定部201は動きベクトルを更新せずに(ステップS104)、信頼性判定を修了する。一方、列方向および行方向の少なくとも一方が線であると判定すると(ステップS103において、NO)、信頼性判定部201は列方向が途切れ線で、かつ行方向が線ではないか否かを判定する(ステップS105)。   If it is determined that neither the column direction nor the row direction is a line (YES in step S103), the reliability determination unit 201 completes the reliability determination without updating the motion vector (step S104). On the other hand, if it is determined that at least one of the column direction and the row direction is a line (NO in step S103), the reliability determination unit 201 determines whether the column direction is a broken line and the row direction is not a line. (Step S105).

列方向が途切れ線で、かつ行方向が線ではないと判定すると(ステップS105において、YES)、信頼性判定部201は列方向のターゲットブロックを再設定して動きベクトルを再検出する(ステップS106)。そして、信頼性判定部201は信頼性判定を終了する。列方向が途切れ線でないことおよび行方向が線であることの少なくとも一方が満たされると判定すると(ステップS105において、NO)、信頼性判定部201は列方向が線ではなく、かつ行方向が途切れ線であるか否かを判定する(ステップS107)。   If it is determined that the column direction is a broken line and the row direction is not a line (YES in step S105), the reliability determination unit 201 resets the target block in the column direction and redetects the motion vector (step S106). ). And the reliability determination part 201 complete | finishes reliability determination. If it is determined that at least one of the column direction is not a broken line and the row direction is a line is satisfied (NO in step S105), the reliability determination unit 201 has a column direction that is not a line and the row direction is broken. It is determined whether or not the line is a line (step S107).

列方向が線ではなく、かつ行方向が途切れ線であると判定すると(ステップS107において、YES)、信頼性判定部201は行方向のターゲットブロックを再設定して動きベクトルを再検出する(ステップS108)。そして、信頼性判定部201は信頼性判定を終了する。一方、列方向が線であることおよび行方向が途切れ線でないことの少なくとも一方が満たされると判定すると(ステップS107において、YES)、信頼性判定部201は動きベクトルを排除する(ステップS109)。そして、信頼性判定部201は信頼性判定を終了する。   If it is determined that the column direction is not a line and the row direction is a broken line (YES in step S107), the reliability determination unit 201 resets the target block in the row direction and redetects the motion vector (step S107). S108). And the reliability determination part 201 complete | finishes reliability determination. On the other hand, when it is determined that at least one of the column direction being a line and the row direction not being a broken line is satisfied (YES in step S107), the reliability determination unit 201 excludes the motion vector (step S109). And the reliability determination part 201 complete | finishes reliability determination.

ここで、図3で説明したステップS101における列方向の1次元線判定について説明する。   Here, the one-dimensional line determination in the column direction in step S101 described in FIG. 3 will be described.

図4は、図2に示す信頼性判定部201で生成されるSADテーブルの一例を示す図である。   FIG. 4 is a diagram illustrating an example of the SAD table generated by the reliability determination unit 201 illustrated in FIG.

図4に示すSADテーブル(つまり、第1の相関値マップ)は図16に示すSADテーブルと同等のテーブルであり、列におけるSAD(つまり、相関値)最小値が黒塗りで示されている。例えば、X方向のずれ量が”−10”である列のSAD最小値は、Y方向のずれ量が”0”の行の”1”5である。また、X方向のずれ量が”3”である列のSAD最小値は、Y方向のずれ量が”3”の行の”2”である。   The SAD table (that is, the first correlation value map) shown in FIG. 4 is equivalent to the SAD table shown in FIG. 16, and the SAD (that is, correlation value) minimum value in the column is shown in black. For example, the SAD minimum value of the column whose deviation amount in the X direction is “−10” is “1” 5 in the row where the deviation amount in the Y direction is “0”. In addition, the SAD minimum value of the column in which the deviation amount in the X direction is “3” is “2” in the row in which the deviation amount in the Y direction is “3”.

さらに、ここでは、列のSAD最小値を列のSAD平均値で正規化して、その値を評価値とする。例えば、X方向のずれ量が”−10”である列のSAD平均値は”88”であるので、その評価値は15/88=0.17となる。また、X方向のずれ量が”3”の列のSAD平均値は”89”であるので、その評価値は2/89=0.02となる。   Further, here, the SAD minimum value of the column is normalized by the SAD average value of the column, and the value is used as the evaluation value. For example, since the SAD average value of the column in which the deviation amount in the X direction is “−10” is “88”, the evaluation value is 15/88 = 0.17. Further, since the SAD average value of the column in which the deviation amount in the X direction is “3” is “89”, the evaluation value is 2/89 = 0.02.

図5は、図1に示すカメラにおいてX方向のずれ量に対する評価値をプロットした図である。   FIG. 5 is a diagram in which evaluation values are plotted with respect to the amount of deviation in the X direction in the camera shown in FIG.

前述のようにして、各列についてSAD最小値を正規化すると、図5に示すように列毎の評価値が得られる。なお、ここでは、正規化、つまり、評価値を得る際、列毎にSAD最小値をSAD平均値で除算して評価値を得るようにしたが、他の手法によって評価値を得るようにしてもよい。例えば、列毎のSAD値の積算値、最大値、又は最大値と最小値の差分値などでSAD最小値を除算して評価値を求めるようにしてもよい。さらには、X方向の各ずれ量に対応する列毎のSAD最小値の平均値、積算値、最大値、又は最大値と最小値の差分値などでSAD最小値を除算して評価値を求めるようにしてもよい。   When the SAD minimum value is normalized for each column as described above, an evaluation value for each column is obtained as shown in FIG. Note that here, when obtaining the evaluation value, normalization, that is, obtaining the evaluation value by dividing the SAD minimum value by the SAD average value for each column, the evaluation value is obtained by other methods. Also good. For example, the evaluation value may be obtained by dividing the SAD minimum value by the integrated value of the SAD value for each column, the maximum value, or the difference value between the maximum value and the minimum value. Furthermore, the evaluation value is obtained by dividing the SAD minimum value by the average value, integrated value, maximum value, or difference value between the maximum value and the minimum value for each column corresponding to each shift amount in the X direction. You may do it.

図2に示す信頼性判定部201は、列方向の1次元線判定において第1の閾値以上で第2の閾値未満である評価値の割合が第3の閾値以上であると、SADテーブルが溝状であるとして線と判定する。いま、第1の閾値を”0”、第2の閾値を”0.3”、そして、第3閾値を”0.5”とする。図5に示す例において、第1の閾値以上でかつ第2閾値未満である評価値の数は”21”であり、その割合は21/21=1となる。そして、当該割合は第3の閾値以上であるので、信頼性判定部201は線として判定することになる。線と判定した場合には、信頼性判定部201は当該線が途切れ線であるか又は完全線であるか否かを判定する。   The reliability determination unit 201 illustrated in FIG. 2 determines that the SAD table has a groove when the ratio of evaluation values that are greater than or equal to the first threshold and less than the second threshold in the one-dimensional line determination in the column direction is greater than or equal to the third threshold. It is determined that the line is a line. Now, it is assumed that the first threshold is “0”, the second threshold is “0.3”, and the third threshold is “0.5”. In the example illustrated in FIG. 5, the number of evaluation values that are greater than or equal to the first threshold and less than the second threshold is “21”, and the ratio is 21/21 = 1. And since the said ratio is more than a 3rd threshold value, the reliability determination part 201 will determine as a line. When it is determined that the line is a line, the reliability determination unit 201 determines whether the line is a broken line or a complete line.

図6は、図5において第1の閾値以上で第2の閾値未満である評価値の頻度をX方向のずれ量毎にプロットした図である。   FIG. 6 is a diagram in which the frequency of evaluation values that are greater than or equal to the first threshold and less than the second threshold in FIG. 5 is plotted for each amount of deviation in the X direction.

図6においては、溝がX方向のずれ量の全域に渡り分布しているので(つまり、分布密度が高い)、信頼性判定部201は上記の線が完全線であって途切れ線ではないと判定する。   In FIG. 6, since the grooves are distributed over the entire amount of deviation in the X direction (that is, the distribution density is high), the reliability determination unit 201 determines that the above line is a complete line and not a broken line. judge.

図18に示すSADテーブル912についいても、図16に示すSADテーブルと同様にして列方向の1次元線判定が行われる。   Also for the SAD table 912 shown in FIG. 18, the one-dimensional line determination in the column direction is performed in the same manner as the SAD table shown in FIG.

図7は、図18に示すSADテーブル912によるX方向のずれ量に対する評価値をプロットした図である。   FIG. 7 is a diagram in which evaluation values with respect to the amount of deviation in the X direction are plotted based on the SAD table 912 shown in FIG.

図7に示す例において、第1の閾値以上でかつ第2閾値未満である評価値の数は”14”であり、その割合は14/21=1となる。そして、当該割合は第3の閾値(ここでは、0.5)以上であるので、信頼性判定部201は線として判定することになる。線と判定した場合には、信頼性判定部201は当該線が途切れ線であるか又は完全線であるか否かを判定する。   In the example illustrated in FIG. 7, the number of evaluation values that are greater than or equal to the first threshold and less than the second threshold is “14”, and the ratio is 14/21 = 1. And since the said ratio is more than a 3rd threshold value (here 0.5), the reliability determination part 201 will determine as a line. When it is determined that the line is a line, the reliability determination unit 201 determines whether the line is a broken line or a complete line.

図8は、図7において第1の閾値以上で第2の閾値未満である評価値の頻度をX方向のずれ量毎にプロットした図である。   FIG. 8 is a diagram in which the frequency of evaluation values that are greater than or equal to the first threshold and less than the second threshold in FIG. 7 is plotted for each amount of deviation in the X direction.

図8においては、溝の分布はX方向のずれ量=3で途切れているので、信頼性判定部201は上記の線が途切れ線であると判定する。また、対応するY方向のずれ量は、図7から”3”となる。よって、信頼性判定部201は当該線の途切れ位置(X,Y)=(3,3)を列ターゲットブロックのずらし量とする。   In FIG. 8, since the distribution of the grooves is interrupted when the amount of deviation in the X direction = 3, the reliability determination unit 201 determines that the above line is an interrupted line. Further, the corresponding shift amount in the Y direction is “3” from FIG. Therefore, the reliability determination unit 201 sets the line break position (X, Y) = (3, 3) as the shift amount of the column target block.

なお、列方向の1次元線判定ではX方向ずれ量に対して評価値を求めるが、行方向の1次元線判定においてY方向ずれ量に対する評価値を求めることになる。行方向における処理は列方向と同様である。   In the one-dimensional line determination in the column direction, an evaluation value is obtained for the X-direction deviation amount, but in the one-dimensional line determination in the row direction, an evaluation value for the Y-direction deviation amount is obtained. Processing in the row direction is the same as in the column direction.

ところで、図15に示すターゲットブロック903については、信頼性判定部201は列が完全線、そして、行は線ではないと判定するので、前述の図3に示すフローチャートで説明したように、ステップS109において動きベクトルは除外されることになる。   By the way, for the target block 903 shown in FIG. 15, since the reliability determination unit 201 determines that the column is not a complete line and the row is not a line, as described in the flowchart shown in FIG. In this case, the motion vector is excluded.

一方、図18に示すターゲットブロック910については、信頼性判定部201は列が途切れ線、そして、行は線ではないと判定するので、前述の図3に示すフローチャートで説明したように、ステップS106において動きベクトルが再検出されることになる。   On the other hand, for the target block 910 shown in FIG. 18, since the reliability determination unit 201 determines that the column is not a broken line and the row is not a line, as described in the flowchart shown in FIG. In this case, the motion vector is detected again.

図9は、図18に示すターゲットブロック910に対する動きベクトルの再検出処理を説明するための図である。   FIG. 9 is a diagram for explaining motion vector redetection processing for the target block 910 shown in FIG.

動きベクトルの再検出を行う際には、参照画像902(ここでは、第2の画像)上に新たに列ターゲットブロック301(ここでは、第2のターゲットブロック)が再設定され、さらに、ターゲット画像901(ここでは、第1の画像)上に列サーチ範囲302が再設定される。この際、列ターゲットブロック301はターゲット画像901上に列ターゲットブロックずらし量(3,3)だけずらされて再設定される。列サーチ範囲302は、参照画像901上に同一のずらし量だけずらされて再設定される。   When the motion vector is re-detected, the column target block 301 (here, the second target block) is newly reset on the reference image 902 (here, the second image), and further, the target image The column search range 302 is reset on 901 (here, the first image). At this time, the column target block 301 is reset and shifted on the target image 901 by the column target block shift amount (3, 3). The column search range 302 is reset on the reference image 901 by being shifted by the same shift amount.

ここで、参照ブロック303は列ターゲットブロック301に対して最小SAD値となるブロックであり、SADテーブル304は参照ブロック303に対応するSADテーブルである。そして、ここでは、図示のように動きベクトル305が再検出されることになる。   Here, the reference block 303 is a block having a minimum SAD value with respect to the column target block 301, and the SAD table 304 is a SAD table corresponding to the reference block 303. Here, the motion vector 305 is re-detected as shown in the figure.

なお、他のターゲットブロックについては動きベクトルの起点がターゲット画像901上にある。このため、再検出動きベクトル305の起点もターゲット画像901上になるように、動きベクトル(第1の動きベクトル又は第2の動きベクトル)の起点はターゲット画像901上の参照ブロック303の中心とされる。   For other target blocks, the starting point of the motion vector is on the target image 901. For this reason, the starting point of the motion vector (first motion vector or second motion vector) is set to the center of the reference block 303 on the target image 901 so that the starting point of the redetected motion vector 305 is also on the target image 901. The

上述のようにして、補正された参照画像は画像処理部107から出力されて、補正後の参照画像として記録媒体108に記録される。記録媒体108は、例えば、カメラ100に備えられた内部メモリ又はカメラ100に着脱可能に装着されるメモリカード又はHDDなどの記録装置である。   As described above, the corrected reference image is output from the image processing unit 107 and recorded on the recording medium 108 as a corrected reference image. The recording medium 108 is, for example, a recording device such as an internal memory provided in the camera 100 or a memory card or HDD that is detachably attached to the camera 100.

なお、撮像の結果得られた画像において被写体像のずれを補正しない場合には、画像処理部107はA/D変換部106から出力された画像データに対して、所定の変換処理および符号化処理を行って、記録媒体108に記録する。   Note that if the subject image shift is not corrected in the image obtained as a result of imaging, the image processing unit 107 performs predetermined conversion processing and encoding processing on the image data output from the A / D conversion unit 106. To record on the recording medium 108.

このように、本発明の第1の実施形態では、ターゲット画像および参照画像のうち参照画像を撮像した際のカメラ100の動きに起因して生じるターゲット画像に対する参照画像のずれを補正することができる。   As described above, in the first embodiment of the present invention, it is possible to correct a shift of the reference image with respect to the target image caused by the movement of the camera 100 when the reference image is captured among the target image and the reference image. .

ここでは、画像処理部107はブロックマッチングで検出された動きベクトルが線状の被写体であるか否かを判定して、線状の被写体のでないと検出された動きベクトルをそのまま用いる。一方、線状の被写体であると、画像処理部107は動きベクトルの再検出を行う。そして、画像処理部107は信頼性の高い動きベクトルが得られない場合には動きベクトルを排除する。   Here, the image processing unit 107 determines whether or not the motion vector detected by the block matching is a linear subject, and uses the motion vector detected as not being a linear subject as it is. On the other hand, if the object is a linear object, the image processing unit 107 performs re-detection of the motion vector. Then, the image processing unit 107 excludes the motion vector when a highly reliable motion vector cannot be obtained.

この結果、線状の被写体において動きベクトルが検出された際に動きベクトルの信頼性が低い場合においても信頼性の高い動きベクトルが再検出される可能性が高くなって、ずれ補正パラメータの精度を向上させることができる。   As a result, there is a high possibility that a highly reliable motion vector is detected again even when the motion vector is low in reliability when the motion vector is detected in a linear object, and the accuracy of the deviation correction parameter is improved. Can be improved.

[第2の実施形態]
続いて、本発明の第2の実施形態による画像処理装置を備えるカメラの一例について説明する。
[Second Embodiment]
Next, an example of a camera provided with an image processing apparatus according to the second embodiment of the present invention will be described.

なお、第2の実施形態に係るカメラの構成は図1に示すカメラと同様である。また、画像処理部の構成は図2に示す画像処理部の構成と同様であるが、信頼性判定部210の機能が異なる。   The configuration of the camera according to the second embodiment is the same as that of the camera shown in FIG. The configuration of the image processing unit is the same as the configuration of the image processing unit shown in FIG. 2, but the function of the reliability determination unit 210 is different.

図10は、本発明の第2の実施形態による画像処理装置を備えるカメラにおいて信頼性判定部の動作を説明するためのフローチャートである。   FIG. 10 is a flowchart for explaining the operation of the reliability determination unit in the camera including the image processing apparatus according to the second embodiment of the present invention.

信頼性判定を開始すると、信頼性判定部201は、まず列方向について、後述する1次元繰り返し判定を行い(ステップS201)、続いて、行方向について、後述する1次元繰り返し判定を行う(ステップS202)。そして、信頼性判定部201は列方向および行方向ともに繰り返しパターン(つまり、特徴点を備える特徴パターン)でないか否かを判定する(ステップS203)。   When the reliability determination is started, the reliability determination unit 201 first performs a one-dimensional repetition determination described later for the column direction (step S201), and then performs a one-dimensional repetition determination described later for the row direction (step S202). ). Then, the reliability determination unit 201 determines whether the pattern is a repetitive pattern (that is, a feature pattern including feature points) in both the column direction and the row direction (step S203).

列方向および行方向ともに繰り返しパターンでないと判定すると(ステップS203において、YES)、信頼性判定部201は動きベクトルを更新せずに(ステップS204)、信頼性判定を修了する。一方、列方向および行方向の少なくとも一方が繰り返しパターンであると判定すると(ステップS203において、NO)、信頼性判定部201は列方向が繰り返しパターンで途切れがあるか否かを判定する(ステップS205)。   If it is determined that neither the column direction nor the row direction is a repetitive pattern (YES in step S203), the reliability determination unit 201 completes the reliability determination without updating the motion vector (step S204). On the other hand, if it is determined that at least one of the column direction and the row direction is a repetitive pattern (NO in step S203), the reliability determination unit 201 determines whether or not the column direction is a repetitive pattern and is interrupted (step S205). ).

列方向が繰り返しパターンでかつ途切れがあると判定すると(ステップS205において、YES)、信頼性判定部201は列方向のターゲットブロックを再設定して動きベクトルを再検出する(ステップS206)。そして、信頼性判定部201は行方向が繰り返しパターンで途切れがあるか否かを判定する(ステップS207)。   If it is determined that the column direction is a repetitive pattern and there is a discontinuity (YES in step S205), the reliability determination unit 201 resets the target block in the column direction and redetects the motion vector (step S206). Then, the reliability determination unit 201 determines whether or not the row direction is a repeated pattern and is interrupted (step S207).

なお、列方向が繰り返しパターンでないことおよび途切れがないことの少なくとも1つが満たされると判定すると(ステップS205において、NO)、信頼性判定部201はステップS207の処理に進む。   If it is determined that at least one of the column direction is not a repetitive pattern and that there is no interruption is satisfied (NO in step S205), the reliability determination unit 201 proceeds to the process of step S207.

行方向が繰り返しパターンでかつ途切れがあると判定すると(ステップS207において、YES)、信頼性判定部201は列方向のターゲットブロックを再設定して動きベクトルを再検出する(ステップS208)。そして、信頼性判定部201は動きベクトルが検出されたか否かを判定する(ステップS209)。   If it is determined that the row direction is a repetitive pattern and there is a break (YES in step S207), the reliability determination unit 201 resets the target block in the column direction and redetects the motion vector (step S208). Then, the reliability determination unit 201 determines whether or not a motion vector is detected (step S209).

なお、行方向が繰り返しパターンでないことおよび途切れがないことの少なくとも1つが満たされると判定すると(ステップS207において、NO)、信頼性判定部201はステップS209の処理に進む。   If it is determined that at least one of the row direction is not a repetitive pattern and that there is no interruption is satisfied (NO in step S207), the reliability determination unit 201 proceeds to the process of step S209.

動きベクトルが検出されないと(ステップS209において、NO)、信頼性判定部201は動きベクトルを排除して(ステップS210)、信頼性判定を終了する。一方、動きベクトルが検出されると(ステップS209において、YES)、信頼性判定部201は信頼性判定を終了する。   If no motion vector is detected (NO in step S209), reliability determination unit 201 excludes the motion vector (step S210) and ends the reliability determination. On the other hand, when a motion vector is detected (YES in step S209), reliability determination unit 201 ends the reliability determination.

ここで、図10で説明したステップS201における列方向の1次元繰り返し判定について説明する。   Here, the one-dimensional repetition determination in the column direction in step S201 described with reference to FIG. 10 will be described.

図11は、本発明の第2の実施形態による画像処理装置を備えるカメラにおいてSADテーブルによるX方向のずれ量に対する評価値をプロットした図である。   FIG. 11 is a diagram in which evaluation values are plotted with respect to a deviation amount in the X direction according to the SAD table in a camera including an image processing apparatus according to the second embodiment of the present invention.

ここでは、列方向の1次元線判定と同様にして、SADテーブルの各列についてSAD最小値が検出される。なお、評価値は列毎のSAD最小値とする。図11は、図14に示すSADテーブル919に対するX方向ずれ量に対する評価値がプロットされている。   Here, the SAD minimum value is detected for each column of the SAD table in the same manner as the one-dimensional line determination in the column direction. The evaluation value is the SAD minimum value for each column. FIG. 11 plots evaluation values with respect to the amount of deviation in the X direction with respect to the SAD table 919 shown in FIG.

列方向の1次元繰り返し判定においては、評価値の第1の極小値(最も小さい極小値)から評価値閾値までの範囲に他の極小値が存在すると、信頼性判定部201は繰り返しパターンである判定する。図11に示す例では、第1の極小値から評価値閾値までの範囲に他の極小値が存在するので、信頼性判定部201は繰り返しパターンであると判定する。そして、繰り返しパターンと判定すると、信頼性判定部201は、前述のように、途切れ繰り返しパターンであるか又は完全繰り返しパターンであるかを判定する。   In the one-dimensional repetition determination in the column direction, if another minimum value exists in the range from the first minimum value (smallest minimum value) of the evaluation values to the evaluation value threshold, the reliability determination unit 201 is a repeated pattern. judge. In the example illustrated in FIG. 11, since another minimum value exists in the range from the first minimum value to the evaluation value threshold, the reliability determination unit 201 determines that the pattern is a repetitive pattern. When it is determined that the pattern is a repetitive pattern, the reliability determination unit 201 determines whether the pattern is a discontinuous repeat pattern or a complete repeat pattern as described above.

図12は、図11において第1の極小値から評価閾値までの範囲に存在する極小値の頻度をX方向のずれ量毎にプロットした図である。   FIG. 12 is a diagram in which the frequency of the minimum value existing in the range from the first minimum value to the evaluation threshold in FIG. 11 is plotted for each amount of deviation in the X direction.

図11に示すように、極小値は評価値周期毎に出現するので、X方向のずれ量も評価値周期毎に出現する。図12に示すように、繰り返しパターンの分布がX方向ずれ量=3で途切れているので、信頼性判定部201は当該繰り返しパターンを途切れ繰り返しパターンと判定する。そして、信頼性判定部201は当該途切れ位置(X,Y)=(3,0)を列ターゲットブロックのずらし量とする。   As shown in FIG. 11, since the minimum value appears every evaluation value period, the deviation amount in the X direction also appears every evaluation value period. As shown in FIG. 12, since the distribution of the repetitive pattern is discontinued at the X-direction deviation amount = 3, the reliability determination unit 201 determines that the repetitive pattern is a discontinuous repetitive pattern. Then, the reliability determination unit 201 sets the interruption position (X, Y) = (3, 0) as the shift amount of the column target block.

なお、列方向の1次元繰り返し判定ではX方向ずれ量に対して評価値を求めるが、行方向の1次元繰り返し判定においてY方向ずれ量に対する評価値を求めることになる。そして、行方向における処理は列方向と同様である。   In the one-dimensional repetition determination in the column direction, an evaluation value is obtained for the X-direction displacement amount, but in the one-dimensional repetition determination in the row direction, an evaluation value for the Y-direction displacement amount is obtained. The processing in the row direction is the same as that in the column direction.

上述のようにして列方向および行方向の1次元繰り返しパターン判定を行うと、例えば、図14に示すターゲットブロック917について、列方向は途切れ繰り返しパターンであって、行方向は完全繰り返しパターンと判定される。この結果、図10に示すフローチャートで説明したように、信頼性判定部201はステップS206において動きベクトルを再検出することになる。   When the one-dimensional repetitive pattern determination in the column direction and the row direction is performed as described above, for example, for the target block 917 shown in FIG. 14, the column direction is determined to be a discontinuous repetitive pattern and the row direction is determined to be a complete repetitive pattern. The As a result, as described in the flowchart shown in FIG. 10, the reliability determination unit 201 redetects the motion vector in step S206.

図13は、本発明の第2の実施形態による画像処理装置を備えるカメラにおける動きベクトルの再検出処理を説明するための図である。   FIG. 13 is a diagram for explaining motion vector redetection processing in a camera including an image processing apparatus according to the second embodiment of the present invention.

図13においては、図14に示すターゲットブロック917に対する動きベクトルの再検出処理が示されており、動きベクトルの再検出を行う際には、参照画像914上に新たに列ターゲットブロック401が再設定され、さらに、ターゲット画像913上に列サーチ範囲402が再設定される。この際、列ターゲットブロック401はターゲット画像913上に列ターゲットブロックずらし量(3,0)だけずらされて再設定される。列サーチ範囲402は、参照画像913上に同一のずらし量だけずらされて再設定される。   FIG. 13 shows motion vector redetection processing for the target block 917 shown in FIG. 14. When the motion vector is redetected, a new column target block 401 is reset on the reference image 914. Further, the column search range 402 is reset on the target image 913. At this time, the column target block 401 is reset on the target image 913 by being shifted by the column target block shift amount (3, 0). The column search range 402 is reset by being shifted on the reference image 913 by the same shift amount.

ここで、参照ブロック403は列ターゲットブロック401に対して最小SAD値となるブロックであり、SADテーブル404は参照ブロック403に対応するSADテーブルである。そして、ここでは、図示のように動きベクトル405が再検出されることになる。   Here, the reference block 403 is a block having a minimum SAD value with respect to the column target block 401, and the SAD table 404 is a SAD table corresponding to the reference block 403. Here, the motion vector 405 is re-detected as shown in the figure.

なお、他のターゲットブロックについては動きベクトルの起点がターゲット画像913上にある。このため、再検出動きベクトル405の起点もターゲット画像913上になるように、動きベクトルの起点はターゲット画像913上の参照ブロック403の中心とされる。   For other target blocks, the starting point of the motion vector is on the target image 913. For this reason, the starting point of the motion vector is set to the center of the reference block 403 on the target image 913 so that the starting point of the redetected motion vector 405 is also on the target image 913.

上述のようにして、補正された参照画像は画像処理部107から出力されて、補正後の参照画像として記録媒体108に記録される。なお、第1の実施形態と同様に、撮像の結果得られた画像において被写体像のずれを補正しない場合には、画像処理部107はA/D変換部106から出力された画像データに対して、所定の変換処理および符号化処理を行って、記録媒体108に記録する。   As described above, the corrected reference image is output from the image processing unit 107 and recorded on the recording medium 108 as a corrected reference image. Note that, as in the first embodiment, the image processing unit 107 applies the image data output from the A / D conversion unit 106 when the subject image shift is not corrected in the image obtained as a result of imaging. Then, a predetermined conversion process and an encoding process are performed and recorded on the recording medium 108.

このように、本発明の第2の実施形態においても、ターゲット画像および参照画像のうち参照画像を撮像した際のカメラ100の動きに起因して生じるターゲット画像に対する参照画像のずれを補正することができる。   As described above, also in the second embodiment of the present invention, it is possible to correct the shift of the reference image with respect to the target image caused by the movement of the camera 100 when the reference image is captured among the target image and the reference image. it can.

ここでは、画像処理部107はブロックマッチングで検出された動きベクトルが繰り返しパターンであるか否かを判定して、繰り返しパターンでないと検出された動きベクトルをそのまま用いる。一方、繰り返しパターンであると、画像処理部107は動きベクトルの再検出を行う。そして、画像処理部107は信頼性の高い動きベクトルが得られない場合には動きベクトルを排除する。   Here, the image processing unit 107 determines whether the motion vector detected by the block matching is a repetitive pattern, and uses the motion vector detected as not being a repetitive pattern as it is. On the other hand, if the pattern is a repetitive pattern, the image processing unit 107 redetects the motion vector. Then, the image processing unit 107 excludes the motion vector when a highly reliable motion vector cannot be obtained.

この結果、繰り返しパターンにおいて動きベクトルが検出された際に動きベクトルの信頼性が低い場合においても信頼性の高い動きベクトルが再検出される可能性が高くなって、ずれ補正パラメータの精度を向上させることができる。   As a result, there is a high possibility that a highly reliable motion vector is redetected even when the motion vector is low in reliability when the motion vector is detected in the repetitive pattern, thereby improving the accuracy of the deviation correction parameter. be able to.

上述の説明から明らかなように、図2に示す例においては、動きベクトル検出部202および信頼性判定部201が判定手段および動きベクトル検出手段として機能する。なお、図1に示す例においては、少なくとも制御部101および画像処理部107が画像処理装置を構成する。   As is clear from the above description, in the example shown in FIG. 2, the motion vector detection unit 202 and the reliability determination unit 201 function as a determination unit and a motion vector detection unit. In the example illustrated in FIG. 1, at least the control unit 101 and the image processing unit 107 constitute an image processing apparatus.

以上、本発明について実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。   As mentioned above, although this invention was demonstrated based on embodiment, this invention is not limited to these embodiment, Various forms of the range which does not deviate from the summary of this invention are also contained in this invention. .

例えば、上記の実施の形態の機能を制御方法として、この制御方法を画像処理装置に実行させるようにすればよい。また、上述の実施の形態の機能を有するプログラムを制御プログラムとして、当該制御プログラムを画像処理装置が備えるコンピュータに実行させるようにしてもよい。なお、制御プログラムは、例えば、コンピュータに読み取り可能な記録媒体に記録される。   For example, the function of the above embodiment may be used as a control method, and this control method may be executed by the image processing apparatus. In addition, a program having the functions of the above-described embodiments may be used as a control program, and the control program may be executed by a computer included in the image processing apparatus. The control program is recorded on a computer-readable recording medium, for example.

上記の制御方法および制御プログラムの各々は、少なくとも判定ステップおよび動きベクトル検出ステップを有している。   Each of the above control method and control program has at least a determination step and a motion vector detection step.

また、本発明は、以下の処理を実行することによっても実現される。つまり、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種の記録媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPUなど)がプログラムを読み出して実行する処理である。   The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various recording media, and the computer (or CPU, MPU, etc.) of the system or apparatus reads the program. To be executed.

101 制御部
104 光学系
105 撮像部
106 A/D変換部
107 画像処理部
108 記録媒体
201 信頼性判定部
202 動きベクトル検出部
203 アフィン係数算出部
207 アフィン変換部
DESCRIPTION OF SYMBOLS 101 Control part 104 Optical system 105 Image pick-up part 106 A / D conversion part 107 Image processing part 108 Recording medium 201 Reliability determination part 202 Motion vector detection part 203 Affine coefficient calculation part 207 Affine conversion part

Claims (7)

第1の画像と第2の画像との間の動きベクトルを求める画像処理装置であって、
前記第1の画像における第1のターゲットブロックと前記第1のターゲットブロックに対応する前記第2の画像における参照ブロックを比較し、特徴パターンが存在する参照ブロックを判定する判定手段と、
前記判定手段によって前記特徴パターンが存在すると判定された前記参照ブロックを第2のターゲットブロックとし、前記第1の画像において前記第2のターゲットブロックに対応する参照ブロックを設定して、前記第2のターゲットブロックと前記第1の画像における参照ブロックとの相関値を求めて動きベクトルを検出する動きベクトル検出手段と、
を有することを特徴とする画像処理装置。
An image processing apparatus for obtaining a motion vector between a first image and a second image,
Determining means for comparing a first target block in the first image and a reference block in the second image corresponding to the first target block, and determining a reference block having a feature pattern;
The reference block determined by the determining unit to determine that the feature pattern exists is set as a second target block, a reference block corresponding to the second target block is set in the first image, and the second block is set. Motion vector detection means for detecting a motion vector by obtaining a correlation value between a target block and a reference block in the first image;
An image processing apparatus comprising:
前記判定手段は、前記第1のターゲットブロックと前記第2の画像における参照ブロックとの相関値を表す第1の相関値マップを生成して、当該第1の相関値マップに応じて前記特徴パターンを備える前記参照ブロックが存在する否かを判定することを特徴とする請求項1に記載の画像処理装置。   The determination unit generates a first correlation value map that represents a correlation value between the first target block and a reference block in the second image, and the feature pattern according to the first correlation value map The image processing apparatus according to claim 1, wherein it is determined whether or not the reference block including 前記判定手段は、前記第1の相関値マップが線形状であり、かつ当該線が途切れていると、前記特徴パターンを備える前記参照ブロックが存在すると判定して、前記線の途切れ部分に位置する前記参照ブロックを前記第2のターゲットブロックとして設定することを特徴とする請求項2に記載の画像処理装置。   The determination means determines that the reference block having the feature pattern exists when the first correlation value map has a line shape and the line is interrupted, and is located at an interrupted portion of the line. The image processing apparatus according to claim 2, wherein the reference block is set as the second target block. 前記判定手段は、前記第1の相関値マップが複数の極小値を有し、かつ当該極小値の分布密度が予め定められた閾値よりも低い領域が存在すると、前記特徴パターンを備える前記参照ブロックが存在すると判定して、前記極小値の分布密度が予め定められた閾値よりも低い領域に位置する前記参照ブロックを前記第2のターゲットブロックとして設定することを特徴とする請求項2に記載の画像処理装置。   When the first correlation value map has a plurality of local minimum values and there is a region where the distribution density of the local minimums is lower than a predetermined threshold, the determination unit includes the reference pattern. The reference block located in a region where the distribution density of the local minimum is lower than a predetermined threshold is set as the second target block. Image processing device. 複数の前記第1のターゲットブロックが存在する際、前記動きベクトル検出手段は、前記第1のターゲットブロックの各々について、前記第1のターゲットブロックに対応する第1の動きベクトル又は前記第2のターゲットブロックに対応する第2の動きベクトルを検出して、前記第1の動きベクトル又は前記第2の動きベクトルを検出する際、前記第1の動きベクトルおよび前記第2の動きベクトルの起点を同一の画像に位置づけることを特徴とする請求項1〜請求項4のいずれか1項に記載の画像処理装置。   When there are a plurality of the first target blocks, the motion vector detection means, for each of the first target blocks, the first motion vector corresponding to the first target block or the second target When the second motion vector corresponding to the block is detected and the first motion vector or the second motion vector is detected, the starting points of the first motion vector and the second motion vector are the same. The image processing apparatus according to claim 1, wherein the image processing apparatus is positioned in an image. 第1の画像と第2の画像との間の動きベクトルを求める画像処理装置の制御方法であって、
前記第1の画像における第1のターゲットブロックと前記第1のターゲットブロックに対応する前記第2の画像における参照ブロックを比較し、特徴パターンが存在する参照ブロックを判定する判定ステップと、
前記判定ステップで前記特徴パターンが存在すると判定された前記参照ブロックを第2のターゲットブロックとし、前記第1の画像において前記第2のターゲットブロックに対応する参照ブロックを設定して、前記第2のターゲットブロックと前記第1の画像における参照ブロックとの相関値を求めて動きベクトルを検出する動きベクトル検出ステップと、
を有することを特徴とする制御方法。
A control method of an image processing apparatus for obtaining a motion vector between a first image and a second image,
A determination step of comparing a first target block in the first image and a reference block in the second image corresponding to the first target block to determine a reference block in which a feature pattern exists;
The reference block determined as having the feature pattern in the determination step is set as a second target block, a reference block corresponding to the second target block is set in the first image, and the second block is set. A motion vector detection step of detecting a motion vector by obtaining a correlation value between a target block and a reference block in the first image;
A control method characterized by comprising:
第1の画像と第2の画像との間の動きベクトルを求める画像処理装置で用いられる制御プログラムであって、
前記画像処理装置が備えるコンピュータに、
前記第1の画像における第1のターゲットブロックと前記第1のターゲットブロックに対応する前記第2の画像における参照ブロックを比較し、特徴パターンが存在する参照ブロックを判定する判定ステップと、
前記判定ステップで前記特徴パターンが存在すると判定された前記参照ブロックを第2のターゲットブロックとし、前記第1の画像において前記第2のターゲットブロックに対応する参照ブロックを設定して、前記第2のターゲットブロックと前記第1の画像における参照ブロックとの相関値を求めて動きベクトルを検出する動きベクトル検出ステップと、
を実行させることを特徴とする制御プログラム。
A control program used in an image processing device for obtaining a motion vector between a first image and a second image,
In the computer provided in the image processing apparatus,
A determination step of comparing a first target block in the first image and a reference block in the second image corresponding to the first target block to determine a reference block in which a feature pattern exists;
The reference block determined as having the feature pattern in the determination step is set as a second target block, a reference block corresponding to the second target block is set in the first image, and the second block is set. A motion vector detection step of detecting a motion vector by obtaining a correlation value between a target block and a reference block in the first image;
A control program characterized by causing
JP2013189326A 2013-09-12 2013-09-12 Image processing apparatus, control method thereof, and control program Expired - Fee Related JP6207311B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013189326A JP6207311B2 (en) 2013-09-12 2013-09-12 Image processing apparatus, control method thereof, and control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013189326A JP6207311B2 (en) 2013-09-12 2013-09-12 Image processing apparatus, control method thereof, and control program

Publications (3)

Publication Number Publication Date
JP2015056043A true JP2015056043A (en) 2015-03-23
JP2015056043A5 JP2015056043A5 (en) 2016-10-27
JP6207311B2 JP6207311B2 (en) 2017-10-04

Family

ID=52820401

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013189326A Expired - Fee Related JP6207311B2 (en) 2013-09-12 2013-09-12 Image processing apparatus, control method thereof, and control program

Country Status (1)

Country Link
JP (1) JP6207311B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017157259A1 (en) * 2016-03-15 2017-09-21 Mediatek Inc. Method and apparatus of video coding with affine motion compensation
TWI617185B (en) * 2016-03-15 2018-03-01 聯發科技股份有限公司 Method and apparatus of video coding with affine motion compensation
CN116051390A (en) * 2022-08-15 2023-05-02 荣耀终端有限公司 Motion blur degree detection method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009223722A (en) * 2008-03-18 2009-10-01 Sony Corp Image signal processing apparatus, image signal processing method, and program
JP2010118862A (en) * 2008-11-12 2010-05-27 Canon Inc Image processor, imaging apparatus and image processing method
JP2013074403A (en) * 2011-09-27 2013-04-22 Jvc Kenwood Corp Motion vector detector detection device and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009223722A (en) * 2008-03-18 2009-10-01 Sony Corp Image signal processing apparatus, image signal processing method, and program
JP2010118862A (en) * 2008-11-12 2010-05-27 Canon Inc Image processor, imaging apparatus and image processing method
JP2013074403A (en) * 2011-09-27 2013-04-22 Jvc Kenwood Corp Motion vector detector detection device and method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017157259A1 (en) * 2016-03-15 2017-09-21 Mediatek Inc. Method and apparatus of video coding with affine motion compensation
TWI617185B (en) * 2016-03-15 2018-03-01 聯發科技股份有限公司 Method and apparatus of video coding with affine motion compensation
RU2696551C1 (en) * 2016-03-15 2019-08-02 МедиаТек Инк. Method and device for encoding video with compensation of affine motion
US10638152B2 (en) 2016-03-15 2020-04-28 Mediatek Inc. Method and apparatus of video coding with affine motion compensation
US11375226B2 (en) 2016-03-15 2022-06-28 Hfi Innovation Inc. Method and apparatus of video coding with affine motion compensation
CN116051390A (en) * 2022-08-15 2023-05-02 荣耀终端有限公司 Motion blur degree detection method and device
CN116051390B (en) * 2022-08-15 2024-04-09 荣耀终端有限公司 Motion blur degree detection method and device

Also Published As

Publication number Publication date
JP6207311B2 (en) 2017-10-04

Similar Documents

Publication Publication Date Title
JP6395506B2 (en) Image processing apparatus and method, program, and imaging apparatus
JP6351238B2 (en) Image processing apparatus, imaging apparatus, and distance correction method
US8289402B2 (en) Image processing apparatus, image pickup apparatus and image processing method including image stabilization
US9418291B2 (en) Information processing apparatus, information processing method, and computer-readable storage medium
JP5374119B2 (en) Distance information acquisition device, imaging device, and program
JP2004234423A (en) Stereoscopic image processing method, stereoscopic image processor and stereoscopic image processing program
EP1968308B1 (en) Image processing method, image processing program, image processing device, and imaging device
JP6207311B2 (en) Image processing apparatus, control method thereof, and control program
JP5822463B2 (en) Three-dimensional measuring apparatus, three-dimensional measuring method, and program
JP6091172B2 (en) Feature point detection apparatus and program
JP5968379B2 (en) Image processing apparatus and control method thereof
US20150204661A1 (en) Image processing apparatus and image processing method
JP2019067358A (en) Estimation program, estimation method and estimation system
JP5173549B2 (en) Image processing apparatus and imaging apparatus
JP2015226326A (en) Video analysis method and video analysis device
US20150302589A1 (en) Image processing apparatus that forms distance image and control method thereof, as well as storage medium
JP4107273B2 (en) Moving body detection device
JP5470529B2 (en) Motion detection device, motion detection method, and motion detection program
JP6378496B2 (en) Image processing apparatus, control method, and recording medium
JP6074198B2 (en) Image processing apparatus and image processing method
JP2011171991A (en) Image processing apparatus, electronic device, image processing method and image processing program
JP2012068842A (en) Motion vector detection apparatus, motion vector detection method, and, motion vector detection program
JP2010079815A (en) Image correction device
JP2018072942A (en) Image processing apparatus, image processing method, program, and storage medium
JP2007140763A (en) Image processor and image processing method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160909

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160909

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170731

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170808

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170905

R151 Written notification of patent or utility model registration

Ref document number: 6207311

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees