JP5476900B2 - Image composition apparatus, image composition method, and program - Google Patents

Image composition apparatus, image composition method, and program Download PDF

Info

Publication number
JP5476900B2
JP5476900B2 JP2009227186A JP2009227186A JP5476900B2 JP 5476900 B2 JP5476900 B2 JP 5476900B2 JP 2009227186 A JP2009227186 A JP 2009227186A JP 2009227186 A JP2009227186 A JP 2009227186A JP 5476900 B2 JP5476900 B2 JP 5476900B2
Authority
JP
Japan
Prior art keywords
subject
images
image
background
cutout
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.)
Expired - Fee Related
Application number
JP2009227186A
Other languages
Japanese (ja)
Other versions
JP2011077820A (en
Inventor
英里奈 市川
淳 村木
博 清水
博之 星野
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2009227186A priority Critical patent/JP5476900B2/en
Publication of JP2011077820A publication Critical patent/JP2011077820A/en
Application granted granted Critical
Publication of JP5476900B2 publication Critical patent/JP5476900B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Processing Or Creating Images (AREA)

Description

本発明は、画像合成装置、画像合成方法及びプログラムに関する。   The present invention relates to an image composition device, an image composition method, and a program.

従来、被写体画像と背景画像やフレームとを合成することにより合成画像を生成し、この合成画像を印刷する技術が知られている(例えば、特許文献1参照)。
また近年では、連写撮影により複数の画像を得、これらの画像から主要な被写体画像を夫々切り抜き、切り抜かれたこれらの複数の被写体画像を順次切り換えて再生表示することにより動画の如く再生表示させる技術が登場している。
Conventionally, a technique is known in which a composite image is generated by combining a subject image, a background image, and a frame, and the composite image is printed (see, for example, Patent Document 1).
Further, in recent years, a plurality of images are obtained by continuous shooting, main subject images are cut out from these images, and the plurality of cut out subject images are sequentially switched and displayed for reproduction and display as a moving image. Technology has appeared.

特開2004−159158号公報JP 2004-159158 A

しかしながら、上記の特許文献1の技術は主たる目的がプリントであるため、切り抜かれた複数の被写体画像を背景画像やフレーム画像に合成するという思想そのものが無く、仮に合成したとしても、静止画の背景に被写体画像だけが動くという変化に乏しい合成動画像となってしまうといった問題が予期される。   However, since the main purpose of the technique of the above-mentioned Patent Document 1 is printing, there is no idea of combining a plurality of clipped subject images with a background image or a frame image, and even if they are combined, the background of a still image In addition, there is a problem that only a subject image moves, resulting in a synthesized moving image with little change.

そこで、本発明の課題は、興趣性の高い変化に富んだ合成動画像を生成することができる画像合成装置、画像合成方法及びプログラムを提供することである。   Therefore, an object of the present invention is to provide an image composition device, an image composition method, and a program capable of generating a synthetic moving image rich in interesting and varied.

上記課題を解決するため、請求項1に記載の画像合成装置は、
所定の撮像フレームレートで所定の枚数連続して撮像させ、背景内に被写体が存在する複数の被写体画像を取得する被写体取得手段と、前記被写体取得手段により取得された前記複数の被写体画像から前記被写体が含まれる被写体領域を抽出して、複数の被写体切り抜き画像を生成する被写体切り抜き手段と、前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像の枚数を算出する枚数算出手段と、前記被写体取得手段により取得された前記複数の被写体画像が存在した背景とは異なる背景画像を前記枚数算出手段で算出した前記複数の被写体切り抜き画像の枚数と同数取得する背景取得手段と、前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像と前記背景取得手段によって取得された複数の背景画像とを合成して複数の合成画像を得、これら複数の合成画像をフレームとした合成動画像を生成する合成手段と、を備えたことを特徴としている。
In order to solve the above problem, an image composition device according to claim 1 is provided.
Given consecutively a predetermined number of the imaging frame rate is captured, and the object obtaining means for obtaining a plurality of object image object is present in the background, the object from the acquired plurality of object images by the object obtaining means A subject cropping unit that extracts a subject region including a plurality of subject cropped images, a number calculation unit that calculates the number of the plurality of subject cropped images generated by the subject cropping unit, and the subject acquisition unit A background acquisition unit that acquires the same number of background images as the number of the plurality of subject cutout images calculated by the number calculation unit, and a background image that is generated by the subject cutout unit. synthesizing the plurality of background images obtained by the plurality of subject cut-out image and the background acquisition means Obtain a plurality of composite images Te, and synthesizing means for generating a synthesized moving image frame a plurality of synthetic images, comprising the.

請求項2に記載の画像合成装置は、請求項1記載の画像装置において、
前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像から構成される被写体切り抜き画像群を複数記録する被写体記録手段と、前記被写体記録手段に記録された複数の被写体切り抜き画像群の中から何れか一の被写体切り抜き画像群を指定する指定手段と、を備えたことを特徴としている。
The image composition device according to claim 2 is the image device according to claim 1,
And the object recording means for plural record composed subject cut-out image group from the subject cut-out means said plurality of subject cut-out image generated in, any one from among a plurality of subject cut-out image group recorded in the object recording unit It is characterized in designating means for designating subject cut-out image group, further comprising a.

請求項3に記載の画像合成装置は、請求項1又は2記載の画像合成装置において、
前記被写体取得手段が複数の被写体画像を取得した際の撮像フレームレートを取得する撮像フレームレート取得手段を更に備え、前記背景取得手段は、 前記撮像フレームレート取得手段によって取得された撮像フレームレートと同じフレームレートで背景画像を取得することを特徴としている。
The image composition device according to claim 3 is the image composition device according to claim 1 or 2,
The image acquisition apparatus further includes an imaging frame rate acquisition unit that acquires an imaging frame rate when the subject acquisition unit acquires a plurality of subject images, and the background acquisition unit is the same as the imaging frame rate acquired by the imaging frame rate acquisition unit It is characterized by acquiring a background image at a frame rate.

請求項4に記載の画像合成装置は、請求項1〜3の何れか一項に記載の画像合成装置において、
撮像手段を備え、前記背景取得手段は、前記撮像手段による撮像により前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像の枚数と少なくとも同数の背景画像を取得することを特徴としている。
The image composition device according to claim 4 is the image composition device according to any one of claims 1 to 3,
The image acquisition means includes the background acquisition means for acquiring at least the same number of background images as the number of the subject cut-out images generated by the subject cut-out means by the image pickup by the image pickup means.

請求項5に記載の発明の画像合成方法は、
所定の撮像フレームレートで所定の枚数連続して撮像させ、背景内に被写体が存在する複数の被写体画像を取得する被写体取得ステップと、前記被写体取得ステップにより取得された前記複数の被写体画像から前記被写体が含まれる被写体領域を抽出して、複数の被写体切り抜き画像を生成する被写体切り抜きステップと、前記被写体切り抜きステップで生成した前記複数の被写体切り抜き画像の枚数を算出する枚数算出ステップと、前記被写体取得ステップにより取得された前記複数の被写体画像が存在した背景とは異なる背景画像を前記枚数算出ステップで算出した前記複数の被写体切り抜き画像の枚数と同数取得する背景取得ステップと、前記被写体切り抜きステップで生成した前記複数の被写体切り抜き画像と前記背景取得ステップによって取得された複数の背景画像とを合成して複数の合成画像を得、これら複数の合成画像をフレームとした合成動画像を生成する合成ステップと、を含むことを特徴としている。
The image composition method of the invention described in claim 5 is:
Given consecutively a predetermined number of the imaging frame rate is captured, and the object acquisition step of acquiring a plurality of object image object is present in the background, the object from the acquired plurality of object images by the object acquisition step A subject cropping step for generating a plurality of subject cropped images, a number calculation step for calculating the number of the plurality of subject cropped images generated in the subject cropping step, and a subject acquisition step. and background acquiring many as the number of the plurality of subject cut-out image calculated by the number calculation step different background image more acquired background plurality of subject images were present was in, generated in the subject cutting-out step the background acquisition step and the plurality of subject cut-out image Thus to obtain a plurality of combined images by combining a plurality of background images acquired, is characterized in that it comprises a synthetic step of generating a synthesized moving image as a frame the plurality of composite images, the.

請求項6に記載の発明のプログラムは、
画像合成装置のコンピュータを、所定の撮像フレームレートで所定の枚数連続して撮像させ、背景内に被写体が存在する複数の被写体画像を取得する被写体取得手段、前記被写体取得手段により取得された前記複数の被写体画像から前記被写体が含まれる被写体領域を抽出して、複数の被写体切り抜き画像を生成する被写体切り抜き手段、前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像の枚数を算出する枚数算出手段、前記被写体取得手段によ取得された前記複数の被写体画像が存在した背景とは異なる背景画像を前記枚数算出手段で算出した前記複数の被写体切り抜き画像の枚数と同数取得する背景取得手段、前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像と前記背景取得手段によって取得された複数の背景画像とを合成して複数の合成画像を得、これら複数の合成画像をフレームとした合成動画像を生成する合成手段、として機能させることを特徴としている。
The program of the invention described in claim 6 is:
The computer of the image synthesizer, is continuously captured predetermined number at a predetermined imaging frame rate, the subject obtaining means for obtaining a plurality of object image object is present in the background, the plurality obtained by the object obtaining means A subject region including the subject from the subject image and generating a plurality of subject cropped images; a number calculating unit for calculating the number of the plurality of subject cropped images generated by the subject cropping unit; number as many acquisition background acquisition means of the object acquisition means is acquired Ri by the a plurality of subject cut-out image calculated by the number calculator means different background image as a background in which the plurality of subject images is present, the subject obtained by the plurality of subject cut-out image and the background acquisition unit generated by the cutout section Obtain a plurality of combined images by combining the number of the background image, it is characterized in that to function the plurality of composite images synthesizing means for generating a synthesized moving image as a frame as.

本発明によれば、興趣性の高い変化に富んだ合成動画像を生成することができる。   ADVANTAGE OF THE INVENTION According to this invention, the synthetic | combination moving image rich in the change with high interest property can be produced | generated.

本発明を適用した一実施形態の撮像装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the imaging device of one Embodiment to which this invention is applied. 被写体切り抜き処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on a subject clipping process. 図2の被写体切り抜き処理の続きを示すフローチャートである。FIG. 3 is a flowchart showing a continuation of the subject clipping process in FIG. 2. FIG. 被写体切り抜き処理に係る画像の一例を模式的に示す図である。It is a figure which shows typically an example of the image which concerns on a subject clipping process. 被写体切り抜き画像の一例を示す図である。It is a figure which shows an example of a to-be-photographed object image. 合成画像生成処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on a synthesized image generation process. 合成画像生成処理に係る背景画像の一例を示す図である。It is a figure which shows an example of the background image which concerns on a synthetic image generation process. 合成画像生成処理における画像合成処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on the image composition process in a composite image generation process. 画像合成処理を説明するための画像の一例を示す図である。It is a figure which shows an example of the image for demonstrating an image composition process. 画像合成処理に係る合成画像の一例を示す図である。It is a figure which shows an example of the synthesized image which concerns on an image synthesis process.

以下に、本発明について、図面を用いて具体的な態様を説明する。ただし、発明の範囲は、図示例に限定されない。
図1は、本発明を適用した一実施形態の撮像装置100の概略構成を示すブロック図である。
本実施形態の撮像装置100は、複数の被写体切り抜き画像(被写体画像)C1〜Cn(図5参照)の数と同数の背景画像D1〜Dn(図7参照)を撮像して、背景画像D1〜Dnの各々と被写体切り抜き画像C1〜Cnの各々とを合成(図9参照)して合成動画像M(図10参照)を生成する。
具体的には、図1に示すように、撮像装置100は、レンズ部1と、電子撮像部2と、撮像制御部3と、画像データ生成部4と、画像メモリ5と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、記録媒体9と、表示制御部10と、表示部11と、操作入力部12と、CPU13とを備えている。
また、撮像制御部3と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、CPU13は、例えば、カスタムLSI1Aとして設計されている。
Hereinafter, specific embodiments of the present invention will be described with reference to the drawings. However, the scope of the invention is not limited to the illustrated examples.
FIG. 1 is a block diagram illustrating a schematic configuration of an imaging apparatus 100 according to an embodiment to which the present invention is applied.
The imaging apparatus 100 according to the present embodiment captures the same number of background images D1 to Dn (see FIG. 7) as the number of subject cutout images (subject images) C1 to Cn (see FIG. 5), and background images D1 to D1. Each of Dn and each of the subject cutout images C1 to Cn are combined (see FIG. 9) to generate a combined moving image M (see FIG. 10).
Specifically, as illustrated in FIG. 1, the imaging apparatus 100 includes a lens unit 1, an electronic imaging unit 2, an imaging control unit 3, an image data generation unit 4, an image memory 5, and a feature amount calculation unit. 6, a block matching unit 7, an image processing unit 8, a recording medium 9, a display control unit 10, a display unit 11, an operation input unit 12, and a CPU 13.
In addition, the imaging control unit 3, the feature amount calculation unit 6, the block matching unit 7, the image processing unit 8, and the CPU 13 are designed as, for example, a custom LSI 1A.

レンズ部1は、複数のレンズから構成され、ズームレンズやフォーカスレンズ等を備えている。
また、レンズ部1は、図示は省略するが、被写体の撮像の際に、ズームレンズを光軸方向に移動させるズーム駆動部、フォーカスレンズを光軸方向に移動させる合焦駆動部等を備えていても良い。
The lens unit 1 includes a plurality of lenses and includes a zoom lens, a focus lens, and the like.
Although not shown, the lens unit 1 includes a zoom drive unit that moves the zoom lens in the optical axis direction and a focus drive unit that moves the focus lens in the optical axis direction when imaging a subject. May be.

電子撮像部2は、例えば、CCD(Charge Coupled Device)やCMOS(Complementary Metal-oxide Semiconductor)等のイメージセンサから構成され、レンズ部1の各種レンズを通過した光学像を二次元の画像信号に変換する。   The electronic imaging unit 2 is composed of an image sensor such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal-oxide Semiconductor), for example, and converts an optical image that has passed through various lenses of the lens unit 1 into a two-dimensional image signal. To do.

撮像制御部3は、図示は省略するが、タイミング発生器、ドライバなどを備えている。そして、撮像制御部3は、タイミング発生器、ドライバにより電子撮像部2を走査駆動して、所定周期毎に光学像を電子撮像部2により二次元の画像信号に変換させ、当該電子撮像部2の撮像領域から1画面分ずつ画像フレームを読み出して画像データ生成部4に出力させる。
また、撮影時にライブビュー画像表示を行う場合には、撮像制御部3は、電子撮像部2により被写体Sを所定の撮像フレームレートで連続して撮像させて、各画像フレームを電子撮像部2から画像データ生成部4に逐次出力させる。
Although not shown, the imaging control unit 3 includes a timing generator, a driver, and the like. Then, the imaging control unit 3 scans and drives the electronic imaging unit 2 with a timing generator and a driver, converts the optical image into a two-dimensional image signal with the electronic imaging unit 2 every predetermined period, and the electronic imaging unit 2 Image frames are read out from the imaging area for each screen and output to the image data generation unit 4.
When live view image display is performed at the time of shooting, the imaging control unit 3 causes the electronic imaging unit 2 to continuously capture the subject S at a predetermined imaging frame rate, and each image frame from the electronic imaging unit 2. The image data generation unit 4 sequentially outputs the data.

また、合成画像生成処理(後述)において、被写体切り抜き画像C1〜Cnの各々と合成される背景画像D1〜Dn(図7参照)を撮像する場合には、撮像制御部3は、当該被写体切り抜き画像C1〜Cnの画像ファイルに付帯されたExif情報から撮像フレームレート及び撮像数に係るデータを読み出す。そして、撮像制御部3は、読み出された被写体切り抜き画像C1〜Cnの撮像フレームレート及び撮像数と同じ撮像条件で背景画像D1〜Dnを電子撮像部2に撮像させる。例えば、被写体切り抜き画像C1〜Cnの画像ファイルに付帯されたExif情報から読み出された撮像フレームレートデータが10fpsで撮像枚数データが20枚の場合、撮像制御部3は、撮像フレームレート10fpsで背景画像D1〜Dnを電子撮像部2に20枚撮像させる。   In addition, in the composite image generation process (described later), when capturing the background images D1 to Dn (see FIG. 7) combined with each of the subject cutout images C1 to Cn, the imaging control unit 3 performs the subject cutout image. Data related to the imaging frame rate and the number of imaging is read out from the Exif information attached to the C1 to Cn image files. Then, the imaging control unit 3 causes the electronic imaging unit 2 to capture the background images D1 to Dn under the same imaging conditions as the imaging frame rate and the number of imaging of the read subject clipped images C1 to Cn. For example, when the imaging frame rate data read from the Exif information attached to the image files of the subject cut-out images C1 to Cn is 10 fps and the number of captured images is 20, the imaging control unit 3 uses the imaging frame rate of 10 fps as the background. Twenty images D1 to Dn are captured by the electronic imaging unit 2.

また、撮像制御部3は、AF(自動合焦処理)、AE(自動露出処理)、AWB(自動ホワイトバランス)等の被写体を撮像する際の条件の調整制御を行う。   In addition, the imaging control unit 3 performs adjustment control of conditions when imaging a subject such as AF (automatic focusing process), AE (automatic exposure process), and AWB (automatic white balance).

画像データ生成部4は、電子撮像部2から転送された画像フレームのアナログ値の信号に対してRGBの各色成分毎に適宜ゲイン調整した後に、サンプルホールド回路(図示略)でサンプルホールドしてA/D変換器(図示略)でデジタルデータに変換し、カラープロセス回路(図示略)で画素補間処理及びγ補正処理を含むカラープロセス処理を行った後、デジタル値の輝度信号Y及び色差信号Cb,Cr(YUVデータ)を生成する。
カラープロセス回路から出力される輝度信号Y及び色差信号Cb,Crは、図示しないDMAコントローラを介して、バッファメモリとして使用される画像メモリ5にDMA転送される。
The image data generation unit 4 appropriately adjusts the gain for each RGB color component with respect to the analog value signal of the image frame transferred from the electronic imaging unit 2, and then performs sample holding by a sample hold circuit (not shown). The digital signal is converted into digital data by a / D converter (not shown), color processing including pixel interpolation processing and γ correction processing is performed by a color process circuit (not shown), and then a digital luminance signal Y and color difference signal Cb , Cr (YUV data).
The luminance signal Y and the color difference signals Cb and Cr output from the color process circuit are DMA-transferred to an image memory 5 used as a buffer memory via a DMA controller (not shown).

画像メモリ5は、例えば、DRAM等により構成され、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、CPU13等によって処理されるデータ等を一時記憶する。   The image memory 5 is composed of, for example, a DRAM or the like, and temporarily stores data processed by the feature amount calculation unit 6, the block matching unit 7, the image processing unit 8, the CPU 13, and the like.

特徴量演算部6は、背景内に被写体Sが存在しない被写体非存在画像B(図4(b)参照)を基準として、当該被写体非存在画像Bから特徴点を抽出する特徴抽出処理を行う。具体的には、特徴量演算部6は、被写体非存在画像BのYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレート(例えば、16×16画素の正方形)として抽出する。
ここで、特徴抽出処理とは、多数の候補ブロックから追跡に都合の良い特徴性の高いものを選択する処理である。
The feature amount calculation unit 6 performs feature extraction processing for extracting feature points from the subject non-existing image B on the basis of the subject non-existing image B where the subject S does not exist in the background (see FIG. 4B). Specifically, the feature amount calculation unit 6 selects a predetermined number (or a predetermined number or more) of highly featured block regions (feature points) based on the YUV data of the subject non-existing image B, and Is extracted as a template (for example, a square of 16 × 16 pixels).
Here, the feature extraction process is a process of selecting a feature having a high characteristic convenient for tracking from a large number of candidate blocks.

ブロックマッチング部7は、被写体存在画像A1〜An(図4(a)参照)の各々と被写体非存在画像Bとの位置合わせのためのブロックマッチング処理を行う。具体的には、ブロックマッチング部7は、特徴抽出処理にて抽出されたテンプレートが各被写体存在画像A1〜An内のどこに対応するか、つまり、各被写体存在画像A1〜An内にてテンプレートの画素値が最適にマッチする位置(対応領域)を各被写体存在画像A1〜Anにおいて探索する。そして、画素値の相違度の評価値(例えば、差分二乗和(SSD)や差分絶対値和(SAD)等)が最も良かった被写体非存在画像Bと各被写体存在画像A1〜Anの最適なオフセットを当該テンプレートの動きベクトルとして算出する。   The block matching unit 7 performs block matching processing for aligning each of the subject presence images A1 to An (see FIG. 4A) and the subject nonexistence image B. Specifically, the block matching unit 7 determines where in the subject existence images A1 to An the template extracted in the feature extraction process corresponds, that is, the template pixels in the subject existence images A1 to An. A position (corresponding region) where the values are optimally matched is searched for in each of the subject existing images A1 to An. Then, the optimum offset between the subject non-existing image B and the subject existing images A1 to An having the best evaluation values (for example, the sum of squared differences (SSD) and the sum of absolute differences (SAD)) of the pixel values. Is calculated as a motion vector of the template.

画像処理部8は、切り抜き画像生成部8aと、被写体取得部8bと、背景取得部8cと、画像合成部8dと、算出部8eと、合成制御部8fとを具備している。   The image processing unit 8 includes a cut-out image generation unit 8a, a subject acquisition unit 8b, a background acquisition unit 8c, an image synthesis unit 8d, a calculation unit 8e, and a synthesis control unit 8f.

切り抜き画像生成部8aは、具体的には、位置合わせ部と、被写体領域抽出部と、位置情報生成部等(何れも図示略)を備えている。
位置合わせ部は、被写体非存在画像Bから抽出した特徴点に基づいて、被写体非存在画像Bに対する被写体存在画像A1〜Anの各々の各画素の座標変換式(射影変換行列)を算出し、当該座標変換式に従って各被写体存在画像A1〜Anを座標変換して被写体非存在画像Bと位置合わせを行う。
被写体領域抽出部は、位置合わせ部により位置合わせされた被写体存在画像A1〜Anの各々と被写体非存在画像Bとの間で対応する各画素の差分情報を生成し、当該差分情報を基準として被写体存在画像A1〜Anの各々から被写体Sが含まれる被写体領域を抽出する。具体的には、被写体領域抽出部は、被写体存在画像A1〜AnのYUVデータの各々と被写体非存在画像BのYUVデータの各々に対してローパスフィルタをかけて各画像の高周波成分を除去する。その後、被写体領域抽出部は、ローパスフィルタをかけた各被写体存在画像A1〜Anと被写体非存在画像Bとの間で対応する各画素について相違度を算出して相違度マップを生成する。続けて、被写体領域抽出部は、各画素に係る相違度マップを所定の閾値で2値化した後、相違度マップから細かいノイズや手ぶれにより相違が生じた領域を除去するために収縮処理を行う。その後、被写体領域抽出部は、ラベリング処理を行って、所定値以下の領域や最大領域以外の領域を除去した後、一番大きな島のパターンを被写体領域として特定し、収縮分を修正するための膨張処理を行う。
位置情報生成部は、各被写体存在画像A1〜An内で抽出された被写体領域の位置を特定して、被写体存在画像A1〜Anの各々における被写体領域の位置を示す位置情報を生成する。
ここで、位置情報としては、例えば、アルファマップが挙げられ、アルファマップとは、各被写体存在画像A1〜Anの各画素について、被写体領域の画像を所定の背景に対してアルファブレンディングする際の重みをアルファ値(0≦α≦1)として表したものである。
Specifically, the cut-out image generation unit 8a includes an alignment unit, a subject area extraction unit, a position information generation unit, and the like (all not shown).
Based on the feature points extracted from the subject non-existing image B, the alignment unit calculates a coordinate conversion formula (projection transformation matrix) of each pixel of the subject existing images A1 to An with respect to the subject non-existing image B. Each subject existing image A1 to An is subjected to coordinate conversion according to the coordinate conversion formula, and aligned with the subject non-existing image B.
The subject region extraction unit generates difference information of each corresponding pixel between each of the subject presence images A1 to An and the subject non-existence image B aligned by the alignment unit, and uses the difference information as a reference for the subject A subject area including the subject S is extracted from each of the existing images A1 to An. Specifically, the subject region extraction unit applies a low-pass filter to each of the YUV data of the subject existing images A1 to An and each of the YUV data of the subject nonexistent image B to remove high frequency components of each image. Thereafter, the subject region extraction unit calculates a difference for each pixel corresponding to each of the subject existing images A1 to An and the subject non-existing image B to which the low-pass filter is applied, and generates a difference map. Subsequently, the subject region extraction unit binarizes the dissimilarity map relating to each pixel with a predetermined threshold, and then performs a contraction process to remove a region in which the dissimilarity is caused by fine noise or camera shake from the dissimilarity map. . After that, the subject region extraction unit performs a labeling process, removes a region below a predetermined value or a region other than the maximum region, identifies the largest island pattern as the subject region, and corrects the contraction Perform expansion treatment.
The position information generation unit specifies the position of the subject area extracted in each of the subject presence images A1 to An, and generates position information indicating the position of the subject area in each of the subject presence images A1 to An.
Here, the position information includes, for example, an alpha map. The alpha map is a weight for alpha blending an image of a subject area with respect to a predetermined background for each pixel of each subject existing image A1 to An. Is expressed as an alpha value (0 ≦ α ≦ 1).

そして、切り抜き画像生成部8aは、位置情報生成部により生成されたアルファマップに基づいて、被写体存在画像A1〜Anそれぞれの各画素のうち、アルファ値が1の画素を所定の単一色画像(図示略)に対して透過させずに、且つ、アルファ値が0の画素を透過させるように、被写体Sの画像を所定の単一色画像と合成して被写体切り抜き画像C1〜Cn各々の画像データを生成する。   Then, based on the alpha map generated by the position information generation unit, the cut-out image generation unit 8a selects a pixel having an alpha value of 1 among each pixel of the subject existing images A1 to An as a predetermined single color image (illustrated). The image of the subject S is synthesized with a predetermined single color image so that the pixel data of each of the subject cut-out images C1 to Cn is generated so that the pixels having the alpha value of 0 are not transmitted. To do.

被写体取得部8bは、動く被写体Sが連続して撮像された複数の被写体切り抜き画像C1〜Cnを取得する。
即ち、被写体取得部8bは、合成画像生成処理にて、ユーザ所望の一の被写体切り抜き画像群Cを構成する複数の被写体切り抜き画像C1〜Cnを取得する。具体的には、合成画像生成処理にて、ユーザによる選択決定ボタン12bの所定操作に基づいて、表示部11の表示画面に表示された複数の被写体切り抜き画像群の中から何れか一の被写体切り抜き画像群(例えば、被写体切り抜き画像群C)が指定されると、被写体取得部8bは、指定された被写体切り抜き画像群Cを構成する被写体切り抜き画像C1〜Cnの画像データを記録媒体9から読み出して取得する。ここで、被写体取得部8bは、動く被写体Sが連続して撮像された被写体存在画像A1〜Anから、それぞれ被写体領域が抽出された複数の被写体切り抜き画像C1〜Cnを取得する。
また、被写体取得部8bは、被写体切り抜き画像C1〜Cnの画像データの取得の際に、当該被写体切り抜き画像C1〜Cnに係る被写体存在画像A1〜Anの連続撮像の際の撮像フレームレート及び撮像数(撮像条件)に係るデータを被写体切り抜き画像C1〜Cnの画像データに付帯されたExif情報から読み出して取得する。
The subject acquisition unit 8b acquires a plurality of subject cutout images C1 to Cn in which the moving subject S is continuously captured.
That is, the subject acquisition unit 8b acquires a plurality of subject cut-out images C1 to Cn constituting one subject cut-out image group C desired by the user in the composite image generation process. Specifically, in the composite image generation process, any one subject cut out from a plurality of subject cut image groups displayed on the display screen of the display unit 11 based on a predetermined operation of the selection determination button 12b by the user. When an image group (for example, a subject cut-out image group C) is designated, the subject acquisition unit 8b reads out image data of the subject cut-out images C1 to Cn constituting the designated subject cut-out image group C from the recording medium 9. get. Here, the subject acquisition unit 8b acquires a plurality of subject cutout images C1 to Cn from which subject regions have been extracted from subject presence images A1 to An in which moving subjects S are continuously captured.
In addition, the subject acquisition unit 8b, when acquiring the image data of the subject clipped images C1 to Cn, captures the imaging frame rate and the number of images when continuously capturing the subject existing images A1 to An related to the subject clipped images C1 to Cn. Data related to (imaging conditions) is read and acquired from the Exif information attached to the image data of the subject cutout images C1 to Cn.

背景取得部8cは、被写体取得部8bにより取得された被写体切り抜き画像C1〜Cnの数と同数の背景画像D1〜Dn(図7参照)を取得する。
即ち、合成画像生成処理にて、ユーザによるシャッタボタン12aの所定操作に基づいて、連続して背景画像D1〜Dnを撮像する撮像指示入力がなされると、CPU13は撮像制御部3により被写体取得部8bにより取得された被写体Sの連続撮像の際の撮像フレームレート及び撮像数と同じ撮像条件で背景画像D1〜Dnを電子撮像部2に連続撮像させ、背景取得部8cは、当該連続撮像された背景画像D1〜Dnを取得する。
これにより、背景取得部8cにより取得された背景画像D1〜Dnと、被写体取得部8bにより取得された被写体切り抜き画像C1〜Cnの数は同数となる。また、背景画像D1〜Dnと被写体切り抜き画像C1〜Cnの撮像フレームレートは同じレートとなる。
The background acquisition unit 8c acquires the same number of background images D1 to Dn (see FIG. 7) as the number of the subject cutout images C1 to Cn acquired by the subject acquisition unit 8b.
That is, in the composite image generation process, when an imaging instruction input for continuously capturing the background images D1 to Dn is made based on a predetermined operation of the shutter button 12a by the user, the CPU 13 causes the imaging control unit 3 to perform a subject acquisition unit. The background image D1 to Dn is continuously captured by the electronic imaging unit 2 under the same imaging conditions as the imaging frame rate and the number of imaging of the subject S acquired by 8b, and the background acquisition unit 8c performs the continuous imaging. Background images D1 to Dn are acquired.
Thereby, the number of the background images D1 to Dn acquired by the background acquisition unit 8c and the subject cut-out images C1 to Cn acquired by the subject acquisition unit 8b are the same. The imaging frame rates of the background images D1 to Dn and the subject cutout images C1 to Cn are the same rate.

画像合成部8dは、複数の被写体切り抜き画像C1〜Cnと複数の背景画像D1〜Dnのそれぞれとを合成し合成画像M1〜Mnを生成する。即ち、画像合成部8dは、複数の被写体切り抜き画像C1〜Cnと複数の背景画像D1〜Dnについて、1枚目どうし(図9(a)参照)、2枚目どうし(図9(b)参照)、3枚目どうし(図9(c)参照)、…N枚目どうし(図9(d)参照)というようにそれぞれの画像の撮像順に合成する。
具体的には、画像合成部8dは、1枚目の背景画像D1の各画素のうち、アルファ値が0の画素は透過させ、アルファ値が1の画素は1枚目の被写体切り抜き画像C1の対応する画素の画素値で上書きし、さらに、背景画像D1の各画素のうち、アルファ値が0<α<1の画素は1の補数(1−α)を用いて被写体領域を切り抜いた画像(背景画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き画像C1を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き画像C1から減算し、それを被写体領域を切り抜いた画像(背景画像×(1−α))と合成する。
また、画像合成部8dは、2枚目以降の被写体切り抜き画像C2…と背景画像D2…についても、上記説明したものと略同様の合成処理を行う。これにより、画像合成部8dは、全ての被写体切り抜き画像C1〜Cnと背景画像D1〜Dnについて合成処理を行い、複数の合成画像M1〜Mnから構成される合成動画像M(図10参照)を生成する。
The image combining unit 8d combines the plurality of subject cutout images C1 to Cn and the plurality of background images D1 to Dn to generate combined images M1 to Mn. That is, the image compositing unit 8d has a plurality of subject cut-out images C1 to Cn and a plurality of background images D1 to Dn, the first one (see FIG. 9A) and the second one (see FIG. 9B). ) And the third image (see FIG. 9C),... The Nth image (see FIG. 9D), and the images are combined in the order of image capturing.
Specifically, the image composition unit 8d transmits pixels having an alpha value of 0 among the pixels of the first background image D1, and pixels having an alpha value of 1 are those of the first subject cutout image C1. Overwrite with the pixel value of the corresponding pixel, and among the pixels of the background image D1, an image with the alpha value 0 <α <1 cut out from the subject area using 1's complement (1-α) ( After generating the background image × (1-α)), a value blended with a single background color is calculated when the subject cutout image C1 is generated using the one's complement (1-α) in the alpha map, The value is subtracted from the subject cutout image C1 and is combined with an image obtained by cutting out the subject area (background image × (1−α)).
The image composition unit 8d also performs composition processing similar to that described above for the second and subsequent subject clipped images C2 and background images D2. As a result, the image composition unit 8d performs composition processing on all the subject cut-out images C1 to Cn and the background images D1 to Dn, and generates a composite moving image M (see FIG. 10) composed of a plurality of composite images M1 to Mn. Generate.

算出部8eは、被写体存在画像A1〜Anのうち、切り抜き画像生成部8aによる被写体領域の抽出に成功した数を算出して取得する。即ち、算出部8eは、被写体切り抜き画像C1〜Cnの数を算出する。   The calculation unit 8e calculates and acquires the number of subject regions that have been successfully extracted by the cutout image generation unit 8a among the subject presence images A1 to An. That is, the calculation unit 8e calculates the number of subject cutout images C1 to Cn.

合成制御部8fは、背景画像D1〜Dnと被写体切り抜き画像C1〜Cnとを画像合成部8dに合成させ合成動画像Mを生成させる。
具体的には、合成制御部8fは、算出部8eにより、例えば、被写体存在画像A1〜Anの取得数「20」のうち、被写体領域の抽出に成功した被写体切抜き画像数が「18」であると算出された場合に、被写体切り抜き画像数「18」と同じ数の背景画像D1〜Dnを取得させて、当該背景画像D1〜Dnと被写体切り抜き画像C1〜Cnとを画像合成部8dに合成させ合成動画像Mを生成させる。
The synthesis control unit 8f causes the image synthesis unit 8d to synthesize the background images D1 to Dn and the subject cutout images C1 to Cn to generate a synthesized moving image M.
Specifically, the composition control unit 8f uses the calculation unit 8e, for example, of the acquired number “20” of the subject presence images A1 to An to be “18” as the number of subject cut-out images that have successfully extracted the subject region. Is calculated, the same number of background images D1 to Dn as the number of subject cutout images “18” are acquired, and the background image D1 to Dn and the subject cutout images C1 to Cn are combined by the image composition unit 8d. A synthesized moving image M is generated.

記録媒体9は、例えば、不揮発性メモリ(フラッシュメモリ)等により構成され、画像処理部8の符号化部(図示略)により符号化された複数の被写体切り抜き画像(被写体切り抜き画像C1〜Cn等)から構成される被写体切り抜き画像群をそれぞれ一画像ファイルとして複数記録する。
また、記録媒体9は、背景取得部8cにより取得された複数の背景画像D1〜Dnの画像データを記録する。
被写体切り抜き画像C1〜Cnの各画像データは、切り抜き画像生成部8aの位置情報生成部により生成されたアルファマップとそれぞれ対応付けられて、当該被写体切り抜き画像C1〜Cnの画像データの拡張子を「.jpg」として保存されている。同様に、背景画像D1〜Dnの各画像データは、当該背景画像D1〜Dnの画像データの拡張子を「.jpg」として保存されている。
また、被写体切り抜き画像C1〜Cnの画像データは、被写体Sが連続撮像された際の撮像フレームレート及び撮像枚数がExif情報として付帯されたExif形式の画像ファイルから構成されている。
ここで、記録媒体9は、複数の被写体切り抜き画像C1〜Cnから構成される被写体切り抜き画像群を複数記録する。また、記録媒体9は、背景画像D1〜Dnを記録する。
The recording medium 9 is composed of, for example, a non-volatile memory (flash memory) or the like, and a plurality of subject cut images (subject cut images C1 to Cn and the like) encoded by an encoding unit (not shown) of the image processing unit 8. A plurality of subject cutout image groups each consisting of the above are recorded as one image file.
The recording medium 9 records image data of a plurality of background images D1 to Dn acquired by the background acquisition unit 8c.
Each image data of the subject cutout images C1 to Cn is associated with an alpha map generated by the position information generation unit of the cutout image generation unit 8a, and the extension of the image data of the subject cutout images C1 to Cn is “ .jpg ". Similarly, each image data of the background images D1 to Dn is stored with the extension of the image data of the background images D1 to Dn as “.jpg”.
Further, the image data of the subject cut-out images C1 to Cn is composed of an Exif format image file in which the imaging frame rate and the number of captured images when the subject S is continuously captured are attached as Exif information.
Here, the recording medium 9 records a plurality of subject cutout image groups including a plurality of subject cutout images C1 to Cn. The recording medium 9 records background images D1 to Dn.

表示制御部10は、画像メモリ5に一時的に記憶されている表示用の画像データを読み出して表示部11に表示させる制御を行う。
具体的には、表示制御部10は、VRAM、VRAMコントローラ、デジタルビデオエンコーダなどを備えている。そして、デジタルビデオエンコーダは、CPU13の制御下にて画像メモリ5から読み出されてVRAM(図示略)に記憶されている輝度信号Y及び色差信号Cb,Crを、VRAMコントローラを介してVRAMから定期的に読み出して、これらのデータを元にビデオ信号を発生して表示部11に出力する。
The display control unit 10 performs control for reading display image data temporarily stored in the image memory 5 and displaying the read image data on the display unit 11.
Specifically, the display control unit 10 includes a VRAM, a VRAM controller, a digital video encoder, and the like. The digital video encoder periodically reads the luminance signal Y and the color difference signals Cb and Cr read from the image memory 5 and stored in the VRAM (not shown) under the control of the CPU 13 from the VRAM via the VRAM controller. Are read out, a video signal is generated based on these data, and is output to the display unit 11.

表示部11は、例えば、液晶表示装置であり、表示制御部10からのビデオ信号に基づいて電子撮像部2により撮像された画像などを表示画面に表示する。具体的には、表示部11は、撮像モードにて、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示したり、本撮像画像として撮像されたレックビュー画像を表示する。   The display unit 11 is, for example, a liquid crystal display device, and displays an image captured by the electronic imaging unit 2 based on a video signal from the display control unit 10 on a display screen. Specifically, the display unit 11 displays a live view image based on a plurality of image frames generated by imaging the subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3 in the imaging mode. The REC view image captured as the actual captured image is displayed.

操作入力部12は、当該撮像装置100の所定操作を行うためのものである。具体的には、操作入力部12は、被写体の撮影指示に係るシャッタボタン12a、撮像モードや機能等の選択指示や被写体切り抜き画像C1〜Cnの各々における被写体領域の基準合成位置の設定指示、表示部11の表示画面上に表示された複数の被写体切り抜き画像群の中から一の被写体切り抜き画像群を指定する指定指示等に係る選択決定ボタン12b、ズーム量の調整指示に係るズームボタン(図示略)等を備え、これらのボタンの操作に応じて所定の操作信号をCPU13に出力する。   The operation input unit 12 is for performing a predetermined operation of the imaging apparatus 100. Specifically, the operation input unit 12 includes a shutter button 12a related to a subject shooting instruction, a selection instruction for an imaging mode, a function, and the like, a setting instruction for a reference composite position of a subject area in each of the subject cut-out images C1 to Cn, and display A selection determination button 12b related to a designation instruction for designating one subject cutout image group from among a plurality of subject cutout image groups displayed on the display screen of the unit 11, and a zoom button (not shown) related to a zoom amount adjustment instruction. ) And the like, and a predetermined operation signal is output to the CPU 13 in accordance with the operation of these buttons.

CPU13は、撮像装置100の各部を制御するものである。具体的には、CPU13は、撮像装置100用の各種処理プログラム(図示略)に従って各種の制御動作を行うものである。   The CPU 13 controls each part of the imaging device 100. Specifically, the CPU 13 performs various control operations in accordance with various processing programs (not shown) for the imaging apparatus 100.

次に、撮像装置100による被写体切り抜き処理について、図2〜図5を参照して説明する。
被写体切り抜き処理は、ユーザによる選択決定ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から被写体切り抜きモードが選択指示された場合に実行される処理である。
なお、本実施形態の被写体切り抜き処理では、ユーザによる選択決定ボタン12bの所定操作に基づいて、被写体切り抜き処理の種類として連写画像(例えば、撮像フレームレート;10fps、撮像枚数;20枚)が選択指示されたものとして、以下説明する。
Next, the subject clipping process performed by the imaging apparatus 100 will be described with reference to FIGS.
The subject clipping process is a process executed when a subject clipping mode is selected from a plurality of imaging modes displayed on the menu screen based on a predetermined operation of the selection determination button 12b by the user.
In the subject clipping process of the present embodiment, a continuous shot image (for example, imaging frame rate: 10 fps, number of images: 20 images) is selected as the type of the subject clipping process based on a predetermined operation of the selection determination button 12b by the user. The instruction will be described below.

図2に示すように、先ず、CPU13は、表示制御部10に、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体の撮像指示メッセージを表示部11の表示画面に表示させる(ステップS1)。   As shown in FIG. 2, first, the CPU 13 displays a live view image on the display control unit 10 based on a plurality of image frames generated by imaging a subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. While displaying on the display screen of the display part 11, it superimposes on the said live view image, and displays the imaging instruction message of a to-be-photographed object on the display screen of the display part 11 (step S1).

次に、CPU13は、ユーザによるシャッタボタン12aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS2)。ここで、撮像指示が入力されたと判定されると(ステップS2;YES)、CPU13は、撮像制御部3に、フォーカスレンズの合焦位置や露出条件やホワイトバランス等の条件を調整させて、被写体存在画像A1〜Anの光学像を撮像フレームレート10fpsで電子撮像部2により20枚連続して撮像させ、画像データ生成部4に、電子撮像部2から転送された被写体存在画像A1〜Anの各画像フレームのYUVデータを生成させる(ステップS3)。なお、当該被写体存在画像A1〜Anの各画像フレームのYUVデータは、画像メモリ5に一時記憶される。
また、CPU13は、撮像制御部3を制御して、当該被写体存在画像A1〜Anの撮像の際の合焦位置や露出条件やホワイトバランス等の条件を固定した状態を維持する。
Next, the CPU 13 determines whether or not an imaging instruction has been input based on a predetermined operation of the shutter button 12a by the user (step S2). If it is determined that an imaging instruction has been input (step S2; YES), the CPU 13 causes the imaging control unit 3 to adjust conditions such as the focus lens in-focus position, exposure conditions, and white balance, and the subject. Optical images of the presence images A1 to An are continuously captured by the electronic imaging unit 2 at an imaging frame rate of 10 fps, and each of the subject existing images A1 to An transferred from the electronic imaging unit 2 to the image data generation unit 4 is captured. YUV data of the image frame is generated (step S3). The YUV data of each image frame of the subject existing images A1 to An is temporarily stored in the image memory 5.
Further, the CPU 13 controls the imaging control unit 3 to maintain a state in which conditions such as a focus position, an exposure condition, and a white balance at the time of imaging the subject presence images A1 to An are fixed.

そして、CPU13は、表示制御部10に、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、一枚目の被写体存在画像A1の半透過の表示態様の画像と被写体非存在画像Bの撮像指示メッセージを表示部11の表示画面に表示させる(ステップS4)。
この後、CPU13は、ユーザによるシャッタボタン12aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS5)。そして、ユーザは、被写体Sを画角外に移動させるか、或いは被写体Sが移動するのを待った後、ユーザにより被写体非存在画像Bが被写体存在画像A1の半透過の画像と重なるようにカメラ位置が調整されて、シャッタボタン12aが所定操作されて撮像指示が入力されたと判定されると(ステップS5;YES)、CPU13は、撮像制御部3に、被写体非存在画像Bの光学像を被写体存在画像A1〜Anの撮像後に固定された条件で電子撮像部2により撮像させて、画像データ生成部4に、電子撮像部2から転送された被写体非存在画像Bの画像フレームに基づいて、被写体非存在画像BのYUVデータを生成させる(ステップS6)。なお、当該被写体非存在画像BのYUVデータは、画像メモリ5に一時記憶される。
Then, the CPU 13 causes the display control unit 10 to display a live view image on the display screen of the display unit 11 based on a plurality of image frames generated by imaging the subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. In addition to the display, the image of the semi-transparent display mode of the first subject presence image A1 and the imaging instruction message of the subject non-existence image B are superimposed on the live view image and displayed on the display screen of the display unit 11 ( Step S4).
Thereafter, the CPU 13 determines whether or not an imaging instruction has been input based on a predetermined operation of the shutter button 12a by the user (step S5). Then, after the user moves the subject S out of the angle of view or waits for the subject S to move, the camera position is set so that the subject non-existing image B overlaps the semi-transparent image of the subject existing image A1 by the user. Is determined, and it is determined that the shutter button 12a is operated for a predetermined time and an imaging instruction is input (step S5; YES), the CPU 13 causes the imaging control unit 3 to display the optical image of the subject non-existing image B as the subject exists. Based on the image frame of the subject non-existing image B that is captured by the electronic imaging unit 2 under the fixed conditions after the images A1 to An are captured and transferred from the electronic imaging unit 2 to the image data generation unit 4, YUV data of the existing image B is generated (step S6). Note that the YUV data of the subject non-existing image B is temporarily stored in the image memory 5.

次に、CPU13は、特徴量演算部6、ブロックマッチング部7及び画像処理部8に、画像メモリ5に一時記憶されている被写体非存在画像BのYUVデータを基準として、被写体存在画像A1〜AnのYUVデータの各々を射影変換させるための射影変換行列を所定の画像変換モデル(例えば、相似変換モデル、或いは合同変換モデル)で算出させる(ステップS7)。
具体的には、特徴量演算部6は、被写体非存在画像BのYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレートとして抽出する。そして、ブロックマッチング部7は、特徴抽出処理にて抽出されたテンプレートの画素値が最適にマッチする位置を被写体存在画像A1〜Anの各画像フレーム内にて探索して、画素値の相違度の評価値が最も良かった被写体非存在画像Bと各被写体存在画像A1〜Anの最適なオフセットを当該テンプレートの動きベクトルとして算出する。そして、切り抜き画像生成部8aの位置合わせ部は、ブロックマッチング部7により算出された複数のテンプレートの動きベクトルに基づいて全体の動きベクトルを統計的に算出し、当該動きベクトルに係る特徴点対応を用いて被写体存在画像A1〜Anの各射影変換行列を算出する。
Next, the CPU 13 uses the subject existence images A1 to An on the basis of the YUV data of the subject non-existence image B temporarily stored in the image memory 5 in the feature amount calculation unit 6, the block matching unit 7, and the image processing unit 8. A projection transformation matrix for projectively transforming each of the YUV data is calculated with a predetermined image transformation model (for example, a similarity transformation model or a joint transformation model) (step S7).
Specifically, the feature amount calculation unit 6 selects a predetermined number (or a predetermined number or more) of highly featured block regions (feature points) based on the YUV data of the subject non-existing image B, and Is extracted as a template. Then, the block matching unit 7 searches the image frames of the subject existing images A1 to An for positions where the pixel values of the template extracted by the feature extraction process are optimally matched, and determines the difference between the pixel values. An optimal offset between the subject non-existing image B and the subject existing images A1 to An having the best evaluation value is calculated as a motion vector of the template. Then, the alignment unit of the cut-out image generation unit 8a statistically calculates the entire motion vector based on the motion vectors of the plurality of templates calculated by the block matching unit 7, and performs feature point correspondence related to the motion vector. The projection transformation matrix of each of the subject existing images A1 to An is calculated.

次に、CPU13は、切り抜き画像生成部8aの位置合わせ部に、算出された各射影変換行例に基づいて被写体存在画像A1〜Anを射影変換させることで、被写体存在画像A1〜AnのYUVデータの各々と被写体非存在画像BのYUVデータとを位置合わせする処理を行わせる(ステップS8)。
そして、図3に示すように、CPU13は、切り抜き画像生成部8aの被写体領域抽出部に、被写体存在画像A1〜Anから被写体Sが含まれる被写体領域を抽出する処理を行わせる(ステップS9)。
次に、CPU13は、切り抜き画像生成部8aの位置情報生成部に、抽出された被写体領域の各被写体存在画像A1〜An内での位置を示すアルファマップをそれぞれ生成させる(ステップS10)。
Next, the CPU 13 causes the alignment unit of the cut-out image generation unit 8a to perform projective transformation of the subject existing images A1 to An based on the calculated projective conversion row examples, so that the YUV data of the subject existing images A1 to An is obtained. And the YUV data of the subject nonexistent image B are aligned (step S8).
Then, as shown in FIG. 3, the CPU 13 causes the subject region extraction unit of the cut-out image generation unit 8a to perform processing for extracting the subject region including the subject S from the subject existing images A1 to An (step S9).
Next, the CPU 13 causes the position information generation unit of the cutout image generation unit 8a to generate an alpha map indicating the position of the extracted subject region in each of the subject existing images A1 to An (step S10).

その後、CPU13は、切り抜き画像生成部8aに、被写体Sの画像を所定の単一色画像と合成した被写体切り抜き画像C1〜Cnの画像データを生成する処理を行わせる(ステップS11)。
即ち、切り抜き画像生成部8aは、1枚目の被写体存在画像A1、2枚目の被写体存在画像A2、3枚目の被写体存在画像A3、…N枚目の被写体存在画像Anというようにそれぞれの画像の撮像順に、所定の単一色画像とそれぞれ合成した被写体切り抜き画像C1〜Cnの画像データを生成するようになっている。
具体的には、切り抜き画像生成部8aは、1枚目の被写体存在画像A1、単一色画像及び被写体存在画像A1と対応するアルファマップを読み出して画像メモリ5に展開した後、被写体存在画像A1の全ての画素について、アルファ値が0の画素については(α=0)、透過させ、アルファ値が0<α<1の画素については(0<α<1)、所定の単一色とブレンディングを行い、アルファ値が1の画素については(α=1)、何もせずに所定の単一色に対して透過させないようにする。
また、切り抜き画像生成部8aは、2枚目以降の被写体存在画像A2…についても同様の処理を行う。これにより、全ての被写体存在画像A1〜Anについて切抜画像生成処理を行い、複数の被写体切り抜き画像C1〜Cnを生成する。
Thereafter, the CPU 13 causes the cutout image generation unit 8a to perform processing for generating image data of the subject cutout images C1 to Cn obtained by combining the image of the subject S with a predetermined single color image (step S11).
In other words, the cut-out image generation unit 8a includes the first subject existing image A1, the second subject existing image A2, the third subject existing image A3,... The Nth subject existing image An. Image data of the subject cut-out images C1 to Cn respectively synthesized with a predetermined single color image is generated in the order of image capturing.
Specifically, the cut-out image generation unit 8a reads the first subject existing image A1, the single color image, and the alpha map corresponding to the subject existing image A1, develops them in the image memory 5, and then extracts the subject existing image A1. For all pixels, a pixel with an alpha value of 0 (α = 0) is transmitted, and a pixel with an alpha value of 0 <α <1 (0 <α <1) is blended with a predetermined single color. For a pixel having an alpha value of 1 (α = 1), nothing is performed so as not to transmit a predetermined single color.
In addition, the cut-out image generation unit 8a performs the same processing for the second and subsequent subject existing images A2. As a result, cut-out image generation processing is performed for all the subject presence images A1 to An, and a plurality of subject cut-out images C1 to Cn are generated.

次に、CPU13は、算出部8eに、複数の被写体切り抜き画像C1〜Cnの枚数、つまり複数の被写体存在画像A1〜Anのうち、被写体領域が抽出された被写体存在画像の枚数を算出する処理を行わせる(ステップS12)。   Next, the CPU 13 causes the calculation unit 8e to calculate the number of subject cut-out images C1 to Cn, that is, the number of subject-existing images from which the subject area is extracted among the plurality of subject-existing images A1 to An. (Step S12).

そして、CPU13は、記録媒体9の所定の記憶領域に、切り抜き画像生成部8aの位置情報生成部により生成された各アルファマップと被写体切り抜き画像C1〜Cnの画像データを対応付けて一の画像ファイルに記憶させるとともに、Exif情報として被写体存在画像A1〜Anが撮像された際の撮像フレームレートと被写体領域が抽出された数を記憶させる(ステップS13)。
これにより、被写体切り抜き処理を終了する。この結果、背景内から被写体S(例えば、人)(図4(a)参照)が抽出された被写体切り抜き画像C1〜Cnの画像データが生成される。
Then, the CPU 13 associates each alpha map generated by the position information generation unit of the cutout image generation unit 8a with the image data of the subject cutout images C1 to Cn in a predetermined storage area of the recording medium 9 in one image file. And the imaging frame rate when the subject existing images A1 to An are captured and the number of extracted subject areas are stored as Exif information (step S13).
Thereby, the subject clipping process is completed. As a result, image data of the subject cutout images C1 to Cn in which the subject S (for example, a person) (see FIG. 4A) is extracted from the background is generated.

次に、撮像装置100による合成画像生成処理について、図6〜図10を参照して説明する。   Next, the composite image generation process by the imaging device 100 will be described with reference to FIGS.

図6に示すように、先ず、CPU13は、ユーザによる選択決定ボタン12bの所定操作に基づいて、表示部11の再生表示画面に表示された複数の被写体切り抜き画像群の中から何れか一の被写体切り抜き画像群(例えば、被写体切り抜き画像群C)の指定がなされたか否かを判定する(ステップS20)。そして、被写体切り抜き画像群Cの指定がなされたと判定されると(ステップS20;YES)、CPU13は、記録媒体9から被写体切り抜き画像群Cの画像データを読み出して、被写体切り抜き画像群Cを被写体取得部8bに取得させる(ステップS21)。   As shown in FIG. 6, first, the CPU 13 selects any one subject from among a plurality of subject cutout image groups displayed on the reproduction display screen of the display unit 11 based on a predetermined operation of the selection determination button 12b by the user. It is determined whether a cutout image group (for example, a subject cutout image group C) has been designated (step S20). When it is determined that the subject cutout image group C has been designated (step S20; YES), the CPU 13 reads out the image data of the subject cutout image group C from the recording medium 9, and obtains the subject cutout image group C as a subject. The part 8b is made to acquire (step S21).

次に、CPU13は、取得された被写体切り抜き画像群Cを構成する複数の被写体切り抜き画像C1〜Cnと対応付けられて記憶された撮像条件(撮像フレームレート及び撮像枚数)を読み出す。そしてCPU13は、当該撮像条件を設定する処理を撮像制御部3に行わせる(ステップS22)。   Next, the CPU 13 reads the imaging conditions (imaging frame rate and number of images) stored in association with the plurality of subject clipped images C1 to Cn constituting the acquired subject clipped image group C. Then, the CPU 13 causes the imaging control unit 3 to perform processing for setting the imaging conditions (step S22).

次に、CPU13は、表示制御部10に、レンズ部1、電子撮像部2及び撮像制御部3による背景の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体切り抜き画像C1〜Cnの半透過の表示態様の各画像を表示部11の表示画面に表示させる(ステップS23)。なお、この時CPU13はユーザによる選択決定ボタン12bの所定の操作を検出すると、ライブビュー画像に重畳させて表示する被写体切り抜き画像C1〜Cnの半透過の表示態様の各画像の表示位置や大きさ角度を変更させるようにしてもよい。   Next, the CPU 13 causes the display control unit 10 to display a live view image on the display unit 11 based on a plurality of image frames generated by imaging the background by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. Each of the images in the semi-transparent display mode of the subject cut-out images C1 to Cn is displayed on the display screen of the display unit 11 so as to be superimposed on the live view image (step S23). At this time, when the CPU 13 detects a predetermined operation of the selection determination button 12b by the user, the display position and size of each image in the semi-transparent display mode of the subject cut-out images C1 to Cn to be displayed superimposed on the live view image. The angle may be changed.

次に、CPU13は、当該ライブビュー画像に重畳させて表示している被写体切り抜き画像C1〜Cnに含まれる被写体Sのライブビュー画像上における位置、つまり表示位置を撮像指示が入力されるまで更新しながら画像メモリ5に記憶する(ステップS24)。なお、このとき表示される被写体切り抜き画像C1〜Cnに含まれる被写体Sは、被写体切り抜き画像C1〜Cnのうちの何れか1つの画像における被写体Sだけを表示するようにしてもよいし、被写体切り抜き画像C1〜Cnに含まれる被写体Sを順番に切り替えながら表示するようにしてもよい。   Next, the CPU 13 updates the position on the live view image of the subject S included in the subject cutout images C1 to Cn displayed superimposed on the live view image, that is, the display position until an imaging instruction is input. The image data is stored in the image memory 5 (step S24). It should be noted that the subject S included in the subject cutout images C1 to Cn displayed at this time may display only the subject S in any one of the subject cutout images C1 to Cn, or the subject cutout. The subject S included in the images C1 to Cn may be displayed while being switched in order.

次に、CPU13は、ユーザによるシャッタボタン12aの全押し操作に基づいて撮像指示が入力されたか否かを判定する(ステップS25)。ここで、撮像指示が入力されたと判定されると(ステップS25;YES)、CPU13は、撮像制御部3に、背景画像D1〜Dn(図7参照)の光学像をステップS22にて設定された所定の撮像条件で電子撮像部2により撮像させる。そして、CPU13は、画像データ生成部4に、電子撮像部2から転送された背景画像D1〜Dnの各YUVデータを生成させる(ステップS26)。その後、CPU13は、背景画像D1〜Dnの各YUVデータを画像メモリ5に一時記憶させる。
これにより、例えば、トラックが左側から右側に走行する背景画像D1〜Dnの画像データが生成される。
Next, the CPU 13 determines whether or not an imaging instruction has been input based on the full pressing operation of the shutter button 12a by the user (step S25). If it is determined that an imaging instruction has been input (step S25; YES), the CPU 13 sets the optical images of the background images D1 to Dn (see FIG. 7) in the imaging control unit 3 in step S22. An image is captured by the electronic imaging unit 2 under predetermined imaging conditions. Then, the CPU 13 causes the image data generation unit 4 to generate the YUV data of the background images D1 to Dn transferred from the electronic imaging unit 2 (Step S26). Thereafter, the CPU 13 temporarily stores the YUV data of the background images D1 to Dn in the image memory 5.
Thereby, for example, image data of the background images D1 to Dn in which the truck travels from the left side to the right side is generated.

続けて、CPU13は、背景画像D1〜Dnの各々と被写体切り抜き画像C1〜Cnの各々とを合成し、合成画像M1〜Mnをフレームとする合成動画像Mを生成する画像合成処理を画像合成部8dに行わせて(ステップS27)、ステップS27で生成された合成動画像Mを記録媒体9に記録する(ステップS28)。   Subsequently, the CPU 13 synthesizes each of the background images D1 to Dn and each of the subject cutout images C1 to Cn, and performs an image synthesis process for generating a synthesized moving image M using the synthesized images M1 to Mn as a frame. 8d (step S27), the synthesized moving image M generated in step S27 is recorded on the recording medium 9 (step S28).

ここで、画像合成処理について図8〜図10を参照して詳細に説明する。
画像合成処理は、複数の被写体切り抜き画像C1〜Cnと複数の背景画像D1〜Dnについて、1枚目どうし、2枚目どうし、3枚目どうし、…N枚目どうしというようにそれぞれの画像の撮像順に合成処理を行う。また、このときの合成位置は、ステップS24において画像メモリ5に記憶された位置、つまり撮像指示が入力される直前のライブビュー画像上における被写体切り抜き画像C1〜Cnに含まれる被写体Sの表示位置に基づいて決定される。
例えば、画像メモリ5に被写体切抜き画像C1に含まれる被写体Sの表示位置が記憶されている場合は、その表示位置を被写体切抜き画像C1に含まれる被写体Sの合成位置とする。そして、その合成位置を基準として被写体切り抜き画像C2〜Cnに含まれる被写体Sを背景画像D2〜Dnに合成する。
つまり、図8に示すように、画像合成部8dは、被写体取得部8bにより取得された被写体切り抜き画像C1〜Cnの中から表示位置が記憶されている被写体切り抜き画像C1と1枚目の背景画像D1のYUVデータを指定する(ステップS30)。
Here, the image composition processing will be described in detail with reference to FIGS.
In the image composition process, for each of the plurality of subject cutout images C1 to Cn and the plurality of background images D1 to Dn, the first image, the second image, the third image,... Composite processing is performed in the order of imaging. Further, the composite position at this time is the position stored in the image memory 5 in step S24, that is, the display position of the subject S included in the subject cut-out images C1 to Cn on the live view image immediately before the imaging instruction is input. To be determined.
For example, when the display position of the subject S included in the subject cutout image C1 is stored in the image memory 5, the display position is set as the combined position of the subject S included in the subject cutout image C1. Then, the subject S included in the subject cut-out images C2 to Cn is synthesized with the background images D2 to Dn using the synthesis position as a reference.
That is, as illustrated in FIG. 8, the image composition unit 8d includes the subject cutout image C1 and the first background image in which the display positions are stored from the subject cutout images C1 to Cn acquired by the subject acquisition unit 8b. The DUV YUV data is designated (step S30).

次に、画像合成部8dは、1枚目の被写体切り抜き画像C1と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開する(ステップS31)。   Next, the image composition unit 8d reads the alpha map stored in association with the first subject cutout image C1 and develops it in the image memory 5 (step S31).

次に、画像合成部8dは、1枚目の背景画像D1の何れか一の画素(例えば、左上隅部の画素)を指定して(ステップS32)、当該画素について、アルファマップのアルファ値に基づいて処理を分岐させる(ステップS33)。具体的には、画像合成部8dは、当該背景画像D1の何れか一の画素のうち、アルファ値が1の画素については(ステップS33;α=1)、1枚目の被写体切り抜き画像C1の対応する画素の画素値で上書きし(ステップS34)、アルファ値が0<α<1の画素については(ステップS35;0<α<1)、1の補数(1−α)を用いて被写体領域を切り抜いた画像(背景画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて1枚目の被写体切り抜き画像C1を生成した際に単一背景色とブレンドした値を計算し、当該値を1枚目の被写体切り抜き画像C1から減算し、それを被写体領域を切り抜いた画像(背景画像×(1−α))と合成し(ステップS35)、アルファ値が0の画素については(ステップS33;α=0)、何もせずに当該1枚目の背景画像D1を透過させるようにする。   Next, the image composition unit 8d designates any one pixel (for example, the pixel at the upper left corner) of the first background image D1 (step S32), and sets the alpha value of the alpha map for the pixel. Based on this, the process is branched (step S33). Specifically, the image composition unit 8d, for any one pixel of the background image D1, has a alpha value of 1 (step S33; α = 1), and the first subject cut-out image C1. The pixel value of the corresponding pixel is overwritten (step S34), and for the pixel with an alpha value of 0 <α <1 (step S35; 0 <α <1), the subject area is calculated using 1's complement (1-α). When the first subject cutout image C1 is generated using the 1's complement (1-α) in the alpha map after the image is cut out (background image × (1-α)) Is calculated by subtracting the value from the first subject cutout image C1 and combining it with the image obtained by cutting out the subject area (background image × (1-α)) (step S35). For pixels with a value of 0 (step 33; α = 0), the first sheet of background image D1 so as to transmit without doing anything.

続けて、画像合成部8dは、当該1枚目の背景画像D1の全ての画素について処理したか否かを判定する(ステップS36)。
ここで、全ての画素について処理していないと判定されると(ステップS36;NO)、画像合成部8dは、処理対象として次の画素を指定して当該画素に処理対象を移動させて(ステップS37)、処理をステップS33に移行させる。
上記の処理を、ステップS36にて全ての画素について処理したと判定されるまで(ステップS36;YES)繰り返すことで、画像合成部dは、1枚目の被写体切り抜き画像C1と1枚目の背景画像D1とを合成した合成動画像Mを構成する1枚目の合成画像M1を生成する。
Subsequently, the image composition unit 8d determines whether or not all the pixels of the first background image D1 have been processed (step S36).
If it is determined that all the pixels have not been processed (step S36; NO), the image composition unit 8d designates the next pixel as the processing target and moves the processing target to the pixel (step S36). S37), the process proceeds to step S33.
By repeating the above processing until it is determined in step S36 that all pixels have been processed (step S36; YES), the image composition unit d allows the first subject cutout image C1 and the first background to be displayed. A first synthesized image M1 constituting a synthesized moving image M synthesized with the image D1 is generated.

次に、画像合成部8dは、複数の被写体切り抜き画像C1〜Cnの全ての画像について合成処理したか否かを判定する(ステップS38)。
ここで、全ての画像について合成処理していないと判定されると(ステップS38;NO)、画像合成部8dは、処理対象として次の画像(例えば、2枚目の被写体切り抜き画像C2と2枚目の背景画像D2)を指定して当該画像に処理対象を移動させて(ステップS39)、処理をステップS31に移行させる。
上記の処理を、ステップS38にて全ての画像について処理したと判定されるまで(ステップS38;YES)繰り返すことで、画像合成部dは、被写体切り抜き画像C1〜Cnの各々と背景画像D1〜Dnの各々とを合成し合成画像M1〜Mnを生成する。
これにより、画像合成処理を終了する。そしてこのように生成された合成画像M1〜Mnは、M1→M2→M3→……→Mnと順次切り換えて表示されることで、例えば、トラックが左側から右側に走行するのを人が追いかける合成動画像Mとなる。
Next, the image composition unit 8d determines whether or not all of the plurality of subject cut-out images C1 to Cn have been subjected to composition processing (step S38).
Here, if it is determined that the composition processing has not been performed for all the images (step S38; NO), the image composition unit 8d determines that the next image (for example, the second subject cutout image C2 and two images) are to be processed. The eye background image D2) is designated, the processing target is moved to the image (step S39), and the process proceeds to step S31.
By repeating the above processing until it is determined in step S38 that all the images have been processed (step S38; YES), the image composition unit d allows each of the subject cutout images C1 to Cn and the background images D1 to Dn. Are combined with each other to generate composite images M1 to Mn.
Thereby, the image composition process is terminated. The composite images M1 to Mn generated in this way are displayed by sequentially switching from M1 → M2 → M3 →... → Mn, for example, a composition in which a person follows the track traveling from the left side to the right side. A moving image M is obtained.

そして、図6に戻り、CPU13は、記録媒体9の所定の記憶領域に、合成画像M1〜Mnの画像データの拡張子を「.jpg」とした複数の画像ファイルからなるグループを記憶させる(ステップS28)。
尚、合成動画像Mはそれ自体ファイルとして存在せず、合成画像M1〜Mnの集合体として存在するようにしたが、合成画像M1〜Mnをフレーム(コマ)としたMotion JPEGからなる動画ファイル(拡張子は「.avi」)、若しくは、MPEGに準拠したファイル形式で圧縮符号化された動画ファイル(拡張子は「.mpg」、「.mov」、「.3g2」、「.3gp」等)として記憶させてもよい。
これにより、合成画像生成処理を終了する。
Returning to FIG. 6, the CPU 13 stores a group of a plurality of image files in which the extensions of the image data of the composite images M1 to Mn are “.jpg” in a predetermined storage area of the recording medium 9 (step S1). S28).
The synthesized moving image M does not exist as a file itself, but exists as an aggregate of the synthesized images M1 to Mn. However, a moving image file composed of Motion JPEG using the synthesized images M1 to Mn as frames (frames) ( The extension is “.avi”) or a video file that is compression-encoded in an MPEG-compliant file format (extensions are “.mpg”, “.mov”, “.3g2”, “.3gp”, etc.) May be stored.
Thus, the composite image generation process is finished.

以上のように、本実施形態の撮像装置100によれば、複数の被写体切り抜き画像C1〜Cnと同数の背景画像D1〜Dnを取得し、その複数の背景画像D1〜Dnの各々と複数の被写体切り抜き画像C1〜Cnの各々とを1枚目どうし、2枚目どうし、…N枚目どうしというようにそれぞれの画像の撮像順に合成して合成動画像Mを生成するので、被写体切り抜き画像C1〜Cnに係る被写体Sだけでなく、背景画像D1〜Dnに係る背景にも動きが生じ、従来のように背景が動かないというような違和感を軽減させることができ、興趣性の高い変化に富んだ合成動画像Mを生成することができる。
また、被写体取得部8bにより取得された複数の被写体切り抜き画像C1〜Cnと数を揃えるように背景画像D1〜Dnを複数取得するので、画像合成処理に係る背景画像D1〜Dn及び被写体切り抜き画像C1〜Cnの数を揃えることができ、画像合成処理を適正に行うことができる。即ち、例えば、背景画像D1〜Dn及び被写体切り抜き画像C1〜Cnのうち、何れか一方の画像が足りなくなった場合に、少ない方の画像に合わせたユーザ所望の数よりも少ない合成枚数での画像合成処理や、当該足りなくなった分の画像を後から追加生成するといった煩雑な処理を回避することができ、画像合成処理を適正に行うことができる。
As described above, according to the imaging apparatus 100 of the present embodiment, the same number of background images D1 to Dn as the plurality of subject cutout images C1 to Cn are acquired, and each of the plurality of background images D1 to Dn and the plurality of subjects are acquired. Since each of the cut-out images C1 to Cn is combined with each other in the order of image pickup such as the first image, the second image, and the N-th image, the combined moving image M is generated. Movement occurs not only in the subject S related to Cn but also in the background related to the background images D1 to Dn, and it is possible to reduce a sense of incongruity that the background does not move as in the past. A synthesized moving image M can be generated.
In addition, since a plurality of background images D1 to Dn are acquired so as to have the same number as the plurality of subject cutout images C1 to Cn acquired by the subject acquisition unit 8b, the background images D1 to Dn and the subject cutout image C1 related to the image composition processing are acquired. The number of .about.Cn can be made uniform, and the image composition process can be performed appropriately. That is, for example, when any one of the background images D1 to Dn and the subject cut-out images C1 to Cn is insufficient, an image with a smaller composite number than the user-desired number according to the smaller image. It is possible to avoid compositing processing and complicated processing such as additional generation of images for the shortage later, and image compositing processing can be performed appropriately.

また、背景取得部8cにより複数の被写体切り抜き画像C1〜Cnの撮像条件と同じ条件で撮像された背景画像D1〜Dnを取得して、記録媒体9は、当該背景画像D1〜Dnを記録するので、画像合成処理に係る背景画像D1〜Dn及び被写体切り抜き画像C1〜Cnの撮像条件を揃えることができ、画像合成処理を適正に行うことができる。特に、背景取得部8cは、複数の被写体切り抜き画像C1〜Cnと同数の背景画像D1〜Dnを取得するので、画像合成処理に係る背景画像D1〜Dnの数を被写体切り抜き画像C1〜Cnの数と揃えることができ、画像合成処理を適正に行うことができる。   Further, the background acquisition unit 8c acquires background images D1 to Dn captured under the same conditions as the imaging conditions of the plurality of subject cutout images C1 to Cn, and the recording medium 9 records the background images D1 to Dn. The imaging conditions of the background images D1 to Dn and the subject cutout images C1 to Cn related to the image composition process can be made uniform, and the image composition process can be performed appropriately. In particular, the background acquisition unit 8c acquires the same number of background images D1 to Dn as the plurality of subject cutout images C1 to Cn. And image composition processing can be performed appropriately.

また、背景取得部8cは、指定された一の被写体画像群Cを構成する複数の被写体切り抜き画像C1〜Cnの数と同数の背景画像D1〜Dnを取得することができ、画像合成処理に係る背景画像D1〜Dn及び被写体切り抜き画像C1〜Cnの数を揃えて画像合成処理を適正に行うことができる。   In addition, the background acquisition unit 8c can acquire the same number of background images D1 to Dn as the number of the subject cutout images C1 to Cn constituting one designated subject image group C, and is related to the image composition processing. Image composition processing can be appropriately performed by aligning the number of background images D1 to Dn and subject cutout images C1 to Cn.

また、背景取得部8cは、被写体取得部8bにより取得された複数の被写体切り抜き画像C1〜Cnの撮像フレームレートと同じ撮像フレームレートで撮像された背景画像D1〜Dnを取得することができるので、被写体切り抜き画像C1〜Cnと背景画像D1〜Dnとの撮影間隔を合わせることができ、より違和感を軽減させて、興趣性の高い変化に富んだ合成動画像Mを生成することができる。   Further, the background acquisition unit 8c can acquire the background images D1 to Dn captured at the same imaging frame rate as the imaging frame rates of the plurality of subject cutout images C1 to Cn acquired by the subject acquisition unit 8b. The shooting intervals of the subject cut-out images C1 to Cn and the background images D1 to Dn can be matched, and a sense of incongruity can be further reduced to generate a synthetic moving image M rich in changes with high interest.

また、複数の被写体切り抜き画像C1〜Cn数と同数の背景画像D1〜Dnを取得して当該背景画像D1〜Dnと被写体切り抜き画像C1〜Cnとを画像合成部8dに合成させることができるので、被写体領域の抽出に失敗した場合でも、当該複数の背景画像D1〜Dnの数に対して被写体切り抜き画像の数が足りなくなるといった状況を回避することができ、適切な画像合成処理を行うことができる。   Further, since the same number of background images D1 to Dn as the number of subject cutout images C1 to Cn can be acquired and the background image D1 to Dn and the subject cutout images C1 to Cn can be synthesized by the image composition unit 8d. Even when the extraction of the subject area fails, it is possible to avoid a situation where the number of subject cut-out images is insufficient with respect to the number of the plurality of background images D1 to Dn, and appropriate image composition processing can be performed. .

なお、本発明は、上記実施形態に限定されることなく、本発明の趣旨を逸脱しない範囲において、種々の改良並びに設計の変更を行っても良い。
例えば、上記実施形態にあっては被写体取得部8bにより取得された複数の被写体画像C1〜Cnと数を揃えるように連続して背景画像を撮像するようにしたが、背景画像の撮像方法はこれに限られるものではなく、複数の被写体画像C1〜Cnと数が揃っていれば適宜任意に変更することができる。
即ち、例えば、20枚の被写体切り抜き画像C1〜C20に対して、連続して撮像された10枚の背景画像と当該10枚の背景画像とは別に連続して撮像された10枚の背景画像とを取得するようにしても良いし、20回をそれぞれ連続ではない別々の撮像処理によって行ってもよい。
このようにして取得された背景画像によれば、背景が全く別の背景に切り替わり被写体切り抜き画像C1〜Cnに係る被写体Sが瞬間移動したかのような合成動画像Mを生成することができ、より興趣性を高めることができる。
また、20枚の被写体切り抜き画像C1〜C20に対して、表示態様が異なる2枚の背景画像(例えば、赤色の背景画像と白色の背景画像)が交互に表示されるように当該2枚の背景画像を10組取得するようにしても良い。
また、上記実施形態にあっては、被写体領域が抽出された被写体存在画像の数と同数の背景画像D1〜Dnを取得するようにしたが、これに限らず取得した被写体存在画像の数と同数の背景画像を取得するようにしてもよい。
The present invention is not limited to the above-described embodiment, and various improvements and design changes may be made without departing from the spirit of the present invention.
For example, in the above embodiment, the background image is continuously captured so that the number of the subject images C1 to Cn acquired by the subject acquisition unit 8b is the same. However, the number of the subject images C1 to Cn can be arbitrarily changed as appropriate.
That is, for example, with respect to 20 subject cutout images C1 to C20, 10 background images captured continuously and 10 background images captured continuously separately from the 10 background images May be acquired, or may be performed 20 times by separate imaging processes that are not continuous.
According to the background image acquired in this manner, the background can be changed to a completely different background, and the synthesized moving image M can be generated as if the subject S related to the subject cutout images C1 to Cn moved instantaneously. More interesting.
Further, the two background images (for example, a red background image and a white background image) are displayed alternately with respect to the 20 subject cutout images C1 to C20. You may make it acquire 10 sets of images.
In the above embodiment, the same number of background images D1 to Dn as the number of subject existing images from which subject areas have been extracted are acquired. However, the present invention is not limited to this, and the same number as the number of acquired subject existing images. The background image may be acquired.

また、上記実施形態にあっては、合成画像生成処理の最初のステップにて、記録媒体9に記憶された複数の被写体切り抜き画像群の中から一の被写体切り抜き画像群Cを指定するようにしたが、これに限らず、当該合成画像生成処理の最初のステップにて、連続して被写体存在画像A1〜Anおよび被写体非存在画像Bを撮像することにより複数の被写体切り抜き画像C1〜Cnを取得するようにしても良い。
これによれば、被写体存在画像A1〜Anの撮像と背景画像D1〜Dnの撮像とを一連の流れで行い、当該被写体切り抜き画像C1〜Cnと背景画像D1〜Dnとを画像合成することができるので、被写体存在画像A1〜Anを撮像する際の撮像条件を固定しておくことができるようになり、迅速な画像合成ができるようになる。
また、被写体存在画像A1〜Anは他の撮像装置によって撮像されたものであってもよい。この場合、画像ファイルに付帯されたExif情報に被写体Sが連続撮像された際の撮像フレームレート及び撮像数に係るデータが記録してあれば、算出部8eは、この情報を読み出すことで被写体存在画像の数を取得することができる。
また、撮像装置によって撮像された被写体存在画像A1〜Anから抽出されたものに限らず、被写体切り抜き画像C1〜Cnは予め記録媒体9に記録されているものであってもよい。
Further, in the above embodiment, in the first step of the composite image generation process, one subject cutout image group C is designated from among a plurality of subject cutout image groups stored in the recording medium 9. However, the present invention is not limited to this, and in the first step of the composite image generation process, a plurality of subject cut-out images C1 to Cn are acquired by continuously capturing the subject presence images A1 to An and the subject absence image B. You may do it.
According to this, imaging of the subject existing images A1 to An and imaging of the background images D1 to Dn are performed in a series of flows, and the subject cutout images C1 to Cn and the background images D1 to Dn can be combined. Therefore, it becomes possible to fix the imaging conditions when imaging the subject existing images A1 to An, and to perform quick image composition.
In addition, the subject presence images A1 to An may be captured by other imaging devices. In this case, if data related to the imaging frame rate and the number of imaging when the subject S is continuously captured is recorded in the Exif information attached to the image file, the calculation unit 8e reads the information to detect the presence of the subject. The number of images can be acquired.
The subject cut-out images C1 to Cn are not limited to those extracted from the subject presence images A1 to An imaged by the imaging device, but may be those recorded in the recording medium 9 in advance.

また、上記実施形態にあっては、被写体取得手段、背景取得手段、合成手段としての機能を、CPU13の制御下にて、画像処理部8が駆動することにより実現される構成としたが、これに限られるものではなく、CPU13によって所定のプログラム等が実行されることにより実現される構成としても良い。
即ち、プログラムを記憶するプログラムメモリ(図示略)に、被写体取得処理ルーチン、背景取得処理ルーチン、合成処理ルーチンを含むプログラムを記憶しておく。そして、被写体取得処理ルーチンによりCPU13を、被写体が連続して撮像された複数の被写体画像を取得する被写体取得手段として機能させるようにしても良い。また、背景取得処理ルーチンによりCPU13を、被写体取得処理ルーチンにより取得された複数の被写体画像と同数の背景画像を取得する背景取得手段として機能させるようにしても良い。また、合成処理ルーチンによりCPU13を、被写体取得処理ルーチンによって取得された複数の被写体画像と背景取得処理ルーチンによって取得された複数の背景画像とを合成して複数の合成画像を得、これら複数の合成画像をフレームとした合成動画像を生成する合成手段として機能させるようにしても良い。
In the above embodiment, the functions of the subject acquisition unit, the background acquisition unit, and the synthesis unit are realized by driving the image processing unit 8 under the control of the CPU 13. However, the present invention is not limited to this, and a configuration realized by executing a predetermined program or the like by the CPU 13 may be adopted.
That is, a program including a subject acquisition processing routine, a background acquisition processing routine, and a synthesis processing routine is stored in a program memory (not shown) that stores the program. Then, the subject acquisition processing routine may cause the CPU 13 to function as subject acquisition means for acquiring a plurality of subject images in which the subject is continuously captured. In addition, the background acquisition processing routine may cause the CPU 13 to function as background acquisition means for acquiring the same number of background images as the plurality of subject images acquired by the subject acquisition processing routine. Further, the CPU 13 causes the synthesis processing routine to synthesize the plurality of subject images acquired by the subject acquisition processing routine and the plurality of background images acquired by the background acquisition processing routine, thereby obtaining a plurality of synthesized images. You may make it function as a synthetic | combination means which produces | generates the synthetic | combination moving image which used the image as the frame.

100 撮像装置
1 レンズ部
2 電子撮像部
3 撮像制御部
8 画像処理部
8a 切り抜き画像生成部
8b 被写体取得部
8c 背景取得部
8d 画像合成部
8e 算出部
8f 合成制御部
12a シャッタボタン
12b 選択決定ボタン
13 CPU
DESCRIPTION OF SYMBOLS 100 Imaging device 1 Lens part 2 Electronic imaging part 3 Imaging control part 8 Image processing part 8a Cutout image generation part 8b Subject acquisition part 8c Background acquisition part 8d Image composition part 8e Calculation part 8f Composition control part 12a Shutter button 12b Selection button 13 CPU

Claims (6)

所定の撮像フレームレートで所定の枚数連続して撮像させ、背景内に被写体が存在する複数の被写体画像を取得する被写体取得手段と、
前記被写体取得手段により取得された前記複数の被写体画像から前記被写体が含まれる被写体領域を抽出して、複数の被写体切り抜き画像を生成する被写体切り抜き手段と、
前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像の枚数を算出する枚数算出手段と、
前記被写体取得手段により取得された前記複数の被写体画像が存在した背景とは異なる背景画像を前記枚数算出手段で算出した前記複数の被写体切り抜き画像の枚数と同数取得する背景取得手段と、
前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像と前記背景取得手段によって取得された複数の背景画像とを合成して複数の合成画像を得、これら複数の合成画像をフレームとした合成動画像を生成する合成手段と、
を備えたことを特徴とする画像合成装置。
Subject acquisition means for continuously capturing a predetermined number of images at a predetermined imaging frame rate and acquiring a plurality of subject images in which a subject exists in the background ;
Subject cutout means for extracting a subject area including the subject from the plurality of subject images acquired by the subject acquisition means and generating a plurality of subject cutout images;
A number calculation means for calculating the number of the plurality of subject cutout images generated by the subject cutout means;
Background acquisition means for acquiring a background image different from the background in which the plurality of subject images acquired by the subject acquisition means are the same as the number of the plurality of subject cut-out images calculated by the number calculation means ;
The plurality of subject cutout images generated by the subject cutout unit and the plurality of background images acquired by the background acquisition unit are combined to obtain a plurality of composite images, and the combined moving image using the plurality of composite images as frames. A synthesis means for generating
An image composition device comprising:
前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像から構成される被写体切り抜き画像群を複数記録する被写体記録手段と、
前記被写体記録手段に記録された複数の被写体切り抜き画像群の中から何れか一の被写体切り抜き画像群を指定する指定手段と、
を更に備え、
前記背景取得手段は、前記指定手段により指定された一の被写体切り抜き画像群を構成する複数の被写体切り抜き画像の枚数と同数の背景画像を取得することを特徴とする請求項1記載の画像合成装置。
Subject recording means for recording a plurality of subject cutout image groups composed of the plurality of subject cutout images generated by the subject cutout means;
Designating means for designating any one of the subject cutout image groups from among the plurality of subject cutout image groups recorded in the subject recording means;
Further comprising
2. The image synthesizing apparatus according to claim 1, wherein the background acquisition unit acquires the same number of background images as the number of a plurality of subject cutout images constituting one subject cutout image group designated by the designation unit. .
前記被写体取得手段が複数の被写体画像を取得した際の撮像フレームレートを取得する撮像フレームレート取得手段を更に備え、
前記背景取得手段は、前記撮像フレームレート取得手段によって取得された撮像フレームレートと同じフレームレートで背景画像を取得することを特徴とする請求項1又は2記載の画像合成装置。
An imaging frame rate acquisition unit that acquires an imaging frame rate when the subject acquisition unit acquires a plurality of subject images;
The image synthesizing apparatus according to claim 1, wherein the background acquisition unit acquires a background image at the same frame rate as the imaging frame rate acquired by the imaging frame rate acquisition unit.
撮像手段を備え、
前記背景取得手段は、前記撮像手段による撮像により前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像の枚数と少なくとも同数の背景画像を取得することを特徴とする請求項1〜3の何れか一項に記載の画像合成装置。
Comprising imaging means,
The background acquisition unit acquires at least the same number of background images as the number of the plurality of subject cutout images generated by the subject cutout unit by imaging by the imaging unit. The image synthesizing device according to item.
所定の撮像フレームレートで所定の枚数連続して撮像させ、背景内に被写体が存在する複数の被写体画像を取得する被写体取得ステップと、
前記被写体取得ステップにより取得された前記複数の被写体画像から前記被写体が含まれる被写体領域を抽出して、複数の被写体切り抜き画像を生成する被写体切り抜きステップと、
前記被写体切り抜きステップで生成した前記複数の被写体切り抜き画像の枚数を算出する枚数算出ステップと、
前記被写体取得ステップにより取得された前記複数の被写体画像が存在した背景とは異なる背景画像を前記枚数算出ステップで算出した前記複数の被写体切り抜き画像の枚数と同数取得する背景取得ステップと、
前記被写体切り抜きステップで生成した前記複数の被写体切り抜き画像と前記背景取得ステップによって取得された複数の背景画像とを合成して複数の合成画像を得、これら複数の合成画像をフレームとした合成動画像を生成する合成ステップと、
を含む画像合成方法。
A subject acquisition step of capturing a plurality of subject images in which a predetermined number of images are continuously captured at a predetermined imaging frame rate and the subject is present in the background ;
A subject cropping step of extracting a subject region including the subject from the plurality of subject images acquired by the subject acquisition step and generating a plurality of subject cropped images;
A number calculation step of calculating the number of the plurality of subject cutout images generated in the subject cutout step;
And background acquiring many as the number of the plurality of subject cut-out image calculated by the number calculation step different background image more acquired background plurality of subject images were present was the object acquisition step,
Wherein the subject cut-out step said plurality of subject cut-out image generated by by synthesizing the plurality of background images acquired by the background acquisition step to obtain a plurality of synthesized images, and a plurality of synthetic images and frame synthesis A composition step for generating a moving image;
An image composition method including:
画像合成装置のコンピュータを、
所定の撮像フレームレートで所定の枚数連続して撮像させ、背景内に被写体が存在する複数の被写体画像を取得する被写体取得手段、
前記被写体取得手段により取得された前記複数の被写体画像から前記被写体が含まれる被写体領域を抽出して、複数の被写体切り抜き画像を生成する被写体切り抜き手段、
前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像の枚数を算出する枚数算出手段、
前記被写体取得手段によ取得された前記複数の被写体画像が存在した背景とは異なる背景画像を前記枚数算出手段で算出した前記複数の被写体切り抜き画像の枚数と同数取得する背景取得手段、
前記被写体切り抜き手段で生成した前記複数の被写体切り抜き画像と前記背景取得手段によって取得された複数の背景画像とを合成して複数の合成画像を得、これら複数の合成画像をフレームとした合成動画像を生成する合成手段、
として機能させることを特徴とするプログラム。
The computer of the image synthesizer
Subject acquisition means for acquiring a plurality of subject images in which a predetermined number of images are continuously captured at a predetermined imaging frame rate and the subject is present in the background ;
Subject cutout means for extracting a subject area including the subject from the plurality of subject images acquired by the subject acquisition means and generating a plurality of subject cutout images;
A number calculating unit for calculating the number of the plurality of subject cutout images generated by the subject cutting unit;
Number as many acquisition background acquisition means of the object acquisition means is acquired Ri by the a plurality of subject cut-out image calculated by the number calculator means different background image as a background in which the plurality of subject images is present,
The plurality of subject cutout images generated by the subject cutout unit and the plurality of background images acquired by the background acquisition unit are combined to obtain a plurality of composite images, and the combined moving image using the plurality of composite images as frames. A synthesis means for generating
A program characterized by functioning as
JP2009227186A 2009-09-30 2009-09-30 Image composition apparatus, image composition method, and program Expired - Fee Related JP5476900B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009227186A JP5476900B2 (en) 2009-09-30 2009-09-30 Image composition apparatus, image composition method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009227186A JP5476900B2 (en) 2009-09-30 2009-09-30 Image composition apparatus, image composition method, and program

Publications (2)

Publication Number Publication Date
JP2011077820A JP2011077820A (en) 2011-04-14
JP5476900B2 true JP5476900B2 (en) 2014-04-23

Family

ID=44021324

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009227186A Expired - Fee Related JP5476900B2 (en) 2009-09-30 2009-09-30 Image composition apparatus, image composition method, and program

Country Status (1)

Country Link
JP (1) JP5476900B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6695826B2 (en) * 2017-05-19 2020-05-20 ヤフー株式会社 Information display program, information display device, information display method, and distribution device
CN116456039A (en) * 2022-01-10 2023-07-18 华为技术有限公司 Video synthesis method, device and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09147134A (en) * 1995-11-17 1997-06-06 Matsushita Electric Ind Co Ltd Animation generating device
JP2001300064A (en) * 2000-04-24 2001-10-30 Heiwa Corp Game machine
JP4344534B2 (en) * 2003-04-30 2009-10-14 セコム株式会社 Image processing system
JP2006186901A (en) * 2004-12-28 2006-07-13 Nikon Corp Electronic camera

Also Published As

Publication number Publication date
JP2011077820A (en) 2011-04-14

Similar Documents

Publication Publication Date Title
JP5105550B2 (en) Image composition apparatus and program
JP4720859B2 (en) Image processing apparatus, image processing method, and program
JP4760973B2 (en) Imaging apparatus and image processing method
JP5051156B2 (en) Image processing apparatus and program
KR20090093817A (en) Imaging apparatus provided with panning mode for taking panned image
JP2010268441A (en) Image processor, imaging device, and image reproducing device
JP4807432B2 (en) Imaging apparatus, image processing method, and program
JP6304293B2 (en) Image processing apparatus, image processing method, and program
CN107205112B (en) Image pickup apparatus, image pickup method, and recording medium
JP4742813B2 (en) Image processing apparatus and image processing method
US8711239B2 (en) Program recording medium, image processing apparatus, imaging apparatus, and image processing method
JP5402166B2 (en) Image composition apparatus and program
JP5267279B2 (en) Image composition apparatus and program
JP6330862B2 (en) Imaging apparatus, imaging method, and program
JP5476900B2 (en) Image composition apparatus, image composition method, and program
JP5402242B2 (en) Image reproduction apparatus, imaging apparatus, image reproduction method, and image reproduction program
JP2009044329A (en) Program, image processing method, and image processor
JP5402148B2 (en) Image composition apparatus, image composition method, and program
JP5636660B2 (en) Image processing apparatus, image processing method, and program
JP2011041041A (en) Imaging apparatus, imaging method and program
JP5493839B2 (en) Imaging apparatus, image composition method, and program
JP5589333B2 (en) Image composition apparatus, image composition method, and program
JP2011182014A (en) Image pickup device, image processing method and program
JP2010278701A (en) Image combining device, and image combining method and program
JP5494537B2 (en) Image processing apparatus and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120927

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20120927

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130709

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130802

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131008

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131108

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140127

R150 Certificate of patent or registration of utility model

Ref document number: 5476900

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees