JP6548409B2 - Image processing apparatus, control method therefor, control program, and imaging apparatus - Google Patents
Image processing apparatus, control method therefor, control program, and imaging apparatus Download PDFInfo
- Publication number
- JP6548409B2 JP6548409B2 JP2015042333A JP2015042333A JP6548409B2 JP 6548409 B2 JP6548409 B2 JP 6548409B2 JP 2015042333 A JP2015042333 A JP 2015042333A JP 2015042333 A JP2015042333 A JP 2015042333A JP 6548409 B2 JP6548409 B2 JP 6548409B2
- 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.)
- Active
Links
Landscapes
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
本発明は、画像処理装置、その制御方法、および制御プログラム、並びに撮像装置に関し、特に、撮像装置の動き(振れ)に起因する画像のぶれを低減する防振処理技術に関する。 The present invention relates to an image processing apparatus, a control method thereof, a control program, and an imaging apparatus, and more particularly, to an anti-vibration processing technique for reducing blurring of an image caused by movement (shake) of the imaging apparatus.
一般に、デジタルスチルカメラ又はデジタルビデオカメラなどの撮像装置の振れに起因する画像のぶれを低減する電子的な防振処理を施すことが行われている。そして、防振処理を施すためには、フレーム間における動き量を検出して複数枚の画像の位置合わせ処理を行う必要がある。 Generally, electronic image stabilization processing is performed to reduce blurring of an image caused by blurring of an imaging device such as a digital still camera or digital video camera. Then, in order to perform the image stabilization processing, it is necessary to detect the amount of movement between frames and to perform the alignment processing of a plurality of images.
フレーム間における動き量を検出する手法においては、例えば、ジャイロセンサなどの外部機器で得られた振れ情報が用いられる。さらには、撮影の結果得られた画像から動き量を推定することも行われている。例えば、画像から動き量を推定する手法として、テンプレートマッチングを用いて動きベクトルを検出する手法がある。 In the method of detecting the amount of movement between frames, for example, shake information obtained by an external device such as a gyro sensor is used. Furthermore, it is also performed to estimate the amount of movement from an image obtained as a result of shooting. For example, as a method of estimating the amount of motion from an image, there is a method of detecting a motion vector using template matching.
テンプレートマッチングにおいては、例えば、2枚の画像の一方を原画像とし、他方の画像を参照画像とする。原画像に配置した所定の大きさの矩形領域をテンプレートブロックとして、参照画像においてテンプレートブロックの輝度値分布との相関を求める。そして、参照画像において最も相関値が高くなる領域をテンプレートブロックの移動先とし、原画像におけるテンプレートブロックの位置を基準とした場合の移動先に対する向きおよび移動量を動きベクトルとする。 In template matching, for example, one of two images is an original image, and the other is a reference image. A rectangular area of a predetermined size arranged in the original image is used as a template block, and the correlation with the luminance value distribution of the template block is determined in the reference image. Then, a region where the correlation value is the highest 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 based
次に、上述のようにして求めた複数の動きベクトルを用いて統計的な処理などを行って、画像間の動きを幾何変形量として求める。この際、画像全域から多数の動きベクトルを精度よく求めることができれば、正確に画像間の幾何変形量を求めることができる。 Next, statistical processing or the like is performed using a plurality of motion vectors obtained as described above, and 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 geometric deformation amount 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 is degraded. Here, the unclear image refers to an image in which high frequency components such as edges are attenuated.
例えば、夜間など暗い場所で撮影する場合には、撮像センサに入射する光量を多くするため、シャッタースピードを遅くして撮影することがある。このような場合には、撮影の結果得られた画像に動きぶれが生じて不鮮明な画像となってしまう。これによって、動きベクトルの精度が低下する。よって、シャッタースピードを遅くしても、動きベクトルの精度を保証できるように撮影の制御を行う必要がある。 For example, in the case of shooting in a dark place such as at night, in order to increase the amount of light incident on the imaging sensor, shooting may be performed with a slow shutter speed. In such a case, motion blur occurs in the 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 photographing so that the accuracy of the motion vector can be guaranteed even if the shutter speed is reduced.
動きベクトルの精度を保証するため、例えば、動きベクトルの精度に応じて動きベクトルを検出する際に用いるパラメータを変更する手法がある。例えば、動きベクトルの誤検出が画像にどのような影響を与えるかを示す影響パラメータを生成して、当該影響パラメータに応じて原画像および参照画像の縮小率を制御するようにしたものがある(特許文献1参照)。 In order to guarantee the accuracy of the motion vector, for example, there is a method of changing parameters used when detecting the motion vector according to the accuracy of the motion vector. For example, some influence parameters are generated to indicate what kind of influence the motion vector misdetection has on the image, and the reduction ratios of the original image and the reference image are controlled according to the influence parameters. Patent Document 1).
ところが、上述の特許文献1に記載の手法では、テンプレートブロックにおける輝度値の分散値および平均値に基づいて画像の縮小率を変更するようにしており、シャッタースピードに応じて画像の縮小率を調整することは行われていない。このため、特許文献1に記載の手法では、シャッタースピードによっては精度よく動きベクトルを検出することができないことがある。 However, in the method described in Patent Document 1 described above, the reduction ratio of the image is changed based on the dispersion value and the average value of the luminance values in the template block, and the reduction ratio of the image is adjusted according to the shutter speed. It has not been done. Therefore, in the method described in Patent Document 1, depending on the shutter speed, it may not be possible to detect a motion vector with high accuracy.
よって、本発明の目的は、シャッタースピードに拘わらず精度よく動きベクトルを検出することのできる画像処理装置、その制御方法、および制御プログラム、並びに撮像装置を提供することにある。 Therefore, an object of the present invention is to provide an image processing apparatus capable of accurately detecting a motion vector regardless of the shutter speed, a control method thereof, a control program, and an imaging apparatus.
上記の目的を達成するため、本発明による画像処理装置は、1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小手段と、前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小手段によって縮小処理を行う際の縮小率を決定する決定手段と、前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出手段と、を有し、前記決定手段は、前記シャッタースピードが遅くなるにつれて画像サイズが大きくなるように前記縮小率を決定することを特徴する。 In order to achieve the above object, the image processing apparatus according to the present invention uses one image as an original image and an image obtained as a result of photographing after the original image as a reference image, the original image and the reference image The reduction means for reduction processing, the determination means for determining the reduction ratio at the time of reduction processing by the reduction means according to the shutter speed at the time of photographing the original image and the reference image, The original for which the reduction processing was performed possess a detecting means for detecting a motion vector between said reference image and said original image based on the image and the reference image, wherein the determination means includes, as the image size increases as the shutter speed becomes slower Determining the reduction ratio .
本発明による画像処理装置の制御方法は、1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小ステップと、前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、を有し、前記決定ステップにおいて、前記シャッタースピードが遅くなるにつれて画像サイズが大きくなるように前記縮小率を決定することを特徴する。 The control method of the image processing apparatus according to the present invention is a reduction step of processing one original image and one original image and the image obtained as a result of photographing after the original image as a reference image and reducing the original image and the reference image. And a determination step of determining a reduction ratio at the time of performing the reduction process in the reduction step according to a shutter speed at the time of photographing the original image and the reference image, and the original image and the reference image subjected to the reduction process. have a, a detection step of detecting a motion vector between said reference image and the original image on the basis of determination in the determination step, the reduction ratio so that the image size increases as the shutter speed becomes slower It is characterized by
本発明による制御プログラムは、画像処理装置で用いられる制御プログラムであって、前記画像処理装置に備えられたコンピュータに、1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小ステップと、前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、を実行させるものであって、前記決定ステップにおいて、前記シャッタースピードが遅くなるにつれて画像サイズが大きくなるように前記縮小率を決定することを特徴する。 The control program according to the present invention is a control program used in an image processing apparatus, and a computer provided in the image processing apparatus uses one image as an original image and is obtained as a result of shooting after the original image. Using an image as a reference image, a reduction step for reducing the original image and the reference image, and a reduction ratio at the time of performing the reduction processing in the reduction step according to the shutter speed at the time of shooting the original image and the reference image Performing a determining step of determining, and a detecting 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 , in decision step, to said determining said reduction ratio so that the image size increases as the shutter speed becomes slower .
本発明によれば、シャッタースピードに応じて動きベクトルの検出に用いられる画像の縮小率を決定するようにしたので、シャッタースピードに拘わらず精度よく動きベクトルを検出して、画像におけるぶれを良好に補正することができる。 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 accurately detected regardless of the shutter speed, and the blurring in the image is favorably made. It can be corrected.
以下に、本発明の実施の形態による画像処理装置の一例について図面を参照して説明する。 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 provided with an image processing apparatus according to a 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 includes 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 imaging device 102 is a CCD sensor or a CMOS sensor, and outputs an electrical signal (analog signal) according 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) according to an analog signal which is an output of the imaging element 102. The camera signal processing circuit 103 includes, for example, an A / D conversion circuit, an automatic gain control circuit (AGC), and an automatic white balance circuit (AWB), and performs predetermined image processing on an analog signal to perform digital processing. It outputs a camera signal which is a signal.
カメラ信号処理回路103の出力であるカメラ信号は一旦メモリ104に記録される。メモリ104はカメラ信号の1フレーム又は複数のフレームを記録するためのメモリである。なお、以下の説明では、1フレームの画像をフレーム画像と呼ぶ。また、図示の例では撮像素子102およびカメラ信号処理回路103によって、画像を取得するための撮像系が構成される。 The camera signal which 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 referred to as a frame image. Further, 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 ratio determination circuit 106 determines the reduction ratio when reducing a 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 reduction processing on the frame image recorded in the memory 104 based on the reduction ratio determined by the reduction ratio determination circuit 106.
動きベクトル検出回路109は、画像縮小回路107および108の出力である縮小後の2枚のフレーム画像間における動きベクトルを検出する。幾何変形パラメータ推定回路110は、動きベクトル検出回路109で得られた動きベクトルを用いて、フレーム画像間のぶれの補正量を幾何変形パラメータとして出力する。幾何変形回路111は幾何変形パラメータに基づいてフレーム画像のぶれを補正するための幾何変形処理を行う。なお、マイコン112はカメラ全体の制御を司る。 The motion vector detection circuit 109 detects a motion vector between two frame images after reduction, which is the 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 correction amount of blurring between frame images as a geometric deformation parameter. The geometric deformation circuit 111 performs geometric deformation processing for correcting blurring of a frame image based on geometric deformation parameters. The microcomputer 112 controls the entire camera.
図2は、図1に示すカメラで行われる撮影処理の一例を説明するためのフローチャートである。なお、図示のフローチャートに係る処理は、マイコン112の制御下で行われる。 FIG. 2 is a flowchart for explaining an example of the photographing process performed by the camera shown in FIG. The processing according to the flowchart in the drawing is performed under the control of the microcomputer 112.
撮影が開始されると、マイコン112の制御下で、カメラ信号処理回路103は撮像素子102の出力であるアナログ信号に対して処理の画像処理を行って、カメラ信号を生成する(画像入力:ステップS201)。ここでは、カメラ信号処理回路103は、例えば、12ビットのデジタル信号をカメラ信号として出力する。この際、カメラ信号処理回路103はAGCおよびAWBによって信号レベル補正および白レベル補正を行って、カメラ信号(つまり、フレーム画像)をメモリ104に記録する。 When shooting is started, under control of the microcomputer 112, the camera signal processing circuit 103 performs image processing of processing on an analog signal that is an output of the imaging element 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. The frame images recorded in the memory 104 are sequentially updated.
続いて、縮小率決定回路106は、マイコン112の制御下で、後述するようにして、フレーム画像の縮小率を決定して、当該縮小率を画像縮小回路107および108に設定する(ステップS202)。 Subsequently, under the control of the microcomputer 112, the reduction ratio determination circuit 106 determines the reduction ratio of the frame image as described later, and sets the reduction ratio in the image reduction circuits 107 and 108 (step S202). .
図3は、画像の縮小率と動きベクトルの検出数との関係についてその一例を示す図である。 FIG. 3 is a diagram showing an example of the relationship between the reduction ratio of an image 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. Then, at the reduction ratio = 1, the image is not reduced. The vertical axis indicates the number of motion vectors (remaining motion vector numbers) determined to have high reliability in the detected motion vectors.
ここで、動きベクトルの信頼度は、例えば、どのようなテクスチャを有する領域から検出された動きベクトルであるかに応じて決定される。つまり、低コントラストの領域および繰り返しパターンを含む領域は、テンプレートマッチングによる動きベクトルの検出が難しい領域であるので、当該領域においては精度よく動きベクトルが検出される可能性は低い。 Here, the reliability of the motion vector is determined, for example, according to what texture the motion vector is detected from the region. That is, since the low contrast area and the area including the repetitive pattern are areas where it is difficult to detect a motion vector by template matching, there is a low possibility that a motion vector is accurately detected in the area.
テクスチャ判定を行うためには、テンプレートにおける画素の輝度値についてその平均値および分散値を求めて、平均値および分散値に応じて当該領域が低コントラスト領域又は繰り返しパターン領域であるか否かを判定する。そして、低コントラスト領域又は繰り返しパターン領域であると判定されると、その領域で検出された動きベクトルは信頼度が低いとして除外される。このような判定を全ての動きベクトルについて行って、最終的に残った信頼度の高い動きベクトルの数が残動きベクトル数とされる。 In order to make a texture determination, the average value and the dispersion value of the luminance values of the pixels in the template are determined, and it is determined whether the area is a low contrast area or a repetitive pattern area according to the average value and the dispersion value. Do. When it is determined that the region is a low contrast region or a repetitive pattern region, motion vectors detected in that region are excluded as having low reliability. Such determination is performed for all motion vectors, and the number of motion vectors with high reliability finally remaining is made the number of remaining motion vectors.
図3に示すように、縮小率が1に近い程、つまり、動きベクトルの検出に用いる画像サイズが大きい程、テンプレートとの相関が高い箇所が複数発生する傾向が強くなって、動きベクトルを誤検出することが多くなる。そして、誤検出された動きベクトルは誤差の要因となるので使用することはできない。 As shown in FIG. 3 , as the reduction ratio is closer to 1, that is, as the size of the image used for detecting the motion vector is larger, there is a tendency that a plurality of locations having high correlation with the template will be generated. It will be detected more often. Then, the motion vector that is erroneously detected can not 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 judged as a low contrast region, the number of motion vectors to be excluded increases. Therefore, as the reduction ratio is closer to 1, the number of residual motion vectors decreases.
一方、縮小率が0に近い程、つまり、動きベクトルの検出に用いる画像サイズが小さい程、テンプレートに画像の広い領域におけるテクスチャが入ることになる。これによって、低コントラストおよび繰り返し判定によって除外される動きベクトルが少なくなって、残動きベクトル数が増加する。 On the other hand, as the reduction ratio is closer to 0, that is, as the size of the image used to detect a motion vector is smaller, textures in a wide area of the image will be included in the template. This reduces the low contrast and the motion vectors excluded by the repeated determination, and increases the number of residual motion vectors.
図4は、画像の縮小率と動きベクトルの精度との関係についてその一例を示す図である。 FIG. 4 is a diagram showing an example of the relationship between the reduction ratio of the image and the accuracy of the motion vector.
図4において、横軸は縮小率を示し、縦軸は動きベクトルの検出精度を示す。図示のように、縮小率が1に近い程、つまり、動きベクトルの検出に用いる画像サイズが大きい程、画像が明瞭であるため動きベクトルの精度が向上する。一方、縮小率が0に近い程、縮小処理によるローパスフィルタ効果に起因して画像が不鮮明になって、動きベクトルの検出精度が低下する。 In FIG. 4, the horizontal axis indicates the reduction rate, and the vertical axis indicates the motion vector detection accuracy. As illustrated, as the reduction ratio is closer to 1, that is, as the image size used to detect a motion vector is larger, the accuracy of the motion vector is improved because the image is clear. On the other hand, as the reduction ratio is closer to 0, the image is blurred due to the low pass filter effect of the reduction processing, and the detection accuracy of the motion vector is lowered.
よって、画像を縮小処理する際には、縮小率を0に近づけるには限界があり、動きベクトルの検出精度が低下しても検知限以上の精度を保つことができるように、縮小率制限501が設定される。なお、検知限とは正確な動きベクトルと同一とみなすことが可能な精度の限界をいう。例えば、検知限とは、ある動きベクトルを用いて画像の幾何変形を行った際に、正確な動きベクトルを用いて幾何変形を行った画像との相違が目視では分からない程度の検出精度のことをいう。 Therefore, when reducing the image, there is a limit to making the reduction ratio close to 0, and even if the detection accuracy of the motion vector is reduced, the reduction ratio restriction 501 can be maintained so that the accuracy beyond the detection limit can be maintained. Is set. The detection limit is the limit of accuracy that can be regarded as the same as an accurate motion vector. For example, the detection limit is a detection accuracy that does not allow visual recognition of the difference between an image that has been geometrically deformed using an accurate motion vector and an image that has been geometrically deformed using a certain motion vector. Say
また、幾何変形パラメータを求める際には、並進成分の動きのみではなく、回転成分およびあおり成分の動きを推定する必要がある。このためには、画像全体から多くの動きベクトルを検出する必要がある。よって、ここでは、縮小率が0に近い状態を標準状態とする。 In addition, when obtaining geometric deformation parameters, it is necessary to estimate not only the movement of the translational component but also the movement of the rotational component and the tilting component. For this purpose, it is necessary to detect many motion vectors from the entire image. Therefore, here, the state in which the reduction ratio is close to 0 is taken as the standard state.
図5は、図3および図4に基づいた縮小率と残動きベクトル数およびベクトル精度との関係を示す図である。 FIG. 5 is a diagram showing the relationship between the reduction ratio, the number of remaining motion vectors, and the vector accuracy based on FIGS. 3 and 4.
図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 residual motion vectors is increased), the reduction ratio approaches zero. On the contrary, if it is desired to detect even a small number of motion vectors with high accuracy (that is, if the number of remaining motion vectors is at least good), the reduction ratio will be 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. 6 (a) is a diagram showing a first example, and FIG. 6 (b) is a diagram showing a second example.
図6において、横軸はシャッタースピードを示し、シャッタースピードが遅くなると、カメラの動き(つまり、振れ)によるぶれが大きくなる。縦軸は縮小率を示し、縮小率が大きくなる程、画像サイズが大きくなる。 In FIG. 6, the horizontal axis indicates the shutter speed, and when the shutter speed is slowed, the camera shake (i.e., 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 ratio changes linearly (linearly), and the reduction ratio approaches 1 as the shutter speed decreases. That is, the image size is increased as the shutter speed decreases. In the example shown in FIG. 6B, the relationship between the shutter speed and the reduction ratio changes exponentially, and here too, the reduction ratio approaches 1 as the shutter speed decreases.
図6に示す関係を用いる際には、縮小率が1に近い、つまり、動きベクトルの検出に用いる画像のサイズが大きい場合には、明瞭な画像で動きベクトルの検出を行うことになる。このため、検出された動きベクトルの精度は向上する一方、テンプレートとの相関が高い箇所が複数発生する傾向が強くなって、動きベクトルの誤検出が生じ易い。そして、誤った動きベクトルは誤差の要因となるため使用することはできない。 When the relationship shown in FIG. 6 is used, when the reduction ratio is close to 1, that is, the size of the image used to detect 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, the tendency that a plurality of portions having high correlation with the template are generated is increased, and erroneous detection of the motion vector is likely to occur. And an incorrect motion vector can not be used because it causes an error.
さらに、明瞭な画像で動きベクトルの検出を行うと、テンプレート内のテクスチャが乏しくなって、低コントラスト領域と判定されて除外される動きベクトルが増加する。このため、残動きベクトル数が減少する。 Furthermore, when motion vectors are detected in a clear image, the texture in the template becomes scarce, and motion vectors that are determined to be low contrast regions and excluded are increased. For this reason, the number of residual motion vectors decreases.
一方、縮小率が0に近い、つまり、動きベクトルの検出に用いる画像のサイズが小さい場合には、不明瞭な画像でベクトル検出を行うことになる。よって、検出される動きベクトルの精度が低下する一方、テンプレート内に画像の広い領域におけるテクスチャが入ることになるので、低コントラストおよび繰り返しパターン判定によって除外されにくくなる。その結果、残動きベクトル数が増加する。 On the other hand, when the reduction ratio is close to 0, that is, the size of the image used for detection of motion vectors is small, vector detection is performed on an unclear image. Therefore, while the accuracy of the detected motion vector is lowered, the 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 repetitive pattern determination. As a result, the number of residual motion vectors increases.
図7は、撮影シーンの一例を説明するための図である。そして、図7(a)はシャッタースピードが速い場合の画像を示す図であり、図7(b)はシャッタースピードが遅い場合の画像を示す図である。 FIG. 7 is a diagram for explaining an example of a shooting scene. 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, regardless of the shutter speed, the movement (shake) of the object to be photographed and the camera is assumed to be the same. In the example shown in FIG. 7B, since the shutter speed is slower compared to the example shown in FIG. 7A, blurring is likely to occur in the image even if the movement of the camera is similar.
図7(a)に示す画像を得た際のシャッタースピードは速いので、画像は明瞭となる。そのため、テンプレートの相関が高い箇所が複数発生する傾向が強くなる。よって、図7(a)に示す画像において動きベクトルを検出する際には、縮小率を0に近づける、つまり、動きベクトルの検出に用いる画像サイズを小さくすれば、残動きベクトル数が向上して、良好に防振処理を行うことができる(標準状態)。 Since the shutter speed at the time of obtaining the image shown in FIG. 7A is fast, the image is clear. Therefore, there is a strong tendency to generate a plurality of places where the correlation of the template is high. Therefore, when detecting a motion vector in the image shown in FIG. 7A, if the reduction ratio is made close to 0, that is, if the image size used for detecting the motion vector is reduced, the number of remaining motion vectors is improved. The vibration isolation processing can be performed well (standard state).
一方、図7(b)に示す画像を得た際のシャッタースピードは遅いので、画像はカメラの動き(振れ)によって不明瞭となる。よって、標準状態と同様の縮小率で画像を縮小すると、さらに不明瞭な画像となって、動きベクトルの精度が標準状態で得られる動きベクトルの精度未満となってしまう。従って、図7(b)に示す画像については、縮小率を1に近づけて、つまり、動きベクトルの検出に用いる画像サイズを大きくして、画像が不明瞭になることを抑えた状態で動きベクトルを検出する。これによって、標準状態と同程度の精度で動きベクトルの検出を行えるようにする。 On the other hand, since the shutter speed at the time of obtaining the image shown in FIG. 7B is slow, the image becomes unclear due to the movement (shake) of the camera. Therefore, if the image is reduced at a reduction rate similar to that in the standard state, the image becomes more unclear and the accuracy of the motion vector becomes 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 reduced with the reduction ratio close to 1, that is, the image size used for detecting the motion vector is increased to suppress the image from becoming unclear. To detect Thus, to allow the detection of the motion vector in the standard state and same accuracy.
但し、図3に関連して説明したように、画像サイズを大きくすれば、残動きベクトル数は減少するので、前述のように、縮小率をシャッタースピードに応じて変化させる必要がある。 However, as described with reference to FIG. 3, if the image size is increased, the number of remaining motion vectors is decreased, and as described above, it is necessary to change the reduction ratio in accordance with the shutter speed.
上述のようにして得られた動きベクトルを用いれば、撮影の結果得られた画像に生じるぶれを正確に示す幾何変形パラメータを推定することが可能となって、画像に対して精度よく防振処理を施すことができる。 If the motion vector obtained as described above is used, it becomes possible to estimate the geometric deformation parameter that accurately indicates the blurring that occurs in the image obtained as a result of the photographing, and the image stabilization processing for the image with high accuracy. Can be applied.
なお、シャッタースピードは、プログラムAEモード、絞り優先AEモード、シャッター優先AEモード、およびマニュアルモードなどのモード毎に異なる。例えば、プログラムAEモードおよび絞り優先AEモードの場合には、カメラによって適切なシャッタースピードが設定される。プログラムAEモードの場合には、カメラによって被写体の明るさに応じた絞りとともにシャッタースピードが自動的に設定される。また、絞り優先AEモードの場合には、絞りが決定された後、適正露出となるようにシャッタースピードが自動的に設定される。 The shutter speed is different for each mode such as the program AE mode, the aperture priority AE mode, the shutter priority AE mode, and the 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 program AE mode, the camera automatically sets the shutter speed together with the aperture according to the brightness of the subject. Further, in the case of the aperture priority AE mode, after the aperture is determined, the shutter speed is automatically set so as to obtain a proper exposure.
一方、マニュアルモード又はシャッター優先AEモードの場合には、撮影者によって任意にシャッタースピードが設定される。マニュアルモードにおいては、絞りおよびシャッタースピードともに撮影者が決定するが、シャッター優先AEモードの場合には、シャッタースピードを撮影者が決定した後、カメラによって適正露出になるように絞りが設定される。 On the other hand, in the case of 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 camera sets the aperture so as to obtain a proper exposure.
シャッタースピードと縮小率との関係は図6に示す例に限定されない。例えば、「1/焦点距離」秒よりも遅いシャッタースピードに設定されると、画像にぶれが生じやすい。 The relationship between the shutter speed and the reduction ratio is not limited to the example shown in FIG. For example, when the shutter speed is set to be slower than "1 / focal length" seconds, the image is likely 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” or less, blurring due to the movement of the camera hardly occurs in the image obtained as a result of shooting. Therefore, in this case, the image is reduced at the reduction ratio in the standard state described above to detect a motion vector. On the other hand, when the shutter speed exceeds "1 / focal length" seconds, the reduction ratio is increased, that is, the image size is increased and the motion vector is detected.
このようにして、縮小率決定回路106は、マイコン112の制御下でシャッタースピードに応じて画像の縮小率を決定して、当該縮小率を画像縮小回路107および108に送る。 Thus, the reduction ratio determination circuit 106 determines the image reduction ratio according to the shutter speed under the control of the microcomputer 112, and sends the reduction ratio 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 to detect a motion vector are selected from the plurality of frame images stored in the memory 104 at the same size in step S201, and input to the image reduction circuits 107 and 108. Then, the image reduction circuits 107 and 108 respectively reduce the original image and the reference image based on the image reduction ratio determined by the reduction ratio determination circuit 106.
なお、画像縮小の手法については、例えば、縮小率が1/8であれば、8×8の矩形領域における画素値の平均値を算出して、画像を縮小する画素平均法を用いるようにしてもよい。あるいは、中央部に位置する画素値を重み付けする所謂縮小フィルタを用いて、画像を縮小するようにしてもよい。 As for the method of image reduction, for example, if the reduction ratio is 1/8, the average value of the pixel values in the 8 × 8 rectangular area is calculated to use the pixel average method for reducing the image. It is also good. Alternatively, the image may be reduced using a so-called reduction filter that weights pixel values 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 is a view showing an example of an original image, and FIG. 9B is a view showing an example of a reference image. Note that FIG. 9 shows an image in which a frame image of the same size stored in the memory 104 is subjected to reduction processing.
動きベクトル検出回路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. Then, the motion vector detection circuit 109 performs template matching on the reference image by the template block 901, and calculates a correlation value in each block region of the reference image. At this time, if the correlation value is calculated for all block areas 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, although there is no particular limitation on the position and size of the search range 902, if the block range corresponding to the moving 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 differences (hereinafter referred to as SAD) method is used as a method of calculating the correlation value.
相関値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) represents the luminance value at the coordinates (i, j) of the template block 901, and g (i, j) represents the block area 903 targeted for correlation value calculation in the search range 902. Indicates the luminance value of Then, in the SAD method, 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 area 903 is determined, and the sum is calculated. Get the value S_SAD.
よって、相関値S_SADが小さい程、テンプレートブロック901とブロック領域903との輝度値の差分が小さい。つまり、テンプレートブロック901とブロック領域903とのテクスチャが類似することになる。 Therefore, the smaller the correlation value S_SAD is, the smaller the difference in luminance value between the template block 901 and the block area 903 is. That is, the textures of the template block 901 and the block area 903 are similar.
なお、ここでは、SAD手法によって相関値を求めるようにしたが、例えば、差分二乗和(SSD)又は正規化相互相関(NCC)などを用いるようにしてもよい。但し、SAD以外の手法を用いる際には、相関値が小さい程類似度が高い場合と相関値が大きい程類似度が高い場合とがあるので、相関値と類似度との関係に応じて以降の処理も変更する必要がある。 Here, although the correlation value is obtained by the SAD method, for example, a sum of squared difference (SSD) or a normalized cross correlation (NCC) may be used. However, when using a method other than SAD, there are cases where the degree of similarity is higher as the correlation value is smaller and the degree of similarity is higher as the correlation value is larger. Therefore, depending on the relationship between the correlation value and the degree of similarity, You also need to change the processing of.
動きベクトル検出回路109はサーチ範囲902の全領域についてブロック領域903を移動させて、サーチ範囲902の全領域についてテンプレートブロック901と相関値を算出する。そして、動きベクトル検出回路109は相関値が最も小さくなる位置(つまり、ブロック領域)を判定して、原画像上のテンプレートブロックが参照画像においていずれの位置に移動したか、つまり、原画像と参照画像と間の動きベクトルを検出する。 The motion vector detection circuit 109 moves the block area 903 in the entire area of the search range 902, and calculates the template block 901 and the correlation value in the entire area of the search range 902. Then, the motion vector detection circuit 109 determines a position (that is, a block area) where the correlation value is the smallest, and to which position in the reference image the template block on the original image has moved, that is, reference to the original image Detect motion vectors between images.
このようにして、動きベクトル検出回路109はフレーム画像間の複数の領域について動きベクトルを検出する。つまり、原画像において別の位置にテンプレートブロックを設定して、同様にして、動きベクトルを検出して、動きベクトル群を得る。そして、動きベクトル検出回路109は当該動きベクトル群を幾何変形パラメータ推定回路110に送る。 Thus, 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 motion vectors are similarly 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 geometric deformation parameters between frame images according to the motion vector group (step S205). Here, as an example of a model of geometric deformation, the case where the homography matrix is used as the image deformation amount will be described.
いま、1つのフレーム(画像)上のある点aを式(2)で示し、当該点aが次のフレームにおいて、式(3)で示す点a’に移動したとする。 Now, it is assumed that a certain point a on one frame (image) is represented by equation (2), and the point a moves to a point a ′ shown in equation (3) in the next frame.
なお、式(2)および式(3)において、添え字Tは転置行列であること示す。 In the equations (2) and (3), the suffix T indicates that it is a transposed matrix.
式(2)で示す点aと式(3)で示す点a’との対応関係は、ホモグラフィ行列Hを用いて、式(4)で表される。 The correspondence between the point a shown in the equation (2) and the point a 'shown in the equation (3) is expressed by the equation (4) using the homography matrix H.
ホモグラフィ行列Hは画像間の並進、回転、変倍、せん断、およびあおりによる変形量を示す行列式であって、次の式(5)で表される。 The homography matrix H is a matrix equation showing the amount of deformation due to translation, rotation, scaling, shear, and tilt between images, and is expressed by the following equation (5).
ホモグラフィ行列Hの各要素は、ステップS204の処理で得られた動きベクトル群、つまり、フレーム画像間における代表点の対応関係に応じて、最小二乗法などの統計的処理を行うことによって算出される。但し、縮小処理が施されたフレーム画像から検出された動きベクトルは、縮小画像における動きベクトルであるので、幾何変形パラメータを推定する際には、動きベクトルを等倍サイズのものに変換する必要がある。 Each element of the homography matrix H is calculated by performing statistical processing such as the least squares method according to the motion vector group obtained in the processing of step S 204, that is, the correspondence of representative points between frame images. Ru. However, since the motion vector detected from the frame image subjected to the reduction processing is the motion vector in the reduced image, when estimating the geometric deformation parameter, it is necessary to convert the motion vector into one having the same size. is there.
上述のようにして求めたホモグラフィ行列Hは、カメラのぶれに起因する画像の変形量を示す。よって、画像のぶれを補正する際には、当該ぶれによる変形を打ち消す画像変形量となるようにホモグラフィ行列Hを変換する必要がある。つまり、ホモグラフィ行列Hを逆行列Hに変換することによって、点a’と点aとの対応関係は、次の式(6)で表される。 The homography matrix H determined as described above indicates the amount of image deformation caused by camera shake. Therefore, when correcting the blurring of the image, it is necessary to convert the homography matrix H so as to obtain an image deformation amount that cancels the deformation due to the blurring. That is, by converting the homography matrix H into the inverse matrix H, the correspondence between the point a 'and the point a is expressed by the following equation (6).
式(6)によって、ぶれが生じた後の点a’をぶれが生じる前の点aと同一の座標に戻すことが可能となる。 The equation (6) makes it possible to return the point a 'after the occurrence of blurring to the same coordinates as the point a before the occurrence of blurring.
図示の例では、フレーム画像間のぶれ量を表すモデルとしてホモグラフィ行列を用いたが、例えば、ヘルマート行列又はアフィン行列などの他のモデルを用いるようにしてもよい。さらには、主被写体を防振対象に設定した場合には、並進のぶれ補正量だけを求めればよく、この場合には、動きベクトル群の平均値を求めればよいので、統計的な推定を行う必要がなく演算量を削減することができる。 In the illustrated example, the homography matrix is used as a model representing the amount of blurring between frame images, but another model such as a Helmert matrix or an affine matrix may be used, for example. Furthermore, when the main subject is set as the image stabilization target, it is sufficient to obtain only the translational shake correction amount. In this case, since the average value of the motion vector group may be obtained, statistical estimation is performed. It is unnecessary to reduce the amount of calculation.
次に、マイコン112は、上述のようにして求められた幾何変形パラメータを幾何変形回路111に与える。幾何変形回路111は幾何変形パラメータを用いて、メモリ104に記憶されたフレーム画像に幾何変換処理を施して防振処理を行う(ステップS206)。そして、幾何変形回路111は防振処理が施された画像を記憶装置(図示せず)に記憶するとともに、表示装置(図示せず)に表示する。その後、マイコン112は撮影処理を終了する。 Next, the microcomputer 112 gives the geometric deformation circuit 111 the geometric deformation parameters obtained as described above. The geometric deformation circuit 111 performs geometric conversion processing on the frame image stored in the memory 104 using the geometric deformation parameter to perform image stabilization processing (step S206). Then, the geometric deformation circuit 111 stores the image subjected to the image stabilization processing in a storage device (not shown) and displays the image on a display device (not shown). Thereafter, the microcomputer 112 ends the photographing process.
このように、本発明の第1の実施形態では、シャッタースピードに応じて動きベクトルの検出に用いる画像の縮小率を変更する。これによって、シャッタースピードに拘わらず精度よく動きベクトルを検出して、画像におけるぶれを良好に補正することができる。 As described above, in the first embodiment of the present invention, the reduction ratio of the image used to detect the motion vector is changed according to the shutter speed. By this, it is possible to accurately detect the motion vector regardless of the shutter speed, and correct the blurring in the image.
[第2の実施形態]
続いて、本発明の第2の実施形態によるカメラの一例について説明する。
Second Embodiment
Subsequently, an example of a camera according to a 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 in the camera shown in FIG.
図示のカメラは、画像縮小回路108の代わりに画像リサイズ回路1001を備えている。 The illustrated camera includes an image resizing circuit 1001 instead of the image reducing circuit 108.
図11は、図10に示すカメラで行われる撮影処理の一例を説明するためのフローチャートである。なお、図示のフローチャートにおいて、図2に示すフローチャートと同一のステップについては同一の参照符号を付して説明を省略する。 FIG. 11 is a flowchart for explaining an example of the photographing process performed by the camera shown in FIG. In the flowchart shown in the figure, the same steps as those in the flowchart shown in FIG.
撮影が開始されると、マイコン112の制御下で、カメラ信号処理回路103はメモリ104にフレーム画像を記録するとともに、フレーム画像を画像縮小回路107に送る(ステップS1101)。ステップS202においては、縮小率決定回路106は、前述のようにして、画像の縮小率を決定して、当該縮小率を画像縮小回路107および画像リサイズ回路1001に設定する。 When photographing is started, under the control of the microcomputer 112, 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 (step S1101). In step S202, the reduction ratio determination circuit 106 determines the image reduction ratio as described above, and sets the reduction ratio 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 ratio set by the reduction ratio 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 ratio determined by the reduction ratio determining circuit 106 at the time of shooting. However, when the reduction ratio is changed according to the temporal change of the photographed scene, the reduced frame image already stored in the memory 104 and the frame image on which the reduction processing has been performed after the reduction ratio is changed. There is a difference in image size among them. Then, if the image size is different between the original image and the reference image, the motion vector can not be detected. Therefore, the image resizing circuit 1001 resizes the reduced image stored in the memory 104 in order to match the size 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 the shooting time (that is, input time) for a certain frame image is 1/8. Then, when the reduction ratio is changed to 1⁄4 according to the temporal change of the photographed scene, the image resizing circuit 1001 doubles the 1⁄8 reduced frame image stored in the memory 104 to process the original. It is sent to the motion vector detection circuit 109 as an image. On the other hand, the frame image of 1⁄4 reduction is sent from the image reduction circuit 107 to the motion vector detection circuit 109 as a reference image and stored in the memory 104.
この結果、原画像および参照画像はともに1/4縮小サイズとなるので、動きベクトル検出回路109は同一の画像サイズの原画像および参照画像を用いて動きベクトルの検出を行うことが可能となる。 As a result, since both the original image and the reference image have a 1⁄4 reduced size, the motion vector detection circuit 109 can detect a motion vector using the original image and the reference image of the same image size.
なお、画像リサイズ回路1001で行われるリサイズ処理の手法はどのような手法であってもよく、例えば、バイリニア又はバイキュービックのような補間処理を用いればよい。 The resizing method performed by the image resizing circuit 1001 may be any method, for example, bilinear or bicubic interpolation processing may be used.
その後、図2で説明したステップS204〜S207の処理を行った後、マイコン112は撮影処理を終了する。 Thereafter, after the processing of steps S204 to S207 described in FIG. 2 is performed, the microcomputer 112 ends the photographing processing.
このように、本発明の第2の実施形態では、撮影時点における縮小率でフレーム画像を縮小してメモリ104に記憶する。そして、縮小率の変化に応じてメモリ104に記憶された縮小処理済みのフレーム画像をリサイズ処理する。前述の第1の実施形態では、等倍サイズのフレーム画像のみをメモリ104に記憶しており、このため、縮小率の変動があると画像縮小回路はメモリ104から等倍サイズのフレーム画像を読み込んで画像縮小処理を行うことになる。よって、伝送のための帯域が大きくなってしまう。一方、第2の実施形態では、撮影時点における縮小率でフレーム画像を縮小してメモリ104に記憶して、縮小率の変化に応じてメモリ104に記憶された縮小処理済みのフレーム画像をリサイズ処理する結果、伝送のための帯域を削減することができる。 As described above, 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 ratio. In the first embodiment described above, only the frame image of the same size is stored in the memory 104. Therefore, the image reduction circuit reads the frame image of the same size from the memory 104 when there is a change in the reduction ratio. Image reduction processing will be performed. Therefore, the bandwidth for transmission becomes large. On the other hand, in the second embodiment, the frame image is reduced at the reduction rate at the time of shooting and stored in the memory 104, and the reduced frame image stored in the memory 104 is resized according to the change in reduction rate. As a result, the bandwidth for transmission can be reduced.
上述の説明から明らかなように、図1および図10に示す例では、画像縮小回路107および108が縮小手段として機能し、マイコン112および縮小率決定回路106が決定手段として機能する。また、動きベクトル検出回路109、幾何変形パラメータ推定回路110、幾何変形回路111、および画像リサイズ回路1001はそれぞれ検出手段、算出手段、補正手段、およびリサイズ手段として機能する。 As apparent from the above description, in the examples shown in FIGS. 1 and 10, the image reduction circuits 107 and 108 function as reduction means, and the microcomputer 112 and the reduction ratio 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 respectively function as a detection unit, a calculation unit, a correction unit, and a resizing unit.
また、上記実施の形態では、撮像装置の内部で防振処理を行う例をあげて説明を行ったが、これに限られるものではない。撮像装置が、撮影された画像に対応するシャッタースピードを関連付けて出力し、これらを受け取ったパーソナルコンピュータなどで、画像の縮小と動きベクトルの検出を行うようにしてもよい。つまり、シャッタースピードに応じて複数の画像を縮小し、これらを用いて動きベクトルを検出する機能を有する画像処理装置であればよい。 Further, in the above embodiment, an example in which the image stabilization processing is performed inside the imaging apparatus has been described, but the present invention is not limited to this. The imaging device may associate and output a shutter speed corresponding to a captured image, and may perform image reduction and motion vector detection with a personal computer or the like that has received these. 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 may be used.
以上、本発明について実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。 As mentioned above, although this invention was demonstrated based on embodiment, this invention is not limited to these embodiment, The various form of the range which does not deviate from the summary of this invention is also included in this invention .
例えば、上記の実施の形態の機能を制御方法として、この制御方法を画像処理装置に実行させるようにすればよい。また、上述の実施の形態の機能を有するプログラムを制御プログラムとして、当該制御プログラムを画像処理装置が備えるコンピュータに実行させるようにしてもよい。なお、制御プログラムは、例えば、コンピュータに読み取り可能な記録媒体に記録される。 For example, the control method may be executed by the image processing apparatus as the control method of the above-described embodiment. Further, a program having the functions of the above-described embodiments may be used as a control program to cause a computer provided with the image processing apparatus to execute the control program. The control program is recorded, for example, on a computer readable recording medium.
[その他の実施形態]
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
Other Embodiments
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. Can also be realized. It can also be implemented by a circuit (eg, an ASIC) that implements one or more functions.
102 撮像素子
103 カメラ信号処理回路
104 メモリ
106 縮小率決定回路
107,108 画像縮小回路
109 動きベクトル検出回路
110 幾何変形パラメータ推定回路
111 幾何変形回路
112 マイコン
1001 画像リサイズ回路
102 image sensor 103 camera signal processing circuit 104 memory 106 reduction ratio 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 resize circuit
Claims (7)
前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小手段によって縮小処理を行う際の縮小率を決定する決定手段と、
前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出手段と、
を有し、
前記決定手段は、前記シャッタースピードが遅くなるにつれて画像サイズが大きくなるように前記縮小率を決定することを特徴する画像処理装置。 Reducing means for reducing the original image and the reference image by using one image as an original image and using an image obtained as a result of shooting after the original image as a reference image;
A determination unit that determines a reduction ratio when the reduction processing is performed by the reduction device according to a shutter speed at the time of capturing the original image and the reference image;
Detection means for detecting a motion vector between the original image and the reference image based on the original image and the reference image subjected to the reduction processing;
I have a,
The image processing apparatus , wherein the determination unit determines the reduction ratio so that the image size increases as the shutter speed decreases .
前記縮小手段は、前記メモリ手段から前記原画像および前記参照画像を読み込んで前記縮小処理を行うことを特徴とする請求項1に記載の画像処理装置。 Memory means for storing the original image and the reference image;
The image processing apparatus according to claim 1, wherein the reduction unit performs the reduction process by reading the original image and the reference image from the memory unit.
前記撮影の際に前記シャッタースピードに応じた縮小率が変化すると、前記縮小処理が行われた原画像および参照画像の縮小率を同一とするためのリサイズ処理を行うリサイズ手段とを有することを特徴とする請求項1に記載の画像処理装置。 Memory means for storing the original image and the reference image subjected to the reduction process;
The apparatus further comprises resizing means for performing resizing processing to equalize the reduction rates of the original image and the reference image subjected to the reduction processing when the reduction ratio according to the shutter speed changes during the photographing. The image processing apparatus according to claim 1, wherein
前記幾何変形パラメータに基づいて撮影の結果得られた画像を幾何変形して当該画像のぶれを補正する補正手段とを有することを特徴とする請求項1〜3のいずれか1項に記載の画像処理装置。 Calculating means for determining a blur between the original image and the reference image as a geometric deformation parameter based on the motion vector;
4. The image according to any one of claims 1 to 3 , further comprising: correction means for geometrically deforming an image obtained as a result of shooting based on the geometric deformation parameter to correct blurring of the image. Processing unit.
請求項1〜4のいずれか1項に記載の画像処理装置とを有することを特徴とする撮像装置。 Imaging means for imaging the original image and the reference image;
An image pickup apparatus comprising the image processing apparatus according to any one of claims 1 to 4 .
前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、
前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、
を有し、
前記決定ステップにおいて、前記シャッタースピードが遅くなるにつれて画像サイズが大きくなるように前記縮小率を決定することを特徴する画像処理装置の制御方法。 Reducing an original image and the reference image by using one image as an original image and using 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 the reduction processing is performed in the reduction step in accordance with a shutter speed at the time of photographing the original image and the reference image;
Detecting a motion vector between the original image and the reference image based on the original image and the reference image subjected to the reduction processing;
I have a,
The control method of the image processing apparatus, wherein in the determination step, the reduction ratio is determined such that the image size becomes larger as the shutter speed becomes slower .
前記画像処理装置に備えられたコンピュータに、
1つの画像を原画像とし、当該原画像の後で撮影の結果得られた画像を参照画像として、前記原画像および前記参照画像を縮小処理する縮小ステップと、
前記原画像と参照画像の撮影の際のシャッタースピードに応じて前記縮小ステップで縮小処理を行う際の縮小率を決定する決定ステップと、
前記縮小処理が行われた原画像および参照画像に基づいて前記原画像と前記参照画像との間における動きベクトルを検出する検出ステップと、
を実行させるものであって、
前記決定ステップにおいて、前記シャッタースピードが遅くなるにつれて画像サイズが大きくなるように前記縮小率を決定することを特徴する制御プログラム。 A control program used in the image processing apparatus,
A computer provided in the image processing apparatus;
Reducing an original image and the reference image by using one image as an original image and using 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 the reduction processing is performed in the reduction step in accordance with a shutter speed at the time of photographing the original image and the reference image;
Detecting a motion vector between the original image and the reference image based on the original image and the reference image subjected to the reduction processing;
It is those for the execution,
The control program , wherein in the determination step, the reduction ratio is determined so that the image size increases as the shutter speed decreases .
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 JP2016163257A (en) | 2016-09-05 |
JP6548409B2 true 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) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5284048B2 (en) * | 2008-11-12 | 2013-09-11 | キヤノン株式会社 | Image processing apparatus, imaging apparatus, and image processing method |
JP5513490B2 (en) * | 2009-04-10 | 2014-06-04 | パナソニック株式会社 | Object detection device, object detection system, integrated circuit for object detection, camera with object detection function, and object detection method |
JP5708097B2 (en) * | 2011-03-18 | 2015-04-30 | 株式会社リコー | Imaging apparatus, imaging method, and imaging program |
JP6016546B2 (en) * | 2012-09-19 | 2016-10-26 | キヤノン株式会社 | Imaging device, control method thereof, and control program |
-
2015
- 2015-03-04 JP JP2015042333A patent/JP6548409B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2016163257A (en) | 2016-09-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5596138B2 (en) | Imaging apparatus, image processing apparatus, image processing method, and image processing program | |
JP6157242B2 (en) | Image processing apparatus and image processing method | |
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 | |
JP2018107526A (en) | Image processing device, imaging apparatus, image processing method and computer program | |
JP2006295626A (en) | Fish-eye image processing apparatus, method thereof and fish-eye imaging apparatus | |
US10482580B2 (en) | Image processing apparatus, image processing method, and program | |
JP2022179514A (en) | Control device, imaging device, control method and program | |
JP2017175364A (en) | Image processing device, imaging device, and control method of image processing device | |
US9007471B2 (en) | Digital photographing apparatus, method for controlling the same, and computer-readable medium | |
JP6282133B2 (en) | Imaging device, control method thereof, and control program | |
JP6231816B2 (en) | IMAGING DEVICE, ITS CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM | |
CN111372000A (en) | Video anti-shake method and apparatus, electronic device and computer-readable storage 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 | |
JP4872830B2 (en) | Imaging apparatus, imaging method, image processing apparatus, image processing program, and image processing method | |
JP7025237B2 (en) | Image processing equipment and its control method and program | |
JP6548409B2 (en) | Image processing apparatus, control method therefor, control program, and imaging apparatus | |
JP4936222B2 (en) | Motion vector collation device, image composition device, and program | |
JP6245847B2 (en) | Image processing apparatus and image processing method | |
JP6016546B2 (en) | Imaging device, control method thereof, and control program | |
JP6381212B2 (en) | Imaging apparatus and control method thereof | |
JP2017173920A (en) | Image processor, image processing method, image processing program, and record medium | |
JP2017183983A (en) | Imaging apparatus, control method and control program of the same | |
JP6501732B2 (en) | Data processing apparatus, imaging apparatus, and control method of data processing apparatus |
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 |