JP2009118434A - Blurring correction device and imaging apparatus - Google Patents

Blurring correction device and imaging apparatus Download PDF

Info

Publication number
JP2009118434A
JP2009118434A JP2007292432A JP2007292432A JP2009118434A JP 2009118434 A JP2009118434 A JP 2009118434A JP 2007292432 A JP2007292432 A JP 2007292432A JP 2007292432 A JP2007292432 A JP 2007292432A JP 2009118434 A JP2009118434 A JP 2009118434A
Authority
JP
Japan
Prior art keywords
image
correction
blur
correction target
images
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007292432A
Other languages
Japanese (ja)
Inventor
Haruo Hatanaka
晴雄 畑中
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP2007292432A priority Critical patent/JP2009118434A/en
Publication of JP2009118434A publication Critical patent/JP2009118434A/en
Pending legal-status Critical Current

Links

Landscapes

  • Exposure Control For Cameras (AREA)
  • Studio Devices (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To achieve blurring correction, at low cost and with high precision, for continuously captured images. <P>SOLUTION: A burring correction device includes: an image capturing unit for capturing a plurality of source images (element images) by consecutive photographing or bracket photographing; a correction target extracting unit for extracting, as a correction target image, one of the plurality of source images; a reference image extracting unit which defines source images, other than the correction target image, as candidate reference images and extracts, as a reference image, a candidate reference image of which a blurring amount included is smaller than that of the correction target image, from among the plurality of candidate reference images; and a correction processing unit for correcting blurring of the correction target image on the basis of the correction target image and the reference image. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、手ぶれ等に由来する画像のぶれを補正するぶれ補正装置及び撮像装置に関する。   The present invention relates to a camera shake correction apparatus and an imaging apparatus that correct camera shake caused by camera shake or the like.

手ぶれ補正技術は、撮影時における手ぶれを軽減する技術であり、デジタルスチルカメラ等の撮像装置における差別化技術として重要視されている。手ぶれ補正の一種として、手ぶれ検出センサで手ぶれを検出しその検出結果に基づいて補正レンズや撮像素子を駆動する光学式手ぶれ補正がある。   The camera shake correction technique is a technique for reducing camera shake at the time of photographing, and is regarded as important as a differentiation technique in an imaging apparatus such as a digital still camera. As one type of camera shake correction, there is optical camera shake correction in which camera shake is detected by a camera shake detection sensor and a correction lens and an image sensor are driven based on the detection result.

一方において、静止画に対する特殊撮影として、撮影に関する諸設定を変更することなく複数枚の静止画を連続的に取得する連写撮影や、撮影に関する諸設定(露出量やホワイトバランスなど)を変更しながら複数枚の静止画を連続的に取得するブラケット撮影がある。このような連写撮影やブラケット撮影に光学式手ぶれ補正を適用することも考えられる。しかし、連続撮影回数が多いと連続撮影の開始から終了までのトータルの手ぶれ量が非常に大きくなって、補正レンズや撮像素子の必要駆動量がそれらの可動範囲を超えることがあり、この場合は連続撮影の後半部において手ぶれ補正が全く効かなくなる。また、手ぶれ検出センサの使用自体がコストアップを招いてしまう。   On the other hand, as special shooting for still images, continuous shooting that continuously acquires multiple still images without changing various settings related to shooting and various settings related to shooting (exposure, white balance, etc.) are changed. However, there is bracket shooting that acquires multiple still images continuously. It is also conceivable to apply optical image stabilization to such continuous shooting and bracket shooting. However, if the number of continuous shooting is large, the total amount of camera shake from the start to the end of continuous shooting becomes very large, and the required drive amount of the correction lens and image sensor may exceed their movable range. In the second half of continuous shooting, camera shake correction does not work at all. Further, the use of the camera shake detection sensor itself increases the cost.

他方、手ぶれ検出センサを用いない電子式手ぶれ補正も開発されている。この電子式手ぶれ補正では、撮影によって得られた画像を解析して手ぶれを検出しその検出結果に基づいて手ぶれ補正を行う。   On the other hand, electronic image stabilization that does not use an image stabilization sensor has also been developed. In this electronic camera shake correction, an image obtained by photographing is analyzed to detect camera shake, and camera shake correction is performed based on the detection result.

電子式手ぶれ補正に関する従来手法として、以下のものがある。ある従来手法では、補正されるべき主画像の撮影前後に副画像を複数枚撮影して、その複数の副画像から主画像撮影時のぶれ情報を推定し、そのぶれ情報から主画像のぶれを補正する(例えば、特許文献1参照)。但し、この手法では、主画像前後に得られる副画像間の動き量(露光間隔をも含んだ動き量)から主画像のぶれが推定されるため、ぶれの検出精度が低くなってしまう。   As conventional methods for electronic image stabilization, there are the following methods. In one conventional method, a plurality of sub-images are captured before and after the main image to be corrected, the blur information at the time of main image shooting is estimated from the sub-images, and the blur of the main image is estimated from the blur information. It correct | amends (for example, refer patent document 1). However, in this method, since the blur of the main image is estimated from the amount of motion between the sub-images obtained before and after the main image (the amount of motion including the exposure interval), the detection accuracy of the blur is lowered.

また他の従来手法では、手ぶれ画像を2次元周波数空間へ変換した画像から手ぶれを検出している(例えば、特許文献2参照)。具体的には、変換によって得られた画像を周波数座標の原点を中心とした円に投影し、その投影データからぶれの大きさと方向を求めるようにしている。但し、この手法では、直線的且つ等速的なぶれしか推定できず、また、被写体の特定方向における周波数成分が小さい場合、ぶれ方向の検出を失敗してしまうことがある。   In another conventional method, camera shake is detected from an image obtained by converting a camera shake image into a two-dimensional frequency space (see, for example, Patent Document 2). Specifically, the image obtained by the conversion is projected onto a circle centered on the origin of the frequency coordinate, and the magnitude and direction of the shake are obtained from the projection data. However, with this method, only linear and constant velocity blur can be estimated, and when the frequency component in a specific direction of the subject is small, detection of the blur direction may fail.

尚、1枚の手ぶれ画像から、撮影中の手ぶれを表す手ぶれ情報(点広がり関数或いは画像復元フィルタ)を推定し、その手ぶれ情報と手ぶれ画像からぶれのない復元画像をデジタル信号処理で生成する方式も提案されている。この種の方式の中で、フーリエ反復法を用いた方式が下記非特許文献1に開示されている。図30にフーリエ反復法を実現する構成のブロック図を示す。フーリエ反復法では、復元画像と点広がり関数(Point Spread Function;PSF)の修正を介しつつフーリエ変換と逆フーリエ変換を反復実行することにより、劣化画像から最終的な復元画像を推定する。フーリエ反復法を実行するためには、初期の復元画像(復元画像の初期値)を与えてやる必要があり、初期の復元画像としては、一般的に、ランダム画像または手ぶれ画像としての劣化画像が用いられる。   A method for estimating camera shake information (a point spread function or an image restoration filter) representing a camera shake during shooting from a single camera shake image, and generating a restored image free from the camera shake information and the camera shake image by digital signal processing. Has also been proposed. Among these types of methods, a method using the Fourier iteration method is disclosed in Non-Patent Document 1 below. FIG. 30 shows a block diagram of a configuration for realizing the Fourier iteration method. In the Fourier iteration method, the final restored image is estimated from the degraded image by repeatedly executing Fourier transform and inverse Fourier transform while correcting the restored image and the point spread function (PSF). In order to execute the Fourier iteration method, it is necessary to give an initial restored image (initial value of the restored image). Generally, the initial restored image is a random image or a degraded image as a camera shake image. Used.

特開2001−346093号公報JP 2001-346093 A 特開平11−27574号公報JP-A-11-27574 G. R. Ayers and J. C. Dainty, "Iterative blind deconvolution method and its applications", OPTICS LETTERS, 1988年,Vol.13, No.7, p.547-549G. R. Ayers and J. C. Dainty, "Iterative blind deconvolution method and its applications", OPTICS LETTERS, 1988, Vol. 13, No. 7, p.547-549

手ぶれ検出センサを必要としない電子式手ぶれ補正によれば、光学式手ぶれ補正に比べて低コスト化が図れるが、連写撮影やブラケット撮影に適したものは未だ提案されていないのが実情である。また、静止画の連写撮影又はブラケット撮影に特に着目して従来技術の問題点を説明したが、連続撮影された静止画の束である動画の撮影時にも同様の問題が生じるため、これにも適した手ぶれ補正技術が切望されている。   Electronic camera shake correction that does not require a camera shake detection sensor can reduce costs compared to optical camera shake correction, but the actual situation is that no suitable camera for continuous shooting or bracket shooting has been proposed. . In addition, the problem of the prior art has been described with particular attention to still image continuous shooting or bracket shooting, but the same problem occurs when shooting a moving image that is a bundle of continuously shot still images. There is an urgent need for a suitable image stabilization technology.

そこで本発明は、連続的に撮影された画像に対するぶれ補正を安価且つ高精度に実現することのできるぶれ補正装置及び撮像装置を提供することを目的とする。   SUMMARY OF THE INVENTION An object of the present invention is to provide a shake correction apparatus and an imaging apparatus that can realize shake correction with respect to continuously shot images at low cost and high accuracy.

本発明に係る第1のぶれ補正装置は、撮像手段を用いた連写撮影又はブラケット撮影によって複数の原画像を取得する画像取得手段と、前記複数の原画像の中から1枚の原画像を補正対象画像として抽出する補正対象画像抽出手段と、前記複数の原画像の内、前記補正対象画像を除く各原画像を候補参照画像とし、複数の候補参照画像の中から、含まれるぶれ量が前記補正対象画像のそれよりも小さい候補参照画像を参照画像として抽出する参照画像抽出手段と、前記補正対象画像と前記参照画像に基づいて前記補正対象画像のぶれを補正する補正処理手段と、備えたことを特徴とする。   A first shake correction apparatus according to the present invention includes an image acquisition unit that acquires a plurality of original images by continuous shooting or bracket shooting using an imaging unit, and a single original image from the plurality of original images. Correction target image extraction means for extracting as a correction target image, and each of the plurality of original images excluding the correction target image is a candidate reference image, and the amount of blur included in the plurality of candidate reference images is Reference image extraction means for extracting a candidate reference image smaller than that of the correction target image as a reference image; and correction processing means for correcting blur of the correction target image based on the correction target image and the reference image. It is characterized by that.

これにより、連写撮影又はブラケット撮影によって得られた画像に対するぶれ補正が行われる。手ぶれ検出センサが不要であるため安価にぶれ補正装置を形成でき、また、参照画像だけでなく、補正されるべき補正対象画像にも基づいて補正対象画像を補正するためぶれ補正の高精度化も見込める。更に、複数の原画像は、連写撮影又はブラケット撮影によって元々取得されるべき画像群であるため、ぶれ補正を行うために別途の専用画像を取得する必要もない。故に、撮影時間やメモリ使用量に対する余分な負荷は発生しない。   Thereby, blur correction is performed on an image obtained by continuous shooting or bracket shooting. Since a camera shake detection sensor is not required, a camera shake correction device can be formed at a low cost. Further, not only the reference image but also the image to be corrected is corrected based on the image to be corrected. I can expect. Furthermore, since the plurality of original images is an image group that should be originally acquired by continuous shooting or bracket shooting, it is not necessary to acquire a separate dedicated image for blur correction. Therefore, there is no extra load on the shooting time and memory usage.

具体的には例えば、前記補正対象画像抽出手段は、各原画像における人物の顔向き、 各原画像における人物の開眼状態、各原画像における人物の表情、及び、各原画像の構図、の内の少なくとも1つに基づいて前記補正対象画像の抽出を行う。   Specifically, for example, the correction target image extracting means includes the face orientation of the person in each original image, the eye open state of the person in each original image, the facial expression of the person in each original image, and the composition of each original image. The correction target image is extracted based on at least one of the above.

顔向きなどから自動的に補正対象画像の抽出を行うようにすれば、ユーザが補正を望む可能性の高い画像を自動的に補正することも可能となる。   If the correction target image is automatically extracted from the face orientation or the like, it is possible to automatically correct an image that is highly likely to be corrected by the user.

本発明に係る第2のぶれ補正装置は、撮像手段を用いた連続的な撮影によって複数のフレーム画像から成る動画像を取得する画像取得手段と、複数のフレーム画像の中の、着目フレームにおけるフレーム画像を補正対象画像とし、前記補正対象画像に含まれるぶれを補正する補正処理手段と、前記着目フレームの近傍フレームにおける各フレーム画像を候補参照画像とし、複数の候補参照画像の中から、含まれるぶれ量が前記補正対象画像のそれよりも小さい候補参照画像を参照画像として抽出する参照画像抽出手段と、を備え、前記補正処理手段は、前記補正対象画像と前記参照画像に基づいて前記補正対象画像の前記ぶれを補正する。   A second shake correction apparatus according to the present invention includes an image acquisition unit that acquires a moving image including a plurality of frame images by continuous shooting using an imaging unit, and a frame in a frame of interest among the plurality of frame images. A correction processing unit that corrects a shake included in the correction target image and an image as a correction target image, and each frame image in a frame near the frame of interest is a candidate reference image, and is included among a plurality of candidate reference images Reference image extraction means for extracting, as a reference image, a candidate reference image whose blur amount is smaller than that of the correction target image, the correction processing means based on the correction target image and the reference image. The blur of the image is corrected.

これにより、鮮明な画質の動画像をユーザに提供することが可能となる。手ぶれ検出センサが不要であるため安価にぶれ補正装置を形成でき、また、参照画像だけでなく、補正されるべき補正対象画像にも基づいて補正対象画像を補正するためぶれ補正の高精度化も見込める。更に、補正対象画像及び参照画像となるフレーム画像は、元々取得されるべき画像であるため、ぶれ補正を行うために別途の専用画像を取得する必要もない。故に、撮影時間やメモリ使用量に対する余分な負荷は発生しない。   Thereby, it is possible to provide a moving image with clear image quality to the user. Since a camera shake detection sensor is not required, a camera shake correction device can be formed at a low cost. Further, not only the reference image but also the image to be corrected is corrected based on the image to be corrected. I can expect. Furthermore, since the correction target image and the frame image serving as the reference image are images that should be acquired originally, it is not necessary to acquire a separate dedicated image in order to perform blur correction. Therefore, there is no extra load on the shooting time and memory usage.

具体的には例えば、第1又は第2のぶれ補正装置において、前記参照画像抽出手段は、前記補正対象画像と各候補参照画像のエッジ強度、及び、前記補正対象画像と各候補参照画像のコントラスト、の内の少なくとも一方に基づいて前記補正対象画像と各候補参照画像のぶれ量を推定することにより、前記参照画像の抽出を行う。   Specifically, for example, in the first or second shake correction apparatus, the reference image extraction unit includes an edge intensity between the correction target image and each candidate reference image, and a contrast between the correction target image and each candidate reference image. The reference image is extracted by estimating the amount of blur between the correction target image and each candidate reference image based on at least one of the above.

これにより、少ない処理時間及び消費電力でぶれ量を推定することができる。   As a result, it is possible to estimate the amount of shake with less processing time and power consumption.

また例えば、第1又は第2のぶれ補正装置において、前記参照画像抽出手段は、前記補正対象画像に対する各候補参照画像の回転角、及び、各候補参照画像の、前記補正対象画像との撮影時間差、の内の少なくとも一方を更に用いて、前記参照画像の抽出を行う。   Further, for example, in the first or second shake correction apparatus, the reference image extraction unit includes a rotation angle of each candidate reference image with respect to the correction target image, and a photographing time difference between each candidate reference image and the correction target image. The reference image is extracted by further using at least one of.

これは、ぶれ補正効果の向上に寄与する。   This contributes to the improvement of the blur correction effect.

また具体的には例えば、第1又は第2のぶれ補正装置において、前記補正処理手段は、前記補正対象画像と前記参照画像に基づいて前記補正対象画像の前記ぶれに応じたぶれ情報を作成し、前記ぶれ情報に基づいて前記補正対象画像の前記ぶれを補正する。   More specifically, for example, in the first or second shake correction apparatus, the correction processing unit creates shake information corresponding to the shake of the correction target image based on the correction target image and the reference image. The blur of the correction target image is corrected based on the blur information.

また具体的には例えば、第1又は第2のぶれ補正装置において、前記補正処理手段は、前記補正対象画像の色信号に前記参照画像の輝度信号を合成することによって、前記補正対象画像の前記ぶれを補正する。   More specifically, for example, in the first or second shake correction apparatus, the correction processing unit synthesizes a luminance signal of the reference image with a color signal of the correction target image, thereby the correction target image. Correct blur.

また具体的には例えば、第1又は第2のぶれ補正装置において、前記補正処理手段は、前記参照画像を用いて前記補正対象画像を鮮鋭化することにより、前記補正対象画像の前記ぶれを補正する。   More specifically, for example, in the first or second shake correction apparatus, the correction processing unit corrects the shake of the correction target image by sharpening the correction target image using the reference image. To do.

また例えば、第1のぶれ補正装置において、連写撮影又はブラケット撮影の終了後、自動的に、前記補正対象画像の前記ぶれを補正することによって得られた補正画像を表示手段に出力する。   In addition, for example, in the first shake correction apparatus, after the continuous shooting or the bracket shooting is finished, the correction image obtained by automatically correcting the shake of the correction target image is output to the display unit.

これにより、連写撮影又はブラケット撮影後、ユーザは、手間をかけずに速やかに補正画像を確認可能となる。   Thus, after continuous shooting or bracket shooting, the user can quickly confirm the corrected image without taking time and effort.

また例えば、第2のぶれ補正装置において、前記補正処理手段は、前記動画像を形成する各フレーム画像を、順次、前記補正対象画像として取り扱うことにより、各フレーム画像に含まれるぶれを補正し、当該ぶれ補正装置は、前記ぶれ補正後の各フレーム画像の一部を切り出し、各切り出し画像を表示手段又は記録媒体に出力する切り出し画像出力手段と、隣接フレーム間の位置ずれを、その隣接フレームについての、ぶれ補正前又はぶれ補正後のフレーム画像に基づいて検出する位置ずれ検出手段と、を更に備え、前記切り出し画像出力手段は、検出された前記位置ずれに基づいて前記切り出し画像の切り出し位置を設定する。   Further, for example, in the second shake correction apparatus, the correction processing unit corrects the shake included in each frame image by sequentially treating each frame image forming the moving image as the correction target image, The blur correction apparatus cuts out a part of each frame image after the blur correction, outputs a clipped image to a display unit or a recording medium, and a positional deviation between adjacent frames with respect to the adjacent frame. Misalignment detection means for detecting based on the frame image before or after blur correction, and the clipped image output means determines the clipped position of the clipped image based on the detected shift. Set.

これにより、フレーム間の手ぶれに対する補正効果も得られる。   Thereby, the correction effect with respect to camera shake between frames is also obtained.

本発明に係る撮像装置は、撮像手段と、上記の何れかに記載のぶれ補正装置と、を備えたことを特徴とする。   An imaging apparatus according to the present invention includes an imaging unit and the shake correction apparatus according to any one of the above.

また、本発明に係る他の撮像装置は、撮像手段と、上記第1のぶれ補正装置と、を備えた撮像装置であって、前記複数の原画像と前記補正対象画像の前記ぶれを補正することによって得られた補正画像を互いに関連付ける関連付け手段と、関連付けられた画像に対する操作を受け付ける操作受付手段と、を更に備え、前記操作に基づく処理を関連付けられた画像の全てに一括して適用することを特徴とする。   Further, another imaging apparatus according to the present invention is an imaging apparatus including an imaging unit and the first blur correction device, and corrects the blur of the plurality of original images and the correction target image. An association means for associating the corrected images obtained in this way with each other and an operation accepting means for accepting an operation on the associated image, and collectively applying the processing based on the operation to all of the associated images. It is characterized by.

これにより、ユーザの利便性が高まる。   Thereby, the convenience for the user is enhanced.

本発明によれば、続的に撮影された画像に対するぶれ補正を安価且つ高精度に実現することのできるぶれ補正装置及び撮像装置を提供可能となる。   According to the present invention, it is possible to provide a camera shake correction apparatus and an imaging apparatus that can realize camera shake correction for continuously photographed images at low cost and with high accuracy.

本発明の意義ないし効果は、以下に示す実施の形態の説明により更に明らかとなろう。ただし、以下の実施の形態は、あくまでも本発明の一つの実施形態であって、本発明ないし各構成要件の用語の意義は、以下の実施の形態に記載されたものに制限されるものではない。   The significance or effect of the present invention will become more apparent from the following description of embodiments. However, the following embodiment is merely one embodiment of the present invention, and the meaning of the term of the present invention or each constituent element is not limited to that described in the following embodiment. .

以下、本発明の実施の形態につき、図面を参照して具体的に説明する。参照される各図において、同一の部分には同一の符号を付し、同一の部分に関する重複する説明を原則として省略する。後に第1〜第6実施例を説明するが、まず、各実施例に共通する事項又は各実施例にて参照される事項について説明する。   Hereinafter, embodiments of the present invention will be specifically described with reference to the drawings. In each of the drawings to be referred to, the same part is denoted by the same reference numeral, and redundant description regarding the same part is omitted in principle. The first to sixth embodiments will be described later. First, matters common to each embodiment or items referred to in each embodiment will be described.

図1は、本発明の実施の形態に係る撮像装置1の全体ブロック図である。図1の撮像装置1は、静止画(静止画像)及び動画(動画像)を撮影及び記録可能なデジタルビデオカメラである。但し、撮像装置1を、静止画のみを撮影及び記録可能なデジタルスチルカメラとすることも可能である。   FIG. 1 is an overall block diagram of an imaging apparatus 1 according to an embodiment of the present invention. An imaging apparatus 1 in FIG. 1 is a digital video camera that can capture and record still images (still images) and moving images (moving images). However, the imaging apparatus 1 can also be a digital still camera that can capture and record only still images.

撮像装置1は、撮像部11と、AFE(Analog Front End)12と、主制御部13と、内部メモリ14と、表示部15と、記録媒体16と、操作部17と、手ぶれ補正部19と、を備えている。操作部17には、シャッタボタン17a及び録画ボタン17bが備えられている。   The imaging apparatus 1 includes an imaging unit 11, an AFE (Analog Front End) 12, a main control unit 13, an internal memory 14, a display unit 15, a recording medium 16, an operation unit 17, and a camera shake correction unit 19. It is equipped with. The operation unit 17 includes a shutter button 17a and a recording button 17b.

撮像部11は、光学系と、絞りと、CCD(Charge Coupled Devices)やCMOS(Complementary Metal Oxide Semiconductor)イメージセンサなどから成る撮像素子と、光学系や絞りを制御するためのドライバ(全て不図示)と、を有している。ドライバは、主制御部13からのAF/AE制御信号に基づいて、光学系のズーム倍率や焦点距離、及び、絞りの開度を制御する。撮像素子は、光学系及び絞りを介して入射した被写体を表す光学像を光電変換し、該光電変換によって得られた電気信号をAFE12に出力する。   The imaging unit 11 includes an optical system, an aperture, an imaging device such as a CCD (Charge Coupled Devices) or a CMOS (Complementary Metal Oxide Semiconductor) image sensor, and a driver (all not shown) for controlling the optical system and the aperture. And have. The driver controls the zoom magnification and focal length of the optical system and the aperture of the diaphragm based on the AF / AE control signal from the main control unit 13. The image sensor photoelectrically converts an optical image representing a subject incident through the optical system and the diaphragm, and outputs an electrical signal obtained by the photoelectric conversion to the AFE 12.

AFE12は、撮像部11(撮像素子)から出力されるアナログ信号を増幅し、増幅されたアナログ信号をデジタル信号に変換する。AFE12は、このデジタル信号を、順次、主制御部13に出力する。   The AFE 12 amplifies the analog signal output from the imaging unit 11 (imaging device), and converts the amplified analog signal into a digital signal. The AFE 12 sequentially outputs this digital signal to the main control unit 13.

主制御部13は、CPU(Central Processing Unit)、ROM(Read Only Memory)及びRAM(Random Access Memory)等を備え、映像信号処理部としても機能する。主制御部13は、AFE12の出力信号に基づいて、撮像部11によって撮影された画像(以下、「撮影画像」又は「フレーム画像」ともいう)を表す映像信号を生成する。また、主制御部13は、表示部15の表示内容を制御する表示制御手段としての機能をも備え、表示に必要な制御を表示部15に対して行う。   The main control unit 13 includes a CPU (Central Processing Unit), a ROM (Read Only Memory), a RAM (Random Access Memory), and the like, and also functions as a video signal processing unit. Based on the output signal of the AFE 12, the main control unit 13 generates a video signal representing an image captured by the imaging unit 11 (hereinafter also referred to as “captured image” or “frame image”). The main control unit 13 also has a function as display control means for controlling the display content of the display unit 15, and performs control necessary for display on the display unit 15.

内部メモリ14は、SDRAM(Synchronous Dynamic Random Access Memory)等にて形成され、撮像装置1内で生成された各種データを一時的に記憶する。表示部15は、液晶ディスプレイパネル等から成る表示装置であり、主制御部13の制御の下、直前のフレームにて撮影された画像や記録媒体16に記録されている画像などを表示する。記録媒体16は、SD(Secure Digital)メモリカード等の不揮発性メモリであり、主制御部13による制御の下、撮影画像などを記憶する。   The internal memory 14 is formed by SDRAM (Synchronous Dynamic Random Access Memory) or the like, and temporarily stores various data generated in the imaging device 1. The display unit 15 is a display device composed of a liquid crystal display panel or the like, and displays an image taken in the immediately previous frame or an image recorded on the recording medium 16 under the control of the main control unit 13. The recording medium 16 is a non-volatile memory such as an SD (Secure Digital) memory card, and stores captured images and the like under the control of the main control unit 13.

操作部17は、外部からの操作を受け付ける。操作部17に対する操作内容は、主制御部13に伝達される。シャッタボタン17aは、静止画の撮影及び記録を指示するためのボタンである。録画ボタン17bは、動画の撮影及び記録に対する開始又は終了を指示するためのボタンである。   The operation unit 17 receives an operation from the outside. The content of the operation on the operation unit 17 is transmitted to the main control unit 13. The shutter button 17a is a button for instructing to capture and record a still image. The recording button 17b is a button for instructing the start or end of moving image shooting and recording.

撮像装置1の動作モードには、静止画または動画の撮影及び記録が可能な撮影モードと、記録媒体16に記録された静止画または動画を表示部15に再生表示する再生モードと、が含まれる。操作部17に対する操作に応じて、各モード間の遷移は実施される。   The operation mode of the imaging device 1 includes a shooting mode capable of shooting and recording a still image or a moving image, and a reproduction mode for reproducing and displaying the still image or moving image recorded on the recording medium 16 on the display unit 15. . Transition between the modes is performed according to the operation on the operation unit 17.

撮影モードにおいて、撮像部11は、所定のフレーム周期(例えば、1/60秒)にて順次撮影を行う。主制御部13は、各フレームにて撮像部11の出力からスルー表示用画像を生成し、順次得られるスルー表示用画像を表示部15に順次更新表示させる。   In the shooting mode, the imaging unit 11 sequentially performs shooting at a predetermined frame period (for example, 1/60 seconds). The main control unit 13 generates a through display image from the output of the imaging unit 11 in each frame, and sequentially displays the through display images obtained sequentially on the display unit 15.

静止画撮影として、シャッタボタン17aの押下による指示に従って1枚の静止画を取得及び記録するシングル撮影と、シャッタボタン17aの押下による指示に従って複数枚の静止画を連続的に取得及び記録する連写撮影がある。シングル撮影の指示がなされた場合、1枚の撮影画像を取得し、この1枚の撮影画像の画像データを1枚の静止画の画像データとして記録媒体16に記録する。連写撮影の指示がなされた場合、連続的に撮影を行い、この連続的な撮影によって得られた複数枚の撮影画像の画像データを連写撮影された複数枚の静止画の画像データとして記録媒体16に記録する。連写撮影によって得られた複数枚の撮影画像を、以下、総称して「連写画像群」とも呼ぶ。また、連写画像群の各形成要素、即ち、連写画像群を形成する各撮影画像を「要素画像」とも呼ぶ。   As still image shooting, single shooting for acquiring and recording one still image according to an instruction by pressing the shutter button 17a, and continuous shooting for continuously acquiring and recording a plurality of still images according to an instruction by pressing the shutter button 17a There is shooting. When an instruction for single shooting is given, one shot image is acquired, and the image data of the one shot image is recorded in the recording medium 16 as image data of one still image. When an instruction for continuous shooting is given, continuous shooting is performed, and the image data of a plurality of shot images obtained by the continuous shooting is recorded as image data of a plurality of still images shot continuously. Recorded on the medium 16. Hereinafter, a plurality of captured images obtained by continuous shooting are collectively referred to as a “continuous shooting image group”. Each forming element of the continuous shot image group, that is, each captured image forming the continuous shot image group is also referred to as an “element image”.

撮影モードにおいて、録画ボタン17bが押下されると、その押下後の各フレームにて得られるフレーム画像の画像データは記録媒体16に順次記録されてゆき、再度、録画ボタン17bが押下されると、その記録は終了する。尚、撮影対象が静止画であるか動画であるかに関わらず、記録媒体16に記録される画像データは、必要に応じて、後述の手ぶれ検出及び手ぶれ補正のために内部メモリ14にも記録されうる。   When the recording button 17b is pressed in the shooting mode, the image data of the frame image obtained in each frame after the pressing is sequentially recorded on the recording medium 16, and when the recording button 17b is pressed again, The recording ends. Regardless of whether the subject to be photographed is a still image or a moving image, the image data recorded on the recording medium 16 is also recorded in the internal memory 14 for camera shake detection and camera shake correction, which will be described later, as necessary. Can be done.

撮像部11の撮影によって得られた画像は、手ぶれに起因するぶれを含みうる画像であり、操作部17等を介して与えられた補正指示に従って或いは自動的に、手ぶれ補正部19によって補正される。ぶれが補正されるべき画像を、特に「補正対象画像」と呼ぶ。補正対象画像に含まれるぶれを補正することによって得られた画像を「補正画像」と呼ぶ。手ぶれ補正部19は、補正対象画像だけでなく他の画像をも参照し、補正対象画像とその他の画像に基づいて補正対象画像に含まれるぶれを補正する。この参照される他の画像を「参照画像」と呼ぶ。ある画像に含まれるぶれは、手ぶれ等に起因する、その画像の劣化(画像劣化)に相当する。   An image obtained by photographing by the imaging unit 11 is an image that may include a shake due to camera shake, and is corrected by the camera shake correction unit 19 in accordance with a correction instruction given via the operation unit 17 or the like. . An image whose blurring is to be corrected is particularly referred to as a “correction target image”. An image obtained by correcting blur included in the correction target image is referred to as a “corrected image”. The camera shake correction unit 19 refers to not only the correction target image but also other images, and corrects the shake included in the correction target image based on the correction target image and other images. This other image to be referred to is referred to as a “reference image”. Blur included in a certain image corresponds to deterioration of the image (image deterioration) caused by camera shake or the like.

手ぶれ補正部19は、角速度センサ等の手ぶれ検出センサを用いることなく、撮像部11の出力信号から得られる画像データに基づいて補正対象画像に含まれるぶれを補正する。即ち、補正対象画像に含まれるぶれを除去する。本実施形態において、ぶれに関する除去とは、完全なる除去又は一部の除去を意味し、それを低減と読み替えることもできる。   The camera shake correction unit 19 corrects the shake included in the correction target image based on the image data obtained from the output signal of the imaging unit 11 without using a camera shake detection sensor such as an angular velocity sensor. That is, the blur included in the correction target image is removed. In the present embodiment, removal related to blur means complete removal or partial removal, which can be read as reduction.

手ぶれ補正部19によるぶれ補正(手ぶれ補正)には、静止画に対する静止画手ぶれ補正と、動画に対する動画手ぶれ補正と、が含まれる。   The camera shake correction (camera shake correction) performed by the camera shake correction unit 19 includes still image camera shake correction for still images and moving image camera shake correction for moving images.

連写撮影を利用することによって、ユーザにとって好ましいシャッタタイミングや撮影条件による画像を連写画像群の中から選択して利用することが可能である。ところが、連写撮影時における手ぶれは一様ではないため、上記の好ましいシャッタタイミングや撮影条件による画像に、大きなぶれが含まれる可能性もある。そこで、本実施形態に係る静止画手ぶれ補正では、連写画像群の中から、上記の好ましいシャッタタイミングや撮影条件による要素画像をベストショット画像(補正対象画像)として選択する共に該ベストショット画像よりも含まれるぶれ量が少ない要素画像を参照画像として連写画像群の中から選択し、選択した両画像を用いてベストショット画像のぶれを補正する。図2に、この補正手法の概念図を示す。   By using continuous shooting, it is possible to select and use an image based on shutter timing and shooting conditions preferable for the user from a group of continuous shot images. However, since camera shake during continuous shooting is not uniform, there is a possibility that an image due to the preferable shutter timing and shooting conditions described above includes large camera shake. Therefore, in still image camera shake correction according to the present embodiment, an element image based on the preferred shutter timing and shooting conditions is selected from the group of continuous shot images as a best shot image (correction target image) and the best shot image is used. Is selected from the group of continuously shot images as a reference image, and the blur of the best shot image is corrected using both selected images. FIG. 2 shows a conceptual diagram of this correction method.

これにより、ぶれの少ないベストショット画像、即ち、ぶれが少なく且つユーザにとって好ましいシャッタタイミングや撮影条件によって取得された画像をユーザに提供することが可能となる。また、連写画像群は連写撮影によって元々取得されるべき画像群であるので、手ぶれ補正用に別途の専用画像を取得する必要もない。故に、撮影時間やメモリ使用量に対する余分な負荷は発生しない。   As a result, it is possible to provide the user with the best shot image with less blur, that is, the image obtained with less shutter shake and preferable shutter timing and shooting conditions for the user. Further, since the continuous image group is an image group that should be originally acquired by continuous shooting, it is not necessary to acquire a separate dedicated image for camera shake correction. Therefore, there is no extra load on the shooting time and memory usage.

また、動画撮影時における手ぶれは不規則であるため、動画を形成するフレーム画像の中には、ぶれの大きなフレーム画像とぶれの小さなフレーム画像が混在する。そこで、本実施形態に係る動画手ぶれ補正では、任意のフレームに着目し、その着目フレームのフレーム画像のぶれが大きいのであれば、その着目フレームの近傍フレームにおける、ぶれの小さなフレーム画像を参照し、そのぶれの小さなフレーム画像と着目フレームのフレーム画像に基づいて着目フレームのフレーム画像のぶれを補正する。   In addition, since the camera shake at the time of moving image shooting is irregular, the frame image forming the moving image includes a frame image having a large shake and a frame image having a small shake. Therefore, in the video image stabilization according to the present embodiment, paying attention to an arbitrary frame, if the blur of the frame image of the target frame is large, refer to a frame image with a small blur in a frame near the target frame, The blur of the frame image of the target frame is corrected based on the frame image with the small blur and the frame image of the target frame.

これにより、各フレーム画像におけるぶれが低減された、鮮明な画質の動画をユーザに提供することが可能となる。   Accordingly, it is possible to provide a user with a clear moving image with reduced blurring in each frame image.

以下に、手ぶれ補正に関与する実施例として、第1〜第6実施例を説明する。図3に、第1〜第6実施例の概略を表にて示す。第1実施例では、静止画手ぶれ補正の全体的な動を説明する。第2実施例では、ベストショット画像としての補正対象画像の選択方法を説明する。第3実施例では、参照画像の選択方法を説明する。第4実施例では、補正対象画像と参照画像に基づく、補正対象画像の補正方法を説明する。第5実施例では、動画手ぶれ補正の動作を説明する。第6実施例では、第1〜第5実施例で述べた事項に対する、応用例や変形列などを説明する。尚、各実施例における記述において、画像などが記憶される「メモリ」とは、特に記述無き限り、内部メモリ14又は手ぶれ補正部19内に設けられた図示されないメモリを意味するものとする。   Hereinafter, first to sixth examples will be described as examples relating to camera shake correction. FIG. 3 shows a summary of the first to sixth embodiments in a table. In the first embodiment, the overall movement of still image stabilization will be described. In the second embodiment, a method for selecting a correction target image as a best shot image will be described. In the third embodiment, a reference image selection method will be described. In the fourth embodiment, a correction method for a correction target image based on the correction target image and the reference image will be described. In the fifth embodiment, a motion blur correction operation will be described. In the sixth embodiment, application examples and modified sequences for the items described in the first to fifth embodiments will be described. In the description of each embodiment, the “memory” in which an image or the like is stored means a memory (not shown) provided in the internal memory 14 or the camera shake correction unit 19 unless otherwise specified.

<<第1実施例>>
まず、第1実施例について説明する。図4を参照して、静止画手ぶれ補正の動作の流れを説明する。図4は、その動作の流れを表すフローチャートである。
<< First Example >>
First, the first embodiment will be described. With reference to FIG. 4, the flow of the still image camera shake correction operation will be described. FIG. 4 is a flowchart showing the flow of the operation.

撮影モードにおいて、連写撮影の指示がなされると、被写体の明るさを測定する測光回路(不図示)から得られた明るさ情報に基づき、撮像部11の撮像素子の露光量が最適化されるように、主制御部13は撮像素子の露光時間TEPを算出する(ステップS11及びS12)。次に、ステップS13において、露光時間TEPにてN回連続撮影することによりN枚の撮影画像から成る連写画像群を取得し、このN枚の撮影画像を要素画像Cw1〜CwNとしてメモリ上に記憶する。要素画像の枚数(即ち、Nの値)は、連写撮影によって取得されるべき画像の枚数と一致し、この枚数は、例えば操作部17に対する操作を介してユーザに指定される。ここで、Nを3以上の整数とする。但し、N=2とすることも可能である。また、要素画像Cw1〜CwNの画像サイズは同じであるものとする。 In the shooting mode, when an instruction for continuous shooting is given, the exposure amount of the image sensor of the imaging unit 11 is optimized based on brightness information obtained from a photometry circuit (not shown) that measures the brightness of the subject. so that, the main control unit 13 calculates an exposure time T EP of the image pickup device (steps S11 and S12). Next, in step S13, acquires a continuous image group consisting of N photographed images by N times continuous shooting at an exposure time T EP, the N photographed images as an element image Cw 1 ~Cw N Store on memory. The number of element images (that is, the value of N) coincides with the number of images to be acquired by continuous shooting, and this number is designated by the user through an operation on the operation unit 17, for example. Here, N is an integer of 3 or more. However, it is possible to set N = 2. The image sizes of the element images Cw 1 to Cw N are the same.

続くステップS14において、主制御部13又は手ぶれ補正部19は、露光時間TEPと閾値TTHとを比較し、露光時間TEPが閾値TTHより小さい場合、要素画像Cw1〜CwNに手ぶれに由来するぶれは含まれていない(或いは極めて軽微である)とみなして、手ぶれ補正を行うことなく図4の処理を終了する。閾値TTHとしては、例えば、手ぶれ限界露光時間を用いる。手ぶれ限界露光時間は、手ぶれが無視できると判断される限界露光時間であり、撮像部11の焦点距離fDの逆数から算出される。 In the following step S14, the main control unit 13 or the camera shake correction unit 19 compares the exposure time T EP and the threshold T TH, if the exposure time T EP is smaller than the threshold value T TH, shake the element image Cw 1 ~Cw N 4 is regarded as being not included (or very slight), and the process of FIG. 4 is terminated without performing camera shake correction. As the threshold value T TH , for example, a camera shake limit exposure time is used. The camera shake limit exposure time is a limit exposure time at which camera shake is determined to be negligible, and is calculated from the reciprocal of the focal length f D of the imaging unit 11.

露光時間TEPが閾値TTHより大きい場合、ステップS15に移行する。ステップS15において、手ぶれ補正部19は、要素画像Cw1〜CwNの中からベストショット画像を選択し、選択したベストショット画像を補正対象画像Lwとしてメモリ上に記憶する(選択方法は第2実施例にて後述)。続くステップS16において、手ぶれ補正部19は、要素画像Cw1〜CwNの中からぶれが小さい1枚の要素画像を選択し、選択した要素画像を参照画像Rwとしてメモリ上に記憶する(選択方法は第3実施例にて後述)。ここで選択されるべきぶれが小さい要素画像とは、基本的には、要素画像Cw1〜CwNの中で最もぶれが小さい要素画像である。後述の手ぶれ補正手法からも明らかとなるが、参照画像Rwは、手ぶれ補正処理において、ぶれによる劣化が除去された画像として利用される。このため、参照画像として選択されるべき要素画像におけるぶれ量は小さければ小さいほどよい。 If the exposure time T EP is larger than the threshold value T TH, the process proceeds to step S15. In step S15, the camera shake correction unit 19 selects the best shot image from the element images Cw 1 to Cw N and stores the selected best shot image in the memory as the correction target image Lw (the selection method is the second embodiment). Later in the example). In subsequent step S16, the camera shake correction unit 19 selects one element image with a small shake from the element images Cw 1 to Cw N and stores the selected element image in the memory as a reference image Rw (selection method). Is described later in the third embodiment). The element image with the smallest blur to be selected here is basically the element image with the smallest blur among the element images Cw 1 to Cw N. As will be apparent from the camera shake correction method described later, the reference image Rw is used as an image from which deterioration due to camera shake has been removed in the camera shake correction processing. For this reason, the smaller the amount of blur in the element image to be selected as the reference image, the better.

続くステップS17において、手ぶれ補正部19は、補正対象画像Lwと参照画像Rwが同じであるか否かを判断し、両者が同じである場合は、手ぶれ補正を行うことなく図4の処理を終了する。   In subsequent step S17, the camera shake correction unit 19 determines whether or not the correction target image Lw and the reference image Rw are the same, and if both are the same, the process of FIG. 4 is terminated without performing the camera shake correction. To do.

補正対象画像Lwと参照画像Rwが同じでない場合は、ステップS17からステップS18に移行する。補正対象画像Lwと参照画像Rwが同じでない場合は、参照画像Rwに含まれるぶれは補正対象画像Lwにおけるそれよりも小さいことになる。即ち、参照画像Rwのぶれ量は補正対象画像Lwのぶれ量よりも小さい。そこで、ステップS18において、手ぶれ補正部19は、補正対象画像Lw及び参照画像Rwに基づいて補正対象画像Lwに対する手ぶれ補正を実施し、補正対象画像Lwにおけるぶれが低減された補正画像を生成してそれを補正画像Qwとしてメモリ上に記憶する(補正方法は第4実施例にて後述)。   When the correction target image Lw and the reference image Rw are not the same, the process proceeds from step S17 to step S18. When the correction target image Lw and the reference image Rw are not the same, the blur included in the reference image Rw is smaller than that in the correction target image Lw. That is, the blur amount of the reference image Rw is smaller than the blur amount of the correction target image Lw. Therefore, in step S18, the camera shake correction unit 19 performs camera shake correction on the correction target image Lw based on the correction target image Lw and the reference image Rw, and generates a correction image in which the blur in the correction target image Lw is reduced. This is stored in the memory as a corrected image Qw (a correction method will be described later in the fourth embodiment).

ステップS19において、補正画像Qwを表す画像データは、主制御部13を介して表示部15に出力され、表示部15の表示画面上に補正画像Qwが自動的に表示される。更に、主制御部13又は手ぶれ補正部19は、補正画像Qwを連写画像群(要素画像Cw1〜CwN)に関連付けるための関連付け情報を内部メモリ14又は記録媒体16に記録する。 In step S19, the image data representing the corrected image Qw is output to the display unit 15 via the main control unit 13, and the corrected image Qw is automatically displayed on the display screen of the display unit 15. Further, the main control unit 13 or the camera shake correction unit 19 records association information for associating the corrected image Qw with the continuous shot image group (element images Cw 1 to Cw N ) in the internal memory 14 or the recording medium 16.

要素画像Cw1〜CwNと補正画像Qwの各画像データは、記録媒体16に記録される。この時、補正対象画像Lwとして選択された要素画像を補正画像Qwにて上書き記録するようにしてもよい。即ち、要素画像Cw1〜CwNの中から1枚の要素画像が補正対象画像Lwとして選択されるが、その選択された要素画像を記録媒体16に記録することなく、代わりに補正画像Qwを記録媒体16に記録するようにしてもよい。 Each image data of the element images Cw 1 to Cw N and the corrected image Qw is recorded on the recording medium 16. At this time, the element image selected as the correction target image Lw may be overwritten and recorded with the correction image Qw. That is, one element image is selected as the correction target image Lw from the element images Cw 1 to Cw N , but the selected element image is not recorded on the recording medium 16, and instead the corrected image Qw is selected. You may make it record on the recording medium 16. FIG.

上述の如く処理することにより、手ぶれ補正がなされたベストショット画像をユーザに提供することが可能となる。また、連写画像群は連写撮影によって元々取得されるべき画像群であるので、手ぶれ補正用に別途の専用画像を取得する必要もない。故に、撮影時間やメモリ使用量に対する余分な負荷は発生しない。   By performing the processing as described above, it is possible to provide the user with the best shot image that has been subjected to camera shake correction. Further, since the continuous image group is an image group that should be originally acquired by continuous shooting, it is not necessary to acquire a separate dedicated image for camera shake correction. Therefore, there is no extra load on the shooting time and memory usage.

また、連写撮影後には、通常、最後に撮影された画像が表示画面に表示されるが、手ぶれ補正が行われた場合は、その補正直後に補正画像Qwが自動的に表示部15に表示される。これにより、連写撮影後、直ちに最も望ましい画像の確認が可能となり、ユーザにとって利便性が高い。   In addition, after continuous shooting, the last captured image is usually displayed on the display screen. However, when camera shake correction is performed, the corrected image Qw is automatically displayed on the display unit 15 immediately after the correction. Is done. This makes it possible to check the most desirable image immediately after continuous shooting, which is convenient for the user.

また、上述の如く、関連付け情報によって補正画像Qwと連写画像群は互いに関連付けられており、図1の操作部17(操作受付手段)は、関連付けられた画像に対する画像ファイル操作を受け付ける。画像ファイル操作がなされた時、主制御部13は、その画像ファイル操作に応じた処理を関連付けられた画像の全てに一括して適用する。画像ファイル操作は、記録媒体16に記録された画像の消去、複製、画像回転、画像サイズ変更、画像切り出し、プリンタによる印刷、ファイル名変更、フォルダ分類などを指示する操作である。例えば、消去を指示する画像ファイル操作がなされた時、補正画像Qwと連写画像群についての全画像データが一括して記録媒体16から消去される。このような画像ファイル操作を可能としておくことにより、ユーザの利便性が高まる。尚、操作部17に対する他の操作によって、補正画像Qwと要素画像Cw1〜CwNの夫々を個別に消去等することも可能となっている。 Further, as described above, the corrected image Qw and the continuous shot image group are associated with each other by the association information, and the operation unit 17 (operation reception unit) in FIG. 1 receives an image file operation on the associated image. When an image file operation is performed, the main control unit 13 collectively applies the process according to the image file operation to all the associated images. The image file operation is an operation for instructing deletion, duplication, image rotation, image size change, image cutout, printing by a printer, file name change, folder classification, and the like recorded on the recording medium 16. For example, when an image file operation for instructing deletion is performed, all the image data for the corrected image Qw and the continuous shot image group are deleted from the recording medium 16 at once. By making such an image file operation possible, user convenience is enhanced. Note that the correction image Qw and the element images Cw 1 to Cw N can be individually deleted by other operations on the operation unit 17.

<<第2実施例>>
次に、第2実施例を説明する。第2実施例では、連写画像群を形成する要素画像Cw1〜CwNの中から、ベストショット画像としての補正対象画像Lwを選択する方法を説明する。この選択処理は、図4のステップS15にて実行される。ユーザにとって好ましいシャッタタイミングや撮影条件による要素画像がベストショット画像として選択されるように、様々な観点から選択処理を行うことが可能である。以下に、第1〜第4のベストショット画像選択方法を含む、複数の選択方法を例示する。
<< Second Example >>
Next, a second embodiment will be described. In the second embodiment, a method for selecting the correction target image Lw as the best shot image from among the element images Cw 1 to Cw N forming the continuous shot image group will be described. This selection process is executed in step S15 of FIG. Selection processing can be performed from various viewpoints so that an element image based on shutter timing and photographing conditions preferable for the user is selected as the best shot image. Hereinafter, a plurality of selection methods including the first to fourth best shot image selection methods will be exemplified.

[第1のベストショット画像選択方法]
まず、第1のベストショット画像選択方法を説明する。被写体としての人物の顔が撮像装置1に対して正面を向いている方が写真として好ましい場合が多い。そこで、第1のベストショット画像選択方法では、要素画像ごとに要素画像内に現れている人物の顔向きを検出し、全要素画像の内、最も顔が撮像装置1に対して正面を向いている要素画像を、ベストショット画像として選択する。顔が撮像装置1に対して正面を向いている度合いを、便宜上、顔向き正面度合いと呼ぶ。顔向き正面度合いが大きいほど、撮像装置1に対する顔の向きがより正面を向いているものとする。
[First best shot image selection method]
First, the first best shot image selection method will be described. In many cases, it is preferable that a person's face as a subject is facing the front of the imaging apparatus 1 as a photograph. Therefore, in the first best shot image selection method, the face orientation of a person appearing in the element image is detected for each element image, and the most face of all the element images faces the front with respect to the imaging device 1. Is selected as the best shot image. The degree to which the face is facing the front with respect to the imaging device 1 is referred to as the face-facing front degree for convenience. It is assumed that the greater the degree of front facing the face, the more the face is facing the imaging device 1.

画像中の人物の顔を検出する方法及び人物の顔向きを検出する方法は公知であり、任意の公知方法を適用可能である。例えば、特開平10−307923号公報に記載された方法を用いればよい。1つの要素画像200を示す図5を参照して具体的方法を例示する。例えば、公知方法を用いて、要素画像200内における人物の顔201を検出すると共にその顔201の部品(眉、眼、鼻及び口など)を検出する。次に、顔201の両眼の外側に位置する2つの端点211及び221の要素画像上における各位置と、顔201の口の両端点231及び232を結ぶ線分の中点233の要素画像上における位置を求める(尚、端点211及び221は左眼の左端及び右眼の右端に位置し、両端点231及び232は口の長手方向の両端に位置する)。続いて、3つの点211、221及び233を頂点とする三角形の、要素画像上の面積を求める。そして、求めた面積が大きいほど、顔向き正面度合いが高いと判断する。   A method for detecting the face of a person in the image and a method for detecting the face direction of the person are known, and any known method can be applied. For example, a method described in JP-A-10-307923 may be used. A specific method is illustrated with reference to FIG. 5 showing one element image 200. For example, using a known method, a face 201 of a person in the element image 200 is detected and parts of the face 201 (eyebrows, eyes, nose, mouth, etc.) are detected. Next, on the element image of the midpoint 233 of the line segment connecting each position on the element image of the two end points 211 and 221 located outside both eyes of the face 201 and both end points 231 and 232 of the mouth of the face 201 The end points 211 and 221 are located at the left end of the left eye and the right end of the right eye, and the end points 231 and 232 are located at both ends in the longitudinal direction of the mouth. Subsequently, the area on the element image of a triangle having three points 211, 221 and 233 as vertices is obtained. Then, the larger the obtained area, the higher the degree of front facing the face.

[第2のベストショット画像選択方法]
次に、第2のベストショット画像選択方法を説明する。被写体としての人物の開眼度合いが大きい方が写真として好ましい場合が多い。そこで、第2のベストショット画像選択方法では、要素画像ごとに要素画像内に現れている人物の開眼度合いを検出し、全要素画像の内、最も開眼度合いが高い要素画像を、ベストショット画像として選択する。開眼度合いとは、要素画像内における人物の眼の開き度合いを意味し、眼がより大きく開かれているほど、開眼度合いは大きい。
[Second best shot image selection method]
Next, a second best shot image selection method will be described. It is often preferable for a photograph that the degree of eye opening of a person as a subject is large. Therefore, in the second best shot image selection method, the eye opening degree of the person appearing in the element image is detected for each element image, and the element image having the highest eye opening degree is selected as the best shot image among all the element images. select. The degree of eye opening means the degree of eye opening of a person in the element image, and the degree of eye opening is larger as the eye is opened more widely.

開眼度合いは、例えば、上瞼の凸方向における曲率から推定することができる。図6を参照して具体的方法を例示する。図6は、図5に示す要素画像200内の顔201の眼付近の拡大図である。まず、上述の公知方法を用いて顔201の部品である眼を要素画像200内から検出した後、両眼の夫々に対して、眼の左右の端点を検出する。一方の眼における左右の端点を符号211及び212によって参照し、他方の眼における左右の端点を符号221及び222によって参照する。次に、要素画像200内の顔201の眼付近における一部画像に対してエッジ検出処理を行う。そうすると、両眼の各上瞼の端に沿って、強いエッジ強度を有するエッジ点群が検出される。そこで、一方の眼に着目し、その眼の両端点211及び212と、両端点211及び212の中央付近に位置するエッジ点群中の任意点213と、の3点に対して放物線フィッティングを行い、その3点に対する曲率を求める。これを、エッジ点郡中の複数点に対して繰り返し行う。また、他方の眼に対しても同様に曲率を求める。そして、このようにして求められた複数の曲率の平均曲率を算出し、この平均曲率が上瞼の凸方向に大きいほど、開眼度合いが高いと推定する。   The degree of eye opening can be estimated from the curvature in the convex direction of the upper eyelid, for example. A specific method is illustrated with reference to FIG. FIG. 6 is an enlarged view near the eyes of the face 201 in the element image 200 shown in FIG. First, the eye which is a part of the face 201 is detected from the element image 200 using the above-described known method, and then the left and right end points of the eyes are detected for each of both eyes. The left and right end points in one eye are referred to by reference numerals 211 and 212, and the left and right end points in the other eye are referred to by reference numerals 221 and 222. Next, edge detection processing is performed on a partial image near the eyes of the face 201 in the element image 200. Then, an edge point group having strong edge strength is detected along the edge of each upper eyelid of both eyes. Therefore, paying attention to one eye, a parabola fitting is performed on three points of the two end points 211 and 212 of the eye and an arbitrary point 213 in the edge point group located near the center of the two end points 211 and 212. The curvature for the three points is obtained. This is repeated for a plurality of points in the edge point group. Further, the curvature is similarly obtained for the other eye. And the average curvature of the some curvature calculated | required in this way is calculated, and it is estimated that the degree of eye opening is so high that this average curvature is large in the convex direction of the upper eyelid.

これに代えて例えば、要素画像200内に現れている、顔201の黒目の面積(要素画像上の面積)から開眼度合いを推定することも可能である。   Instead of this, for example, it is also possible to estimate the degree of eye opening from the black eye area (area on the element image) of the face 201 appearing in the element image 200.

[第3のベストショット画像選択方法]
次に、第3のベストショット画像選択方法を説明する。被写体としての人物の表情が良い方が写真として好ましい場合が多い。そこで、第3のベストショット画像選択方法では、要素画像ごとに要素画像内に現れている人物の表情を検出し、全要素画像の内、最も表情が良い要素画像を、ベストショット画像として選択する。例えば、人物の表情の良し悪し表す指標として顔の笑顔度合いを検出するようにし、笑顔度合いが最も高い要素画像をベストショット画像として選択する。この場合、要素画像内の顔がより笑っている顔だと判断されるほど、笑顔度合いが高くなって、より表情が良いと判断される。
[Third best shot image selection method]
Next, a third best shot image selection method will be described. In many cases, it is preferable for a photograph to have a better expression of a person as a subject. Therefore, in the third best shot image selection method, the facial expression of the person appearing in the element image is detected for each element image, and the element image having the best expression among all the element images is selected as the best shot image. . For example, the smile level of the face is detected as an index representing the quality of the person's facial expression, and the element image having the highest smile level is selected as the best shot image. In this case, as the face in the element image is determined to be a laughing face, the degree of smile increases and the expression is determined to be better.

笑顔度合いを検出する方法は公知であり、任意の公知方法を適用可能である。例えば、特開2005−56388号公報に記載された方法を用いればよい。この場合、要素画像内に含まれる顔の所定部位群の夫々について特徴量を求めると共に所定の表情の顔(今の例において、笑顔)を含む画像における当該顔の所定部位群の夫々について特徴量を求め、求めた両特徴量間の差分に基づいて所定部位群の夫々に対して得点を計算し、所定部位群の夫々に対して計算した得点の分布に基づいて要素画像内に含まれる顔の笑顔度合いを求める。   A method for detecting the smile level is known, and any known method can be applied. For example, a method described in JP-A-2005-56388 may be used. In this case, the feature amount is obtained for each of the predetermined portion group of the face included in the element image, and the feature amount is obtained for each of the predetermined portion group of the face in the image including the face having a predetermined expression (in this example, a smile). A face is included in the element image based on the distribution of the points calculated for each of the predetermined part groups. Find the degree of smile.

これに代えて例えば、要素画像内に現れている歯の面積(要素画像上の面積)から顔の笑顔度合いを推定することも可能である。この場合、要素画像中の顔の全体面積に対する歯の面積の比が大きいほど、笑顔度合いが高いと推定する。或いは、要素画像内における顔の開口度合い(口の開き度合い)から顔の笑顔度合いを推定することも可能である。この場合、要素画像中の顔の全体面積に対する口の面積の比が大きいほど、笑顔度合いが高いと推定する。或いは、要素画像内における顔の頬筋の曲率から顔の笑顔度合いを推定することも可能である。この場合、要素画像内における顔の頬筋の曲率が大きいほど、笑顔度合いが高いと推定する。   Instead of this, for example, the degree of smile of the face can be estimated from the area of the teeth appearing in the element image (area on the element image). In this case, it is estimated that the smile degree is higher as the ratio of the tooth area to the entire face area in the element image is larger. Alternatively, it is also possible to estimate the degree of smile of the face from the degree of opening of the face (degree of opening of the mouth) in the element image. In this case, it is estimated that the larger the ratio of the mouth area to the entire face area in the element image, the higher the smile degree. Alternatively, it is possible to estimate the smile level of the face from the curvature of the cheek muscles of the face in the element image. In this case, it is estimated that the higher the curvature of the facial cheek muscles in the element image, the higher the smile degree.

[第4のベストショット画像選択方法]
次に、第4のベストショット画像選択方法を説明する。第4のベストショット画像選択方法では、要素画像ごとに撮影の構図の良し悪しを評価し、最も構図が良いと評価される要素画像をベストショット画像として選択する。構図の良し悪しを表す指標として、構図良好度合いを定義する。構図良好度合いが大きいほど、構図が良いと判断されることとする。
[Fourth best shot image selection method]
Next, a fourth best shot image selection method will be described. In the fourth best shot image selection method, the quality of the photographic composition is evaluated for each element image, and the element image evaluated as having the best composition is selected as the best shot image. A good degree of composition is defined as an index representing the quality of composition. It is determined that the better the composition is, the better the composition is.

人物を撮影する際、頭部が撮影範囲の上下(即ち、撮影画像の全体領域中の上端又は下端)に偏った構図は好ましくないことが多い。しかし、撮影時における被写体の動きや手ぶれに由来して、このような好ましくない構図となってしまうこともある。そこで、まず、操作部17に対する操作によって、予め撮影者が好みの頭部の中心位置及び大きさを設定しておく。ここにおける中心位置及び大きさは、撮影画像上における頭部の中心位置及び大きさである。次に、上述したような公知の顔検出処理によって、要素画像内における人物の頭部の中心位置及び大きさを検出する。そして、この検出された中心位置及び大きさが設定された中心位置及び大きさに近いほど、構図良好度合いが大きいと判断するようにする。   When photographing a person, a composition in which the head is biased above and below the photographing range (that is, the upper end or the lower end in the entire region of the photographed image) is often not preferable. However, there may be such an unfavorable composition due to the movement of the subject and camera shake at the time of shooting. Therefore, first, the photographer sets the preferred center position and size of the head in advance by operating the operation unit 17. The center position and size here are the center position and size of the head on the captured image. Next, the center position and size of the person's head in the element image are detected by the known face detection process as described above. Then, it is determined that the better the composition is, the closer the detected center position and size are to the set center position and size.

上記の如く中心位置や大きさに対する設定操作を省略することも可能である。例えば、図7に示す如く、要素画像250内における頭部の上端251と要素画像250自体の上端252との距離D253を検出する。距離D253は、要素画像250上における距離である。一方で、この距離の最適距離を予めメモリ上に保持しておき、検出された距離D253が最適距離に近いほど、構図良好度合いが大きいと判断するようにしてもよい。 As described above, the setting operation for the center position and size can be omitted. For example, as shown in FIG. 7, a distance D 253 between the upper end 251 of the head in the element image 250 and the upper end 252 of the element image 250 itself is detected. A distance D 253 is a distance on the element image 250. On the other hand, the optimum distance of this distance may be stored in advance in the memory, and it may be determined that the better the composition is, the closer the detected distance D 253 is to the optimum distance.

上述の第1〜第4のベストショット画像選択方法を用いてベストショット画像を自動選択することにより、ユーザが連写画像群から好ましい画像を選択する手間が省ける。   By automatically selecting the best shot image using the first to fourth best shot image selection methods described above, it is possible to save the user from having to select a preferable image from the group of continuously shot images.

但し、第1〜第4のベストショット画像選択方法に頼ることなく、ユーザの選択指示に基づいて要素画像Cw1〜CwNの中からベストショット画像を選択することも可能である。この場合、要素画像Cw1〜CwNの取得後、要素画像Cw1〜CwNを表示部15に表示し、ユーザの選択指示を仰ぐ。ユーザによるベストショット画像の選択指示は、図1の操作部17に対して行うことができる。 However, it is also possible to select the best shot image from the element images Cw 1 to Cw N based on the user's selection instruction without depending on the first to fourth best shot image selection methods. In this case, after the acquisition of the element image Cw 1 ~Cw N, to display the elemental images Cw 1 ~Cw N on the display unit 15, seek user selection instruction. The user can instruct the selection of the best shot image to the operation unit 17 in FIG.

或いは、第1〜第4のベストショット画像選択方法の内の何れか1つを用いて要素画像Cw1〜CwNの中からベストショット画像の候補をM個選択し、選択したM個の候補の中から1つのベストショット画像をユーザの選択指示に従って選択するようにしてもよい(Mは2以上の整数であって、N>M)。つまり、ベストショット画像の候補をM個に絞り込んだ上で、ユーザに最終的に選択させる。この場合は、絞り込こまれた、ベストショット画像の候補としてのM個の要素画像を表示部15に表示し、そのM個の要素画像から1つのベストショット画像を選択するためのユーザによる選択指示を仰ぐ。例えば、第1のベストショット画像選択方法を用いる場合は、顔向き正面度合いが1〜M番目に大きいM個の要素画像をベストショット画像の候補とすればよい。同様に、第2、第3、又は、第4のベストショット画像選択方法を用いる場合は、顔向き正面度合いではなく、夫々、開眼度合い、笑顔度合い、又は、構図良好度合いが1〜M番目に大きいM個の要素画像をベストショット画像の候補とすればよい。 Alternatively, M candidates of best shot images are selected from the element images Cw 1 to Cw N using any one of the first to fourth best shot image selection methods, and the selected M candidates One best shot image may be selected according to the user's selection instruction (M is an integer equal to or greater than 2 and N> M). That is, the user is finally selected after narrowing down the best shot image candidates to M. In this case, the narrowed down M element images as candidates for the best shot image are displayed on the display unit 15, and selection by the user for selecting one best shot image from the M element images Ask for instructions. For example, when the first best shot image selection method is used, M element images having a face-facing front degree of 1st to Mth may be used as best shot image candidates. Similarly, when the second, third, or fourth best shot image selection method is used, the degree of eye opening, the degree of smile, or the degree of composition goodness is 1 to Mth, not the degree of front facing the face. Large M element images may be used as best shot image candidates.

また、上述した第1〜第4のベストショット画像選択方法の内の2つ、3つ又は4つを組み合わせて用いることも可能である。この場合例えば、要素画像ごとに、顔向き正面度合いを表す値、開眼度合いを表す値、笑顔度合いを表す値及び構図良好度合いを表す値の内の、2以上の値の加重加算値を算出する。そして、最大の加重加算値に対応する要素画像をベストショット画像として選択する。これとユーザによる選択指示を組み合わせることも可能である。即ち、加重加算値が1〜M番目に大きいM個の要素画像をベストショット画像の候補として選択して表示し、選択したM個の候補の中から1つのベストショット画像をユーザの選択指示に従って選択するようにしてもよい。   Also, two, three, or four of the first to fourth best shot image selection methods described above can be used in combination. In this case, for example, for each element image, a weighted addition value of two or more values is calculated among a value representing the degree of front facing the face, a value representing the degree of eye opening, a value representing the degree of smile, and a value representing the degree of good composition. . Then, the element image corresponding to the maximum weighted addition value is selected as the best shot image. It is also possible to combine this with a selection instruction by the user. That is, M element images having the first to Mth weighted addition values are selected and displayed as best shot image candidates, and one best shot image is selected from the selected M candidates according to a user's selection instruction. You may make it select.

<<第3実施例>>
次に、第3実施例を説明する。第3実施例では、連写画像群を形成する要素画像Cw1〜CwNの中から参照画像Rwを選択する方法を説明する。この選択処理は、図4のステップS16にて実行される。以下に、第1〜第4の参照画像選択方法を含む、複数の選択方法を例示する。
<< Third Example >>
Next, a third embodiment will be described. In the third embodiment, a method of selecting the reference image Rw from the element images Cw 1 to Cw N forming the continuous shot image group will be described. This selection process is executed in step S16 of FIG. Hereinafter, a plurality of selection methods including the first to fourth reference image selection methods will be exemplified.

[第1の参照画像選択方法]
まず、第1の参照画像選択方法について説明する。第1の参照画像選択方法では、画像のエッジ強度に基づいて参照画像Rwを選択する。具体的な選択動作の流れを、図8及び図9を参照して説明する。図8は、第1の参照画像選択方法に関する動作の流れを表すフローチャートである。図9は、この動作に利用される画像などの関係を示す図である。
[First Reference Image Selection Method]
First, the first reference image selection method will be described. In the first reference image selection method, the reference image Rw is selected based on the edge strength of the image. A specific flow of the selection operation will be described with reference to FIGS. FIG. 8 is a flowchart showing the flow of operations related to the first reference image selection method. FIG. 9 is a diagram showing the relationship of images used for this operation.

まず、ステップS31において、1〜Nの間の各整数値を取りうる変数iを導入し、変数iに初期値として1を代入する。続くステップS32において、現在、変数iが1であるか否かを判別し、i=1である場合はステップS33に移行する一方、i≠1である場合はステップS34に移行する。ステップS33では、要素画像Cwiの中央又は中央付近に位置する小領域を抽出し、この小領域内の画像を小画像Csiとする。抽出される小領域を、例えば、128×128画素の小領域とする。i=1である場合にのみステップS33に至るのであるから、ステップS33では、連写画像群を形成する1番目の要素画像Cw1から小画像Cs1が抽出されることになる。 First, in step S31, a variable i that can take each integer value between 1 and N is introduced, and 1 is substituted into the variable i as an initial value. In subsequent step S32, it is determined whether or not the variable i is currently 1. If i = 1, the process proceeds to step S33, whereas if i ≠ 1, the process proceeds to step S34. In step S33, it extracts the central or small region located near the center of the element images Cw i, the image of the small area as the small image Cs i. The extracted small area is, for example, a small area of 128 × 128 pixels. i = only since it is the processing leads to the step S33 if 1 is, in step S33, so that the small image Cs 1 is extracted from the first element image Cw 1 to form a continuous image group.

ステップS33の処理の後、ステップS35に移行する。ステップS35では、小画像Csiに対してエッジ抽出処理を施し、小画像Esiを得る。例えば、小画像Csiの各画素に対して任意のエッジ検出オペレータを適用することにより小画像Csiのエッジ抽出画像を生成し、このエッジ抽出画像を小画像Esiとする。その後、ステップS36において、小画像Esiの画素値の総和を算出し、その総和を評価値Kaiとする。ステップS36の処理の後、ステップS37において、変数iがNと等しいか否かが判断される。 After step S33, the process proceeds to step S35. In step S35, subjected to edge extraction processing for the small image Cs i, obtaining the small image Es i. For example, to generate an edge extracted image of the small image Cs i by applying any edge detection operator to each pixel of the small image Cs i, to the edge extraction image and the small image Es i. Thereafter, in step S36, the sum of the pixel values of the small image Es i is calculated, and the sum is taken as an evaluation value Ka i . After step S36, it is determined in step S37 whether the variable i is equal to N or not.

ステップS37において、i≠Nである場合はステップS38にて変数iに1を加えてからステップS32に戻る。この場合、ステップS32において、i≠1となるのでステップS32からステップS34に移行する。ステップS34では、要素画像Cw1から抽出された小領域に対応する小領域を要素画像Cwi(≠Cw1)から抽出し、要素画像Cwiから抽出された小領域内の画像を小画像Csiとする。対応小領域の探索は、テンプレートマッチング法などを利用した画像処理によって行う。即ち例えば、要素画像Cw1から抽出された小画像Cs1をテンプレートとし、周知のテンプレートマッチング法を用いて、そのテンプレートとの類似度が最も高い小領域を要素画像Cwi内から探索し、探索された小領域内の画像を小画像Csiとする。ステップS34にて小画像Csiが抽出された後は、その小画像Csiに対してステップS35及びS36の各処理が実施される。 If i ≠ N in step S37, 1 is added to variable i in step S38, and the process returns to step S32. In this case, since i ≠ 1 in step S32, the process proceeds from step S32 to step S34. In step S34, a small area corresponding to the small area extracted from the element image Cw 1 is extracted from the element image Cw i (≠ Cw 1 ), and an image in the small area extracted from the element image Cw i is extracted from the small image Cs. i . The search for the corresponding small area is performed by image processing using a template matching method or the like. Specifically, for example, the small image Cs 1 extracted from the element image Cw 1 as a template, using a known template matching method, and searches for a small area most similar to the template from the element image Cw i, the search the image in the small area and the small image Cs i. After the small image Cs i is extracted in step S34, the processes of steps S35 and S36 are performed on the small image Cs i .

変数i=1、2、・・・Nの夫々に対してステップS36の処理を実行し、N個の評価値Ka1〜KaNが算出されると、ステップS37においてi=Nが成立し、図8の処理を終える。上述の処理内容から明らかなように、評価値Kaiは小画像Csiのエッジ強度の増大に伴って増加する。 When the process of step S36 is performed for each of the variables i = 1, 2,... N and N evaluation values Ka 1 to Ka N are calculated, i = N is established in step S37. The process of FIG. 8 ends. As is clear from the above processing contents, the evaluation value Ka i increases as the edge strength of the small image Cs i increases.

同じ構図の画像であれば、露光期間中に生じた手ぶれが小さいほどエッジは鮮明となり、画像中のエッジ強度は高くなる。また、手ぶれは画像全体に対して一様な劣化を与えるため、要素画像Cwiの全体におけるエッジ強度は、小画像Csiにおけるエッジ強度に応じたものとなる。従って、上記の評価値Kaiが大きいほど、それに対応する小画像Csi及び要素画像Cwiのぶれ量は小さいと推定できる。参照画像として選択されるべき要素画像のぶれ量は小さければ小さいほど望ましいので、要素画像Cw1〜CwNの内、最大の評価値に対応する画像を参照画像Rwとして選択する。例えば、評価値Ka1〜KaNの内、評価値KaN-1が最大であるのであれば、要素画像CwN-1を参照画像Rwとして選択する。 If the images have the same composition, the smaller the camera shake during the exposure period, the clearer the edge and the higher the edge strength in the image. Moreover, since motion blur uniformly deteriorated on the entire image, the edge intensity in the entire element image Cw i is a one corresponding to the edge intensity in the small image Cs i. Therefore, it can be estimated that the larger the evaluation value Ka i is, the smaller the amount of shake of the corresponding small image Cs i and element image Cw i is. Since the amount of blurring of the element image to be selected as the reference image is preferably as small as possible, the image corresponding to the maximum evaluation value is selected as the reference image Rw among the element images Cw 1 to Cw N. For example, among the evaluation values Ka 1 ~Ka N, evaluation value Ka N-1 is equal to the maximum, selects the element image Cw N-1 as a reference image Rw.

一般に、1枚の画像から該画像のぶれ量を求めるためには、特開平11−27574号公報に記載されているように、画像をフーリエ変換して周波数空間上の変換画像を生成し、手ぶれにより減衰する周波数の間隔を計測するなど、計算コストの大きな処理が必要である。計算コストとは、計算による負荷を意味し、計算コストの増大は処理時間及び消費電力を増大させる。これに対し、本選択方法では、エッジ強度とぶれ量の関係を利用してエッジ強度からぶれ量を推定することとしている。このため、フーリエ変換などを利用する従来手法と比べて、ぶれ量を推定するための計算コストを小さくすることができる。また、画像全体でなく、抽出された小画像に着目して評価値を算出することにより、計算コストの更なる低減効果が得られる。加えて、テンプレートマッチングなどを用い対応小領域間で評価値を比較するようにしているため、連写撮影中に構図の変化があったとしても、その変化による影響は軽微である。   In general, in order to obtain the blur amount of an image from one image, as described in Japanese Patent Application Laid-Open No. 11-27574, a Fourier transform is performed on the image to generate a converted image on the frequency space, and a camera shake is caused. Therefore, processing with a large calculation cost is required, such as measuring the frequency interval of attenuation. The calculation cost means a load due to calculation, and an increase in calculation cost increases processing time and power consumption. On the other hand, in this selection method, the blur amount is estimated from the edge strength using the relationship between the edge strength and the blur amount. For this reason, compared with the conventional method using a Fourier transform etc., the calculation cost for estimating the amount of blurring can be made small. Further, by calculating the evaluation value by focusing on the extracted small image instead of the entire image, an effect of further reducing the calculation cost can be obtained. In addition, since evaluation values are compared between corresponding small regions using template matching or the like, even if there is a change in composition during continuous shooting, the effect of the change is negligible.

[第2の参照画像選択方法]
次に、第2の参照画像選択方法について説明する。第2の参照画像選択方法では、画像のコントラストに基づいて参照画像Rwを選択する。具体的な選択動作の流れを、図10を参照して説明する。図10は、第2の参照画像選択方法に関する動作の流れを表すフローチャートである。
[Second Reference Image Selection Method]
Next, the second reference image selection method will be described. In the second reference image selection method, the reference image Rw is selected based on the contrast of the image. A specific flow of the selection operation will be described with reference to FIG. FIG. 10 is a flowchart showing an operation flow related to the second reference image selection method.

図10におけるステップS41〜S44、S47及びS48の各処理内容は、夫々、図8におけるステップS31〜S34、S37及びS38の各処理内容と同じであるため、それらの重複する説明を割愛する。但し、第2の参照画像選択方法では、ステップ43又はS44の処理の後、ステップS45に移行し、ステップS45及びS46の各処理を経てからステップS47に至るものとする。   Since the processing contents of steps S41 to S44, S47, and S48 in FIG. 10 are the same as the processing contents of steps S31 to S34, S37, and S38 in FIG. 8, respectively, their overlapping descriptions are omitted. However, in the second reference image selection method, after step 43 or S44, the process proceeds to step S45, and after steps S45 and S46, the process proceeds to step S47.

ステップS45では、小画像Csiの各画素の輝度信号を抽出する。勿論、例えば、i=1の時は、小画像Cs1の各画素の輝度信号が抽出され、i=2の時は、小画像Cs2の各画素の輝度信号が抽出される。そして、ステップS46において、小画像Csiの輝度値(即ち、輝度信号の値)のヒストグラムを生成し、そのヒストグラムの分散を算出して該分散を評価値Kbiとする。この後、ステップS47に移行する。変数i=1、2、・・・Nの夫々に対してステップS46の処理を実行し、N個の評価値Kb1〜KbNが算出されると、ステップS47においてi=Nが成立し、図10の処理を終える。 In step S45, it extracts a luminance signal of each pixel of the small image Cs i. Of course, for example, when i = 1, the luminance signal of each pixel of the small image Cs 1 is extracted, and when i = 2, the luminance signal of each pixel of the small image Cs 2 is extracted. In step S46, a histogram of the luminance value (that is, the value of the luminance signal) of the small image Cs i is generated, the variance of the histogram is calculated, and the variance is set as the evaluation value Kb i . Thereafter, the process proceeds to step S47. When the process of step S46 is executed for each of the variables i = 1, 2,... N and N evaluation values Kb 1 to Kb N are calculated, i = N is established in step S47. The process of FIG. 10 is finished.

同じ構図の画像であれば、露光期間中に生じた手ぶれが大きいほど隣接画素間の輝度が平滑化され、中間階調の画素の割合が増加して輝度値のヒストグラムにおける分布が中間階調に集中化する。上記の平滑化の程度が大きいほどヒストグラムにおける分散が小さくなって評価値Kbiが小さくなるため、評価値Kbiが大きいほど、それに対応する小画像Csi及び要素画像Cwiのぶれ量は小さいと推定できる。参照画像として選択されるべき要素画像のぶれ量は小さければ小さいほど望ましいので、要素画像Cw1〜CwNの内、最大の評価値に対応する要素画像を参照画像Rwとして選択する。例えば、評価値Kb1〜KbNの内、評価値KbN-1が最大であるのであれば、要素画像CwN-1を参照画像Rwとして選択する。 For images with the same composition, the greater the camera shake that occurs during the exposure period, the smoother the luminance between adjacent pixels, and the proportion of pixels in the intermediate gradation increases, and the distribution of luminance values in the histogram becomes intermediate gradation. Centralize. The greater the degree of smoothing, the smaller the variance in the histogram and the smaller the evaluation value Kb i , so the larger the evaluation value Kb i , the smaller the amount of blurring of the corresponding small image Cs i and element image Cw i. Can be estimated. Since the amount of blurring of the element image to be selected as the reference image is preferably as small as possible, the element image corresponding to the maximum evaluation value is selected as the reference image Rw among the element images Cw 1 to Cw N. For example, among the evaluation values Kb 1 ~Kb N, evaluation value Kb N-1 is equal to the maximum, selects the element image Cw N-1 as a reference image Rw.

連写画像群を形成する要素画像の例として、図11(a)に要素画像261を示すと共に図11(b)に要素画像262を示す。要素画像261は鮮明な画像である一方、要素画像262の露光期間中に大きな手ぶれが生じたことにより、要素画像262には大きなぶれが含まれている。また、図12(a)及び(b)に、夫々、要素画像261及び262に対してステップS46にて生成されたヒストグラムを示す。要素画像261のヒストグラムとの対比おいて(図12(a)参照)、要素画像262のヒストグラム(図12(b)参照)では中間階調への分布の集中化が見られる。この集中化によって、分散(及び標準偏差)は小さくなる。   As an example of an element image that forms a continuous image group, an element image 261 is shown in FIG. 11A and an element image 262 is shown in FIG. While the element image 261 is a clear image, the element image 262 includes a large amount of shake due to a large amount of camera shake during the exposure period of the element image 262. FIGS. 12A and 12B show the histograms generated in step S46 for the element images 261 and 262, respectively. In contrast to the histogram of the element image 261 (see FIG. 12A), the histogram of the element image 262 (see FIG. 12B) shows a concentration of distribution to the intermediate gradation. This concentration reduces the variance (and standard deviation).

或る着目画像に関して、ヒストグラムにおける分散が小さいことは該着目画像のコントラストが低いことに対応し、ヒストグラムにおける分散が大きいことは該着目画像のコントラストが高いことに対応している。従って、上述の方法では、ヒストグラムにおける分散を算出することによって着目画像のコントラストを推定し、その推定したコントラストによって着目画像のぶれ量を推定していることになる。そして、コントラストの推定値が評価値Kbiとして導出される。 For a certain image of interest, a small variance in the histogram corresponds to a low contrast of the image of interest, and a large variance in the histogram corresponds to a high contrast of the image of interest. Therefore, in the above-described method, the contrast of the target image is estimated by calculating the variance in the histogram, and the blur amount of the target image is estimated based on the estimated contrast. Then, the estimated contrast value is derived as the evaluation value Kb i .

本選択方法では、コントラストとぶれ量の関係を利用してコントラストからぶれ量を推定することとしている。このため、フーリエ変換などを利用する従来手法と比べて、ぶれ量を推定するための計算コストを小さくすることができる。また、画像全体でなく、抽出された小画像に着目して評価値を算出することにより、計算コストの更なる低減効果が得られる。加えて、テンプレートマッチングなどを用い対応小領域間で評価値を比較するようにしているため、連写撮影中に構図の変化があったとしても、その変化による影響は軽微である。   In this selection method, the blur amount is estimated from the contrast using the relationship between the contrast and the blur amount. For this reason, compared with the conventional method using a Fourier transform etc., the calculation cost for estimating the amount of blurring can be made small. Further, by calculating the evaluation value by focusing on the extracted small image instead of the entire image, an effect of further reducing the calculation cost can be obtained. In addition, since evaluation values are compared between corresponding small regions using template matching or the like, even if there is a change in composition during continuous shooting, the effect of the change is negligible.

[第3の参照画像選択方法]
次に、第3の参照画像選択方法について説明する。第3の参照画像選択方法では、連写画像群を形成する要素画像Cw1〜CwNの内、補正対象画像Lwとして選択された要素画像を除く(N−1)枚の要素画像を参照画像Rwの候補として取り扱う。参照画像Rwの候補として取り扱われる要素画像を「候補画像」とも呼ぶ。そして、補正対象画像Lwに対する各候補画像の夫々の回転角を求め、求めた各回転角を用いて参照画像Rwの選択を行う。
[Third Reference Image Selection Method]
Next, a third reference image selection method will be described. In the third reference image selection method, (N−1) element images excluding the element image selected as the correction target image Lw from the element images Cw 1 to Cw N forming the continuous shot image group are used as reference images. Treat as a candidate for Rw. Element images that are handled as candidates for the reference image Rw are also referred to as “candidate images”. Then, each rotation angle of each candidate image with respect to the correction target image Lw is obtained, and the reference image Rw is selected using each obtained rotation angle.

図13を参照して、より具体的に本選択方法を説明する。今、要素画像CwNが補正対象画像Lwとして選択された場合を想定する。この場合、要素画像Cw1〜CwN-1の夫々が候補画像とされる。 This selection method will be described more specifically with reference to FIG. Now, it is assumed that the element image Cw N are selected as the correction target image Lw. In this case, each of the element images Cw 1 to Cw N−1 is set as a candidate image.

まず、補正対象画像Lwの中から特徴的な小領域を複数個抽出する。特徴的な小領域とは、抽出元画像の中でエッジ成分が比較的多い(換言すれば、コントラストが比較的強い)矩形領域のことを指し、例えば、ハリス(Harris)のコーナ検出器を用いて抽出される。特徴的な小領域は、抽出元画像の中でエッジ成分が比較的多い(換言すれば、コントラストが比較的強い)矩形領域のことを指し、例えば、特徴的な絵柄を含む領域である。特徴的な絵柄とは、例えば、物体の角部のような2方向以上に輝度変化を有し、その輝度変化に基づき画像処理によって該絵柄の位置(画像上の位置)を容易に検出できるような絵柄を意味する。ここでは、32×32画素の小領域を特徴的な小領域として、複数個、抽出する。図13に示す如く、補正対象画像Lw(今の想定下において、要素画像CwN)から2つの小領域281及び282が抽出されたとする。小領域281及び282の中心点を、夫々、符号291及び292によって参照する。図13に示す例では、中心点291及び292を結ぶ線分の方向が補正対象画像Lwの水平方向と合致している。 First, a plurality of characteristic small regions are extracted from the correction target image Lw. A characteristic small area refers to a rectangular area that has a relatively large number of edge components (in other words, a relatively strong contrast) in the source image. For example, a Harris corner detector is used. Extracted. A characteristic small area refers to a rectangular area having a relatively large number of edge components (in other words, a relatively strong contrast) in the extraction source image, and is an area including a characteristic pattern, for example. A characteristic pattern has, for example, a luminance change in two or more directions such as a corner of an object, and the position of the pattern (position on the image) can be easily detected by image processing based on the luminance change. Meaning a simple pattern. Here, a plurality of small areas of 32 × 32 pixels are extracted as characteristic small areas. As shown in FIG. 13, it is assumed that two small regions 281 and 282 are extracted from the correction target image Lw (the element image Cw N under the current assumption). The center points of the small areas 281 and 282 are referred to by reference numerals 291 and 292, respectively. In the example shown in FIG. 13, the direction of the line segment connecting the center points 291 and 292 matches the horizontal direction of the correction target image Lw.

次に、補正対象画像Lwから抽出された2つの小領域281及び282に対応する2つの小領域を、候補画像の夫々から抽出する。対応小領域の探索は、テンプレートマッチング法などを利用し、上述した手法を用いて行えば良い(第1の参照画像選択方法の説明文参照)。図13には、候補画像としての要素画像Cw1から抽出された2つの小領域281a及び282a、並びに、候補画像としての要素画像Cw2から抽出された2つの小領域281b及び282bが示されている。小領域281a及び281bが小領域281に対応し、小領域282a及び282bが小領域282に対応している。また、小領域281a、282a、281b及び282bの中心点を、夫々、符号291a、292a、291b及び292bによって参照する。 Next, two small regions corresponding to the two small regions 281 and 282 extracted from the correction target image Lw are extracted from each of the candidate images. The search for the corresponding small region may be performed using the above-described method using a template matching method or the like (see the description of the first reference image selection method). FIG. 13 shows two small areas 281 a and 282 a extracted from the element image Cw 1 as the candidate image, and two small areas 281 b and 282 b extracted from the element image Cw 2 as the candidate image. Yes. The small areas 281 a and 281 b correspond to the small area 281, and the small areas 282 a and 282 b correspond to the small area 282. Further, the center points of the small regions 281a, 282a, 281b, and 282b are referred to by reference numerals 291a, 292a, 291b, and 292b, respectively.

この後、要素画像Cw1に着目し、中心点291及び292を結ぶ線分に対する、中心点291a及び292aを結ぶ線分の回転角(即ち、傾き)θ1を求める。同様に、要素画像Cw2に着目し、中心点291及び292を結ぶ線分に対する、中心点291b及び292bを結ぶ線分の回転角(即ち、傾き)θ2を求める。要素画像Cw3〜要素画像CwN-1についての回転角θ3〜θN-1も同様に求め、回転角θiの逆数を評価値Kciとして求める。 Thereafter, paying attention to the element image Cw 1 , the rotation angle (ie, inclination) θ 1 of the line connecting the center points 291a and 292a with respect to the line connecting the center points 291 and 292 is obtained. Similarly, paying attention to the element image Cw 2 , the rotation angle (ie, inclination) θ 2 of the line connecting the center points 291 b and 292 b with respect to the line connecting the center points 291 and 292 is obtained. Rotation angle θ 3N-1 is also determined in the same manner for the element image Cw 3 ~ element images Cw N-1, obtains the reciprocal of the rotation angle theta i as the evaluation value Kc i.

後述するように、評価値Kciと他の評価値を共に用いて参照画像Rwの選択を行うことが望ましいが、最小の評価値Kciに対応する候補画像を参照画像Rwとして選択することも可能である。この場合、例えば、求められた評価値Kc1〜KcN-1の内、評価値KcN-1が最大であるのであれば、要素画像CwN-1を参照画像Rwとして選択する。 As described later, it is desirable to perform the selection of the reference image Rw using both the evaluation value Kc i and other evaluation values, also select candidate images corresponding to the minimum evaluation value Kc i as a reference image Rw Is possible. In this case, for example, among the evaluation values Kc 1 ~Kc N-1 obtained, the evaluation value Kc N-1 is equal to the maximum, selects the element image Cw N-1 as a reference image Rw.

補正対象画像Lwと参照画像Rwの撮影時間(撮影時刻)は異なるため、両者の撮影間で構図のずれが発生しうる。高精度な手ぶれ補正を行うためには、このずれに由来する補正対象画像Lwと参照画像Rwとの間の位置ずれを打ち消すための位置合わせが必要となる。この位置合わせは座標変換(アフィン変換など)によって実現されるが、この位置合わせに画像回転処理が含まれると回路規模及び計算コストが増大してしまう。本選択方法によれば、補正対象画像Lwに対する回転角が小さな要素画像が優先的に選択されるため、平行移動による位置合わせだけで比較的良好な手ぶれ補正効果を得ることができ、回路規模の低減にも寄与する。   Since the imaging time (imaging time) of the correction target image Lw and the reference image Rw are different, a compositional deviation may occur between the two images. In order to perform high-accuracy camera shake correction, it is necessary to perform alignment for canceling the positional shift between the correction target image Lw and the reference image Rw resulting from this shift. This alignment is realized by coordinate transformation (affine transformation or the like), but if this alignment includes image rotation processing, the circuit scale and calculation cost increase. According to this selection method, an element image having a small rotation angle with respect to the correction target image Lw is preferentially selected. Therefore, a relatively good camera shake correction effect can be obtained only by alignment by parallel movement, and the circuit scale can be increased. Contributes to reduction.

尚、後述のフーリエ反復法を利用して手ぶれ補正を行う場合、補正対象画像Lw及び参照画像Rwをフーリエ変換することによって得られた周波数空間画像間で線形演算がなされる(第4実施例にて詳説)。この場合において、補正対象画像Lwと参照画像Rwとの間に回転方向のずれがあると、フーリエ変換の特性上、手ぶれ検出及び手ぶれ補正精度が顕著に低下する。このため、フーリエ反復法を利用して手ぶれ補正を行う場合においては、本選択方法を利用して参照画像Rwを選択することにより、手ぶれ検出及び手ぶれ補正精度が大幅に向上する。   In addition, when camera shake correction is performed using the Fourier iteration method described later, linear calculation is performed between frequency space images obtained by Fourier transform of the correction target image Lw and the reference image Rw (in the fourth embodiment). Detailed explanation). In this case, if there is a shift in the rotation direction between the correction target image Lw and the reference image Rw, camera shake detection and camera shake correction accuracy are significantly reduced due to the characteristics of Fourier transform. For this reason, when camera shake correction is performed using the Fourier iteration method, camera shake detection and camera shake correction accuracy are greatly improved by selecting the reference image Rw using this selection method.

[第4の参照画像選択方法]
次に、第4の参照画像選択方法について説明する。第4の参照画像選択方法では、第3の参照画像選択方法と同様、連写画像群を形成する要素画像Cw1〜CwNの内、補正対象画像Lwとして選択された要素画像を除く(N−1)枚の要素画像を参照画像Rwの候補として取り扱う。参照画像Rwの候補として取り扱われる要素画像を「候補画像」とも呼ぶ。そして、各候補画像の、補正対象画像Lwとの撮影時間差(撮影時刻差)を求める。そして、求めた各撮影時間差を用いて参照画像Rwの選択を行う。
[Fourth Reference Image Selection Method]
Next, a fourth reference image selection method will be described. In the fourth reference image selection method, similarly to the third reference image selection method, the element image selected as the correction target image Lw is excluded from the element images Cw 1 to Cw N forming the continuous shot image group (N -1) Treat element images as candidates for the reference image Rw. Element images that are handled as candidates for the reference image Rw are also referred to as “candidate images”. Then, a photographing time difference (photographing time difference) between each candidate image and the correction target image Lw is obtained. Then, the reference image Rw is selected using each obtained photographing time difference.

より具体的に説明する。今、要素画像CwNが補正対象画像Lwとして選択された場合を想定する。この場合、要素画像Cw1〜CwN-1の夫々が候補画像とされる。また、要素画像Cw1、Cw2、・・・、CwN-1及びCwNの順番で連続撮影がなされたものとする。着目した候補画像の、補正対象画像Lwとの撮影時間差は、着目した候補画像の撮影時における露光期間の中間時点と補正対象画像Lwの撮影時における露光期間の中間時点との時間差とする。候補画像としての要素画像Cwiに対して求められた上記撮影時間差の逆数を評価値Kdiとする。今の例の場合、計(N−1)個の評価値Kd1〜KdN-1が算出され、当然の如く、Kd1<Kd2<・・・<KdN-1が成立することになる。 This will be described more specifically. Now, it is assumed that the element image Cw N are selected as the correction target image Lw. In this case, each of the element images Cw 1 to Cw N−1 is set as a candidate image. In addition, it is assumed that continuous photographing is performed in the order of element images Cw 1 , Cw 2 ,..., Cw N−1 and Cw N. The difference in shooting time between the focused candidate image and the correction target image Lw is the time difference between the intermediate point in the exposure period when shooting the focused candidate image and the intermediate point in the exposure period when shooting the correction target image Lw. The inverse of the photographing time difference determined for the element image Cw i as a candidate image as the evaluation value Kd i. For this example, a total of (N-1) evaluation value Kd 1 ~Kd N-1 is calculated, as a matter of course, that the Kd 1 <Kd 2 <··· < Kd N-1 is established Become.

後述するように、評価値Kdiと他の評価値を共に用いて参照画像Rwの選択を行うことが望ましいが、最小の評価値Kdiに対応する候補画像を参照画像Rwとして選択することも可能である。この場合、今の例では、評価値KdN-1が最大となるため、要素画像CwN-1が参照画像Rwとして選択されることとなる。 As will be described later, it is desirable to select the reference image Rw using both the evaluation value Kd i and another evaluation value, but it is also possible to select a candidate image corresponding to the minimum evaluation value Kd i as the reference image Rw. Is possible. In this case, in the present example, the evaluation value Kd N-1 is maximized, and thus the element image Cw N-1 is selected as the reference image Rw.

補正対象画像Lwと参照画像Rwの撮影時間差が大きいほど、その間に被写体が動く確率が高くなると共に照度などの撮影条件が変化する確率も高くなる。被写体の動きや撮影条件の変化は、手ぶれ検出及び手ぶれ補正精度を低下させる方向に作用する。本選択方法によれば、補正対象画像Lwとの撮影時間差の小さな要素画像が優先的に選択されるため、これらの変化の影響が軽減されて、より高精度な手ぶれ検出及び手ぶれ補正を行うことが可能となる。   The larger the shooting time difference between the correction target image Lw and the reference image Rw, the higher the probability that the subject will move during that time, and the higher the probability that shooting conditions such as illuminance will change. The movement of the subject and the change in shooting conditions act in the direction of reducing the camera shake detection and camera shake correction accuracy. According to this selection method, since an element image having a small photographing time difference from the correction target image Lw is preferentially selected, the influence of these changes is reduced, and more accurate camera shake detection and camera shake correction are performed. Is possible.

尚、上述した第1〜第4の参照画像選択方法の内の2つ、3つ又は4つを組み合わせて用いることも可能である。例えば、4つを組み合わせる場合は、要素画像Cwiに対する総合評価値Kiを下記式(A−1)によって算出し、最大の総合評価値に対応する要素画像を参照画像Rwとして選択すればよい。ここで、ka、kb、kc及びkdは、ゼロ又は正の値を有する所定の重み付け係数である。2つ又は3つの選択方法を組み合わせる場合は、必要な重み付け係数をゼロとすればよい。例えば、第1〜第3の参照画像選択方法の3つの選択方法を組み合わせる場合は、「kd=0」とした上で総合評価値Kiを算出すれば良い。
i=ka×Kai+kb×Kbi+kc×Kci+kd×Kdi ・・・(A−1)
Note that two, three, or four of the first to fourth reference image selection methods described above may be used in combination. For example, when combining four, a total evaluation value K i for the element image Cw i is calculated by the following formula (A-1), may be selected element image corresponding to the maximum total evaluation value as the reference image Rw . Here, ka, kb, kc, and kd are predetermined weighting factors having zero or positive values. When combining two or three selection methods, the necessary weighting factor may be zero. For example, when combining the three selection methods of the first to third reference picture selection method may be calculated overall evaluation value K i on which the "kd = 0".
K i = ka × Ka i + kb × Kb i + kc × Kc i + kd × Kd i (A-1)

第1実施例で述べた処理を実現するためには、「参照画像Rwとして選択されるべき要素画像におけるぶれ量がベストショット画像(補正対象画像Lw)のそれよりも小さい」という必要条件を満たす必要がある。一方で、ぶれ量は、第1〜第4評価値Kai、Kbi、Kci及びKdiの内、評価値Kai及びKbiのみに対して反映される。従って、上記式(A−1)に基づいて総合評価値Kiを算出するに当たり、重み付け係数ka及びkbの内の少なくとも一方はゼロとすべきではない。 In order to realize the processing described in the first embodiment, the requirement that “the amount of blur in the element image to be selected as the reference image Rw is smaller than that of the best shot image (correction target image Lw)” is satisfied. There is a need. On the other hand, the shake amount is reflected only on the evaluation values Ka i and Kb i among the first to fourth evaluation values Ka i , Kb i , Kc i and Kd i . Therefore, in calculating the overall evaluation value K i based on the above formula (A-1), at least one of the weighting coefficients ka and kb it should not be zero.

また更に、第1〜第4の参照画像選択方法の内の2つ、3つ又は4つを組み合わせて利用する場合は、上記の必要条件が満たされるように総合評価値Kiに基づいて参照画像Rwを選択すべきである。従って例えば、要素画像CwNが補正対象画像Lwとして選択された場合は、要素画像Cw1〜CwN-1についての総合評価値K1〜KN-1を求める。この段階で、上述の第1又は第2の参照画像選択方法の説明で述べたぶれ量推定方法により、各要素画像Cw1〜CwNのぶれ量は推定されている。この場合において、「K1<K2<・・・<KN-2<KN-1」であるならば、要素画像CwNについて推定したぶれ量と要素画像CwN-1について推定したぶれ量を比較し、前者が大きいのであれば要素画像CwN-1を参照画像Rwとして選択する。一方、後者が大きいのであれば、上記の必要条件を満たすべく、2番目に大きな総合評価値KN-2に対応する要素画像CwN-2に着目して要素画像CwNについて推定したぶれ量と要素画像CwN-2について推定したぶれ量を比較する。ここで、前者が大きいのであれば要素画像CwN-2を参照画像Rwとして選択する一方、後者が大きいのであれば3番目に大きな総合評価値KN-3に対応する要素画像CwN-3に着目して同様の処理を行うようにする。このように処理することにより、上記の必要条件を満たした上で最も望ましい要素画像が参照画像Rwとして選択される。 Furthermore, two of the first through fourth reference picture selection method, see when using three or four in combination, based on the overall evaluation value K i as described above requirements are met The image Rw should be selected. Thus, for example, if the element image Cw N are selected as the correction target image Lw, obtaining the total evaluation value K 1 ~K N-1 for elemental image Cw 1 ~Cw N-1. At this stage, the shake amount of each of the element images Cw 1 to Cw N is estimated by the shake amount estimation method described in the description of the first or second reference image selection method. In this case, "K 1 <K 2 <··· < K N-2 <K N-1 " if a blur estimated for blurring amount and the element image Cw N-1 which is estimated for an element image Cw N If the former is large, the element image Cw N-1 is selected as the reference image Rw. On the other hand, if the latter is larger, to meet the above requirements, the shake amount estimated for an element image Cw N focusing on an element image Cw N-2 corresponding to the large total evaluation value K N-2 in the second And the shake amount estimated for the element image Cw N-2 are compared. Here, if the former is large, the element image Cw N-2 is selected as the reference image Rw. If the latter is large, the element image Cw N-3 corresponding to the third largest comprehensive evaluation value K N-3 is selected. The same processing is performed focusing on the above. By processing in this way, the most desirable element image that satisfies the above-described requirements is selected as the reference image Rw.

<<第4実施例>>
次に、第4実施例を説明する。第4実施例では、補正対象画像Lwと参照画像Rwに基づく、補正対象画像Lwの補正方法を説明する。この補正を行うための処理は、図4のステップS18にて実行される。補正対象画像Lwの補正方法として、以下に、第1〜第3の補正方法を例示する。第1、第2、第3の補正方法は、夫々、画像復元方式、画像合成方式、画像鮮鋭化方式による補正方法である(図3参照)。
<< 4th Example >>
Next, a fourth embodiment will be described. In the fourth embodiment, a correction method for the correction target image Lw based on the correction target image Lw and the reference image Rw will be described. The process for performing this correction is executed in step S18 of FIG. As a correction method for the correction target image Lw, first to third correction methods will be exemplified below. The first, second, and third correction methods are correction methods using an image restoration method, an image synthesis method, and an image sharpening method, respectively (see FIG. 3).

[第1の補正方法]
図14を参照して、第1の補正方法について説明する。図14は、第1の補正方法に基づく補正処理の流れを表すフローチャートである。第1の補正方法を採用する場合、図4のステップS18の処理は、図14のステップS71〜S77の各処理から形成される。
[First correction method]
The first correction method will be described with reference to FIG. FIG. 14 is a flowchart showing the flow of correction processing based on the first correction method. When the first correction method is adopted, the process in step S18 in FIG. 4 is formed from the processes in steps S71 to S77 in FIG.

まず、ステップS71において、補正対象画像Lwの中から特徴的な小領域を抽出し、この抽出された小領域内の画像を小画像Lsとしてメモリ上に記憶する。例えば、ハリス(Harris)のコーナ検出器を用いて128×128画素の小領域を特徴的な小領域として抽出する。尚、特徴的な小領域の意義は、上述したとおりである。   First, in step S71, a characteristic small area is extracted from the correction target image Lw, and an image in the extracted small area is stored in the memory as a small image Ls. For example, a small area of 128 × 128 pixels is extracted as a characteristic small area by using a Harris corner detector. The significance of the characteristic small area is as described above.

次に、ステップS72において、補正対象画像Lwから抽出された小領域と同一座標の小領域を参照画像Rwから抽出し、参照画像Rwから抽出された小領域内の画像を小画像Rsとしてメモリ上に記憶する。補正対象画像Lwから抽出される小領域の中心座標(補正対象画像Lwにおける中心座標)と参照画像Rwから抽出される小領域の中心座標(参照画像Rwにおける中心座標)は等しく、また、補正対象画像Lwと参照画像Rwの画像サイズは等しいため、両小領域の画像サイズも等しくされる。   Next, in step S72, a small region having the same coordinates as the small region extracted from the correction target image Lw is extracted from the reference image Rw, and an image in the small region extracted from the reference image Rw is stored in the memory as a small image Rs. To remember. The center coordinates of the small area extracted from the correction target image Lw (center coordinates in the correction target image Lw) and the center coordinates of the small area extracted from the reference image Rw (center coordinates in the reference image Rw) are equal, and the correction target Since the image sizes of the image Lw and the reference image Rw are equal, the image sizes of both small regions are also made equal.

上述のようにして得られた小画像Lsを劣化画像として且つ小画像Rsを初期復元画像として取り扱った上で(ステップS73)、ステップS74にてフーリエ反復法を実施することにより、小画像Lsのぶれによる劣化の状態を表す画像劣化関数を求める。   The small image Ls obtained as described above is treated as a deteriorated image and the small image Rs is treated as an initial restored image (step S73), and the Fourier iteration method is performed in step S74, whereby the small image Ls is obtained. An image deterioration function representing a state of deterioration due to blur is obtained.

フーリエ反復法を実施する際、初期の復元画像(復元画像の初期値)を与えてやる必要があるが、この初期の復元画像を初期復元画像と呼ぶ。   When performing the Fourier iteration method, it is necessary to give an initial restored image (initial value of the restored image). This initial restored image is called an initial restored image.

画像劣化関数として点広がり関数(Point Spread Function;以下、PSFと呼ぶ)を求める。理想的な点像が撮像装置1のぶれによって画像上で描く軌跡にあわせて重み付けがなされたオペレータ或るいは空間フィルタは、PSFと呼ばれ、手ぶれの数学モデルとして一般的に使用される。手ぶれは画像全体に対して一様な劣化を与えるため、小画像Lsに対して求めたPSFは、補正対象画像Lwの全体に対するPSFとして利用することができる。   A point spread function (hereinafter referred to as PSF) is obtained as an image degradation function. An operator or a spatial filter in which an ideal point image is weighted in accordance with a trajectory drawn on the image by a shake of the image pickup apparatus 1 is called a PSF, and is generally used as a mathematical model of camera shake. Since camera shake uniformly degrades the entire image, the PSF obtained for the small image Ls can be used as the PSF for the entire correction target image Lw.

フーリエ反復法は、劣化を含む劣化画像から、劣化を除去或いは低減した復元画像を得る手法である(上記非特許文献1参照)。このフーリエ反復法を、図15及び図16を参照して詳細に説明する。図15は、図14のステップS74の処理の詳細フローチャートである。図16は、図1の手ぶれ補正部19に内在する、フーリエ反復法を実施する部位のブロック図である。   The Fourier iteration method is a method for obtaining a restored image from which deterioration is removed or reduced from a deteriorated image including deterioration (see Non-Patent Document 1 above). This Fourier iteration method will be described in detail with reference to FIGS. FIG. 15 is a detailed flowchart of the process in step S74 of FIG. FIG. 16 is a block diagram of a part of the image stabilization unit 19 shown in FIG.

まず、ステップS101において、復元画像をf’とし、この復元画像f’に初期復元画像をセットする。即ち、初期の復元画像f’として小画像Rsを用いるようにする。次に、ステップS102において、劣化画像(即ち、小画像Ls)をgとする。そして、劣化画像gをフーリエ変換したものをGとしてメモリ上に記憶しておく(ステップS103)。例えば、初期復元画像及び劣化画像の画像サイズが128×128画素の場合、f’及びgは、128×128の行列サイズを有する行列として表現できる。   First, in step S101, a restored image is set as f ', and an initial restored image is set in the restored image f'. That is, the small image Rs is used as the initial restored image f ′. Next, in step S102, the deteriorated image (that is, the small image Ls) is set to g. Then, the result of Fourier transform of the deteriorated image g is stored in the memory as G (step S103). For example, when the image sizes of the initial restored image and the degraded image are 128 × 128 pixels, f ′ and g can be expressed as a matrix having a matrix size of 128 × 128.

次に、ステップS110において、復元画像f’をフーリエ変換したF’を求め、更にステップS111において、下記式(B−1)によりHを算出する。Hは、PSFをフーリエ変換したものに相当する。式(B−1)において、F’*は、F’の共役複素行列であり、αは、定数である。 Next, in step S110, F ′ obtained by Fourier transform of the restored image f ′ is obtained, and in step S111, H is calculated by the following equation (B-1). H corresponds to the result of Fourier transform of PSF. In Formula (B-1), F ′ * is a conjugate complex matrix of F ′, and α is a constant.

次に、ステップS112において、Hを逆フーリエ変換することにより、PSFを得る。ここで得られるPSFをhとする。次に、ステップS113において、PSF hを下記式(B−2a)の拘束条件で修正した後、更に式(B−2b)の拘束条件にて修正する。   Next, in step S112, PSF is obtained by performing inverse Fourier transform on H. The PSF obtained here is assumed to be h. Next, in step S113, after the PSF h is corrected under the constraint condition of the following formula (B-2a), it is further corrected under the constraint condition of the formula (B-2b).

PSF hは、2次元の行列として表現されるため、この行列の各要素をh(x,y)で表す。PSFの各要素は、本来、0以上且つ1以下の値をとるはずである。従って、ステップS113において、PSFの各要素が0以上且つ1以下であるかを判断し、0以上且つ1以下となっている要素の値はそのままにする一方、1より大きな要素がある場合はその要素の値を1に修正し、且つ、0より小さい要素がある場合はその要素の値を0に修正する。これが、式(B−2a)の拘束条件による修正である。そして、この修正後のPSFの各要素の総和が1となるように、PSFを正規化する。この正規化が、式(B−2b)の拘束条件による修正である。   Since PSF h is expressed as a two-dimensional matrix, each element of this matrix is represented by h (x, y). Each element of the PSF should originally take a value of 0 or more and 1 or less. Therefore, in step S113, it is determined whether each element of the PSF is 0 or more and 1 or less, and the value of the element that is 0 or more and 1 or less is left as it is. The value of the element is corrected to 1, and if there is an element smaller than 0, the value of the element is corrected to 0. This is correction by the constraint condition of Formula (B-2a). Then, the PSF is normalized so that the sum of the elements of the PSF after correction is 1. This normalization is correction by the constraint condition of the formula (B-2b).

式(B−2a)及び(B−2b)の拘束条件によって修正されたPSFを、h'とする。   The PSF corrected by the constraints of the equations (B-2a) and (B-2b) is set as h ′.

次に、ステップS114において、PSF h’をフーリエ変換したH’を求め、更にステップS115において、下記式(B−3)によりFを算出する。Fは、復元画像fをフーリエ変換したものに相当する。式(B−3)において、H’*は、H’の共役複素行列であり、βは、定数である。 Next, in step S114, H ′ obtained by Fourier transforming PSF h ′ is obtained, and in step S115, F is calculated by the following equation (B-3). F corresponds to a Fourier transform of the restored image f. In the formula (B-3), H ′ * is a conjugate complex matrix of H ′, and β is a constant.

次に、ステップS116において、Fを逆フーリエ変換することにより、復元画像を取得する。ここで得られる復元画像をfとする。次に、ステップS117において、復元画像fを下記式(B−4)の拘束条件で修正し、修正された復元画像を、新たにf’とする。   Next, in step S116, a restored image is obtained by performing an inverse Fourier transform on F. Let f be the restored image obtained here. Next, in step S117, the restored image f is corrected under the constraint condition of the following formula (B-4), and the corrected restored image is newly set as f '.

復元画像fは、2次元の行列として表現されるため、この行列の各要素をf(x,y)で表す。今、劣化画像及び復元画像の各画素の画素値が、0から255までのデジタル値にて表されるものとする。そうすると、復元画像fを表す行列の各要素(即ち、各画素値)は、本来、0以上且つ255以下の値をとるはずである。従って、ステップS117において、復元画像fを表す行列の各要素が0以上且つ255以下であるかを判断し、0以上且つ255以下となっている要素の値はそのままにする一方、255より大きな要素がある場合はその要素の値を255に修正し、且つ、0より小さい要素がある場合はその要素の値を0に修正する。これが、式(B−4)の拘束条件による修正である。   Since the restored image f is represented as a two-dimensional matrix, each element of the matrix is represented by f (x, y). Now, it is assumed that the pixel value of each pixel of the degraded image and the restored image is represented by a digital value from 0 to 255. Then, each element (that is, each pixel value) of the matrix representing the restored image f should originally have a value of 0 or more and 255 or less. Accordingly, in step S117, it is determined whether each element of the matrix representing the restored image f is 0 or more and 255 or less, and the value of the element that is 0 or more and 255 or less is left as it is. If there is an element, the value of the element is corrected to 255, and if there is an element smaller than 0, the value of the element is corrected to 0. This is correction by the constraint condition of Formula (B-4).

次に、ステップS118において、収束条件を満たすか否かを判断することによって、反復処理の収束判定を行う。   Next, in step S118, it is determined whether or not the convergence condition is satisfied, thereby determining whether or not the iterative process is converged.

例えば、最新のF'と1つ前に得られたF'との差分の絶対値を収束判定の指標として用いる。この指標が所定の閾値以下の場合、収束条件が満たされると判断する一方、そうでない場合、収束条件は満たされないと判断する。   For example, the absolute value of the difference between the latest F ′ and the previous F ′ is used as an index for convergence determination. If this index is less than or equal to a predetermined threshold value, it is determined that the convergence condition is satisfied. Otherwise, it is determined that the convergence condition is not satisfied.

収束条件が満たされる場合、最新のH'を逆フーリエ変換したものを最終的なPSFとする。即ち、この最新のH'を逆フーリエ変換したものが、図14のステップS74で求められるべきPSFとなる。収束条件が満たされない場合、ステップS110に戻り、ステップS110〜S118の各処理を繰り返す。ステップS110〜S118の各処理の繰り返しにおいて、f'、F'、H、h、h'、H'、F及びf(図16参照)は、順次、最新のものに更新されていく。   When the convergence condition is satisfied, a final PSF is obtained by performing inverse Fourier transform on the latest H ′. That is, the latest H ′ obtained by inverse Fourier transform is the PSF to be obtained in step S74 of FIG. When the convergence condition is not satisfied, the process returns to step S110, and the processes of steps S110 to S118 are repeated. In the repetition of each process of steps S110 to S118, f ′, F ′, H, h, h ′, H ′, F, and f (see FIG. 16) are sequentially updated to the latest ones.

収束判定の指標として、他の指標を用いることも可能である。例えば、最新のH'と1つ前に得られたH'との差分の絶対値を収束判定の指標として用いて、上記の収束条件の成立/不成立を判断してもよい。また例えば、上記式(B−2a)及び(B−2b)を用いたステップS113における修正量、或いは、式(B−4)を用いたステップS117における修正量を収束判定の指標として用いて、上記の収束条件の成立/不成立を判断してもよい。反復処理が収束に向かえば、それらの修正量が小さくなるからである。   Another index can be used as an index for determining convergence. For example, the absolute value of the difference between the latest H ′ and the previous H ′ obtained may be used as the convergence determination index to determine whether or not the convergence condition is satisfied. Further, for example, the correction amount in step S113 using the above formulas (B-2a) and (B-2b) or the correction amount in step S117 using formula (B-4) is used as an index for convergence determination. Whether or not the convergence condition is satisfied may be determined. This is because if the iterative process is toward convergence, the amount of correction becomes small.

また、ステップS110〜S118から成るループ処理の繰り返し回数が所定回数に達した場合、収束不可と判断して、最終的なPSFを算出することなく処理を終了するようにしてもよい。この場合、補正対象画像Lwの補正は行われない。   Further, when the number of repetitions of the loop process consisting of steps S110 to S118 reaches a predetermined number, it may be determined that convergence is impossible and the process may be terminated without calculating a final PSF. In this case, the correction target image Lw is not corrected.

図14の各ステップの説明に戻る。ステップS74にて、PSFが算出された後、ステップS75に移行する。ステップS75では、ステップS74で求められたPSFの逆行列の各要素を画像復元フィルタの各フィルタ係数として求める。この画像復元フィルタは、劣化画像から復元画像を得るためのフィルタである。実際には、上記式(B−3)の右辺の一部に相当する下記式(B−5)にて表される行列の各要素が、画像復元フィルタの各フィルタ係数に相当するため、ステップS74におけるフーリエ反復法の計算途中結果をそのまま利用可能である。但し、式(B−5)におけるH’*及びH’は、ステップS118の収束条件の成立直前に得られたH’*及びH’(即ち、最終的に得られたH’*及びH’)である。 Returning to the description of each step in FIG. After the PSF is calculated in step S74, the process proceeds to step S75. In step S75, each element of the inverse matrix of PSF obtained in step S74 is obtained as each filter coefficient of the image restoration filter. This image restoration filter is a filter for obtaining a restored image from a deteriorated image. Actually, each element of the matrix represented by the following equation (B-5) corresponding to a part of the right side of the equation (B-3) corresponds to each filter coefficient of the image restoration filter. The intermediate calculation result of the Fourier iteration method in S74 can be used as it is. However, the formula (B-5) H 'in * and H' is, H obtained satisfied immediately before the convergence condition in step S118 '* and H' (i.e., the finally obtained H '* and H' ).

ステップS75にて画像復元フィルタの各フィルタ係数が求められた後、ステップS76に移行し、この画像復元フィルタを用いて補正対象画像Lwをフィルタリング(空間フィルタリング)する。即ち、求められた各フィルタ係数を有する画像復元フィルタを補正対象画像Lwの各画素に適用して補正対象画像Lwをフィルタリングする。これにより、補正対象画像Lwに含まれるぶれを除去或いは低減したフィルタリング画像が生成される。画像復元フィルタのサイズは補正対象画像Lwの画像サイズよりも小さいが、手ぶれは画像全体に一様な劣化を与えると考えられるため、この画像復元フィルタを補正対象画像Lwの全体に対して適用することによって、補正対象画像Lwの全体のぶれが除去される。   After each filter coefficient of the image restoration filter is obtained in step S75, the process proceeds to step S76, and the correction target image Lw is filtered (spatial filtering) using this image restoration filter. In other words, the correction target image Lw is filtered by applying an image restoration filter having the obtained filter coefficients to each pixel of the correction target image Lw. As a result, a filtered image in which the blur included in the correction target image Lw is removed or reduced is generated. Although the size of the image restoration filter is smaller than the image size of the correction target image Lw, it is considered that camera shake causes uniform degradation on the entire image. Therefore, this image restoration filter is applied to the entire correction target image Lw. As a result, the entire blur of the correction target image Lw is removed.

フィルタリング画像には、フィルタリングに伴うリンギングが含まれうる。このため、ステップS77において、これを除去するためのリンギング除去処理をフィルタリング画像に施すことにより最終的な補正画像Qwを生成する。リンギングを除去する手法は公知であるため、詳細な説明を割愛する。その手法として、例えば特開2006−129236号公報に記載の手法を用いればよい。   The filtering image may include ringing accompanying filtering. For this reason, in step S77, a final correction image Qw is generated by performing ringing removal processing for removing this on the filtered image. Since the method for removing ringing is known, a detailed description is omitted. For example, a technique described in JP 2006-129236 A may be used.

補正画像Qwは、補正対象画像Lwに含まれるぶれが除去或いは低減され且つフィルタリングに伴うリンギングが除去或いは低減された画像となる。但し、フィルタリング画像もぶれが除去或いは低減された画像であるため、フィルタリング画像を補正画像Qwとして捉えることも可能である。   The corrected image Qw is an image in which blur included in the correction target image Lw is removed or reduced and ringing due to filtering is removed or reduced. However, since the filtering image is also an image in which the blur is removed or reduced, the filtering image can be regarded as the corrected image Qw.

参照画像Rwに含まれるぶれ量は少ないため、それのエッジ成分は、手ぶれのない理想画像のエッジ成分に近い。従って、上述の如く、この参照画像Rwから得られる画像をフーリエ反復法における初期復元画像とする。   Since the amount of blur included in the reference image Rw is small, its edge component is close to the edge component of an ideal image without camera shake. Therefore, as described above, an image obtained from this reference image Rw is used as an initial restored image in the Fourier iteration method.

フーリエ反復法によるループ処理の繰り返しによって、復元画像(f')は、手ぶれが極力除去された画像に徐々に近づいていくが、初期復元画像自体が既に手ぶれのない画像に近いため、従来の如くランダム画像や劣化画像を初期復元画像とするよりも収束が早くなる(最短では、1回のループ処理で収束する)。この結果、手ぶれ情報(PSF又は画像復元フィルタのフィルタ係数)作成用の処理時間及び手ぶれ補正用の処理時間が短縮される。また、初期復元画像が収束すべき画像からかけ離れていると局所解(真に収束すべき画像とは異なる画像)に収束する確率が高くなるが、上述のように初期復元画像を設定することにより、局所解に収束する確率が低くなる(即ち、手ぶれ補正に失敗する確率が低くなる)。   By repetitive loop processing by the Fourier iteration method, the restored image (f ′) gradually approaches an image from which camera shake has been removed as much as possible. However, since the initial restored image itself is already close to an image without camera shake, Convergence is faster than a random image or a deteriorated image as an initial restored image (in the shortest, convergence is achieved by a single loop process). As a result, the processing time for generating camera shake information (PSF or filter coefficient of the image restoration filter) and the processing time for camera shake correction are shortened. If the initial restored image is far from the image to be converged, the probability of convergence to a local solution (an image different from the image to be truly converged) increases. However, by setting the initial restored image as described above, , The probability of convergence to a local solution is low (that is, the probability that camera shake correction fails) is low.

また、手ぶれは画像全体に一様な劣化を与えると考えられるため、各画像から小領域を抽出して各小領域の画像データから手ぶれ情報(PSF又は画像復元フィルタのフィルタ係数)を作成し、それを画像全体に適用する。これにより、必要な演算量が低減され、手ぶれ情報作成用の処理時間及び手ぶれ補正用の処理時間が短縮される。勿論、必要回路の規模縮小化やそれに伴うコストダウン効果も見込める。   In addition, camera shake is thought to give uniform degradation to the entire image, so a small area is extracted from each image to create camera shake information (PSF or filter coefficient of the image restoration filter) from the image data of each small area, Apply it to the entire image. As a result, the amount of calculation required is reduced, and the processing time for creating camera shake information and the processing time for correcting camera shake are shortened. Of course, the required circuit scale can be reduced and the cost reduction effect can be expected.

この際、上述の如く、エッジ成分を多く含む特徴的な小領域を自動的に抽出するようにする。PSFの算出元画像におけるエッジ成分の増大は、雑音成分に対する信号成分の割合の増大を意味するため、特徴的な小領域の抽出によって雑音の影響が小さくなり、手ぶれ情報をより正確に検出することができるようになる。   At this time, as described above, a characteristic small region containing a lot of edge components is automatically extracted. An increase in the edge component in the PSF calculation source image means an increase in the ratio of the signal component to the noise component. Therefore, the influence of noise is reduced by extracting a characteristic small region, and camera shake information is detected more accurately. Will be able to.

[第2の補正方法]
次に、図17及び図18を参照して、第2の補正方法について説明する。図17は、第2の補正方法に基づく補正処理の流れを表すフローチャートである。図18は、この補正処理の流れを表す概念図である。第2の補正方法を採用する場合、図4のステップS18の処理は、図17のステップS151〜S154の各処理から形成される。
[Second correction method]
Next, the second correction method will be described with reference to FIGS. 17 and 18. FIG. 17 is a flowchart showing the flow of correction processing based on the second correction method. FIG. 18 is a conceptual diagram showing the flow of this correction process. When the second correction method is adopted, the process in step S18 in FIG. 4 is formed from the processes in steps S151 to S154 in FIG.

図1の撮像部11の撮影によって得られる画像は、輝度に関する情報と色に関する情報を含むカラー画像となっている。従って、補正対象画像Lwを形成する各画素の画素信号は、画素の輝度を表す輝度信号と、画素の色を表す色信号から形成される。今、各画素の画素信号がYUV形式で表現されているものとする。この場合、色信号は2つの色差信号U及びVから形成されることなる。そして、補正対象画像Lwを形成する各画素の画素信号は、画素の輝度を表す輝度信号Yと、画素の色を表す2つの色差信号U及びVと、から形成される。   1 is a color image including information on luminance and information on color. Accordingly, the pixel signal of each pixel that forms the correction target image Lw is formed from a luminance signal that represents the luminance of the pixel and a color signal that represents the color of the pixel. Now, it is assumed that the pixel signal of each pixel is expressed in YUV format. In this case, the color signal is formed from the two color difference signals U and V. The pixel signal of each pixel forming the correction target image Lw is formed from a luminance signal Y that represents the luminance of the pixel and two color difference signals U and V that represent the color of the pixel.

そうすると、補正対象画像Lwは、図18に示す如く、画素信号として輝度信号Yのみを含む画像LwYと、画素信号として色差信号Uのみを含む画像LwUと、画素信号として色差信号Vのみを含む画像LwVと、に分解することができる。同様に、参照画像Rwも、画素信号として輝度信号Yのみを含む画像RwYと、画素信号として色差信号Uのみを含む画像RwUと、画素信号として色差信号Vのみを含む画像RwVと、に分解できる(図18では、画像RwYのみ図示)。 Then, as shown in FIG. 18, the correction target image Lw includes an image Lw Y including only the luminance signal Y as a pixel signal, an image Lw U including only the color difference signal U as a pixel signal, and only the color difference signal V as a pixel signal. an image Lw V containing, can be decomposed into. Similarly, the reference image Rw includes an image Rw Y including only the luminance signal Y as a pixel signal, an image Rw U including only the color difference signal U as a pixel signal, an image Rw V including only the color difference signal V as a pixel signal, (In FIG. 18, only the image Rw Y is shown).

図17のステップS151では、まず、補正対象画像Lwの輝度信号及び色差信号を抽出することにより、画像LwY、LwU及びLwVを生成する。続くステップS152では、参照画像Rwの輝度信号を抽出することにより、画像RwYを生成する。 In step S151 in FIG. 17, first, images Lw Y , Lw U and Lw V are generated by extracting the luminance signal and color difference signal of the correction target image Lw. In step S152, by extracting a brightness signal of the reference image Rw, and generates an image Rw Y.

その後、ステップS153において、画像LwYの画素信号と画像RwYの画素信号を比較することにより、画像LwYを画像RwYとの間の位置ずれ量ΔDを算出する。位置ずれ量ΔDは、水平成分及び垂直成分を含む二次元量であり、所謂動きベクトルとして表現される。位置ずれ量ΔDの算出を、周知の代表点マッチング法やテンプレートマッチングを利用したブロックマッチング法を用いて行うことができる。例えば、画像LwYから抽出した小領域内の画像をテンプレートとし、テンプレートマッチングによって、そのテンプレートとの類似度が最も高い小領域を画像RwY内から探索する。そして、探索された小領域の位置(画像RwY上の位置)と画像LwYから抽出した小領域の位置(画像LwY上の位置)とのずれ量を位置ずれ量ΔDとして算出する。尚、画像LwYから抽出されるべき小領域を、上述したような、特徴的な小領域とすることが望ましい。 Thereafter, in step S153, the pixel signal of the image Lw Y and the pixel signal of the image Rw Y are compared, thereby calculating a positional deviation amount ΔD between the image Lw Y and the image Rw Y. The positional deviation amount ΔD is a two-dimensional amount including a horizontal component and a vertical component, and is expressed as a so-called motion vector. The positional deviation amount ΔD can be calculated using a well-known representative point matching method or a block matching method using template matching. For example, an image in a small region extracted from the image Lw Y is used as a template, and a small region having the highest similarity with the template is searched from the image Rw Y by template matching. Then, to calculate the amount of deviation between the searched position of the small area (position on the image Rw Y) and the position of the small area extracted from the image Lw Y (position on the image Lw Y) as the positional deviation amount [Delta] D. Note that the small area to be extracted from the image Lw Y is desirably a characteristic small area as described above.

画像LwYを基準として考え、位置ずれ量ΔDが、画像LwYに対する画像RwYの位置ずれ量であるとする。画像RwYは、画像LwYを基準として位置ずれ量ΔDに相当する分だけ位置ずれが生じた画像とみなすことができる。そこで、ステップS154では、この位置ずれ量ΔDが打ち消されるように画像RwYに座標変換(アフィン変換など)を施すことによって画像RwYを位置ずれ補正する。位置ずれ補正前の画像RwY内の座標(x+ΔDx,y+ΔDy)に位置する画素は、位置ずれ補正によって座標(x,y)に位置する画素に変換される。ΔDx及びΔDyは、夫々、ΔDの水平成分及び垂直成分である。 Considering the image Lw Y as a reference, it is assumed that the positional deviation amount ΔD is the positional deviation amount of the image Rw Y with respect to the image Lw Y. The image Rw Y can be regarded as an image in which a positional deviation has occurred by an amount corresponding to the positional deviation amount ΔD with respect to the image Lw Y. Therefore, in step S154, positional deviation correcting the image Rw Y by performing coordinate conversion (such as affine transformation) in the image Rw Y as the positional deviation amount ΔD is canceled. A pixel located at the coordinates (x + ΔDx, y + ΔDy) in the image Rw Y before the positional deviation correction is converted into a pixel located at the coordinates (x, y) by the positional deviation correction. ΔDx and ΔDy are a horizontal component and a vertical component of ΔD, respectively.

ステップS154では、更に、画像LwU及びLwVと位置ずれ補正後の画像RwYが合成され、この合成によって得られた画像が補正画像Qwとして出力される。補正画像Qw内の座標(x,y)に位置する画素の画素信号は、座標(x,y)に位置する画像LwU内の画素の画素信号と、座標(x,y)に位置する画像LwV内の画素の画素信号と、座標(x,y)に位置する位置ずれ補正後の画像RwY内の画素の画素信号と、から形成される。 In step S154, the images Lw U and Lw V and the image Rw Y after the positional deviation correction are further combined, and the image obtained by this combination is output as the corrected image Qw. The pixel signal of the pixel located at the coordinates (x, y) in the corrected image Qw is the pixel signal of the pixel in the image Lw U located at the coordinates (x, y) and the image located at the coordinates (x, y). It is formed from the pixel signal of the pixel in Lw V and the pixel signal of the pixel in the image Rw Y after the positional deviation correction located at the coordinates (x, y).

カラー画像において、見た目のぶれは主に輝度のぶれによって引き起こされ、輝度のエッジ成分がぶれのない理想画像のそれに近ければ、観察者はぶれが少ないと感じる。従って、本補正方法では、ぶれ量の比較的少ない参照画像Rwの輝度信号を補正対象画像Lwの色信号に合成することによって擬似的な手ぶれ補正効果を得る。この方法によれば、エッジ近傍で色ずれが生じることとなるが、見た目においてぶれの少ない画像を低い計算コストで生成することができる。   In color images, visual blur is mainly caused by luminance blur, and if the edge component of luminance is close to that of an ideal image without blur, the viewer feels that there is little blur. Therefore, in this correction method, a pseudo camera shake correction effect is obtained by combining the luminance signal of the reference image Rw with a relatively small amount of blur with the color signal of the correction target image Lw. According to this method, although color misregistration occurs in the vicinity of the edge, an image with less blurring in appearance can be generated at a low calculation cost.

[第3の補正方法]
次に、図19及び図20を参照して、第3の補正方法について説明する。図19は、第3の補正方法に基づく補正処理の流れを表すフローチャートである。図20は、この補正処理の流れを表す概念図である。第3の補正方法を採用する場合、図4のステップS18の処理は、図19のステップS201〜S206の各処理から形成される。
[Third correction method]
Next, the third correction method will be described with reference to FIGS. 19 and 20. FIG. 19 is a flowchart showing the flow of correction processing based on the third correction method. FIG. 20 is a conceptual diagram showing the flow of this correction process. When the third correction method is employed, the process of step S18 in FIG. 4 is formed from the processes of steps S201 to S206 in FIG.

まず、ステップS201において、補正対象画像Lwから特徴的な小領域を抽出することによって小画像Lsを生成し、ステップS202において、参照画像Rwから小画像Lsに対応する小領域を抽出することによって小画像Rsを生成する。このステップS201及びS202の処理は、図14のステップS71及びS72の処理と同じである。   First, in step S201, a small image Ls is generated by extracting a characteristic small region from the correction target image Lw. In step S202, a small region corresponding to the small image Ls is extracted from the reference image Rw. An image Rs is generated. The processing in steps S201 and S202 is the same as the processing in steps S71 and S72 in FIG.

次に、ステップS203において、互いに異なる8種類の平滑化フィルタを用いて小画像Rsをフィルタリングすることにより、平滑化度合いの異なる8つの平滑化小画像RsG1、RsG2、・・・、RsG8を生成する。今、8つの平滑化フィルタとして互いに異なる8つのガウシアンフィルタを用いるものとし、各ガウシアンフィルタによって表されるガウス分布の分散をσ2で表す。 Next, in step S203, eight smoothed small images Rs G1 , Rs G2 ,..., Rs G8 having different smoothing levels are obtained by filtering the small image Rs using eight different smoothing filters. Is generated. Now, eight different Gaussian filters are used as the eight smoothing filters, and the variance of the Gaussian distribution represented by each Gaussian filter is represented by σ 2 .

一次元の画像に着目し、その一次元の画像における画素の位置をxで表した場合、平均が0且つ分散がσ2のガウス分布は下記式(C−1)によって表されることが一般的に知られている(図21参照)。このガウス分布をガウシアンフィルタに適用すると、ガウシアンフィルタの各フィルタ係数はhg(x)で表される。つまり、ガウシアンフィルタを位置0の画素に適用する時、位置xにおけるフィルタ係数はhg(x)で表される。換言すれば、ガウシアンフィルタによるフィルタリング後の位置0の画素値に対する、フィルタリング前の位置xの画素値の寄与率はhg(x)で表される。 When attention is paid to a one-dimensional image and the pixel position in the one-dimensional image is represented by x, a Gaussian distribution having an average of 0 and a variance of σ 2 is generally represented by the following formula (C-1). (See FIG. 21). When this Gaussian distribution is applied to a Gaussian filter, each filter coefficient of the Gaussian filter is represented by h g (x). That is, when the Gaussian filter is applied to the pixel at position 0, the filter coefficient at position x is represented by h g (x). In other words, the contribution ratio of the pixel value at the position x before filtering to the pixel value at the position 0 after filtering by the Gaussian filter is represented by h g (x).

この考え方を二次元に拡張し、二次元の画像における画素の位置を(x,y)で表した場合、二次元ガウス分布は、下記式(C−2)によって表される。尚、x及びyは、それぞれ、水平方向の位置及び垂直方向の位置を表している。この二次元ガウス分布をガウシアンフィルタに適用すると、ガウシアンフィルタの各フィルタ係数はhg(x,y)で表され、ガウシアンフィルタを位置(0,0)の画素に適用する時、位置(x,y)におけるフィルタ係数はhg(x,y)で表される。つまり、ガウシアンフィルタによるフィルタリング後の位置(0,0)の画素値に対する、フィルタリング前の位置(x,y)の画素値の寄与率はhg(x,y)で表される。 When this concept is extended to two dimensions and the pixel position in the two-dimensional image is represented by (x, y), the two-dimensional Gaussian distribution is represented by the following equation (C-2). Note that x and y represent a horizontal position and a vertical position, respectively. When this two-dimensional Gaussian distribution is applied to the Gaussian filter, each filter coefficient of the Gaussian filter is represented by h g (x, y). When the Gaussian filter is applied to the pixel at the position (0, 0), the position (x, The filter coefficient in y) is represented by h g (x, y). That is, the contribution ratio of the pixel value at the position (x, y) before filtering to the pixel value at the position (0, 0) after filtering by the Gaussian filter is represented by h g (x, y).

ステップS203では、8つのガウシアンフィルタとして、σ=1,3,5,7,9,11,13,15のガウシアンフィルタを用いることとする。続くステップS204では、小画像Lsと平滑化小画像RsG1〜RsG8の夫々との間で画像マッチングを行い、平滑化小画像RsG1〜RsG8の内、最もマッチング誤差が小さくなる平滑化小画像(即ち、小画像Lsとの相関性が最も高い平滑化小画像)を特定する。 In step S203, Gaussian filters with σ = 1, 3, 5, 7, 9, 11, 13, and 15 are used as the eight Gaussian filters. In subsequent step S204, image matching is performed between the small image Ls and each of the smoothed small images Rs G1 to Rs G8 , and among the smoothed small images Rs G1 to Rs G8 , the smoothing small that has the smallest matching error. An image (that is, a smoothed small image having the highest correlation with the small image Ls) is specified.

平滑化小画像RsG1に着目し、小画像Lsと平滑化小画像RsG1を対比した時のマッチング誤差(マッチング残差)の算出法を簡単に説明する。小画像Lsと平滑化小画像RsG1の画像サイズは同じであり、それらの水平方向の画素数及び垂直方向の画素数を夫々MN及びNNとする(MN及びNNは、2以上の整数)。小画像Ls内の位置(x,y)における画素の画素値をVLs(x,y)にて表し、平滑化小画像RsG1内の位置(x,y)における画素の画素値をVRs(x,y)にて表す。(但し、x及びyは、0≦x≦MN−1且つ0≦y≦NN−1、を満たす整数)。そうすると、対比画像間におけるSAD(Sum of Absolute Difference)を表すRSADは下記式(C−3)に従って算出され、対比画像間におけるSSD(Sum of Square Difference)を表すRSSDは下記式(C−4)に従って算出される。 Focusing on the smoothed small image Rs G1, briefly explaining the calculation method of the small image Ls and the smoothed small image Rs G1 matching error when the comparison (matching residuals). The image sizes of the small image Ls and the smoothed small image Rs G1 are the same, and the number of pixels in the horizontal direction and the number of pixels in the vertical direction are respectively M N and N N (M N and N N are 2 or more) Integer). The pixel value of the pixel at the position (x, y) in the small image Ls is represented by V Ls (x, y), and the pixel value of the pixel at the position (x, y) in the smoothed small image Rs G1 is represented by V Rs. It is represented by (x, y). (Where x and y are integers satisfying 0 ≦ x ≦ M N −1 and 0 ≦ y ≦ N N −1). Then, R SAD representing SAD (Sum of Absolute Difference) between contrast images is calculated according to the following equation (C-3), and R SSD representing SSD (Sum of Square Difference) between contrast images is represented by the following equation (C− Calculated according to 4).

このRSAD又はRSSDを、小画像Lsと平滑化小画像RsG1との間におけるマッチング誤差とする。同様にして、小画像Lsと平滑化小画像RsG2〜RsG8の夫々との間におけるマッチング誤差も求め、最もマッチング誤差が小さくなる平滑化小画像を特定する。今、σ=5に対応する平滑化小画像RsG3が特定されたとする。ステップS204では、平滑化小画像RsG3に対応するσをσ’とする。即ち、σ’の値は5となる。 Let R SAD or R SSD be a matching error between the small image Ls and the smoothed small image Rs G1 . Similarly, a matching error between the small image Ls and each of the smoothed small images Rs G2 to Rs G8 is also obtained, and the smoothed small image with the smallest matching error is specified. Now, it is assumed that the smoothed small image Rs G3 corresponding to σ = 5 is specified. In step S204, σ corresponding to the smoothed small image Rs G3 is set to σ ′. That is, the value of σ ′ is 5.

続くステップS205では、このσ’によって表されるガウスぼけを補正対象画像Lwの劣化の状態を表す画像劣化関数として取り扱うことにより、補正対象画像Lwの劣化除去を図る。   In the subsequent step S205, the Gaussian blur represented by σ 'is treated as an image deterioration function representing the deterioration state of the correction target image Lw, thereby deteriorating the correction target image Lw.

具体的には、ステップS205では、σ’に基づいて補正対象画像Lwの全体にアンシャープマスクフィルタを適用することにより、補正対象画像Lwのぶれを除去する。アンシャープマスクフィルタの適用前の画像を入力画像IINPUTとし、アンシャープマスクフィルタの適用後の画像を出力画像IOUTPUTとして、アンシャープマスクフィルタの処理内容を説明する。まず、アンシャープフィルタとしてσ’のガウシアンフィルタ(即ち、σ=5のガウシアンフィルタ)を採用し、このσ’のガウシアンフィルタを用いて入力画像IINPUTをフィルタリングすることにより、ぼかし画像IBLURを生成する。次に、入力画像IINPUTの各画素値からぼかし画像IBLURの各画素値を差し引くことにより、入力画像IINPUTとぼかし画像IBLURとの間の差分画像IDELTAを生成する。最後に、入力画像IINPUTの各画素値に差分画像IDELTAの各画素値を加算することによって得られた画像を、出力画像IOUTPUTとする。入力画像IINPUTと出力画像IOUTPUTとの関係式を式(C−5)に示す。式(C−5)において、(IINPUT・Gauss)は、σ’のガウシアンフィルタを用いて入力画像IINPUTをフィルタリングした結果を表している。 Specifically, in step S205, blurring of the correction target image Lw is removed by applying an unsharp mask filter to the entire correction target image Lw based on σ ′. Processing contents of the unsharp mask filter will be described with an image before application of the unsharp mask filter as an input image I INPUT and an image after application of the unsharp mask filter as an output image I OUTPUT . First, a σ ′ Gaussian filter (that is, a σ = 5 Gaussian filter) is used as an unsharp filter, and the input image I INPUT is filtered using this σ ′ Gaussian filter to generate a blurred image I BLUR . To do. Then, by subtracting each pixel value of the blurred image I BLUR from each pixel value of the input image I INPUT, and generates a difference image I DELTA between the input image I INPUT and the blurred image I BLUR. Finally, an image obtained by adding each pixel value of the difference image I DELTA to each pixel value of the input image I INPUT is defined as an output image I OUTPUT . Expression (C-5) shows a relational expression between the input image I INPUT and the output image I OUTPUT . In Expression (C-5), (I INPUT · Gauss) represents the result of filtering the input image I INPUT using a Gaussian filter of σ ′.

OUTPUT =IINPUT+IDELTA
=IINPUT+(IINPUT−IBLUR)
=IINPUT+(IINPUT−(IINPUT・Gauss) ・・・(C−5)
ステップS205では、補正対象画像Lwを入力画像IINPUTとして取り扱うことにより、出力画像IOUTPUTとしてのフィルタリング画像を得る。そして、ステップS206において、このフィルタリング画像のリンギングを除去して補正画像Qwを生成する(ステップS206の処理は、図14のステップS77の処理と同じである)。
I OUTPUT = I INPUT + I DELTA
= I INPUT + (I INPUT -I BLUR )
= I INPUT + (I INPUT- (I INPUT · Gauss) (C-5)
In step S205, the filtering target image Lw is handled as the input image I INPUT to obtain a filtered image as the output image I OUTPUT . In step S206, the ringing of the filtered image is removed to generate a corrected image Qw (the process in step S206 is the same as the process in step S77 in FIG. 14).

アンシャープマスクフィルタを用いることにより、入力画像(IINPUT)のエッジが強調され、画像鮮鋭化効果が得られる。但し、ぼかし画像(IBLUR)生成時におけるぼかし度合いが入力画像に含まれる実際のぼけ量と大きく異なると、適切なぼけ補正効果が得られない。例えば、ぼかし画像生成時におけるぼかし度合いが実際のぼけ量よりも大きいと、出力画像(IOUTPUT)は、極端に鮮鋭化された不自然な画像となる。一方、ぼかし画像生成時におけるぼかし度合いが実際のぼけ量よりも小さいと、鮮鋭化効果が弱すぎる。本補正方法では、アンシャープフィルタとしてσにてぼかし度合いが規定されるガウシアンフィルタを用い、そのガウシアンフィルタのσとして画像劣化関数に対応するσ’を用いる。このため、最適な鮮鋭化効果が得られ、ぼけが良好に除去された補正画像が得られる。即ち、見た目においてぶれの少ない画像を低い計算コストで生成することができる。 By using an unsharp mask filter, the edge of the input image (I INPUT ) is enhanced, and an image sharpening effect is obtained. However, if the blurring degree at the time of generating the blurred image (I BLUR ) is significantly different from the actual blur amount included in the input image, an appropriate blur correction effect cannot be obtained. For example, if the degree of blur at the time of blur image generation is larger than the actual blur amount, the output image (I OUTPUT ) becomes an extremely sharp and unnatural image. On the other hand, if the blurring degree at the time of generating the blurred image is smaller than the actual blur amount, the sharpening effect is too weak. In this correction method, a Gaussian filter whose degree of blurring is defined by σ is used as the unsharp filter, and σ ′ corresponding to the image degradation function is used as σ of the Gaussian filter. For this reason, an optimal sharpening effect is obtained, and a corrected image from which blur is well removed is obtained. That is, it is possible to generate an image with less blur in appearance at a low calculation cost.

尚、連写撮影時に、補正レンズや撮像素子の駆動による所謂光学式手ぶれ補正を適用することも考えられる。但し、連写枚数が多いと連写開始から終了までのトータルの手ぶれ量が非常に大きくなって、補正レンズや撮像素子の必要駆動量がそれらの可動範囲を超えることも多く、この場合は、連写の後半部において手ぶれ補正が全く効かなくなる。これに対し、上述の第1〜第3の補正方法によれば、そのような制限が加わることなく、連写画像群中の任意の要素画像に対して適切な手ぶれ補正を施すことができる。   It is also conceivable to apply so-called optical camera shake correction by driving a correction lens or an image sensor during continuous shooting. However, if the number of continuous shots is large, the total amount of camera shake from the start to the end of continuous shooting becomes very large, and the required drive amount of the correction lens and image sensor often exceeds their movable range. In the second half of continuous shooting, camera shake correction does not work at all. On the other hand, according to the above-described first to third correction methods, it is possible to perform appropriate camera shake correction on an arbitrary element image in the continuous-shot image group without such limitation.

<<第5実施例>>
次に、第5実施例を説明する。第5実施例では、動画撮影時における撮像装置1の動作を説明する。
<< 5th Example >>
Next, a fifth embodiment will be described. In the fifth embodiment, the operation of the imaging apparatus 1 during moving image shooting will be described.

動画撮影時においても上述してきた手ぶれ補正技術を利用できる。一方で、動画撮影時においては、撮像部11から取得した各フレーム画像の一部を切り出して切り出し画像を表示部15等に出力するようにしておき、隣接フレーム間の手ぶれに由来する隣接フレームの切り出し画像間の位置ずれを打ち消すように切り出し位置を制御する方法が知られている。この方法も手ぶれ補正の一種である。以下の説明では、この切り出し位置制御による手ぶれ補正と上述の各実施例で述べた手ぶれ補正を区別するため、前者をフレーム外手ぶれ補正、後者をフレーム内手ぶれ補正と呼ぶことがある。   The above-described camera shake correction technology can also be used during movie shooting. On the other hand, at the time of moving image shooting, a part of each frame image acquired from the imaging unit 11 is cut out and the cut-out image is output to the display unit 15 or the like. A method of controlling the cutout position so as to cancel the positional deviation between cutout images is known. This method is also a type of camera shake correction. In the following description, in order to distinguish the camera shake correction by the cutout position control from the camera shake correction described in each of the above-described embodiments, the former is sometimes referred to as out-of-frame camera shake correction, and the latter is referred to as in-frame camera shake correction.

図22及び図23は、動画撮影時における撮像装置1の動作の流れを表すフローチャートである。これらの図を参照して、この動作の流れを説明する。図22及び図23に示される各ステップの処理は、基本的に、主制御部13の制御の下、手ぶれ補正部19によって実行される。但し、一部の処理(表示など)は、撮像装置1内の他の部位が主体となって実行される。   22 and 23 are flowcharts showing the flow of operations of the imaging apparatus 1 during moving image shooting. The flow of this operation will be described with reference to these drawings. The processing of each step shown in FIGS. 22 and 23 is basically executed by the camera shake correction unit 19 under the control of the main control unit 13. However, some processes (display and the like) are executed mainly by other parts in the imaging apparatus 1.

まず、図1の録画ボタン17bに対する操作によって動画撮影指示がなされると、ステップS301に移行する。そこで、変数iを導入し、この変数iに1を代入してからステップS302に移行する。変数iの値は、現在のフレームの番号を表す。所定のフレーム周期(例えば、1/60秒)にて第1、第2、第3、・・・のフレームが順次訪れ、各フレームにおいて1枚のフレーム画像が取得される。   First, when a moving image shooting instruction is given by an operation on the recording button 17b in FIG. 1, the process proceeds to step S301. Therefore, the variable i is introduced, and 1 is assigned to the variable i, and then the process proceeds to step S302. The value of variable i represents the current frame number. The first, second, third,... Frames are sequentially visited in a predetermined frame period (for example, 1/60 seconds), and one frame image is acquired in each frame.

ステップS302では、現在のフレームにおけるフレーム画像を抽出する。抽出したフレーム画像をFwiとする。例えば、現在のフレームが第1のフレームである時には(即ち、i=1の時には)フレーム画像Fw1が抽出され、現在のフレームが第2のフレームである時には(即ち、i=2の時には)フレーム画像Fw2が抽出される。 In step S302, a frame image in the current frame is extracted. The extracted frame image and Fw i. For example, when the current frame is the first frame (ie, when i = 1), the frame image Fw 1 is extracted, and when the current frame is the second frame (ie, when i = 2). A frame image Fw 2 is extracted.

続くステップS303では、i=1であるか否かが確認され、現フレームが動画撮影の開始フレームである場合、即ちi=1の場合はステップS304に移行する。一方、i≠1の場合はステップS307に移行する。ステップ304では、フレーム画像Fwiから特徴的な小領域が抽出され、その小領域内の画像を小画像Fsiとしてメモリ上に記憶する。i=1の時にのみステップS304に至るのであるから、フレーム画像Fw1から小画像Fs1が抽出されることになる。例えば、フレーム画像Fwiを水平及び垂直方向に夫々3分割した時の中央の領域から、32×32画素の特徴的な小領域を抽出する。尚、特徴的な小領域の意義は、上述したとおりである。フレーム画像の全体領域でなく、特徴的な小領域を利用することにより、後のフレーム画像間の位置合わせ精度及びぶれ情報の検出精度を良好に維持しつつ、メモリ使用量を削減することができる。 In subsequent step S303, it is confirmed whether or not i = 1. If the current frame is a moving image shooting start frame, that is, if i = 1, the process proceeds to step S304. On the other hand, if i ≠ 1, the process proceeds to step S307. In step 304, the extracted characteristic small areas from the frame image Fw i, stored in the memory an image of the small area as a small image Fs i. Since step S304 is reached only when i = 1, the small image Fs 1 is extracted from the frame image Fw 1 . For example, the central region when the respectively divided into three frame images Fw i in the horizontal and vertical directions to extract a characteristic small area of 32 × 32 pixels. The significance of the characteristic small area is as described above. By using a characteristic small area instead of the entire area of the frame image, it is possible to reduce the memory usage while maintaining good alignment accuracy between subsequent frame images and blur information detection accuracy. .

上述のフレーム外手ぶれ補正を実現するために、動画撮影時には、隣接フレームのフレーム画像間における動きベクトルが算出される。フレーム画像Fwiに対して算出される動きベクトルをVECiで表す。動きベクトルVECiは、同時に、後述の画像Qwiに対する動きベクトルでもある。 In order to realize the above-described out-of-frame camera shake correction, a motion vector between frame images of adjacent frames is calculated during moving image shooting. The motion vectors calculated for the frame image Fw i represented by VEC i. The motion vector VEC i is also a motion vector for an image Qw i described later.

i=1の時には、まだ、1つのフレーム画像しか取得されていない。そこで、ステップS304に続くステップS305では、フレーム画像Fw1及び画像Qw1に対する動きベクトルVEC1の水平成分及び垂直成分をゼロとする(VEC1の大きさをゼロとする)。更に、続くステップS306において、フレーム内手ぶれ補正を行うことなく、現フレーム画像Fwiを画像Qwiとしてメモリ上に記憶する。従って、開始フレームのフレーム画像に対してフレーム内手ぶれ補正は行われない。ステップS306の処理後、ステップS321(図23参照)に移行する。 When i = 1, only one frame image has been acquired yet. Therefore, in step S305 following step S304, the horizontal and vertical components of the motion vector VEC 1 for the frame image Fw 1 and the image Qw 1 are set to zero (the magnitude of VEC 1 is set to zero). Further, in the subsequent step S306, without performing image stabilization in a frame, and stores in the memory the current frame image Fw i as an image Qw i. Accordingly, no intra-frame camera shake correction is performed on the frame image of the start frame. After step S306, the process proceeds to step S321 (see FIG. 23).

ステップS321以降の処理の説明の前に、i≠1の時に実施されるステップS307以降の処理内容について説明する。ステップS307では、現在の変数iの値が規定値Nより小さいかが確認される。今、Nは3以上の整数であるが、N=2とすることも可能である。i<Nの場合はステップS307からステップS308に移行して、変数bに1を代入する一方で、i≧Nの場合はステップS307からステップS309に移行して、変数bに(i―N+1)を代入する。ステップS308又はS309にて変数bの値を決定した後、ステップS310において、過去のフレーム画像Fwbから抽出された小画像Fsbに対応する小領域を現フレーム画像Fwiから抽出し、現フレーム画像Fwiから抽出した小領域内の画像を小画像Fsiとしてメモリ上に記憶する。対応小領域の探索は、テンプレートマッチング法などを利用した、上述の方法によって行うことができる。その後、ステップS311において、小画像Fsb〜Fsiの中から、最もぶれ量の小さな1枚の小画像を選択し、選択した小画像を小画像Rsとしてメモリ上に記憶する。その後、現フレームに対応する小画像Fsiと小画像Rsが異なるならば、現フレーム画像Fwiに対するフレーム内手ぶれ補正が行われる(ステップS312及びS313;詳細は後述)。 Prior to the description of the processing after step S321, the processing content after step S307 performed when i ≠ 1 will be described. In step S307, it is confirmed whether the current value of the variable i is smaller than the specified value N. Now, N is an integer of 3 or more, but it is possible to set N = 2. If i <N, the process proceeds from step S307 to step S308, and 1 is substituted for the variable b. On the other hand, if i ≧ N, the process proceeds from step S307 to step S309 to set the variable b to (i−N + 1). Is assigned. Step S308 or S309 after determining the value of the variable b in, in step S310, the extracted small area corresponding to the small image Fs b extracted from a past frame image Fw b from the current frame image Fw i, the current frame , stored in the memory and the image in the small area extracted from the image Fw i as a small image Fs i. The search for the corresponding small area can be performed by the above-described method using a template matching method or the like. Thereafter, in step S311, from among the small image Fs b ~Fs i, selects the most blurring amount of small one small image is stored in the memory of the small image selected as a small image Rs. Thereafter, if the small image Fs i corresponding to the current frame is different from the small image Rs, intra-frame camera shake correction for the current frame image Fw i is performed (steps S312 and S313; details will be described later).

今、N=5である場合を考えて、ステップS307〜S311の処理内容に対する補足説明を行う。尚、後述の説明から明らかとなるが、N=5である場合には、5フレーム分のフレーム画像を用いて、現フレーム画像の手ぶれ補正がなされる。N=5である場合において、2≦i≦4の時には、まだ5フレーム分の画像を取得していないので変数bに1を代入し(ステップS308)、4枚以下の小画像Fsb〜Fsi(=Fs1〜Fsi)の中から、最もぶれ量の小さな小画像を選択して小画像Rsとする。この小画像Rsを選択する処理は、上述してきた参照画像Rwを選択する処理に対応している(図4のステップS16参照)。一方、例えばi=6の時には、b=i−N+1=6−5+1=2より(ステップS309参照)第2〜第6のフレームが着目されて、ステップS310では現フレーム画像Fw6から小画像Fs2に対応する小画像Fs6が抽出され且つステップS311では5枚の小画像Fs2〜Fs6の中から、最もぶれ量の小さな小画像が小画像Rsとして選択される。手ぶれは画像全体に一様な劣化を与えると考えられるため、小画像Rsを含むフレーム画像のぶれ量は、フレーム画像Fw2〜Fw6のぶれ量の中で最も小さい。 Now, considering the case where N = 5, a supplementary explanation will be given to the processing contents of steps S307 to S311. As will be apparent from the description below, when N = 5, camera shake correction of the current frame image is performed using frame images for five frames. In the case of N = 5, when 2 ≦ i ≦ 4, images for 5 frames have not yet been acquired, so 1 is substituted into the variable b (step S308), and four or less small images Fs b to Fs A small image with the smallest blur amount is selected from i (= Fs 1 to Fs i ) to be a small image Rs. The process of selecting the small image Rs corresponds to the process of selecting the reference image Rw described above (see step S16 in FIG. 4). On the other hand, for example, i = 6 in the case of, b = i-N + 1 = 6-5 + 1 = ( see step S309) from 2 second to sixth frame is focused in the small image Fs from the current frame image Fw 6 In step S310 The small image Fs 6 corresponding to 2 is extracted, and in step S311, the small image with the smallest blur amount is selected as the small image Rs from the five small images Fs 2 to Fs 6 . Since camera shake is considered to cause uniform degradation on the entire image, the amount of blur of the frame image including the small image Rs is the smallest among the amounts of blur of the frame images Fw 2 to Fw 6 .

ステップS311における、小画像Fs2〜Fs6の中から小画像Rsとしての一つの小画像を選択する方法として、第3実施例にて述べた参照画像選択方法を使用することができる。
即ち例えば、図8に対応する第1の参照画像選択方法を採用する場合は、小画像Fs2〜Fs6を小画像Cs2〜Cs6として取り扱い、小画像Fs2〜Fs6に対する評価値Ka2〜Ka6を算出して小画像Fs2〜Fs6のぶれ量(及びフレーム画像Fw2〜Fw6のぶれ量)を推定する。そして例えば、評価値Ka2〜Ka6の内、評価値Ka4が最大であるのであれば小画像Fs4を小画像Rsとして選択する。
或いは、図10に対応する第2の参照画像選択方法を採用する場合は、小画像Fs2〜Fs6を小画像Cs2〜Cs6として取り扱い、小画像Fs2〜Fs6に対する評価値Kb2〜Kb6を算出して小画像Fs2〜Fs6のぶれ量(及びフレーム画像Fw2〜Fw6のぶれ量)を推定する。そして例えば、評価値Kb2〜Kb6の内、評価値Kb4が最大であるのであれば小画像Fs4を小画像Rsとして選択する。
また、評価値Ka2〜Ka6と評価値Kb2〜Kb6の双方を考慮して、小画像Rsを選択することも可能である。
As a method for selecting one small image as the small image Rs from the small images Fs 2 to Fs 6 in step S 311, the reference image selection method described in the third embodiment can be used.
That is, for example, when adopting the first reference picture selection method corresponding to FIG. 8, handling the small image Fs 2 ~Fs 6 as a small image Cs 2 to CS 6, the evaluation value Ka for small images Fs 2 ~Fs 6 2 to Ka 6 are calculated to estimate the shake amount of the small images Fs 2 to Fs 6 (and the shake amount of the frame images Fw 2 to Fw 6 ). For example, if the evaluation value Ka 4 is the maximum among the evaluation values Ka 2 to Ka 6 , the small image Fs 4 is selected as the small image Rs.
Alternatively, in the case of employing the second reference picture selection method corresponding to FIG. 10, handling the small image Fs 2 ~Fs 6 as a small image Cs 2 to CS 6, the evaluation value Kb for small images Fs 2 ~Fs 6 2 calculates the ~Kb 6 estimates the blur amount of the small image Fs 2 ~Fs 6 (and blurring amount of the frame image Fw 2 ~Fw 6). For example, if the evaluation value Kb 4 is the maximum among the evaluation values Kb 2 to Kb 6 , the small image Fs 4 is selected as the small image Rs.
In addition, it is possible to select the small image Rs in consideration of both the evaluation values Ka 2 to Ka 6 and the evaluation values Kb 2 to Kb 6 .

ステップS311の選択処理によって小画像Rsを得た後、ステップS312にて、この小画像Rsと現フレーム画像Fwiから抽出された小画像Fsiとが同じであるかを判断する。両者が同じである場合、即ち、現フレーム画像を含む直近のN個のフレーム画像の中で、現フレーム画像のぶれ量が最も小さい場合はステップS306に移行し、フレーム内手ぶれ補正を行うことなく現フレーム画像Fwiを画像Qwiとしてメモリ上に記憶してから図23のステップS321に移行する。一方、ステップS312にて、小画像Rsと小画像Fsiが同じでないと判断された場合は、ステップS313に移行し、現フレーム画像Fwiと小画像Rsを含む過去のフレーム画像に基づいて現フレーム画像Fwiに対してフレーム内手ぶれ補正を行い、フレーム内手ぶれ補正後の現フレーム画像Fwiを画像Qwiとしてメモリ上に記憶してからステップS321に移行する。例えば、小画像Rsが小画像Fs4の場合、小画像Rsを含む過去のフレーム画像とは、フレーム画像Fw4を指す。 After obtaining the small image Rs by the selection process of step S311, at step S312, the a small image Fs i extracted from the small image Rs and the current frame image Fw i to determine whether it is the same. If they are the same, that is, if the current frame image has the smallest amount of shake among the most recent N frame images including the current frame image, the process proceeds to step S306 without performing intra-frame image stabilization. migrating the current frame image Fw i after stored in the memory as an image Qw i to step S321 of FIG. 23. On the other hand, if it is determined in step S312 that the small image Rs and the small image Fs i are not the same, the process proceeds to step S313 and the current frame image Fw i and the past frame image including the small image Rs are displayed based on the current frame image Fs i. It performs frame-in image stabilization with respect to the frame image Fw i, moves from the stored in the memory in step S321 the current frame image Fw i after camera shake compensation in the frame as an image Qw i. For example, when the small image Rs is the small image Fs 4 , the past frame image including the small image Rs indicates the frame image Fw 4 .

ステップS313におけるフレーム内手ぶれ補正の方法として、第4実施例で述べた方法を利用可能である。即ち、現フレーム画像Fwiを補正対象画像Lwとして且つ小画像Rsを含む過去のフレーム画像を参照画像Rwとして取り扱って第4実施例で述べた第1〜第3の補正方法の何れかを用いることにより、補正画像Qwとしての画像Qwiを得ればよい。尚、図14に対応する第1の補正方法を採用する場合は、現フレーム画像Fwiから抽出された小画像Fsiを図14のステップS71にて抽出されるべき小画像Lsとして利用し、且つ、ステップS311にて選択された小画像Rsを図14のステップS72にて抽出されるべき小画像Rsとして利用すればよい。 The method described in the fourth embodiment can be used as the intra-frame camera shake correction method in step S313. That is, using any of the first to third correction method described in the fourth embodiment deals with a past frame image and including the small image Rs the current frame image Fw i as a correction target image Lw as the reference image Rw by, you get an image Qw i as corrected image Qw. When the first correction method corresponding to FIG. 14 is adopted, the small image Fs i extracted from the current frame image Fw i is used as the small image Ls to be extracted in step S71 of FIG. In addition, the small image Rs selected in step S311 may be used as the small image Rs to be extracted in step S72 of FIG.

図23のステップS321以降の処理について説明する。ステップS321では、代表点マッチング法やブロックマッチング法などを用い、画像Qwi-1及びQwiの画像データに基づいて、画像Qwi-1から見た画像Qwiの位置ずれ量を表す動きベクトルVECiを算出する。この動きベクトルVECiは、水平成分及び垂直成分を含む二次元量である。2つの画像間の位置ずれ量(動きベクトル)を算出する方法として、他の実施例にて既に述べた方法を利用可能である。特に例えば、画像Qwi-1及びQwiから抽出した、互いに対応する特徴的な小領域を用いてこの算出を行うようにするとよい。 Processing after step S321 in FIG. 23 will be described. In step S321, using a representative point matching method, a block matching method, or the like, based on the image data of the images Qw i-1 and Qw i , a motion vector representing the amount of positional deviation of the image Qw i viewed from the image Qw i-1. VEC i is calculated. This motion vector VEC i is a two-dimensional quantity including a horizontal component and a vertical component. As a method for calculating the positional deviation amount (motion vector) between two images, the method already described in other embodiments can be used. In particular, for example, this calculation may be performed using characteristic small regions corresponding to each other extracted from the images Qw i-1 and Qw i .

続くステップS322において、今までに算出された動きベクトルVEC1〜VECiを累積して得られる累積ベクトルWiを算出する。図24に示す如く、累積ベクトルWiは、着目した動きベクトルの終点とその次に得られた動きベクトルの始点とを一致させながら、順次、動きベクトルVEC1〜VECiを繋ぎ合わせていくことで生成される。 In subsequent step S322, a cumulative vector W i obtained by accumulating the motion vectors VEC 1 to VEC i calculated so far is calculated. As shown in FIG. 24, the accumulated vector W i sequentially connects the motion vectors VEC 1 to VEC i while matching the end point of the focused motion vector with the start point of the motion vector obtained next. Is generated.

累積ベクトルWiが求められた後、ステップS323において、図25に示す如く、画像Qwiの中心350から累積ベクトルWiにて表される分だけ移動した点351を中心とする固定サイズの切り出し枠352を設定し、その切り出し枠352内の画像を切り出し画像Qciとして画像Qwiから抽出する。例えば、切り出し枠352の水平方向及び垂直方向のサイズは、画像Qwiのそれらの80%とされる。 After the accumulated vector W i is obtained, in step S323, as shown in FIG. 25, a fixed size cut-out centered on a point 351 moved by the amount represented by the accumulated vector W i from the center 350 of the image Qw i. set the frame 352 is extracted from the image Qw i as an image Qc i cut an image of the trimming frame 352. For example, horizontal and vertical size of the clipping frame 352 is 80% of their image Qw i.

そして、ステップS324において、手ぶれ補正部19は、切り出し画像Qciが表示部15に表示され且つ記録媒体16に記録されるように、切り出し画像Qciの画像データを主制御部13を介して表示部15及び記録媒体16に出力する。 Then, in step S324, the motion blur correction portion 19, as cut image Qc i is recorded on and the recording medium 16 is displayed on the display unit 15, the image data of the clipped image Qc i via the main control unit 13 displays Output to the unit 15 and the recording medium 16.

その後、ステップS325では、シーンチェンジが生じたか、即ち、撮影対象が大きく変化したかを判断する。例えば、光学ズーム倍率の変更が生じたり、撮像装置1に対してパン操作やチルト操作が加わったりした時には、シーンチェンジが生じたと判断してステップS326にて変数iにゼロを代入してからステップS327に移行する。シーンチェンジが生じていないと判断した場合は、ステップ325からそのままステップS327に移行する。そして、ステップS327において、主制御部13は、操作部17に対する操作によって動画撮影の終了が指示されたかを確認し、その指示がなされた場合は動画撮影動作を終了する一方で、その指示がなされていない場合はステップS328にて変数iに1を加えてからステップS302(図22)に戻り、上述した処理を繰り返す。但し、ステップS302〜S313及びS321〜S328から成るループ処理は、1つのフレームにおいて1回だけ実行されるものとする。   Thereafter, in step S325, it is determined whether a scene change has occurred, that is, whether the subject to be photographed has changed significantly. For example, when a change in the optical zoom magnification occurs or when a panning or tilting operation is applied to the image pickup apparatus 1, it is determined that a scene change has occurred, and step S326 is performed after substituting zero for the variable i. The process proceeds to S327. If it is determined that no scene change has occurred, the process proceeds from step 325 to step S327 as it is. In step S327, the main control unit 13 confirms whether or not the end of the moving image shooting is instructed by an operation on the operation unit 17, and when the instruction is given, the moving image shooting operation is ended while the instruction is made. If not, 1 is added to the variable i in step S328, and the process returns to step S302 (FIG. 22) to repeat the above-described processing. However, the loop process composed of steps S302 to S313 and S321 to S328 is executed only once in one frame.

上述のように、フレーム内手ぶれ補正を行うことにより、各フレーム画像の露光期間中に手ぶれが生じても、各フレーム画像内におけるぶれが低減された、鮮明な画質の動画をユーザに提供することが可能となる。また、補正対象画像及び参照画像となるフレーム画像は、元々取得されるべき画像であるため、ぶれ補正を行うために別途の専用画像を取得する必要もない。故に、撮影時間やメモリ使用量に対する余分な負荷は発生しない。加えて、切り出し位置制御によるフレーム外手ぶれ補正を行うことにより、開始フレーム(或いは基準となるフレーム)と現フレームの切り出し画像の構図は同一となる。つまり、フレーム間の手ぶれも補正される。   As described above, by performing in-frame image stabilization, even if camera shake occurs during the exposure period of each frame image, the user can be provided with a clear video with reduced image blur in each frame image. Is possible. Further, since the correction target image and the frame image serving as the reference image are images that should be acquired originally, it is not necessary to acquire a separate dedicated image in order to perform blur correction. Therefore, there is no extra load on the shooting time and memory usage. In addition, by performing the out-of-frame camera shake correction by the cutout position control, the composition of the cutout image of the start frame (or the reference frame) and the current frame becomes the same. That is, camera shake between frames is also corrected.

上述の手法によれば、動画撮影中にリアルタイムに手ぶれ補正を行うことができるというメリットがあるが、フレーム内手ぶれ補正前の各フレーム画像を記録媒体16に一旦記録しおき、動画撮影終了後に、フレーム内手ぶれ補正を行って動画を形成するフレーム画像の枚数分の画像Qwiを生成することも可能である。これは、記録媒体16に記録されたフレーム内手ぶれ補正前の各フレーム画像を用いて、図22及び図23を用いて示した上述の処理を単に実行すれば足る。この場合、ある着目フレームのフレーム画像に対するフレーム内手ぶれ補正は、図26(a)に示す如く、その着目フレームの過去フレームのフレーム画像を用いて実行される(これは、動画撮影中にフレーム内手ぶれ補正を行う場合も同様である)。 According to the above-described method, there is an advantage that camera shake correction can be performed in real time during moving image shooting. However, each frame image before the intra-frame camera shake correction is temporarily recorded in the recording medium 16, and after moving image shooting is finished, it is also possible to generate an image Qw i of number of sheets of frame images forming the moving image by performing the image stabilization in the frame. For this, it is sufficient to simply execute the above-described processing shown in FIGS. 22 and 23 using each frame image recorded in the recording medium 16 before the intra-frame camera shake correction. In this case, in-frame image stabilization for a frame image of a certain frame of interest is executed using the frame image of the past frame of the frame of interest as shown in FIG. The same applies when camera shake correction is performed).

但し、動画撮影終了後であれば、ある着目フレームのフレーム画像に対するフレーム内手ぶれ補正を、その着目フレームの前後フレームのフレーム画像を用いて行うことも可能である。即ち、着目フレームと着目フレームの前後フレームとを含む合計Nフレーム分のフレーム画像を参照し、そのNフレーム分のフレーム画像の中で最もぶれ量の小さなフレーム画像を抽出する。そして、抽出した最もぶれ量の小さなフレーム画像を参照画像Rwとして且つ着目フレームのフレーム画像を補正対象画像Lwとして取り扱って、着目フレームのフレーム画像に対するフレーム内手ぶれ補正を実施すれば良い(但し、参照画像Rwと補正対象画像Lwが同じとなるならば実施不可)。このように着目フレームの前後フレームを利用することにより、より正確なフレーム内手ぶれ補正が実行可能となる。補正対象画像との撮影時間差が比較的短い参照画像を用いてフレーム内手ぶれ補正が実行されることになるからである。   However, after the moving image shooting is completed, the intra-frame camera shake correction for the frame image of a certain frame of interest can be performed using the frame images of the frames before and after the frame of interest. That is, frame images for a total of N frames including the target frame and frames before and after the target frame are referenced, and a frame image with the smallest blur amount is extracted from the frame images for the N frames. Then, the extracted frame image with the smallest blur amount is treated as the reference image Rw and the frame image of the target frame is treated as the correction target image Lw, and the intra-frame camera shake correction may be performed on the frame image of the target frame (however, refer to This is not possible if the image Rw and the correction target image Lw are the same). By using the frames before and after the frame of interest in this way, more accurate intra-frame camera shake correction can be performed. This is because intra-frame camera shake correction is performed using a reference image having a relatively short photographing time difference from the correction target image.

尚、フレーム内手ぶれ補正後の画像Qwi-1及びQwiの画像データを用いて動きベクトルVECiを算出する例を示したが(図23のステップS321参照)、フレーム内手ぶれ補正前のフレーム画像Fwi-1及びFwiの画像データを用いてフレーム画像Fwi-1とフレーム画像Fwiとの間の動きベクトルを算出し、これをステップS321にて算出されるべき動きベクトルVECiとして取り扱うようにしても良い。例えば、ステップS310(又はS304及びS310)の抽出結果に基づいて動きベクトルVECiを算出するようにしてもよい。即ち、フレーム画像Fwi-1内における小画像Fsi-1の位置と、フレーム画像Fwi内における小画像Fsiの位置との間の位置ずれ量から動きベクトルVECiを算出するようにしてもよい。 Although an example in which the motion vector VEC i is calculated using the image data of the images Qw i-1 and Qw i after the intra-frame camera shake correction (see step S321 in FIG. 23), the frame before the intra-frame camera shake correction is shown. using the image data of the image Fw i-1 and Fw i calculates a motion vector between frame images Fw i-1 and the frame image Fw i, which as the motion vector VEC i to be calculated in step S321 You may make it handle. For example, the motion vector VEC i may be calculated based on the extraction result in step S310 (or S304 and S310). That is, the position of the small image Fs i-1 in the frame image Fw in i-1, from the amount of positional deviation between the position of the small image Fs i in the frame image Fw i to calculate the motion vector VEC i Also good.

また、ステップS311の選択処理において、第3実施例で述べた第3又は第4の参照画像選択方法を利用することも可能である。これを、N=5且つi=6である場合を例にとって説明する。第3の参照画像選択方法を利用する場合、補正対象画像となるべき現フレーム画像Fw6に対する過去のフレーム画像Fw2〜Fw5の夫々の回転角θ2〜θ5を算出して、回転角θ2〜θ5の逆数を評価値Kc2〜Kc5として求める。そして、フレーム画像Fw2〜Fw5の内、大きな評価値に対応するフレーム画像内の小画像が小画像Rsとして優先的に選択されるようにする。第4の参照画像選択方法を利用する場合、各フレーム画像Fw2〜Fw5の、現フレーム画像Fw6に対する撮影時間差を求め、各フレーム画像Fw2〜Fw5に対して求められた撮影時間差の逆数を評価値Kd2〜Kd5として求める。そして、フレーム画像Fw2〜Fw5の内、大きな評価値に対応するフレーム画像内の小画像が小画像Rsとして優先的に選択されるようにする。 In the selection process in step S311, the third or fourth reference image selection method described in the third embodiment can be used. This will be described taking the case where N = 5 and i = 6 as an example. When using the third reference picture selection method, and calculates a rotation angle theta 2 through? 5 each of the past frame image Fw 2 ~Fw 5 for the current frame image Fw 6 to be a correction target image, the rotation angle Reciprocals of θ 2 to θ 5 are obtained as evaluation values Kc 2 to Kc 5 . Then, among the frame images Fw 2 to Fw 5 , the small image in the frame image corresponding to the large evaluation value is preferentially selected as the small image Rs. When using a fourth reference picture selection method, for each frame image Fw 2 ~Fw 5, obtains a photographing time difference for the current frame image Fw 6, the photographing time difference obtained for each frame image Fw 2 ~Fw 5 The reciprocal is obtained as evaluation values Kd 2 to Kd 5 . Then, among the frame images Fw 2 to Fw 5 , the small image in the frame image corresponding to the large evaluation value is preferentially selected as the small image Rs.

ステップS311の選択処理において第3又は第4の参照画像選択方法を利用した場合、ステップS311にて、小画像Fs2〜Fs6の中から、最もぶれ量の小さな小画像が選択されるとは限らない。しかし、ステップS313におけるフレーム内手ぶれ補正を行うためには、「小画像Rsのぶれ量は現フレーム画像Fwiから抽出された小画像Fsiのぶれ量よりも小さい」という必要条件を満たす必要がある。従って、第3又は第4の参照画像選択方法を利用する場合であっても、この必要条件が満たされるように、第1の参照画像選択方法による評価値(Ka2等)及び/又は第2の参照画像選択方法による評価値(Kb2等)を優先的に考慮するべきである。第3実施例で式(A−1)を示して説明したように、それら(Ka2やKb2等)を主として用いた上で、補助的に第3の参照画像選択方法による評価値(Kc2等)及び/又は第4の参照画像選択方法による評価値(Kd2等)を用い、上記の必要条件を満たした上で適切な小画像Rsを選択すればよい。 If the selection processing in step S311 using the third or fourth reference picture selection method, at step S311, from among the small image Fs 2 ~Fs 6, most blurring amount of small small image is selected Not exclusively. However, to perform the frame-in image stabilization in step S313 is "shake amount of the small image Rs is smaller than the shift amount of the small image Fs i extracted from the current frame image Fw i" must satisfy the requirements that is there. Accordingly, even when the third or fourth reference image selection method is used, the evaluation value (Ka 2 or the like) and / or the second reference image selection method is used so that this necessary condition is satisfied. The evaluation value (Kb 2 etc.) according to the reference image selection method should be preferentially considered. As described in the third embodiment with the expression (A-1), the evaluation value (Kc) by the third reference image selection method is supplementarily used after mainly using them (Ka 2 , Kb 2, etc.). 2 ) and / or an evaluation value (Kd 2 or the like) obtained by the fourth reference image selection method, and an appropriate small image Rs may be selected after satisfying the above-mentioned necessary conditions.

また、第3及び第4の参照画像選択方法は、現フレーム画像と小画像Rsを含むフレーム画像が異なることを前提としているため、ステップS311において、第3及び/又は第4の参照画像選択方法を利用する場合は、ステップS312では、以下の判断を行う(N=5且つi=6である場合を例にとる)。即ち、現フレーム画像Fw6のぶれ量よりも含むぶれ量が小さなフレーム画像がフレーム画像Fw2〜Fw5の中に存在するかを判断する。そして、存在していない場合はステップS306に移行する一方、存在している場合はステップS313に移行する。フレーム画像に含まれるぶれ量は、第1又は第2の参照画像選択方法の説明にて述べた方法を用いて推定できる。 In addition, since the third and fourth reference image selection methods are based on the premise that the current frame image and the frame image including the small image Rs are different, in step S311, the third and / or fourth reference image selection method is selected. In step S312, the following determination is made (N = 5 and i = 6 are taken as an example). That is, it is determined whether a frame image having a smaller blur amount than the current frame image Fw 6 is present in the frame images Fw 2 to Fw 5 . If it does not exist, the process proceeds to step S306. If it exists, the process proceeds to step S313. The amount of blur included in the frame image can be estimated using the method described in the description of the first or second reference image selection method.

<<第6実施例>>
次に、第6実施例を説明する。第6実施例では、上述してきた内容に対する応用例や変形例、注釈事項を説明する。
<< Sixth Example >>
Next, a sixth embodiment will be described. In the sixth embodiment, application examples, modifications, and annotations for the above-described contents will be described.

最初に、画像のぶれ量の推定に有益な技術的事項を説明する。第3実施例において、要素画像Cwiから小画像Csiを抽出し、小画像Csiのエッジ強度又はコントラストに基づいて要素画像Cwiの全体に対するぶれ量を推定できることを述べた(図8及び図10参照)。この際、小画像Csiを要素画像Cwiの中央付近から抽出する例を挙げたが、小画像Csiが要素画像Cwiの中央付近から抽出される必要性は必ずしもない。例えば、以下のようにするとよい。尚、説明の具体化のため、N=5の場合、即ち、連写画像群が5枚の要素画像Cw1〜Cw5から形成される場合を考える。 First, technical matters useful for estimating the amount of image blur will be described. In a third embodiment, it extracts the small image Cs i from the element image Cw i, said to be able to estimate the blur amount for the entire element image Cw i based on the edge intensity or contrast of the small image Cs i (FIG. 8 and (See FIG. 10). In this case, an example of extracting the small image Cs i from the vicinity of the center of the element images Cw i, it is not always necessary to the small image Cs i is extracted from the vicinity of the center of the element image Cw i. For example, the following may be performed. For the sake of concrete explanation, consider the case where N = 5, that is, the case where the continuous shot image group is formed from five element images Cw 1 to Cw 5 .

まず、ブロックマッチング法などを利用して、時間的に連続して撮影された2つの要素画像Cwi-1と要素画像Cwiの間におけるオプティカルフローを求める。ここにおけるオプティカルフローには、対比画像間における動きベクトルの束が含まれる。図27は、求められたオプティカルフローの例を示している。次に、求められたオプティカルフローに基づいて、一連の要素画像Cw1〜Cw5中における、小画像抽出用領域を検出する。小画像抽出用領域は、各要素画像内に定義される。そして、要素画像Cwiの小画像抽出用領域内から小画像Csiを抽出するようにする。 First, by using a block matching method or the like, an optical flow between two element images Cw i−1 and element images Cw i photographed continuously in time is obtained. The optical flow here includes a bundle of motion vectors between contrast images. FIG. 27 shows an example of the obtained optical flow. Next, a small image extraction region in the series of element images Cw 1 to Cw 5 is detected based on the obtained optical flow. The small image extraction area is defined in each element image. Then, so as to extract the small image Cs i from the small-image-extraction area of the element image Cw i.

例えば、連写撮影中において、撮像装置1が略固定され且つ撮影領域の中央付近に位置する人物が実空間上で動いている場合、その人物に対応する位置において有意な動きベクトルが検出される一方、要素画像の大部分を占める周辺部において、そのような動きベクトルは検出されない。有意な動きベクトルとは、所定の大きさ以上の大きさを有する動きベクトルであり、単純には大きさがゼロではない動きベクトルを意味する。図27は、このような場合におけるオプティカルフローを表している。この場合、有意な動きベクトルが検出されない領域は、実空間上で静止した被写体が描写される静被写体領域であり、この静被写体領域を小画像抽出用領域として検出する。図27の要素画像Cw1〜Cw5中における破線で囲まれた領域内部が、検出された小画像抽出用領域に対応している。 For example, during continuous shooting, when the imaging apparatus 1 is substantially fixed and a person located near the center of the shooting area is moving in real space, a significant motion vector is detected at a position corresponding to the person. On the other hand, such a motion vector is not detected in the peripheral portion occupying most of the element image. A significant motion vector is a motion vector having a magnitude greater than or equal to a predetermined magnitude, and simply means a motion vector whose magnitude is not zero. FIG. 27 shows an optical flow in such a case. In this case, the region where no significant motion vector is detected is a still subject region where a stationary subject is depicted in real space, and this still subject region is detected as a small image extraction region. The inside of the area surrounded by the broken line in the element images Cw 1 to Cw 5 in FIG. 27 corresponds to the detected small image extraction area.

また例えば、連写撮影中において、撮影領域の中央付近に位置する人物が実空間上で右方向に動いており且つ撮像装置1の筐体(不図示)がその人物に追従するように右方向に振られている場合、図28に示す如く、その人物に対応する位置において有意な動きベクトルは検出されず、一方、要素画像の大部分を占める周辺部(背景部分)において有意な動きベクトルが検出される。しかも、検出される、この有意な動きベクトルの大きさ及び向きは均一である。この場合、この有意な動きベクトルが検出される領域、即ち、画像中の支配的な動き領域を小画像抽出用領域として検出する(結果的に、図27に示す場合と同様の小画像抽出用領域が検出される)。   Also, for example, during continuous shooting, a person located near the center of the shooting area is moving in the right direction in real space, and the housing (not shown) of the imaging device 1 follows the person in the right direction. 28, as shown in FIG. 28, no significant motion vector is detected at a position corresponding to the person, while a significant motion vector is detected in the peripheral portion (background portion) that occupies most of the element image. Detected. Moreover, the magnitude and direction of the detected significant motion vector are uniform. In this case, a region where the significant motion vector is detected, that is, a dominant motion region in the image is detected as a small image extraction region (resulting in the same small image extraction region as that shown in FIG. 27). Area is detected).

また例えば、連写撮影中に全被写体及び撮像装置1が実空間上で静止している場合は、要素画像の全体領域において有意な動きベクトルは検出されない。この場合は、各要素画像の全体領域が静被写体領域であり、この静被写体領域を小画像抽出用領域として検出する。また例えば、連写撮影中において、全被写体が実空間上で静止しているものの撮像装置1の筐体が右方向に振られている場合或いは撮像装置1が実空間上で静止しているものの全被写体が均一に左方向に移動している場合は、図29に示す如く、要素画像の全体に渡って、大きさ及び向きが均一な、有意な動きベクトルが検出される。この場合は、要素画像の全体領域が支配的な動き領域であると判断され、その支配的な動き領域を小画像抽出用領域として検出する。   Also, for example, when all the subjects and the imaging device 1 are stationary in real space during continuous shooting, no significant motion vector is detected in the entire region of the element image. In this case, the entire region of each element image is a still subject region, and this still subject region is detected as a small image extraction region. Further, for example, during continuous shooting, when all subjects are stationary in real space but the casing of the imaging device 1 is swung to the right, or the imaging device 1 is stationary in real space. When all the subjects are moving in the left direction evenly, as shown in FIG. 29, a significant motion vector having a uniform size and orientation is detected over the entire element image. In this case, it is determined that the entire region of the element image is a dominant motion region, and the dominant motion region is detected as a small image extraction region.

このように、オプティカルフローを形成する複数の動きベクトルを統計処理することにより小画像抽出用領域を特定することができる。   As described above, the small image extraction region can be specified by statistically processing a plurality of motion vectors forming the optical flow.

或いは、実空間上で動く動被写体(人物など)を検出し、その動被写体が位置していない領域を小画像抽出用領域として検出するようにしてもよい。画像処理による、公知の動被写体の追尾技術を用いれば、要素画像の画像データを含む撮像部11の出力から動被写体を検出して追尾することが可能である。   Alternatively, a moving subject (such as a person) moving in real space may be detected, and an area where the moving subject is not located may be detected as a small image extraction region. If a known moving subject tracking technique based on image processing is used, it is possible to detect and track the moving subject from the output of the imaging unit 11 including the image data of the element image.

撮影領域内で不規則に動く動被写体が描画されている領域より小画像Csiを抽出し、その小画像Csiに基づいて第3実施例で述べた評価値(Kai又はKbi)を算出するようにすると(図8、図10参照)、該評価値が動被写体の動きの影響を受け、小画像Csi及び要素画像Cwiに対するぶれ量の推定精度が劣化する。結果、ぶれ量の小さな要素画像の選択、即ち、参照画像Rwの選択を失敗する可能が高まる。しかしながら、上記の如く、小画像抽出用領域(静被写体領域又は支配的な動き領域)を検出して小画像抽出用領域から小画像Csiを抽出するようにすれば、要素画像Cwi中に不規則に動く動被写体が含まれていたとしても、ぶれ量の少ない要素画像を参照画像Rwとして正確に抽出できるようになる。 A small image Cs i is extracted from a region where a moving subject that moves irregularly in the imaging region is drawn, and the evaluation value (Ka i or Kb i ) described in the third embodiment is extracted based on the small image Cs i. If the calculation is performed (see FIGS. 8 and 10), the evaluation value is affected by the motion of the moving subject, and the blur amount estimation accuracy for the small image Cs i and the element image Cw i deteriorates. As a result, there is an increased possibility that selection of an element image with a small blur amount, that is, selection of the reference image Rw will fail. However, as described above, if to extract small image Cs i from the detection to the small-image-extraction area of small-image-extraction areas (static subject area or dominant motion areas), in the element image Cw i Even if an irregularly moving moving subject is included, an element image with a small amount of blur can be accurately extracted as the reference image Rw.

また、要素画像Cwiの回転角に基づく評価値Kciを算出する際にも(図13参照)、補正対象対象Lwから複数の小領域が抽出されるが、評価値Kciが動被写体の動きの影響を受けるのを回避すべく、この複数の小領域も小画像抽出用領域から抽出するようにするとよい。 Further, (see FIG. 13) even when calculating the evaluation value Kc i based on the rotation angle of the element images Cw i, the plurality of small areas are extracted from the correction target object Lw, the evaluation value Kc i Gado subject In order to avoid the influence of movement, the plurality of small areas may be extracted from the small image extraction area.

また、連写撮影に着目して小画像抽出方法を説明したが、同一の考え方を、第5実施例に対応する動画撮影にも適用できる。即ち、上述した小画像抽出用領域の検出方法を利用し、図22のステップS311で参照される小画像Fsb〜Fsiをフレーム画像Fwb〜Fwiの小画像抽出用領域から抽出しておくようにするとよい。 Although the small image extraction method has been described focusing on continuous shooting, the same concept can be applied to moving image shooting corresponding to the fifth embodiment. That is, using the detection method of the small-image-extraction area as described above, by extracting the small image Fs b ~Fs i which is referred to in step S311 of FIG. 22 from the small-image-extraction area of the frame image Fw b ~Fw i It is good to leave.

この他の、上述してきた内容に対する応用例や変形例、注釈事項を、注釈1〜注釈4として以下に列記する。各注釈に記載された事項は、矛盾なき限り、任意に組み合わせることが可能である。   Other application examples, modified examples, and annotations for the above-described contents are listed below as annotations 1 to 4. The matters described in each comment can be arbitrarily combined as long as there is no contradiction.

[注釈1]
連写撮影における手ぶれ補正方法をしたが、この方法を、そのままブラケット撮影に対して適用することができる。この場合、上述してきた連写撮影をブラケット撮影と読み替えればよく、ブラケット撮影によって連続的に取得されたN枚の撮影画像をN枚の要素画像Cw1〜CwNと捉えればよい。この場合における要素画像の枚数(即ち、Nの値)も、連写撮影時と同様、ブラケット撮影によって取得されるべき画像の枚数と一致する。
[Note 1]
Although the camera shake correction method in continuous shooting was performed, this method can be applied to bracket shooting as it is. In this case, the continuous shooting described above may be read as bracket shooting, and N captured images continuously acquired by bracket shooting may be regarded as N element images Cw 1 to Cw N. In this case, the number of element images (that is, the value of N) also coincides with the number of images to be acquired by bracket shooting, as in continuous shooting.

連写撮影では、撮影に関する諸設定を変更することなく複数枚の撮影画像を連続的に取得する。撮影に関する諸設定とは、撮像部11の焦点距離、撮像部11の露出量、ホワイトバランスなどである。一方、一般的に知られているように、ブラケット撮影では、この諸設定を変更しながら複数枚の撮影画像を連続的に取得する。例えば、露出量に対するブラケット撮影を行う場合には、複数枚の撮影画像が異なる露出量にて取得されるように、撮像部11の絞り(不図示)の開度を順次変更させながら連続的に撮影を行う。   In continuous shooting, a plurality of shot images are continuously acquired without changing various settings relating to shooting. The various settings relating to shooting are the focal length of the image pickup unit 11, the exposure amount of the image pickup unit 11, white balance, and the like. On the other hand, as is generally known, in bracket shooting, a plurality of shot images are continuously acquired while changing these settings. For example, when performing bracket photography with respect to the exposure amount, continuously changing the aperture of the imaging unit 11 (not shown) sequentially so that a plurality of photographed images are acquired with different exposure amounts. Take a picture.

[注釈2]
上述した説明文中に示した具体的な数値は、単なる例示であって、当然の如く、それらを様々な数値に変更することができる。
[Note 2]
The specific numerical values shown in the above description are merely examples, and as a matter of course, they can be changed to various numerical values.

[注釈3]
図1の撮像装置1は、ハードウェア、或いは、ハードウェアとソフトウェアの組み合わせによって実現可能である。特に、手ぶれ補正部19の機能は、ハードウェア、ソフトウェア、またはハードウェアとソフトウェアの組み合わせによって実現可能であり、また、その機能を撮像装置1の外部装置(コンピュータ等)にて実現することも可能である。手ぶれ補正部19にて実現される機能の全部または一部を、プログラムとして記述し、該プログラムをプログラム実行装置(例えばコンピュータ)上で実行することによって、その機能の全部または一部を実現するようにしてもよい。ソフトウェアを用いて撮像装置1を構成する場合、ソフトウェアにて実現される部位についてのブロック図は、その部位の機能ブロック図を表すことになる。
[Note 3]
The imaging apparatus 1 in FIG. 1 can be realized by hardware or a combination of hardware and software. In particular, the function of the camera shake correction unit 19 can be realized by hardware, software, or a combination of hardware and software, and the function can also be realized by an external device (such as a computer) of the imaging device 1. It is. All or part of the functions realized by the camera shake correction unit 19 are described as a program, and the program is executed on a program execution device (for example, a computer) to realize all or part of the functions. It may be. When the imaging apparatus 1 is configured using software, a block diagram of a part realized by software represents a functional block diagram of the part.

[注釈4]
連写撮影又はブラケット撮影に関し、例えば、以下のように考えることができる。連写撮影又はブラケット撮影によってN枚の要素画像を取得する画像取得手段と、図4のステップS15の処理を実行して補正対象画像を抽出する補正対象画像抽出手段(補正対象画像選択手段)と、図4のステップS16の処理を実行して参照画像を抽出する参照画像抽出手段(参照画像選択手段)と、図4のステップ18の処理を実行して補正画像を生成する補正処理手段と、を有するぶれ補正装置が図1の撮像装置1に内在している。このぶれ補正装置は、主として、手ぶれ補正部19にて形成される、或いは、手ぶれ補正部19及び主制御部13にて形成される。更に、撮像装置1は、図4のステップS19の処理を実行して連写画像群に補正画像を関連付ける関連付け手段を有する。
[Note 4]
Regarding continuous shooting or bracket shooting, for example, the following can be considered. An image acquisition unit that acquires N element images by continuous shooting or bracket shooting, and a correction target image extraction unit (correction target image selection unit) that executes the process of step S15 in FIG. 4 to extract a correction target image. 4. Reference image extraction means (reference image selection means) for executing the process of step S16 in FIG. 4 to extract a reference image; Correction process means for generating a corrected image by executing the process in step 18 of FIG. Is included in the imaging apparatus 1 of FIG. This camera shake correction device is mainly formed by the camera shake correction unit 19, or is formed by the camera shake correction unit 19 and the main control unit 13. Further, the imaging apparatus 1 includes an association unit that associates the corrected image with the group of continuously shot images by executing the process of step S19 in FIG.

動画撮影に関し、例えば、以下のように考えることができる。動画撮影によって動画像を形成する複数のフレーム画像を取得する画像取得手段と、図22のステップS313の処理を行って補正対象画像と参照画像から補正画像(画像Qwi)を生成する補正処理手段と、図22のステップS311の処理を行い該処理結果に基づいて参照画像を抽出する参照画像抽出手段(参照画像選択手段)と、を有するぶれ補正装置が図1の撮像装置1に内在している。このぶれ補正装置は、主として、手ぶれ補正部19にて形成される、或いは、手ぶれ補正部19及び主制御部13にて形成される。このぶれ補正装置は、図23のステップS321及びS322の処理を行う位置ずれ検出手段と、図23のステップS323及びS324の処理を行う切り出し画像出力手段と、を更に備える。 Regarding moving image shooting, for example, the following can be considered. Image acquisition means for acquiring a plurality of frame images forming a moving image by moving image shooting, and correction processing means for generating a correction image (image Qw i ) from the correction target image and the reference image by performing the processing of step S313 in FIG. And a reference image extraction unit (reference image selection unit) that performs the process of step S311 in FIG. 22 and extracts a reference image based on the processing result. Yes. This camera shake correction device is mainly formed by the camera shake correction unit 19, or is formed by the camera shake correction unit 19 and the main control unit 13. The shake correction apparatus further includes a misalignment detection unit that performs the processes of steps S321 and S322 in FIG. 23 and a cut-out image output unit that performs the processes of steps S323 and S324 in FIG.

本発明の実施の形態に係る撮像装置の全体ブロック図である。1 is an overall block diagram of an imaging apparatus according to an embodiment of the present invention. 本発明の実施の形態に係り、連写画像群に対する手ぶれ補正手法の概念図である。FIG. 6 is a conceptual diagram of a camera shake correction method for a continuous shot image group according to the embodiment of the present invention. 本発明に関する第1〜第6実施例の概略を示した表である。It is the table | surface which showed the outline of the 1st-6th Example regarding this invention. 本発明の第1実施例に係る静止画手ぶれ補正の動作の流れを表すフローチャートである。4 is a flowchart showing a flow of still image camera shake correction operation according to the first embodiment of the present invention. 本発明の第2実施例に係るベストショット画像選択方法を説明するための図であり、連写画像群を形成する1つの要素画像を表す図である。It is a figure for demonstrating the best shot image selection method which concerns on 2nd Example of this invention, and is a figure showing one element image which forms a continuous-shot image group. 図5の要素画像内における人物の眼付近の拡大図である。FIG. 6 is an enlarged view near the eyes of a person in the element image of FIG. 5. 本発明の第2実施例に係るベストショット画像選択方法を説明するための図であり、連写画像群を形成する1つの要素画像を表す図である。It is a figure for demonstrating the best shot image selection method which concerns on 2nd Example of this invention, and is a figure showing one element image which forms a continuous-shot image group. 本発明の第3実施例に係り、第1の参照画像選択方法に関する動作の流れを表すフローチャートである。It is a flowchart showing the flow of operation | movement regarding the 3rd Example of this invention regarding the 1st reference image selection method. 図8に対応する動作説明を補助する概念図である。It is a conceptual diagram which assists operation | movement description corresponding to FIG. 本発明の第3実施例に係り、第2の参照画像選択方法に関する動作の流れを表すフローチャートである。It is a flowchart showing the flow of operation | movement regarding 2nd Example of this invention regarding the 2nd reference image selection method. 図10に対応する選択動作の意義を説明するための図であり、鮮明な要素画像とぶれの大きい不鮮明な要素画像を示す図である。It is a figure for demonstrating the significance of the selection operation | movement corresponding to FIG. 10, and is a figure which shows a clear element image and a blurred unclear element image with a big blur. 図11の各要素画像に対応する輝度ヒストグラムを示す図である。It is a figure which shows the brightness | luminance histogram corresponding to each element image of FIG. 本発明の第3実施例に係り、第3の参照画像選択方法による参照画像の選択動作を説明するための図である。It is a figure for demonstrating the selection operation | movement of the reference image by the 3rd reference image selection method concerning 3rd Example of this invention. 本発明の第4実施例に係り、第1の補正方法による手ぶれ補正処理の動作の流れを表すフローチャートである。FIG. 14 is a flowchart illustrating an operation flow of camera shake correction processing according to the first correction method according to the fourth embodiment of the present invention. 図14の手ぶれ補正処理の一部である、フーリエ反復法の詳細フローチャートである。FIG. 15 is a detailed flowchart of a Fourier iteration method, which is a part of the camera shake correction processing of FIG. 14. 図15のフーリエ反復法を実施する部位のブロック図である。It is a block diagram of the site | part which implements the Fourier iteration method of FIG. 本発明の第4実施例に係り、第2の補正方法による手ぶれ補正処理の動作の流れを表すフローチャートである。FIG. 14 is a flowchart illustrating an operation flow of camera shake correction processing according to a second correction method according to the fourth embodiment of the present invention. 図17に対応する手ぶれ補正処理の概念図である。FIG. 18 is a conceptual diagram of camera shake correction processing corresponding to FIG. 17. 本発明の第4実施例に係り、第3の補正方法による手ぶれ補正処理の動作の流れを表すフローチャートである。FIG. 14 is a flowchart illustrating an operation flow of camera shake correction processing according to a third correction method according to the fourth embodiment of the present invention. 図19に対応する手ぶれ補正処理の概念図である。FIG. 20 is a conceptual diagram of camera shake correction processing corresponding to FIG. 19. 本発明の第4実施例に係り、一次元のガウス分布を示す図である。It is a figure which concerns on 4th Example of this invention and shows a one-dimensional Gaussian distribution. 本発明の第5実施例に係る動画手ぶれ補正の動作の流れを表すフローチャートである。It is a flowchart showing the flow of the operation | movement of the moving image camera shake correction which concerns on 5th Example of this invention. 本発明の第5実施例に係る動画手ぶれ補正の動作の流れを表すフローチャートである。It is a flowchart showing the flow of the operation | movement of the moving image camera shake correction which concerns on 5th Example of this invention. 本発明の第5実施例に係り、複数の動きベクトルとそれらの累積ベクトルとの関係を示す図である。FIG. 10 is a diagram illustrating a relationship between a plurality of motion vectors and their accumulated vectors according to the fifth embodiment of the present invention. 本発明の第5実施例に係り、フレーム外手ぶれ補正を実現する切り出し位置制御を説明するための図である。It is a figure for demonstrating cutout position control which concerns on 5th Example of this invention, and implement | achieves out-of-frame camera shake correction. 本発明の第5実施例に係り、着目フレームのフレーム画像が過去のフレーム画像を用いて補正されることを示した図と、着目フレームのフレーム画像がその前後フレームのフレーム画像を用いて補正されることを示した図である。In the fifth embodiment of the present invention, a diagram showing that the frame image of the target frame is corrected using the past frame image, and the frame image of the target frame is corrected using the frame images of the previous and subsequent frames. It is the figure which showed that. 本発明の第6実施例に係り、連写画像群を形成する各要素画像と、隣接する要素画像間のオプティカルフローの例を示す図である。FIG. 20 is a diagram illustrating an example of an optical flow between each element image forming a continuous-shot image group and adjacent element images according to the sixth embodiment of the present invention. 本発明の第6実施例に係り、隣接する要素画像間のオプティカルフローの他の例を示す図である。It is a figure which concerns on 6th Example of this invention and shows the other example of the optical flow between adjacent element images. 本発明の第6実施例に係り、隣接する要素画像間のオプティカルフローの更に他の例を示す図である。It is a figure which concerns on 6th Example of this invention and shows the further another example of the optical flow between adjacent element images. 従来のフーリエ反復法を実現する構成のブロック図である。It is a block diagram of the structure which implement | achieves the conventional Fourier iteration method.

符号の説明Explanation of symbols

1 撮像装置
11 撮像部
13 主制御部
19 手ぶれ補正部
DESCRIPTION OF SYMBOLS 1 Imaging device 11 Imaging part 13 Main control part 19 Camera shake correction part

Claims (12)

撮像手段を用いた連写撮影又はブラケット撮影によって複数の原画像を取得する画像取得手段と、
前記複数の原画像の中から1枚の原画像を補正対象画像として抽出する補正対象画像抽出手段と、
前記複数の原画像の内、前記補正対象画像を除く各原画像を候補参照画像とし、複数の候補参照画像の中から、含まれるぶれ量が前記補正対象画像のそれよりも小さい候補参照画像を参照画像として抽出する参照画像抽出手段と、
前記補正対象画像と前記参照画像に基づいて前記補正対象画像のぶれを補正する補正処理手段と、備えた
ことを特徴とするぶれ補正装置
Image acquisition means for acquiring a plurality of original images by continuous shooting or bracket shooting using an imaging means;
Correction target image extraction means for extracting one original image as a correction target image from the plurality of original images;
Among the plurality of original images, each original image excluding the correction target image is set as a candidate reference image, and among the plurality of candidate reference images, a candidate reference image whose amount of blur is smaller than that of the correction target image is selected. Reference image extraction means for extracting as a reference image;
A blur correction apparatus comprising: correction processing means for correcting blur of the correction target image based on the correction target image and the reference image.
前記補正対象画像抽出手段は、
各原画像における人物の顔向き、
各原画像における人物の開眼状態、
各原画像における人物の表情、及び、
各原画像の構図、
の内の少なくとも1つに基づいて前記補正対象画像の抽出を行う
ことを特徴とする請求項1に記載のぶれ補正装置。
The correction target image extracting means includes
The face orientation of the person in each original image,
The person's open eye state in each original image,
The facial expression of the person in each original image, and
Composition of each original image,
The shake correction apparatus according to claim 1, wherein the correction target image is extracted based on at least one of the two.
撮像手段を用いた連続的な撮影によって複数のフレーム画像から成る動画像を取得する画像取得手段と、
複数のフレーム画像の中の、着目フレームにおけるフレーム画像を補正対象画像とし、前記補正対象画像に含まれるぶれを補正する補正処理手段と、
前記着目フレームの近傍フレームにおける各フレーム画像を候補参照画像とし、複数の候補参照画像の中から、含まれるぶれ量が前記補正対象画像のそれよりも小さい候補参照画像を参照画像として抽出する参照画像抽出手段と、を備え、
前記補正処理手段は、前記補正対象画像と前記参照画像に基づいて前記補正対象画像の前記ぶれを補正する
ことを特徴とするぶれ補正装置。
Image acquisition means for acquiring a moving image consisting of a plurality of frame images by continuous shooting using an imaging means;
A correction processing means for correcting a shake included in the correction target image, with the frame image in the frame of interest as a correction target image among the plurality of frame images;
Each frame image in a frame in the vicinity of the target frame is used as a candidate reference image, and a reference image that extracts a candidate reference image having a smaller blur amount than that of the correction target image as a reference image from among a plurality of candidate reference images. Extracting means,
The blur correction apparatus, wherein the correction processing unit corrects the blur of the correction target image based on the correction target image and the reference image.
前記参照画像抽出手段は、
前記補正対象画像と各候補参照画像のエッジ強度、及び、
前記補正対象画像と各候補参照画像のコントラスト、
の内の少なくとも一方に基づいて前記補正対象画像と各候補参照画像のぶれ量を推定することにより、前記参照画像の抽出を行う
ことを特徴とする請求項1〜請求項3の何れかに記載のぶれ補正装置。
The reference image extraction means includes
Edge strength of the correction target image and each candidate reference image, and
The contrast between the correction target image and each candidate reference image,
4. The reference image is extracted by estimating a blur amount between the correction target image and each candidate reference image based on at least one of the reference image. Blur correction device.
前記参照画像抽出手段は、
前記補正対象画像に対する各候補参照画像の回転角、及び、
各候補参照画像の、前記補正対象画像との撮影時間差、
の内の少なくとも一方を更に用いて、前記参照画像の抽出を行う
ことを特徴とする請求項4に記載のぶれ補正装置。
The reference image extraction means includes
The rotation angle of each candidate reference image with respect to the correction target image, and
Difference in shooting time between each candidate reference image and the correction target image,
The blur correction device according to claim 4, wherein the reference image is extracted by further using at least one of the reference image.
前記補正処理手段は、前記補正対象画像と前記参照画像に基づいて前記補正対象画像の前記ぶれに応じたぶれ情報を作成し、前記ぶれ情報に基づいて前記補正対象画像の前記ぶれを補正する
ことを特徴とする請求項1〜請求項5の何れかに記載のぶれ補正装置。
The correction processing unit creates blur information corresponding to the blur of the correction target image based on the correction target image and the reference image, and corrects the blur of the correction target image based on the blur information. The shake correction apparatus according to claim 1, wherein:
前記補正処理手段は、前記補正対象画像の色信号に前記参照画像の輝度信号を合成することによって、前記補正対象画像の前記ぶれを補正する
ことを特徴とする請求項1〜請求項5の何れかに記載のぶれ補正装置。
The correction processing unit corrects the blur of the correction target image by synthesizing a luminance signal of the reference image with a color signal of the correction target image. The camera shake correction device according to claim 1.
前記補正処理手段は、前記参照画像を用いて前記補正対象画像を鮮鋭化することにより、前記補正対象画像の前記ぶれを補正する
ことを特徴とする請求項1〜請求項5の何れかに記載のぶれ補正装置。
The correction processing unit corrects the blur of the correction target image by sharpening the correction target image using the reference image. Blur correction device.
連写撮影又はブラケット撮影の終了後、自動的に、前記補正対象画像の前記ぶれを補正することによって得られた補正画像を表示手段に出力する
ことを特徴とする請求項1又は請求項2に記載のぶれ補正装置。
The correction image obtained by correcting the blur of the correction target image is automatically output to the display unit after the continuous shooting or the bracket shooting is finished. The described blur correction device.
前記補正処理手段は、前記動画像を形成する各フレーム画像を、順次、前記補正対象画像として取り扱うことにより、各フレーム画像に含まれるぶれを補正し、
当該ぶれ補正装置は、
前記ぶれ補正後の各フレーム画像の一部を切り出し、各切り出し画像を表示手段又は記録媒体に出力する切り出し画像出力手段と、
隣接フレーム間の位置ずれを、その隣接フレームについての、ぶれ補正前又はぶれ補正後のフレーム画像に基づいて検出する位置ずれ検出手段と、を更に備え、
前記切り出し画像出力手段は、検出された前記位置ずれに基づいて前記切り出し画像の切り出し位置を設定する
ことを特徴とする請求項3に記載のぶれ補正装置。
The correction processing means corrects blur included in each frame image by sequentially handling each frame image forming the moving image as the correction target image,
The blur correction device is
Cut out a part of each frame image after the blur correction, and a cut image output unit that outputs each cut image to a display unit or a recording medium;
A positional deviation detecting means for detecting a positional deviation between adjacent frames based on a frame image of the adjacent frame before or after blur correction, and
The blur correction device according to claim 3, wherein the cut-out image output unit sets a cut-out position of the cut-out image based on the detected positional deviation.
撮像手段と、
請求項1〜請求項10の何れかに記載のぶれ補正装置と、を備えた
ことを特徴とする撮像装置。
Imaging means;
An image pickup apparatus comprising: the shake correction apparatus according to claim 1.
撮像手段と、
請求項1又は請求項2に記載のぶれ補正装置と、を備えた撮像装置であって、
前記複数の原画像と前記補正対象画像の前記ぶれを補正することによって得られた補正画像を互いに関連付ける関連付け手段と、
関連付けられた画像に対する操作を受け付ける操作受付手段と、を更に備え、
前記操作に基づく処理を関連付けられた画像の全てに一括して適用する
ことを特徴とする撮像装置。
Imaging means;
An image pickup apparatus comprising the shake correction apparatus according to claim 1 or 2,
Association means for associating the corrected images obtained by correcting the blur of the plurality of original images and the correction target image with each other;
An operation receiving means for receiving an operation on the associated image;
An image pickup apparatus that applies the process based on the operation to all of the associated images at once.
JP2007292432A 2007-11-09 2007-11-09 Blurring correction device and imaging apparatus Pending JP2009118434A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007292432A JP2009118434A (en) 2007-11-09 2007-11-09 Blurring correction device and imaging apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007292432A JP2009118434A (en) 2007-11-09 2007-11-09 Blurring correction device and imaging apparatus

Publications (1)

Publication Number Publication Date
JP2009118434A true JP2009118434A (en) 2009-05-28

Family

ID=40785014

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007292432A Pending JP2009118434A (en) 2007-11-09 2007-11-09 Blurring correction device and imaging apparatus

Country Status (1)

Country Link
JP (1) JP2009118434A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2381669A1 (en) * 2010-03-23 2011-10-26 Nikon Corporation Best shot selection using evaluation values updated after image processing
US9019387B2 (en) 2011-03-18 2015-04-28 Ricoh Company, Ltd. Imaging device and method of obtaining image
JPWO2020065706A1 (en) * 2018-09-25 2021-04-30 三菱電機株式会社 Information processing device and information processing method
CN114793265A (en) * 2021-01-26 2022-07-26 Oppo广东移动通信有限公司 Image processor, electronic device, and image correction method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002247444A (en) * 2001-02-14 2002-08-30 Olympus Optical Co Ltd Image processor and recording medium for recording image processing program
JP2004248021A (en) * 2003-02-14 2004-09-02 Minolta Co Ltd Imaging unit, image processor and image processing method
JP2005045600A (en) * 2003-07-23 2005-02-17 Casio Comput Co Ltd Image photographing apparatus and program
JP2005341229A (en) * 2004-05-27 2005-12-08 Sony Corp Imaging device
JP2007150802A (en) * 2005-11-29 2007-06-14 Seiko Epson Corp Control apparatus, photographing apparatus, control method of photographing apparatus, and control program
JP2007158488A (en) * 2005-12-01 2007-06-21 Sharp Corp Camera shake detecting apparatus
JP2007221710A (en) * 2006-02-20 2007-08-30 Seiko Epson Corp Image processing apparatus, photographing apparatus, image processing method and control program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002247444A (en) * 2001-02-14 2002-08-30 Olympus Optical Co Ltd Image processor and recording medium for recording image processing program
JP2004248021A (en) * 2003-02-14 2004-09-02 Minolta Co Ltd Imaging unit, image processor and image processing method
JP2005045600A (en) * 2003-07-23 2005-02-17 Casio Comput Co Ltd Image photographing apparatus and program
JP2005341229A (en) * 2004-05-27 2005-12-08 Sony Corp Imaging device
JP2007150802A (en) * 2005-11-29 2007-06-14 Seiko Epson Corp Control apparatus, photographing apparatus, control method of photographing apparatus, and control program
JP2007158488A (en) * 2005-12-01 2007-06-21 Sharp Corp Camera shake detecting apparatus
JP2007221710A (en) * 2006-02-20 2007-08-30 Seiko Epson Corp Image processing apparatus, photographing apparatus, image processing method and control program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2381669A1 (en) * 2010-03-23 2011-10-26 Nikon Corporation Best shot selection using evaluation values updated after image processing
US8928768B2 (en) 2010-03-23 2015-01-06 Nikon Corporation Image processing device and computer-readable computer program product containing image processing program
US9019387B2 (en) 2011-03-18 2015-04-28 Ricoh Company, Ltd. Imaging device and method of obtaining image
JPWO2020065706A1 (en) * 2018-09-25 2021-04-30 三菱電機株式会社 Information processing device and information processing method
JP7026812B2 (en) 2018-09-25 2022-02-28 三菱電機株式会社 Information processing equipment and information processing method
CN114793265A (en) * 2021-01-26 2022-07-26 Oppo广东移动通信有限公司 Image processor, electronic device, and image correction method

Similar Documents

Publication Publication Date Title
JP4748244B2 (en) Image selection apparatus, image selection method, and program
JP3934151B2 (en) Image generating apparatus and image generating method
JP5213670B2 (en) Imaging apparatus and blur correction method
JP4582423B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
KR100890949B1 (en) Electronic device and method in an electronic device for processing image data
JP2010011441A (en) Imaging apparatus and image playback device
JP4454657B2 (en) Blur correction apparatus and method, and imaging apparatus
US20090040364A1 (en) Adaptive Exposure Control
JP4752941B2 (en) Image composition apparatus and program
JP2011502367A (en) Camera motion detection and estimation
JP5210198B2 (en) Image processing apparatus, image processing method, and image processing program
TWI469085B (en) Image processing apparatus, image processing method and computer readable storage medium
WO2019124289A1 (en) Device, control method, and storage medium
JP5144724B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP6261205B2 (en) Image processing device
JP2005332381A (en) Image processing method, device and program
JP2009088935A (en) Image recording apparatus, image correcting apparatus, and image pickup apparatus
JP2009118434A (en) Blurring correction device and imaging apparatus
JP2007104249A (en) Image correcting apparatus, image correcting method, program and recording medium
US8243154B2 (en) Image processing apparatus, digital camera, and recording medium
JP2006049949A (en) Image processing apparatus, image processing method and program thereof
JP6486453B2 (en) Image processing apparatus, image processing method, and program
JP2019016893A (en) Image processing apparatus, control method therefor, and program
JP2009021909A (en) Image adder, method, and program
JP2009153046A (en) Blur correcting device and method, and imaging apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101101

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120216

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120221

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120619