JP2010233001A - Image compositing apparatus, image reproducing apparatus, and program - Google Patents

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

Info

Publication number
JP2010233001A
JP2010233001A JP2009079038A JP2009079038A JP2010233001A JP 2010233001 A JP2010233001 A JP 2010233001A JP 2009079038 A JP2009079038 A JP 2009079038A JP 2009079038 A JP2009079038 A JP 2009079038A JP 2010233001 A JP2010233001 A JP 2010233001A
Authority
JP
Japan
Prior art keywords
image
subject
moving
moving image
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
JP2009079038A
Other languages
Japanese (ja)
Other versions
JP5402148B2 (en
Inventor
Kazuya Nara
和也 奈良
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 JP2009079038A priority Critical patent/JP5402148B2/en
Publication of JP2010233001A publication Critical patent/JP2010233001A/en
Application granted granted Critical
Publication of JP5402148B2 publication Critical patent/JP5402148B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To produce a highly interesting composited image. <P>SOLUTION: An imaging apparatus 100 includes: an image compositing unit 7f for compositing a background still image and a subject cutout moving image to produce a composited motion picture of a subject composited image; a motion detection unit 6 for detecting the motion of a subject in the moving image; and a compositing control unit 7g which causes the image compositing unit to composite the still image and the moving image so as to additively display the subject at different positions in the background still image with the passage of reproducing time, with the motion of the subject detected by the motion detection unit as a reference. <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 subject image with a background image or a frame image is known (see, for example, Patent Document 1).

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

しかしながら、被写体画像としての動画像を背景用の静止画像に単に合成しただけでは、ありきたりな動画像しか生成することができず、興趣に欠ける画像になってしまう。   However, by simply synthesizing a moving image as a subject image with a background still image, only ordinary moving images can be generated, resulting in an uninteresting image.

そこで、本発明の課題は、興趣性の高い合成画像を生成することができる画像合成装置、画像再生装置及びプログラムを提供することである。   Therefore, an object of the present invention is to provide an image composition device, an image reproduction device, and a program capable of generating a highly interesting composite image.

上記課題を解決するため、請求項1に記載の発明の画像合成装置は、
背景用の静止画像と動画像とを合成して合成動画を生成する合成手段と、前記動画像における動体の動きを検出する検出手段と、この検出手段により検出された動体の動きを基準として、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように前記静止画像と前記動画像とを前記合成手段に合成させる合成制御手段と、を備えたことを特徴としている。
In order to solve the above-described problem, an image composition device according to a first aspect of the present invention provides:
With reference to the motion of the moving object detected by the detecting means, the detecting means for detecting the movement of the moving object in the moving image, the combining means for combining the still image for the background and the moving image to generate a combined moving image And a synthesis control unit that synthesizes the still image and the moving image with the synthesizing unit so as to add and display the moving object at different positions of the still image as the playback time elapses. .

請求項2に記載の発明は、請求項1に記載の画像合成装置において、
前記合成制御手段は、前記動画像を構成する複数の画像フレーム中の動体を前記静止画像に対して前記合成手段により加算して複数の画像フレームからなる合成動画を生成させることを特徴としている。
According to a second aspect of the present invention, in the image composition device according to the first aspect,
The composition control means is characterized in that a moving object in a plurality of image frames constituting the moving image is added to the still image by the composition means to generate a composite moving image composed of a plurality of image frames.

請求項3に記載の発明は、請求項1又は2に記載の画像合成装置において、
前記検出手段により検出された動体の動きの方向が略等しいか否かを判定する動き判定手段を更に備え、前記合成制御手段は、前記動き判定手段により前記動体の動きの方向が略等しいと判定された場合に、前記動体を再生時間の経過に伴って異なる位置に加算表示させるように前記合成手段に合成させることを特徴としている。
According to a third aspect of the present invention, in the image composition device according to the first or second aspect,
It further comprises motion determining means for determining whether or not the direction of motion of the moving object detected by the detecting means is substantially equal, and the composition control means determines that the direction of motion of the moving object is approximately equal by the motion determining means. In this case, the moving means is synthesized by the synthesizing means so that the moving objects are added and displayed at different positions as the reproduction time elapses.

請求項4に記載の発明は、請求項3に記載の画像合成装置において、
前記動き判定手段は、前記動画像を構成する複数の画像フレームのうち、隣り合う画像フレーム間での動体の動きの方向が略等しいか否かを判定し、前記合成制御手段は、前記動き判定手段により何れか一の画像フレームにおける前記動体の動きの方向が当該一の画像フレームよりも前の画像フレームにおける前記動体の動きの方向に対して変化したと判断された場合に、既に前記静止画像に対して加算表示された動体を消去することを特徴としている。
According to a fourth aspect of the present invention, in the image synthesizing device according to the third aspect,
The motion determination means determines whether or not the direction of motion of a moving object between adjacent image frames among a plurality of image frames constituting the moving image is substantially equal, and the composition control means determines the motion determination When it is determined by the means that the direction of motion of the moving object in any one image frame has changed with respect to the direction of motion of the moving object in the image frame prior to the one image frame, the still image has already been obtained. It is characterized in that the moving object displayed in addition to is deleted.

請求項5に記載の発明は、請求項3又は4に記載の画像合成装置において、
前記動き判定手段は、前記検出手段により検出された動体の動きの量が所定値以上であるか否かを判定し、前記合成制御手段は、前記動き判定手段により前記動体の動きの量が所定値以上であると判定された場合に、前記動体を再生時間の経過に伴って異なる位置に加算表示させるように前記合成手段に合成させることを特徴としている。
The invention according to claim 5 is the image composition apparatus according to claim 3 or 4,
The movement determination means determines whether or not the amount of movement of the moving object detected by the detection means is greater than or equal to a predetermined value, and the composition control means determines that the amount of movement of the moving object is predetermined by the movement determination means. When it is determined that the value is equal to or greater than the value, the moving means is combined with the combining means so that the moving object is added and displayed at different positions as the playback time elapses.

請求項6に記載の発明は、請求項3〜5の何れか一項に記載の画像合成装置において、
前記合成制御手段は、前記動き判定手段により前記動体の動きの方向が略等しくないと判定された場合に、前記動画像を構成する複数の画像フレームの各々を前記静止画像に対して前記合成手段により合成させることを特徴としている。
The invention according to claim 6 is the image synthesizing apparatus according to any one of claims 3 to 5,
The synthesis control means, when the motion determination means determines that the moving direction of the moving body is not substantially equal, each of the plurality of image frames constituting the moving image with respect to the still image. It is characterized by being synthesized by.

請求項7に記載の発明の画像再生装置は、
背景用の静止画像と動画像とを記録する画像記録手段と、前記動画像における動体の動きを基準として設定された前記動体の合成位置を記録する位置記録手段と、前記位置記録手段に記録された合成位置に基づいて、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生制御手段と、を備えたことを特徴としている。
The image reproduction device of the invention according to claim 7
An image recording unit that records a still image and a moving image for background, a position recording unit that records a combined position of the moving object set on the basis of the movement of the moving object in the moving image, and a recording unit that records the position recording unit. Reproduction control means for combining the still image and the moving image to reproduce the combined moving image so that the moving object is added and displayed at different positions of the still image as the reproduction time elapses based on the combined position. It is characterized by having.

請求項8に記載の発明のプログラムは、
画像合成装置のコンピュータを、背景用の静止画像と動画像とを合成して合成動画を生成する合成手段、前記動画像における動体の動きを検出する検出手段、この検出手段により検出された動体の動きを基準として、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように前記静止画像と前記動画像とを前記合成手段に合成させる合成制御手段、として機能させることを特徴としている。
The program of the invention described in claim 8 is:
A computer of the image composition apparatus, a composing means for composing a background still image and a moving image to generate a composite moving image, a detecting means for detecting the motion of the moving object in the moving image, and a moving object detected by the detecting means Using the movement as a reference, the moving unit functions as a combining control unit that combines the still image and the moving image so that the moving image is added and displayed at different positions of the still image as the playback time elapses. It is characterized by.

請求項9に記載の発明のプログラムは、
画像再生装置のコンピュータを、背景用の静止画像と動画像とを記録手段に記録させる画像記録制御手段、前記動画像における動体の動きを基準として設定された前記動体の合成位置を記録手段に記録させる位置記録制御手段、前記記録手段に記録された合成位置に基づいて、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生制御手段、として機能させることを特徴としている。
The program of the invention according to claim 9 is:
An image recording control unit that causes a computer of the image reproduction apparatus to record a still image and a moving image for background on a recording unit, and a recording position of the moving object set on the basis of the movement of the moving object in the moving image is recorded on the recording unit Position recording control means, and based on the combined position recorded in the recording means, the still image and the moving image are displayed so that the moving object is added and displayed at different positions of the still image as the playback time elapses. It is characterized by functioning as a reproduction control means for synthesizing and reproducing a synthesized moving image.

本発明によれば、静止画像に動体を斬新な態様で合成することができ、興趣性の高い合成画像を生成することができる。   ADVANTAGE OF THE INVENTION According to this invention, a moving body can be synthesize | combined with a still image in a novel aspect, and a highly interesting synthetic | combination image 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の被写体切り抜き処理に係る被写体存在画像の一例を模式的に示す図である。FIG. 3 is a diagram schematically illustrating an example of a subject existing image according to the subject clipping process of FIG. 2. 図2の被写体切り抜き処理に係る被写体切り抜き画像の一例を模式的に示す図である。FIG. 3 is a diagram schematically illustrating an example of a subject cutout image according to the subject cutout process of FIG. 2. 図1の撮像装置による背景用画像生成処理に係る動作の一例を示すフローチャートである。3 is a flowchart illustrating an example of an operation related to background image generation processing by the imaging apparatus of FIG. 1. 図1の撮像装置による合成画像生成処理に係る動作の一例を示すフローチャートである。3 is a flowchart illustrating an example of an operation related to a composite image generation process by the imaging apparatus of FIG. 1. 図6の合成画像生成処理における合成判定処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on the synthetic | combination determination process in the synthetic | combination image generation process of FIG. 図6の合成画像生成処理における加算合成処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on the addition synthetic | combination process in the synthetic | combination image generation process of FIG. 図8の加算合成処理にて画像合成される被写体合成画像の一例を模式的に示す図である。It is a figure which shows typically an example of the to-be-photographed object synthetic | combination image image-synthesized by the addition synthetic | combination process of FIG. 図6の合成画像生成処理における通常合成処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on the normal synthetic | combination process in the synthetic | combination image generation process of FIG. 図10の通常合成処理にて画像合成される被写体合成画像の一例を模式的に示す図である。It is a figure which shows typically an example of the to-be-photographed object synthetic | combination image image-combined by the normal synthetic | combination process of FIG.

以下に、本発明について、図面を用いて具体的な態様を説明する。ただし、発明の範囲は、図示例に限定されない。
図1は、本発明を適用した一実施形態の撮像装置100の概略構成を示すブロック図である。
本実施形態の撮像装置100は、合成画像生成処理に係る被写体切り抜き動画像M2における被写体の動きを検出して、検出された被写体の動きを基準として、当該被写体を再生時間の経過に伴って背景用画像P1の異なる位置に加算表示させるように背景用画像P1と被写体切り抜き動画像M2とを合成させる。
具体的には、図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 movement of the subject in the subject cutout moving image M2 related to the composite image generation process, and uses the detected movement of the subject as a reference to the subject as the playback time elapses. The background image P1 and the subject cutout moving image M2 are combined so as to be added and displayed at different positions of the use image P1.
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は、撮像手段として、合成画像生成処理に係る被写体存在動画像M1(図3(a)〜図3(e)参照)や背景用画像P1(図9(a)等参照)を撮像する。
また、撮像レンズ部1、電子撮像部2及び撮像制御部3は、被写体存在動画像M1の撮像後、当該被写体存在動画像M1の撮像の際の撮像条件を固定した状態で、被写体切り抜き動画像M2(図4(a)〜図4(e)参照)の生成のための被写体非存在画像(図示略)を撮像する。
The imaging lens unit 1, the electronic imaging unit 2, and the imaging control unit 3 configured as described above serve as the subject presence moving image M <b> 1 related to the composite image generation process (see FIGS. 3A to 3E) as an imaging unit. ) And the background image P1 (see FIG. 9A, etc.).
In addition, the imaging lens unit 1, the electronic imaging unit 2, and the imaging control unit 3 capture the subject clipping moving image in a state in which the imaging conditions for capturing the subject existing moving image M1 are fixed after capturing the subject existing moving image M1. A subject non-existing image (not shown) for generating M2 (see FIGS. 4A to 4E) 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は、特徴量演算部6aと、ブロックマッチング部6bとを具備している。
特徴量演算部6aは、被写体非存在画像を基準として、当該被写体非存在画像から特徴点を抽出する特徴抽出処理を行う。具体的には、特徴量演算部6aは、被写体非存在画像のYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレート(例えば、16×16画素の正方形)として抽出する。
ここで、特徴抽出処理とは、多数の候補ブロックから追跡に都合の良い特徴性の高いものを選択する処理である。
The motion detection unit 6 includes a feature amount calculation unit 6a and a block matching unit 6b.
The feature amount calculation unit 6a performs feature extraction processing for extracting feature points from the subject non-existing image with reference to the subject non-existing image. 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 nonexistent image, and The contents are 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.

また、特徴量演算部6aは、合成判定処理(後述)にて、例えば、Motion−JPEG形式で記録された被写体切り抜き動画像M2の動画像データを構成する各画像フレームgから所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレート(例えば、16×16画素の正方形)として抽出する。   Further, the feature amount calculation unit 6a performs a predetermined number (or alternatively) from each image frame g constituting the moving image data of the subject cutout moving image M2 recorded in the Motion-JPEG format, for example, in the composition determination process (described later). A block area (feature point) having a high feature (a predetermined number or more) is selected, and the contents of the block are extracted as a template (for example, a square of 16 × 16 pixels).

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

また、ブロックマッチング部6bは、被写体切り抜き動画像M2の動画像データを構成する複数の画像フレームg、…のうち、一の画像フレームgから特徴抽出処理にて抽出されたテンプレートが一つ前の画像フレームg内のどこに対応するか、つまり、一つ前の画像フレームg内にてテンプレートの画素値が最適にマッチする位置(対応領域)を探索する。そして、画素値の相違度の評価値(例えば、差分二乗和(SSD)や差分絶対値和(SAD)等)が最も良かった当該一の画像フレームgと一つ前の画像フレームg間の最適なオフセットを当該テンプレートの動きベクトルとして算出する。そして、算出された複数の動きベクトルの各々について、何れか一の動きベクトルを評価対象として他の動きベクトルと比較して当該評価対象の動きベクトルに対して投票するか否かを決定し、一の画像フレームgの全体の動きベクトル(図4(a)〜図4(e)参照)を多数決により算出する。
なお、図4(a)〜図4(e)にあっては、画像フレームgの被写体の動きベクトルを白抜きの矢印で表すものとする。
ここで、動き検出部6の特徴量演算部6a及びブロックマッチング部6bは、動画像における動体の動きを検出する検出手段を構成している。
Also, the block matching unit 6b has the template extracted by the feature extraction process from one image frame g among the plurality of image frames g,... Constituting the moving image data of the subject cutout moving image M2 one before. Where to correspond in the image frame g, that is, a position (corresponding region) where the pixel value of the template optimally matches in the previous image frame g is searched. Then, the evaluation value (for example, sum of squares of differences (SSD), sum of absolute differences (SAD), etc.) of the difference between pixel values is the optimum between the one image frame g and the previous image frame g. A correct offset is calculated as a 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 entire image frame g (see FIGS. 4A to 4E) is calculated by majority vote.
In FIGS. 4A to 4E, the motion vector of the subject in the image frame g is represented by a white arrow.
Here, the feature amount calculation unit 6a and the block matching unit 6b of the motion detection unit 6 constitute detection means for detecting the motion of the moving object in the moving image.

画像処理部7は、被写体存在動画像M1と被写体非存在画像との位置合わせを行う位置合わせ部7aを具備している。
位置合わせ部7aは、被写体非存在画像から抽出した特徴点に基づいて、被写体非存在画像に対する被写体存在動画像M1の各画素の座標変換式(射影変換行列)を算出し、当該座標変換式に従って被写体存在動画像M1を座標変換して被写体非存在画像と位置合わせを行う。
また、位置合わせ部7aは、複数の画像フレームf、…からなる被写体存在動画像M1の各画像フレームfについて被写体非存在画像と位置合わせを行う。
The image processing unit 7 includes an alignment unit 7a that performs alignment between the subject presence moving image M1 and the subject non-existence image.
The alignment unit 7a calculates a coordinate conversion formula (projection conversion matrix) of each pixel of the subject presence moving image M1 with respect to the subject nonexistence image based on the feature points extracted from the subject nonexistence image, and follows the coordinate conversion formula. The subject presence moving image M1 is coordinate-converted and aligned with the subject non-existence image.
In addition, the alignment unit 7a aligns each image frame f of the subject existing moving image M1 including the plurality of image frames f,.

また、画像処理部7は、位置合わせ部7aにより位置合わせされた被写体存在動画像M1と被写体非存在画像との間で対応する各画素の差分情報を生成し、当該差分情報を基準として被写体存在動画像M1から被写体が含まれる被写体領域Sを抽出する被写体領域抽出部7bを具備している。
また、被写体領域抽出部7bは、複数の画像フレームf、…からなる被写体存在動画像M1の各画像フレームfから被写体が含まれる被写体領域Sを抽出する。
Further, the image processing unit 7 generates difference information of each corresponding pixel between the subject presence moving image M1 and the subject non-existence image 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 moving image M1 is provided.
In addition, the subject area extraction unit 7b extracts a subject area S including a subject from each image frame f of the subject existing moving image M1 including a plurality of image frames f.

また、画像処理部7は、被写体存在動画像M1内で抽出された被写体領域Sの位置を特定して、被写体存在動画像M1における被写体領域Sの位置を示す位置情報を生成する位置情報生成部7cを具備している。
ここで、位置情報としては、例えば、アルファマップが挙げられ、アルファマップとは、被写体存在動画像M1の各画素について、被写体領域Sの画像を所定の背景に対してアルファブレンディングする際の重みをアルファ値(0≦α≦1)として表したものである。
また、位置情報生成部7cは、被写体存在動画像M1が複数の画像フレームf、…からなる動画像の場合、各画像フレームfにおける被写体領域Sの位置を示す位置情報を生成する。
In addition, the image processing unit 7 specifies the position of the subject region S extracted in the subject presence moving image M1, and generates position information indicating the position of the subject region S in the subject presence moving image M1. 7c.
Here, the position information includes, for example, an alpha map. 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 moving image M1. This is expressed as an alpha value (0 ≦ α ≦ 1).
Further, when the subject existing moving image M1 is a moving image including a plurality of image frames f,..., The position information generating unit 7c generates position information indicating the position of the subject region S in each image frame f.

また、画像処理部7は、生成されたアルファマップに基づいて、被写体存在動画像M1の各画素のうち、アルファ値が1の画素を所定の単一色画像(図示略)に対して透過させずに、且つ、アルファ値が0の画素を透過させるように、被写体の画像を所定の単一色画像と合成して被写体切り抜き動画像M2(図4(a)〜図4(e)参照)の画像データを生成する切抜画像生成部7dを具備している。
これにより、切抜画像生成部7dは、背景と被写体とが存在する被写体存在動画像M1から被写体が含まれる領域を切り抜いた被写体切り抜き動画像M2を取得する。
また、切抜画像生成部7dは、複数の画像フレームf、…からなる被写体存在動画像M1の各画像フレームfから被写体が含まれる領域を切り抜いた画像フレームfを取得して、これら画像フレームfからなる被写体切り抜き動画像M2の動画像データを生成する。
Further, the image processing unit 7 does not transmit a pixel having an alpha value of 1 among the pixels of the subject existing moving image M1 to a predetermined single color image (not shown) based on the generated alpha map. In addition, an image of the subject cutout moving image M2 (see FIGS. 4A to 4E) is synthesized by synthesizing the subject image with a predetermined single color image so as to transmit pixels having an alpha value of 0. A cut-out image generation unit 7d for generating data is provided.
Thereby, the cut-out image generation unit 7d acquires the subject cut-out moving image M2 obtained by cutting out the area including the subject from the subject existing moving image M1 in which the background and the subject exist.
Further, the cut-out image generation unit 7d acquires an image frame f obtained by cutting out a region including the subject from each image frame f of the subject existing moving image M1 including a plurality of image frames f,. The moving image data of the subject cutout moving image M2 is generated.

また、画像処理部7は、動き検出部6により検出された被写体切り抜き動画像M2の動画像データを構成する各画像フレームにおける被写体の動きの方向が略等しいか否かを判定する動き判定部7eを具備している。
具体的には、動き判定部7eは、動き検出部6から複数の画像フレームg、…の動きベクトルを取得して、当該動きベクトルの大きさが所定の閾値以上であるか否かに応じて被写体の動きの量が所定の閾値値以上であるか否かを判定する。そして、被写体の動きの量が所定の閾値以上であると判定した場合に、動き判定部7eは、隣り合う画像フレームg間での動きベクトルが略一致するか否かに応じて被写体の動きの方向が略等しいか否かを判定する。例えば、ソリに乗った人が雪上(地表)を所定の一方向に滑る場合(図3(a)〜図3(e)参照)、各画像フレームgの動きベクトルは、所定の一方向(例えば、左斜め下方向)と略等しくなる(図4(a)〜図4(e)参照)。なお、動きベクトルの方向の判定は、厳密にする必要はなく、例えば、図4(b)及び図4(c)における動きベクトルと、図4(d)及び図4(e)における動きベクトルとはわずかに方向がずれているが、その差がわずかな角度であれば所定の一方向(例えば、左斜め下方向)と略等しいと判断するようにしても良い。
In addition, the image processing unit 7 determines whether or not the direction of movement of the subject in each image frame constituting the moving image data of the subject cutout moving image M2 detected by the motion detection unit 6 is substantially equal. It has.
Specifically, the motion determination unit 7e acquires motion vectors of a plurality of image frames g,... From the motion detection unit 6, and depending on whether the magnitude of the motion vector is equal to or greater than a predetermined threshold value. It is determined whether or not the amount of movement of the subject is equal to or greater than a predetermined threshold value. Then, when it is determined that the amount of movement of the subject is equal to or greater than the predetermined threshold, the motion determination unit 7e determines whether the motion of the subject is in accordance with whether or not the motion vectors between adjacent image frames g are substantially the same. It is determined whether the directions are substantially equal. For example, when a person on a sled slides on the snow (the ground surface) in a predetermined direction (see FIGS. 3A to 3E), the motion vector of each image frame g has a predetermined direction (for example, , Obliquely downward to the left) (see FIGS. 4A to 4E). The direction of the motion vector need not be strictly determined. For example, the motion vector in FIGS. 4B and 4C, the motion vector in FIGS. 4D and 4E, However, if the difference is a slight angle, it may be determined that the direction is substantially equal to a predetermined one direction (for example, diagonally downward to the left).

また、画像処理部7は、被写体切り抜き動画像M2と背景用画像P1とを合成する画像合成部7fを具備している。具体的には、画像合成部7fは、記録媒体8からユーザ所望の背景用画像P1を取得して、当該背景用画像P1の各画素のうち、アルファ値が0の画素は透過させ、アルファ値が1の画素は被写体切り抜き動画像M2の対応する画素の画素値で上書きし、さらに、背景用画像P1の各画素のうち、アルファ値が0<α<1の画素は1の補数(1−α)を用いて被写体領域Sを切り抜いた画像(背景用画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き動画像M2を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き動画像M2から減算し、それを被写体領域Sを切り抜いた画像(背景用画像×(1−α))と合成する。
また、画像合成部7fは、複数の画像フレームg、…からなる被写体切り抜き動画像M2の各画像フレームgを指定された所定の画像を背景用画像P1として合成する。
The image processing unit 7 includes an image composition unit 7f that synthesizes the subject cutout moving image M2 and the background image P1. Specifically, the image composition unit 7f acquires a user-desired background image P1 from the recording medium 8, and transmits pixels with an alpha value of 0 among the pixels of the background image P1 to obtain an alpha value. Is overwritten with the pixel value of the corresponding pixel of the subject cutout moving image M2, and among the pixels of the background image P1, the pixel with an alpha value of 0 <α <1 is a 1's complement (1- An image (background image × (1−α)) obtained by clipping the subject area S using α) is generated, and then a subject cutout moving image M2 is generated using 1's complement (1−α) in the alpha map. At this time, a value blended with a single background color is calculated, and the value is subtracted from the subject cutout moving image M2, and is combined with an image obtained by cutting out the subject region S (background image × (1-α)).
In addition, the image composition unit 7f synthesizes a predetermined image as the background image P1 with each image frame g of the subject cutout moving image M2 composed of a plurality of image frames g,.

また、画像合成部7fは、被写体切り抜き動画像M2を構成する各画像フレームgの背景用画像P1に対する合成を制御する合成制御部7gを具備している。即ち、画像合成部7fは、合成制御部7gの制御下にて、動き検出部6により検出された各画像フレームgの動きベクトルを基準として、被写体を再生時間の経過に伴って異なる位置に加算表示させるように被写体切り抜き動画像M2と背景用画像P1とを合成する。
具体的には、合成制御部7gは、動き判定部7eにより被写体切り抜き動画像M2の動画像データを構成する複数の画像フレームg、…における被写体の動きの量が所定の閾値以上で、且つ、動きの方向が略等しいと判定された場合に、複数の画像フレームg、…中の被写体を再生時間の経過に伴って異なる位置に加算表示させるように複数の被写体を静止画像に対して画像合成部7fにより加算して複数の画像フレームg、…からなる合成動画を生成させる加算合成処理を行う。
即ち、合成制御部7gは、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、最初の画像フレームg1と背景用の静止画像として指定された静止画像とをアルファマップを用いて画像合成部7fに生成させた後、当該静止画像に最初の画像フレームg1の被写体が合成された画像h1(図9(a)参照)を背景用の静止画像として指定して、この画像h1に対して被写体切り抜き動画像M2を構成する次(二番目)の画像フレームg2の被写体を加算表示させるように次の画像フレームg2のアルファマップを用いて画像合成部7fに生成させる。これにより、当該静止画像に最初の画像フレームg1の被写体が合成された画像h1(図9(a)参照)に次の画像フレームg2の被写体が加算合成された画像(図示略)が生成される。上記の処理を被写体切り抜き動画像M2を構成する全ての画像フレームgについて繰り返し行うことで、例えば、図9(a)〜図9(d)に示すように、奥側から手前側に滑る人が再生時間の経過に伴って次第に重畳(加算)されていくような複数の画像フレームh、…からなる合成動画が生成される。
なお、被写体の加算表示は、重畳されたものに限られるものではなく、再生時間の経過に伴って被写体の数が増加するような表示であれば良く、例えば、複数の被写体が所定間隔を空けて配置される表示であっても良い。
Further, the image composition unit 7f includes a composition control unit 7g that controls composition of each image frame g constituting the subject cutout moving image M2 with the background image P1. That is, the image composition unit 7f adds the subject to a different position as the playback time elapses with reference to the motion vector of each image frame g detected by the motion detection unit 6 under the control of the composition control unit 7g. The subject cutout moving image M2 and the background image P1 are combined so as to be displayed.
Specifically, the composition control unit 7g has the motion amount of the subject in the plurality of image frames g,... Constituting the moving image data of the subject cutout moving image M2 by the motion determination unit 7e greater than or equal to a predetermined threshold value, and When it is determined that the directions of movement are substantially equal, the plurality of subjects are combined with the still image so that the subjects in the plurality of image frames g,... Are added and displayed at different positions as the playback time elapses. Addition processing is performed to generate a composite moving image including a plurality of image frames g,.
That is, the composition control unit 7g uses the alpha map for the first image frame g1 and the still image designated as the background still image among the plurality of image frames g,... Constituting the subject cutout moving image M2. After generating the image composition unit 7f, an image h1 (see FIG. 9A) in which the subject of the first image frame g1 is synthesized with the still image is designated as a background still image. On the other hand, the image synthesizing unit 7f is generated using the alpha map of the next image frame g2 so that the subject of the next (second) image frame g2 constituting the subject cutout moving image M2 is added and displayed. Thus, an image (not shown) is generated by adding and synthesizing the subject of the next image frame g2 to the image h1 (see FIG. 9A) in which the subject of the first image frame g1 is synthesized with the still image. . By repeating the above processing for all the image frames g constituting the subject cutout moving image M2, for example, as shown in FIGS. 9A to 9D, a person slipping from the back side to the front side can be obtained. A composite moving image including a plurality of image frames h,... That is gradually superimposed (added) as the playback time elapses is generated.
Note that the subject addition display is not limited to the superimposed display, and may be any display in which the number of subjects increases as the playback time elapses. For example, a plurality of subjects are spaced at a predetermined interval. Display may be arranged.

また、合成制御部7gは、動き判定部7eにより被写体切り抜き動画像M2の動画像データを構成する複数の画像フレームgにおける被写体の動きの量が所定の閾値以上、又は、動きの方向が略等しくないと判定された場合に、当該複数の画像フレームgの各々を背景用の静止画像として指定された静止画像に対して画像合成部7fによりそれぞれ合成させる通常合成処理を行う。
即ち、例えば、図11(a)〜図11(d)に示すように、人が所定位置から動かずに腕を上下に動かした場合、動きベクトル(図示略)が右斜め上(図11(b)参照)から右斜め下(図11(c)参照)、さらに、左斜め下(図11(d)参照)とばらばらに変化する。このような場合に、加算合成処理を行うと、腕が千手観音のような状態となって見苦しい画像となることから、各画像フレームgと背景用画像P1とを合成して合成動画を構成する画像フレームiを個別に生成する。
In addition, the composition control unit 7g has the motion amount of the subject in the plurality of image frames g constituting the moving image data of the subject clipped moving image M2 by the motion determination unit 7e, or the direction of the motion is substantially equal. If it is determined that there is no image, the image combining unit 7f performs normal combining processing for combining each of the plurality of image frames g with a still image designated as a background still image.
That is, for example, as shown in FIGS. 11 (a) to 11 (d), when a person moves his / her arm up and down without moving from a predetermined position, the motion vector (not shown) is diagonally upward (FIG. 11 ( b)) to the lower right (see FIG. 11 (c)) and further to the lower left (see FIG. 11 (d)). In such a case, if the addition synthesis process is performed, the arm becomes a state of a thousand-handed kannon, resulting in an unsightly image. Therefore, each image frame g and the background image P1 are synthesized to form a synthesized moving image. The image frame i to be generated is generated individually.

記録媒体8は、例えば、不揮発性メモリ(フラッシュメモリ)等により構成され、画像処理部7の符号化部(図示略)により符号化された背景用画像P1や被写体切り抜き動画像M2の画像データを記憶する。
被写体切り抜き動画像M2の画像データは、画像処理部7の位置情報生成部7cにより生成されたアルファマップと対応付けられて一ファイルで保存されている。
また、被写体切り抜き動画像M2が動画像の場合、例えば、所定の撮像フレームレートで撮像された連続した複数の画像フレームg、…(例えば、n枚の画像フレーム)、…からなる動画像データがMotion−JPEG形式で記録されている。なお、図4(a)〜図4(e)は、被写体切り抜き動画像M2の動画像データを構成する連続するn枚の画像フレームg1〜gnを模式的に表しており、これらの画像フレームg1〜gnを時間軸に沿って図4(a)〜図4(e)として表すものとする。
The recording medium 8 is composed of, for example, a nonvolatile memory (flash memory) or the like, and stores image data of the background image P1 and the subject cutout moving image M2 encoded by the encoding unit (not shown) of the image processing unit 7. Remember.
The image data of the subject cutout moving image M2 is stored in one file in association with the alpha map generated by the position information generation unit 7c of the image processing unit 7.
Further, when the subject cutout moving image M2 is a moving image, moving image data including a plurality of continuous image frames g,... (For example, n image frames) captured at a predetermined imaging frame rate, for example. It is recorded in the Motion-JPEG format. 4 (a) to 4 (e) schematically represent n consecutive image frames g1 to gn constituting the moving image data of the subject cutout moving image M2, and these image frames g1. ˜gn is expressed as FIG. 4A to FIG. 4E along the time axis.

表示制御部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による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示したり、本撮像画像として撮像されたレックビュー画像を表示する。   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 generated by imaging an object by the imaging 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、撮像モードや機能等の選択指示や被写体切り抜き動画像M2の初期合成位置の設定指示に係る選択決定ボタン11b、ズーム量の調整指示に係るズームボタン(図示略)等を備え、これらのボタンの操作に応じて所定の操作信号をCPU12に出力する。   The operation input unit 11 is for performing a predetermined operation of the imaging apparatus 100. Specifically, the operation input unit 11 includes a shutter button 11a related to a subject photographing instruction, a selection instruction 11b related to a selection instruction of an imaging mode, a function, and the like, and an instruction to set an initial composite position of the subject cutout moving image M2. A zoom button (not shown) or the like related to an amount adjustment instruction is 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(a)〜図3(e)は、被写体切り抜き処理に係る被写体存在動画像M1の一例を模式的に示す図であり、図4(a)〜図4(e)は、被写体切り抜き処理に係る被写体切り抜き動画像M2の一例を模式的に示す図である。
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. FIGS. 3A to 3E are diagrams schematically showing an example of the subject presence moving image M1 related to the subject clipping process, and FIGS. 4A to 4E are views of the subject. It is a figure which shows typically an example of the to-be-photographed object moving image M2 which concerns on a clipping process.

被写体切り抜き処理は、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から被写体切り抜きモードが選択指示された場合に実行される処理である。
なお、以下に説明する被写体切り抜き処理にあっては、被写体存在動画像M1として被写体を所定の撮像フレームレートで撮像して複数の画像フレームからなる動画像(被写体存在動画像M1)を生成し、当該動画像の各画像フレームfから被写体領域Sが抽出された動画像(被写体切り抜き動画像M2)を生成するものとする。
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.
In the subject clipping process described below, the subject is captured as a subject existing moving image M1 at a predetermined imaging frame rate to generate a moving image (subject present moving image M1) including a plurality of image frames. Assume that a moving image (subject cutout moving image M2) in which the subject region S is extracted from each image frame f of the moving image is generated.

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

次に、CPU12は、ユーザによる操作入力部11のシャッタボタン11aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS2)。ここで、撮像指示が入力されたと判定されると(ステップS2;YES)、CPU12は、撮像制御部3に、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、被写体存在動画像M1(図3(a)〜図3(e)参照)の光学像を所定の条件で電子撮像部2により所定の撮像フレームレートで撮像させて、画像データ生成部4に、電子撮像部2から転送された被写体存在動画像M1の各画像フレームfのYUVデータを生成させる(ステップS4)。なお、当該被写体存在動画像M1の各画像フレームfのYUVデータは、画像メモリ5に一時記憶される。
また、CPU12は、撮像制御部3を制御して、当該被写体存在動画像M1の撮像の際の合焦位置や露出条件やホワイトバランス等の条件を固定した状態を維持する。
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 presence moving image M1 (see FIGS. 3A to 3E) is captured by the electronic imaging unit 2 at a predetermined imaging frame rate under predetermined conditions. Then, the image data generation unit 4 generates YUV data of each image frame f of the subject existing moving image M1 transferred from the electronic imaging unit 2 (step S4). The YUV data of each image frame f of the subject existing moving image M1 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 moving image M1 are fixed.

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

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

次に、CPU12は、位置合わせ部7aに、算出された射影変換行例に基づいて、対応する被写体存在動画像M1の各画像フレームfを射影変換させることで、被写体存在動画像M1の各画像フレームfのYUVデータと被写体非存在画像のYUVデータとを位置合わせする処理を行わせる(ステップS8)。   Next, the CPU 12 causes the alignment unit 7a to perform projective conversion of each image frame f of the corresponding subject existing moving image M1 based on the calculated projective conversion row example, thereby each image of the subject existing moving image M1. A process of aligning the YUV data of the frame f and the YUV data of the non-subject image is performed (step S8).

そして、CPU12は、画像処理部7の被写体領域抽出部7bに、被写体存在動画像M1の各画像フレームfから被写体が含まれる被写体領域Sを抽出する処理を行わせる(ステップS9)。
具体的には、被写体領域抽出部7bは、被写体存在動画像M1の各画像フレームfのYUVデータと被写体非存在画像のYUVデータの各々に対してローパスフィルタをかけて各画像の高周波成分を除去する。その後、被写体領域抽出部7bは、ローパスフィルタをかけた被写体存在動画像M1の各画像フレームfと被写体非存在画像との間で対応する各画素について相違度を算出して相違度マップを生成する。続けて、被写体領域抽出部7bは、各画素に係る相違度マップを所定の閾値で2値化した後、相違度マップから細かいノイズや手ぶれにより相違が生じた領域を除去するために収縮処理を行う。その後、被写体領域抽出部7bは、ラベリング処理を行って、所定値以下の領域や最大領域以外の領域を除去した後、一番大きな島のパターンを被写体領域Sとして特定し、収縮分を修正するための膨張処理を行う。
Then, the CPU 12 causes the subject region extraction unit 7b of the image processing unit 7 to perform processing for extracting the subject region S including the subject from each image frame f of the subject presence moving image M1 (step S9).
Specifically, the subject region extraction unit 7b applies a low-pass filter to each of the YUV data of each image frame f of the subject presence moving image M1 and the YUV data of the subject nonexistence image to remove high frequency components of each image. To do. Thereafter, the subject area extraction unit 7b calculates a difference for each corresponding pixel between each image frame f of the subject existing moving image M1 subjected to the low-pass filter and the subject non-existing image, 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の被写体存在動画像M1の各画像フレームf内での位置を示すアルファマップを生成させる(ステップ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 image frame f of the subject existing moving image M1 (step S10). .

その後、CPU12は、画像処理部7の切抜画像生成部7dに、被写体切り抜き動画像M2の各画像フレームg内の被写体の画像を所定の単一色画像と合成した被写体切り抜き動画像M2(図4(a)〜図4(e)参照)の各画像フレームgの画像データを生成する処理を行わせる(ステップS11)。
具体的には、切抜画像生成部7dは、被写体存在動画像M1の各画像フレームf、単一色画像及びアルファマップを読み出して画像メモリ5に展開した後、被写体存在動画像M1の各画像フレームfの全ての画素について、アルファ値が0の画素については(α=0)、透過させ、アルファ値が0<α<1の画素については(0<α<1)、所定の単一色とブレンディングを行い、アルファ値が1の画素については(α=1)、何もせずに所定の単一色に対して透過させないようにする。
Thereafter, the CPU 12 causes the cutout image generation unit 7d of the image processing unit 7 to combine the subject image in each image frame g of the subject cutout moving image M2 with a predetermined single color image M2 (FIG. 4 ( A process of generating image data of each image frame g in FIGS. 4A to 4E) is performed (step S11).
Specifically, the cut-out image generation unit 7d reads out each image frame f, single color image, and alpha map of the subject existing moving image M1 and develops them in the image memory 5, and then each image frame f of the subject existing moving image M1. For all of the pixels, alpha pixels with a zero value (α = 0) are transmitted, and pixels with an alpha value of 0 <α <1 (0 <α <1), a predetermined single color and blending are performed. For pixels with an alpha value of 1 (α = 1), nothing is done so as not to transmit a predetermined single color.

その後、CPU12は、記録媒体8の所定の記憶領域に、画像処理部7の位置情報生成部7cにより生成されたアルファマップと被写体切り抜き動画像M2の各画像フレームgの画像データを対応付けて一ファイルで記憶させる(ステップS12)。
これにより、被写体切り抜き処理を終了する。この結果、例えば、所定の背景内から雪上をソリで滑る人が被写体として抽出された被写体切り抜き動画像M2の画像データが生成される。
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 each image frame g of the subject cutout moving image M2 in a predetermined storage area of the recording medium 8. The file is stored (step S12).
Thereby, the subject clipping process is completed. As a result, for example, image data of a subject cutout moving image M2 in which a person who slides on a snow with a sled from a predetermined background is extracted as a subject is generated.

次に、撮像装置100による背景用画像生成処理について、図5を参照して説明する。
図5は、背景用画像生成処理に係る動作の一例を示すフローチャートである。
背景用画像生成処理は、通常の静止画像の撮像処理であり、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から静止画撮像モードが選択指示された場合に実行される処理である。
Next, background image generation processing by the imaging apparatus 100 will be described with reference to FIG.
FIG. 5 is a flowchart illustrating an example of an operation related to the background image generation processing.
The background image generation process is a normal still image imaging process, and a still image 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 an imaging mode selection instruction is given.

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

次に、CPU12は、ユーザによる操作入力部11のシャッタボタン11aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS22)。ここで、撮像指示が入力されたと判定されると(ステップS22;YES)、CPU12は、撮像制御部3に、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、背景用画像P1(図9(a)等参照)の光学像を所定の条件で電子撮像部2により撮像させる(ステップS23)。   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 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 background image P1 (see FIG. 9A, etc.) is picked up by the electronic image pickup unit 2 under predetermined conditions (step S23).

続けて、CPU12は、画像データ生成部4に、電子撮像部2から転送された背景用画像P1の画像フレームのYUVデータを生成させた後、記録媒体8の所定の記憶領域に、背景用画像P1のYUVデータをExif形式の画像ファイルとして記憶させる(ステップS24)。
これにより、背景用画像P1生成処理を終了する。この結果、例えば、市街地が記録された背景用画像P1の静止画像データが生成される。
Subsequently, the CPU 12 causes the image data generation unit 4 to generate the YUV data of the image frame of the background image P1 transferred from the electronic imaging unit 2, and then the background image is stored in a predetermined storage area of the recording medium 8. The P1 YUV data is stored as an Exif format image file (step S24).
Thus, the background image P1 generation process is terminated. As a result, for example, still image data of the background image P1 in which the city area is recorded is generated.

次に、合成画像生成処理について図6〜図11を参照して詳細に説明する。
図6は、合成画像生成処理に係る動作の一例を示すフローチャートである。また、図7は、合成判定処理に係る動作の一例を示すフローチャートである。また、図8は、加算合成処理に係る動作の一例を示すフローチャートであり、図9(a)〜図9(d)は、加算合成処理にて画像合成される被写体合成動画像M3の一例を模式的に示す図である。また、図10は、通常合成処理に係る動作の一例を示すフローチャートであり、図11(a)〜図11(d)は、通常合成処理にて画像合成される被写体合成動画像M4の一例を模式的に示す図である。
Next, the composite image generation process will be described in detail with reference to FIGS.
FIG. 6 is a flowchart illustrating an example of an operation related to the composite image generation process. FIG. 7 is a flowchart illustrating an example of an operation related to the synthesis determination process. FIG. 8 is a flowchart showing an example of the operation related to the addition synthesis process, and FIGS. 9A to 9D show an example of the subject synthesis moving image M3 synthesized by the addition synthesis process. It is a figure shown typically. FIG. 10 is a flowchart showing an example of the operation related to the normal synthesis process, and FIGS. 11A to 11D show an example of the subject synthesized moving image M4 synthesized in the normal synthesis process. It is a figure shown typically.

合成画像生成処理は、ユーザによる操作入力部11の選択決定ボタン11bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から画像合成モードが選択指示された場合に実行される処理である。
図6に示すように、CPU12は、先ず、合成処理の内容を判定する合成判定処理を動き検出部6及び画像処理部7に実行させる(ステップS31)。
The composite image generation process is executed when an image combination 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, the CPU 12 first causes the motion detection unit 6 and the image processing unit 7 to execute a synthesis determination process for determining the content of the synthesis process (step S <b> 31).

ここで、合成判定処理について図7を参照して詳細に説明する。
図7に示すように、ユーザによる操作入力部11の所定操作に基づいて、記録媒体8に記録されている複数の画像の中で所望の被写体切り抜き動画像M2(図4(a)〜図4(e)参照)が選択して指定されると、動き検出部6は、指定された被写体切り抜き動画像M2の画像データを読み出して画像メモリ5に展開する(ステップS41)。
Here, the synthesis determination process will be described in detail with reference to FIG.
As shown in FIG. 7, a desired subject cutout moving image M2 (FIGS. 4A to 4) 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. When (see (e)) is selected and designated, the motion detection unit 6 reads out the image data of the designated subject cutout moving image M2 and develops it in the image memory 5 (step S41).

次に、動き検出部6は、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、処理対象に係る最初の画像フレームg1のフレーム番号として「1」を指定すると(ステップS42)、指定されたフレーム番号「1」の画像フレームg1及び当該画像フレームg1と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開する(ステップS43)。
続けて、動き検出部6は、読み出した画像フレームg1からアルファマップを用いて被写体領域Sを特定して被写体を抽出する(ステップS44)。
Next, the motion detection unit 6 designates “1” as the frame number of the first image frame g1 related to the processing object among the plurality of image frames g,... Constituting the subject cutout moving image M2 (step S42). Then, the image frame g1 having the designated frame number “1” and the alpha map stored in association with the image frame g1 are read out and developed in the image memory 5 (step S43).
Subsequently, the motion detection unit 6 identifies the subject region S using the alpha map from the read image frame g1 and extracts the subject (step S44).

次に、動き検出部6は、読み出した画像フレームg1よりも前の画像フレームgから抽出された被写体があるか否かを判定する(ステップS45)。ここで、ステップS43にて読み出した画像フレームgが最初の画像フレームg1であるので、前の画像フレームgの被写体がないと判定されると(ステップS45;NO)、動き検出部6は、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、処理対象となる次の画像フレームg2に係るフレーム番号を+1インクリメントして指定する(ステップS46)。これにより、二番目の画像フレームg2が合成判定処理の対象として指定される。
そして、動き検出部6は、処理をステップS43に移行させて、それ以降の処理を実行する。これにより、動き検出部6は、指定されたフレーム番号「2」の画像フレームg2及び当該画像フレームg2と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開して(ステップS43)、読み出した画像フレームg2からアルファマップを用いて被写体領域Sを特定して被写体を抽出する(ステップS44)。
Next, the motion detection unit 6 determines whether there is a subject extracted from the image frame g before the read image frame g1 (step S45). Here, since the image frame g read in step S43 is the first image frame g1, if it is determined that there is no subject of the previous image frame g (step S45; NO), the motion detection unit 6 Among the plurality of image frames g,... Constituting the cutout moving image M2, the frame number relating to the next image frame g2 to be processed is specified by incrementing by +1 (step S46). As a result, the second image frame g2 is designated as the target of the synthesis determination process.
Then, the motion detection unit 6 shifts the processing to step S43 and executes the subsequent processing. As a result, the motion detection unit 6 reads out the image frame g2 of the designated frame number “2” and the alpha map stored in association with the image frame g2 and develops them in the image memory 5 (step S43). Then, the subject region S is specified from the read image frame g2 using the alpha map, and the subject is extracted (step S44).

そして、ステップS45にて、前の画像フレームgの被写体があると判定されると(ステップS45;YES)、動き検出部6は、二番目の画像フレームg2から抽出された被写体について、当該被写体から特徴抽出処理にて抽出されたテンプレートが最初の画像フレームg1から抽出された被写体のどこに対応するかを探索して動きベクトルを算出する(ステップS47)。   When it is determined in step S45 that there is a subject of the previous image frame g (step S45; YES), the motion detection unit 6 determines the subject extracted from the second image frame g2 from the subject. A motion vector is calculated by searching where the template extracted in the feature extraction process corresponds to the subject extracted from the first image frame g1 (step S47).

次に、画像処理部7の動き判定部7eは、動き検出部6から動きベクトルを取得して、当該動きベクトルの大きさが所定の閾値以上であるか否かに応じて被写体の動きの量が所定の閾値値以上であるか否かを判定する(ステップS48)。
ここで、被写体の動きの量が所定の閾値以上であると判定されると(ステップS48;YES)、動き判定部7eは、前の画像フレームgの被写体の動きベクトルがあるか否かを判定する(ステップS49)。
Next, the motion determination unit 7e of the image processing unit 7 acquires a motion vector from the motion detection unit 6, and the amount of motion of the subject depending on whether the magnitude of the motion vector is equal to or greater than a predetermined threshold value. Is greater than or equal to a predetermined threshold value (step S48).
If it is determined that the amount of movement of the subject is equal to or greater than the predetermined threshold (step S48; YES), the motion determination unit 7e determines whether there is a motion vector of the subject in the previous image frame g. (Step S49).

ステップS49にて、ステップS43にて読み出した画像フレームgが二番目の画像フレームg2であるので、前の画像フレームgの被写体の動きベクトルがないと判定されると(ステップS49;NO)、動き判定部7eは、処理をステップS46に移行させて、それ以降の処理を実行する。これにより、三番目の画像フレームg3が合成判定処理の対象として指定される。
そして、二番目の画像フレームg2と同様の処理を経て当該三番目の画像フレームg3の被写体の動きベクトルが算出された後(ステップS47)、ステップS49にて、前の画像フレームg(例えば、二番目の画像フレームg2)の被写体の動きベクトルがあると判定されると(ステップS49;YES)、動き判定部7eは、二番目の画像フレームg2と三番目の画像フレームg3との間で被写体の動きベクトルが略一致するか否かに応じて被写体の動きの方向が略等しいか否かを判定する(ステップS50)。
In step S49, since the image frame g read in step S43 is the second image frame g2, if it is determined that there is no motion vector of the subject in the previous image frame g (step S49; NO), the motion The determination unit 7e shifts the process to step S46 and executes the subsequent processes. As a result, the third image frame g3 is designated as the target of the synthesis determination process.
After the same processing as that for the second image frame g2, the motion vector of the subject of the third image frame g3 is calculated (step S47), and then in step S49, the previous image frame g (for example, the second image frame g2) When it is determined that there is a motion vector of the subject in the second image frame g2) (step S49; YES), the motion determination unit 7e determines the subject between the second image frame g2 and the third image frame g3. It is determined whether or not the direction of movement of the subject is substantially equal depending on whether or not the motion vectors substantially match (step S50).

ここで、被写体の動きの方向が略等しいと判定されると(ステップS50;YES)、動き判定部7eは、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、合成判定処理の対象となる次の画像フレームgがあるか否かを判定する(ステップS51)。ここで、次の画像フレームg、例えば、四番目の画像フレームg4があると判定されると(ステップS51;YES)、動き判定部7eは、処理をステップS45に移行させて、それ以降の処理を実行する。
これにより、四番目の画像フレームg4が合成判定処理の対象として指定される。
Here, if it is determined that the direction of movement of the subject is substantially equal (step S50; YES), the motion determination unit 7e performs a composite determination process among a plurality of image frames g,... Constituting the subject cutout moving image M2. It is determined whether or not there is a next image frame g to be subjected to (step S51). Here, if it is determined that there is a next image frame g, for example, the fourth image frame g4 (step S51; YES), the motion determination unit 7e shifts the processing to step S45, and the subsequent processing. Execute.
As a result, the fourth image frame g4 is designated as the target of the synthesis determination process.

一方、ステップS48にて、被写体の動きの量が所定の閾値よりも小さいと判定されると(ステップS48;NO)、画像処理部7の合成制御部7gは、画像合成処理として、被写体切り抜き動画像M2を構成する複数の画像フレームg、…の各々を背景用画像P1に対してそれぞれ合成する通常合成処理を設定する(ステップS52)。
また、ステップS50にて、被写体の動きの方向が略等しくないと判定されると(ステップS50;NO)、画像処理部7の合成制御部7gは、処理をステップS52に移行させて、画像合成処理として、通常合成処理を設定する(ステップS52)。
On the other hand, if it is determined in step S48 that the amount of movement of the subject is smaller than the predetermined threshold (step S48; NO), the composition control unit 7g of the image processing unit 7 performs subject cropping video as image composition processing. A normal combining process for combining each of the plurality of image frames g,... Constituting the image M2 with the background image P1 is set (step S52).
If it is determined in step S50 that the direction of movement of the subject is not substantially equal (step S50; NO), the composition control unit 7g of the image processing unit 7 shifts the process to step S52 to perform image composition. As a process, a normal composition process is set (step S52).

そして、上記の処理がステップS51にて次の画像フレームgがないと判定されるまで(ステップS51;NO)、繰り返されると、即ち、二番目以降の全ての画像フレームgについて被写体の動きの量が所定の閾値以上で、且つ、動きの方向が略等しい場合、画像処理部7の合成制御部7gは、画像合成処理として、複数の被写体を静止画像に対して加算して複数の画像フレームh、…からなる合成動画を生成する加算合成処理を設定する(ステップS53)。
これにより、合成判定処理を終了する。
If the above process is repeated until it is determined in step S51 that there is no next image frame g (step S51; NO), that is, the amount of movement of the subject for all the second and subsequent image frames g. Is equal to or greater than a predetermined threshold value and the direction of motion is substantially equal, the composition control unit 7g of the image processing unit 7 adds a plurality of subjects to the still image as a plurality of image frames h as an image composition process. ,... Are set (step S53).
As a result, the combination determination process is terminated.

図5に示すように、次に、CPU12は、合成判定処理の判定結果に応じて処理を分岐させる(ステップS32)。
具体的には、CPU12は、合成判定処理の結果として加算合成処理が設定されている場合には(ステップS32;加算合成)、画像合成部7fに加算合成処理を実行させ(ステップS33)、一方、合成判定処理の結果として通常合成処理が設定されている場合には(ステップS32;通常合成)、画像合成部7fに通常合成処理を実行させる(ステップS34)。
As shown in FIG. 5, next, the CPU 12 branches the process according to the determination result of the synthesis determination process (step S32).
Specifically, when the addition combination process is set as a result of the combination determination process (step S32; addition combination), the CPU 12 causes the image composition unit 7f to execute the addition combination process (step S33). When the normal composition process is set as a result of the composition determination process (step S32; normal composition), the image composition unit 7f is caused to execute the normal composition process (step S34).

ここで、加算合成処理について図8及び図9を参照して詳細に説明する。
図8に示すように、ユーザによる操作入力部12の所定操作に基づいて、記録媒体8に記録されている複数の画像の中で合成画像の背景となる所望の背景用画像P1(図9(a)参照)が選択して指定されると、画像処理部7は、指定された背景用画像P1の画像データを読み出して画像メモリ5に展開する(ステップS61)。
Here, the addition synthesis process will be described in detail with reference to FIGS.
As shown in FIG. 8, based on a predetermined operation of the operation input unit 12 by the user, a desired background image P <b> 1 that becomes the background of the composite image among a plurality of images recorded on the recording medium 8 (FIG. 9 ( When a) (see a) is selected and designated, the image processing unit 7 reads out the image data of the designated background image P1 and develops it in the image memory 5 (step S61).

次に、画像合成部7fの合成制御部7gは、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、処理対象に係る最初の画像フレームh1のフレーム番号として「1」を指定すると(ステップS62)、指定されたフレーム番号「1」の画像フレームg1及び当該画像フレームg1と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開する(ステップS63)。   Next, the composition control unit 7g of the image composition unit 7f designates “1” as the frame number of the first image frame h1 related to the processing target among the plurality of image frames g,... Constituting the subject cutout moving image M2. Then (step S62), the image frame g1 of the designated frame number “1” and the alpha map stored in association with the image frame g1 are read and developed in the image memory 5 (step S63).

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

続けて、画像合成部7fは、背景用画像P1の全ての画素について処理したか否かを判定する(ステップS68)。
ここで、全ての画素について処理していないと判定されると(ステップS68;NO)、画像合成部7fは、処理対象として次の画素を指定して当該画素に処理対象を移動させて(ステップS69)、処理をステップS65に移行させる。
上記の処理を、ステップS68にて全ての画素について処理したと判定されるまで(ステップS68;YES)、繰り返すことで、画像合成部7fは、被写体切り抜き動画像M2の画像フレームg1と背景用画像P1とを合成した被写体合成動画像M3の合成動画を構成する最初の画像フレームh1(図9(a)参照)を生成する。
Subsequently, the image composition unit 7f determines whether or not all the pixels of the background image P1 have been processed (step S68).
If it is determined that all the pixels have not been processed (step S68; NO), the image composition unit 7f designates the next pixel as a processing target and moves the processing target to the pixel (step S68). (S69) The process proceeds to step S65.
By repeating the above processing until it is determined in step S68 that all pixels have been processed (step S68; YES), the image composition unit 7f allows the image frame g1 and the background image of the subject cutout moving image M2 to be processed. A first image frame h1 (see FIG. 9A) constituting a synthesized moving image of the subject synthesized moving image M3 synthesized with P1 is generated.

そして、ステップS68にて全ての画素について処理したと判定されると(ステップS68;YES)、合成制御部7gは、被写体切り抜き動画像M2を構成する全ての画像フレームgについて処理したか否かを判定する(ステップS70)。
ここで、全ての画像フレームgについて処理していないと判定されると(ステップS70;NO)、合成制御部7gは、生成された合成動画を構成する最初の画像フレームh1を背景用の静止画像として指定した後(ステップS71)、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、処理対象となる次の画像フレームgに係るフレーム番号を+1インクリメントして指定する(ステップS72)。これにより、二番目の画像フレームg2が画像合成処理の対象として指定される。
If it is determined in step S68 that all the pixels have been processed (step S68; YES), the composition control unit 7g determines whether all the image frames g constituting the subject cutout moving image M2 have been processed. Determine (step S70).
If it is determined that all the image frames g have not been processed (step S70; NO), the composition control unit 7g uses the first image frame h1 constituting the generated composition video as a background still image. (Step S71), among the plurality of image frames g,... Constituting the subject cutout moving image M2,..., The frame number relating to the next image frame g to be processed is incremented by 1 (step S72). ). As a result, the second image frame g2 is designated as the target of the image composition process.

次に、画像合成部7fは、処理をステップS63に移行させて、背景用の静止画像として指定された画像フレームh1の何れか一の画素(例えば、左上隅部の画素)を指定して、それ以降の処理(ステップS64〜S69)を行うことで、背景用の静止画像として指定された最初の画像フレームh1と被写体切り抜き動画像M2の二番目の画像フレームg2とを合成した被写体合成動画像M3の合成動画を構成する二番目の画像フレームを生成する。これにより、最初の画像フレームh1に対して被写体切り抜き動画像M2の二番目の画像フレームg2の被写体領域Sが加算合成された二番目の画像フレームが生成される。
そして、二番目の画像フレームの生成が完了することによって、ステップS68にて全ての画素について処理したと判定されると(ステップS68;YES)、処理をステップS70に移行させて、合成制御部7gは、被写体切り抜き動画像M2を構成する全ての画像フレームgについて処理したか否かを判定する(ステップS70)。
上記の処理を、全ての画像フレームgについて処理したと判定されるまで(ステップS70;YES)、繰り返すことで、画像合成部7fは、被写体合成動画像M3の合成動画を構成する全ての画像フレームh1〜hn(図9(a)〜図9(d)参照)を生成する。
これにより、加算合成処理を終了する。
Next, the image composition unit 7f shifts the process to step S63 to designate any one pixel (for example, the pixel at the upper left corner) of the image frame h1 designated as the background still image, By performing the subsequent processing (steps S64 to S69), the subject synthesized moving image obtained by synthesizing the first image frame h1 designated as the background still image and the second image frame g2 of the subject cutout moving image M2. A second image frame constituting the synthesized moving image of M3 is generated. As a result, a second image frame is generated in which the subject region S of the second image frame g2 of the subject cutout moving image M2 is added and synthesized to the first image frame h1.
If it is determined in step S68 that all the pixels have been processed by completing the generation of the second image frame (step S68; YES), the process proceeds to step S70, and the composition control unit 7g. Determines whether all image frames g constituting the subject cutout moving image M2 have been processed (step S70).
By repeating the above processing until it is determined that all image frames g have been processed (step S70; YES), the image composition unit 7f allows all image frames constituting the composite moving image of the subject composition moving image M3. h1 to hn (see FIGS. 9A to 9D) are generated.
Thereby, the addition synthesis process is terminated.

図5に示すように、その後、CPU12は、表示制御部9に、画像合成部7fにより生成された複数の画像フレームh、…からなる被写体合成動画像M3の合成動画の画像データに基づいて、各画像フレームhを所定の表示フレームレートで切り換えて表示部10の表示画面に再生表示させることで、再生時間の経過に伴って静止画像(背景用画像P1)の異なる位置に被写体としてのソリに乗った人が加算表示される被写体合成動画像M3の合成動画を再生する(ステップS35)。   As shown in FIG. 5, after that, the CPU 12 causes the display control unit 9 to generate the synthesized moving image M3 composed of a plurality of image frames h,... Each image frame h is switched at a predetermined display frame rate and reproduced and displayed on the display screen of the display unit 10, so that as the reproduction time elapses, the still image (background image P <b> 1) is changed to a sledge as a subject at a different position. A synthesized moving image of the subject synthesized moving image M3 on which the rider is added and displayed is reproduced (step S35).

次に、通常合成処理について図10及び図11を参照して詳細に説明する。
通常合成処理は、最初に指定された背景用画像P1と被写体切り抜き動画像M2を構成する全ての画像フレームとを合成する以外の点で加算合成処理と略同様の処理を行う。
即ち、図10に示すように、ユーザによる操作入力部12の所定操作に基づいて、記録媒体8に記録されている複数の画像の中で合成画像の背景となる所望の背景用画像P1(図11(a)参照)が選択して指定されると、画像処理部7は、指定された背景用画像P1の画像データを読み出して画像メモリ5に展開する(ステップS81)。
Next, the normal synthesis process will be described in detail with reference to FIGS.
The normal synthesis process is substantially the same as the addition synthesis process except that the background image P1 specified first and all the image frames constituting the subject cutout moving image M2 are synthesized.
That is, as shown in FIG. 10, based on a predetermined operation of the operation input unit 12 by the user, a desired background image P1 (FIG. 10) that becomes the background of the composite image among a plurality of images recorded on the recording medium 8. 11 (a)) is selected and designated, the image processing unit 7 reads the image data of the designated background image P1 and develops it in the image memory 5 (step S81).

次に、画像合成部7fの合成制御部7gは、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、処理対象に係る最初の画像フレームg1のフレーム番号として「1」を指定すると(ステップS82)、指定されたフレーム番号「1」の画像フレームg1及び当該画像フレームg1と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開する(ステップS83)。   Next, the composition control unit 7g of the image composition unit 7f designates “1” as the frame number of the first image frame g1 related to the processing object among the plurality of image frames g,... Constituting the subject cutout moving image M2. Then (step S82), the image frame g1 of the designated frame number “1” and the alpha map stored in association with the image frame g1 are read out and developed in the image memory 5 (step S83).

次に、画像合成部7fは、背景用画像P1の何れか一の画素(例えば、左上隅部の画素)を指定して(ステップS84)、当該画素について、アルファマップのアルファ値に基づいて処理を分岐させる(ステップS85)。具体的には、画像合成部7fは、背景用画像P1の何れか一の画素のうち、アルファ値が1の画素については(ステップS85;α=1)、被写体切り抜き動画像M2の画像フレームg1の対応する画素の画素値で上書きし(ステップS86)、アルファ値が0<α<1の画素については(ステップS85;0<α<1)、1の補数(1−α)を用いて被写体領域Sを切り抜いた画像(背景用画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き動画像M2を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き動画像M2の画像フレームg1から減算し、それを被写体領域Sを切り抜いた画像(背景用画像×(1−α))と合成し(ステップS87)、アルファ値が0の画素については(ステップS85;α=0)、何もせずに背景用画像P1を透過さるようにする。   Next, the image composition unit 7f designates any one pixel (for example, the pixel at the upper left corner) of the background image P1 (step S84), and processes the pixel based on the alpha value of the alpha map. Is branched (step S85). Specifically, the image composition unit 7f, for any one of the pixels of the background image P1, for the pixel having an alpha value of 1 (step S85; α = 1), the image frame g1 of the subject cutout moving image M2 Is overwritten with the pixel value of the corresponding pixel (step S86), and for the pixel whose alpha value is 0 <α <1 (step S85; 0 <α <1), the one's complement (1-α) is used to determine the subject. When an image (background image × (1−α)) obtained by cutting out the region S is generated and then the subject cutout moving image M2 is generated using the one's complement (1−α) in the alpha map, a single background color is generated. And the blended value is subtracted from the image frame g1 of the subject cutout moving image M2 and synthesized with the image obtained by cutting out the subject region S (background image × (1-α)) (step S87). ), Alpha value is 0 For iodine (Step S85; α = 0), so as monkey transmitting a background image P1 without doing anything.

続けて、画像合成部7fは、背景用画像P1の全ての画素について処理したか否かを判定する(ステップS88)。
ここで、全ての画素について処理していないと判定されると(ステップS88;NO)、画像合成部7fは、処理対象として次の画素を指定して当該画素に処理対象を移動させて(ステップS89)、処理をステップS85に移行させる。
上記の処理を、ステップS88にて全ての画素について処理したと判定されるまで(ステップS88;YES)、繰り返すことで、画像合成部7fは、被写体切り抜き動画像M2の画像フレームg1と背景用画像P1とを合成した被写体合成動画像M4の合成動画を構成する最初の画像フレームi1(図11(a)参照)を生成する。
Subsequently, the image composition unit 7f determines whether or not all the pixels of the background image P1 have been processed (step S88).
If it is determined that all the pixels have not been processed (step S88; NO), the image composition unit 7f designates the next pixel as the processing target and moves the processing target to the pixel (step S88). In step S89, the process proceeds to step S85.
By repeating the above processing until it is determined in step S88 that all pixels have been processed (step S88; YES), the image composition unit 7f allows the image frame g1 and the background image of the subject cutout moving image M2 to be processed. A first image frame i1 (see FIG. 11A) constituting a synthesized moving image of the subject synthesized moving image M4 synthesized with P1 is generated.

そして、ステップS88にて全ての画素について処理したと判定されると(ステップS88;YES)、合成制御部7gは、被写体切り抜き動画像M2を構成する全ての画像フレームgについて処理したか否かを判定する(ステップS90)。
ここで、全ての画像フレームgについて処理していないと判定されると(ステップS90;NO)、合成制御部7gは、被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、処理対象となる次の画像フレームgに係るフレーム番号を+1インクリメントして指定する(ステップS91)。これにより、二番目の画像フレームg2が画像合成処理の対象として指定される。
If it is determined in step S88 that all the pixels have been processed (step S88; YES), the composition control unit 7g determines whether all the image frames g constituting the subject cutout moving image M2 have been processed. Determination is made (step S90).
If it is determined that all image frames g have not been processed (step S90; NO), the composition control unit 7g performs processing among a plurality of image frames g,... Constituting the subject cutout moving image M2. The frame number related to the next image frame g as a target is designated by incrementing by +1 (step S91). As a result, the second image frame g2 is designated as the target of the image composition process.

次に、画像合成部7fは、処理をステップS83に移行させて、背景用画像P1の何れか一の画素(例えば、左上隅部の画素)を指定して、それ以降の処理(ステップS84〜S89)を行うことで、背景用画像P1と被写体切り抜き動画像M2の二番目の画像フレームg2とを合成した被写体合成動画像M4の合成動画を構成する二番目の画像フレームi2(図11(b)参照)を生成する。
そして、二番目の画像フレームi2の生成が完了することによって、ステップS88にて全ての画素について処理したと判定されると(ステップS88;YES)、処理をステップS90に移行させて、合成制御部7gは、被写体切り抜き動画像M2を構成する全ての画像フレームgについて処理したか否かを判定する(ステップS90)。
上記の処理を、全ての画像フレームgについて処理したと判定されるまで(ステップS90;YES)、繰り返すことで、画像合成部7fは、被写体合成動画像M4の合成動画を構成する全ての画像フレームg1〜gn(図11(a)〜図11(d)参照)を生成する。
これにより、通常合成処理を終了する。
Next, the image composition unit 7f shifts the processing to step S83, designates any one pixel (for example, the pixel in the upper left corner) of the background image P1, and performs subsequent processing (steps S84 to S84). By performing S89), the second image frame i2 (FIG. 11 (b)) that composes the synthesized moving image of the subject synthesized moving image M4 obtained by synthesizing the background image P1 and the second image frame g2 of the subject cutout moving image M2. ))).
If the generation of the second image frame i2 is completed and it is determined in step S88 that all the pixels have been processed (step S88; YES), the process proceeds to step S90, and the composition control unit In 7g, it is determined whether or not the processing has been performed for all the image frames g constituting the subject cutout moving image M2 (step S90).
By repeating the above processing until it is determined that all image frames g have been processed (step S90; YES), the image composition unit 7f allows all image frames constituting the composite moving image of the subject composite moving image M4. g1 to gn (see FIGS. 11A to 11D) are generated.
As a result, the normal synthesis process is terminated.

図5に示すように、その後、CPU12は、表示制御部9に、画像合成部7fにより生成された複数の画像フレームi、…からなる被写体合成動画像M4の合成動画の画像データに基づいて、各画像フレームiを所定の表示フレームレートで切り換えて表示部10の表示画面に再生表示させることで、背景用画像P1を背景として人が腕を上下動させる被写体合成動画像M4の合成動画を再生する(ステップS35)。   As shown in FIG. 5, after that, the CPU 12 causes the display control unit 9 to generate image data of the synthesized moving image of the subject synthesized moving image M4 including the plurality of image frames i generated by the image synthesizing unit 7f. Each image frame i is switched at a predetermined display frame rate and reproduced and displayed on the display screen of the display unit 10 to reproduce a synthesized moving image of the subject synthesized moving image M4 in which the person moves his / her arm up and down with the background image P1 as the background. (Step S35).

以上のように、本実施形態の撮像装置100によれば、合成画像生成処理に係る被写体切り抜き動画像M2における被写体の動きを動き検出部6により検出して、検出された被写体の動きを基準として、当該被写体を再生時間の経過に伴って背景用画像P1の異なる位置に加算表示させるように背景用画像P1と被写体切り抜き動画像M2とを画像合成部7fに合成させる。具体的には、被写体切り抜き動画像M2を構成する複数の画像フレームg、…中の被写体を背景用画像P1に対して画像合成部7fにより加算して複数の画像フレームh、…からなる被写体合成動画像M3の合成動画を生成する。
これにより、再生時間の経過に伴って背景用画像P1の異なる位置に被写体が加算表示されるように、背景用画像P1に対して被写体を斬新な態様で合成することができ、動画像を背景用画像P1に単に合成しただけではない興趣性の高い合成画像を生成することができる。
As described above, according to the imaging apparatus 100 of the present embodiment, the movement of the subject in the subject cutout moving image M2 related to the composite image generation process is detected by the motion detection unit 6, and the detected movement of the subject is used as a reference. The background image P1 and the subject cutout moving image M2 are combined by the image combining unit 7f so that the subject is added and displayed at different positions of the background image P1 as the reproduction time elapses. Specifically, a subject composition composed of a plurality of image frames h,... Is added by adding the subject in the plurality of image frames g,. A synthesized moving image of the moving image M3 is generated.
As a result, the subject can be combined with the background image P1 in a novel manner so that the subject is added and displayed at different positions of the background image P1 as the playback time elapses. It is possible to generate a highly interesting composite image that is not simply combined with the work image P1.

また、動き判定部7eにより被写体切り抜き動画像M2の各画像フレームgの被写体の動きの量が所定の閾値以上であり、且つ、被写体の動きの方向が略等しいと判定された場合に、被写体を再生時間の経過に伴って背景用画像P1の異なる位置に加算表示させるように画像合成部7fに合成させるので、被写体切り抜き動画像M2の被写体の動きを解析することで、自動的に被写体を加算合成することができる。これにより、当該撮像装置100の操作を熟知していなくとも背景用画像P1に対して被写体を斬新な態様で合成することができる。
なお、上記実施形態では、動き判定部7eによって少なくとも被写体切り抜き動画像M2の各画像フレームgの被写体の動きの方向が略等しいと判定された場合に、被写体を再生時間の経過に伴って背景用画像P1の異なる位置に加算表示させるように画像合成部7fに合成させれば良い。しかしながら、被写体の動きの量が所定の閾値よりも小さい場合には、被写体を加算合成すると被写体の合成数が多くなり過ぎて見苦しい合成動画になってしまう虞がある。
従って、動き判定部7eにより被写体切り抜き動画像M2の各画像フレームgの被写体の動きの量が所定の閾値以上であり、且つ、被写体の動きの方向が略等しいと判定された場合に、被写体を加算合成することにより視認性の良好な合成動画を生成することができる。
Further, when it is determined by the movement determination unit 7e that the amount of movement of the subject in each image frame g of the subject cutout moving image M2 is equal to or greater than a predetermined threshold and the direction of movement of the subject is substantially equal, As the playback time elapses, the image composition unit 7f composes the images so that they are added and displayed at different positions in the background image P1, so that the subject is automatically added by analyzing the motion of the subject in the subject cutout moving image M2. Can be synthesized. As a result, the subject can be synthesized in a novel manner with the background image P1 even if the operation of the imaging apparatus 100 is not well known.
In the above-described embodiment, when the motion determination unit 7e determines that the motion direction of the subject in at least each image frame g of the subject cutout moving image M2 is substantially equal, the subject is used for the background as the playback time elapses. What is necessary is just to synthesize | combine to the image synthetic | combination part 7f so that addition display may be carried out in the different position of the image P1. However, if the amount of movement of the subject is smaller than a predetermined threshold, adding and synthesizing the subjects may increase the number of subjects to be combined, resulting in an unsightly synthesized moving image.
Accordingly, when the movement determination unit 7e determines that the amount of movement of the subject in each image frame g of the subject cutout moving image M2 is equal to or greater than a predetermined threshold and the direction of movement of the subject is substantially equal, By adding and synthesizing, it is possible to generate a synthesized moving image with good visibility.

さらに、動き判定部7eにより被写体切り抜き動画像M2の各画像フレームgの被写体の動きの方向が略等しくないと判定された場合には、当該被写体切り抜き動画像M2を構成する複数の画像フレームg、…の各々を背景用画像P1に対して画像合成部7fにより合成させるので、被写体の動きの方向がばらばらで加算合成に適していない場合には、通常の画像合成処理を行って複数の画像フレームg、…からなる被写体合成動画像M4の合成動画を生成することができる。
また、被写体の加算合成と通常合成とを被写体切り抜き動画像M2の被写体の動きを解析することで自動的に切り換えるので、より操作の簡便な撮像装置100を提供することができる。
Furthermore, when the motion determination unit 7e determines that the direction of movement of the subject in each image frame g of the subject cutout moving image M2 is not substantially equal, a plurality of image frames g, which constitute the subject cutout moving image M2, Are combined with the background image P1 by the image combining unit 7f. Therefore, when the direction of movement of the subject is different and is not suitable for addition combining, a normal image combining process is performed to obtain a plurality of image frames. A synthesized moving image of the subject synthesized moving image M4 composed of g,... can be generated.
In addition, since the addition synthesis of the subject and the normal synthesis are automatically switched by analyzing the motion of the subject in the subject cutout moving image M2, it is possible to provide the imaging apparatus 100 that is easier to operate.

なお、本発明は、上記実施形態に限定されることなく、本発明の趣旨を逸脱しない範囲において、種々の改良並びに設計の変更を行っても良い。
例えば、加算合成処理にて、動き判定部7eが被写体切り抜き動画像M2を構成する複数の画像フレームg、…のうち、何れか一の画像フレームgにおける被写体の動きベクトルの方向が当該一の画像フレームgよりも前の画像フレームgにおける被写体の動きベクトルの方向に対して変化したか否かを判断し、変化したと判断された場合に、合成制御部7gは、既に静止画像に対して加算表示された被写体を消去するようにしても良い。
即ち、被写体の動きが所定の画像フレームgまでは略等しかったが、次の画像フレームgから被写体の動きが急に変化した場合等に、所定の画像フレームgまでの被写体の加算表示が残っていると、新たに合成される被写体と重なってしまい、見苦しくなってしまうことを防止するためである。
なお、被写体の動きが変化しても所定の画像フレームgまでの被写体の加算表示と新たに合成される被写体と重なってしまう虞がない場合、例えば、被写体の動きが所定の画像フレームgまでの被写体の動きの方向に対して所定角度範囲の変化である場合には、合成制御部7gは、必ずしも既に静止画像に対して加算表示された被写体を消去する必要はない。
The present invention is not limited to the above-described embodiment, and various improvements and design changes may be made without departing from the spirit of the present invention.
For example, in the addition / combination process, the direction of the motion vector of the subject in any one of the plurality of image frames g,... Constituting the subject cutout moving image M2 by the motion determination unit 7e is the one image. It is determined whether or not there is a change in the direction of the motion vector of the subject in the image frame g before the frame g, and when it is determined that the change has occurred, the composition control unit 7g already adds to the still image. The displayed subject may be erased.
That is, the movement of the subject is substantially equal to the predetermined image frame g, but when the movement of the subject suddenly changes from the next image frame g, the addition display of the subject to the predetermined image frame g remains. This is to prevent the subject from being overlapped with a newly synthesized subject and becoming unsightly.
If there is no possibility that the subject addition display up to the predetermined image frame g overlaps with the newly synthesized subject even if the movement of the subject changes, for example, the movement of the subject up to the predetermined image frame g When the change is within a predetermined angle range with respect to the direction of movement of the subject, the composition control unit 7g does not necessarily need to delete the subject that has already been added to the still image.

また、上記実施形態にあっては、被写体切り抜き動画像M2の動画像データの記録方式として、Motion−JPEG形式を例示したが、例えば、MPEG形式であっても良い。かかる場合には、合成画像生成処理にて、予め当該MPEG形式の動画像データを復号化して複数の画像フレームg、…を生成することで、各画像フレームgについて被写体の動きベクトルの検出や背景用画像P1との合成を行うことができる。   In the above embodiment, the Motion-JPEG format is exemplified as the recording method of the moving image data of the subject cutout moving image M2, but the MPEG-format may be used, for example. In such a case, in the composite image generation process, the moving image data in the MPEG format is decoded in advance to generate a plurality of image frames g,. The image P1 can be combined with the work image P1.

また、動きベクトルの検出に当たっては従来のテンプレートマッチングを行ったが、アルファマップから簡易的に検出するようにしても良い。すなわち、被写体領域であるアルファ値が1の画素座標(全ての画素ではなく適宜間引いても良い)の重心座標を求め、フレーム間の重心座標の移動を動きベクトルとしても良い。   In addition, the conventional template matching is performed for the detection of the motion vector, but it may be detected simply from the alpha map. In other words, the center of gravity coordinates of the pixel coordinates of the subject area having an alpha value of 1 (may be thinned out instead of all pixels) may be obtained, and the movement of the center of gravity coordinates between frames may be used as a motion vector.

また、撮像装置100の構成は、上記実施形態に例示したものは一例であり、これに限られるものではない。即ち、画像合成装置として、撮像装置100を例示したが、これに限られるものではい。例えば、被写体切り抜き動画像M2、背景用画像P1及び被写体切り抜き動画像の画像データの生成は、当該撮像装置100とは異なる撮像装置にて行い、この撮像装置から転送された画像データのみを記録して、合成画像生成処理のみを実行する画像合成装置であっても良い。
さらに、被写体切り抜き動画像M2における被写体の動きを基準として設定された被写体の合成位置に係るデータを予め記録媒体8に記録しておき、表示制御部9が、当該記録媒体8に記録された合成位置に係るデータに基づいて、当該被写体を再生時間の経過に伴って静止画像の異なる位置に加算表示させるように当該静止画像と動画像とを合成して表示部に合成動画を再生させるようにしても良い。
即ち、例えば、被写体の合成位置に係るデータの生成は、当該撮像装置100とは異なる撮像装置にて行い、この撮像装置から転送された被写体切り抜き動画像M2、背景用画像P1及び合成位置に係るデータのみを記録媒体8に記録しておき、被写体存在動画像M1の再生の際に、表示制御部9が、記録媒体8に記録された合成位置に係るデータに基づいて画像合成しつつ再生表示する装置であっても良い。
In addition, the configuration of the imaging apparatus 100 is merely an example illustrated in the above embodiment, and is not limited thereto. That is, the imaging apparatus 100 is illustrated as the image composition apparatus, but is not limited thereto. For example, the image data of the subject cutout moving image M2, the background image P1, and the subject cutout moving image is generated by an image pickup device different from the image pickup device 100, and only the image data transferred from the image pickup device is recorded. Thus, an image composition apparatus that executes only the composite image generation process may be used.
Further, data relating to the composition position of the subject set based on the movement of the subject in the subject cutout moving image M2 is recorded in advance on the recording medium 8, and the display control unit 9 performs the composition recorded on the recording medium 8. Based on the data relating to the position, the still image and the moving image are synthesized so that the subject is added and displayed at different positions of the still image as the reproduction time elapses, and the synthesized moving image is reproduced on the display unit. May be.
That is, for example, the data related to the composition position of the subject is generated by an imaging device different from the imaging device 100, and the subject clipping moving image M2, the background image P1, and the composition position transferred from the imaging device are related. Only the data is recorded on the recording medium 8, and when the subject existing moving image M <b> 1 is reproduced, the display control unit 9 reproduces and displays the image while synthesizing the image based on the data relating to the synthesis position recorded on the recording medium 8. It may be a device that performs.

加えて、上記実施形態にあっては、合成手段、検出手段、合成制御手段としての機能を、CPU12の制御下にて、動き検出部6、画像処理部7の画像合成部7f、合成制御部7gが駆動することにより実現され、画像記録手段、位置記録手段、再生制御手段としての機能を、CPU12の制御下にて、表示制御部9が駆動することにより実現される構成としたが、これに限られるものではなく、CPU12によって所定のプログラム等が実行されることにより実現される構成としても良い。
即ち、プログラムを記憶するプログラムメモリ(図示略)に、合成処理ルーチン、検出処理ルーチン、合成制御処理ルーチンを含むプログラムを記憶しておく。そして、合成処理ルーチンによりCPU12に、背景用の静止画像と動画像とを合成して合成動画を生成させるようにしても良い。また、検出処理ルーチンによりCPU12に、動画像における動体の動きを検出させるようにしても良い。また、合成制御処理ルーチンによりCPU12に、検出された動体の動きを基準として、当該動体を再生時間の経過に伴って静止画像の異なる位置に加算表示させるように静止画像と動画像とを合成させるようにしても良い。
また、プログラムを記憶するプログラムメモリ(図示略)に、画像記録制御処理ルーチン、位置記録制御処理ルーチン、再生制御処理ルーチンを含むプログラムを記憶しておく。そして、画像記録制御処理ルーチンによりCPU12に、背景用の静止画像と動画像とを記録媒体8に記録させるようにしても良い。また、位置記録制御処理ルーチンによりCPU12に、動画像における動体の動きを基準として設定された動体の合成位置を記録媒体8に記録させるようにしても良い。また、再生制御処理ルーチンによりCPU12に、記録媒体8に記録された合成位置に基づいて、当該動体を再生時間の経過に伴って静止画像の異なる位置に加算表示させるように当該静止画像と動画像とを合成して合成動画を再生させるようにしても良い。
In addition, in the above embodiment, the functions as the synthesis unit, the detection unit, and the synthesis control unit are controlled under the control of the CPU 12 by the motion detection unit 6, the image synthesis unit 7f of the image processing unit 7, and the synthesis control unit. 7g is driven, and the functions as the image recording unit, the position recording unit, and the reproduction control unit are realized by driving the display control unit 9 under the control of the CPU 12. The present invention is not limited to this, and a configuration realized by executing a predetermined program or the like by the CPU 12 may be adopted.
That is, a program memory (not shown) that stores a program stores a program including a synthesis processing routine, a detection processing routine, and a synthesis control processing routine. Then, the synthesized moving image may be generated by synthesizing the background still image and the moving image by the synthesis processing routine. Moreover, you may make it make CPU12 detect the motion of the moving body in a moving image by a detection process routine. Further, the synthesis control processing routine causes the CPU 12 to synthesize the still image and the moving image so that the moving object is added and displayed at different positions of the still image as the playback time elapses with reference to the detected movement of the moving object. You may do it.
A program memory (not shown) that stores the program stores a program including an image recording control processing routine, a position recording control processing routine, and a reproduction control processing routine. Then, a background still image and a moving image may be recorded on the recording medium 8 by the image recording control processing routine. Alternatively, the CPU 12 may cause the recording medium 8 to record the combined position of the moving object set based on the movement of the moving object in the moving image by the position recording control processing routine. Further, based on the composite position recorded on the recording medium 8 by the reproduction control processing routine, the still image and the moving image are displayed so that the moving object is added and displayed at different positions of the still image as the reproduction time elapses. And a synthesized moving image may be reproduced.

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

Claims (9)

背景用の静止画像と動画像とを合成して合成動画を生成する合成手段と、
前記動画像における動体の動きを検出する検出手段と、
この検出手段により検出された動体の動きを基準として、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように前記静止画像と前記動画像とを前記合成手段に合成させる合成制御手段と、
を備えたことを特徴とする画像合成装置。
Combining means for combining a still image for background and a moving image to generate a combined moving image;
Detecting means for detecting movement of a moving object in the moving image;
Based on the motion of the moving object detected by the detecting means, the still image and the moving image are combined with the combining means so that the moving object is added and displayed at different positions of the still image as the playback time elapses. Synthesis control means
An image composition device comprising:
前記合成制御手段は、
前記動画像を構成する複数の画像フレーム中の動体を前記静止画像に対して前記合成手段により加算して複数の画像フレームからなる合成動画を生成させることを特徴とする請求項1に記載の画像合成装置。
The synthesis control means includes
2. The image according to claim 1, wherein a moving image in a plurality of image frames constituting the moving image is added to the still image by the combining unit to generate a combined moving image including a plurality of image frames. Synthesizer.
前記検出手段により検出された動体の動きの方向が略等しいか否かを判定する動き判定手段を更に備え、
前記合成制御手段は、
前記動き判定手段により前記動体の動きの方向が略等しいと判定された場合に、前記動体を再生時間の経過に伴って異なる位置に加算表示させるように前記合成手段に合成させることを特徴とする請求項1又は2に記載の画像合成装置。
A motion determining means for determining whether or not the directions of motion of the moving object detected by the detecting means are substantially equal;
The synthesis control means includes
When the movement determining unit determines that the moving direction of the moving object is substantially equal, the combining unit is configured to combine the moving object so that the moving object is added and displayed at different positions as the playback time elapses. The image composition device according to claim 1.
前記動き判定手段は、
前記動画像を構成する複数の画像フレームのうち、隣り合う画像フレーム間での動体の動きの方向が略等しいか否かを判定し、
前記合成制御手段は、
前記動き判定手段により何れか一の画像フレームにおける前記動体の動きの方向が当該一の画像フレームよりも前の画像フレームにおける前記動体の動きの方向に対して変化したと判断された場合に、既に前記静止画像に対して加算表示された動体を消去することを特徴とする請求項3に記載の画像合成装置。
The movement determination means includes
Determining whether or not the directions of movement of moving objects between adjacent image frames among the plurality of image frames constituting the moving image are substantially equal;
The synthesis control means includes
When it is determined by the motion determination means that the direction of motion of the moving object in any one image frame has changed with respect to the direction of motion of the moving object in an image frame prior to the one image frame, The image synthesizing apparatus according to claim 3, wherein the moving object added to the still image is deleted.
前記動き判定手段は、
前記検出手段により検出された動体の動きの量が所定値以上であるか否かを判定し、
前記合成制御手段は、
前記動き判定手段により前記動体の動きの量が所定値以上であると判定された場合に、前記動体を再生時間の経過に伴って異なる位置に加算表示させるように前記合成手段に合成させることを特徴とする請求項3又は4に記載の画像合成装置。
The movement determination means includes
Determining whether the amount of motion of the moving object detected by the detection means is greater than or equal to a predetermined value;
The synthesis control means includes
When the movement determining unit determines that the amount of movement of the moving object is equal to or greater than a predetermined value, the combining unit is configured to synthesize the moving object to be added and displayed at different positions as the playback time elapses. The image synthesizing device according to claim 3 or 4,
前記合成制御手段は、
前記動き判定手段により前記動体の動きの方向が略等しくないと判定された場合に、前記動画像を構成する複数の画像フレームの各々を前記静止画像に対して前記合成手段により合成させることを特徴とする請求項3〜5の何れか一項に記載の画像合成装置。
The synthesis control means includes
When the motion determining unit determines that the moving direction of the moving object is not substantially equal, each of the plurality of image frames constituting the moving image is combined with the still image by the combining unit. The image composition device according to any one of claims 3 to 5.
背景用の静止画像と動画像とを記録する画像記録手段と、
前記動画像における動体の動きを基準として設定された前記動体の合成位置を記録する位置記録手段と、
前記位置記録手段に記録された合成位置に基づいて、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生制御手段と、
を備えたことを特徴とする画像再生装置。
Image recording means for recording a still image and a moving image for background;
Position recording means for recording the combined position of the moving object set with reference to the movement of the moving object in the moving image;
Based on the combined position recorded in the position recording means, the moving image is combined with the moving image so that the moving object is added and displayed at different positions of the still image as the playback time elapses. Playback control means for playing back,
An image reproducing apparatus comprising:
画像合成装置のコンピュータを、
背景用の静止画像と動画像とを合成して合成動画を生成する合成手段、
前記動画像における動体の動きを検出する検出手段、
この検出手段により検出された動体の動きを基準として、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように前記静止画像と前記動画像とを前記合成手段に合成させる合成制御手段、
として機能させることを特徴とするプログラム。
The computer of the image synthesizer
A synthesis means for synthesizing a background still image and a moving image to generate a synthesized moving image;
Detecting means for detecting movement of a moving object in the moving image;
Based on the motion of the moving object detected by the detecting means, the still image and the moving image are combined with the combining means so that the moving object is added and displayed at different positions of the still image as the playback time elapses. A synthesis control means,
A program characterized by functioning as
画像再生装置のコンピュータを、
背景用の静止画像と動画像とを記録手段に記録させる画像記録制御手段、
前記動画像における動体の動きを基準として設定された前記動体の合成位置を記録手段に記録させる位置記録制御手段、
前記記録手段に記録された合成位置に基づいて、当該動体を再生時間の経過に伴って前記静止画像の異なる位置に加算表示させるように当該静止画像と前記動画像とを合成して合成動画を再生する再生制御手段、
として機能させることを特徴とするプログラム。
The computer of the image playback device
Image recording control means for causing the recording means to record a still image and a moving image for background;
Position recording control means for causing the recording means to record the combined position of the moving object set on the basis of the movement of the moving object in the moving image;
Based on the combined position recorded in the recording means, the moving image is combined with the moving image so that the moving object is added and displayed at different positions of the still image as the playback time elapses. Playback control means for playback,
A program characterized by functioning as
JP2009079038A 2009-03-27 2009-03-27 Image composition apparatus, image composition method, and program Expired - Fee Related JP5402148B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009079038A JP5402148B2 (en) 2009-03-27 2009-03-27 Image composition apparatus, image composition method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009079038A JP5402148B2 (en) 2009-03-27 2009-03-27 Image composition apparatus, image composition method, and program

Publications (2)

Publication Number Publication Date
JP2010233001A true JP2010233001A (en) 2010-10-14
JP5402148B2 JP5402148B2 (en) 2014-01-29

Family

ID=43048396

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009079038A Expired - Fee Related JP5402148B2 (en) 2009-03-27 2009-03-27 Image composition apparatus, image composition method, and program

Country Status (1)

Country Link
JP (1) JP5402148B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014155877A1 (en) * 2013-03-26 2014-10-02 ソニー株式会社 Image processing device, image processing method, and program
US9600160B2 (en) 2013-12-09 2017-03-21 Sony Corporation Image processing device, image processing method, and program
CN111327840A (en) * 2020-02-27 2020-06-23 努比亚技术有限公司 Multi-frame special-effect video acquisition method, terminal and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09102910A (en) * 1995-10-03 1997-04-15 Nippon Hoso Kyokai <Nhk> Device and method for processing moving image
JP2003008993A (en) * 2001-06-26 2003-01-10 Nippon Hoso Kyokai <Nhk> Image compositing device and method
JP2008182683A (en) * 2006-12-26 2008-08-07 Casio Comput Co Ltd Imaging apparatus, recording/reproducing method, and recording/reproducing program
JP2009044329A (en) * 2007-08-07 2009-02-26 Nikon Corp Program, image processing method, and image processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09102910A (en) * 1995-10-03 1997-04-15 Nippon Hoso Kyokai <Nhk> Device and method for processing moving image
JP2003008993A (en) * 2001-06-26 2003-01-10 Nippon Hoso Kyokai <Nhk> Image compositing device and method
JP2008182683A (en) * 2006-12-26 2008-08-07 Casio Comput Co Ltd Imaging apparatus, recording/reproducing method, and recording/reproducing program
JP2009044329A (en) * 2007-08-07 2009-02-26 Nikon Corp Program, image processing method, and image processor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014155877A1 (en) * 2013-03-26 2014-10-02 ソニー株式会社 Image processing device, image processing method, and program
US10115431B2 (en) 2013-03-26 2018-10-30 Sony Corporation Image processing device and image processing method
US9600160B2 (en) 2013-12-09 2017-03-21 Sony Corporation Image processing device, image processing method, and program
CN111327840A (en) * 2020-02-27 2020-06-23 努比亚技术有限公司 Multi-frame special-effect video acquisition method, terminal and computer readable storage medium

Also Published As

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

Similar Documents

Publication Publication Date Title
JP5051156B2 (en) Image processing apparatus and program
JP5105550B2 (en) Image composition apparatus and program
JP5733565B2 (en) Image processing apparatus and method, and program
JP4760973B2 (en) Imaging apparatus and image processing method
JP4798236B2 (en) Imaging apparatus, image processing method, and program
JP2012242821A (en) Display image generation method
JP2010239447A (en) Image capturing apparatus, image processing method, and program
JP5402166B2 (en) Image composition apparatus and program
US8711239B2 (en) Program recording medium, image processing apparatus, imaging apparatus, and image processing method
JP5402148B2 (en) Image composition apparatus, image composition method, and program
JP5267279B2 (en) Image composition apparatus and program
JP2009044329A (en) Program, image processing method, and image processor
JP5476900B2 (en) Image composition apparatus, image composition method, and program
JP2011182014A (en) Image pickup device, image processing method and program
JP5636660B2 (en) Image processing apparatus, image processing method, and program
JP2011041041A (en) Imaging apparatus, imaging method and program
JP5493839B2 (en) Imaging apparatus, image composition method, and program
JP2011003057A (en) Image composition device, image specifying method, image composition method, and program
JP5703771B2 (en) Imaging assistance device, imaging assistance method, and program
JP5332668B2 (en) Imaging apparatus and subject detection program
JP5494537B2 (en) Image processing apparatus and program
JP2010278701A (en) Image combining device, and image combining method and program
JP5381207B2 (en) Image composition apparatus and program
JP5589333B2 (en) Image composition apparatus, image composition method, and program
JP2009049457A (en) Imaging device and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120316

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20120316

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 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130621

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130709

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130903

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

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees