JP2010067125A - Image processing apparatus, method for processing image, and program - Google Patents
Image processing apparatus, method for processing image, and program Download PDFInfo
- Publication number
- JP2010067125A JP2010067125A JP2008234419A JP2008234419A JP2010067125A JP 2010067125 A JP2010067125 A JP 2010067125A JP 2008234419 A JP2008234419 A JP 2008234419A JP 2008234419 A JP2008234419 A JP 2008234419A JP 2010067125 A JP2010067125 A JP 2010067125A
- Authority
- JP
- Japan
- Prior art keywords
- image
- frames
- images
- background
- subject
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、画像処理装置、画像処理方法、及びプログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and a program.
従来、固定されたカメラで移動する被写体を撮影し、1枚の画像(写真)内に当該被写体の移動の経過を表したストロボ画像が知られている。フィルムカメラの時代においては、長時間露光中に移動する被写体へ複数回のストロボ発光を行うことでストロボ画像を生成していたが、デジタルカメラが普及した今日においては、カメラ内のコンピュータによる画像処理でストロボ画像を生成することが可能となっている。 2. Description of the Related Art Conventionally, a strobe image is known in which a moving subject is photographed with a fixed camera and the movement of the subject is shown in one image (photo). In the era of film cameras, strobe images were generated by performing multiple strobes on a moving object during long exposures. Today, when digital cameras have become popular, image processing by computers in cameras It is possible to generate a strobe image.
上記のような画像処理によるストロボ画像生成を行っているものとして、例えば特許文献1には、連写画像の中から被写体が重ならない画像を選択し、その差を利用することで、被写体領域を抽出する技術が開示されている。
また、例えば特許文献2には、動画像上の特定の調査領域の相関パターンから背景が写っている時間区間を特定することで移動体を判別したり、被写体が写っている画像の前後の被写体が映っていない画像を利用して変動のない被写体を予想したりすることで、移動する被写体の移動速度を想定する技術が開示されている。
Further, for example, in Patent Document 2, a moving object is identified by specifying a time section in which a background is reflected from a correlation pattern of a specific investigation area on a moving image, or a subject before and after an image in which the subject is reflected. There is disclosed a technique that assumes a moving speed of a moving subject by predicting a subject that does not fluctuate using an image in which no image is reflected.
しかしながら、上記従来技術では、被写体が重ならない画像同士から被写体を抽出したり、動画上の特定の領域から背景らしい画像が写っている時間区間を特定したりすることで、被写体の位置を判別しているが、実際に生成されるストロボ画像において一番大きな領域を占める背景部分に関しては、選択の余地がなかった。そのため、ストロボ画像を生成した際、被写体に比べて背景がぶれていると、画像全体の印象が悪くなるという課題があった。 However, in the above prior art, the position of the subject is determined by extracting the subject from images where the subject does not overlap, or by identifying a time interval in which a background-like image is captured from a specific area on the moving image. However, there is no room for selection for the background portion that occupies the largest area in the actually generated strobe image. Therefore, when the strobe image is generated, if the background is blurred compared to the subject, there is a problem that the impression of the entire image is deteriorated.
本発明は、ぶれの小さい背景画像を選択可能な画像処理装置、画像処理方法、及びプログラムを提供することを目的とする。 An object of the present invention is to provide an image processing apparatus, an image processing method, and a program capable of selecting a background image with small blur.
請求項1に記載の発明は、上記目的を達成するためになされたものであり、画像処理装置において、複数フレームの画像から移動する被写体の被写体領域を抽出する抽出手段と、前記複数フレームの画像のうちぶれが最も小さい画像を選択する選択手段と、前記抽出手段により抽出された被写体領域、及び前記選択手段により選択された画像の背景領域に基づいてストロボ画像を合成する合成手段と、を備えることを特徴とする。
The invention described in
請求項2に記載の発明は、請求項1に記載の画像処理装置において、前記選択手段は、前記複数フレームの画像のそれぞれについて前記背景領域の高周波成分を算出し、当該算出された高周波成分が最も大きい画像を選択することを特徴とする。 According to a second aspect of the present invention, in the image processing apparatus according to the first aspect, the selection unit calculates a high-frequency component of the background region for each of the images of the plurality of frames, and the calculated high-frequency component is The largest image is selected.
請求項3に記載の発明は、請求項2に記載の画像処理装置において、前記高周波成分とは、斜めに隣接する位置のピクセル値の差の二乗和の総和であることを特徴とする。 According to a third aspect of the present invention, in the image processing apparatus according to the second aspect, the high-frequency component is a sum of square sums of differences between pixel values at obliquely adjacent positions.
請求項4に記載の発明は、請求項2に記載の画像処理装置において、前記高周波成分とは、上下左右に隣接する位置のピクセル値の差の二乗和の総和であることを特徴とする。 According to a fourth aspect of the present invention, in the image processing apparatus according to the second aspect, the high-frequency component is a sum of square sums of differences in pixel values at adjacent positions in the vertical and horizontal directions.
請求項5に記載の発明は、請求項1に記載の画像処理装置において、前記選択手段は、前記複数フレームの画像の位置合わせの結果に基づいて、前記画像間の位置変動量を算出し、当該算出された位置変動量が最も小さい画像を選択することを特徴とする。 According to a fifth aspect of the present invention, in the image processing apparatus according to the first aspect, the selection unit calculates a positional variation amount between the images based on a result of alignment of the images of the plurality of frames. An image having the smallest calculated amount of position variation is selected.
請求項6に記載の発明は、請求項1に記載の画像処理装置において、複数フレームの画像を連続して撮影するとともに、それぞれの画像のオートフォーカスによるフォーカス精度の評価値を取得する撮影手段を更に備え、前記選択手段は、前記撮影手段により取得された前記フォーカス精度の評価値に基づいて、ぶれが最も小さい画像を選択することを特徴とする。 According to a sixth aspect of the present invention, in the image processing apparatus according to the first aspect of the present invention, there is provided photographing means for continuously photographing images of a plurality of frames and acquiring an evaluation value of focus accuracy by autofocus of each image. In addition, the selection unit may select an image with the smallest blur based on the evaluation value of the focus accuracy acquired by the photographing unit.
請求項7に記載の発明は、請求項1に記載の画像処理装置において、複数フレームの画像を連続して撮影する撮影手段と、当該装置に生じるぶれ量を検出する検出手段と、を更に備え、前記選択手段は、前記検出手段により検出されたぶれ量に基づいて、前記複数フレームの画像間の位置変動量を算出し、当該算出された位置変動量が最も小さい画像を選択することを特徴とする。 According to a seventh aspect of the present invention, in the image processing device according to the first aspect of the present invention, the image processing device further includes a photographing unit that continuously captures images of a plurality of frames, and a detection unit that detects a blur amount generated in the device. The selection unit calculates a position variation amount between the images of the plurality of frames based on the blur amount detected by the detection unit, and selects an image having the smallest calculated position variation amount. And
請求項8に記載の発明は、複数フレームの画像から移動する被写体の被写体領域を抽出する抽出ステップと、前記複数フレームの画像のうちぶれが最も小さい画像を選択する選択ステップと、前記抽出ステップにより抽出された被写体領域、及び前記選択ステップにより選択された画像の背景領域に基づいてストロボ画像を合成する合成ステップと、を含むことを特徴とする画像処理方法である。 The invention according to claim 8 includes an extraction step of extracting a subject area of a moving object from a plurality of frames of images, a selection step of selecting an image with the smallest blur among the plurality of frames of images, and the extraction step. And a synthesizing step of synthesizing a stroboscopic image based on the extracted subject region and the background region of the image selected in the selecting step.
請求項9に記載の発明は、コンピュータに、複数フレームの画像から移動する被写体の被写体領域を抽出する抽出機能と、前記複数フレームの画像のうちぶれが最も小さい画像を選択する選択機能と、前記抽出機能により抽出された被写体領域、及び前記選択機能により選択された画像の背景領域に基づいてストロボ画像を合成する合成機能と、を実現させるためのプログラムである。 The invention according to claim 9 is an extraction function for extracting a subject area of a moving object from a plurality of frames of images, a selection function for selecting an image with the smallest blur among the plurality of frames, and It is a program for realizing a composition function for synthesizing a strobe image based on a subject area extracted by an extraction function and a background area of an image selected by the selection function.
本発明によれば、ぶれの小さい背景画像を選択可能な画像処理装置、画像処理方法、及びプログラムを提供することができる。 According to the present invention, it is possible to provide an image processing apparatus, an image processing method, and a program capable of selecting a background image with small blur.
以下、本発明の実施の形態を図面に基づいて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
図1は、本実施形態に係るデジタルカメラ1の概略構成を示すブロック図である。
図1に示すように、デジタルカメラ1は、画像データ生成部21と、データ処理部22と、ユーザインタフェース部23と、加速度センサ24と、を備えて構成される。
FIG. 1 is a block diagram showing a schematic configuration of a
As shown in FIG. 1, the
画像データ生成部21は、光学レンズ部101と、イメージセンサ102と、を備えて構成され、被写体を撮影する機能を有する。
光学レンズ部101は、被写体を撮影するために光を集光するレンズ等で構成されたものであり、焦点、露出、ホワイトバランス等のカメラ設定パラメータを調整するための周辺回路を備える。
イメージセンサ102は、例えば、CCD(Charge Coupled Device)等で構成され、光学レンズ部101が光を集光することによって結像した画像を、デジタル化した画像データ(画像フレーム)として取り込む。取り込まれた画像データは、データ処理部22のメモリ201に一時的に記憶される。
The image
The
The
なお、画像データ生成部21は、低解像度画像撮影(プレビュー撮影)と高解像度画像撮影が可能である。低解像度画像撮影は、例えば、画像解像度がXGA(Extended Graphics Array:1024×768ドット)程度と低いが、30fps(フレーム/秒)の速さで動画撮影と画像読み出しが可能である。一方、高解像度画像撮影は、例えば、撮影可能な最大画素数(例えば400万画素のカメラである場合はその400万画素)での画像撮影を行うことができるが、画像の読み取り速度は遅くなる。
Note that the image
データ処理部22は、メモリ201と、ビデオ出力部202と、画像処理部203と、制御部204と、プログラムメモリ207と、を備えて構成される。
メモリ201は、撮影処理を行う度にイメージセンサ102が取り込んだ画像データを一時記憶する。また、メモリ201は、画像処理に必要な画像データ、各種フラグの値、閾値等も記憶する。さらに、メモリ201は、画像表示を行うための表示画像データの記憶と読み出しを行うための表示メモリ領域を含んでいる。
ビデオ出力部202は、メモリ201の表示メモリ領域に格納された表示画像データを読み出し、当該読み出された表示画像データに基づいてRGB信号を生成し、当該生成されたRGB信号をユーザインタフェース部23の液晶表示部301に出力する。また、RGB信号を、ユーザインタフェース部23の外部インタフェース303を介して外部出力させることにより、テレビやPC、プロジェクタ等の外部機器に画像表示させることも可能である。
画像処理部203は、メモリ201に一時記憶されている画像データに対して、画像表示を行うための所定の画像処理を施す。当該画像処理を施された画像データは、表示画像データとしてメモリ201の表示メモリ領域に格納される。
The
The
The
The
制御部204は、図示しないCPUや記憶装置、及びAF処理部205、ぶれ補正処理部206、を含んで構成され、プログラムメモリ207に記憶されたデジタルカメラ1用のプログラムに従って各種制御動作を行う。
ここで、AF処理部205は、光学レンズ部101により結像された画像のフォーカス精度の評価値、例えば、コントラスト値や、後述するエッジ量に応じて、光学レンズ部101の図示しないフォーカスレンズの位置を制御する。また、ぶれ補正処理部206は、加速度センサ24から入力されたデジタルカメラ1のぶれ量に応じて、光学レンズ部101の図示しないぶれ補正レンズを光軸と直交する方向に駆動し、イメージセンサ102に結像する画像のぶれを補正するよう制御する。
The
Here, the
プログラムメモリ207は、例えば、ROM(Read Only Memory)やフラッシュメモリなどの記憶装置から構成され、制御部204の動作に必要な各種プログラムやデータを記憶する。具体的には、被写体を撮影し当該被写体のストロボ画像を生成するための撮影プログラム、特定された合成フレームから被写体を抽出してストロボ画像を合成するための合成プログラム、擬似背景画像を生成するための擬似背景画像生成プログラム、被写体を判別するための被写体判別パラメータ算出プログラム、被写体のみを抽出するための被写体抽出プログラム、好ましい背景を選択するための背景選択プログラム等を記憶している。
The
ユーザインタフェース部23は、液晶表示部301と、操作部302と、外部インタフェース303と、外部メモリ304と、を備えて構成される。
液晶表示部301は、ビデオ出力部202から出力されたRGB信号に基づいて被写体画像を表示する。具体的には、画像データ生成部21により生成された複数の画像データ(画像フレーム)に基づいたライブビュー画像や、録画中に外部メモリ304に記録される動画像を表示したり、外部メモリ304に記録された動画像を再生表示したりする。
なお、液晶表示部301は、ビデオ出力部202から適宜出力される表示画像データを一時的に記憶するビデオメモリ(図示せず)を備えるようにしてもよい。
操作部302は、ユーザがデジタルカメラ1における所定の操作を行うための機能であり、ユーザの操作に応じた操作信号を制御部204に出力する。操作部302は、例えば、シャッタボタン、選択決定用ボタン、再生ボタン、撮影ボタン等を備えている。
外部インタフェース303は、テレビやPC、プロジェクタ等の外部機器との接続用端子であり、所定の通信ケーブルを介してデータの送受信を行う。
外部メモリ304は、例えば、カード型の不揮発性メモリ(フラッシュメモリ)やハードディスク等により構成され、画像データ生成部21により撮影された被写体画像の画像データを、複数記憶する。
The
The liquid
Note that the liquid
The
The
The
加速度センサ24は、デジタルカメラ1の動きを物理的、直接的に検出し、角速度を示す測定値を制御部204に入力する。
The
図2は、実際にストロボ撮影を行っている様子について示した図である。また、図3は、図2で連続撮影されたフレーム群と、当該フレーム群を合成した画像(ストロボ画像)と、を示した図である。すなわち、図2に示したように被写体をデジタルカメラ1で連続撮影すると、図3(b)に示したようなストロボ画像が出来上がることとなる。
固定されたデジタルカメラ1で移動する被写体を連続撮影すると、フレーム内では被写体のみが移動することとなる。連続撮影された結果、図3(a)に示したような「フレーム」が生成される。このフレームの中で移動する被写体の領域(以下、移動領域)を後に述べる処理(図5に示す撮影処理)で抽出し、この抽出された移動領域を重ね合わせることで、図3(b)に示したような動きのある合成画像が生成される。
FIG. 2 is a diagram showing a state in which flash photography is actually performed. FIG. 3 is a diagram showing a group of frames continuously photographed in FIG. 2 and an image (strobe image) obtained by synthesizing the group of frames. That is, when the subject is continuously photographed with the
When a moving subject is continuously photographed by the fixed
移動領域を算出するには、まず、変動のない領域の特徴点の位置が同じになるようにして、すべてのフレームの位置ずれを補正する。
そして、位置合わせを行ったすべてのフレームにおける各座標のピクセル値(画素値)を、座標ごとに独立して順に並び替える。ここでピクセル値とは、例えば、RGB(赤(R)、緑(G)、青(B))の加算値の合計値や、YUV(輝度信号(Y)、輝度信号と青色成分の差(U)及び輝度信号と赤色成分の差(V))のY及びUVに係数をかけた値の合計値である。移動する被写体を連続して撮影すると、背景画像(移動体を除いた部分の画像)が一番多く写り込むことを利用すれば、並び替えたピクセル値のうち中央に位置する値を背景とみなすことができる。そうすると、例えば、図4に示すように、生成された背景画像を各フレームから引いた差分量の大きい座標を被写体とみなすことができる。
In order to calculate the moving region, first, the positional deviations of all the frames are corrected such that the positions of the feature points in the region without fluctuation are the same.
Then, the pixel values (pixel values) of the coordinates in all the frames that have been aligned are rearranged in order independently for each coordinate. Here, the pixel value is, for example, a total value of RGB (red (R), green (G), blue (B)) added values, YUV (luminance signal (Y), difference between luminance signal and blue component ( U) and the difference between the luminance signal and the red component (V)) are the sum of Y and UV multiplied by coefficients. If the moving image is taken continuously, the background image (the image of the part excluding the moving object) will be reflected in the largest amount, and the center value of the rearranged pixel values will be regarded as the background. be able to. Then, for example, as shown in FIG. 4, coordinates with a large difference amount obtained by subtracting the generated background image from each frame can be regarded as a subject.
しかし、例えば、背景領域として採用する画像に手振れがあった場合、背景画像の印象により画像全体の印象が悪くなってしまう。すなわち、背景画像を書き込む際、より位置ずれの少ない画像を選択する必要がある。
そこで、これらの問題を解決すべく行われる処理について、図5〜図12に示すフローチャートを用いて説明する。
However, for example, when an image used as the background area has a camera shake, the impression of the background image deteriorates the impression of the entire image. That is, when writing a background image, it is necessary to select an image with less positional deviation.
Therefore, processing performed to solve these problems will be described with reference to the flowcharts shown in FIGS.
(第1実施形態)
図5は、デジタルカメラ1内で行われる撮影処理の一例について示したフローチャートである。この撮影処理は、ユーザによりシャッタボタンが押下操作され、画像の撮影が開始されたことを契機に、制御部204がプログラムメモリ207に格納されている撮影プログラムを実行することにより実現される。
具体的には、ユーザにより撮影操作、すなわち、シャッタボタンの押下が行われると、当該操作に応じた入力信号が制御部204に入力される。制御部204は当該入力信号を受け付けると、画像データ生成部21を制御して、移動する被写体の連写撮影を行わせる。この連写撮影動作は、ユーザがシャッタボタンを押下し続けている間行われる。
(First embodiment)
FIG. 5 is a flowchart illustrating an example of a photographing process performed in the
Specifically, when the user performs a shooting operation, that is, a shutter button is pressed, an input signal corresponding to the operation is input to the
まず、図5に示すように、撮影画像を一時的にメモリ201に記憶させるとともに(ステップS101)、オートフォーカス(AF)のフォーカス精度を表す評価値を記憶する(ステップS102)。ステップS101及びステップS102を、停止操作が行われるまで繰り返す(ステップS103で“N0”)。一方、連写撮影中に停止操作が行われた場合(ステップS103で“Yes”)、全フレームの特徴点が合致するよう位置ずれを補正する(ステップS104)。その後、位置ずれが補正された撮影画像からストロボ画像を合成する合成処理を行う(ステップS105)。当該合成処理が行われると、合成された合成画像(ストロボ画像)を表示した(ステップS106)後、合成画像を外部メモリ304に記憶(ステップS107)させて終了する。 First, as shown in FIG. 5, the captured image is temporarily stored in the memory 201 (step S101), and an evaluation value representing the focus accuracy of autofocus (AF) is stored (step S102). Steps S101 and S102 are repeated until a stop operation is performed (“N0” in step S103). On the other hand, when a stop operation is performed during continuous shooting (“Yes” in step S103), the positional deviation is corrected so that the feature points of all frames match (step S104). After that, a composition process is performed for compositing a strobe image from the captured image with the misalignment corrected (step S105). When the synthesis process is performed, the synthesized image (strobe image) is displayed (step S106), and then the synthesized image is stored in the external memory 304 (step S107), and the process ends.
図6は、合成処理の一例について示したフローチャートである。
図6に示すように、合成対象の画像が取得されると、後述する擬似背景画像生成処理(ステップS121)、被写体判別パラメータ算出処理(ステップS122)を行う。その後、全フレームに対して被写体抽出処理(ステップS123)を行う。そして、最後の有効フレームの被写体領域の画像を取得し(ステップS124)、取得された被写体領域の画像のうち未登録の部分のみを上書きして登録し(ステップS125、S126)、最初の有効フレームまで順次被写体領域の画像のうち未登録の部分のみを上書きする(ステップS127で“No”、ステップS128)。上書きが終了すると(ステップS127で“Yes”)、まだ書き込まれていない未登録座標に対して後述する背景選択処理を行い(ステップS129)、当該背景選択されたフレームのデータを書き込んでいく(ステップS130)。これにより、例えば図3(b)のように、すべての座標にデータが書き込まれる。このように生成された合成画像は、液晶表示部301でプレビュー表示され(図5のステップS106)、外部メモリ304に記憶されることとなる(図5のステップS107)。
FIG. 6 is a flowchart illustrating an example of the synthesis process.
As shown in FIG. 6, when an image to be combined is acquired, a pseudo background image generation process (step S121) and a subject determination parameter calculation process (step S122) described later are performed. Thereafter, subject extraction processing (step S123) is performed on all frames. Then, the image of the subject area of the last effective frame is acquired (step S124), and only the unregistered portion of the acquired image of the subject area is overwritten and registered (steps S125 and S126). Until then, only the unregistered portion of the image of the subject area is overwritten (“No” in step S127, step S128). When overwriting is completed (“Yes” in step S127), background selection processing described later is performed on unregistered coordinates that have not yet been written (step S129), and data of the frame selected for the background is written (step S129). S130). Thereby, for example, as shown in FIG. 3B, data is written in all coordinates. The composite image generated in this way is displayed as a preview on the liquid crystal display unit 301 (step S106 in FIG. 5) and stored in the external memory 304 (step S107 in FIG. 5).
図7は、擬似背景画像生成処理の一例について示したフローチャートである。
まず、図7に示すように、座標(x,y)の初期化を行う(ステップS141)。次に、各フレームの同一座標(x,y)の値(ピクセル値)を取得する(ステップS142、ステップS143)。当該ピクセル値は、例えば、数1を演算することで算出することができる。
First, as shown in FIG. 7, the coordinates (x, y) are initialized (step S141). Next, the value (pixel value) of the same coordinate (x, y) of each frame is acquired (step S142, step S143). The pixel value can be calculated, for example, by calculating
図8は、被写体判別パラメータ算出処理の一例について示したフローチャートである。
まず、図8に示すように、座標(x,y)の初期化を行う(ステップS151)。次に、フレームnの座標(x,y)のピクセル値f(n,x,y)と擬似背景画像生成によって生成された擬似背景画像の座標(x,y)のピクセル値fb(x,y)との差fd(n,x,y)を算出し、ピクセル差分値として登録する(ステップS152)。当該ピクセル差分値は、例えば、数3を演算することで算出することができる。
First, as shown in FIG. 8, the coordinates (x, y) are initialized (step S151). Next, the pixel value f (n, x, y) of the coordinate (x, y) of the frame n and the pixel value fb (x, y) of the coordinate (x, y) of the pseudo background image generated by the pseudo background image generation. ) And fd (n, x, y) are calculated and registered as pixel difference values (step S152). The pixel difference value can be calculated by, for example, calculating Equation 3.
図9は、被写体抽出処理の一例について示したフローチャートである。
まず、図9に示すように、各フレームの画像と擬似背景画像とのそれぞれのピクセル値の差であるピクセル差分値fd(n,x,y)が、変動閾値moveの値以上の座標(x,y)を1、変動閾値moveの値より小さい座標(x,y)を0とするデータfp(n,x,y)を生成する(ステップS171〜ステップS174)。当該生成されるデータfp(n,x,y)は、例えば、数6を演算することで算出することができる。
First, as shown in FIG. 9, the pixel difference value fd (n, x, y), which is the difference between the pixel values of the image of each frame and the pseudo background image, is a coordinate (x , Y) is 1 and data fp (n, x, y) is generated with coordinates (x, y) smaller than the value of the fluctuation threshold move being 0 (steps S171 to S174). The generated data fp (n, x, y) can be calculated, for example, by calculating Equation 6.
なお、本実施形態では2値(0と1)の領域マスクデータを生成するようにしているが、擬似背景画像との差を明確に有り無しで表現できない(2値化できない)場合があるため、予め設けた閾値との差に基づいて段階を持った多値の領域マスクデータを生成するようにしてもよい。 In this embodiment, binary (0 and 1) area mask data is generated. However, there is a case where the difference from the pseudo background image cannot be expressed clearly or not (binarization cannot be performed). Alternatively, multi-value region mask data having steps may be generated based on a difference from a predetermined threshold value.
図10は、背景選択処理の一例について示したフローチャートである。
まず、図10に示すように、背景座標数と高周波成分をクリアする(ステップS191)。次に、図9のステップS179において生成した各フレームの領域マスクデータに基づいてフレーム内の座標位置が背景(背景領域)であるかを判定し(ステップS192)、座標位置が背景領域であると判定された場合(ステップS192で“Yes”)は、背景座標数を更新(+1)し(ステップS193)、さらに座標位置の高周波成分を算出して加算する(ステップS194)。当該高周波成分は、例えば、数7を演算することで算出することができる。
すべてのフレームについて上記処理を繰り返す(ステップS199で“No”)ことで、背景領域の高周波成分が最も大きいフレームを選択することが可能となる。そして、選択されたフレームデータを利用して、未登録座標の書き込みを行う(図6のステップS130)。
なお、本実施形態では数7にあるようなロバーツフィルタを用いたが、ソーベル等の微分フィルタを用いてもよい。
FIG. 10 is a flowchart illustrating an example of the background selection process.
First, as shown in FIG. 10, the number of background coordinates and the high frequency component are cleared (step S191). Next, it is determined whether the coordinate position in the frame is the background (background area) based on the area mask data of each frame generated in step S179 of FIG. 9 (step S192), and the coordinate position is the background area. If it is determined (“Yes” in step S192), the number of background coordinates is updated (+1) (step S193), and a high frequency component at the coordinate position is calculated and added (step S194). The high frequency component can be calculated, for example, by calculating Equation 7.
By repeating the above process for all frames (“No” in step S199), it becomes possible to select a frame having the largest high-frequency component in the background region. Then, unregistered coordinates are written using the selected frame data (step S130 in FIG. 6).
In this embodiment, the Roberts filter as shown in Equation 7 is used, but a differential filter such as Sobel may be used.
このように、第1実施形態では、連写した画像の中で背景とみなした領域の高周波成分を比較し、高周波成分が最大となるフレームを背景フレームとして採用することで、背景領域にぶれの小さい背景画像を選択することができる。また、合成後のストロボ画像の大部分を占める背景のぶれを可能な限り小さくし、結果として合成画像をぶれの少ない画像にすることが可能となる。 As described above, in the first embodiment, the high-frequency components of the region regarded as the background in the continuously shot image are compared, and the frame having the maximum high-frequency component is adopted as the background frame, so that the background region is not blurred. A small background image can be selected. In addition, it is possible to reduce background blur that occupies most of the combined strobe image as much as possible, and as a result, it is possible to make the composite image an image with less blur.
上記第1実施形態では、背景領域の高周波成分が最も大きいフレームを背景フレームとして採用したが、例えば、カメラのオートフォーカスにエッジヒストグラムを用いている場合、同様のことを行うことができる。
すなわち、カメラのオートフォーカスは評価値(高周波成分値)が大きいレンズ位置でフォーカスが合ったとみなすので、各フレームで継続して評価値を取得することができれば、それを利用して高周波成分が大きくてぶれの少ない背景画像を選択することが可能となる。以下、オートフォーカスを利用した背景選択処理について、図11のフローチャートを用いて説明する。
In the first embodiment, the frame having the largest high-frequency component in the background region is used as the background frame. However, for example, when an edge histogram is used for camera autofocus, the same can be performed.
In other words, the camera's autofocus is considered to be in focus at the lens position where the evaluation value (high-frequency component value) is large. If the evaluation value can be obtained continuously in each frame, the high-frequency component is increased using that value. It is possible to select a background image with less blur. Hereinafter, background selection processing using autofocus will be described with reference to the flowchart of FIG.
(第2実施形態)
図11は、背景選択処理の一例(背景選択処理2)について示したフローチャートである。
まず、図11に示すように、対象フレームnにおける高周波成分であるオートフォーカス(AF)用エッジ量を表すef[n]を取得する(ステップS211)。ここで、エッジ量とは、画像内の近接又は近傍ピクセル値間の差の総和である。ステップS211で今回取得した対象フレームのエッジ量が、既に取得したフレームのエッジ量と比較して大きい場合(ステップS212で“Yes”)は、当該対象フレームを背景フレームとして更新する(ステップS213)。
すべてのフレームについて上記処理を繰り返す(ステップS214で“No”)ことで、背景領域の高周波成分が最も大きいフレームを選択することができる。
(Second Embodiment)
FIG. 11 is a flowchart illustrating an example of background selection processing (background selection processing 2).
First, as shown in FIG. 11, ef [n] representing an autofocus (AF) edge amount that is a high-frequency component in the target frame n is acquired (step S211). Here, the edge amount is the sum of differences between adjacent or neighboring pixel values in the image. If the edge amount of the target frame acquired this time in step S211 is larger than the edge amount of the already acquired frame (“Yes” in step S212), the target frame is updated as a background frame (step S213).
By repeating the above process for all frames (“No” in step S214), it is possible to select a frame having the largest high-frequency component in the background region.
このように、第2実施形態では、連写した画像の中で背景とみなした領域の高周波成分(エッジ量)を比較し、エッジ量が最大となるフレームを背景フレームとして採用することで、背景領域にぶれの小さい背景画像を選択することができる。また、合成後のストロボ画像の大部分を占める背景のぶれを可能な限り小さくし、結果として合成画像をぶれの少ない画像にすることが可能となる。
また、フォーカス精度は撮影時に決定しているため、対象フレームnにおけるフォーカス精度を表すエッジ量ef[n]をフレーム数分比較し、エッジ量が最大となるフレームを選択することで、最適な背景選択を行うことができる。
As described above, in the second embodiment, the high-frequency component (edge amount) of the region regarded as the background in the continuously shot image is compared, and the frame having the maximum edge amount is employed as the background frame, thereby allowing the background It is possible to select a background image with less blur in the area. In addition, it is possible to reduce background blur that occupies most of the combined strobe image as much as possible, and as a result, it is possible to make the composite image an image with less blur.
In addition, since the focus accuracy is determined at the time of shooting, the optimum amount of background can be obtained by comparing the edge amount ef [n] representing the focus accuracy in the target frame n by the number of frames and selecting the frame having the maximum edge amount. Selection can be made.
なお、フォーカス精度をコントラスト値で評価している場合は、ステップS211においてコントラスト値を取得し、ステップS212においてコントラスト値が大きいか否かを判別するようにしてもよい。 When the focus accuracy is evaluated by the contrast value, the contrast value may be acquired in step S211 and it may be determined whether the contrast value is large in step S212.
(第3実施形態)
図12は、背景選択処理の一例(背景選択処理3)について示したフローチャートである。背景選択処理3では、フレーム間のずれが最も小さい画像を背景として選択する。なお、合成処理における背景選択処理3の段階では、図5のステップS104、S105に示したように位置合わせは終了しているので、位置合わせに利用する数8に示すような変形行列の移動成分(位置合わせパラメータ)から、フレーム間のずれ量(平行移動成分)を算出することができる。
FIG. 12 is a flowchart illustrating an example of background selection processing (background selection processing 3). In the background selection process 3, an image with the smallest shift between frames is selected as the background. Note that, at the stage of the background selection process 3 in the composition process, since the alignment is completed as shown in steps S104 and S105 of FIG. 5, the moving component of the deformation matrix as shown in Equation 8 used for the alignment is used. From the (positioning parameter), it is possible to calculate the amount of shift (translation component) between frames.
まず、図12に示すように、対象フレームnにおける平行移動量d[n]を、例えば、数9を演算することで算出する(ステップS221)。ここで、数8に示した位置補正計算パラメータはすでに算出済みであるものとする。
例えば、第1実施形態、第2実施形態のように高周波成分で背景を判別する場合は、高周波成分e[n]、又はef[n]が最大となるものを選択すればよいが、第3実施形態のように平行移動量で背景を判別する場合は、値d[n]が最小のものを選択する。すなわち、平行移動量が最も小さい画像を背景として選択することで、ぶれの小さい画像を選択することが可能となる。 For example, when the background is discriminated by the high frequency component as in the first embodiment and the second embodiment, the one having the highest high frequency component e [n] or ef [n] may be selected. When the background is determined by the amount of parallel movement as in the embodiment, the one having the smallest value d [n] is selected. That is, by selecting an image with the smallest amount of parallel movement as the background, it is possible to select an image with less blur.
以上、本発明に係る実施形態に基づいて具体的に説明したが、本発明は上記実施形態に限定されるものではなく、その要旨を逸脱しない範囲で変更可能である。 As mentioned above, although concretely demonstrated based on embodiment which concerns on this invention, this invention is not limited to the said embodiment, It can change in the range which does not deviate from the summary.
例えば、フレームごとのぶれ量を特定するために、近年カメラに搭載されている加速度センサの測定値を利用することも有効である。
加速度センサによる測定値を利用する場合は、オートフォーカスを利用する場合と同様、撮影直後に各フレームの移動量(位置変動量)が算出されている。また、加速度センサによる測定値を利用した背景選択処理は、図12と同様、数9で算出される移動量を利用して行うことができる。すなわち、移動量が最も小さい画像を背景として選択することで、ぶれの小さい画像を選択することが可能となる。
For example, in order to specify the amount of shake for each frame, it is also effective to use the measurement value of an acceleration sensor mounted on a camera in recent years.
When using the measurement value by the acceleration sensor, the movement amount (position fluctuation amount) of each frame is calculated immediately after shooting, as in the case of using autofocus. Further, the background selection process using the measurement value by the acceleration sensor can be performed using the movement amount calculated by Equation 9, as in FIG. That is, by selecting an image with the smallest amount of movement as the background, it is possible to select an image with a small amount of blur.
なお、オートフォーカス用エッジ量を含む高周波成分は、数7に示したように、斜めに隣接する位置のピクセル値の差の二乗和の総和としてもよく、又、上下左右に隣接する位置のピクセル値の差の二乗和の総和としてもよい。このように、近接又は近傍の位置のピクセル値の差で算出すればそれだけ細かい変化に敏感になり、エッジ量が大きいということは近接又は近傍の位置のピクセル値の差が大きいため、コントラストのあるくっきりとしたぶれの少ない画像であると言うことができる。また、離れた位置のピクセル値の差で算出すれば、細かい変化には反応しなくなる。
さらに、近接又は近傍の位置のピクセル値の差としたが、近接又は近傍のピクセル間の輝度の差の総和でもよい。また、近接又は近傍のピクセル間の彩度の差の総和でもよく、近接又は近傍のピクセル間の明度の差の総和でもよい。さらに、近接又は近傍のピクセル間のRGB(赤(R)、緑(G)、青(B))それぞれの差の総和、或いは近接又は近傍のピクセル間のYUV(輝度信号(Y)、輝度信号と青色成分の差(U)及び輝度信号と赤色成分の差(V))それぞれの差の総和でもよく、近接又は近傍のピクセル間のCMYK(シアン(C)、マゼンダ(M)、イエロー(Y)及びブラック(Bk))それぞれの差の総和でもよい。
すなわち、画像を表現する要素であればどのような要素の近接又は近傍の差の総和でもよい。
The high-frequency component including the amount of edge for autofocus may be the sum of the square sums of the differences between the pixel values at the diagonally adjacent positions as shown in Equation 7, or the pixels at the adjacent positions in the vertical and horizontal directions. It is good also as the sum total of the square sum of the difference of a value. In this way, if it is calculated by the difference between the pixel values at the adjacent or neighboring positions, it becomes more sensitive to fine changes, and the large edge amount means that the difference between the pixel values at the neighboring or neighboring positions is large, so that there is a contrast. It can be said that it is a clear image with little blur. In addition, if it is calculated by the difference between pixel values at distant positions, it will not respond to small changes.
Furthermore, although the difference in pixel values between adjacent or neighboring positions is used, the sum of luminance differences between neighboring or neighboring pixels may be used. Further, it may be the sum of chroma differences between adjacent or neighboring pixels, or the sum of brightness differences between neighboring or neighboring pixels. Furthermore, the sum of differences of RGB (red (R), green (G), blue (B)) between adjacent or neighboring pixels, or YUV (luminance signal (Y), luminance signal between neighboring or neighboring pixels). And the sum of the difference between the luminance signal and the red component (V)), and CMYK (cyan (C), magenta (M), yellow (Y ) And black (Bk)).
In other words, the sum of differences between adjacent or neighboring elements may be used as long as they represent an image.
なお、本発明に係る画像処理装置は、上記実施形態で例示したデジタルカメラ1のように、本発明に係る構成や機能を予め備えた画像処理装置として提供できる他、制御部204の各機能と同様の機能を実現するプログラムを適用することにより、既存の画像処理装置を本発明に係る画像処理装置として機能させることもできる。
Note that the image processing apparatus according to the present invention can be provided as an image processing apparatus provided with the configuration and functions according to the present invention in advance, like the
このようなプログラムの適用方法は任意であり、例えば、CD−ROMやメモリカードなどの記憶媒体に格納して適用できる他、例えば、インターネットなどの通信媒体を介して適用することもできる。 The application method of such a program is arbitrary. For example, the program can be applied by being stored in a storage medium such as a CD-ROM or a memory card, or can be applied via a communication medium such as the Internet.
1・・・デジタルカメラ、21・・・画像データ生成部、101・・・光学レンズ部、102・・・イメージセンサ、22・・・データ処理部、201・・・メモリ、202・・・ビデオ出力部、203・・・画像処理部、204・・・制御部、205・・・AF処理部、206・・・ぶれ補正処理部、207・・・プログラムメモリ、23・・・ユーザインタフェース部、301・・・液晶表示部、302・・・操作部、303・・・外部インタフェース、304・・・外部メモリ、24・・・加速度センサ
DESCRIPTION OF
Claims (9)
前記複数フレームの画像のうちぶれが最も小さい画像を選択する選択手段と、
前記抽出手段により抽出された被写体領域、及び前記選択手段により選択された画像の背景領域に基づいてストロボ画像を合成する合成手段と、
を備えることを特徴とする画像処理装置。 Extraction means for extracting a subject area of a moving subject from a plurality of frames of images;
Selecting means for selecting an image with the smallest blur among the images of the plurality of frames;
Synthesizing means for synthesizing a strobe image based on the subject area extracted by the extracting means and the background area of the image selected by the selecting means;
An image processing apparatus comprising:
前記選択手段は、前記撮影手段により取得された前記フォーカス精度の評価値に基づいて、ぶれが最も小さい画像を選択することを特徴とする請求項1に記載の画像処理装置。 In addition to continuously shooting images of a plurality of frames, the camera further includes shooting means for acquiring an evaluation value of focus accuracy by autofocus of each image,
The image processing apparatus according to claim 1, wherein the selection unit selects an image with the smallest blur based on the evaluation value of the focus accuracy acquired by the photographing unit.
当該装置に生じるぶれ量を検出する検出手段と、を更に備え、
前記選択手段は、前記検出手段により検出されたぶれ量に基づいて、前記複数フレームの画像間の位置変動量を算出し、当該算出された位置変動量が最も小さい画像を選択することを特徴とする請求項1に記載の画像処理装置。 Photographing means for continuously photographing images of a plurality of frames;
Detecting means for detecting the amount of shake generated in the device,
The selection unit calculates a position variation amount between the images of the plurality of frames based on a blur amount detected by the detection unit, and selects an image having the smallest calculated position variation amount. The image processing apparatus according to claim 1.
前記複数フレームの画像のうちぶれが最も小さい画像を選択する選択ステップと、
前記抽出ステップにより抽出された被写体領域、及び前記選択ステップにより選択された画像の背景領域に基づいてストロボ画像を合成する合成ステップと、
を含むことを特徴とする画像処理方法。 An extraction step of extracting a subject area of a moving subject from a plurality of frames of images;
A selection step of selecting an image with the smallest blur among the images of the plurality of frames;
A synthesizing step of synthesizing a stroboscopic image based on the subject region extracted by the extracting step and the background region of the image selected by the selecting step;
An image processing method comprising:
複数フレームの画像から移動する被写体の被写体領域を抽出する抽出機能と、
前記複数フレームの画像のうちぶれが最も小さい画像を選択する選択機能と、
前記抽出機能により抽出された被写体領域、及び前記選択機能により選択された画像の背景領域に基づいてストロボ画像を合成する合成機能と、
を実現させるためのプログラム。 On the computer,
An extraction function for extracting a subject area of a moving subject from a multi-frame image;
A selection function for selecting an image with the smallest blur among the images of the plurality of frames;
A synthesis function for synthesizing a strobe image based on a subject area extracted by the extraction function and a background area of the image selected by the selection function;
A program to realize
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008234419A JP5181952B2 (en) | 2008-09-12 | 2008-09-12 | Image processing apparatus, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008234419A JP5181952B2 (en) | 2008-09-12 | 2008-09-12 | Image processing apparatus, image processing method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010067125A true JP2010067125A (en) | 2010-03-25 |
JP5181952B2 JP5181952B2 (en) | 2013-04-10 |
Family
ID=42192642
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008234419A Expired - Fee Related JP5181952B2 (en) | 2008-09-12 | 2008-09-12 | Image processing apparatus, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5181952B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012003584A (en) * | 2010-06-18 | 2012-01-05 | Hoya Corp | Moving image emphasis processing system and method |
JP2019219940A (en) * | 2018-06-20 | 2019-12-26 | カシオ計算機株式会社 | Image processing device, image processing method, and program |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0973541A (en) * | 1995-09-07 | 1997-03-18 | Hitachi Denshi Ltd | Object detection device/method |
JP2001320623A (en) * | 2001-04-02 | 2001-11-16 | Sony Corp | Electronic still image pickup device |
JP2006203444A (en) * | 2005-01-19 | 2006-08-03 | Inc Corp | Background image formation device and program |
WO2007032082A1 (en) * | 2005-09-16 | 2007-03-22 | Fujitsu Limited | Image processing method, and image processing device |
-
2008
- 2008-09-12 JP JP2008234419A patent/JP5181952B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0973541A (en) * | 1995-09-07 | 1997-03-18 | Hitachi Denshi Ltd | Object detection device/method |
JP2001320623A (en) * | 2001-04-02 | 2001-11-16 | Sony Corp | Electronic still image pickup device |
JP2006203444A (en) * | 2005-01-19 | 2006-08-03 | Inc Corp | Background image formation device and program |
WO2007032082A1 (en) * | 2005-09-16 | 2007-03-22 | Fujitsu Limited | Image processing method, and image processing device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012003584A (en) * | 2010-06-18 | 2012-01-05 | Hoya Corp | Moving image emphasis processing system and method |
JP2019219940A (en) * | 2018-06-20 | 2019-12-26 | カシオ計算機株式会社 | Image processing device, image processing method, and program |
JP7192259B2 (en) | 2018-06-20 | 2022-12-20 | カシオ計算機株式会社 | Image processing device, image processing method and program |
Also Published As
Publication number | Publication date |
---|---|
JP5181952B2 (en) | 2013-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4186699B2 (en) | Imaging apparatus and image processing apparatus | |
US7868922B2 (en) | Foreground/background segmentation in digital images | |
JP4760973B2 (en) | Imaging apparatus and image processing method | |
JP6157242B2 (en) | Image processing apparatus and image processing method | |
US8310553B2 (en) | Image capturing device, image capturing method, and storage medium having stored therein image capturing program | |
JP4798236B2 (en) | Imaging apparatus, image processing method, and program | |
JP4947136B2 (en) | Image processing apparatus, image processing method, and program | |
JP2009118483A (en) | Device and method for correcting camera shake in digital by using object tracking | |
JP2007194794A (en) | Photographic device, and image processing method for photographed image, and program | |
JP5246078B2 (en) | Object location program and camera | |
JP4466015B2 (en) | Image processing apparatus and image processing program | |
JP4818393B2 (en) | Image processing method and image processing apparatus | |
JP2009005083A (en) | Imaging apparatus, control method of imaging apparatus and control program of imaging apparatus | |
JP5691617B2 (en) | Subject identification device and subject tracking device | |
JP2005275447A (en) | Image processing device, image processing method and program | |
JP5181952B2 (en) | Image processing apparatus, image processing method, and program | |
JP2012060468A (en) | Imaging apparatus, image generating apparatus, image generating program and image generating method | |
JP4438363B2 (en) | Image processing apparatus and image processing program | |
JP4466017B2 (en) | Image processing apparatus and image processing program | |
JP4705146B2 (en) | Imaging apparatus and imaging method | |
JP4466016B2 (en) | Image processing apparatus and image processing program | |
JP2011135379A (en) | Imaging apparatus, imaging method and program | |
JP5131399B2 (en) | Image processing apparatus, image processing method, and program | |
JP5147912B2 (en) | Image processing method, image processing apparatus, program, and recording medium | |
JP4819859B2 (en) | Imaging apparatus and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110901 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20110901 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120614 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120619 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120802 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20121218 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20121231 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5181952 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160125 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |