JP2016163257A - Image processor, control method thereof, and control program, and imaging device - Google Patents

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

Info

Publication number
JP2016163257A
JP2016163257A JP2015042333A JP2015042333A JP2016163257A JP 2016163257 A JP2016163257 A JP 2016163257A JP 2015042333 A JP2015042333 A JP 2015042333A JP 2015042333 A JP2015042333 A JP 2015042333A JP 2016163257 A JP2016163257 A JP 2016163257A
Authority
JP
Japan
Prior art keywords
image
reduction
original image
motion vector
reference image
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
JP2015042333A
Other languages
Japanese (ja)
Other versions
JP6548409B2 (en
Inventor
文貴 中山
Fumitaka Nakayama
文貴 中山
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 JP2015042333A priority Critical patent/JP6548409B2/en
Publication of JP2016163257A publication Critical patent/JP2016163257A/en
Application granted granted Critical
Publication of JP6548409B2 publication Critical patent/JP6548409B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To satisfactorily correct blurring in an image by detecting a motion vector with high accuracy regardless of a shutter speed.SOLUTION: Image reduction circuits 107 and 108 regard one image as an original image, regard an image obtained by a result of photographing after the original image as a reference image, and perform reduction processing of the original image and the reference image. A reduction rate determination circuit 106 determines a reduction rate when the image reduction circuits perform reduction processing in accordance with a shutter speed during photographing, and a motion vector detection circuit 109 detects a motion vector between the original image and the reference image on the basis of the original image and the reference image subjected to the reduction processing.SELECTED DRAWING: Figure 1

Description

本発明は、画像処理装置、その制御方法、および制御プログラム、並びに撮像装置に関し、特に、撮像装置の動き(振れ)に起因する画像のぶれを低減する防振処理技術に関する。   The present invention relates to an image processing device, a control method thereof, a control program, and an imaging device, and more particularly, to an image stabilization processing technique for reducing image blur due to motion (shake) of the imaging device.

一般に、デジタルスチルカメラ又はデジタルビデオカメラなどの撮像装置の振れに起因する画像のぶれを低減する電子的な防振処理を施すことが行われている。そして、防振処理を施すためには、フレーム間における動き量を検出して複数枚の画像の位置合わせ処理を行う必要がある。   In general, electronic image stabilization processing is performed to reduce image blurring caused by image blurring of an imaging apparatus such as a digital still camera or a digital video camera. In order to perform the image stabilization process, it is necessary to detect the amount of motion between frames and perform the alignment process for a plurality of images.

フレーム間における動き量を検出する手法においては、例えば、ジャイロセンサなどの外部機器で得られた振れ情報が用いられる。さらには、撮影の結果得られた画像から動き量を推定することも行われている。例えば、画像から動き量を推定する手法として、テンプレートマッチングを用いて動きベクトルを検出する手法がある。   In the technique for detecting the amount of motion between frames, for example, shake information obtained by an external device such as a gyro sensor is used. Further, the amount of motion is estimated from an image obtained as a result of shooting. For example, as a technique for estimating a motion amount from an image, there is a technique for detecting a motion vector using template matching.

テンプレートマッチングにおいては、例えば、2枚の画像の一方を原画像とし、他方の画像を参照画像とする。原画像に配置した所定の大きさの矩形領域をテンプレートブロックとして、参照画像においてテンプレートブロックの輝度値分布との相関を求める。そして、参照画像において最も相関値が高くなる領域をテンプレートブロックの移動先とし、原画像におけるテンプレートブロックの位置を基準とした場合の移動先に対する向きおよび移動量を動きベクトルとする。   In template matching, for example, one of the two images is used as an original image, and the other image is used as a reference image. Using a rectangular area of a predetermined size arranged in the original image as a template block, the correlation with the luminance value distribution of the template block is obtained in the reference image. Then, the region having the highest correlation value in the reference image is set as the movement destination of the template block, and the direction and movement amount with respect to the movement destination when the position of the template block in the original image is used as a reference is set as the motion vector.

次に、上述のようにして求めた複数の動きベクトルを用いて統計的な処理などを行って、画像間の動きを幾何変形量として求める。この際、画像全域から多数の動きベクトルを精度よく求めることができれば、正確に画像間の幾何変形量を求めることができる。   Next, statistical processing or the like is performed using the plurality of motion vectors obtained as described above, and a motion between images is obtained as a geometric deformation amount. At this time, if a large number of motion vectors can be accurately obtained from the entire image, the amount of geometric deformation between the images can be accurately obtained.

ところが、処理時間およびリソースを抑制しようとすると高精度で多数の動きベクトルを得ることは困難である。   However, it is difficult to obtain a large number of motion vectors with high accuracy in order to reduce processing time and resources.

一方、画像が不明瞭(つまり、不鮮明)であると、画像間の相関を求めることが困難となって動きベクトル精度が低下してしまう。なお、ここでは、不鮮明な画像とは、エッジなどの高周波成分が減衰した画像をいう。   On the other hand, if the images are unclear (that is, unclear), it is difficult to obtain the correlation between the images, and the motion vector accuracy decreases. Here, the unclear image refers to an image in which high-frequency components such as edges are attenuated.

例えば、夜間など暗い場所で撮影する場合には、撮像センサに入射する光量を多くするため、シャッタースピードを遅くして撮影することがある。このような場合には、撮影の結果得られた画像に動きぶれが生じて不鮮明な画像となってしまう。これによって、動きベクトルの精度が低下する。よって、シャッタースピードを遅くしても、動きベクトルの精度を保証できるように撮影の制御を行う必要がある。   For example, when shooting in a dark place such as at night, in order to increase the amount of light incident on the image sensor, shooting may be performed with a slow shutter speed. In such a case, motion blur occurs in an image obtained as a result of shooting, resulting in an unclear image. This reduces the accuracy of the motion vector. Therefore, it is necessary to control shooting so as to guarantee the accuracy of the motion vector even if the shutter speed is slowed down.

動きベクトルの精度を保証するため、例えば、動きベクトルの精度に応じて動きベクトルを検出する際に用いるパラメータを変更する手法がある。例えば、動きベクトルの誤検出が画像にどのような影響を与えるかを示す影響パラメータを生成して、当該影響パラメータに応じて原画像および参照画像の縮小率を制御するようにしたものがある(特許文献1参照)。   In order to guarantee the accuracy of the motion vector, for example, there is a method of changing a parameter used when detecting the motion vector according to the accuracy of the motion vector. For example, an influence parameter indicating how an erroneous detection of a motion vector affects an image is generated, and the reduction ratio of the original image and the reference image is controlled according to the influence parameter ( Patent Document 1).

特開2010−252259号公報JP 2010-252259 A

ところが、上述の特許文献1に記載の手法では、テンプレートブロックにおける輝度値の分散値および平均値に基づいて画像の縮小率を変更するようにしており、シャッタースピードに応じて画像の縮小率を調整することは行われていない。このため、特許文献1に記載の手法では、シャッタースピードによっては精度よく動きベクトルを検出することができないことがある。   However, in the method described in Patent Document 1 described above, the image reduction rate is changed based on the variance value and the average value of the luminance values in the template block, and the image reduction rate is adjusted according to the shutter speed. It is not done. For this reason, the technique described in Patent Document 1 may not be able to detect a motion vector with high accuracy depending on the shutter speed.

よって、本発明の目的は、シャッタースピードに拘わらず精度よく動きベクトルを検出することのできる画像処理装置、その制御方法、および制御プログラム、並びに撮像装置を提供することにある。   Therefore, an object of the present invention is to provide an image processing apparatus capable of detecting a motion vector with high precision regardless of the shutter speed, a control method thereof, a control program, and an imaging apparatus.

上記の目的を達成するため、本発明による画像処理装置は、1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小手段と、前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小手段によって縮小処理を行う際の縮小率を決定する決定手段と、前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出手段と、を有することを特徴する。   In order to achieve the above object, an image processing apparatus according to the present invention uses one image as an original image, an image obtained as a result of shooting after the original image as a reference image, and the original image and the reference image. Reduction means for reduction processing, determination means for determining a reduction rate when the reduction processing is performed by the reduction means in accordance with a shutter speed at the time of photographing the original image and the reference image, and the original on which the reduction processing has been performed And detecting means for detecting a motion vector between the original image and the reference image based on the image and the reference image.

本発明による画像処理装置の制御方法は、1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小ステップと、前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、を有することを特徴する。   The control method of the image processing apparatus according to the present invention includes a reduction step of reducing the original image and the reference image using one image as an original image and an image obtained as a result of photographing after the original image as a reference image. A determination step of determining a reduction ratio when performing the reduction process in the reduction step according to a shutter speed at the time of shooting the original image and the reference image, and the original image and the reference image subjected to the reduction process And a detection step of detecting a motion vector between the original image and the reference image.

本発明による制御プログラムは、画像処理装置で用いられる制御プログラムであって、前記画像処理装置に備えられたコンピュータに、1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小ステップと、前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、を実行させることを特徴する。   A control program according to the present invention is a control program used in an image processing apparatus, and is obtained as a result of photographing after making an original image one image on a computer provided in the image processing apparatus. A reduction ratio for reducing the original image and the reference image as a reference image, and performing a reduction process in the reduction step according to a shutter speed at the time of shooting the original image and the reference image. A determination step of determining and a detection step of detecting a motion vector between the original image and the reference image based on the original image and the reference image on which the reduction process has been performed are executed.

本発明によれば、シャッタースピードに応じて動きベクトルの検出に用いられる画像の縮小率を決定するようにしたので、シャッタースピードに拘わらず精度よく動きベクトルを検出して、画像におけるぶれを良好に補正することができる。   According to the present invention, since the reduction ratio of the image used for detecting the motion vector is determined according to the shutter speed, the motion vector is detected accurately regardless of the shutter speed, and the blur in the image is improved. It can be corrected.

本発明の第1の実施形態による画像処理装置を備える撮像装置の一例についてその構成を示すブロック図である。1 is a block diagram illustrating a configuration of an example of an imaging apparatus including an image processing apparatus according to a first embodiment of the present invention. 図1に示すカメラで行われる撮影処理の一例を説明するためのフローチャートである。3 is a flowchart for explaining an example of a photographing process performed by the camera shown in FIG. 1. 画像の縮小率と動きベクトルの検出数との関係についてその一例を示す図である。It is a figure which shows the example about the relationship between the reduction rate of an image, and the detection number of a motion vector. 画像の縮小率と動きベクトルの精度との関係についてその一例を示す図である。It is a figure which shows the example about the relationship between the reduction ratio of an image, and the precision of a motion vector. 図3および図4に基づいた縮小率と残動きベクトル数およびベクトル精度との関係を示す図である。It is a figure which shows the relationship between the reduction rate based on FIG. 3 and FIG. 4, the number of remaining motion vectors, and vector accuracy. シャッタースピードと縮小率との関係の一例を説明するための図であり、(a)は第1の例を示す図、(b)は第2の例を示す図である。It is a figure for demonstrating an example of the relationship between shutter speed and a reduction rate, (a) is a figure which shows a 1st example, (b) is a figure which shows a 2nd example. 撮影シーンの一例を説明するための図であり、(a)はシャッタースピードが速い場合の画像を示す図、(b)はシャッタースピードが遅い場合の画像を示す図である。It is a figure for demonstrating an example of an imaging | photography scene, (a) is a figure which shows an image when shutter speed is fast, (b) is a figure which shows an image when shutter speed is slow. シャッタースピードと縮小率との関係の他の例を説明するための図である。It is a figure for demonstrating the other example of the relationship between shutter speed and a reduction rate. 図1に示す動きベクトル検出回路で行われるテンプレートマッチングを説明するための図であり、(a)は原画像の一例を示す図、(b)は参照画像の一例を示す図である。2A and 2B are diagrams for explaining template matching performed by the motion vector detection circuit illustrated in FIG. 1. FIG. 2A is a diagram illustrating an example of an original image, and FIG. 2B is a diagram illustrating an example of a reference image. 本発明の第2の実施形態によるカメラの一例についてその構成を示すブロック図である。It is a block diagram which shows the structure about an example of the camera by the 2nd Embodiment of this invention. 図10に示すカメラで行われる撮影処理の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the imaging | photography process performed with the camera shown in FIG.

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

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

図示の撮像装置は、例えば、デジタルカメラ(以下単にカメラと呼ぶ)であり、撮像光学系(以下単に光学系と呼ぶ)を有している。撮像素子102には光学系101を介して被写体像(光学像)が結像する。撮像素子102は、CCDセンサ又はCMOSセンサであり、光電変換によって光学像に応じた電気信号(アナログ信号)を出力する。   The illustrated imaging apparatus is, for example, a digital camera (hereinafter simply referred to as a camera) and has an imaging optical system (hereinafter simply referred to as an optical system). A subject image (optical image) is formed on the image sensor 102 via the optical system 101. The image sensor 102 is a CCD sensor or a CMOS sensor, and outputs an electrical signal (analog signal) corresponding to an optical image by photoelectric conversion.

カメラ信号処理回路103は撮像素子102の出力であるアナログ信号に応じた画像信号(カメラ信号ともいう)を生成する。カメラ信号処理回路103は、例えば、A/D変換回路、オートゲイン制御回路(AGC)、およびオートホワイトバランス回路(AWB)を有しており、アナログ信号に対して所定の画像処理を行ってデジタル信号であるカメラ信号を出力する。   The camera signal processing circuit 103 generates an image signal (also referred to as a camera signal) corresponding to an analog signal that is an output of the image sensor 102. The camera signal processing circuit 103 includes, for example, an A / D conversion circuit, an auto gain control circuit (AGC), and an auto white balance circuit (AWB), and performs predetermined image processing on the analog signal to perform digital processing. The camera signal which is a signal is output.

カメラ信号処理回路103の出力であるカメラ信号は一旦メモリ104に記録される。メモリ104はカメラ信号の1フレーム又は複数のフレームを記録するためのメモリである。なお、以下の説明では、1フレームの画像をフレーム画像と呼ぶ。また、図示の例では撮像素子102およびカメラ信号処理回路103によって、画像を取得するための撮像系が構成される。   The camera signal that is the output of the camera signal processing circuit 103 is temporarily recorded in the memory 104. The memory 104 is a memory for recording one frame or a plurality of frames of the camera signal. In the following description, an image of one frame is called a frame image. In the illustrated example, the imaging device 102 and the camera signal processing circuit 103 constitute an imaging system for acquiring an image.

縮小率決定回路106は、マイコン112の制御下で、撮影の際のシャッタースピードに応じてフレーム画像を縮小する際の縮小率を決定する。画像縮小回路107および108の各々は、縮小率決定回路106で決定された縮小率に基づいてメモリ104に記録されたフレーム画像に対して縮小処理を施す。   The reduction rate determination circuit 106 determines a reduction rate when reducing the frame image according to the shutter speed at the time of shooting under the control of the microcomputer 112. Each of the image reduction circuits 107 and 108 performs a reduction process on the frame image recorded in the memory 104 based on the reduction rate determined by the reduction rate determination circuit 106.

動きベクトル検出回路109は、画像縮小回路107および108の出力である縮小後の2枚のフレーム画像間における動きベクトルを検出する。幾何変形パラメータ推定回路110は、動きベクトル検出回路109で得られた動きベクトルを用いて、フレーム画像間のぶれの補正量を幾何変形パラメータとして出力する。幾何変形回路111は幾何変形パラメータに基づいてフレーム画像のぶれを補正するための幾何変形処理を行う。なお、マイコン112はカメラ全体の制御を司る。   A motion vector detection circuit 109 detects a motion vector between two reduced frame images, which is an output of the image reduction circuits 107 and 108. The geometric deformation parameter estimation circuit 110 uses the motion vector obtained by the motion vector detection circuit 109 to output a blur correction amount between frame images as a geometric deformation parameter. The geometric deformation circuit 111 performs a geometric deformation process for correcting blurring of the frame image based on the geometric deformation parameters. The microcomputer 112 controls the entire camera.

図2は、図1に示すカメラで行われる撮影処理の一例を説明するためのフローチャートである。なお、図示のフローチャートに係る処理は、マイコン112の制御下で行われる。   FIG. 2 is a flowchart for explaining an example of a photographing process performed by the camera shown in FIG. Note that the processing according to the illustrated flowchart is performed under the control of the microcomputer 112.

撮影が開始されると、マイコン112の制御下で、カメラ信号処理回路103は撮像素子102の出力であるアナログ信号に対して処理の画像処理を行って、カメラ信号を生成する(画像入力:ステップS201)。ここでは、カメラ信号処理回路103は、例えば、12ビットのデジタル信号をカメラ信号として出力する。この際、カメラ信号処理回路103はAGCおよびAWBによって信号レベル補正および白レベル補正を行って、カメラ信号(つまり、フレーム画像)をメモリ104に記録する。   When shooting is started, under the control of the microcomputer 112, the camera signal processing circuit 103 performs processing image processing on the analog signal that is the output of the image sensor 102 to generate a camera signal (image input: step). S201). Here, the camera signal processing circuit 103 outputs, for example, a 12-bit digital signal as a camera signal. At this time, the camera signal processing circuit 103 performs signal level correction and white level correction by AGC and AWB, and records a camera signal (that is, a frame image) in the memory 104.

図示のカメラにおいては、所定のフレームレートで順次フレーム画像を生成して、メモリ104にフレーム画像を記録する。そして、メモリ104に記録された等倍サイズのフレーム画像は画像縮小回路107および108に入力される。なお、メモリ104に記録されたフレーム画像は順次更新される。   In the illustrated camera, frame images are sequentially generated at a predetermined frame rate, and the frame images are recorded in the memory 104. Then, the same size frame image recorded in the memory 104 is input to the image reduction circuits 107 and 108. Note that the frame images recorded in the memory 104 are sequentially updated.

続いて、縮小率決定回路106は、マイコン112の制御下で、後述するようにして、フレーム画像の縮小率を決定して、当該縮小率を画像縮小回路107および108に設定する(ステップS202)。   Subsequently, the reduction rate determination circuit 106 determines the reduction rate of the frame image under the control of the microcomputer 112 as described later, and sets the reduction rate in the image reduction circuits 107 and 108 (step S202). .

図3は、画像の縮小率と動きベクトルの検出数との関係についてその一例を示す図である。   FIG. 3 is a diagram illustrating an example of the relationship between the image reduction rate and the number of detected motion vectors.

図3において、横軸は縮小率を示し、縮小率が大きくなる程、縮小後の画像サイズは大きく、縮小率が小さくなる程、縮小後の画像サイズは小さくなる。そして、縮小率=1においては、画像の縮小は行われない。また、縦軸は検出された動きベクトルにおいて信頼度が高いと判定された動きベクトルの数(残動きベクトル数)を示す。   In FIG. 3, the horizontal axis indicates the reduction ratio. The larger the reduction ratio, the larger the image size after reduction, and the smaller the reduction ratio, the smaller the image size after reduction. When the reduction ratio = 1, the image is not reduced. The vertical axis represents the number of motion vectors (the number of remaining motion vectors) determined to have high reliability in the detected motion vectors.

ここで、動きベクトルの信頼度は、例えば、どのようなテクスチャを有する領域から検出された動きベクトルであるかに応じて決定される。つまり、低コントラストの領域および繰り返しパターンを含む領域は、テンプレートマッチングによる動きベクトルの検出が難しい領域であるので、当該領域においては精度よく動きベクトルが検出される可能性は低い。   Here, the reliability of the motion vector is determined in accordance with, for example, what kind of texture the motion vector is detected from. That is, the low-contrast region and the region including the repetitive pattern are regions in which it is difficult to detect a motion vector by template matching, and therefore there is a low possibility that a motion vector is accurately detected in the region.

テクスチャ判定を行うためには、テンプレートにおける画素の輝度値についてその平均値および分散値を求めて、平均値および分散値に応じて当該領域が低コントラスト領域又は繰り返しパターン領域であるか否かを判定する。そして、低コントラスト領域又は繰り返しパターン領域であると判定されると、その領域で検出された動きベクトルは信頼度が低いとして除外される。このような判定を全ての動きベクトルについて行って、最終的に残った信頼度の高い動きベクトルの数が残動きベクトル数とされる。   In order to perform texture determination, the average value and dispersion value of the luminance values of the pixels in the template are obtained, and it is determined whether the area is a low contrast area or a repeated pattern area according to the average value and dispersion value. To do. If it is determined that the region is a low-contrast region or a repeated pattern region, the motion vector detected in that region is excluded as having low reliability. Such a determination is performed for all the motion vectors, and the number of motion vectors with high reliability remaining finally is set as the number of remaining motion vectors.

図4に示すように、縮小率が1に近い程、つまり、動きベクトルの検出に用いる画像サイズが大きい程、テンプレートとの相関が高い箇所が複数発生する傾向が強くなって、動きベクトルを誤検出することが多くなる。そして、誤検出された動きベクトルは誤差の要因となるので使用することはできない。   As shown in FIG. 4, the closer the reduction ratio is to 1, that is, the larger the image size used for motion vector detection, the more likely that multiple locations with high correlation with the template are generated, resulting in erroneous motion vectors. More are detected. The erroneously detected motion vector cannot be used because it causes an error.

さらに、縮小率が1に近い程、テンプレートにおけるテクスチャが乏しくなって、低コントラスト領域と判定される結果、除外される動きベクトルの数が増加する。このため、縮小率が1に近い程、残動きベクトル数は減少する。   Furthermore, as the reduction ratio is closer to 1, the texture in the template becomes poor, and as a result of being determined as a low contrast region, the number of motion vectors to be excluded increases. For this reason, the number of remaining motion vectors decreases as the reduction ratio approaches 1.

一方、縮小率が0に近い程、つまり、動きベクトルの検出に用いる画像サイズが小さい程、テンプレートに画像の広い領域におけるテクスチャが入ることになる。これによって、低コントラストおよび繰り返し判定によって除外される動きベクトルが少なくなって、残動きベクトル数が増加する。   On the other hand, the closer the reduction ratio is to 0, that is, the smaller the image size used for motion vector detection, the more texture in the wide area of the image will be in the template. As a result, the number of motion vectors excluded due to low contrast and repeated determination decreases, and the number of remaining motion vectors increases.

図4は、画像の縮小率と動きベクトルの精度との関係についてその一例を示す図である。   FIG. 4 is a diagram illustrating an example of the relationship between the image reduction ratio and the accuracy of the motion vector.

図4において、横軸は縮小率を示し、縦軸は動きベクトルの検出精度を示す。図示のように、縮小率が1に近い程、つまり、動きベクトルの検出に用いる画像サイズが大きい程、画像が明瞭であるため動きベクトルの精度が向上する。一方、縮小率が0に近い程、縮小処理によるローパスフィルタ効果に起因して画像が不鮮明になって、動きベクトルの検出精度が低下する。   In FIG. 4, the horizontal axis represents the reduction ratio, and the vertical axis represents the motion vector detection accuracy. As shown in the figure, the closer the reduction ratio is to 1, that is, the larger the image size used for motion vector detection, the clearer the image, the more accurate the motion vector. On the other hand, as the reduction ratio is closer to 0, the image becomes unclear due to the low-pass filter effect by the reduction processing, and the motion vector detection accuracy decreases.

よって、画像を縮小処理する際には、縮小率を0に近づけるには限界があり、動きベクトルの検出精度が低下しても検知限以上の精度を保つことができるように、縮小率制限501が設定される。なお、検知限とは正確な動きベクトルと同一とみなすことが可能な精度の限界をいう。例えば、検知限とは、ある動きベクトルを用いて画像の幾何変形を行った際に、正確な動きベクトルを用いて幾何変形を行った画像との相違が目視では分からない程度の検出精度のことをいう。   Therefore, when the image is reduced, there is a limit to making the reduction rate close to 0, and even if the detection accuracy of the motion vector is lowered, the reduction rate limit 501 is maintained so that the accuracy beyond the detection limit can be maintained. Is set. The detection limit is a limit of accuracy that can be regarded as the same as an accurate motion vector. For example, the detection limit is detection accuracy that does not allow visual recognition of the difference from an image that has been geometrically deformed using an accurate motion vector when the image is geometrically deformed using a certain motion vector. Say.

また、幾何変形パラメータを求める際には、並進成分の動きのみではなく、回転成分およびあおり成分の動きを推定する必要がある。このためには、画像全体から多くの動きベクトルを検出する必要がある。よって、ここでは、縮小率が0に近い状態を標準状態とする。   Further, when obtaining the geometric deformation parameter, it is necessary to estimate not only the movement of the translation component but also the movement of the rotation component and the tilt component. For this purpose, it is necessary to detect many motion vectors from the entire image. Therefore, here, a state in which the reduction ratio is close to 0 is set as a standard state.

図5は、図3および図4に基づいた縮小率と残動きベクトル数およびベクトル精度との関係を示す図である。   FIG. 5 is a diagram showing the relationship between the reduction rate, the number of remaining motion vectors, and the vector accuracy based on FIGS.

図5に示すように、標準の精度で多数の動きベクトルを検出したい場合(つまり、残動きベクトル数を多くする場合)には縮小率を0に近づけることになる。反対に、少数であっても高精度の動きベクトルを検出したい場合(つまり、残動きベクトル数が少なくともよい場合)には縮小率を1に近づけることになる。つまり、動きベクトルの検出精度に応じて画像サイズが変更される。   As shown in FIG. 5, when it is desired to detect a large number of motion vectors with standard accuracy (that is, when the number of remaining motion vectors is increased), the reduction rate is brought close to zero. On the other hand, when it is desired to detect a highly accurate motion vector even if it is a small number (that is, when the number of remaining motion vectors is at least good), the reduction ratio is brought close to 1. That is, the image size is changed according to the detection accuracy of the motion vector.

図6は、シャッタースピードと縮小率との関係の一例を説明するための図である。そして、図6(a)は第1の例を示す図であり、図6(b)は第2の例を示す図である。   FIG. 6 is a diagram for explaining an example of the relationship between the shutter speed and the reduction ratio. FIG. 6A is a diagram illustrating a first example, and FIG. 6B is a diagram illustrating a second example.

図6において、横軸はシャッタースピードを示し、シャッタースピードが遅くなると、カメラの動き(つまり、振れ)によるぶれが大きくなる。縦軸は縮小率を示し、縮小率が大きくなる程、画像サイズが大きくなる。   In FIG. 6, the horizontal axis indicates the shutter speed, and when the shutter speed is slowed down, camera shake (ie, shake) increases. The vertical axis indicates the reduction ratio, and the image size increases as the reduction ratio increases.

図6(a)に示す例では、シャッタースピードと縮小率との関係は線型的(一次関数的)に変化し、シャッタースピードが遅くなるにつれて縮小率を1に近づける。つまり、シャッタースピードが遅くなるにつれて画像サイズを大きくする。図6(b)に示す例では、シャッタースピードと縮小率との関係は指数関数的に変化し、ここでもシャッタースピードが遅くなるにつれて縮小率を1に近づける。   In the example shown in FIG. 6A, the relationship between the shutter speed and the reduction rate changes linearly (linear function), and the reduction rate approaches 1 as the shutter speed decreases. That is, the image size is increased as the shutter speed is decreased. In the example shown in FIG. 6B, the relationship between the shutter speed and the reduction rate changes exponentially, and here, the reduction rate approaches 1 as the shutter speed decreases.

図6に示す関係を用いる際には、縮小率が1に近い、つまり、動きベクトルの検出に用いる画像のサイズが大きい場合には、明瞭な画像で動きベクトルの検出を行うことになる。このため、検出された動きベクトルの精度は向上する一方、テンプレートとの相関が高い箇所が複数発生する傾向が強くなって、動きベクトルの誤検出が生じ易い。そして、誤った動きベクトルは誤差の要因となるため使用することはできない。   When the relationship shown in FIG. 6 is used, if the reduction ratio is close to 1, that is, the size of the image used for detecting the motion vector is large, the motion vector is detected with a clear image. For this reason, while the accuracy of the detected motion vector is improved, there is a strong tendency to generate a plurality of portions having a high correlation with the template, and erroneous detection of the motion vector is likely to occur. Incorrect motion vectors cannot be used because they cause errors.

さらに、明瞭な画像で動きベクトルの検出を行うと、テンプレート内のテクスチャが乏しくなって、低コントラスト領域と判定されて除外される動きベクトルが増加する。このため、残動きベクトル数が減少する。   Further, when motion vectors are detected with a clear image, the texture in the template becomes poor, and the number of motion vectors that are excluded because they are determined to be low-contrast regions increases. For this reason, the number of remaining motion vectors decreases.

一方、縮小率が0に近い、つまり、動きベクトルの検出に用いる画像のサイズが小さい場合には、不明瞭な画像でベクトル検出を行うことになる。よって、検出される動きベクトルの精度が低下する一方、テンプレート内に画像の広い領域におけるテクスチャが入ることになるので、低コントラストおよび繰り返しパターン判定によって除外されにくくなる。その結果、残動きベクトル数が増加する。   On the other hand, when the reduction ratio is close to 0, that is, when the size of the image used for detecting the motion vector is small, vector detection is performed with an unclear image. Therefore, while the accuracy of the detected motion vector is reduced, a texture in a wide area of the image is included in the template, so that it is difficult to be excluded by low contrast and repeated pattern determination. As a result, the number of remaining motion vectors increases.

図7は、撮影シーンの一例を説明するための図である。そして、図7(a)はシャッタースピードが速い場合の画像を示す図であり、図7(b)はシャッタースピードが遅い場合の画像を示す図である。   FIG. 7 is a diagram for explaining an example of a shooting scene. FIG. 7A shows an image when the shutter speed is fast, and FIG. 7B shows an image when the shutter speed is slow.

ここでは、シャッタースピードに拘わらず、撮影対象物およびカメラの動き(振れ)は同様であるものとする。図7(b)に示す例では、図7(a)に示す例に比べてシャッタースピードが遅いため、カメラの動きが同様であったとしても、画像にぶれが生じ易い。   Here, it is assumed that the movement (shake) of the object to be photographed and the camera are the same regardless of the shutter speed. In the example shown in FIG. 7B, since the shutter speed is slower than in the example shown in FIG. 7A, even if the movement of the camera is the same, the image is likely to be blurred.

図7(a)に示す画像を得た際のシャッタースピードは速いので、画像は明瞭となる。そのため、テンプレートの相関が高い箇所が複数発生する傾向が強くなる。よって、図7(a)に示す画像において動きベクトルを検出する際には、縮小率を0に近づける、つまり、動きベクトルの検出に用いる画像サイズを小さくすれば、残動きベクトル数が向上して、良好に防振処理を行うことができる(標準状態)。   Since the shutter speed when the image shown in FIG. 7A is obtained is fast, the image becomes clear. For this reason, there is a strong tendency that a plurality of locations having a high template correlation are generated. Therefore, when detecting a motion vector in the image shown in FIG. 7A, the number of remaining motion vectors can be improved by reducing the reduction rate to 0, that is, by reducing the image size used for detecting the motion vector. , It can perform the anti-vibration treatment well (standard condition).

一方、図7(b)に示す画像を得た際のシャッタースピードは遅いので、画像はカメラの動き(振れ)によって不明瞭となる。よって、標準状態と同様の縮小率で画像を縮小すると、さらに不明瞭な画像となって、動きベクトルの精度が標準状態で得られる動きベクトルの精度未満となってしまう。従って、図7(b)に示す画像については、縮小率を1に近づけて、つまり、動きベクトルの検出に用いる画像サイズを大きくして、画像が不明瞭になることを抑えた状態で動きベクトルを検出する。これによって、標準状態と同程度の精度で動きベクトルの検出行えるようにする。   On the other hand, since the shutter speed when the image shown in FIG. 7B is obtained is slow, the image becomes unclear due to the movement (shake) of the camera. Therefore, if the image is reduced at the same reduction ratio as in the standard state, the image becomes more unclear and the accuracy of the motion vector is less than the accuracy of the motion vector obtained in the standard state. Therefore, for the image shown in FIG. 7B, the motion vector is set in a state in which the reduction ratio is brought close to 1, that is, the image size used for detecting the motion vector is increased to prevent the image from becoming unclear. Is detected. As a result, the motion vector can be detected with the same accuracy as the standard state.

但し、図3に関連して説明したように、画像サイズを大きくすれば、残動きベクトル数は減少するので、前述のように、縮小率をシャッタースピードに応じて変化させる必要がある。   However, as described with reference to FIG. 3, if the image size is increased, the number of remaining motion vectors decreases, so that the reduction rate needs to be changed according to the shutter speed as described above.

上述のようにして得られた動きベクトルを用いれば、撮影の結果得られた画像に生じるぶれを正確に示す幾何変形パラメータを推定することが可能となって、画像に対して精度よく防振処理を施すことができる。   By using the motion vector obtained as described above, it is possible to estimate the geometric deformation parameter that accurately indicates the blurring that occurs in the image obtained as a result of shooting, and the image stabilization process is performed with high accuracy on the image. Can be applied.

なお、シャッタースピードは、プログラムAEモード、絞り優先AEモード、シャッター優先AEモード、およびマニュアルモードなどのモード毎に異なる。例えば、プログラムAEモードおよび絞り優先AEモードの場合には、カメラによって適切なシャッタースピードが設定される。プログラムAEモードの場合には、カメラによって被写体の明るさに応じた絞りとともにシャッタースピードが自動的に設定される。また、絞り優先AEモードの場合には、絞りが決定された後、適正露出となるようにシャッタースピードが自動的に設定される。   Note that the shutter speed differs for each mode such as the program AE mode, aperture priority AE mode, shutter priority AE mode, and manual mode. For example, in the case of the program AE mode and the aperture priority AE mode, an appropriate shutter speed is set by the camera. In the case of the program AE mode, the shutter speed is automatically set together with an aperture corresponding to the brightness of the subject by the camera. In the case of the aperture priority AE mode, after the aperture is determined, the shutter speed is automatically set so that proper exposure is obtained.

一方、マニュアルモード又はシャッター優先AEモードの場合には、撮影者によって任意にシャッタースピードが設定される。マニュアルモードにおいては、絞りおよびシャッタースピードともに撮影者が決定するが、シャッター優先AEモードの場合には、シャッタースピードを撮影者が決定した後、カメラによって適正露出になるように絞りが設定される。   On the other hand, in the manual mode or the shutter priority AE mode, the shutter speed is arbitrarily set by the photographer. In the manual mode, the photographer determines both the aperture and the shutter speed. However, in the shutter priority AE mode, after the photographer determines the shutter speed, the aperture is set so that a proper exposure is obtained by the camera.

シャッタースピードと縮小率との関係は図7に示す例に限定されない。例えば、「1/焦点距離」秒よりも遅いシャッタースピードに設定されると、画像にぶれが生じやすい。   The relationship between the shutter speed and the reduction ratio is not limited to the example shown in FIG. For example, if the shutter speed is set slower than “1 / focal length” seconds, the image tends to be blurred.

図8は、シャッタースピードと縮小率との関係の他の例を説明するための図である。   FIG. 8 is a diagram for explaining another example of the relationship between the shutter speed and the reduction ratio.

図8において、シャッタースピードが「1/焦点距離」秒以下であると、撮影の結果得られた画像にカメラの動きに起因するぶれが生じにくい。よって、この場合には、前述の標準状態の縮小率で画像を縮小して動きベクトルを検出する。一方、シャッタースピードが「1/焦点距離」秒を超えた場合には、縮小率を大きして、つまり、画像サイズを大きくして動きベクトルを検出する。   In FIG. 8, when the shutter speed is “1 / focal length” seconds or less, an image obtained as a result of shooting is less likely to be blurred due to camera movement. Therefore, in this case, the motion vector is detected by reducing the image at the reduction ratio of the standard state described above. On the other hand, when the shutter speed exceeds “1 / focal length” seconds, the reduction rate is increased, that is, the image size is increased to detect the motion vector.

このようにして、縮小率決定回路106は、マイコン112の制御下でシャッタースピードに応じて画像の縮小率を決定して、当該縮小率を画像縮小回路107および108に送る。   In this way, the reduction rate determination circuit 106 determines the image reduction rate according to the shutter speed under the control of the microcomputer 112, and sends the reduction rate to the image reduction circuits 107 and 108.

再び図2を参照して、画像縮小回路107および108の各々は、縮小率決定回路106で決定された縮小率に応じて画像を縮小する(ステップS203)。ここでは、ステップS201においてメモリ104に等倍サイズで記憶された複数のフレーム画像から動きベクトルの検出に用いる原画像および参照画像が選択されて、画像縮小回路107および108に入力される。そして、画像縮小回路107および108は、縮小率決定回路106で決定された画像縮小率に基づいてそれぞれ原画像および参照画像を縮小処理する。   Referring again to FIG. 2, each of the image reduction circuits 107 and 108 reduces the image according to the reduction ratio determined by the reduction ratio determination circuit 106 (step S203). Here, an original image and a reference image used for motion vector detection are selected from a plurality of frame images stored in the memory 104 at the same size in step S201, and are input to the image reduction circuits 107 and 108. Then, the image reduction circuits 107 and 108 reduce the original image and the reference image based on the image reduction rate determined by the reduction rate determination circuit 106, respectively.

なお、画像縮小の手法については、例えば、縮小率が1/8であれば、8×8の矩形領域における画素値の平均値を算出して、画像を縮小する画素平均法を用いるようにしてもよい。あるいは、中央部に位置する画素値を重み付けする所謂縮小フィルタを用いて、画像を縮小するようにしてもよい。   As for the image reduction method, for example, when the reduction ratio is 1/8, an average value of pixel values in an 8 × 8 rectangular area is calculated, and a pixel average method for reducing the image is used. Also good. Alternatively, the image may be reduced using a so-called reduction filter that weights the pixel value located in the center.

続いて、動きベクトル検出回路109は画像縮小回路107および108から入力された2枚のフレーム画像(縮小処理済みの画像)において動きベクトルを検出する(ステップS204)。例えば、動きベクトル検出回路109はテンプレートマッチングを用いて動きベクトルを検出する。   Subsequently, the motion vector detection circuit 109 detects a motion vector in the two frame images (images subjected to reduction processing) input from the image reduction circuits 107 and 108 (step S204). For example, the motion vector detection circuit 109 detects a motion vector using template matching.

図9は、図1に示す動きベクトル検出回路109で行われるテンプレートマッチングを説明するための図である。そして、図9(a)は原画像の一例を示す図であり、図9(b)は参照画像の一例を示す図である。なお、図9においては、メモリ104に記憶された等倍サイズのフレーム画像を縮小処理した画像が示されている。   FIG. 9 is a diagram for explaining template matching performed by the motion vector detection circuit 109 shown in FIG. FIG. 9A shows an example of the original image, and FIG. 9B shows an example of the reference image. In FIG. 9, an image obtained by reducing the frame image of the same size stored in the memory 104 is shown.

動きベクトル検出回路109は、原画像において任意の位置にテンプレートブロック901を配置する。そして、動きベクトル検出回路109はテンプレートブロック901によって参照画像についてテンプレートマッチングを行って、参照画像の各ブロック領域において相関値を算出する。この際、参照画像の全てのブロック領域について相関値を算出するとその演算量が膨大なものとなる。このため、動きベクトル検出回路109は参照画像において相関値を算出する矩形領域をサーチ範囲902として設定する。ここでは、サーチ範囲902の位置および大きさについては特に制限はないものの、サーチ範囲902内にテンプレートブロック901の移動先に相当するブロック領域が含まれていないと、正しく動きベクトルを検出することができない。   The motion vector detection circuit 109 arranges the template block 901 at an arbitrary position in the original image. The motion vector detection circuit 109 performs template matching on the reference image using the template block 901, and calculates a correlation value in each block region of the reference image. At this time, if the correlation values are calculated for all the block regions of the reference image, the amount of calculation becomes enormous. Therefore, the motion vector detection circuit 109 sets a rectangular area for calculating a correlation value in the reference image as the search range 902. Here, the position and size of the search range 902 are not particularly limited, but if the block range corresponding to the destination of the template block 901 is not included in the search range 902, a motion vector can be detected correctly. Can not.

図示の例では、相関値の算出手法として、差分絶対値和(Sum of Absolute Difference、以下SADと呼ぶ)手法が用いられる。   In the illustrated example, a sum of absolute difference (hereinafter referred to as SAD) technique is used as a correlation value calculation technique.

相関値S_SADを求める際には、動きベクトル検出回路109は、次の式(1)を用いる。   When obtaining the correlation value S_SAD, the motion vector detection circuit 109 uses the following equation (1).

式(1)において、f(i,j)はテンプレートブロック901の座標(i,j)における輝度値を示し、g(i,j)はサーチ範囲902において相関値算出の対象となるブロック領域903の輝度値を示す。そして、SAD手法においては、テンプレートブロック901の輝度値f(i,j)とブロック領域903の輝度値g(i,j)との差の絶対値を求めて、その総和を算出することによって相関値S_SADを得る。   In equation (1), f (i, j) indicates the luminance value at the coordinates (i, j) of the template block 901, and g (i, j) is the block area 903 that is the target of correlation value calculation in the search range 902. Indicates the luminance value. In the SAD technique, the absolute value of the difference between the luminance value f (i, j) of the template block 901 and the luminance value g (i, j) of the block region 903 is obtained, and the correlation is obtained by calculating the sum thereof. Get the value S_SAD.

よって、相関値S_SADが小さい程、テンプレートブロック901とブロック領域903との輝度値の差分が小さい。つまり、テンプレートブロック901とブロック領域903とのテクスチャが類似することになる。   Therefore, the smaller the correlation value S_SAD, the smaller the difference in luminance value between the template block 901 and the block area 903. That is, the textures of the template block 901 and the block area 903 are similar.

なお、ここでは、SAD手法によって相関値を求めるようにしたが、例えば、差分二乗和(SSD)又は正規化相互相関(NCC)などを用いるようにしてもよい。但し、SAD以外の手法を用いる際には、相関値が小さい程類似度が高い場合と相関値が大きい程類似度が高い場合とがあるので、相関値と類似度との関係に応じて以降の処理も変更する必要がある。   Here, the correlation value is obtained by the SAD method, but, for example, a sum of squared differences (SSD) or a normalized cross-correlation (NCC) may be used. However, when using a technique other than SAD, there are cases where the similarity is higher as the correlation value is smaller, and the similarity is higher as the correlation value is larger, and so on depending on the relationship between the correlation value and the similarity. It is also necessary to change the process.

動きベクトル検出回路109はサーチ範囲902の全領域についてブロック領域903を移動させて、サーチ範囲902の全領域についてテンプレートブロック901と相関値を算出する。そして、動きベクトル検出回路109は相関値が最も小さくなる位置(つまり、ブロック領域)を判定して、原画像上のテンプレートブロックが参照画像においていずれの位置に移動したか、つまり、原画像と参照画像と間の動きベクトルを検出する。   The motion vector detection circuit 109 moves the block area 903 for the entire area of the search range 902 and calculates the correlation value with the template block 901 for the entire area of the search range 902. Then, the motion vector detection circuit 109 determines a position (that is, a block region) where the correlation value is the smallest, and to which position the template block on the original image has moved, that is, the original image and the reference The motion vector between the images is detected.

このようにして、動きベクトル検出回路109はフレーム画像間の複数の領域について動きベクトルを検出する。つまり、原画像において別の位置にテンプレートブロックを設定して、同様にして、動きベクトルを検出して、動きベクトル群を得る。そして、動きベクトル検出回路109は当該動きベクトル群を幾何変形パラメータ推定回路110に送る。   In this way, the motion vector detection circuit 109 detects motion vectors for a plurality of regions between frame images. That is, a template block is set at another position in the original image, and similarly, a motion vector is detected to obtain a motion vector group. Then, the motion vector detection circuit 109 sends the motion vector group to the geometric deformation parameter estimation circuit 110.

続いて、幾何変形パラメータ推定回路110は動きベクトル群に応じてフレーム画像間における幾何変形パラメータを推定する(ステップS205)。ここでは、幾何変形のモデルの一例として、ホモグラフィ行列を画像変形量とした場合について説明する。   Subsequently, the geometric deformation parameter estimation circuit 110 estimates a geometric deformation parameter between frame images according to the motion vector group (step S205). Here, a case where a homography matrix is used as an image deformation amount will be described as an example of a geometric deformation model.

いま、1つのフレーム(画像)上のある点aを式(2)で示し、当該点aが次のフレームにおいて、式(3)で示す点a’に移動したとする。   Now, it is assumed that a point a on one frame (image) is represented by Expression (2), and the point a has moved to a point a ′ represented by Expression (3) in the next frame.

なお、式(2)および式(3)において、添え字Tは転置行列であること示す。   Note that in the expressions (2) and (3), the subscript T indicates a transposed matrix.

式(2)で示す点aと式(3)で示す点a’との対応関係は、ホモグラフィ行列Hを用いて、式(4)で表される。   The correspondence relationship between the point a shown in Expression (2) and the point a ′ shown in Expression (3) is expressed by Expression (4) using the homography matrix H.

ホモグラフィ行列Hは画像間の並進、回転、変倍、せん断、およびあおりによる変形量を示す行列式であって、次の式(5)で表される。   The homography matrix H is a determinant indicating the amount of deformation caused by translation, rotation, scaling, shear, and tilt between images, and is expressed by the following expression (5).

ホモグラフィ行列Hの各要素は、ステップS204の処理で得られた動きベクトル群、つまり、フレーム画像間における代表点の対応関係に応じて、最小二乗法などの統計的処理を行うことによって算出される。但し、縮小処理が施されたフレーム画像から検出された動きベクトルは、縮小画像における動きベクトルであるので、幾何変形パラメータを推定する際には、動きベクトルを等倍サイズのものに変換する必要がある。   Each element of the homography matrix H is calculated by performing a statistical process such as a least square method in accordance with the motion vector group obtained by the process of step S204, that is, the correspondence of representative points between frame images. The However, since the motion vector detected from the reduced frame image is a motion vector in the reduced image, it is necessary to convert the motion vector to one of the same size when estimating the geometric deformation parameter. is there.

上述のようにして求めたホモグラフィ行列Hは、カメラのぶれに起因する画像の変形量を示す。よって、画像のぶれを補正する際には、当該ぶれによる変形を打ち消す画像変形量となるようにホモグラフィ行列Hを変換する必要がある。つまり、ホモグラフィ行列Hを逆行列Hに変換することによって、点a’と点aとの対応関係は、次の式(6)で表される。   The homography matrix H obtained as described above indicates the amount of image deformation caused by camera shake. Therefore, when correcting image blur, it is necessary to convert the homography matrix H so as to obtain an image deformation amount that cancels the deformation caused by the blur. That is, by converting the homography matrix H to the inverse matrix H, the correspondence between the point a ′ and the point a is expressed by the following equation (6).

式(6)によって、ぶれが生じた後の点a’をぶれが生じる前の点aと同一の座標に戻すことが可能となる。   Expression (6) makes it possible to return the point a ′ after the blurring to the same coordinates as the point a before the blurring.

図示の例では、フレーム画像間のぶれ量を表すモデルとしてホモグラフィ行列を用いたが、例えば、ヘルマート行列又はアフィン行列などの他のモデルを用いるようにしてもよい。さらには、主被写体を防振対象に設定した場合には、並進のぶれ補正量だけを求めればよく、この場合には、動きベクトル群の平均値を求めればよいので、統計的な推定を行う必要がなく演算量を削減することができる。   In the illustrated example, a homography matrix is used as a model representing the amount of blur between frame images, but other models such as a Helmat matrix or an affine matrix may be used. Furthermore, when the main subject is set as an image stabilization target, only the translational blur correction amount needs to be obtained. In this case, the average value of the motion vector group may be obtained, so that statistical estimation is performed. There is no need, and the amount of calculation can be reduced.

次に、マイコン112は、上述のようにして求められた幾何変形パラメータを幾何変形回路111に与える。幾何変形回路111は幾何変形パラメータを用いて、メモリ104に記憶されたフレーム画像に幾何変換処理を施して防振処理を行う(ステップS206)。そして、幾何変形回路111は防振処理が施された画像を記憶装置(図示せず)に記憶するとともに、表示装置(図示せず)に表示する。その後、マイコン112は撮影処理を終了する。   Next, the microcomputer 112 gives the geometric deformation parameter obtained as described above to the geometric deformation circuit 111. The geometric deformation circuit 111 performs a vibration reduction process by applying a geometric transformation process to the frame image stored in the memory 104 using the geometric deformation parameter (step S206). The geometric deformation circuit 111 stores the image subjected to the image stabilization process in a storage device (not shown) and displays it on a display device (not shown). Thereafter, the microcomputer 112 ends the photographing process.

このように、本発明の第1の実施形態では、シャッタースピードに応じて動きベクトルの検出に用いる画像の縮小率を変更する。これによって、シャッタースピードに拘わらず精度よく動きベクトルを検出して、画像におけるぶれを良好に補正することができる。   Thus, in the first embodiment of the present invention, the reduction ratio of the image used for motion vector detection is changed according to the shutter speed. As a result, it is possible to detect the motion vector with high accuracy regardless of the shutter speed and to correct the blurring in the image satisfactorily.

[第2の実施形態]
続いて、本発明の第2の実施形態によるカメラの一例について説明する。
[Second Embodiment]
Next, an example of a camera according to the second embodiment of the present invention will be described.

図10は、本発明の第2の実施形態によるカメラの一例についてその構成を示すブロック図である。なお、図10において、図1に示すカメラと同一の構成要素については同一の参照番号を付して説明を省略する。   FIG. 10 is a block diagram showing the configuration of an example of a camera according to the second embodiment of the present invention. In FIG. 10, the same components as those of the camera shown in FIG.

図示のカメラは、画像縮小回路108の代わりに画像リサイズ回路1001を備えている。   The illustrated camera includes an image resizing circuit 1001 instead of the image reduction circuit 108.

図11は、図10に示すカメラで行われる撮影処理の一例を説明するためのフローチャートである。なお、図示のフローチャートにおいて、図2に示すフローチャートと同一のステップについては同一の参照符号を付して説明を省略する。   FIG. 11 is a flowchart for explaining an example of a photographing process performed by the camera shown in FIG. In the illustrated flowchart, the same steps as those in the flowchart shown in FIG.

撮影が開始されると、マイコン112の制御下で、カメラ信号処理回路103はメモリ104にフレーム画像を記録するとともに、フレーム画像を画像縮小回路107に送る(ステップS1101)。ステップS202においては、縮小率決定回路106は、前述のようにして、画像の縮小率を決定して、当該縮小率を画像縮小回路107および画像リサイズ回路1001に設定する。   When shooting is started, the camera signal processing circuit 103 records the frame image in the memory 104 and sends the frame image to the image reduction circuit 107 under the control of the microcomputer 112 (step S1101). In step S202, the reduction rate determination circuit 106 determines the reduction rate of the image as described above, and sets the reduction rate in the image reduction circuit 107 and the image resizing circuit 1001.

続いて、画像縮小回路107はカメラ信号処理回路103から送られるフレーム画像を、縮小率設定回路106によって設定された縮小率に基づいて縮小処理する(ステップS1103)。そして、画像縮小回路107は、縮小処理したフレーム画像をメモリ104に記憶する。   Subsequently, the image reduction circuit 107 reduces the frame image sent from the camera signal processing circuit 103 based on the reduction rate set by the reduction rate setting circuit 106 (step S1103). Then, the image reduction circuit 107 stores the reduced frame image in the memory 104.

画像リサイズ回路1001は、メモリ104に記憶された縮小処理済みのフレーム画像をリサイズ処理する(ステップS1104)。   The image resizing circuit 1001 resizes the reduced frame image stored in the memory 104 (step S1104).

ところで、メモリ104に記憶された縮小処理済みのフレーム画像は、撮影した時点において縮小率決定回路106で決定された縮小率に応じて縮小処理されている。ところが、撮影シーンの時間的変動に応じて縮小率が変更されると、既にメモリ104に記憶された縮小処理済みのフレーム画像と縮小率が変更された後に縮小処理が行われたフレーム画像との間で画像サイズに相違が生じる。そして、原画像および参照画像において画像サイズが異なっていると、動きベクトルを検出することができない。よって、原画像および参照画像の双方の画像サイズを合わせるために、画像リサイズ回路1001は、メモリ104に記憶された縮小処理済みの画像をリサイズ処理する。   By the way, the reduced frame image stored in the memory 104 is reduced according to the reduction rate determined by the reduction rate determination circuit 106 at the time of shooting. However, if the reduction ratio is changed according to the temporal variation of the shooting scene, the frame image that has already been reduced and that has already been stored in the memory 104 and the frame image that has been reduced after the reduction ratio has been changed. Differences in image size occur between the two. If the image size is different between the original image and the reference image, the motion vector cannot be detected. Therefore, the image resizing circuit 1001 resizes the reduced image stored in the memory 104 in order to match the image sizes of both the original image and the reference image.

例えば、あるフレーム画像に対する撮影時点(つまり、入力時点)における縮小率が1/8であったとする。そして、撮影シーンの時間的変動に伴って縮小率が1/4に変更されると、画像リサイズ回路1001はメモリ104に記憶された1/8縮小のフレーム画像を2倍に拡大処理して原画像として動きベクトル検出回路109に送る。一方、1/4縮小のフレーム画像は参照画像として画像縮小回路107から動きベクトル検出回路109に送られるとともに、メモリ104に記憶される。   For example, it is assumed that the reduction ratio at a photographing time point (that is, an input time point) for a certain frame image is 1/8. Then, when the reduction ratio is changed to ¼ according to the temporal variation of the shooting scene, the image resizing circuit 1001 enlarges the 8 reduced frame image stored in the memory 104 twice and performs original processing. The image is sent to the motion vector detection circuit 109 as an image. On the other hand, the 1/4 reduced frame image is sent as a reference image from the image reduction circuit 107 to the motion vector detection circuit 109 and stored in the memory 104.

この結果、原画像および参照画像はともに1/4縮小サイズとなるので、動きベクトル検出回路109は同一の画像サイズの原画像および参照画像を用いて動きベクトルの検出を行うことが可能となる。   As a result, the original image and the reference image are both reduced to ¼, and the motion vector detection circuit 109 can detect the motion vector using the original image and the reference image having the same image size.

なお、画像リサイズ回路1001で行われるリサイズ処理の手法はどのような手法であってもよく、例えば、バイリニア又はバイキュービックのような補間処理を用いればよい。   Note that the resizing process performed by the image resizing circuit 1001 may be any technique, for example, an interpolation process such as bilinear or bicubic may be used.

その後、図2で説明したステップS204〜S207の処理を行った後、マイコン112は撮影処理を終了する。   Thereafter, after performing the processing of steps S204 to S207 described in FIG. 2, the microcomputer 112 ends the photographing process.

このように、本発明の第2の実施形態では、撮影時点における縮小率でフレーム画像を縮小してメモリ104に記憶する。そして、縮小率の変化に応じてメモリ104に記憶された縮小処理済みのフレーム画像をリサイズ処理する。前述の第1の実施形態では、等倍サイズのフレーム画像のみをメモリ104に記憶しており、このため、縮小率の変動があると画像縮小回路はメモリ104から等倍サイズのフレーム画像を読み込んで画像縮小処理を行うことになる。よって、伝送のための帯域が大きくなってしまう。一方、第2の実施形態では、撮影時点における縮小率でフレーム画像を縮小してメモリ104に記憶して、縮小率の変化に応じてメモリ104に記憶された縮小処理済みのフレーム画像をリサイズ処理する結果、伝送のための帯域を削減することができる。   Thus, in the second embodiment of the present invention, the frame image is reduced and stored in the memory 104 at the reduction rate at the time of shooting. Then, the reduced frame image stored in the memory 104 is resized according to the change in the reduction rate. In the first embodiment described above, only the frame image of the same size is stored in the memory 104. Therefore, if there is a change in the reduction ratio, the image reduction circuit reads the frame image of the same size from the memory 104. Thus, the image reduction process is performed. Therefore, the bandwidth for transmission becomes large. On the other hand, in the second embodiment, the frame image is reduced and stored in the memory 104 at the reduction rate at the time of shooting, and the reduced frame image stored in the memory 104 according to the change in the reduction rate is resized. As a result, the bandwidth for transmission can be reduced.

上述の説明から明らかなように、図1および図10に示す例では、画像縮小回路107および108が縮小手段として機能し、マイコン112および縮小率決定回路106が決定手段として機能する。また、動きベクトル検出回路109、幾何変形パラメータ推定回路110、幾何変形回路111、および画像リサイズ回路1001はそれぞれ検出手段、算出手段、補正手段、およびリサイズ手段として機能する。   As is apparent from the above description, in the example shown in FIGS. 1 and 10, the image reduction circuits 107 and 108 function as reduction means, and the microcomputer 112 and the reduction rate determination circuit 106 function as determination means. The motion vector detection circuit 109, the geometric deformation parameter estimation circuit 110, the geometric deformation circuit 111, and the image resizing circuit 1001 function as a detection unit, a calculation unit, a correction unit, and a resizing unit, respectively.

また、上記実施の形態では、撮像装置の内部で防振処理を行う例をあげて説明を行ったが、これに限られるものではない。撮像装置が、撮影された画像に対応するシャッタースピードを関連付けて出力し、これらを受け取ったパーソナルコンピュータなどで、画像の縮小と動きベクトルの検出を行うようにしてもよい。つまり、シャッタースピードに応じて複数の画像を縮小し、これらを用いて動きベクトルを検出する機能を有する画像処理装置であればよい。   In the above-described embodiment, an example in which the image stabilization process is performed inside the imaging apparatus has been described. However, the present invention is not limited to this. The image capturing apparatus may output the shutter speed corresponding to the captured image in association with the image, and may perform image reduction and motion vector detection using a personal computer or the like that has received the shutter speed. That is, any image processing apparatus having a function of reducing a plurality of images according to the shutter speed and detecting a motion vector using these images may be used.

以上、本発明について実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。   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.

[その他の実施形態]
本発明は、上述の実施形態の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.

102 撮像素子
103 カメラ信号処理回路
104 メモリ
106 縮小率決定回路
107,108 画像縮小回路
109 動きベクトル検出回路
110 幾何変形パラメータ推定回路
111 幾何変形回路
112 マイコン
1001 画像リサイズ回路
DESCRIPTION OF SYMBOLS 102 Image pick-up element 103 Camera signal processing circuit 104 Memory 106 Reduction rate determination circuit 107,108 Image reduction circuit 109 Motion vector detection circuit 110 Geometric deformation parameter estimation circuit 111 Geometric deformation circuit 112 Microcomputer 1001 Image resizing circuit

Claims (8)

1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小手段と、
前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小手段によって縮小処理を行う際の縮小率を決定する決定手段と、
前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出手段と、
を有することを特徴する画像処理装置。
One image as an original image, an image obtained as a result of photographing after the original image as a reference image, a reduction means for reducing the original image and the reference image,
Determining means for determining a reduction ratio when performing reduction processing by the reduction means according to a shutter speed at the time of photographing the original image and the reference image;
Detecting means for detecting a motion vector between the original image and the reference image based on the original image and the reference image on which the reduction processing has been performed;
An image processing apparatus comprising:
前記原画像および前記参照画像を記憶するメモリ手段を有し、
前記縮小手段は、前記メモリ手段から前記原画像および前記参照画像を読み込んで前記縮小処理を行うことを特徴とする請求項1に記載の画像処理装置。
Memory means for storing the original image and the reference image;
The image processing apparatus according to claim 1, wherein the reduction unit reads the original image and the reference image from the memory unit and performs the reduction process.
前記縮小処理が行われた原画像および参照画像を記憶するメモリ手段と、
前記撮影の際に前記シャッタースピードに応じた縮小率が変化すると、前記縮小処理が行われた原画像および参照画像の縮小率を同一とするためのリサイズ処理を行うリサイズ手段とを有することを特徴とする請求項1に記載の画像処理装置。
Memory means for storing the original image and the reference image subjected to the reduction processing;
Resizing means for performing resizing processing to make the same reduction ratio of the original image and the reference image subjected to the reduction processing when the reduction rate according to the shutter speed changes during the photographing. The image processing apparatus according to claim 1.
前記決定手段は、前記シャッタースピードが遅くなるにつれて画像サイズが大きくなるように前記縮小率を決定することを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the determination unit determines the reduction ratio so that an image size increases as the shutter speed decreases. 前記動きベクトルに基づいて前記原画像と前記参照画像との間のぶれを幾何変形パラメータとして求める算出手段と、
前記幾何変形パラメータに基づいて撮影の結果得られた画像を幾何変形して当該画像のぶれを補正する補正手段とを有することを特徴とする請求項1〜4のいずれか1項に記載の画像処理装置。
Calculating means for obtaining a blur between the original image and the reference image as a geometric deformation parameter based on the motion vector;
5. The image according to claim 1, further comprising a correcting unit that geometrically deforms an image obtained as a result of photographing based on the geometric deformation parameter and corrects blurring of the image. Processing equipment.
前記原画像と前記参照画像を撮像する撮像手段と、
請求項1〜5のいずれか1項に記載の画像処理装置とを有することを特徴とする撮像装置。
Imaging means for imaging the original image and the reference image;
An image pickup apparatus comprising: the image processing apparatus according to claim 1.
1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小ステップと、
前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、
前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、
を有することを特徴する画像処理装置の制御方法。
A reduction step of reducing the original image and the reference image using one image as an original image, and an image obtained as a result of shooting after the original image as a reference image;
A determination step of determining a reduction ratio when performing the reduction process in the reduction step according to the shutter speed at the time of shooting the original image and the reference image;
A detection step of detecting a motion vector between the original image and the reference image based on the original image and the reference image on which the reduction processing has been performed;
A control method for an image processing apparatus, comprising:
画像処理装置で用いられる制御プログラムであって、
前記画像処理装置に備えられたコンピュータに、
1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小ステップと、
前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、
前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、
を実行させることを特徴する制御プログラム。
A control program used in an image processing apparatus,
In the computer provided in the image processing apparatus,
A reduction step of reducing the original image and the reference image using one image as an original image, and an image obtained as a result of shooting after the original image as a reference image;
A determination step of determining a reduction ratio when performing the reduction process in the reduction step according to the shutter speed at the time of shooting the original image and the reference image;
A detection step of detecting a motion vector between the original image and the reference image based on the original image and the reference image on which the reduction processing has been performed;
A control program characterized by causing execution.
JP2015042333A 2015-03-04 2015-03-04 Image processing apparatus, control method therefor, control program, and imaging apparatus Active JP6548409B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015042333A JP6548409B2 (en) 2015-03-04 2015-03-04 Image processing apparatus, control method therefor, control program, and imaging apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015042333A JP6548409B2 (en) 2015-03-04 2015-03-04 Image processing apparatus, control method therefor, control program, and imaging apparatus

Publications (2)

Publication Number Publication Date
JP2016163257A true JP2016163257A (en) 2016-09-05
JP6548409B2 JP6548409B2 (en) 2019-07-24

Family

ID=56847311

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015042333A Active JP6548409B2 (en) 2015-03-04 2015-03-04 Image processing apparatus, control method therefor, control program, and imaging apparatus

Country Status (1)

Country Link
JP (1) JP6548409B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010118862A (en) * 2008-11-12 2010-05-27 Canon Inc Image processor, imaging apparatus and image processing method
WO2010116763A1 (en) * 2009-04-10 2010-10-14 パナソニック株式会社 Object detection device, object detection system, integrated circuit for object detection, camera with object detection function, and object detection method
JP2012199691A (en) * 2011-03-18 2012-10-18 Ricoh Co Ltd Imaging apparatus, imaging method, and imaging program
JP2014060654A (en) * 2012-09-19 2014-04-03 Canon Inc Imaging device, control method therefor, and control program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010118862A (en) * 2008-11-12 2010-05-27 Canon Inc Image processor, imaging apparatus and image processing method
WO2010116763A1 (en) * 2009-04-10 2010-10-14 パナソニック株式会社 Object detection device, object detection system, integrated circuit for object detection, camera with object detection function, and object detection method
JP2012199691A (en) * 2011-03-18 2012-10-18 Ricoh Co Ltd Imaging apparatus, imaging method, and imaging program
JP2014060654A (en) * 2012-09-19 2014-04-03 Canon Inc Imaging device, control method therefor, and control program

Also Published As

Publication number Publication date
JP6548409B2 (en) 2019-07-24

Similar Documents

Publication Publication Date Title
JP5596138B2 (en) Imaging apparatus, image processing apparatus, image processing method, and image processing program
JP5226600B2 (en) Image deformation apparatus and operation control method thereof
JP6308748B2 (en) Image processing apparatus, imaging apparatus, and image processing method
KR20120099713A (en) Algorithms for estimating precise and relative object distances in a scene
US8159544B2 (en) Method for adjusting photographing settings of digital camera through motion detection
JP6656035B2 (en) Image processing apparatus, imaging apparatus, and control method for image processing apparatus
JP2008160300A (en) Image processor, and imaging apparatus
CN111372000B (en) Video anti-shake method and apparatus, electronic device, and computer-readable storage medium
JP2022179514A (en) Control apparatus, imaging apparatus, control method, and program
JP6282133B2 (en) Imaging device, control method thereof, and control program
US9007471B2 (en) Digital photographing apparatus, method for controlling the same, and computer-readable medium
JP6231816B2 (en) IMAGING DEVICE, ITS CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
US10497104B2 (en) Empirical exposure normalization
CN115035013A (en) Image processing method, image processing apparatus, terminal, and readable storage medium
JP6548409B2 (en) Image processing apparatus, control method therefor, control program, and imaging apparatus
CN110689502B (en) Image processing method and related device
JP6381212B2 (en) Imaging apparatus and control method thereof
JP2012085205A (en) Image processing apparatus, imaging device, image processing method, and image processing program
JP6016546B2 (en) Imaging device, control method thereof, and control program
JP2019144827A (en) Image processing device, and control method and program of the same
JP2017173920A (en) Image processor, image processing method, image processing program, and record medium
US11044396B2 (en) Image processing apparatus for calculating a composite ratio of each area based on a contrast value of images, control method of image processing apparatus, and computer-readable storage medium
JP2021118523A (en) Image processing device and image processing method, program, and storage medium
JP2019083448A (en) Image processing device and control method therefor, imaging device, and program
JP5610967B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180221

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181024

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20181113

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190110

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: 20190528

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190625

R151 Written notification of patent or utility model registration

Ref document number: 6548409

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151