JP2010239464A - Image compositing device, image reproducing device, and program - Google Patents

Image compositing device, image reproducing device, and program Download PDF

Info

Publication number
JP2010239464A
JP2010239464A JP2009086169A JP2009086169A JP2010239464A JP 2010239464 A JP2010239464 A JP 2010239464A JP 2009086169 A JP2009086169 A JP 2009086169A JP 2009086169 A JP2009086169 A JP 2009086169A JP 2010239464 A JP2010239464 A JP 2010239464A
Authority
JP
Japan
Prior art keywords
image
moving
subject
frame
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009086169A
Other languages
Japanese (ja)
Other versions
JP5402166B2 (en
Inventor
Hiroyuki Hoshino
博之 星野
Atsushi Muraki
淳 村木
Hiroshi Shimizu
博 清水
Erina Ichikawa
英里奈 市川
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 JP2009086169A priority Critical patent/JP5402166B2/en
Publication of JP2010239464A publication Critical patent/JP2010239464A/en
Application granted granted Critical
Publication of JP5402166B2 publication Critical patent/JP5402166B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Television Signal Processing For Recording (AREA)
  • Studio Devices (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To generate an image having high amusement by imparting motion to a composited still image. <P>SOLUTION: An image pickup device 100 includes: an acquiring means 7e for acquiring a motion image P4 for background and an object cutout image P3 to be composited to the motion image P4; a motion detecting section 6 for detecting the motion information of a moving object B in the motion image P4 obtained by the acquiring section 7e; and an image compositing section 7g for compositing the subject cutout image P3 with the motion image P4 so that the object cutout image P3 moves on the motion image P4 on the basis of the motion information detected by the motion detecting section 6 and generating a composite image. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、複数の画像を合成する画像合成装置、画像再生装置及びプログラムに関する。   The present invention relates to an image composition device, an image reproduction device, and a program for combining a plurality of images.

従来、合成用画像と背景用画像やフレーム画像を合成することにより合成画像を生成する技術が知られている(例えば、特許文献1参照)。   Conventionally, a technique for generating a composite image by combining a composite image with a background image or a frame image is known (see, for example, Patent Document 1).

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

しかしながら、背景用画像が動画像の場合、当該背景用画像に対する合成用の静止画像の合成位置を設定しても、合成用の静止画像が最初に設定された合成位置に固定された状態の動画像が単に生成されるに過ぎず、興趣に欠ける画像となってしまう。   However, if the background image is a moving image, the moving image in a state where the composition still image is fixed at the initially set composition position even if the composition position of the composition still image with respect to the background image is set. The image is merely generated, and the image is not interesting.

そこで、本発明の課題は、合成された静止画像に動きを与えることができ、興趣性の高い画像を生成することができる画像合成装置、画像再生装置及びプログラムを提供することである。   Therefore, an object of the present invention is to provide an image composition device, an image reproduction device, and a program that can give a motion to a synthesized still image and can generate a highly interesting image.

上記課題を解決するため、請求項1に記載の発明の画像合成装置は、
背景用の動画像及び当該動画像と合成すべき静止画像を取得する取得手段と、この取得手段によって取得された背景用の動画像における動体の動き情報を検出する検出手段と、この検出手段によって検出された動き情報に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を生成する合成手段と、を備えたことを特徴としている。
In order to solve the above-described problem, an image composition device according to a first aspect of the present invention provides:
An acquisition means for acquiring a background moving image and a still image to be synthesized with the moving image, a detection means for detecting motion information of a moving object in the background moving image acquired by the acquisition means, and the detection means Based on the detected motion information, comprising a combining unit that combines the still image and the moving image to generate a combined moving image so that the still image is operated on the background moving image. It is characterized by.

請求項2に記載の発明は、請求項1に記載の画像合成装置において、
前記動画像を構成する複数の画像フレームのうち、何れか一の画像フレームにおける前記静止画像の合成位置を指定する指定手段を更に備え、前記合成手段は、前記複数の画像フレームのうち、前記一の画像フレームにおいては、前記指定手段によって指定された合成位置に前記静止画像を合成し、且つ、前記一の画像フレーム以外の各画像フレームにおいては、前記一の画像フレームに合成された前記静止画像に対し前記動体の動きに合わせて変位させるように前記静止画像を合成することを特徴としている。
According to a second aspect of the present invention, in the image composition device according to the first aspect,
The image processing apparatus further includes designation means for designating a synthesis position of the still image in any one of the plurality of image frames constituting the moving image, and the synthesis means includes the one of the plurality of image frames. In the image frame, the still image is synthesized at the synthesis position designated by the designation unit, and in each image frame other than the one image frame, the still image synthesized in the one image frame. On the other hand, the still image is synthesized so as to be displaced according to the movement of the moving body.

請求項3に記載の発明は、請求項2に記載の画像合成装置において、
前記合成手段は、前記指定手段によって指定された合成位置が、前記動画像における動体を含む位置であった場合に、前記一の画像フレーム以外の各画像フレームにおいては、前記一の画像フレームに合成された前記静止画像に対し前記動体の動き情報に応じて変位させるように前記静止画像を合成することを特徴としている。
According to a third aspect of the present invention, in the image composition device according to the second aspect,
The synthesizing unit synthesizes the one image frame in each image frame other than the one image frame when the synthesis position designated by the designation unit is a position including a moving object in the moving image. The still image is synthesized so that the still image is displaced in accordance with movement information of the moving object.

請求項4に記載の発明は、請求項2又は3に記載の画像合成装置において、
前記検出手段は、前記複数の画像フレームのうち、少なくとも一の隣合う画像フレーム間の動体の動き情報を検出し、前記検出手段によって検出された前記少なくとも一の隣合う画像フレーム間の動体の動き情報に基づいて、前記一の画像フレーム以外の各画像フレームにおける前記静止画像の合成位置を設定する合成位置設定手段を更に備えることを特徴としている。
According to a fourth aspect of the present invention, in the image composition device according to the second or third aspect,
The detection means detects movement information of a moving object between at least one adjacent image frame among the plurality of image frames, and a movement of the moving object between the at least one adjacent image frames detected by the detection means. The image processing apparatus further includes a combination position setting unit that sets a combination position of the still image in each image frame other than the one image frame based on the information.

請求項5に記載の発明は、請求項1〜4の何れか一項に記載の画像合成装置において、
前記静止画像は、背景内に被写体が存在する被写体存在画像から被写体が含まれる被写体領域を抽出した画像であることを特徴としている。
The invention according to claim 5 is the image composition device according to any one of claims 1 to 4,
The still image is an image obtained by extracting a subject area including a subject from a subject existing image in which a subject is present in a background.

請求項6に記載の発明は、請求項1〜5の何れか一項に記載の画像合成装置において、
前記動体の動き情報は、動体の位置の変化情報、大きさの変化情報及び回転角度の変化情報のうち少なくとも1つを含むことを特徴としている。
The invention according to claim 6 is the image synthesizing apparatus according to any one of claims 1 to 5,
The motion information of the moving object includes at least one of position change information, size change information, and rotation angle change information of the moving object.

請求項7に記載の発明の画像再生装置は、
背景用の動画像及び当該動画像と合成すべき静止画像を記録する画像記録手段と、前記背景用の動画像の動体の動き情報に基づいて、当該動画像における前記静止画像の合成位置を記録する位置記録手段と、この位置記録手段に記録された前記合成位置に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生手段と、を備えたことを特徴としている。
The image reproduction device of the invention according to claim 7
An image recording means for recording a moving image for background and a still image to be combined with the moving image, and a recording position of the still image in the moving image based on motion information of the moving object of the moving image for background And a position recording unit that combines the still image and the moving image so as to operate the still image on the background moving image based on the combination position recorded in the position recording unit. And a reproducing means for reproducing a moving image.

請求項8に記載の発明のプログラムは、
画像合成装置のコンピュータを、背景用の動画像及び当該動画像と合成すべき静止画像を取得する取得手段、この取得手段によって取得された背景用の動画像における動体の動き情報を検出する検出手段、この検出手段によって検出された動き情報に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を生成する合成制御手段、として機能させることを特徴としている。
The program of the invention described in claim 8 is:
An acquisition means for acquiring a background moving image and a still image to be combined with the moving image, and a detecting means for detecting motion information of a moving object in the background moving image acquired by the acquisition means. Based on the motion information detected by the detection unit, a synthesis control unit that synthesizes the still image and the moving image so as to operate the still image on the background moving image to generate a combined moving image. It is characterized by functioning as.

請求項9に記載の発明のプログラムは、
画像再生装置のコンピュータを、背景用の動画像及び当該動画像と合成すべき静止画像を記録手段に記録させる画像記録制御手段、前記背景用の動画像の動体の動き情報に基づいて設定された当該動画像における前記静止画像の合成位置を記録手段に記録させる位置記録制御手段、この位置記録制御手段により記録された前記合成位置に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生制御手段、として機能させることを特徴としている。
The program of the invention according to claim 9 is:
The computer of the image reproduction apparatus is set based on the motion information of the moving object of the moving image of the background moving image, the image recording control unit for recording the moving image for the background and the still image to be combined with the moving image on the recording unit Position recording control means for causing the recording means to record the synthesized position of the still image in the moving image, and the still image is operated on the background moving image based on the synthesized position recorded by the position recording control means. It is characterized by functioning as reproduction control means for synthesizing the still image and the moving image so as to reproduce a synthesized moving image.

本発明によれば、動画像を背景として合成された静止画像に動きを与えることができ、興趣性の高い合成動画を生成することができる。   ADVANTAGE OF THE INVENTION According to this invention, a motion can be given to the still image synthesize | combined using the moving image as a background, and a synthetic animation 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. 図1の撮像装置による被写体切り抜き処理に係る動作の一例を示すフローチャートである。3 is a flowchart illustrating an example of an operation related to subject clipping processing by the imaging apparatus of FIG. 1. 図2の被写体切り抜き処理に係る画像の一例を模式的に示す図である。It is a figure which shows typically an example of the image which concerns on the to-be-photographed object cutting process of FIG. 図1の撮像装置による動画像生成処理に係る動作の一例を示すフローチャートである。3 is a flowchart illustrating an example of an operation related to a moving image generation process by the imaging apparatus of FIG. 1. 図4の動画像生成処理に係る画像の一例を模式的に示す図である。It is a figure which shows typically an example of the image which concerns on the moving image generation process of FIG. 図1の撮像装置による合成動画生成処理に係る動作の一例を示すフローチャートである。3 is a flowchart illustrating an example of an operation related to a synthetic moving image generation process performed by the imaging apparatus of FIG. 1. 図6の合成動画生成処理の続きを示す続きのフローチャートである。FIG. 7 is a continuation flowchart showing a continuation of the synthetic moving image generation process of FIG. 6. 図6及び図7の合成動画生成処理の続きを示す続きのフローチャートである。FIG. 8 is a continuation flowchart showing a continuation of the synthetic moving image generation process of FIGS. 6 and 7. FIG. 図6〜図8の合成動画生成処理における画像合成処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on the image composition process in the synthetic | combination moving image production | generation process of FIGS. 図6〜図8の合成動画生成処理に係る画像の一例を模式的に示す図である。It is a figure which shows typically an example of the image which concerns on the synthetic | combination moving image production | generation process of FIGS.

以下に、本発明について、図面を用いて具体的な態様を説明する。ただし、発明の範囲は、図示例に限定されない。
図1は、本発明を適用した一実施形態の撮像装置100の概略構成を示すブロック図である。
本実施形態の撮像装置100は、背景用の動画像P4(図5参照)における動体B(図5参照)の動き情報を検出し、検出された動き情報に基づいて、動体Bの動きに合わせて合成用の静止画像P3の被写体領域S(図3(c)参照)を所定動作させるように当該静止画像P3と動画像P4とを合成して合成動画M(図10(b)参照)を生成する。
具体的には、図1に示すように、撮像装置100は、レンズ部1と、電子撮像部2と、撮像制御部3と、画像データ生成部4と、画像メモリ5と、動き検出部6と、画像処理部7と、記録媒体8と、表示制御部9と、表示部10と、操作入力部11と、CPU12とを備えている。
また、撮像制御部3と、動き検出部6と、画像処理部7と、CPU12は、例えば、カスタム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 detects the motion information of the moving object B (see FIG. 5) in the background moving image P4 (see FIG. 5), and matches the motion of the moving object B based on the detected motion information. The still image P3 and the moving image P4 are synthesized so that the subject area S (see FIG. 3C) of the still image P3 for synthesis is operated in a predetermined manner, and the synthesized moving image M (see FIG. 10B) is obtained. Generate.
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 motion detection unit 6. An image processing unit 7, a recording medium 8, a display control unit 9, a display unit 10, an operation input unit 11, and a CPU 12.
In addition, the imaging control unit 3, the motion detection unit 6, the image processing unit 7, and the CPU 12 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は、AF(自動合焦処理)、AE(自動露出処理)、AWB(自動ホワイトバランス)等の被写体を撮像する際の条件の調整制御を行う。
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.
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).

このように構成されたレンズ部1、電子撮像部2及び撮像制御部3は、背景内に被写体が存在する被写体存在画像P1(図3(a)参照)や背景用の動画像P4(図5参照)を撮像する。
また、レンズ部1、電子撮像部2及び撮像制御部3は、被写体存在画像P1の撮像後、当該被写体存在画像P1の撮像の際の撮像条件を固定した状態で、被写体切り抜き画像P3(図3(c)参照)の生成のための被写体非存在画像P2(図3(b)参照)を撮像する。
The lens unit 1, the electronic imaging unit 2, and the imaging control unit 3 configured in this way have a subject existing image P 1 (see FIG. 3A) in which a subject exists in the background and a background moving image P 4 (see FIG. 5). Image).
In addition, the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3 capture the subject clipped image P3 (FIG. 3) in a state where the imaging conditions for capturing the subject presence image P1 are fixed after the subject presence image P1 is captured. A subject non-existence image P2 (see FIG. 3B) for generating (see (c)) is captured.

画像データ生成部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と、CPU12等によって処理されるデータ等を一時記憶する。   The image memory 5 is composed of, for example, a DRAM or the like, and temporarily stores data processed by the motion detection unit 6, the image processing unit 7, the CPU 12, and the like.

動き検出部6は、異なる時間に撮像された複数の画像を用いて、被写体の運動を解析する。具体的には、図1に示すように、動き検出部6は、特徴量演算部6aと、ブロックマッチング部6bとを備えている。   The motion detection unit 6 analyzes the motion of the subject using a plurality of images taken at different times. Specifically, as shown in FIG. 1, the motion detection unit 6 includes a feature amount calculation unit 6a and a block matching unit 6b.

特徴量演算部6aは、被写体非存在画像P2を基準として、当該被写体非存在画像P2から特徴点を抽出する特徴抽出処理を行う。具体的には、特徴量演算部6aは、被写体非存在画像P2のYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレート(例えば、16×16画素の正方形)として抽出する。
ここで、特徴抽出処理とは、多数の候補ブロックから追跡に都合の良い特徴性の高いものを選択する処理である。
The feature amount calculation unit 6a performs feature extraction processing for extracting feature points from the subject non-existing image P2 with reference to the subject non-existing image P2. Specifically, the feature amount calculation unit 6a 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 P2, and the block 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.

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

また、ブロックマッチング部6bは、例えば、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、動画像P4を構成するユーザ所望の任意の基準画像フレーム(例えば、画像フレームf3)への被写体切り抜き画像P3における被写体領域Sの合成位置が指定入力されると、当該合成位置をテンプレートとして、当該基準画像フレームと隣合う画像フレーム(例えば、基準画像フレームの1つ前の画像フレームf2)内にて当該テンプレートの画素値が最適にマッチする位置(対応領域)を探索する。そして、画素値の相違度の評価値(例えば、差分二乗和(SSD)や差分絶対値和(SAD)等)が最も良かった基準画像フレームと当該基準画像フレームの1つ前の画像フレームとの間の最適なオフセットを当該テンプレートの動きベクトルとして算出する。そして、算出された複数の動きベクトルの各々について、何れか一の動きベクトルを評価対象として他の動きベクトルと比較して当該評価対象の動きベクトルに対して投票するか否かを決定し、一の画像フレームにおける動体Bの動きベクトルを多数決により算出する。
さらに、動体Bの動きベクトルが算出された画像フレーム(例えば、画像フレームf2)と隣合う画像フレーム(例えば、基準画像フレームの二つ前の画像フレームf1)に対しても、上記と同様の処理を行って、当該画像フレームの動体Bの動きベクトルを算出する。これらの処理を動画像P4を構成する基準画像フレーム以外の全ての画像フレーム(例えば、画像フレームf1,f2,f4,f5)に対して行うことで、各画像フレームf1〜f5における動体Bの動きベクトルを算出する。
Further, the block matching unit 6b, for example, to an arbitrary reference image frame (for example, an image frame f3) desired by the user constituting the moving image P4 based on a predetermined operation of the selection determination button 11b of the operation input unit 11 by the user. When the composite position of the subject region S in the subject cutout image P3 is designated and input, an image frame adjacent to the reference image frame (for example, the image frame f2 immediately before the reference image frame) using the composite position as a template. The position (corresponding region) where the pixel value of the template matches optimally is searched. Then, the reference image frame having the best evaluation value (for example, difference sum of squares (SSD), difference sum of absolute values (SAD), etc.) of the pixel value and the image frame immediately before the reference image frame are evaluated. An optimal offset between them is calculated as the motion vector of the template. Then, for each of the plurality of calculated motion vectors, one of the motion vectors is compared with another motion vector as an evaluation target, and it is determined whether or not to vote for the motion vector of the evaluation target. The motion vector of the moving object B in the image frame is calculated by majority vote.
Further, the same processing as described above is performed for an image frame (for example, the image frame f1 immediately before the reference image frame) adjacent to the image frame (for example, the image frame f2) for which the motion vector of the moving object B is calculated. To calculate the motion vector of the moving object B of the image frame. By performing these processes on all image frames (for example, image frames f1, f2, f4, and f5) other than the reference image frame constituting the moving image P4, the motion of the moving object B in each of the image frames f1 to f5 Calculate the vector.

画像処理部7は、被写体存在画像P1と被写体非存在画像P2との位置合わせを行う位置合わせ部7aを具備している。
位置合わせ部7aは、被写体非存在画像P2から抽出した特徴点に基づいて、被写体非存在画像P2に対する被写体存在画像P1の各画素の座標変換式(射影変換行列)を算出し、当該座標変換式に従って被写体存在画像P1を座標変換して被写体非存在画像P2と位置合わせを行う。
The image processing unit 7 includes an alignment unit 7a that performs alignment between the subject presence image P1 and the subject non-existence image P2.
The alignment unit 7a calculates a coordinate conversion formula (projection conversion matrix) of each pixel of the subject presence image P1 with respect to the subject non-existence image P2 based on the feature points extracted from the subject non-existence image P2, and the coordinate conversion formula Accordingly, the subject presence image P1 is coordinate-converted to align with the subject non-existence image P2.

また、画像処理部7は、位置合わせ部7aにより位置合わせされた被写体存在画像P1と被写体非存在画像P2との間で対応する各画素の差分情報を生成し、当該差分情報を基準として被写体存在画像P1から被写体が含まれる被写体領域Sを抽出する被写体領域抽出部7bを具備している。   Further, the image processing unit 7 generates difference information of corresponding pixels between the subject presence image P1 and the subject non-existence image P2 that are aligned by the alignment unit 7a, and the subject exists based on the difference information. A subject area extraction unit 7b that extracts a subject area S including a subject from the image P1 is provided.

また、画像処理部7は、被写体存在画像P1内で抽出された被写体領域Sの位置を特定して、被写体存在画像P1における被写体領域Sの位置を示す位置情報を生成する位置情報生成部7cを具備している。
ここで、位置情報としては、例えば、アルファマップが挙げられ、アルファマップとは、被写体存在画像P1の各画素について、被写体領域Sの画像を所定の背景に対してアルファブレンディングする際の重みをアルファ値(0≦α≦1)として表したものである。
In addition, the image processing unit 7 specifies a position of the subject region S extracted in the subject presence image P1, and generates a position information generation unit 7c that generates position information indicating the position of the subject region S in the subject presence image P1. It has.
Here, as the position information, for example, an alpha map can be cited. The alpha map is a weight for alpha blending the image of the subject area S with respect to a predetermined background for each pixel of the subject existing image P1. It is expressed as a value (0 ≦ α ≦ 1).

また、画像処理部7は、生成されたアルファマップに基づいて、被写体存在画像P1の各画素のうち、アルファ値が1の画素を所定の単一色画像(図示略)に対して透過させずに、且つ、アルファ値が0の画素を透過させるように、被写体の画像を所定の単一色画像と合成して被写体切り抜き画像P3(図3(c)参照)の画像データを生成する切抜画像生成部7dを具備している。
これにより、切抜画像生成部7dは、背景と被写体とが存在する被写体存在画像P1から被写体が含まれる領域を切り抜いた被写体切り抜き画像P3を取得する。
Further, the image processing unit 7 does not transmit a pixel having an alpha value of 1 out of each pixel of the subject existing image P1 to a predetermined single color image (not shown) based on the generated alpha map. In addition, a cut-out image generation unit that generates image data of the cut-out image P3 of the subject (see FIG. 3C) by combining the image of the subject with a predetermined single-color image so that the pixels with an alpha value of 0 are transmitted. 7d.
As a result, the cutout image generation unit 7d acquires a subject cutout image P3 obtained by cutting out a region including the subject from the subject existing image P1 in which the background and the subject exist.

また、画像処理部7は、複数の画像フレームf1〜f5からなる動画像P4と被写体切り抜き画像P3を合成用の静止画像として取得する取得部7eを具備している。
具体的には、取得部7eは、合成動画生成処理(後述)にて、記録媒体8に記録されている複数の画像データのうち、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて指示された動画像P4や被写体切り抜き画像P3の画像データを読み出して画像メモリ5に展開する。
In addition, the image processing unit 7 includes an acquisition unit 7e that acquires a moving image P4 including a plurality of image frames f1 to f5 and a subject cutout image P3 as a still image for synthesis.
Specifically, the acquisition unit 7e performs a predetermined operation of the selection determination button 11b of the operation input unit 11 by the user among a plurality of pieces of image data recorded on the recording medium 8 in the synthetic moving image generation process (described later). The image data of the instructed moving image P4 and subject cutout image P3 is read and developed in the image memory 5.

また、画像処理部7は、動画像P4の各画像フレームf1〜f5における被写体切り抜き画像P3の被写体領域Sの合成位置を設定する合成位置設定部7fを具備している。
具体的には、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて設定された動画像P4の基準画像フレーム(例えば、画像フレームf3(図10(a)参照))における被写体切り抜き画像P3の被写体領域Sの基準合成位置(例えば、中心座標)が指定されると、合成位置設定部7fは、基準画像フレーム中の当該基準合成位置を中心として被写体切り抜き画像P3が重畳される画像領域を合成領域として設定する。
そして、合成位置設定部7fは、動き検出部6により検出された隣合う画像フレーム間(例えば、画像フレームf3に対する画像フレームf2)の動体Bの動きベクトルに基づいて、基準画像フレーム(例えば、画像フレームf3(図10(a)参照))以外の各画像フレーム(例えば、画像フレームf1,f2,f4,f5)における被写体切り抜き画像P3の被写体領域Sの合成位置を算出する。具体的には、合成位置設定部7fは、動き検出部6による各画像フレームf1〜f5の動体Bの動きベクトルの検出の際に探索された基準となる画像フレーム(例えば、画像フレームf3(図10(a)参照))における合成位置の周辺領域に対応する対応領域を、当該動きベクトルの検出に係る画像フレーム(例えば、画像フレームf2)における被写体切り抜き画像P3の被写体領域Sの合成位置として特定する。例えば、合成位置設定部7fは、動き検出部6による画像フレームf2の動体Bの動きベクトルの検出結果に基づいて、当該画像フレームf2内における被写体切り抜き画像P3の被写体領域Sの合成位置を算出して特定した後、当該画像フレームf2中の当該合成位置を中心として被写体切り抜き画像P3が重畳される画像領域を合成領域として設定する。続けて、合成位置設定部7fは、画像フレームf2を基準として画像フレームf1についても同様の処理を行う。このようにして、動画像P4の先頭の画像フレームf1まで繰り返すことで、基準画像フレーム(例えば、画像フレームf3(図10(a)参照))よりも前の画像フレーム(例えば、画像フレームf1,f2)について被写体切り抜き画像P3における被写体領域Sの合成位置を設定する。
同様に、合成位置設定部7fは、動き検出部6により検出された画像フレームf3の一つ後の画像フレームである画像フレームf4、また、二つ後の画像フレームである画像フレームf5についても、被写体切り抜き画像P3が重畳される画像領域を合成領域として設定する。
このように、合成位置設定部7fは、動き検出部6によって検出された少なくとも一の隣合う画像フレーム(例えば、画像フレームf3に対する画像フレームf2)間の動体Bの動き情報に基づいて、基準画像フレーム(例えば、画像フレームf3(図10(a)参照))以外の各画像フレーム(例えば、画像フレームf1,f2,f4,f5)における被写体切り抜き画像P3の被写体領域Sの合成位置を設定する。
In addition, the image processing unit 7 includes a composite position setting unit 7f that sets a composite position of the subject region S of the subject cutout image P3 in each of the image frames f1 to f5 of the moving image P4.
Specifically, the subject clipping in the reference image frame (for example, the image frame f3 (see FIG. 10A)) of the moving image P4 set based on a predetermined operation of the selection determination button 11b of the operation input unit 11 by the user. When the reference composite position (for example, center coordinates) of the subject region S of the image P3 is designated, the composite position setting unit 7f is an image in which the subject cutout image P3 is superimposed around the reference composite position in the reference image frame. Set the region as a composite region.
The composite position setting unit 7f then generates a reference image frame (for example, an image) based on the motion vector of the moving object B between adjacent image frames (for example, the image frame f2 with respect to the image frame f3) detected by the motion detection unit 6. The composite position of the subject area S of the subject cutout image P3 in each image frame (for example, image frames f1, f2, f4, and f5) other than the frame f3 (see FIG. 10A) is calculated. Specifically, the composition position setting unit 7f is a reference image frame (e.g., image frame f3 (see FIG. 5) that is searched when the motion detection unit 6 detects the motion vector of the moving object B in each of the image frames f1 to f5. 10 (a))) is specified as the combined position of the subject region S of the subject cutout image P3 in the image frame (for example, the image frame f2) related to the detection of the motion vector. To do. For example, the composite position setting unit 7f calculates the composite position of the subject region S of the subject clipped image P3 in the image frame f2 based on the detection result of the motion vector of the moving object B in the image frame f2 by the motion detection unit 6. Then, an image area on which the subject cutout image P3 is superimposed with the synthesis position in the image frame f2 as the center is set as a synthesis area. Subsequently, the composite position setting unit 7f performs the same process on the image frame f1 with the image frame f2 as a reference. In this way, by repeating up to the first image frame f1 of the moving image P4, an image frame (for example, the image frame f1,...) Preceding the reference image frame (for example, the image frame f3 (see FIG. 10A)). For f2), the composition position of the subject region S in the subject cutout image P3 is set.
Similarly, the composition position setting unit 7f also applies to the image frame f4 that is the next image frame of the image frame f3 detected by the motion detection unit 6 and the image frame f5 that is the second image frame. An image area on which the subject cutout image P3 is superimposed is set as a synthesis area.
As described above, the composite position setting unit 7f is based on the motion information of the moving object B between at least one adjacent image frame (for example, the image frame f2 with respect to the image frame f3) detected by the motion detection unit 6. The composition position of the subject region S of the subject cutout image P3 in each image frame (for example, the image frames f1, f2, f4, and f5) other than the frame (for example, the image frame f3 (see FIG. 10A)) is set.

また、画像処理部7は、被写体切り抜き画像P3と背景用の動画像P4を構成する各画像フレームf1〜f5とを合成する画像合成部7gを具備している。具体的には、画像合成部7gは、動画像P4の各画像フレームf1〜f5を背景用画像として指定して、指定された画像フレームf1〜f5の各画素のうち、アルファ値が0の画素は透過させ、アルファ値が1の画素は被写体切り抜き画像P3の対応する画素の画素値で上書きし、さらに、指定された画像フレームf1〜f5の各画素のうち、アルファ値が0<α<1の画素は1の補数(1−α)を用いて被写体領域Sを切り抜いた画像(背景用画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き画像P3を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き画像P3から減算し、それを被写体領域Sを切り抜いた画像(背景用画像×(1−α))と合成する。   The image processing unit 7 includes an image composition unit 7g that synthesizes the subject cut-out image P3 and the image frames f1 to f5 constituting the background moving image P4. Specifically, the image composition unit 7g designates each image frame f1 to f5 of the moving image P4 as a background image, and among the pixels of the designated image frames f1 to f5, a pixel having an alpha value of 0 Is transmitted, and the pixel with the alpha value of 1 is overwritten with the pixel value of the corresponding pixel of the subject cutout image P3, and among the pixels of the designated image frames f1 to f5, the alpha value is 0 <α <1. After generating an image (background image × (1-α)) obtained by cutting out the subject region S using 1's complement (1-α), 1's complement (1-α) in the alpha map is used. When the subject cutout image P3 is generated, a value blended with the single background color is calculated, and the value is subtracted from the subject cutout image P3, and the image is cut out from the subject region S (background image × (1− a)).

また、画像合成部7gは、被写体切り抜き画像P3の動画像P4を構成する各画像フレームf1〜f5に対する合成を制御する合成制御部7hを具備している。即ち、画像合成部7gは、合成制御部7hの制御下にて、動画像P4を構成する各画像フレームf1〜f5に対する被写体切り抜き画像P3における被写体領域Sの合成位置及び合成領域等を調整して画像合成により複数の画像フレームg1〜g5を生成して、当該複数の画像フレームg1〜g5からなる合成動画Mを生成する。
具体的には、合成制御部7hは、合成位置設定部7fにより設定された被写体切り抜き画像P3における被写体領域Sの合成位置及び合成領域に基づいて、ユーザによる操作入力部の所定操作に基づいて指定された基準画像フレーム(例えば、画像フレームf3)においては、当該基準画像フレームにおけるユーザにより指定された合成位置に被写体領域Sを合成させる。そして、合成制御部7hは、基準画像フレーム以外の各画像フレームf1〜f5においては、当該画像フレームf1〜f5に合成された被写体領域Sに対し動体Bの動きに合わせて変位させるように被写体切り抜き画像P3を順次合成させる。例えば、図10(a)及び図10(b)に示すように、基準画像フレームの一つ前の画像フレームf2においては、合成制御部7hは、合成位置設定部7fにより設定された被写体領域Sの合成位置に基づいて、被写体領域Sを画像フレームg3における被写体領域Sに対して動体Bの動きに合わせて左側に変位させるように被写体切り抜き画像P3を合成させて合成動画Mを構成する画像フレームg2を生成する。同様に、基準画像フレームよりも前の他の画像フレーム(例えば、画像フレームf1)については、処理対象となる画像フレーム(例えば、画像フレームf1)よりも一つ後の画像フレーム(例えば、画像フレームf2)における被写体領域Sの合成位置に対して動体Bの動きに合わせて左側に変位させるようにして合成動画Mを構成する画像フレームg1を生成する。
また、基準画像フレームの一つ後の画像フレームf4においては、合成制御部7hは、合成位置設定部7fにより設定された被写体領域Sの合成位置に基づいて、被写体領域Sを画像フレームg3における被写体領域Sに対して動体Bの動きに合わせて右側に変位させるように被写体切り抜き画像P3を合成させて合成動画Mを構成する画像フレームg4を生成する。同様に、基準画像フレームよりも後の他の画像フレーム(例えば、画像フレームf5)については、処理対象となる画像フレーム(例えば、画像フレームf5)よりも一つ前の画像フレーム(例えば、画像フレームf4)における被写体領域Sの合成位置に対して動体Bの動きに合わせて右側に変位させるようにして合成動画Mを構成する画像フレームg5を生成する。
このようにして、画像合成部7gは、動き検出部6により検出された動きベクトルに基づいて、動画像P4の動体Bの動きに合せて被写体切り抜き画像P3を所定動作させるように当該被写体切り抜き画像P3と動画像P4とを合成して合成動画Mを生成する。
Further, the image composition unit 7g includes a composition control unit 7h that controls composition of the image frames f1 to f5 constituting the moving image P4 of the subject cutout image P3. That is, the image composition unit 7g adjusts the composition position, composition region, and the like of the subject area S in the subject cutout image P3 for each of the image frames f1 to f5 constituting the moving image P4 under the control of the composition control unit 7h. A plurality of image frames g1 to g5 are generated by image synthesis, and a synthesized moving image M including the plurality of image frames g1 to g5 is generated.
Specifically, the composition control unit 7h is designated based on a predetermined operation of the operation input unit by the user based on the composition position and composition region of the subject region S in the subject cutout image P3 set by the composition position setting unit 7f. In the reference image frame (for example, image frame f3), the subject region S is combined at the combination position designated by the user in the reference image frame. Then, the composition control unit 7h cuts out the subject in each of the image frames f1 to f5 other than the reference image frame so as to be displaced in accordance with the movement of the moving object B with respect to the subject region S synthesized with the image frames f1 to f5. The images P3 are sequentially synthesized. For example, as shown in FIGS. 10A and 10B, in the image frame f2 immediately preceding the reference image frame, the composition control unit 7h sets the subject area S set by the composition position setting unit 7f. Based on the combination position, the subject cutout image P3 is synthesized so that the subject region S is displaced to the left in accordance with the movement of the moving object B with respect to the subject region S in the image frame g3, and the image frame constituting the synthesized moving image M g2 is generated. Similarly, for another image frame (for example, image frame f1) before the reference image frame, an image frame (for example, image frame) immediately after the image frame to be processed (for example, image frame f1) is processed. An image frame g1 constituting the combined moving image M is generated so as to be displaced to the left in accordance with the movement of the moving body B with respect to the combined position of the subject area S in f2).
In addition, in the image frame f4 immediately after the reference image frame, the composition control unit 7h defines the subject area S as the subject in the image frame g3 based on the composition position of the subject area S set by the composition position setting unit 7f. The subject cutout image P3 is synthesized so as to be displaced to the right in accordance with the movement of the moving body B with respect to the region S to generate an image frame g4 constituting the synthesized moving image M. Similarly, for another image frame (for example, image frame f5) after the reference image frame, the image frame (for example, image frame) immediately before the image frame (for example, image frame f5) to be processed is processed. An image frame g5 constituting the synthesized moving image M is generated so as to be displaced to the right according to the movement of the moving body B with respect to the synthesized position of the subject area S in f4).
In this way, the image composition unit 7g performs the subject cutout image P3 to perform a predetermined operation in accordance with the motion of the moving body B of the moving image P4 based on the motion vector detected by the motion detection unit 6. The synthesized moving image M is generated by synthesizing P3 and the moving image P4.

記録媒体8は、例えば、不揮発性メモリ(フラッシュメモリ)等により構成され、画像処理部7のJPEG圧縮部(図示略)により符号化された被写体切り抜き画像P3の静止画像データを記憶する。
また、被写体切り抜き画像P3の画像データは、画像処理部7の位置情報生成部7cにより生成されたアルファマップと対応付けられて、当該被写体切り抜き画像P3の画像データの拡張子を「.jpe」として保存されている。
The recording medium 8 is configured by, for example, a non-volatile memory (flash memory) or the like, and stores still image data of the subject cutout image P3 encoded by the JPEG compression unit (not shown) of the image processing unit 7.
The image data of the subject clipped image P3 is associated with the alpha map generated by the position information generating unit 7c of the image processing unit 7, and the extension of the image data of the subject clipped image P3 is set to “.jpe”. Saved.

また、記録媒体8は、レンズ部1、電子撮像部2及び撮像制御部3による動体Bの撮像により生成された複数の画像フレームf、…を画像処理部7の符号化部(図示略)により所定の圧縮形式で符号化した動画像P4を記憶する。
動画像P4は、動体Bの動きを所定の記録方式(例えば、Motion−JPEG形式)で記録したものであり、例えば、所定の撮像フレームレートで撮像された連続した複数の画像フレーム(例えば、n枚の画像フレーム)f、…からなるものである。なお、図5にあっては、動画像P4として、模式的に5枚の画像フレームf1〜f5からなるものを表すものとする。
Further, the recording medium 8 uses a coding unit (not shown) of the image processing unit 7 to generate a plurality of image frames f generated by the imaging of the moving body B by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. A moving picture P4 encoded in a predetermined compression format is stored.
The moving image P4 is obtained by recording the motion of the moving object B in a predetermined recording method (for example, Motion-JPEG format). For example, a plurality of continuous image frames (for example, n) captured at a predetermined imaging frame rate. Image frames) f,... In FIG. 5, the moving image P <b> 4 is typically represented by five image frames f <b> 1 to f <b> 5.

表示制御部9は、画像メモリ5に一時的に記憶されている表示用の画像データを読み出して表示部10に表示させる制御を行う。
具体的には、表示制御部9は、VRAM、VRAMコントローラ、デジタルビデオエンコーダなどを備えている。そして、デジタルビデオエンコーダは、CPU12の制御下にて画像メモリ5から読み出されてVRAM(図示略)に記憶されている輝度信号Y及び色差信号Cb,Crを、VRAMコントローラを介してVRAMから定期的に読み出して、これらのデータを元にビデオ信号を発生して表示部10に出力する。
The display control unit 9 performs control for reading display image data temporarily stored in the image memory 5 and displaying the read image data on the display unit 10.
Specifically, the display control unit 9 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 12 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 10.

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

操作入力部11は、当該撮像装置100の所定操作を行うためのものである。具体的には、操作入力部11は、被写体の撮影指示に係るシャッタボタン11a、撮像モードや機能等の選択指示や被写体切り抜き画像P3における被写体領域Sの基準合成位置の設定指示等に係る選択決定ボタン11b、ズーム量の調整指示に係るズームボタン(図示略)等を備え、これらのボタンの操作に応じて所定の操作信号をCPU12に出力する。   The operation input unit 11 is for performing a predetermined operation of the imaging apparatus 100. Specifically, the operation input unit 11 selects and determines a shutter button 11a related to a subject photographing instruction, a selection instruction such as an imaging mode and a function, and a setting instruction for setting a reference composite position of the subject region S in the subject cutout image P3. A button 11b, a zoom button (not shown) relating to a zoom amount adjustment instruction, and the like are provided, and a predetermined operation signal is output to the CPU 12 in accordance with the operation of these buttons.

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

次に、撮像装置100による被写体切り抜き処理について、図2及び図3を参照して説明する。
図2は、被写体切り抜き処理に係る動作の一例を示すフローチャートである。また、図3は、被写体切り抜き処理に係る画像の一例を模式的に示す図である。
被写体切り抜き処理は、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から被写体切り抜きモードが選択指示された場合に実行される処理である。
Next, the subject clipping process performed by the imaging apparatus 100 will be described with reference to FIGS.
FIG. 2 is a flowchart illustrating an example of an operation related to the subject clipping process. FIG. 3 is a diagram schematically illustrating an example of an image related to the subject clipping process.
The subject clipping process is executed when the 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 11b of the operation input unit 11 by the user. It is.

図2に示すように、先ず、CPU12は、表示制御部9に、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームf、…に基づいてライブビュー画像を表示部10の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体存在画像P1の撮像指示メッセージを表示部10の表示画面に表示させる(ステップS1)。   As shown in FIG. 2, first, the CPU 12 performs live display on the display control unit 9 based on a plurality of image frames f generated by imaging the subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. The view image is displayed on the display screen of the display unit 10 and is superimposed on the live view image to display an imaging instruction message for the subject existing image P1 on the display screen of the display unit 10 (step S1).

次に、CPU12は、ユーザによる操作入力部11のシャッタボタン11aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS2)。ここで、撮像指示が入力されたと判定されると(ステップS2;YES)、CPU12は、撮像制御部3に、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、被写体存在画像P1(図3(a)参照)の光学像を所定の条件で電子撮像部2により撮像させて、画像データ生成部4に、電子撮像部2から転送された被写体存在画像P1の画像フレームのYUVデータを生成させる(ステップS3)。なお、当該被写体存在画像P1のYUVデータは、画像メモリ5に一時記憶される。
また、CPU12は、撮像制御部3を制御して、当該被写体存在画像P1の撮像の際の合焦位置や露出条件やホワイトバランス等の条件を固定した状態を維持する。
Next, the CPU 12 determines whether an imaging instruction is input based on a predetermined operation of the shutter button 11a of the operation input unit 11 by the user (step S2). Here, if it is determined that an imaging instruction has been input (step S2; YES), the CPU 12 instructs the imaging control unit 3 to focus the focus lens, exposure conditions (shutter speed, aperture, amplification factor, etc.) and white. By adjusting conditions such as balance, an optical image of the subject existing image P1 (see FIG. 3A) is picked up by the electronic image pickup unit 2 under a predetermined condition, and the image data generation unit 4 causes the electronic image pickup unit 2 to YUV data of the image frame of the transferred subject presence image P1 is generated (step S3). The YUV data of the subject existing image P1 is temporarily stored in the image memory 5.
Further, the CPU 12 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 image P1 are fixed.

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

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

次に、CPU12は、位置合わせ部7aに、算出された射影変換行例に基づいて被写体存在画像P1を射影変換させることで、被写体存在画像P1のYUVデータと被写体非存在画像P2のYUVデータとを位置合わせする処理を行わせる(ステップS8)。   Next, the CPU 12 causes the alignment unit 7a to perform the projective transformation on the subject existing image P1 based on the calculated projective transformation row example, so that the YUV data of the subject existing image P1 and the YUV data of the subject nonexistent image P2 Is performed (step S8).

そして、CPU12は、画像処理部7の被写体領域抽出部7bに、被写体存在画像P1から被写体が含まれる被写体領域Sを抽出する処理を行わせる(ステップS9)。
具体的には、被写体領域抽出部7bは、被写体存在画像P1のYUVデータと被写体非存在画像P2のYUVデータの各々に対してローパスフィルタをかけて各画像の高周波成分を除去する。その後、被写体領域抽出部7bは、ローパスフィルタをかけた被写体存在画像P1と被写体非存在画像P2との間で対応する各画素について相違度を算出して相違度マップを生成する。続けて、被写体領域抽出部7bは、各画素に係る相違度マップを所定の閾値で2値化した後、相違度マップから細かいノイズや手ぶれにより相違が生じた領域を除去するために収縮処理を行う。その後、被写体領域抽出部7bは、ラベリング処理を行って、所定値以下の領域や最大領域以外の領域を除去した後、一番大きな島のパターンを被写体領域Sとして特定し、収縮分を修正するための膨張処理を行う。
Then, the CPU 12 causes the subject region extraction unit 7b of the image processing unit 7 to perform a process of extracting the subject region S including the subject from the subject presence image P1 (step S9).
Specifically, the subject region extraction unit 7b applies a low-pass filter to each of the YUV data of the subject presence image P1 and the YUV data of the subject non-existence image P2 to remove the high-frequency component of each image. Thereafter, the subject area extraction unit 7b calculates a difference for each corresponding pixel between the subject existing image P1 and the subject non-existing image P2 subjected to the low-pass filter, and generates a difference map. Subsequently, the subject region extraction unit 7b binarizes the dissimilarity map relating to each pixel with a predetermined threshold, and then performs a contraction process to remove the region in which the dissimilarity is caused by fine noise or camera shake from the dissimilarity map. Do. Thereafter, the subject region extraction unit 7b performs a labeling process to remove a region below a predetermined value or a region other than the maximum region, and then specifies the largest island pattern as the subject region S and corrects the contraction. Expansion processing is performed.

次に、CPU12は、画像処理部7の位置情報生成部7cに、抽出された被写体領域Sの被写体存在画像P1内での位置を示すアルファマップを生成させる(ステップS10)。   Next, the CPU 12 causes the position information generation unit 7c of the image processing unit 7 to generate an alpha map indicating the position of the extracted subject region S in the subject existing image P1 (step S10).

その後、CPU12は、画像処理部7の切抜画像生成部7dに、被写体の画像を所定の単一色画像と合成した被写体切り抜き画像P3(図3(c)参照)の画像データを生成する処理を行わせる(ステップS11)。
具体的には、切抜画像生成部7dは、被写体存在画像P1、単一色画像及びアルファマップを読み出して画像メモリ5に展開した後、被写体存在画像P1の全ての画素について、アルファ値が0の画素については(α=0)、透過させ、アルファ値が0<α<1の画素については(0<α<1)、所定の単一色とブレンディングを行い、アルファ値が1の画素については(α=1)、何もせずに所定の単一色に対して透過させないようにする。
Thereafter, the CPU 12 performs processing for generating image data of a subject cutout image P3 (see FIG. 3C) obtained by combining the subject image with a predetermined single color image in the cutout image generation unit 7d of the image processing unit 7. (Step S11).
Specifically, the cut-out image generation unit 7d reads out the subject existing image P1, the single color image, and the alpha map and develops them in the image memory 5, and thereafter, for all the pixels of the subject existing image P1, the pixels having an alpha value of 0. (Α = 0) for transmission, and for pixels with an alpha value of 0 <α <1, (0 <α <1), blending with a predetermined single color is performed, and for pixels with an alpha value of 1 (α = 1) Do nothing and do not transmit light to a predetermined single color.

その後、CPU12は、記録媒体8の所定の記憶領域に、画像処理部7の位置情報生成部7cにより生成されたアルファマップと被写体切り抜き画像P3の画像データを対応付けて、当該被写体切り抜き画像P3の画像データの拡張子を「.jpe」として一ファイルで記憶させる(ステップS12)。
これにより、被写体切り抜き処理を終了する。この結果、例えば、背景内から被写体領域Sとして人(図3(c)参照)が抽出された被写体切り抜き画像P3の静止画像データが生成される。
Thereafter, the CPU 12 associates the alpha map generated by the position information generation unit 7c of the image processing unit 7 with the image data of the subject clipped image P3 in a predetermined storage area of the recording medium 8, and stores the clipped image P3 of the subject clipped image P3. The extension of the image data is stored as one file with “.jpe” (step S12).
Thereby, the subject clipping process is completed. As a result, for example, still image data of the subject cutout image P3 in which a person (see FIG. 3C) is extracted as the subject region S from the background is generated.

次に、撮像装置100による背景用の動画像生成処理について、図4及び図5を参照して説明する。
図4は、背景用の動画像生成処理に係る動作の一例を示すフローチャートである。また、図5は、背景用の動画像生成処理に係る画像の一例を模式的に示す図である。
背景用の動画像生成処理は、通常の動画像の撮像処理であり、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から動画撮像モードが選択指示された場合に実行される処理である。
Next, background moving image generation processing by the imaging apparatus 100 will be described with reference to FIGS. 4 and 5.
FIG. 4 is a flowchart illustrating an example of an operation related to a background moving image generation process. FIG. 5 is a diagram schematically illustrating an example of an image related to the background moving image generation process.
The background moving image generation process is a normal moving image imaging process, and is selected from a plurality of imaging modes displayed on the menu screen based on a predetermined operation of the selection determination button 11b of the operation input unit 11 by the user. This is a process executed when a moving image capturing mode is instructed to be selected.

図4に示すように、先ず、CPU12は、表示制御部9に、レンズ部1、電子撮像部2及び撮像制御部3による動画像P4の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部10の表示画面に表示させる(ステップS21)。   As shown in FIG. 4, first, the CPU 12 causes the display control unit 9 to perform live view based on a plurality of image frames generated by imaging the moving image P4 by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. The image is displayed on the display screen of the display unit 10 (step S21).

次に、CPU12は、ユーザによる操作入力部11のシャッタボタン11aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS22)。ここで、撮像指示が入力されたと判定されると(ステップS22;YES)、CPU13は、撮像制御部3に、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、動画像P4(図5参照)の光学像を所定の条件で電子撮像部2により撮像させて画像データ生成部4に、電子撮像部2から転送された動画像P4の各画像フレームf1〜f5のYUVデータを生成させる(ステップS23)。その後、CPU12は、記録媒体8の所定の記憶領域に、動画像P4の各画像フレームf1〜f5のYUVデータをMotion−JPEG形式で記憶させる(ステップS24)。
これにより、動画像生成処理を終了する。この結果、例えば、トラックが左側から右側に走行する複数の画像フレームf1〜f5からなる動画像P4の画像データが生成される。
Next, the CPU 12 determines whether or not an imaging instruction has been input based on a predetermined operation of the shutter button 11a of the operation input unit 11 by the user (step S22). If it is determined that an imaging instruction has been input (step S22; YES), the CPU 13 instructs the imaging control unit 3 to focus the focus lens, exposure conditions (shutter speed, aperture, amplification factor, etc.) and white. The moving image transferred from the electronic image capturing unit 2 to the image data generating unit 4 by adjusting the conditions such as the balance, causing the electronic image capturing unit 2 to capture an optical image of the moving image P4 (see FIG. 5) under a predetermined condition. YUV data of the image frames f1 to f5 of P4 is generated (step S23). Thereafter, the CPU 12 stores the YUV data of the image frames f1 to f5 of the moving image P4 in the Motion-JPEG format in a predetermined storage area of the recording medium 8 (step S24).
Thus, the moving image generation process is terminated. As a result, for example, image data of a moving image P4 including a plurality of image frames f1 to f5 in which the track travels from the left side to the right side is generated.

次に、合成動画生成処理について図6〜図10を参照して詳細に説明する。
図6〜図8は、合成動画生成処理に係る動作の一例を示すフローチャートである。また、図9は、合成動画生成処理における画像合成処理に係る動作の一例を示すフローチャートである。また、図10(a)及び図10(b)は、合成動画生成処理にて画像合成される画像の一例を模式的に示す図である。
Next, the synthetic moving image generation process will be described in detail with reference to FIGS.
6 to 8 are flowcharts illustrating an example of operations related to the synthetic moving image generation process. FIG. 9 is a flowchart illustrating an example of an operation related to the image composition process in the composite moving image generation process. FIGS. 10A and 10B are diagrams schematically illustrating an example of an image that is combined in the combined moving image generation process.

合成動画生成処理は、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から画像合成モードが選択指示された場合に実行される処理である。
図6に示すように、ユーザによる操作入力部11の所定操作に基づいて、記録媒体8に記録されている複数の画像の中で合成用の静止画像としての被写体切り抜き画像P3が選択して指定されると、画像処理部7の取得部7eは、指定された被写体切り抜き画像P3の画像データを読み出して画像メモリ5に展開する(ステップS31)。
The synthesized moving image generation process is executed when an image synthesis mode is selected from a plurality of imaging modes displayed on the menu screen based on a predetermined operation of the selection determination button 11b of the operation input unit 11 by the user. It is processing.
As shown in FIG. 6, based on a predetermined operation of the operation input unit 11 by the user, a subject cutout image P3 as a still image for synthesis is selected and specified from among a plurality of images recorded on the recording medium 8. Then, the acquisition unit 7e of the image processing unit 7 reads out the image data of the designated subject cutout image P3 and develops it in the image memory 5 (step S31).

次に、ユーザによる操作入力部11の所定操作に基づいて、記録媒体8に記録されている複数の画像の中で所望の動画像P4が選択して指定されると、画像処理部7の取得部7eは、指定された動画像P4の画像データを読み出して画像メモリ5に展開する。そして、CPU12は、表示制御部9に、画像メモリ5に展開された動画像P4の画像データに基づいて、当該動画像P4を構成する各画像フレームf1〜f5を所定の表示フレームレートで切り換えて表示部10の表示画面に再生表示させる(ステップS32)。   Next, when a desired moving image P4 is selected and specified from among a plurality of images recorded on the recording medium 8 based on a predetermined operation of the operation input unit 11 by the user, the image processing unit 7 obtains it. The unit 7e reads out the image data of the designated moving image P4 and develops it in the image memory 5. Then, the CPU 12 switches the image frames f1 to f5 constituting the moving image P4 at a predetermined display frame rate based on the image data of the moving image P4 expanded in the image memory 5 to the display control unit 9. Reproduction is displayed on the display screen of the display unit 10 (step S32).

続けて、CPU12は、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、表示部10の表示画面に再生表示された画像フレームf1〜f5の選択指示が入力されたか否かを判定する(ステップS33)。
ここで、画像フレームf1〜f5の選択指示が入力されたと判定されると(ステップS33;YES)、CPU12は、表示制御部9に、選択指示入力のあったユーザ所望の画像フレーム(例えば、画像フレームf3(図10(a)参照))を基準画像フレームとして表示部10の表示画面に一時停止表示させる(ステップS34)。
Subsequently, the CPU 12 determines whether or not an instruction to select the image frames f1 to f5 reproduced and displayed on the display screen of the display unit 10 is input based on a predetermined operation of the selection determination button 11b of the operation input unit 11 by the user. Determination is made (step S33).
If it is determined that the selection instruction for the image frames f1 to f5 has been input (step S33; YES), the CPU 12 causes the display control unit 9 to input the image frame desired by the user who has input the selection instruction (for example, an image). The frame f3 (see FIG. 10A)) is temporarily displayed on the display screen of the display unit 10 as a reference image frame (step S34).

そして、CPU12は、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、被写体切り抜き画像P3における被写体領域Sの当該基準画像フレームへの合成位置の指定指示が入力されたか否かを判定する(ステップS35)。
ここで、合成位置の指定指示が入力されたと判定されると(ステップS35;YES)、CPU12は、動画像P4の各画像フレームf1〜f5と被写体切り抜き画像P3とを合成して合成動画Mを構成する画像フレームg1〜g5を生成する画像合成処理を画像合成部7gに行わせる(ステップS36)。
Then, based on a predetermined operation of the selection determination button 11b of the operation input unit 11 by the user, the CPU 12 determines whether or not an instruction to specify a composite position of the subject area S in the subject cutout image P3 with respect to the reference image frame is input. Determination is made (step S35).
Here, if it is determined that an instruction for specifying a composite position has been input (step S35; YES), the CPU 12 combines the image frames f1 to f5 of the moving image P4 and the subject cutout image P3 to generate a composite moving image M. The image composition unit 7g is caused to perform image composition processing for generating the image frames g1 to g5 to be configured (step S36).

ここで、画像合成処理について図9を参照して詳細に説明する。
図9に示すように、画像合成部7gは、被写体切り抜き画像P3と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開する(ステップS61)。
なお、図6のステップS35にて被写体切り抜き画像P3における被写体領域Sの合成位置が指定された際に、動画像P4の基準画像フレーム(例えば、画像フレームf3(図10(a)参照))とアルファマップとがずれてしまいアルファマップの範囲外となる領域については、α=0としてアルファ値が存在しない領域を生じさせないようにする。
Here, the image composition processing will be described in detail with reference to FIG.
As shown in FIG. 9, the image composition unit 7g reads the alpha map stored in association with the subject cutout image P3 and develops it in the image memory 5 (step S61).
Note that when the synthesis position of the subject area S in the subject cutout image P3 is designated in step S35 of FIG. 6, the reference image frame (for example, the image frame f3 (see FIG. 10A)) of the moving image P4 and For an area that deviates from the alpha map and is out of the alpha map range, α = 0 is set so that no alpha value exists.

次に、画像合成部7gは、基準画像フレームの何れか一の画素(例えば、左上隅部の画素)を指定して(ステップS62)、当該画素について、アルファマップのアルファ値に基づいて処理を分岐させる(ステップS63)。具体的には、画像合成部7gは、当該基準画像フレームの何れか一の画素のうち、アルファ値が1の画素については(ステップS63;α=1)、被写体切り抜き画像P3の対応する画素の画素値で上書きし(ステップS64)、アルファ値が0<α<1の画素については(ステップS65;0<α<1)、1の補数(1−α)を用いて被写体領域Sを切り抜いた画像(背景用画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き画像P3を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き画像P3から減算し、それを被写体領域Sを切り抜いた画像(背景用画像×(1−α))と合成し(ステップS65)、アルファ値が0の画素については(ステップS63;α=0)、何もせずに当該基準画像フレームを透過させるようにする。   Next, the image composition unit 7g designates any one pixel (for example, the pixel at the upper left corner) of the reference image frame (step S62), and processes the pixel based on the alpha value of the alpha map. Branch (step S63). Specifically, the image composition unit 7g, for any one of the pixels of the reference image frame, for the pixel having an alpha value of 1 (step S63; α = 1), the corresponding pixel of the subject cutout image P3. The pixel value is overwritten (step S64), and the subject area S is cut out using the one's complement (1-α) for the pixel with an alpha value of 0 <α <1 (step S65; 0 <α <1). After the image (background image × (1-α)) is generated, the blended value with the single background color is calculated when the subject cutout image P3 is generated using the one's complement (1-α) in the alpha map. Then, the value is subtracted from the subject cutout image P3, and is combined with an image obtained by cutting out the subject area S (background image × (1-α)) (step S65). Step S63; α = ), The reference image frame so as to transmit without doing anything.

続けて、画像合成部7gは、当該基準画像フレームの全ての画素について処理したか否かを判定する(ステップS66)。
ここで、全ての画素について処理していないと判定されると(ステップS66;NO)、画像合成部7gは、処理対象として次の画素を指定して当該画素に処理対象を移動させて(ステップS67)、処理をステップS63に移行させる。
上記の処理を、ステップS66にて全ての画素について処理したと判定されるまで(ステップS66;YES)、繰り返すことで、画像合成部7gは、被写体切り抜き画像P3と動画像P4とを合成した合成動画Mを構成する一の画像フレームgを生成する。
これにより、画像合成処理を終了する。
Subsequently, the image composition unit 7g determines whether or not all the pixels of the reference image frame have been processed (step S66).
If it is determined that all the pixels have not been processed (step S66; NO), the image composition unit 7g designates the next pixel as the processing target and moves the processing target to the pixel (step S66). (S67) The process proceeds to step S63.
By repeating the above processing until it is determined in step S66 that all pixels have been processed (step S66; YES), the image composition unit 7g composes the subject clipped image P3 and the moving image P4. One image frame g constituting the moving image M is generated.
Thereby, the image composition process is terminated.

図6に示すように、その後、CPU12は、基準画像フレームが動画像P4を構成する画像フレームf1〜f5のうち最初の画像フレームf1であるか否かを判定する(ステップS37)。
ここで、基準画像フレームが最初の画像フレームf1でないと判定されると(ステップS37;NO)、CPU12は、処理対象を基準画像フレームの1つ前の画像フレームへ移動させる(ステップS38)。具体的には、図10(a)に示すように、基準画像フレームとして画像フレームf3が選択指示された場合、当該画像フレームf3の一つ前の画像フレームf2に移動する。
As shown in FIG. 6, thereafter, the CPU 12 determines whether or not the reference image frame is the first image frame f1 among the image frames f1 to f5 constituting the moving image P4 (step S37).
If it is determined that the reference image frame is not the first image frame f1 (step S37; NO), the CPU 12 moves the processing target to the image frame immediately before the reference image frame (step S38). Specifically, as shown in FIG. 10 (a), when an image frame f3 is selected as a reference image frame, the image frame f2 is moved to the previous image frame f3.

そして、CPU12は、隣合う画像フレーム(例えば、画像フレームf3と画像フレームf2)間の動体Bの動き情報として、基準画像フレームに対する画像フレーム(例えば、画像フレームf2)における動体の動きベクトルを動き検出部6に検出させる(ステップS39)。   Then, the CPU 12 detects the motion vector of the moving object in the image frame (for example, the image frame f2) with respect to the reference image frame as the motion information of the moving object B between the adjacent image frames (for example, the image frame f3 and the image frame f2). It is made to detect by the part 6 (step S39).

そして、CPU12は、動き検出部6により検出された画像フレーム(例えば、画像フレームf2)の動体Bの動きベクトル(動き情報)に基づいて、当該画像フレーム(例えば、画像フレームf2)における被写体切り抜き画像P3の被写体領域Sの合成位置の算出を合成位置設定部7fに行わせる(ステップS40)。
そして、合成制御部7hは、算出された合成位置に基づいて被写体切り抜き画像P3を1つ前に移動した画像フレーム(例えば、画像フレームf2)へ合成した場合に当該被写体領域Sの合成領域の一部が当該画像フレームf2内にあるか否かを判定する(ステップS41)。
ここで、合成領域の一部が画像フレームf2内にあると判定されると(ステップS41;YES)、CPU12は、算出された一つ前の画像フレーム(例えば、画像フレームf2)における被写体切り抜き画像P3の被写体領域Sの合成位置を合成位置設定部7fに設定させる(ステップS42)。
Then, based on the motion vector (motion information) of the moving object B of the image frame (for example, image frame f2) detected by the motion detection unit 6, the CPU 12 cuts out the subject in the image frame (for example, image frame f2). The composite position setting unit 7f calculates the composite position of the subject area S of P3 (step S40).
Then, the composition control unit 7h, when compositing the subject cutout image P3 to the image frame (for example, the image frame f2) that has been moved forward one time based on the calculated composition position, It is determined whether or not the part is in the image frame f2 (step S41).
Here, when it is determined that a part of the synthesis area is within the image frame f2 (step S41; YES), the CPU 12 cuts out the subject clipped image in the immediately preceding calculated image frame (for example, the image frame f2). The composite position of the subject area S of P3 is set in the composite position setting unit 7f (step S42).

そして、CPU12は、動画像P4の画像フレーム(例えば、画像フレームf2)と被写体切り抜き画像P3とを合成して合成動画Mを構成する画像フレーム(例えば、画像フレームg2)を生成する画像合成処理を画像合成部7gに行わせる(ステップS43;図9参照)。
なお、画像合成処理の内容は、上記説明したものと略同様であり、その詳細な説明は省略する。また、図7のステップS42にて被写体切り抜き画像P3における被写体領域Sの合成位置が設定された際に、動画像P4の画像フレームf1〜f5とアルファマップとがずれてしまいアルファマップの範囲外となる領域については、α=0としてアルファ値が存在しない領域を生じさせないようにする。
Then, the CPU 12 synthesizes an image frame (for example, image frame f2) of the moving image P4 and the subject cutout image P3 to generate an image frame (for example, image frame g2) that forms the combined moving image M. The image composition unit 7g is caused to perform the process (step S43; see FIG. 9).
The contents of the image composition process are substantially the same as those described above, and a detailed description thereof is omitted. In addition, when the composition position of the subject area S in the subject cutout image P3 is set in step S42 in FIG. 7, the image frames f1 to f5 of the moving image P4 are shifted from the alpha map, and are outside the range of the alpha map. For such a region, α = 0 is set so as not to generate a region having no alpha value.

図7に示すように、その後、CPU12は、基準画像フレームより前の全ての画像フレーム(例えば、画像フレームf1、f2)について合成処理を行ったか否かを判定する(ステップS44)。
ここで、基準画像フレームより前の全ての画像フレーム(例えば、画像フレームf1、f2)について合成処理を行っていないと判定されると(ステップS44;NO)、ステップS38へ戻り、基準画像フレームより前の全ての画像フレーム(例えば、画像フレームf1、f2)について合成処理が行われるまで、CPU12は、ステップS38以降の処理を行わせる。一方、基準画像フレームより前の全ての画像フレーム(例えば、画像フレームf1、f2)について合成処理を行ったと判定されると(ステップS44;YES)、即ち、ステップS41にて、合成領域の一部が画像フレーム内にないと判定された場合(ステップS41;NO)、例えば、画像フレームf1における被写体切り抜き画像P3の被写体領域Sの合成領域の一部が当該画像フレームf1内にない場合には、CPU12は、ステップS44にて、基準画像フレームより前の全ての画像フレーム(例えば、画像フレームf1、f2)について合成処理を行ったと判定する。なお、ステップS41にて、合成領域の一部が画像フレーム(例えば、画像フレームf1)内にないと判定された画像フレーム(例えば、画像フレームf1)については、動画像P4の画像フレーム(例えば、画像フレームf1)を合成動画Mの画像フレーム(例えば、画像フレームg1)とみなす。
As shown in FIG. 7, thereafter, the CPU 12 determines whether or not the synthesis process has been performed for all image frames (for example, image frames f1 and f2) before the reference image frame (step S44).
Here, if it is determined that the composition process has not been performed for all image frames (for example, image frames f1 and f2) before the reference image frame (step S44; NO), the process returns to step S38, and the reference image frame. The CPU 12 causes the processes in and after step S38 to be performed until all the previous image frames (for example, image frames f1 and f2) have been combined. On the other hand, if it is determined that all image frames prior to the reference image frame (for example, image frames f1 and f2) have been combined (step S44; YES), that is, a part of the combined region is determined in step S41. Is not within the image frame (step S41; NO), for example, when a part of the composite region of the subject region S of the subject cutout image P3 in the image frame f1 is not in the image frame f1. In step S44, the CPU 12 determines that all the image frames before the reference image frame (for example, the image frames f1 and f2) have been combined. Note that in step S41, for an image frame (for example, image frame f1) that is determined not to be part of the image frame (for example, image frame f1), the image frame (for example, image frame f1) of the moving image P4 is used. The image frame f1) is regarded as an image frame (for example, an image frame g1) of the synthesized moving image M.

その後、CPU12は、処理対象を基準画像フレーム(例えば、画像フレームf3)の1つ後の画像フレーム(例えば、画像フレームf4)へ移動させ(ステップS45)、CPU12は、ステップS39と同様に、隣合う画像フレーム間(例えば、画像フレームf3に対する画像フレームf4)の動体Bの動き情報の検出を動き検出部6に行わせる(ステップS47)。   Thereafter, the CPU 12 moves the processing target to the next image frame (for example, the image frame f4) after the reference image frame (for example, the image frame f3) (step S45), and the CPU 12 performs the adjacent processing similarly to step S39. The motion detector 6 is caused to detect motion information of the moving object B between matching image frames (for example, the image frame f4 with respect to the image frame f3) (step S47).

そして、CPU12は、動き検出部6により検出された画像フレーム(例えば、画像フレームf4)の動体Bの動きベクトル(動き情報)に基づいて、当該画像フレーム(例えば、画像フレームf4)における被写体切り抜き画像P3の被写体領域Sの合成位置の算出を合成位置設定部7fに行わせる(ステップS48)。
そして、合成制御部7hは、算出された合成位置に基づいて被写体切り抜き画像P3を1つ後に移動した画像フレーム(例えば、画像フレームf4)へ合成した場合に当該被写体切り抜き画像P3における被写体領域Sの合成領域の一部が当該画像フレーム(例えば、画像フレームf4)内にあるか否かを判定する(ステップS49)。
ここで、合成領域の一部が画像フレーム(例えば、画像フレームf4)内にあると判定されると(ステップS49;YES)、CPU12は、算出された一つ後の画像フレーム(例えば、画像フレームf4)における被写体切り抜き画像P3の被写体領域Sの合成位置を合成位置設定部7fに設定させる(ステップS50)。
Then, based on the motion vector (motion information) of the moving object B of the image frame (for example, image frame f4) detected by the motion detection unit 6, the CPU 12 cuts out the subject in the image frame (for example, image frame f4). The composite position setting unit 7f is caused to calculate the composite position of the subject area S of P3 (step S48).
Then, the composition control unit 7h, when compositing the subject clipped image P3 to the image frame (for example, the image frame f4) moved one after based on the calculated composition position, the subject region S in the subject clipped image P3. It is determined whether or not a part of the synthesis area is within the image frame (for example, image frame f4) (step S49).
Here, when it is determined that a part of the composite area is within the image frame (for example, image frame f4) (step S49; YES), the CPU 12 calculates the next image frame (for example, image frame). The composition position setting unit 7f sets the composition position of the subject region S of the subject cutout image P3 in step f4) (step S50).

そして、CPU12は、動画像P4の画像フレーム(例えば、画像フレームf4)と被写体切り抜き画像P3とを合成して合成動画Mを構成する画像フレーム(例えば、画像フレームg4)を生成する画像合成処理を画像合成部7gに行わせる(ステップS51;図9参照)。
なお、画像合成処理の内容は、上記説明したものと略同様であり、その詳細な説明は省略する。また、図8のステップS50にて被写体切り抜き画像P3における被写体領域Sの合成位置が設定された際に、動画像P4の画像フレームf1〜f5とアルファマップとがずれてしまいアルファマップの範囲外となる領域については、α=0としてアルファ値が存在しない領域を生じさせないようにする。
Then, the CPU 12 combines image frames (for example, an image frame f4) of the moving image P4 and the subject cutout image P3 to generate an image combination process for generating an image frame (for example, an image frame g4) that forms the combined moving image M. The image composition unit 7g is caused to perform the process (step S51; see FIG. 9).
The contents of the image composition process are substantially the same as those described above, and a detailed description thereof is omitted. Also, when the composition position of the subject region S in the subject cutout image P3 is set in step S50 of FIG. 8, the image frames f1 to f5 of the moving image P4 are shifted from the alpha map, and are outside the range of the alpha map. For such a region, α = 0 is set so as not to generate a region having no alpha value.

図8に示すように、その後、CPU12は、全ての画像フレームf1〜f5について合成処理を行ったか否かを判定する(ステップS52)。
ここで、全ての画像フレームf1〜f5について合成処理を行っていないと判定されると(ステップS52;NO)、ステップS46へ戻り、全ての画像フレームf1〜f5について合成処理が行われるまで、CPU12は、ステップS46以降の処理を行わせる。一方、全ての画像フレームf1〜f5について合成処理を行ったと判定されると(ステップS52;YES)、画像合成部7gは、合成動画Mを構成する全ての画像フレームg1〜5(図10(b)参照)を生成する。なお、ステップS49にて、合成領域の一部が画像フレーム(例えば、画像フレームf5)内にないと判定された画像フレーム(例えば、画像フレームf5)については、動画像P4の画像フレーム(例えば、画像フレームf5)を合成動画Mの画像フレーム(例えば、画像フレームg5)とみなす。
As shown in FIG. 8, thereafter, the CPU 12 determines whether or not the synthesis process has been performed for all the image frames f1 to f5 (step S52).
If it is determined that the composition process has not been performed for all the image frames f1 to f5 (step S52; NO), the process returns to step S46, and the CPU 12 continues until the composition process is performed for all the image frames f1 to f5. Causes the processing after step S46 to be performed. On the other hand, if it is determined that the composition processing has been performed for all the image frames f1 to f5 (step S52; YES), the image composition unit 7g configures all the image frames g1 to g5 (FIG. ))). Note that in step S49, for an image frame (for example, image frame f5) that is determined to have a part of the synthesis area not in the image frame (for example, image frame f5), the image frame (for example, image frame f5) The image frame f5) is regarded as an image frame (for example, an image frame g5) of the synthesized moving image M.

また、図6のステップS37において、基準画像フレームが最初の画像フレームf1であると判定された場合(ステップS37;YES)、CPU12は、処理対象を基準画像フレームの1つ後の画像フレームf2へ移動させ、(ステップS46)上記のように、ステップS47以降の処理を行う。
これにより、合成動画生成処理を終了する。
If it is determined in step S37 of FIG. 6 that the reference image frame is the first image frame f1 (step S37; YES), the CPU 12 moves the processing target to the image frame f2 immediately after the reference image frame. (Step S46) As described above, the processing after Step S47 is performed.
As a result, the combined moving image generation process is terminated.

以上のように、本実施形態の撮像装置100によれば、背景用の動画像P4の複数の画像フレームf1〜f5のうち、隣合う画像フレーム間(例えば、画像フレームf3に対する画像フレームf2)の動体Bの動き情報を動き検出部6により検出し、当該動き情報に基づいて、被写体切り抜き画像P3を動画像P4上で動作させるように当該被写体切り抜き画像P3と動画像P4の複数の画像フレームf1〜f5の各々とを合成して合成動画Mを画像合成部7gにより生成する。
従って、背景用の動画像P4の各画像フレームf1〜f5と合成用の静止画像である被写体切り抜き画像P3とを合成する場合に、合成用の静止画像が最初に設定された合成位置に固定されることなく、動画像P4における動体Bの動きに合わせて被写体切り抜き画像P3を所定動作させることができ、興趣性の高い合成動画Mを生成することができる。
As described above, according to the imaging apparatus 100 of the present embodiment, among the plurality of image frames f1 to f5 of the background moving image P4, between adjacent image frames (for example, the image frame f2 with respect to the image frame f3). The motion detection unit 6 detects the motion information of the moving body B, and based on the motion information, a plurality of image frames f1 of the subject cutout image P3 and the moving image P4 so that the subject cutout image P3 is operated on the moving image P4. -F5 are combined with each other to generate a combined moving image M by the image combining unit 7g.
Therefore, when the image frames f1 to f5 of the background moving image P4 and the subject cutout image P3, which is a still image for combining, are combined, the combining still image is fixed at the initially set combining position. Therefore, the subject cutout image P3 can be operated in a predetermined manner in accordance with the movement of the moving object B in the moving image P4, and a highly interesting synthetic video M can be generated.

また、画像合成部7gは、動画像P4を構成する複数の画像フレームf1〜f5のうち、ユーザによる操作入力部11の所定操作に基づいて指定された基準画像フレーム(例えば、画像フレームf3)においては、所望の基準合成位置に被写体切り抜き画像P3を合成し、且つ、基準画像フレーム以外の各画像フレームにおいては、合成位置設定部7fが、動き検出部6によって検出された隣合う画像フレーム間(例えば、画像フレームf3に対する画像フレームf2)の動体Bの動き情報に基づいて、基準画像フレーム以外の各画像フレームにおける被写体切り抜き画像P3の合成位置を設定して、基準画像フレームに合成された被写体切り抜き画像P3に対し動体Bの動きに合わせて変位させるように被写体切り抜き画像P3を合成して合成動画Mを構成する複数の画像フレームg1〜g5を生成する。
これにより、ユーザ所望の画像フレーム(基準画像フレーム)において、被写体切り抜き画像P3の合成位置を指定することにより、当該基準画像フレーム以外の各画像フレームについて被写体切り抜き画像P3の合成位置を自動的に設定することができ、合成動画Mの生成に係る操作をより簡便なものとすることができる。従って、ユーザ所望の合成位置を適切に指定するだけで、興趣性の高い合成動画Mを簡便に生成することができる。
In addition, the image composition unit 7g uses a reference image frame (for example, image frame f3) designated based on a predetermined operation of the operation input unit 11 by the user among the plurality of image frames f1 to f5 constituting the moving image P4. Synthesizes the subject clipped image P3 at a desired reference composition position, and in each image frame other than the reference image frame, the composition position setting unit 7f detects the interval between adjacent image frames detected by the motion detection unit 6 ( For example, based on the motion information of the moving body B of the image frame f2) with respect to the image frame f3, the composition position of the subject cutout image P3 in each image frame other than the reference image frame is set, and the subject cutout synthesized with the reference image frame The subject cutout image P3 is synthesized so as to be displaced in accordance with the movement of the moving object B with respect to the image P3. Generating a plurality of image frames g1~g5 constituting the formed video M.
As a result, in the user-desired image frame (reference image frame), the composition position of the subject cutout image P3 is automatically set for each image frame other than the reference image frame by designating the composition position of the subject cutout image P3. Therefore, the operation related to the generation of the synthesized moving image M can be simplified. Therefore, it is possible to easily generate a highly interesting synthesized moving image M simply by appropriately specifying a user-desired synthesis position.

なお、本発明は、上記実施形態に限定されることなく、本発明の趣旨を逸脱しない範囲において、種々の改良並びに設計の変更を行っても良い。
例えば、上記実施形態として、動画像P4を構成する各画像フレームf1〜f5間のそれぞれの動体Bの動きベクトル(動き情報)を算出したが、これに限られるものではなく、例えば、動体Bが一定の方向に一定間隔の速さで変位していると判断した場合には、少なくとも一の動体Bの動きベクトルに基づいて、各画像フレームf1〜f5に対する被写体切り抜き画像P3の合成位置を算出するようにしても良い。
また、基準画像フレームにおいて指定した基準合成位置が動体Bを含む領域だった場合に、基準画像フレーム以外の各画像フレームにおいては、動き検出部6によって検出された隣合う画像フレーム間の動体Bの動き情報に基づいて、基準画像フレーム以外の各画像フレームにおける被写体切り抜き画像P3の合成位置を設定するようにしてもよい。
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, as the above embodiment, the motion vector (motion information) of each moving object B between the image frames f1 to f5 constituting the moving image P4 is calculated. However, the present invention is not limited to this. If it is determined that the object is displaced in a certain direction at a constant interval, the combined position of the subject cutout image P3 for each of the image frames f1 to f5 is calculated based on the motion vector of at least one moving object B. You may do it.
Further, when the reference composite position designated in the reference image frame is an area including the moving object B, in each image frame other than the reference image frame, the moving object B between adjacent image frames detected by the motion detection unit 6 is displayed. Based on the motion information, the synthesis position of the subject cutout image P3 in each image frame other than the reference image frame may be set.

また、上記実施形態として、動画像P4として、Motion−JPEG形式で記録された動画像データを例示したが、これに限られるものではなく、例えば、所定のシャッタースピードで連写された連続した複数の静止画からなる連写画像であっても良い。この場合にあっても、上記実施形態と同様に、連続する静止画どうしの間で動体Bの動き情報を検出して、当該動き情報に基づいて被写体切り抜き画像P3の被写体領域Sを所定動作させる。   In the above embodiment, the moving image data recorded in the Motion-JPEG format is exemplified as the moving image P4. However, the present invention is not limited to this. For example, a plurality of continuous images continuously shot at a predetermined shutter speed are used. The continuous shot image which consists of still images may be sufficient. Even in this case, as in the above-described embodiment, the motion information of the moving object B is detected between successive still images, and the subject region S of the subject clipped image P3 is caused to perform a predetermined operation based on the motion information. .

また、上記実施形態にあっては、動画像データの記録方式として、Motion−JPEG形式を例示したが、MPEG形式であっても良い。かかる場合には、動体Bの動きを検出する際に、予め当該MPEG形式の動画像データを復号化して複数の画像フレームf1〜f5を生成することで、画像フレームf1〜f5間の動体Bの動きの検出を行うことができる。   In the above embodiment, the Motion-JPEG format has been exemplified as a moving image data recording method. However, an MPEG format may be used. In such a case, when detecting the motion of the moving object B, the moving image data in the MPEG format is generated in advance by decoding the MPEG moving image data to generate a plurality of image frames f1 to f5. Motion detection can be performed.

また、撮像装置100の構成は、上記実施形態に例示したものは一例であり、これに限られるものではない。即ち、画像合成装置として、撮像装置を例示したが、これに限られるものではい。例えば、被写体切り抜き画像P3、動画像P4及び動体Bの動き情報に基づいて設定された当該動画像P4に対する被写体切り抜き画像の合成位置に係るデータの生成は、当該撮像装置100とは異なる撮像装置にて行い、この撮像装置から転送されたデータのみを記録して、合成動画の再生処理のみを実行する画像再生装置であっても良い。   In addition, the configuration of the imaging apparatus 100 is merely an example illustrated in the above embodiment, and is not limited thereto. In other words, the image pickup apparatus is exemplified as the image composition apparatus, but is not limited thereto. For example, the generation of data related to the combined position of the subject clipped image with respect to the moving image P4 set based on the motion information of the subject clipped image P3, the moving image P4, and the moving object B is generated by an imaging device different from the imaging device 100. It is also possible to use an image playback device that records only the data transferred from the imaging device and executes only the playback processing of the synthesized moving image.

加えて、上記実施形態にあっては、取得手段、検出手段、合成手段、合成位置設定手段としての機能を、CPU13の制御下にて、動き検出部6、画像処理部7の切抜画像生成部7d、取得部7e、合成位置設定部7f、画像合成部7gが駆動することにより実現される構成としたが、これに限られるものではなく、CPU13によって所定のプログラム等が実行されることにより実現される構成としても良い。
即ち、プログラムを記憶するプログラムメモリ(図示略)に、取得処理ルーチン、検出処理ルーチン、合成位置設定処理ルーチン、合成処理ルーチンを含むプログラムを記憶しておく。そして、取得処理ルーチンによりCPU13に、背景用の動画像と合成用の静止画像を取得させるようにしても良い。また、検出処理ルーチンによりCPU13に、取得された背景用の動画像における動体の動き情報を検出させるようにしても良い。また、合成位置設定処理ルーチンによりCPU13に、検出された少なくとも一の隣合う画像フレーム間の動体の動き情報に基づいて、一の画像フレーム以外の各画像フレームにおける静止画像の合成位置を設定させるようにしても良い。また、合成処理ルーチンによりCPU13に、検出された動き情報に基づいて、動体の動きに合わせて合成用の静止画像を所定動作させるように静止画像と動画像とを合成して合成動画を生成させるようにしても良い。
In addition, in the above embodiment, the functions as the acquisition unit, the detection unit, the synthesis unit, and the synthesis position setting unit are controlled under the control of the CPU 13 by the motion detection unit 6 and the cutout image generation unit of the image processing unit 7. 7d, the acquisition unit 7e, the synthesis position setting unit 7f, and the image synthesis unit 7g are configured to be driven. However, the configuration is not limited to this, and is realized by the CPU 13 executing a predetermined program or the like. It is good also as a structure to be performed.
That is, a program memory (not shown) that stores a program stores a program including an acquisition process routine, a detection process routine, a synthesis position setting process routine, and a synthesis process routine. Then, the background processing image and the composition still image may be acquired by the CPU 13 by the acquisition processing routine. Further, the CPU 13 may detect the motion information of the moving object in the acquired background moving image by the detection processing routine. Further, the synthesis position setting processing routine causes the CPU 13 to set the still image synthesis position in each image frame other than the one image frame based on the detected motion information of the moving body between at least one adjacent image frame. Anyway. Further, the synthesis processing routine causes the CPU 13 to generate a synthesized moving image by synthesizing the still image and the moving image so that the synthesis still image is operated in a predetermined manner in accordance with the motion of the moving object based on the detected motion information. You may do it.

100 撮像装置
1 レンズ部
2 電子撮像部
3 撮像制御部
6 動き検出部
7 画像処理部
7d 切抜画像生成部
7e 取得部
7f 合成位置設定部
7g 画像合成部
7h 合成制御部
8 記録媒体
10 表示部
12 CPU
DESCRIPTION OF SYMBOLS 100 Imaging device 1 Lens part 2 Electronic imaging part 3 Imaging control part 6 Motion detection part 7 Image processing part 7d Cutout image generation part 7e Acquisition part 7f Composition position setting part 7g Image composition part 7h Composition control part 8 Recording medium 10 Display part 12 CPU

Claims (9)

背景用の動画像及び当該動画像と合成すべき静止画像を取得する取得手段と、
この取得手段によって取得された背景用の動画像における動体の動き情報を検出する検出手段と、
この検出手段によって検出された動き情報に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を生成する合成手段と、
を備えたことを特徴とする画像合成装置。
Acquisition means for acquiring a moving image for background and a still image to be combined with the moving image;
Detecting means for detecting motion information of a moving object in the background moving image acquired by the acquiring means;
Based on the motion information detected by the detection means, a synthesis means for synthesizing the still image and the moving image so as to operate the still image on the background moving image to generate a synthesized moving image;
An image composition device comprising:
前記動画像を構成する複数の画像フレームのうち、何れか一の画像フレームにおける前記静止画像の合成位置を指定する指定手段を更に備え、
前記合成手段は、
前記複数の画像フレームのうち、前記一の画像フレームにおいては、前記指定手段によって指定された合成位置に前記静止画像を合成し、且つ、前記一の画像フレーム以外の各画像フレームにおいては、前記一の画像フレームに合成された前記静止画像に対し前記動体の動きに合わせて変位させるように前記静止画像を合成することを特徴とする請求項1に記載の画像合成装置。
A designating unit for designating a synthesis position of the still image in any one of the plurality of image frames constituting the moving image;
The synthesis means includes
Among the plurality of image frames, in the one image frame, the still image is synthesized at the synthesis position designated by the designation unit, and in each image frame other than the one image frame, the one image frame The image synthesizing apparatus according to claim 1, wherein the still image is combined with the still image combined with the image frame so as to be displaced in accordance with the movement of the moving object.
前記合成手段は、
前記指定手段によって指定された合成位置が、前記動画像における動体を含む位置であった場合に、前記一の画像フレーム以外の各画像フレームにおいては、前記一の画像フレームに合成された前記静止画像に対し前記動体の動き情報に応じて変位させるように前記静止画像を合成することを特徴とする請求項2記載の画像合成装置。
The synthesis means includes
When the synthesis position designated by the designation means is a position including a moving object in the moving image, the still image synthesized with the one image frame in each image frame other than the one image frame. The image synthesizing apparatus according to claim 2, wherein the still image is synthesized so as to be displaced according to movement information of the moving object.
前記検出手段は、
前記複数の画像フレームのうち、少なくとも一の隣合う画像フレーム間の動体の動き情報を検出し、
前記検出手段によって検出された前記少なくとも一の隣合う画像フレーム間の動体の動き情報に基づいて、前記一の画像フレーム以外の各画像フレームにおける前記静止画像の合成位置を設定する合成位置設定手段を更に備えることを特徴とする請求項2又は3に記載の画像合成装置。
The detection means includes
Detecting motion information of a moving object between at least one adjacent image frame among the plurality of image frames;
Composition position setting means for setting a composition position of the still image in each image frame other than the one image frame based on movement information of a moving body between the at least one adjacent image frames detected by the detection means; The image composition device according to claim 2 or 3, further comprising:
前記静止画像は、背景内に被写体が存在する被写体存在画像から被写体が含まれる被写体領域を抽出した画像であることを特徴とする請求項1〜4の何れか一項に記載の画像合成装置。   The image synthesizing apparatus according to claim 1, wherein the still image is an image obtained by extracting a subject area including a subject from a subject existing image in which a subject is present in a background. 前記動体の動き情報は、動体の位置の変化情報、大きさの変化情報及び回転角度の変化情報のうち少なくとも1つを含むことを特徴とする請求項1〜5の何れか一項に記載の画像合成装置。   The motion information of the moving object includes at least one of change information of a position of the moving object, change information of a size, and change information of a rotation angle. Image composition device. 背景用の動画像及び当該動画像と合成すべき静止画像を記録する画像記録手段と、
前記背景用の動画像の動体の動き情報に基づいて、当該動画像における前記静止画像の合成位置を記録する位置記録手段と、
この位置記録手段に記録された前記合成位置に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生手段と、
を備えたことを特徴とする画像再生装置。
Image recording means for recording a moving image for background and a still image to be combined with the moving image;
A position recording means for recording a composite position of the still image in the moving image based on motion information of the moving object of the background moving image;
Based on the composition position recorded in the position recording means, reproduction means for reproducing the synthesized moving image by synthesizing the still image and the moving image so that the still image is operated on the background moving image. When,
An image reproducing apparatus comprising:
画像合成装置のコンピュータを、
背景用の動画像及び当該動画像と合成すべき静止画像を取得する取得手段、
この取得手段によって取得された背景用の動画像における動体の動き情報を検出する検出手段、
この検出手段によって検出された動き情報に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を生成する合成制御手段、
として機能させることを特徴とするプログラム。
The computer of the image synthesizer
Acquisition means for acquiring a moving image for background and a still image to be combined with the moving image;
Detecting means for detecting motion information of a moving object in the background moving image acquired by the acquiring means;
Based on the motion information detected by the detection means, a synthesis control means for synthesizing the still image and the moving image so as to operate the still image on the background moving image to generate a synthesized moving image;
A program characterized by functioning as
画像再生装置のコンピュータを、
背景用の動画像及び当該動画像と合成すべき静止画像を記録手段に記録させる画像記録制御手段、
前記背景用の動画像の動体の動き情報に基づいて設定された当該動画像における前記静止画像の合成位置を記録手段に記録させる位置記録制御手段、
この位置記録制御手段により記録された前記合成位置に基づいて、前記静止画像を前記背景用の動画像上で動作させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生制御手段、
として機能させることを特徴とするプログラム。
The computer of the image playback device
Image recording control means for recording a moving image for background and a still image to be combined with the moving image on a recording means;
Position recording control means for causing the recording means to record the combined position of the still image in the moving image set based on the motion information of the moving object of the background moving image;
Based on the combination position recorded by the position recording control means, the still image and the moving image are combined to reproduce the combined moving image so that the still image is operated on the background moving image. Control means,
A program characterized by functioning as
JP2009086169A 2009-03-31 2009-03-31 Image composition apparatus and program Expired - Fee Related JP5402166B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009086169A JP5402166B2 (en) 2009-03-31 2009-03-31 Image composition apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009086169A JP5402166B2 (en) 2009-03-31 2009-03-31 Image composition apparatus and program

Publications (2)

Publication Number Publication Date
JP2010239464A true JP2010239464A (en) 2010-10-21
JP5402166B2 JP5402166B2 (en) 2014-01-29

Family

ID=43093401

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009086169A Expired - Fee Related JP5402166B2 (en) 2009-03-31 2009-03-31 Image composition apparatus and program

Country Status (1)

Country Link
JP (1) JP5402166B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013210691A (en) * 2012-03-30 2013-10-10 Casio Comput Co Ltd Movement information generation method, movement information generation device and program
JP2013214158A (en) * 2012-03-30 2013-10-17 Ntt Comware Corp Display image retrieval device, display control system, display control method, and program
KR20230099921A (en) * 2021-12-28 2023-07-05 연세대학교 산학협력단 Method for generating synthetic video using optical flow

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318596B (en) * 2014-10-08 2017-10-20 北京搜狗科技发展有限公司 The generation method and generating means of a kind of dynamic picture

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0329472A (en) * 1989-06-26 1991-02-07 Sony Corp Video synthesizer
JPH08123816A (en) * 1994-10-24 1996-05-17 Mitsubishi Electric Corp Animation hypermedia processor
JP2000013683A (en) * 1998-06-22 2000-01-14 Canon Inc Device and method for composing image, and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0329472A (en) * 1989-06-26 1991-02-07 Sony Corp Video synthesizer
JPH08123816A (en) * 1994-10-24 1996-05-17 Mitsubishi Electric Corp Animation hypermedia processor
JP2000013683A (en) * 1998-06-22 2000-01-14 Canon Inc Device and method for composing image, and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013210691A (en) * 2012-03-30 2013-10-10 Casio Comput Co Ltd Movement information generation method, movement information generation device and program
JP2013214158A (en) * 2012-03-30 2013-10-17 Ntt Comware Corp Display image retrieval device, display control system, display control method, and program
KR20230099921A (en) * 2021-12-28 2023-07-05 연세대학교 산학협력단 Method for generating synthetic video using optical flow
KR102586637B1 (en) * 2021-12-28 2023-10-06 연세대학교 산학협력단 Method for generating synthetic video using optical flow

Also Published As

Publication number Publication date
JP5402166B2 (en) 2014-01-29

Similar Documents

Publication Publication Date Title
JP5105550B2 (en) Image composition apparatus and program
JP5051156B2 (en) Image processing apparatus and program
WO2012128066A1 (en) Image processing device and method; and program
JP2012242821A (en) Display image generation method
JP4798236B2 (en) Imaging apparatus, image processing method, and program
JP4807432B2 (en) Imaging apparatus, image processing method, and program
JP2011135438A (en) Image synthesis apparatus and method, and program
JP5402166B2 (en) Image composition apparatus and program
JP5267279B2 (en) Image composition apparatus and program
JP5125294B2 (en) Program, image processing apparatus, imaging apparatus, and image processing method
JP5402148B2 (en) Image composition apparatus, image composition method, and program
JP2009044329A (en) Program, image processing method, and image processor
JP5476900B2 (en) Image composition apparatus, image composition method, and program
JP2010273268A (en) Image reproducing device, imaging apparatus, image reproducing method, and image reproducing program
JP5636660B2 (en) Image processing apparatus, image processing method, and program
JP2011003057A (en) Image composition device, image specifying method, image composition method, and program
JP2011041041A (en) Imaging apparatus, imaging method and program
JP2011182014A (en) Image pickup device, image processing method and program
JP5493839B2 (en) Imaging apparatus, image composition method, and program
JP5423296B2 (en) Image processing apparatus, image processing method, and program
JP5494537B2 (en) Image processing apparatus and program
JP6564295B2 (en) Composite image creation device
JP2010278701A (en) Image combining device, and image combining method and program
JP5589333B2 (en) Image composition apparatus, image composition method, and program
JP5381207B2 (en) Image composition apparatus and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120327

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20120327

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130416

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130423

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130620

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

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131014

R150 Certificate of patent or registration of utility model

Ref document number: 5402166

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees