JP2011077850A - Image processing apparatus, image processing method, and program - Google Patents

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

Info

Publication number
JP2011077850A
JP2011077850A JP2009227623A JP2009227623A JP2011077850A JP 2011077850 A JP2011077850 A JP 2011077850A JP 2009227623 A JP2009227623 A JP 2009227623A JP 2009227623 A JP2009227623 A JP 2009227623A JP 2011077850 A JP2011077850 A JP 2011077850A
Authority
JP
Japan
Prior art keywords
image
subject
background
predetermined
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
JP2009227623A
Other languages
Japanese (ja)
Other versions
JP5636660B2 (en
Inventor
Hiroko Shoji
裕子 東海林
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 JP2009227623A priority Critical patent/JP5636660B2/en
Publication of JP2011077850A publication Critical patent/JP2011077850A/en
Application granted granted Critical
Publication of JP5636660B2 publication Critical patent/JP5636660B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an effective composite image when combining a background image and a foreground image. <P>SOLUTION: An imaging device 100 is provided with: a combination region specification unit 8c for specifying a combination region of the background image with which a subject image should be combined; a process handling unit 8e that applies predetermined image processing to the subject image and/or the background image based on the subject image combination region specified by the combination region specification unit; and an image combination unit 8f that combines the subject image applied with predetermined image processing by the process handling unit with the background image to generate a subject combined image P. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、複数の画像を合成する画像処理装置、画像処理方法及びプログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, 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, since the above conventional technique only synthesizes the subject image at the designated position of the background image, depending on the background image to be synthesized, the content of the subject image, the synthesis position, and the synthesis size, it does not become an effective synthesized image. There was a problem.

そこで、本発明の課題は、背景画像と前景画像とを合成する際、効果的な合成画像を得ることができる画像処理装置、画像処理方法及びプログラムを提供することである。   Therefore, an object of the present invention is to provide an image processing apparatus, an image processing method, and a program capable of obtaining an effective composite image when combining a background image and a foreground image.

上記課題を解決するため、請求項1に記載の発明の画像処理装置は、
背景画像に前景画像を合成する合成手段を備えた画像処理装置において、前記背景画像における前記前景画像を合成すべき領域を特定する特定手段と、この特定手段により特定された前記前景画像を合成すべき領域に基づいて、当該前景画像及び前記背景画像の少なくとも一方に所定の処理を施す画像処理手段と、を備え、前記合成手段は、前記画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像と前記背景画像とを合成することを特徴としている。
In order to solve the above problem, an image processing apparatus according to claim 1 is provided.
In an image processing apparatus including a synthesis unit that synthesizes a foreground image with a background image, a specifying unit that specifies a region in the background image to be combined with the foreground image, and the foreground image specified by the specification unit are combined. Image processing means for performing a predetermined process on at least one of the foreground image and the background image based on a power region, and the synthesizing means is subjected to the predetermined process on at least one of the image processing means. The foreground image and the background image are synthesized.

請求項2に記載の発明は、請求項1に記載の画像処理装置において、
前記前景画像と所定の処理とを対応付けて記憶する記憶手段を更に備え、前記画像処理手段は、前記特定手段により特定された前記前景画像を合成すべき領域に基づいて、前記記憶手段に前記前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び前記背景画像の少なくとも一方に施すことを特徴としている。
The invention according to claim 2 is the image processing apparatus according to claim 1,
The image processing device further comprises storage means for storing the foreground image and a predetermined process in association with each other, and the image processing means stores the foreground image in the storage means based on an area to be combined with the foreground image specified by the specifying means. The predetermined processing stored in association with the foreground image is performed on at least one of the foreground image and the background image.

請求項3に記載の発明は、請求項1又は2に記載の画像処理装置において、
前記特定手段により前記前景画像を合成すべき領域として前記背景画像における所定領域が特定されたか否かを判定する判定手段を更に備え、前記画像処理手段は、前記判定手段により前記背景画像における所定領域が特定されたと判定された場合に、前記前景画像及び前記背景画像の少なくとも一方に所定の処理を施すことを特徴としている。
The invention according to claim 3 is the image processing apparatus according to claim 1 or 2,
And a determination unit configured to determine whether or not a predetermined region in the background image is specified as a region to be combined with the foreground image by the specifying unit, and the image processing unit is configured to determine the predetermined region in the background image by the determination unit. When it is determined that the image is identified, a predetermined process is performed on at least one of the foreground image and the background image.

請求項4に記載の発明は、請求項3に記載の画像処理装置において、
前記画像処理手段は、前記判定手段により前記背景画像における所定領域が特定されたと判定された場合に、前記背景画像における前記所定領域の画像部分を前記前景画像に対して優先的に表示させるように、前記前景画像及び前記背景画像の少なくとも一方に所定の処理を施すことを特徴としている。
The invention according to claim 4 is the image processing apparatus according to claim 3,
The image processing unit preferentially displays an image portion of the predetermined region in the background image with respect to the foreground image when the determination unit determines that the predetermined region in the background image is specified. A predetermined process is performed on at least one of the foreground image and the background image.

請求項5に記載の発明は、請求項3又は4に記載の画像処理装置において、
前記背景画像は、複数のフレーム画像からなる連写画像若しくは動画像であり、前記判定手段は、前記連写画像若しくは動画像を構成する各フレーム画像毎に、当該フレーム画像における所定領域が前記特定手段により特定されたか否かを判定し、前記画像処理手段は、前記複数のフレーム画像のうち、前記判定手段により所定領域が特定されたと判定されたフレーム画像及び前記前景画像の少なくとも一方に所定の処理を施すことを特徴としている。
The invention according to claim 5 is the image processing apparatus according to claim 3 or 4,
The background image is a continuous shot image or a moving image composed of a plurality of frame images, and the determining means determines the predetermined area in the frame image for each frame image constituting the continuous shot image or the moving image. The image processing means determines whether or not a predetermined image of at least one of the frame image and the foreground image determined by the determining means to be specified from the plurality of frame images. It is characterized by processing.

請求項6に記載の発明は、請求項3〜5の何れか一項に記載の画像処理装置において、
前記所定領域は、前記背景画像から検出された顔画像領域であることを特徴としている。
The invention according to claim 6 is the image processing apparatus according to any one of claims 3 to 5,
The predetermined area is a face image area detected from the background image.

請求項7に記載の発明の画像処理装置は、
背景画像に前景画像を合成する合成手段を備えた画像処理装置において、前記前景画像と所定の処理とを対応付けて記憶する記憶手段と、この記憶手段に前記前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び前記背景画像の少なくとも一方に施す画像処理手段と、を備え、前記合成手段は、前記画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像と前記背景画像とを合成することを特徴としている。
An image processing apparatus according to a seventh aspect of the present invention provides:
In an image processing apparatus including a synthesis unit that synthesizes a foreground image with a background image, a storage unit that stores the foreground image and a predetermined process in association with each other, and a storage unit that stores the foreground image in association with the foreground image. Image processing means for performing the predetermined processing on at least one of the foreground image and the background image, and the synthesizing means has the foreground image on which at least one of the predetermined processing has been performed by the image processing means. And the background image.

請求項8に記載の発明は、請求項7に記載の画像処理装置において、
前記背景画像における前記前景画像を合成すべき領域を特定する特定手段を更に備え、前記画像処理手段は、前記特定手段により前記前景画像を合成すべき領域として特定された前記背景画像における所定領域から所定の範囲内の前記背景画像に所定の処理を施すことを特徴としている。
The invention according to claim 8 is the image processing apparatus according to claim 7,
The image processing means further includes a specifying unit that specifies a region in the background image to be combined with the foreground image, and the image processing unit is configured to select a predetermined region in the background image specified as the region to be combined with the foreground image. A predetermined process is performed on the background image within a predetermined range.

請求項9に記載の発明の画像処理方法は、
背景画像における前景画像を合成すべき領域を特定するステップと、上記ステップにて特定された前記前景画像を合成すべき領域に基づいて、当該前景画像及び前記背景画像の少なくとも一方に所定の処理を施すステップと、上記ステップにて少なくとも一方に所定の処理を施された前記前景画像と前記背景画像とを合成するステップとを含むことを特徴としている。
The image processing method of the invention according to claim 9
Based on the step of specifying the region in the background image where the foreground image is to be combined and the region where the foreground image specified in the above step is to be combined, predetermined processing is performed on at least one of the foreground image and the background image. And a step of synthesizing the foreground image and the background image that have been subjected to predetermined processing in at least one of the steps.

請求項10に記載の発明の画像処理方法は、
予め前景画像と所定の処理とを対応付けて記憶し、当該前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び当該前景画像が合成される背景画像の少なくとも一方に施すステップと、上記ステップにて少なくとも一方に所定の処理を施された前記前景画像と前記背景画像とを合成するステップとを含むことを特徴としている。
An image processing method according to the invention of claim 10 is provided.
A foreground image and a predetermined process are stored in association with each other in advance, and the predetermined process stored in association with the foreground image is applied to at least one of the foreground image and the background image with which the foreground image is synthesized. And a step of synthesizing the foreground image and the background image that have been subjected to predetermined processing in at least one of the steps.

請求項11に記載の発明のプログラムは、
画像処理装置のコンピュータを、背景画像における前景画像を合成すべき領域を特定する特定手段、この特定手段により特定された前記前景画像を合成すべき領域に基づいて、当該前景画像及び前記背景画像の少なくとも一方に所定の処理を施す画像処理手段、この画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像と前記背景画像とを合成する合成手段として機能させることを特徴としている。
The program of the invention described in claim 11 is
The computer of the image processing apparatus is configured to specify a region for combining the foreground image in the background image, based on the region to be combined with the foreground image specified by the specifying unit. The image processing means for performing a predetermined process on at least one, and a combining means for combining the foreground image and the background image on which the predetermined process has been applied to at least one by the image processing means.

請求項12に記載の発明のプログラムは、
前景画像と所定の処理とを対応付けて記憶させる記憶部を有する画像処理装置のコンピュータを、前記記憶部に前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び前記背景画像の少なくとも一方に施す画像処理手段、この画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像及び前記背景画像を合成する合成手段として機能させることを特徴としている。
The program of the invention described in claim 12 is:
A computer of an image processing apparatus having a storage unit that stores a foreground image and a predetermined process in association with each other. The predetermined process stored in the storage unit in association with a foreground image is stored in the foreground image and the background. The image processing means is applied to at least one of the images, and the image processing means functions as a synthesis means for synthesizing the foreground image and the background image on which at least one of the images has been subjected to predetermined processing.

本発明によれば、背景画像と前景画像とを合成する際、効果的な合成画像を得ることができる。   According to the present invention, an effective composite image can be obtained when a background image and a foreground image are combined.

本発明を適用した一実施形態の撮像装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the imaging device of one Embodiment to which this invention is applied. 図1の撮像装置に記憶されている処理内容テーブルの一例を示す図である。It is a figure which shows an example of the processing content table memorize | stored in the imaging device of FIG. 図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 subject clipping 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. 図5の合成画像生成処理における画像合成処理に係る動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement which concerns on the image composition process in the composite image generation process of FIG. 図5の合成画像生成処理に係る画像の一例を模式的に示す図である。It is a figure which shows typically an example of the image which concerns on the synthesized image generation process of FIG. 変形例1の撮像装置による合成画像生成処理に係る画像の一例を模式的に示す図である。FIG. 10 is a diagram schematically illustrating an example of an image related to a composite image generation process performed by an imaging apparatus according to Modification 1. 変形例2の撮像装置による合成画像生成処理に係る動作の一例を示すフローチャートである。14 is a flowchart illustrating an example of an operation related to a composite image generation process performed by an imaging apparatus according to a second modification.

以下に、本発明について、図面を用いて具体的な態様を説明する。ただし、発明の範囲は、図示例に限定されない。
図1は、本発明を適用した一実施形態の撮像装置100の概略構成を示すブロック図である。
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.

本実施形態の撮像装置100は、背景画像B(図7(a)等参照)における被写体画像(前景画像)G(図7(a)等参照)を合成すべき合成領域を特定して、当該被写体画像Gを合成すべき合成領域に基づいて、当該被写体画像G及び背景画像Bのうち、少なくとも何れか一方に所定の画像処理を施して被写体合成画像Pを生成する。
具体的には、図1に示すように、撮像装置100は、レンズ部1と、電子撮像部2と、撮像制御部3と、画像データ生成部4と、画像メモリ5と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、記録媒体9と、表示制御部10と、表示部11と、操作入力部12と、CPU13とを備えている。
また、撮像制御部3と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、CPU13は、例えば、カスタムLSI1Aとして設計されている。
The imaging apparatus 100 according to the present embodiment identifies a synthesis region in which a subject image (foreground image) G (see FIG. 7A, etc.) in the background image B (see FIG. 7A, etc.) is to be synthesized, and Based on the synthesis area where the subject image G is to be synthesized, at least one of the subject image G and the background image B is subjected to predetermined image processing to generate a subject synthesized image P.
Specifically, as illustrated in FIG. 1, the imaging apparatus 100 includes a lens unit 1, an electronic imaging unit 2, an imaging control unit 3, an image data generation unit 4, an image memory 5, and a feature amount calculation unit. 6, a block matching unit 7, an image processing unit 8, a recording medium 9, a display control unit 10, a display unit 11, an operation input unit 12, and a CPU 13.
In addition, the imaging control unit 3, the feature amount calculation unit 6, the block matching unit 7, the image processing unit 8, and the CPU 13 are designed as, for example, a custom LSI 1A.

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

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

撮像制御部3は、図示は省略するが、タイミング発生器、ドライバなどを備えている。そして、撮像制御部3は、タイミング発生器、ドライバにより電子撮像部2を走査駆動して、所定周期毎に光学像を電子撮像部2により二次元の画像信号に変換させ、当該電子撮像部2の撮像領域から1画面分ずつ画像フレームを読み出して画像データ生成部4に出力させる。
また、撮像制御部3は、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は、画像合成処理に係る背景画像B(図7(a)参照)や被写体存在画像(図示略)を撮像する。   The lens unit 1, the electronic imaging unit 2, and the imaging control unit 3 configured as described above capture the background image B (see FIG. 7A) and the subject presence image (not shown) related to the image composition processing.

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

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

撮像された被写体存在画像から被写体切り抜き画像を生成する場合、特徴量演算部6は、比較すべき被写体非存在画像を基準として、当該被写体非存在画像から特徴点を抽出する特徴抽出処理を行う。具体的には、特徴量演算部6は、被写体非存在画像のYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレート(例えば、16×16画素の正方形)として抽出する。
ここで、特徴抽出処理とは、多数の候補ブロックから追跡に都合の良い特徴性の高いものを選択する処理である。
When generating a subject cut-out image from the captured subject existing image, the feature amount calculation unit 6 performs feature extraction processing for extracting feature points from the subject non-existing image with reference to the subject non-existing image to be compared. Specifically, the feature amount calculation unit 6 selects a predetermined number (or a predetermined number or more) of highly featured block regions (feature points) based on the YUV data of the subject 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.

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

画像処理部8は、切抜画像生成部8aと、顔検出部8bと、合成領域特定部8cと、領域判定部8dと、加工処理部8eと、画像合成部8fとを具備している。   The image processing unit 8 includes a cut-out image generation unit 8a, a face detection unit 8b, a synthesis region specifying unit 8c, a region determination unit 8d, a processing unit 8e, and an image synthesis unit 8f.

切抜画像生成部8aは、被写体切り抜き画像の画像データを生成する。具体的には、切抜画像生成部8aは、位置合わせ部と、被写体画像抽出部と、位置情報生成部等(何れも図示略)を備えている。
位置合わせ部は、被写体非存在画像から抽出した特徴点に基づいて、被写体非存在画像に対する被写体存在画像の各画素の座標変換式(射影変換行列)を算出し、当該座標変換式に従って被写体存在画像を座標変換して被写体非存在画像と位置合わせを行う。
被写体画像抽出部は、位置合わせ部により位置合わせされた被写体存在画像と被写体非存在画像との間で対応する各画素の差分情報を生成し、当該差分情報を基準として被写体存在画像から被写体が含まれる被写体画像(前景画像)Gを抽出する。
位置情報生成部は、被写体存在画像から抽出された被写体画像Gの位置を特定して、被写体存在画像における被写体画像Gの位置を示す位置情報(例えば、アルファマップ)を生成する。ここで、アルファマップとは、被写体存在画像の各画素について、被写体画像Gを所定の背景に対してアルファブレンディングする際の重みをアルファ値(0≦α≦1)として表したものである。
切抜画像生成部8aは、位置情報生成部により生成されたアルファマップに基づいて、被写体存在画像の各画素のうち、アルファ値が1の画素を所定の単一色画像(図示略)に対して透過させずに、且つ、アルファ値が0の画素を透過させるように、被写体画像Gを所定の単一色画像と合成して被写体切り抜き画像の画像データを生成する。
The cutout image generation unit 8a generates image data of the subject cutout image. Specifically, the cut-out image generation unit 8a includes a position alignment unit, a subject image extraction unit, a position information generation unit, and the like (all not shown).
The alignment unit calculates a coordinate conversion formula (projection conversion matrix) of each pixel of the subject existing image with respect to the subject nonexistent image based on the feature points extracted from the subject nonexistent image, and the subject existing image according to the coordinate conversion formula Is coordinate-converted with the subject non-existing image.
The subject image extraction unit generates difference information of each corresponding pixel between the subject presence image and the subject non-existence image aligned by the alignment unit, and includes the subject from the subject presence image based on the difference information. Subject image (foreground image) G is extracted.
The position information generating unit specifies the position of the subject image G extracted from the subject existing image, and generates position information (for example, an alpha map) indicating the position of the subject image G in the subject existing image. Here, the alpha map represents a weight when alpha blending the subject image G with respect to a predetermined background for each pixel of the subject existing image as an alpha value (0 ≦ α ≦ 1).
Based on the alpha map generated by the position information generation unit, the cut-out image generation unit 8a transmits a pixel having an alpha value of 1 to a predetermined single color image (not shown) among the pixels of the subject existing image. In addition, the subject image G is synthesized with a predetermined single color image so as to transmit a pixel having an alpha value of 0 without generating the image data of the subject cut-out image.

顔検出部8bは、背景画像Bから所定の顔検出方法を用いて顔を検出する。具体的には、顔検出部8bは、合成画像生成処理(後述)にて、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて指定された背景画像B内から顔画像領域Aを検出し、その検出した各領域内から目、鼻、口等に相当する特徴部(顔パーツ)を検出する。この顔検出処理は、公知の技術であるので、ここでは詳細な説明を省略する。   The face detection unit 8b detects a face from the background image B using a predetermined face detection method. Specifically, the face detection unit 8b performs a face image region A from the background image B designated based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user in a composite image generation process (described later). , And feature portions (face parts) corresponding to eyes, nose, mouth, and the like are detected from within the detected regions. Since this face detection process is a known technique, a detailed description thereof is omitted here.

合成領域特定部8cは、背景画像Bにおける被写体切り抜き画像の被写体画像Gを合成すべき合成領域を特定する。具体的には、合成画像生成処理にて、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて背景画像B上の被写体画像Gの合成位置が指定されると、合成領域特定部8cは、当該合成位置にて背景画像B上の被写体画像Gが重畳された領域を背景画像Bにおける被写体切り抜き画像の被写体画像Gを合成すべき合成領域として特定する。
ここで、合成領域特定部8cは、背景画像Bにおける被写体画像(前景画像)Gを合成すべき領域を特定する特定手段を構成している。
The synthesis area specifying unit 8c specifies a synthesis area in which the subject image G of the subject cutout image in the background image B is to be synthesized. Specifically, in the composite image generation process, when the composite position of the subject image G on the background image B is specified based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user, the composite region specifying unit 8c specifies an area in which the subject image G on the background image B is superimposed at the synthesis position as a synthesis area where the subject image G of the subject cut-out image in the background image B is to be synthesized.
Here, the synthesis area specifying unit 8c constitutes specifying means for specifying an area in which the subject image (foreground image) G in the background image B is to be synthesized.

領域判定部8dは、背景画像Bにおける被写体画像Gの合成領域と当該背景画像Bにおける所定領域とが重なるか否かを判定する。具体的には、領域判定部8dは、合成領域特定部8cにより特定された被写体画像Gの合成領域と顔検出部8bにより背景画像Bから検出された顔画像領域(所定領域)Aとが重なるか否かを判定する。
ここで、領域判定部8dは、合成領域特定部8cにより被写体画像(前景画像)Gを合成すべき合成領域として背景画像Bにおける所定領域が特定されたか否かを判定する判定手段を構成している。
The region determination unit 8d determines whether or not the composite region of the subject image G in the background image B and the predetermined region in the background image B overlap. Specifically, the area determination unit 8d overlaps the synthesis area of the subject image G specified by the synthesis area specification unit 8c and the face image area (predetermined area) A detected from the background image B by the face detection unit 8b. It is determined whether or not.
Here, the region determination unit 8d constitutes a determination unit that determines whether or not a predetermined region in the background image B is specified as a combination region in which the subject image (foreground image) G is to be combined by the combination region specification unit 8c. Yes.

加工処理部8eは、背景画像Bにおける被写体画像Gの合成領域に基づいて、背景画像Bに所定の画像処理を施す。具体的には、加工処理部8eは、被写体画像Gの合成領域にて、処理内容テーブルT(図2参照)に被写体画像Gと対応付けて登録されている所定の画像処理を背景画像Bに施す。
処理内容テーブルTは、記憶手段として、被写体画像Gと所定の画像処理とを対応付けて記憶する。具体的には、図2に示すように、処理内容テーブルTは、背景画像Bと合成される被写体画像(前景画像)Gに係る被写体画像名(例えば、「感嘆符」、「ライト」、「水滴」、「ボール」等)と、被写体画像Gの画像データと、背景画像Bに対する画像処理の処理内容とを対応付けて記憶している。例えば、被写体画像Gとしての「感嘆符」は、画像処理の処理内容として「顔画像領域をびっくりした表情にする」と対応付けられており、加工処理部8eは、背景画像Bの顔画像領域Aの目の白目部分を顔の外側方向に拡大するとともに、黒目部分を顔の内側方向に縮小するような画像処理を施す。また、被写体画像Gとしての「ライト」は、画像処理の処理内容として「合成領域を中心に明るくする」と対応付けられており、加工処理部8eは、背景画像Bの合成領域以外の部分の明るさやコントラストや色調等を調整して合成領域の近傍ほど明るくするような画像処理を施す。また、被写体画像Gとしての「水滴」は、画像処理の処理内容として「合成位置を中心に波紋が広がるような処理」と対応付けられており、加工処理部8eは、背景画像Bの合成領域以外の領域に所定径の環状部を想定して、当該環状部と重なる部分が波立つような画像処理を施す。また、被写体画像Gとしての「ボール」は、画像処理の処理内容として「合成位置を中心に凹ませるような処理」と対応付けられており、加工処理部8eは、背景画像Bの合成領域の近傍ほど歪むような画像処理を施す。
なお、上記した処理内容テーブルTは、一例であって被写体画像Gの種類や処理内容等はこれらに限られるものではなく、これらの内容は予め処理内容テーブルTに登録されていても良いし、後述する被写体切り抜き処理によって登録できるようにしても良い。
また、上記した処理内容テーブルTは、画像メモリ5に予め記憶されていてもよいし、記録媒体9の所定の記憶領域や画像ファイルごとの所定の記憶領域に記憶するようにしてもよい。
The processing unit 8e performs predetermined image processing on the background image B based on the composite region of the subject image G in the background image B. Specifically, the processing unit 8e performs predetermined image processing registered in the processing content table T (see FIG. 2) in association with the subject image G on the background image B in the synthesis region of the subject image G. Apply.
The processing content table T stores the subject image G and predetermined image processing in association with each other as storage means. Specifically, as illustrated in FIG. 2, the processing content table T includes a subject image name (for example, “exclamation mark”, “light”, “ Water droplets ”,“ balls ”, etc.), image data of the subject image G, and processing contents of image processing for the background image B are stored in association with each other. For example, “exclamation mark” as the subject image G is associated with “the face image area is made a surprised expression” as the processing content of the image processing, and the processing unit 8e performs the face image area of the background image B. Image processing is performed such that the white part of the eye of A is enlarged toward the outside of the face, and the black part is reduced toward the inside of the face. Further, “light” as the subject image G is associated with “brighten around the composite region” as the processing content of the image processing, and the processing unit 8e has a portion other than the composite region of the background image B. Image processing is performed such that the brightness, contrast, color tone, and the like are adjusted to make the area closer to the synthesis area brighter. Further, “water droplets” as the subject image G are associated with “processing that causes ripples to spread around the synthesis position” as the processing content of the image processing, and the processing unit 8e performs the synthesis region of the background image B. Assuming an annular portion having a predetermined diameter in the other region, image processing is performed so that a portion overlapping the annular portion undulates. In addition, “ball” as the subject image G is associated with “processing to dent about the composite position” as the processing content of the image processing, and the processing unit 8e displays the composite area of the background image B. Image processing that distorts the vicinity is performed.
Note that the processing content table T described above is an example, and the type and processing content of the subject image G are not limited to these. These content may be registered in the processing content table T in advance. Registration may be performed by subject clipping processing described later.
Further, the processing content table T described above may be stored in the image memory 5 in advance, or may be stored in a predetermined storage area of the recording medium 9 or a predetermined storage area for each image file.

また、加工処理部8eは、領域判定部8dにより被写体画像Gの合成領域として背景画像Bにおける所定領域が特定された場合、即ち、被写体画像Gの合成領域と顔検出部8bにより背景画像Bから検出された顔画像領域Aとが重なったと判定された場合に、背景画像Bに所定の画像処理を施す。具体的には、加工処理部8eは、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なったと判定されると、被写体画像Gの合成領域にて、処理内容テーブルTに当該被写体画像Gと対応付けて登録されている所定の画像処理を背景画像Bに施す。   Further, when the predetermined region in the background image B is specified as the composite region of the subject image G by the region determination unit 8d, that is, the processing unit 8e, that is, from the background image B by the composite region of the subject image G and the face detection unit 8b. When it is determined that the detected face image area A overlaps, the background image B is subjected to predetermined image processing. Specifically, when it is determined that the face image area A of the background image B and the composite area of the subject image G overlap, the processing unit 8e stores the processing content table T in the composite area of the subject image G. The predetermined image processing registered in association with the subject image G is performed on the background image B.

なお、加工処理部8eは、上記のような背景画像Bに対する画像処理とともに、或いは、背景画像Bに対する画像処理に替えて、被写体画像Gに対して所定の画像処理を施すようにしても良い。
ここで、加工処理部8eは、合成領域特定部8cにより特定された背景画像Bにおける被写体画像(前景画像)Gを合成すべき合成領域に基づいて、当該被写体画像G及び背景画像Bのうち、少なくとも何れか一方に所定の処理を施す画像処理手段を構成している。
The processing unit 8e may perform predetermined image processing on the subject image G in addition to the image processing on the background image B as described above or instead of the image processing on the background image B.
Here, the processing unit 8e, based on the synthesis area in which the subject image (foreground image) G in the background image B specified by the synthesis area specification unit 8c is to be synthesized, of the subject image G and the background image B, Image processing means for performing predetermined processing on at least one of them is configured.

また、画像処理部8は、被写体切り抜き画像と背景画像Bとを合成する画像合成部(合成手段)8fを具備している。
画像合成部8fは、加工処理部8eにより所定の画像処理が施された背景画像Bと被写体切り抜き画像とを合成して被写体合成画像Pを生成する。具体的には、画像合成部8fは、画像処理後の背景画像Bの各画素のうち、アルファ値が0の画素は透過させ、アルファ値が1の画素は被写体切り抜き画像の対応する画素の画素値で上書きし、さらに、背景画像Bの各画素のうち、アルファ値が0<α<1の画素は1の補数(1−α)を用いて被写体領域を切り抜いた画像(背景画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き画像を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き画像から減算し、それを被写体領域を切り抜いた画像(背景画像×(1−α))と合成する。
The image processing unit 8 includes an image composition unit (composition unit) 8f that combines the subject cut-out image and the background image B.
The image synthesizing unit 8f synthesizes the background image B on which the predetermined image processing has been performed by the processing unit 8e and the subject cutout image to generate the subject synthesized image P. Specifically, the image composition unit 8f transmits pixels having an alpha value of 0 among the pixels of the background image B after image processing, and pixels having an alpha value of 1 are pixels corresponding to the subject cutout image. In addition, among the pixels of the background image B, the pixel whose alpha value is 0 <α <1 is an image obtained by clipping the subject area using the one's complement (1-α) (background image × (1 -Α)), a value blended with a single background color is calculated when the subject cutout image is generated using the one's complement (1-α) in the alpha map, and the value is calculated from the subject cutout image. Subtraction is performed, and the resultant is combined with an image obtained by cutting out the subject area (background image × (1−α)).

記録媒体9は、例えば、不揮発性メモリ(フラッシュメモリ)等により構成され、画像処理部8の圧縮部(図示略)により符号化された背景画像Bや被写体切り抜き画像の画像データを記憶する。
また、被写体切り抜き画像の画像データは、画像処理部8の位置情報生成部により生成されたアルファマップと対応付けられて、当該被写体切り抜き画像の画像データの拡張子を「.jpe」とした複数の画像ファイルからなるグループが保存されている。
The recording medium 9 is constituted by, for example, a nonvolatile memory (flash memory) or the like, and stores the image data of the background image B and the subject cutout image encoded by the compression unit (not shown) of the image processing unit 8.
In addition, the image data of the subject clipped image is associated with the alpha map generated by the position information generation unit of the image processing unit 8 and a plurality of extensions of the image data of the subject clipped image is “.jpe”. A group of image files is saved.

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

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

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

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

次に、撮像装置100による背景画像生成処理について、図3を参照して説明する。
図3は、背景画像生成処理に係る動作の一例を示すフローチャートである。
Next, background image generation processing by the imaging apparatus 100 will be described with reference to FIG.
FIG. 3 is a flowchart illustrating an example of an operation related to the background image generation process.

背景画像生成処理は、通常の静止画像の撮像処理であり、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から静止画撮像モードが選択指示された場合に実行される処理である。
図3に示すように、先ず、表示制御部10は、レンズ部1、電子撮像部2及び撮像制御部3による背景画像Bの撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させる(ステップS1)。
The background image generation process is a normal still image capturing process, and based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user, a still image is captured from among a plurality of imaging modes displayed on the menu screen. This process is executed when a mode is instructed to be selected.
As shown in FIG. 3, first, the display control unit 10 displays a live view image based on a plurality of image frames generated by imaging the background image B by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. It displays on the display screen of the part 11 (step S1).

次に、CPU13は、ユーザによる操作入力部12のシャッタボタン12aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS2)。ここで、撮像指示が入力されたと判定されると(ステップS2;YES)、撮像制御部3は、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、背景画像B(図7(a)等参照)の光学像を所定の条件で電子撮像部2により撮像させる(ステップS3)。   Next, the CPU 13 determines whether or not an imaging instruction has been input based on a predetermined operation of the shutter button 12a of the operation input unit 12 by the user (step S2). If it is determined that an imaging instruction has been input (step S2; YES), the imaging control unit 3 determines the focus lens focus position, exposure conditions (shutter speed, aperture, amplification factor, etc.), white balance, and the like. The condition is adjusted, and the optical image of the background image B (see FIG. 7A, etc.) is imaged by the electronic imaging unit 2 under a predetermined condition (step S3).

続けて、画像データ生成部4は、電子撮像部2から転送された背景画像Bの画像フレームのYUVデータを生成した後、当該背景画像BのYUVデータを記録媒体9の所定の記憶領域に記憶させる(ステップS4)。
これにより、背景画像生成処理を終了する。
Subsequently, the image data generation unit 4 generates YUV data of the image frame of the background image B transferred from the electronic imaging unit 2 and then stores the YUV data of the background image B in a predetermined storage area of the recording medium 9. (Step S4).
Thereby, the background image generation process is terminated.

次に、撮像装置100による被写体切り抜き処理について、図4を参照して説明する。
図4は、被写体切り抜き処理に係る動作の一例を示すフローチャートである。
Next, the subject clipping process performed by the imaging apparatus 100 will be described with reference to FIG.
FIG. 4 is a flowchart illustrating an example of an operation related to the subject clipping process.

被写体切り抜き処理は、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から被写体切り抜きモードが選択指示された場合に実行される処理である。
図4に示すように、先ず、表示制御部10は、レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体存在画像の撮像指示メッセージを表示部11の表示画面に表示させる(ステップS11)。
The subject clipping process is executed when a subject clipping mode is selected from a plurality of imaging modes displayed on the menu screen based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user. It is.
As shown in FIG. 4, first, the display control unit 10 displays a live view image based on a plurality of image frames generated by imaging a subject by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. Is displayed on the display screen, and is superimposed on the live view image, and an imaging instruction message for the subject existing image is displayed on the display screen of the display unit 11 (step S11).

次に、CPU13は、ユーザにより操作入力部12のシャッタボタン12aの所定操作に基づいて撮像指示が入力されたか否かを判定する(ステップS12)。ここで、撮像指示が入力されたと判定されると(ステップS12;YES)、撮像制御部3は、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、被写体存在画像(図示略)の光学像を所定の条件で電子撮像部2により撮像させる(ステップS13)。   Next, the CPU 13 determines whether or not an imaging instruction has been input based on a predetermined operation of the shutter button 12a of the operation input unit 12 by the user (step S12). If it is determined that an imaging instruction has been input (step S12; YES), the imaging control unit 3 determines the focus lens focus position, exposure conditions (shutter speed, aperture, amplification factor, etc.), white balance, and the like. The conditions are adjusted, and an optical image of a subject existing image (not shown) is imaged by the electronic imaging unit 2 under a predetermined condition (step S13).

続けて、画像データ生成部4は、電子撮像部2から転送された被写体存在画像の画像フレームのYUVデータを生成した後、当該被写体存在画像のYUVデータを画像メモリ5に一時記憶させる。
また、撮像制御部3は、当該被写体存在画像の撮像の際の合焦位置や露出条件やホワイトバランス等の条件を固定した状態を維持する。
Subsequently, the image data generation unit 4 generates YUV data of the image frame of the subject existing image transferred from the electronic imaging unit 2 and then temporarily stores the YUV data of the subject existing image in the image memory 5.
Further, the imaging control unit 3 maintains a state in which conditions such as a focus position, an exposure condition, and a white balance at the time of imaging the subject existing image are fixed.

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

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

次に、切抜画像生成部8aの位置合わせ部は、算出された射影変換行例に基づいて被写体存在画像を射影変換することで、被写体存在画像のYUVデータと被写体非存在画像のYUVデータとを位置合わせする処理を行わせる(ステップS18)。   Next, the alignment unit of the cutout image generation unit 8a performs the projective transformation on the subject existing image based on the calculated projective conversion example, thereby obtaining the YUV data of the subject existing image and the YUV data of the subject nonexistent image. A process of aligning is performed (step S18).

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

次に、切抜画像生成部8aの位置情報生成部は、抽出された被写体領域の被写体存在画像内での位置を示すアルファマップを生成する(ステップS20)。   Next, the position information generation unit of the cutout image generation unit 8a generates an alpha map indicating the position of the extracted subject area in the subject existing image (step S20).

その後、切抜画像生成部8aは、被写体の画像を所定の単一色画像と合成した被写体切り抜き画像(図示略)の画像データを生成する処理を行わせる(ステップS21)。
具体的には、切抜画像生成部8aは、被写体存在画像、単一色画像及びアルファマップを読み出して画像メモリ5に展開した後、被写体存在画像の全ての画素について、アルファ値が0の画素については(α=0)、透過させ、アルファ値が0<α<1の画素については(0<α<1)、所定の単一色とブレンディングを行い、アルファ値が1の画素については(α=1)、何もせずに所定の単一色に対して透過させないようにする。
Thereafter, the cut-out image generation unit 8a performs a process of generating image data of a cut-out subject (not shown) obtained by combining the subject image with a predetermined single color image (step S21).
Specifically, the cut-out image generation unit 8a reads out the subject existing image, the single color image, and the alpha map and develops them in the image memory 5. Then, for all the pixels of the subject existing image, the pixels with an alpha value of 0 are obtained. (Α = 0), transmission is performed for a pixel with an alpha value of 0 <α <1, (0 <α <1), and blending with a predetermined single color is performed, and for a pixel with an alpha value of 1 (α = 1) ) Do nothing and do not allow transmission through a given single color.

その後、CPU13は、被写体切り抜き画像のYUVデータを、切抜画像生成部8aの位置情報生成部により生成されたアルファマップがExif情報として付帯されたExif形式の画像ファイルとし、例えば、当該被写体切り抜き画像の画像データの拡張子を「.jpe」とする一ファイルで記録媒体9の所定の記憶領域に記憶させる(ステップS22)。
なお、画像ファイルを記録媒体9の所定の記憶領域に記憶する際に、所定の処理内容を対応付けて記憶する。例えば、「明度を上げる」、「輝度を低くする」、「ボカシ処理を加える」などの処理内容が画像メモリ5に記憶されていて、この中から任意の画像処理内容を選択するようにし、選択した処理内容を当該画像ファイルと対応付けて記録媒体9の所定の記憶領域に記憶させる。
これにより、被写体切り抜き処理を終了する。
After that, the CPU 13 converts the YUV data of the subject clipped image into an Exif format image file in which the alpha map generated by the position information generation unit of the clipped image generation unit 8a is attached as Exif information. One file with an extension of image data “.jpe” is stored in a predetermined storage area of the recording medium 9 (step S22).
When the image file is stored in a predetermined storage area of the recording medium 9, predetermined processing contents are stored in association with each other. For example, processing contents such as “increase brightness”, “decrease brightness”, and “add blur processing” are stored in the image memory 5, and an arbitrary image processing content can be selected from among these. The processed contents are stored in a predetermined storage area of the recording medium 9 in association with the image file.
Thereby, the subject clipping process is completed.

次に、合成画像生成処理について図5〜図7を参照して詳細に説明する。
図5は、合成画像生成処理に係る動作の一例を示すフローチャートである。また、図6は、合成画像生成処理における画像合成処理に係る動作の一例を示すフローチャートである。
Next, the composite image generation process will be described in detail with reference to FIGS.
FIG. 5 is a flowchart illustrating an example of an operation related to the composite image generation process. FIG. 6 is a flowchart illustrating an example of an operation related to the image composition processing in the composite image generation processing.

合成画像生成処理は、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から画像合成モードが選択指示された場合に実行される処理である。
図5に示すように、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で合成画像の背景となる所望の背景画像B(図7(a)等参照)が選択して指定されると(ステップS31)、画像処理部8は、指定された背景画像Bの画像データを読み出して画像メモリ5に展開して、画像処理部8の顔検出部8bが、当該画像データに対する顔検出処理を行って背景画像B内から顔画像領域Aを検出する(ステップS32)。
The composite image generation processing 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 12b of the operation input unit 12 by the user. It is processing.
As shown in FIG. 5, based on a predetermined operation of the operation input unit 12 by the user, a desired background image B (FIG. 7 (a) as a background of the composite image among a plurality of images recorded on the recording medium 9 is displayed. )) Is selected and designated (step S31), the image processing unit 8 reads the image data of the designated background image B, develops it in the image memory 5, and detects the face of the image processing unit 8. The unit 8b performs face detection processing on the image data and detects the face image area A from the background image B (step S32).

次に、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で所望の被写体切り抜き画像が選択して指定されると(ステップS33)、画像処理部8は、指定された被写体切り抜き画像の画像データを読み出して画像メモリ5に展開する。   Next, when a desired subject cut-out image is selected and designated from among a plurality of images recorded on the recording medium 9 based on a predetermined operation of the operation input unit 12 by the user (step S33), image processing is performed. The unit 8 reads out the image data of the designated subject cutout image and develops it in the image memory 5.

続けて、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、背景画像Bにおける被写体切り抜き画像の被写体画像Gの合成位置が指定されると(ステップS34;図7(a)等参照)、画像処理部8の合成領域特定部8cは、背景画像B上の被写体画像Gが重畳された領域を背景画像Bにおける被写体切り抜き画像の被写体画像Gを合成すべき合成領域として特定する(ステップS35)。   Subsequently, when the synthesis position of the subject image G of the subject cut-out image in the background image B is designated based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user (step S34; FIG. 7A) and the like. The composite region specifying unit 8c of the image processing unit 8 specifies the region where the subject image G on the background image B is superimposed as the composite region to be combined with the subject image G of the subject cutout image in the background image B (see FIG. Step S35).

続けて、画像処理部8の領域判定部8dは、顔検出部8bにより検出された顔画像領域Aと合成領域特定部8cにより特定された被写体画像Gの合成領域とが重なるか否かを判定する(ステップS36)。
ここで、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なる(図7(b)参照)と判定されると(ステップS36;YES)、画像処理部8の加工処理部8eは、処理内容テーブルTに当該被写体画像Gと対応付けて登録されている所定の画像処理内容を取得して(ステップS37)、取得した画像処理内容に従って背景画像Bに対する画像処理を行う(ステップS38)。
例えば、被写体画像「感嘆符」が選択指定されている場合に、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なると、加工処理部8eは、処理内容テーブルTから画像処理内容「顔画像領域をびっくりした表情にする」を取得して、顔画像領域Aの目の白目部分を顔の外側方向に拡大するとともに、黒目部分を顔の内側方向に縮小するような画像処理を施す。また例えば、被写体画像Gとして処理テーブルTの「ライト」が選択されている場合は、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なると、加工処理部8eは、処理内容テーブルTから画像処理内容「合成領域を中心に明るくする」を取得して、当該合成領域を中心に背景画像Bが明るくなるような画像処理を施す。
Subsequently, the area determination unit 8d of the image processing unit 8 determines whether or not the face image area A detected by the face detection unit 8b overlaps with the synthesis area of the subject image G specified by the synthesis area specification unit 8c. (Step S36).
If it is determined that the face image area A of the background image B and the composite area of the subject image G overlap (see FIG. 7B) (step S36; YES), the processing unit 8e of the image processing unit 8 is determined. Acquires predetermined image processing content registered in association with the subject image G in the processing content table T (step S37), and performs image processing on the background image B according to the acquired image processing content (step S38). ).
For example, when the subject image “exclamation mark” is selected and designated, if the face image area A of the background image B overlaps with the composite area of the subject image G, the processing unit 8e performs image processing from the processing content table T. Image processing that obtains the content “make the face image area a surprised expression” and enlarges the white part of the eye of the face image area A in the outward direction of the face and reduces the black eye part in the inward direction of the face Apply. Further, for example, when “light” in the processing table T is selected as the subject image G, if the face image region A of the background image B and the composite region of the subject image G overlap, the processing unit 8e The image processing content “brighten around the combined area” is acquired from the table T, and image processing is performed so that the background image B is brightened around the combined area.

次に、画像処理部8は、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、背景画像Bにおける被写体切り抜き画像の被写体画像Gの合成位置が再指定されたか否かを判定する(ステップS39)。
ここで、被写体画像Gの合成位置が再指定されたと判定されると(ステップS39;YES)、画像処理部8は、処理をステップS35に移行して、それ以降の処理を実行する。
ステップS35以降の処理は、ステップS39にて、被写体画像Gの合成位置が再指定されていないと判定されるまで(ステップS39;NO)、繰り返し行われる。
そして、ステップS39にて、被写体画像Gの合成位置が再指定されていないと判定されると(ステップS39;NO)、画像処理部8の画像合成部8fは、背景画像Bと被写体切り抜き画像とを合成する画像合成処理を行う(ステップS40)。
また、ステップS36にて、被写体画像Gの合成領域と顔画像領域Aとが重なっていない(図7(a)、図7(c)等参照)と判定された場合にも(ステップS36;NO)、画像合成部8fは、画像合成処理を行う。
Next, the image processing unit 8 determines whether or not the composite position of the subject image G of the subject cutout image in the background image B has been redesignated based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user. (Step S39).
Here, if it is determined that the synthesis position of the subject image G has been redesignated (step S39; YES), the image processing unit 8 shifts the process to step S35 and executes the subsequent processes.
The processing after step S35 is repeatedly performed until it is determined in step S39 that the composition position of the subject image G has not been designated again (step S39; NO).
When it is determined in step S39 that the composition position of the subject image G has not been designated again (step S39; NO), the image composition unit 8f of the image processing unit 8 determines that the background image B, the subject cut-out image, and the like. An image synthesis process is performed to synthesize (step S40).
Further, when it is determined in step S36 that the composite area of the subject image G and the face image area A do not overlap (see FIG. 7A, FIG. 7C, etc.) (step S36; NO) ), The image composition unit 8f performs image composition processing.

ここで、画像合成処理について図6を参照して詳細に説明する。
画像合成処理は、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっている場合には、ステップS38にて所定の画像処理が施された背景画像Bを対象画像として行われ、一方、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっていない場合には、所定の画像処理が施されていない背景画像Bを対象画像として行われる。
なお、以下の説明にあっては、処理対象となる背景画像Bは所定の画像処理が施されているか否かに関わらず、単に背景画像Bと言う。
Here, the image composition processing will be described in detail with reference to FIG.
When the face image area A of the background image B and the composition area of the subject image G overlap, the image composition processing is performed using the background image B subjected to the predetermined image processing in step S38 as the target image. On the other hand, when the face image area A of the background image B and the composite area of the subject image G do not overlap, the background image B that has not been subjected to the predetermined image processing is performed as the target image.
In the following description, the background image B to be processed is simply referred to as the background image B regardless of whether or not predetermined image processing has been performed.

図6に示すように、画像合成部8fは、被写体切り抜き画像と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開する(ステップS51)。
なお、図5のステップS34やステップS39にて背景画像Bにおける被写体切り抜き画像の被写体画像Gの合成位置が指定された際に、背景画像Bとアルファマップとがずれてしまいアルファマップの範囲外となる領域については、α=0としてアルファ値が存在しない領域を生じさせないようにする。
As shown in FIG. 6, the image composition unit 8f reads the alpha map stored in association with the subject clipped image and develops it in the image memory 5 (step S51).
In addition, when the synthesis position of the subject image G of the subject cutout image in the background image B is designated in step S34 or step S39 in FIG. 5, the background image B and the alpha map are shifted, and are outside the range of the alpha map. For such a region, α = 0 is set so as not to generate a region having no alpha value.

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

続けて、画像合成部8fは、背景画像Bの全ての画素について処理したか否かを判定する(ステップS56)。
ここで、全ての画素について処理していないと判定されると(ステップS56;NO)、画像合成部8fは、処理対象として次の画素を指定して当該画素に処理対象を移動させて(ステップS57)、処理をステップS53に移行させる。
上記の処理を、ステップS56にて全ての画素について処理したと判定されるまで(ステップS56;YES)、繰り返すことで、画像合成部8fは、被写体切り抜き画像と背景画像Bとを合成した被写体合成画像Pの画像データを生成させる。
これにより、画像合成処理を終了する。
Subsequently, the image composition unit 8f determines whether or not all the pixels of the background image B have been processed (step S56).
If it is determined that all the pixels have not been processed (step S56; NO), the image composition unit 8f designates the next pixel as a processing target and moves the processing target to the pixel (step S56). S57), the process proceeds to step S53.
By repeating the above process until it is determined in step S56 that all pixels have been processed (step S56; YES), the image composition unit 8f composites the subject clipped image and the background image B. Image data of the image P is generated.
Thereby, the image composition process is terminated.

その後、図5に示すように、表示制御部10は、画像合成部8fにより生成された被写体合成画像Pの画像データに基づいて、背景画像Bに被写体画像Gが重畳された被写体合成画像Pを表示部11の表示画面に表示させる(ステップS41)。
具体的には、表示制御部10は、例えば、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっている場合には、所定の画像処理が施された背景画像Bに被写体画像Gが重畳された被写体合成画像Pb(図7(b)参照)を表示部11に表示させる。一方、表示制御部10は、例えば、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっていない場合には、所定の画像処理が施されていない背景画像Bに被写体画像Gが重畳された被写体合成画像Pa、Pc(図7(a)、図7(c)等参照)を表示部11に表示させる。
これにより、合成画像生成処理を終了する。
After that, as shown in FIG. 5, the display control unit 10 displays the subject composite image P in which the subject image G is superimposed on the background image B based on the image data of the subject composite image P generated by the image composition unit 8 f. It displays on the display screen of the display part 11 (step S41).
Specifically, for example, when the face image area A of the background image B and the composite area of the subject image G overlap, the display control unit 10 applies the subject to the background image B that has undergone predetermined image processing. The subject composite image Pb (see FIG. 7B) on which the image G is superimposed is displayed on the display unit 11. On the other hand, for example, when the face image area A of the background image B and the composite area of the subject image G do not overlap, the display control unit 10 applies the subject image G to the background image B that has not been subjected to predetermined image processing. Subject display images Pa and Pc (see FIG. 7A, FIG. 7C, etc.) superimposed on the display unit 11.
Thus, the composite image generation process is finished.

以上のように、本実施形態の撮像装置100によれば、背景画像Bにおける被写体切り抜き画像の被写体画像Gを合成すべき合成領域に基づいて、当該被写体画像G及び背景画像Bのうち、少なくとも何れか一方に所定の画像処理を施すので、従来のように被写体画像Gと背景画像Bとを単に合成するのではなく、被写体画像Gや背景画像Bに所定の画像処理を施された斬新な態様の被写体合成画像Pbを生成することができ、被写体合成画像Pbに違和感を生じさせて当該被写体合成画像Pbの興趣性の向上を図ることができる。
特に、背景画像Bにおける被写体画像Gを合成すべき合成領域として当該背景画像Bにおける顔画像領域Aが特定された場合に、処理内容テーブルTに被写体画像Gと対応付けて記憶されている所定の画像処理を被写体画像G及び背景画像Bのうち、少なくとも何れか一方に施すので、例えば、被写体画像Gと背景画像Bの顔画像領域Aとが重なってしまい顔画像領域A全体の視認が制限されてしまうような場合に、当該顔画像領域Aに対して所定の画像処理を施すことで、被写体合成画像Pbに違和感を生じさせて当該被写体合成画像Pbの興趣性の向上を図ることができる。
このように、背景画像Bと被写体画像Gとを合成して、効果的な被写体合成画像Pを得ることができる。
As described above, according to the imaging apparatus 100 of the present embodiment, at least one of the subject image G and the background image B is based on the synthesis region in which the subject image G of the subject clipped image in the background image B is to be synthesized. Since predetermined image processing is performed on one of them, a novel mode in which predetermined image processing is performed on the subject image G and the background image B, instead of simply combining the subject image G and the background image B as in the past. The subject composite image Pb can be generated, and the subject composite image Pb can be made uncomfortable to improve the interest of the subject composite image Pb.
In particular, when the face image area A in the background image B is specified as a synthesis area in which the subject image G in the background image B is to be synthesized, a predetermined content stored in the processing content table T in association with the subject image G is stored. Since the image processing is performed on at least one of the subject image G and the background image B, for example, the subject image G and the face image area A of the background image B overlap, and the visual recognition of the entire face image area A is restricted. In such a case, by applying predetermined image processing to the face image area A, it is possible to create a sense of incongruity in the subject composite image Pb and improve the interest of the subject composite image Pb.
In this way, an effective subject composite image P can be obtained by combining the background image B and the subject image G.

なお、本発明は、上記実施形態に限定されることなく、本発明の趣旨を逸脱しない範囲において、種々の改良並びに設計の変更を行っても良い。
以下に、撮像装置100の変形例について説明する。
ここで、撮像装置100の変形例は、以下に詳細に説明する以外の点で上記実施形態の撮像装置100と略同様の構成を成し、その説明は省略する
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.
Below, the modification of the imaging device 100 is demonstrated.
Here, the modified example of the imaging device 100 has substantially the same configuration as the imaging device 100 of the above-described embodiment except for the details described below, and the description thereof is omitted.

<変形例1>
変形例1の撮像装置100は、被写体画像Gの合成領域と背景画像Bにおける所定領域とが重なったと判定された場合に、加工処理部8eは、背景画像Bにおける当該所定領域の画像部分を被写体画像Gに対して優先的に表示させるように、被写体画像Gや背景画像Bに対して所定の画像処理を施す。
即ち、加工処理部8eは、領域判定部8dにより被写体画像Gの合成領域と顔画像領域(所定領域)Aとが重なったと判定された場合に、被写体画像Gを半透過の表示態様で表示されるように当該被写体画像Gに対して画像処理を施す。
なお、被写体画像Gの半透過の表示態様とは、被写体画像Gが透明と不透明の中間で表示された状態であり、当該被写体画像Gに重畳して後側に表示される背景画像Bの輪郭や色彩や明暗などを透過する程度の表示態様のことである。
<Modification 1>
When it is determined that the composite region of the subject image G and the predetermined region in the background image B overlap with each other, the processing unit 8e uses the image portion of the predetermined region in the background image B as the subject. Predetermined image processing is performed on the subject image G and the background image B so that the image G is displayed with priority.
That is, the processing unit 8e displays the subject image G in a semi-transparent display mode when the region determination unit 8d determines that the composite region of the subject image G and the face image region (predetermined region) A overlap. As described above, the subject image G is subjected to image processing.
The semi-transparent display mode of the subject image G is a state in which the subject image G is displayed in the middle of transparent and opaque, and the outline of the background image B displayed on the rear side superimposed on the subject image G. In other words, the display mode is such that the color, color, brightness, and the like are transmitted.

これにより、背景画像Bにおける当該顔画像領域Aの画像部分が被写体画像Gに対して優先的に表示される(図8参照)。
なお、背景画像Bにおける当該顔画像領域Aの画像部分を被写体画像Gに対して優先的に表示させる際に、被写体画像Gに所定の画像処理を施すようにしたが、これに限られるものではなく、背景画像Bに対して所定の画像処理を施すようにしても良い。また、背景画像Bの優先的な表示態様として、被写体画像Gの半透過の表示態様を例示したが、これに限られるものではなく、例えば、被写体画像Gの背景画像Bの顔画像領域Aと重なる部分を切り欠いたような表示態様や、被写体画像Gに対して背景画像Bの顔画像領域Aの方がより目立つように、これらの画像の明るさやコントラストや色調等を調整した表示態様などが挙げられる。
Thereby, the image portion of the face image area A in the background image B is preferentially displayed with respect to the subject image G (see FIG. 8).
Note that when the image portion of the face image area A in the background image B is displayed preferentially with respect to the subject image G, the subject image G is subjected to predetermined image processing. However, the present invention is not limited to this. Alternatively, predetermined image processing may be performed on the background image B. Further, as the preferential display mode of the background image B, the semi-transparent display mode of the subject image G has been exemplified, but the present invention is not limited to this. For example, the face image region A of the background image B of the subject image G Display mode in which overlapping portions are cut out, display mode in which the brightness, contrast, color tone, etc. of these images are adjusted so that the face image area A of the background image B is more conspicuous than the subject image G Is mentioned.

従って、変形例1の撮像装置100によれば、背景画像Bにおける被写体画像Gを合成すべき合成領域として当該背景画像Bにおける顔画像領域Aが特定された場合に、当該顔画像領域Aの画像部分を被写体画像Gに対して優先的に表示することができる。   Therefore, according to the imaging device 100 of the first modification, when the face image area A in the background image B is specified as the synthesis area in which the subject image G in the background image B is to be synthesized, the image of the face image area A The portion can be preferentially displayed with respect to the subject image G.

<変形例2>
変形例2の撮像装置100は、複数(例えば、20枚)の背景画像Bを含む連写背景画像と被写体画像Gとを合成する際に、加工処理部8eは、連写背景画像を構成する複数の背景画像B、…のうち、被写体画像Gの合成領域として顔画像領域Aが特定された背景画像Bの各々に所定の画像処理を施す。
<Modification 2>
When the imaging apparatus 100 according to the second modification synthesizes a continuous shot background image including a plurality of (for example, 20) background images B and the subject image G, the processing unit 8e configures the continuous shot background image. Among the plurality of background images B,..., Predetermined image processing is performed on each of the background images B in which the face image area A is specified as the synthesis area of the subject image G.

連写背景画像は、図示は省略するが、レンズ部1、電子撮像部2及び撮像制御部3により所定の撮像フレームレートで連続して撮像された複数の背景画像(フレーム画像)B、…からなる。
画像処理部8の顔検出部8bは、連写背景画像を構成する複数の背景画像B、…の各々に対する顔検出処理を行って顔画像領域Aを検出する。また、画像処理部8の合成領域特定部8cは、連写背景画像を構成する複数の背景画像B、…の各々における被写体切り抜き画像の被写体画像Gを合成すべき合成領域を特定する。
そして、画像処理部8の領域判定部8dは、合成領域特定部8cにより特定された各背景画像Bにおける被写体画像Gの合成領域と顔検出部8bにより各背景画像Bから検出された顔画像領域(所定領域)Aとが重なるか否かを判定する。即ち、領域判定部8dは、連写背景画像を構成する各背景画像(構成画像)B毎に、当該背景画像Bにおける顔画像領域(所定領域)Aが合成領域特定部8cにより特定されたか否かを判定する。
Although the continuous shooting background image is not shown in the drawing, from a plurality of background images (frame images) B,... Successively captured at a predetermined imaging frame rate by the lens unit 1, the electronic imaging unit 2, and the imaging control unit 3. Become.
The face detection unit 8b of the image processing unit 8 detects the face image area A by performing face detection processing on each of the plurality of background images B,. Further, the synthesis region specifying unit 8c of the image processing unit 8 specifies a synthesis region in which the subject image G of the subject cutout image in each of the plurality of background images B,.
Then, the region determination unit 8d of the image processing unit 8 includes the synthesis region of the subject image G in each background image B specified by the synthesis region specification unit 8c and the face image region detected from each background image B by the face detection unit 8b. It is determined whether or not (predetermined area) A overlaps. That is, for each background image (component image) B constituting the continuous shot background image, the region determination unit 8d determines whether the face image region (predetermined region) A in the background image B is specified by the composite region specifying unit 8c. Determine whether.

加工処理部8eは、連写背景画像を構成する複数の背景画像B、…のうち、領域判定部8dにより被写体画像Gの合成領域と顔画像領域(所定領域)Aとが重なると判定された背景画像Bの各々に所定の画像処理を施す。
なお、加工処理部8eは、上記のような連写背景画像を構成する複数の背景画像B、…に対する画像処理とともに、或いは、各背景画像Bに対する画像処理に替えて、被写体画像Gに対して所定の画像処理を施すようにしても良い。
The processing unit 8e determines that the combined region of the subject image G and the face image region (predetermined region) A are overlapped by the region determination unit 8d among the plurality of background images B constituting the continuous shot background image. Predetermined image processing is performed on each of the background images B.
The processing unit 8e performs image processing on the subject image G in addition to image processing on the plurality of background images B,... Constituting the continuous shooting background image as described above, or instead of image processing on each background image B. Predetermined image processing may be performed.

次に、変形例2の撮像装置100による合成画像生成処理について、図9を参照して説明する。
図9は、合成画像生成処理に係る動作の一例を示すフローチャートである。
Next, a composite image generation process performed by the imaging apparatus 100 according to Modification 2 will be described with reference to FIG.
FIG. 9 is a flowchart illustrating an example of an operation related to the composite image generation process.

図9に示すように、先ず、上記実施形態と略同様に、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で所望の被写体切り抜き画像が選択して指定されると(ステップS61)、画像処理部8は、指定された被写体切り抜き画像の画像データを読み出して画像メモリ5に展開する。   As shown in FIG. 9, first, in substantially the same manner as in the above-described embodiment, a desired subject cut-out image is selected from a plurality of images recorded on the recording medium 9 based on a predetermined operation of the operation input unit 12 by the user. When selected and designated (step S61), the image processing unit 8 reads out the image data of the designated subject cutout image and develops it in the image memory 5.

次に、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で合成画像の背景となる所望の連写背景画像(図示略)が選択して指定されると(ステップS62)、画像処理部8は、指定された連写背景画像の画像データを読み出して画像メモリ5に展開して、当該連写背景画像を構成する最初の背景画像Bを指定する(ステップS63)。また、画像処理部8は、連写背景画像の連写枚数に応じて被写体切り抜き画像を複製して、各背景画像Bに対応する被写体切り抜き画像を画像メモリ5に記憶しておく。
続けて、画像処理部8の顔検出部8bが、最初の背景画像Bの画像データに対する顔検出処理を行って当該背景画像B内から顔画像領域Aを検出する(ステップS64)。
Next, based on a predetermined operation of the operation input unit 12 by the user, a desired continuous shooting background image (not shown) as a background of the composite image is selected from a plurality of images recorded on the recording medium 9. When designated (step S62), the image processing unit 8 reads out the image data of the designated continuous shooting background image and develops it in the image memory 5 to obtain the first background image B constituting the continuous shooting background image. Designate (step S63). Further, the image processing unit 8 duplicates the subject cutout image according to the number of continuous shots of the continuous shot background image, and stores the subject cutout image corresponding to each background image B in the image memory 5.
Subsequently, the face detection unit 8b of the image processing unit 8 performs a face detection process on the image data of the first background image B to detect the face image region A from the background image B (step S64).

続けて、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、最初の背景画像Bにおける被写体切り抜き画像の被写体画像Gの合成位置が指定されると(ステップS65)、画像処理部8の合成領域特定部8cは、最初の背景画像B上の被写体画像Gが重畳された領域を背景画像Bにおける被写体切り抜き画像の被写体画像Gを合成すべき合成領域として特定する(ステップS66)。   Subsequently, when the combination position of the subject image G of the subject cutout image in the first background image B is designated based on a predetermined operation of the selection determination button 12b of the operation input unit 12 by the user (step S65), the image processing unit The composite region specifying unit 8c in FIG. 8 specifies the region in which the subject image G on the first background image B is superimposed as the composite region to be combined with the subject image G of the subject cutout image in the background image B (step S66).

続けて、画像処理部8の領域判定部8dは、顔検出部8bにより検出された顔画像領域Aと合成領域特定部8cにより特定された被写体画像Gの合成領域とが重なるか否かを判定する(ステップS67)。
ここで、背景画像Bにおける顔画像領域Aと被写体画像Gの合成領域とが重なる(図7(b)参照)と判定されると(ステップS67;YES)、画像処理部8の加工処理部8eは、処理内容テーブルTに当該被写体画像Gと対応付けて登録されている所定の画像処理内容を取得して(ステップS68)、取得した画像処理内容に従って処理対象の背景画像Bに対する画像処理を行う(ステップS69)。
なお、画像処理の具体的な内容は、上記実施形態にて説明したものと同一であり、その詳細な説明は省略する。
Subsequently, the area determination unit 8d of the image processing unit 8 determines whether or not the face image area A detected by the face detection unit 8b overlaps with the synthesis area of the subject image G specified by the synthesis area specification unit 8c. (Step S67).
If it is determined that the face image area A in the background image B and the composite area of the subject image G overlap (see FIG. 7B) (step S67; YES), the processing unit 8e of the image processing unit 8 is determined. Acquires predetermined image processing content registered in the processing content table T in association with the subject image G (step S68), and performs image processing on the background image B to be processed in accordance with the acquired image processing content. (Step S69).
The specific contents of the image processing are the same as those described in the above embodiment, and a detailed description thereof is omitted.

次に、画像処理部8は、連写背景画像を構成する複数の背景画像B、…の中で処理対象となっている背景画像Bが最初の背景画像Bであるか否かを判定する(ステップS70)。また、ステップS67にて、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっていないと判定された場合にも(ステップS67;NO)、画像処理部8は、処理をステップS70に移行して、処理対象の背景画像Bが最初の背景画像Bであるか否かを判定する。   Next, the image processing unit 8 determines whether or not the background image B to be processed among the plurality of background images B constituting the continuous shot background image is the first background image B ( Step S70). Even when it is determined in step S67 that the face image area A of the background image B and the composite area of the subject image G do not overlap (step S67; NO), the image processing unit 8 performs the process. The process proceeds to S70 to determine whether or not the background image B to be processed is the first background image B.

ステップS70にて、処理対象の背景画像Bが最初の背景画像Bであると判定されると(ステップS70;YES)、画像処理部8は、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、最初の背景画像Bにおける被写体切り抜き画像の被写体画像Gの合成位置が再指定されたか否かを判定する(ステップS71)。
ここで、被写体画像Gの合成位置が再指定されたと判定されると(ステップS71;YES)、画像処理部8は、処理をステップS66に移行して、それ以降の処理を実行する。
ステップS66以降の処理は、ステップS71にて、被写体画像Gの合成位置が再指定されていないと判定されるまで(ステップS71;NO)、繰り返し行われる。
そして、ステップS71にて、被写体画像Gの合成位置が再指定されていないと判定されると(ステップS71;NO)、画像処理部8の画像合成部8fは、処理対象の背景画像Bと被写体切り抜き画像とを合成する画像合成処理を行う(ステップS40)。
When it is determined in step S70 that the background image B to be processed is the first background image B (step S70; YES), the image processing unit 8 determines the selection determination button 12b of the operation input unit 12 by the user. Based on the operation, it is determined whether or not the synthesis position of the subject image G of the subject cutout image in the first background image B has been designated again (step S71).
Here, if it is determined that the composition position of the subject image G has been redesignated (step S71; YES), the image processing unit 8 shifts the processing to step S66 and executes the subsequent processing.
The processing after step S66 is repeatedly performed until it is determined in step S71 that the composition position of the subject image G has not been designated again (step S71; NO).
When it is determined in step S71 that the composition position of the subject image G has not been designated again (step S71; NO), the image composition unit 8f of the image processing unit 8 performs processing on the background image B and the subject. An image synthesis process for synthesizing the clipped image is performed (step S40).

画像合成処理は、連写背景画像の中から指定された背景画像B(例えば、最初の背景画像B等)を処理対象として実行する以外は、上記実施形態と略同様であり、詳細な説明は省略する。
これにより、処理対象の背景画像B(例えば、最初の背景画像B)に被写体切り抜き画像の被写体画像Gが重畳された被写体合成画像Pが生成される。なお、生成された被写体合成画像Pの画像データは、画像メモリ5に一時記憶される。
The image composition process is substantially the same as the above embodiment except that the background image B (for example, the first background image B, etc.) designated from the continuous shot background image is executed as a processing target. Omitted.
As a result, a subject composite image P in which the subject image G of the subject cutout image is superimposed on the background image B to be processed (for example, the first background image B) is generated. Note that the generated image data of the subject composite image P is temporarily stored in the image memory 5.

次に、画像処理部8は、連写背景画像を構成する複数の背景画像B、…の全てについて処理したか否かを判定する(ステップS72)。
ここで、背景画像Bの全てについて処理していないと判定されると(ステップS72;NO)、画像処理部8は、処理対象として次の背景画像B(例えば、二枚目の背景画像B)を指定して当該背景画像Bに処理対象を移動させる(ステップS73)。続けて、画像処理部8の顔検出部8bは、処理対象の背景画像Bの画像データに対する顔検出処理を行って当該背景画像B内から顔画像領域Aを検出した後(ステップS74)、処理をステップS66に移行させる。
Next, the image processing unit 8 determines whether or not all of the plurality of background images B,... Constituting the continuous shot background image have been processed (step S72).
Here, when it is determined that all the background images B have not been processed (step S72; NO), the image processing unit 8 sets the next background image B (for example, the second background image B) as the processing target. And the processing target is moved to the background image B (step S73). Subsequently, the face detection unit 8b of the image processing unit 8 performs a face detection process on the image data of the background image B to be processed to detect the face image region A from the background image B (step S74), and then performs processing. Is shifted to step S66.

画像処理部8は、上記の処理をステップS72にて複数の背景画像B、…の全てについて処理したと判定されるまで(ステップS72;YES)、繰り返す。
ここで、処理対象が二枚目以降の背景画像Bに指定された場合、ステップS70にて、処理対象の背景画像Bが最初の背景画像Bでないと判定されることから(ステップS70;NO)、画像処理部8は、ステップS71の処理をとばして、画像合成部8fが、処理対象の背景画像Bと被写体切り抜き画像とを合成する画像合成処理を行う(ステップS40)。
The image processing unit 8 repeats the above processing until it is determined in step S72 that all of the plurality of background images B,... Have been processed (step S72; YES).
Here, when the processing target is designated as the second and subsequent background images B, it is determined in step S70 that the processing target background image B is not the first background image B (step S70; NO). The image processing unit 8 skips the process of step S71, and the image composition unit 8f performs image composition processing for compositing the background image B to be processed and the subject cutout image (step S40).

そして、ステップS72にて、複数の背景画像B、…の全てについて処理したと判定されると(ステップS72;YES)、表示制御部10は、画像合成部8fにより生成された複数の被写体合成画像P、…の画像データに基づいて、被写体合成動画像を表示部11の表示画面に表示させる(ステップS75)。
具体的には、表示制御部10は、画像メモリ5から複数の被写体合成画像P、…の画像データを取得して、複数の被写体合成画像P、…を所定の表示フレームレートで切り換えて表示部11の表示画面に再生表示させることで、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっている場合には、所定の画像処理が施された背景画像Bに被写体画像Gが重畳された被写体合成画像Pを表示部11に表示させ、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっていない場合には、所定の画像処理が施されていない背景画像Bに被写体画像Gが重畳された被写体合成画像Pを表示部11に表示させる。
これにより、合成画像生成処理を終了する。
If it is determined in step S72 that all of the plurality of background images B,... Have been processed (step S72; YES), the display control unit 10 displays the plurality of subject composite images generated by the image composition unit 8f. Based on the image data of P,..., The subject synthesized moving image is displayed on the display screen of the display unit 11 (step S75).
Specifically, the display control unit 10 acquires image data of a plurality of subject composite images P,... From the image memory 5 and switches the plurality of subject composite images P,... At a predetermined display frame rate. When the face image area A of the background image B and the composite area of the subject image G overlap each other by being reproduced and displayed on the display screen 11, the subject image G is added to the background image B subjected to predetermined image processing. Is displayed on the display unit 11, and when the face image area A of the background image B and the composite area of the subject image G do not overlap, the background that has not been subjected to the predetermined image processing The subject composite image P in which the subject image G is superimposed on the image B is displayed on the display unit 11.
Thus, the composite image generation process is finished.

従って、変形例2の撮像装置100によれば、連写背景画像を構成する複数の背景画像B、…のうち、被写体画像Gの合成領域として顔画像領域Aが特定された背景画像Bの各々に所定の画像処理を施すので、背景画像Bの顔画像領域Aと被写体画像Gの合成領域とが重なっているか否かに応じて、被写体画像Gが所定の画像処理が施された背景画像Bに重畳された被写体合成画像Pと所定の画像処理が施されていない背景画像Bに重畳された被写体合成画像Pとを切り替えて表示することができ、斬新な態様の被写体合成動画像を生成することができ、被写体合成動画像に違和感を生じさせて当該被写体合成動画像の興趣性の向上を図ることができる。   Therefore, according to the imaging apparatus 100 of the second modification, each of the background images B in which the face image area A is specified as the synthesis area of the subject image G among the plurality of background images B,. Since the predetermined image processing is performed on the background image B, the subject image G is subjected to the predetermined image processing depending on whether the face image area A of the background image B and the composite area of the subject image G are overlapped. The subject composite image P superimposed on the subject image and the subject composite image P superimposed on the background image B that has not been subjected to the predetermined image processing can be switched and displayed, and a novel subject composite moving image is generated. This makes it possible to create a sense of incongruity in the subject synthesized moving image and improve the interest of the subject synthesized moving image.

なお、上記変形例2にあっては、背景画像Bとして、複数の背景画像B、…を含む連写背景画像を例示したが、処理対象画像はこれに限られるものではなく、複数の画像フレーム(構成画像)を含む動画像であっても良い。   In the second modification, a continuous background image including a plurality of background images B,... Is exemplified as the background image B. However, the processing target image is not limited to this, and a plurality of image frames. It may be a moving image including (composition image).

また、上記実施形態にあっては、合成画像生成処理にて、背景画像Bにおける被写体画像Gの合成領域として当該背景画像Bにおける顔画像領域(所定領域)Aが特定された場合に、背景画像Bや被写体画像Gに対して所定の画像処理を施すようにしたが、画像処理の実行タイミングはこれに限られるものではない。
例えば、背景画像Bにおける被写体画像Gの合成領域が特定された場合に、当該被写体画像Gの合成領域に基づいて、背景画像Bや被写体画像Gに対して所定の画像処理を施すようにしても良い。即ち、例えば、略中央部近傍に比較的重要な被写体が配置された構図で静止画撮像される場合があるが、被写体画像Gの合成領域が背景画像Bの略中央部近傍である場合には、被写体画像Gと背景画像Bにおける比較的重要な被写体が重なった状態となる虞がある。そこで、かかる場合を考慮して、背景画像Bにおける被写体画像Gを合成すべき合成領域に基づいて、背景画像Bや被写体画像Gに対して所定の画像処理を施すようにしても良い。
さらに、例えば、背景画像Bにおける被写体画像Gの合成領域が特定された後、画像合成処理にて実際に背景画像Bと被写体画像Gとを合成する際に、背景画像Bや被写体画像Gに対して所定の画像処理を施すようにしても良い。
In the above embodiment, when the face image region (predetermined region) A in the background image B is specified as the composite region of the subject image G in the background image B in the composite image generation process, the background image Although predetermined image processing is performed on B and subject image G, the execution timing of image processing is not limited to this.
For example, when the composite region of the subject image G in the background image B is specified, predetermined image processing may be performed on the background image B or the subject image G based on the composite region of the subject image G. good. That is, for example, a still image may be taken with a composition in which a relatively important subject is arranged in the vicinity of the approximate center, but when the composite area of the subject image G is in the vicinity of the approximate center of the background image B, for example. There is a possibility that a relatively important subject in the subject image G and the background image B overlaps each other. Therefore, in consideration of such a case, predetermined image processing may be performed on the background image B or the subject image G based on the synthesis region in which the subject image G in the background image B is to be synthesized.
Further, for example, after the synthesis region of the subject image G in the background image B is specified, when the background image B and the subject image G are actually synthesized in the image synthesis process, the background image B and the subject image G are combined. Then, predetermined image processing may be performed.

また、上記実施形態にあっては、背景画像Bにおける所定領域として顔画像領域Aを例示したが、所定領域の種類はこれに限られるものではない。例えば、背景画像Bに対して画像認識処理を行って、例えば、色、明るさ、コントラスト、高周波成分情報などの画像の各種情報を利用して主要被写体の画素集合の輪郭を抽出して、当該主要被写体の画像部分を所定領域としても良い。
さらに、この所定領域は被写体画像Gごとに設定できるようにしても良い。図2に示した処理内容テーブルTを例にとると、被写体画像Gとしての「感嘆符」は、画像処理の処理内容として「顔画像領域をびっくりした表情にする」と対応付けられているが、これに加えて所定領域として「顔画像領域」が対応付けられているものとする。つまり、「感嘆符」の合成領域が背景画像Bにおける顔画像領域と重なる場合に、当該顔画像領域を「びっくりした表示にする」処理を施すようにする。また、被写体画像Gとしての「ライト」は、画像処理の処理内容として「合成領域を中心に明るくする」に加えて所定領域として「暗い領域」が対応付けられており、「ライト」の合成領域が背景画像Bにおける暗い領域(例えば輝度が所定値以下である領域)と重なる場合に、「合成領域を中心に明るくする」処理を施すようにしても良い。
また、処理内容テーブルTには被写体画像Gごとに、加工処理部8eによる背景画像Bや被写体画像Gに対する所定の画像処理の処理範囲を対応付けて記憶できるようにしても良い。
また、被写体画像Gの種類に関係なく、背景画像における所定領域と処理内容とを対応付けて記録できるようにしてもよい。例えば、所定領域として「顔画像領域」が記憶されていて、処理内容として「顔画像領域をびっくりした表示にする」と対応付けられている場合は、いかなる被写体画像Gであっても、合成領域が顔画像領域と重なった場合は当該顔画像領域をびっくりした表示にするように画像処理を施すようにしても良い。
Moreover, in the said embodiment, although the face image area | region A was illustrated as a predetermined area | region in the background image B, the kind of predetermined area | region is not restricted to this. For example, an image recognition process is performed on the background image B, and for example, the outline of the pixel set of the main subject is extracted using various information of the image such as color, brightness, contrast, and high frequency component information. The image portion of the main subject may be a predetermined area.
Further, this predetermined area may be set for each subject image G. Taking the processing content table T shown in FIG. 2 as an example, the “exclamation mark” as the subject image G is associated with “make the face image area a surprising expression” as the processing content of the image processing. In addition to this, it is assumed that a “face image area” is associated as a predetermined area. That is, when the composite area of “exclamation mark” overlaps with the face image area in the background image B, the face image area is subjected to the process of “displaying it astonishingly”. In addition, “light” as the subject image G is associated with “dark area” as a predetermined area in addition to “brighten around the synthesis area” as the processing content of the image processing. May overlap with a dark area in the background image B (for example, an area having a luminance equal to or lower than a predetermined value), a process of “brightening around the combined area” may be performed.
Further, the processing content table T may store a processing range of predetermined image processing for the background image B and the subject image G by the processing unit 8e in association with each subject image G.
Further, regardless of the type of the subject image G, the predetermined area in the background image and the processing content may be recorded in association with each other. For example, when “face image area” is stored as the predetermined area and associated with “display the face image area astonishingly” as the processing content, any subject image G can be combined. When the face image area overlaps with the face image area, image processing may be performed so that the face image area is displayed in an astonishing manner.

さらに、上記実施形態にあっては、被写体切り抜き画像の被写体画像Gを前景画像として背景画像Bと合成するようにしたが、前景画像の種類はこれに限られるものではなく、背景画像Bに重畳して合成される画像であれば如何なる画像であっても良い。   Furthermore, in the above embodiment, the subject image G of the subject cutout image is combined with the background image B as a foreground image. However, the type of the foreground image is not limited to this, and is superimposed on the background image B. Any image may be used as long as it is an image to be synthesized.

また、上記実施形態にあっては、加工処理部8eは、背景画像Bや被写体画像Gに対する所定の画像処理を背景画像Bにおける被写体画像Gの合成領域を基準として行うようにしたが、所定の画像処理の基準はこれに限られるものではない。
即ち、加工処理部8eは、処理内容テーブルT(図2参照)に被写体画像Gと対応付けて登録されている所定の画像処理を、背景画像B及び被写体画像Gのうち、少なくとも何れか一方に画像処理を施すようにしても良い。
このような構成としても、従来のように被写体画像Gと背景画像Bとを単に合成するのではなく、被写体画像Gや背景画像Bに所定の画像処理を施された斬新な態様の被写体合成画像Pを生成することができ、当該被写体合成画像Pの興趣性の向上を図ることができる。
In the above embodiment, the processing unit 8e performs predetermined image processing on the background image B and the subject image G on the basis of the composite region of the subject image G in the background image B. The standard for image processing is not limited to this.
That is, the processing unit 8e applies predetermined image processing registered in association with the subject image G in the processing content table T (see FIG. 2) to at least one of the background image B and the subject image G. Image processing may be performed.
Even in such a configuration, the subject image G and the background image B are not simply synthesized as in the prior art, but the subject composite image in a novel form in which the subject image G and the background image B are subjected to predetermined image processing. P can be generated, and the interest of the subject composite image P can be improved.

さらに、撮像装置100の構成は、上記実施形態に例示したものは一例であり、これに限られるものではない。即ち、画像処理装置として、撮像装置100を例示したが、これに限られるものではない。例えば、背景画像Bや被写体画像Gの生成は、当該撮像装置100とは異なる撮像装置(図示略)にて行い、この撮像装置から転送された画像データを記録して合成画像生成処理を実行する画像処理装置であっても良い。   Furthermore, the configuration of the imaging apparatus 100 is merely an example illustrated in the above embodiment, and is not limited thereto. That is, although the imaging apparatus 100 is illustrated as an image processing apparatus, it is not limited to this. For example, the background image B and the subject image G are generated by an imaging device (not shown) different from the imaging device 100, and the image data transferred from the imaging device is recorded to execute a composite image generation process. An image processing apparatus may be used.

加えて、上記実施形態にあっては、CPU13の制御下にて、画像処理部8の合成領域特定部8cや加工処理部8eが駆動することにより本発明が実現される構成としたが、これに限られるものではなく、CPU13によって所定のプログラム等が実行されることにより実現される構成としても良い。
即ち、プログラムを記憶するプログラムメモリ(図示略)に、特定処理ルーチン、画像処理ルーチン及び合成処理ルーチンを含むプログラム、或いは画像処理ルーチン及び合成処理ルーチンを含むプログラムを記憶しておく。そして、特定処理ルーチンによりCPU13を、背景画像Bにおける被写体画像(前景画像)Gを合成すべき領域を特定する特定手段として機能させるようにしても良い。また、画像処理ルーチンによりCPU13を、特定手段により特定された前景画像を合成すべき領域に基づいて、当該前景画像及び背景画像Bの少なくとも一方に所定の処理を施す画像処理手段として機能させるようにしても良い。また、合成処理ルーチンによりCPU13を、画像処理手段によって少なくとも一方に所定の処理が施された前景画像と背景画像とを合成する合成手段として機能っせるようにしても良い。
また、画像処理ルーチンによりCPU13を、記憶部に前景画像と対応付けて記憶されている所定の処理を、当該前景画像及び背景画像Bの少なくとも一方に施す画像処理手段として機能させるようにしても良い。また、合成処理ルーチンによりCPU13を、画像処理手段によって少なくとも一方に所定の処理が施された前景画像と背景画像とを合成する合成手段として機能させるようにしても良い。
In addition, in the above embodiment, the present invention is realized by driving the synthesis region specifying unit 8c and the processing unit 8e of the image processing unit 8 under the control of the CPU 13. However, the present invention is not limited to this, and a configuration realized by executing a predetermined program or the like by the CPU 13 may be adopted.
That is, a program including a specific processing routine, an image processing routine, and a composition processing routine, or a program including an image processing routine and a composition processing routine is stored in a program memory (not shown) that stores the program. Then, the CPU 13 may be caused to function as a specifying unit that specifies a region where the subject image (foreground image) G in the background image B is to be synthesized by a specifying process routine. Further, the image processing routine causes the CPU 13 to function as an image processing unit that performs a predetermined process on at least one of the foreground image and the background image B based on the region where the foreground image specified by the specifying unit is to be synthesized. May be. Further, the CPU 13 may be caused to function as a synthesis unit that synthesizes the foreground image and the background image on which at least one of the predetermined processing has been performed by the image processing unit by the synthesis processing routine.
Further, the CPU 13 may function as an image processing unit that performs predetermined processing stored in the storage unit in association with the foreground image on at least one of the foreground image and the background image B by the image processing routine. . Further, the CPU 13 may be caused to function as a synthesis unit that synthesizes the foreground image and the background image on which at least one of the predetermined processing has been performed by the image processing unit by the synthesis processing routine.

100 撮像装置
1 レンズ部
2 電子撮像部
3 撮像制御部
8 画像処理部
8b 顔検出部
8c 合成領域特定部
8d 領域判定部
8e 加工処理部
8f 画像合成部
13 CPU
T 処理内容テーブル
DESCRIPTION OF SYMBOLS 100 Imaging device 1 Lens part 2 Electronic imaging part 3 Imaging control part 8 Image processing part 8b Face detection part 8c Composite area specific | specification part 8d Area | region determination part 8e Processing process part 8f Image composition part 13 CPU
T processing contents table

Claims (12)

背景画像に前景画像を合成する合成手段を備えた画像処理装置において、
前記背景画像における前記前景画像を合成すべき領域を特定する特定手段と、
この特定手段により特定された前記前景画像を合成すべき領域に基づいて、当該前景画像及び前記背景画像の少なくとも一方に所定の処理を施す画像処理手段と、
を備え、
前記合成手段は、前記画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像と前記背景画像とを合成することを特徴とする画像処理装置。
In an image processing apparatus provided with a combining unit that combines a foreground image with a background image,
Specifying means for specifying an area in the background image to be combined with the foreground image;
Image processing means for performing a predetermined process on at least one of the foreground image and the background image based on the region to be combined with the foreground image specified by the specifying means;
With
The image processing apparatus, wherein the synthesizing unit synthesizes the foreground image and the background image that have been subjected to predetermined processing on at least one of the image processing units.
前記前景画像と所定の処理とを対応付けて記憶する記憶手段を更に備え、
前記画像処理手段は、前記特定手段により特定された前記前景画像を合成すべき領域に基づいて、前記記憶手段に前記前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び前記背景画像の少なくとも一方に施すことを特徴とする請求項1に記載の画像処理装置。
Storage means for storing the foreground image and a predetermined process in association with each other;
The image processing means performs the predetermined processing stored in the storage means in association with the foreground image based on the region to be synthesized with the foreground image specified by the specifying means. The image processing apparatus according to claim 1, wherein the image processing apparatus is applied to at least one of the background images.
前記特定手段により前記前景画像を合成すべき領域として前記背景画像における所定領域が特定されたか否かを判定する判定手段を更に備え、
前記画像処理手段は、前記判定手段により前記背景画像における所定領域が特定されたと判定された場合に、前記前景画像及び前記背景画像の少なくとも一方に所定の処理を施すことを特徴とする請求項1又は2に記載の画像処理装置。
Determination means for determining whether or not a predetermined area in the background image is specified as an area to be combined with the foreground image by the specifying means;
The image processing means performs a predetermined process on at least one of the foreground image and the background image when the determination means determines that a predetermined area in the background image is specified. Or the image processing apparatus of 2.
前記画像処理手段は、前記判定手段により前記背景画像における所定領域が特定されたと判定された場合に、前記背景画像における前記所定領域の画像部分を前記前景画像に対して優先的に表示させるように、前記前景画像及び前記背景画像の少なくとも一方に所定の処理を施すことを特徴とする請求項3に記載の画像処理装置。   The image processing unit preferentially displays an image portion of the predetermined region in the background image with respect to the foreground image when the determination unit determines that the predetermined region in the background image is specified. The image processing apparatus according to claim 3, wherein predetermined processing is performed on at least one of the foreground image and the background image. 前記背景画像は、複数のフレーム画像からなる連写画像若しくは動画像であり、
前記判定手段は、前記連写画像若しくは動画像を構成する各フレーム画像毎に、当該フレーム画像における所定領域が前記特定手段により特定されたか否かを判定し、
前記画像処理手段は、前記複数のフレーム画像のうち、前記判定手段により所定領域が特定されたと判定されたフレーム画像及び前記前景画像の少なくとも一方に所定の処理を施すことを特徴とする請求項3又は4に記載の画像処理装置。
The background image is a continuous image or a moving image composed of a plurality of frame images,
The determination means determines, for each frame image constituting the continuous shot image or moving image, whether or not a predetermined area in the frame image is specified by the specifying means,
The image processing means performs a predetermined process on at least one of the frame image and the foreground image determined to have specified a predetermined area by the determination means among the plurality of frame images. Or the image processing apparatus of 4.
前記所定領域は、前記背景画像から検出された顔画像領域であることを特徴とする請求項3〜5の何れか一項に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the predetermined area is a face image area detected from the background image. 背景画像に前景画像を合成する合成手段を備えた画像処理装置において、
前記前景画像と所定の処理とを対応付けて記憶する記憶手段と、
この記憶手段に前記前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び前記背景画像の少なくとも一方に施す画像処理手段と、
を備え、
前記合成手段は、前記画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像と前記背景画像とを合成することを特徴とする画像処理装置。
In an image processing apparatus provided with a combining unit that combines a foreground image with a background image,
Storage means for storing the foreground image and predetermined processing in association with each other;
Image processing means for applying the predetermined processing stored in the storage means in association with the foreground image to at least one of the foreground image and the background image;
With
The image processing apparatus, wherein the synthesizing unit synthesizes the foreground image and the background image that have been subjected to predetermined processing on at least one of the image processing units.
前記背景画像における前記前景画像を合成すべき領域を特定する特定手段を更に備え、
前記画像処理手段は、前記特定手段により前記前景画像を合成すべき領域として特定された前記背景画像における所定領域から所定の範囲内の前記背景画像に所定の処理を施すことを特徴とする請求項7に記載の画像処理装置。
A specifying unit for specifying a region in the background image to be combined with the foreground image;
The image processing means performs a predetermined process on the background image within a predetermined range from a predetermined area in the background image specified as an area to be synthesized with the foreground image by the specifying means. 8. The image processing apparatus according to 7.
背景画像における前景画像を合成すべき領域を特定するステップと、
上記ステップにて特定された前記前景画像を合成すべき領域に基づいて、当該前景画像及び前記背景画像の少なくとも一方に所定の処理を施すステップと、
上記ステップにて少なくとも一方に所定の処理を施された前記前景画像と前記背景画像とを合成するステップと
を含むことを特徴とする画像処理方法。
Identifying a region in the background image where the foreground image is to be synthesized;
Performing a predetermined process on at least one of the foreground image and the background image based on the region to be combined with the foreground image specified in the step;
And a step of synthesizing the foreground image and the background image that have been subjected to a predetermined process in at least one of the steps.
予め前景画像と所定の処理とを対応付けて記憶し、当該前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び当該前景画像が合成される背景画像の少なくとも一方に施すステップと、
上記ステップにて少なくとも一方に所定の処理を施された前記前景画像と前記背景画像とを合成するステップと
を含むことを特徴とする画像処理方法。
A foreground image and a predetermined process are stored in association with each other in advance, and the predetermined process stored in association with the foreground image is applied to at least one of the foreground image and the background image with which the foreground image is synthesized. Steps,
And a step of synthesizing the foreground image and the background image that have been subjected to a predetermined process in at least one of the steps.
画像処理装置のコンピュータを、
背景画像における前景画像を合成すべき領域を特定する特定手段、
この特定手段により特定された前記前景画像を合成すべき領域に基づいて、当該前景画像及び前記背景画像の少なくとも一方に所定の処理を施す画像処理手段、
この画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像と前記背景画像とを合成する合成手段
として機能させることを特徴とするプログラム。
The computer of the image processing device
A specifying means for specifying a region in the background image to be synthesized with the foreground image;
Image processing means for performing a predetermined process on at least one of the foreground image and the background image based on the region to be combined with the foreground image specified by the specifying means;
A program that functions as a combining unit that combines the foreground image and the background image that have been subjected to predetermined processing on at least one of them by the image processing unit.
前景画像と所定の処理とを対応付けて記憶させる記憶部を有する画像処理装置のコンピュータを、
前記記憶部に前景画像と対応付けて記憶されている前記所定の処理を、当該前景画像及び前記背景画像の少なくとも一方に施す画像処理手段、
この画像処理手段によって少なくとも一方に所定の処理が施された前記前景画像及び前記背景画像を合成する合成手段
として機能させることを特徴とするプログラム。
A computer of an image processing apparatus having a storage unit that stores a foreground image and a predetermined process in association with each other,
Image processing means for applying the predetermined processing stored in the storage unit in association with the foreground image to at least one of the foreground image and the background image;
A program that functions as a combining unit that combines the foreground image and the background image that have been subjected to predetermined processing on at least one of them by the image processing unit.
JP2009227623A 2009-09-30 2009-09-30 Image processing apparatus, image processing method, and program Active JP5636660B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009227623A JP5636660B2 (en) 2009-09-30 2009-09-30 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009227623A JP5636660B2 (en) 2009-09-30 2009-09-30 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2011077850A true JP2011077850A (en) 2011-04-14
JP5636660B2 JP5636660B2 (en) 2014-12-10

Family

ID=44021344

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009227623A Active JP5636660B2 (en) 2009-09-30 2009-09-30 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP5636660B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013246189A (en) * 2012-05-23 2013-12-09 Casio Comput Co Ltd Imaging device and imaging processing method, and program
JP2015211395A (en) * 2014-04-28 2015-11-24 オリンパス株式会社 Information apparatus, image processing method, and program

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07175587A (en) * 1993-10-28 1995-07-14 Hitachi Ltd Information processor
JPH11102434A (en) * 1997-07-31 1999-04-13 Sony Corp Image processor and its method
JPH11306375A (en) * 1998-04-23 1999-11-05 Internatl Business Mach Corp <Ibm> Method and device for picture composition processing
JPH11317909A (en) * 1998-02-02 1999-11-16 Matsushita Electric Ind Co Ltd Picture synthesis method/device and data recording medium
JP2005260630A (en) * 2004-03-12 2005-09-22 Seiko Epson Corp Image composition by superposing images together to generate composite image
JP2005270378A (en) * 2004-03-25 2005-10-06 Nobutaka Nishikata Information output device, communication system and computer program
JP2006060719A (en) * 2004-08-23 2006-03-02 Make Softwear:Kk Apparatus and method for image editing

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07175587A (en) * 1993-10-28 1995-07-14 Hitachi Ltd Information processor
JPH11102434A (en) * 1997-07-31 1999-04-13 Sony Corp Image processor and its method
JPH11317909A (en) * 1998-02-02 1999-11-16 Matsushita Electric Ind Co Ltd Picture synthesis method/device and data recording medium
JPH11306375A (en) * 1998-04-23 1999-11-05 Internatl Business Mach Corp <Ibm> Method and device for picture composition processing
JP2005260630A (en) * 2004-03-12 2005-09-22 Seiko Epson Corp Image composition by superposing images together to generate composite image
JP2005270378A (en) * 2004-03-25 2005-10-06 Nobutaka Nishikata Information output device, communication system and computer program
JP2006060719A (en) * 2004-08-23 2006-03-02 Make Softwear:Kk Apparatus and method for image editing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013246189A (en) * 2012-05-23 2013-12-09 Casio Comput Co Ltd Imaging device and imaging processing method, and program
JP2015211395A (en) * 2014-04-28 2015-11-24 オリンパス株式会社 Information apparatus, image processing method, and program

Also Published As

Publication number Publication date
JP5636660B2 (en) 2014-12-10

Similar Documents

Publication Publication Date Title
JP5051156B2 (en) Image processing apparatus and program
JP5105550B2 (en) Image composition apparatus and program
JP4760973B2 (en) Imaging apparatus and image processing method
JP5359856B2 (en) Image composition apparatus, image composition method, and program
JP4798236B2 (en) Imaging apparatus, image processing method, and program
US20170272660A1 (en) Imaging device configured to control a region of imaging
JP6541501B2 (en) IMAGE PROCESSING APPARATUS, IMAGING APPARATUS, AND IMAGE PROCESSING METHOD
JP2011066827A (en) Image processing apparatus, image processing method and program
JP5267279B2 (en) Image composition apparatus and program
JP5402166B2 (en) Image composition apparatus and program
JP5636660B2 (en) Image processing apparatus, image processing method, and program
JP6024135B2 (en) Subject tracking display control device, subject tracking display control method and program
JP5402148B2 (en) Image composition apparatus, image composition method, and program
JP5493839B2 (en) Imaging apparatus, image composition method, and program
JP5476900B2 (en) Image composition apparatus, image composition method, and program
JP2011182014A (en) Image pickup device, image processing method and program
JP2011041041A (en) Imaging apparatus, imaging method and program
JP2011003057A (en) Image composition device, image specifying method, image composition method, and 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
JP5565227B2 (en) Image processing apparatus, image processing method, and program
JP6213619B2 (en) Camera and program
JP4803319B2 (en) Imaging apparatus, image processing method, and program
JP2011135619A (en) Image processing apparatus and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120926

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20120926

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130813

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130917

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140708

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140902

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141007

R150 Certificate of patent or registration of utility model

Ref document number: 5636660

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150