JP2010226291A - Image synthesis apparatus, and program - Google Patents
Image synthesis apparatus, and program Download PDFInfo
- Publication number
- JP2010226291A JP2010226291A JP2009069755A JP2009069755A JP2010226291A JP 2010226291 A JP2010226291 A JP 2010226291A JP 2009069755 A JP2009069755 A JP 2009069755A JP 2009069755 A JP2009069755 A JP 2009069755A JP 2010226291 A JP2010226291 A JP 2010226291A
- Authority
- JP
- Japan
- Prior art keywords
- image
- subject
- unit
- line segment
- straight line
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
- Studio Devices (AREA)
Abstract
Description
本発明は、複数の画像を合成する画像合成装置及びプログラムに関する。 The present invention relates to an image composition apparatus and a program for synthesizing a plurality of images.
従来、背景内に被写体が存在する画像を撮影し、その後に背景内に被写体が存在しない背景画像を撮影して、背景画像と被写体が存在する画像から差分情報を生成し、被写体のみを抜き出すアプリケーションを搭載したものが知られている(例えば、特許文献1参照)。 Conventionally, an application that takes an image with a subject in the background, then takes a background image without the subject in the background, generates difference information from the background image and the image with the subject, and extracts only the subject (For example, refer to Patent Document 1).
しかしながら、上記技術で抜き出した被写体画像が画角から切れてしまった場合、その画像を背景画像等に合成しようとすると、被写体画像の切れ端が目立ち不自然な画像になってしまうという問題があった。 However, when the subject image extracted by the above technique is cut from the angle of view, there is a problem that when the image is combined with a background image, the subject image becomes a noticeable unnatural image. .
そこで、本発明の課題は、違和感の少ない合成画像を生成することができるようにすることである。 Therefore, an object of the present invention is to be able to generate a composite image with little uncomfortable feeling.
上記課題を解決するため、請求項1に記載の発明の画像合成装置は、
被写体画像の輪郭から所定の長さ以上の略直線分を検出する第1検出手段と、前記被写体画像と合成すべき背景用画像から所定の長さ以上の略直線分を検出する第2検出手段と、前記第1検出手段によって検出された前記被写体画像の略直線分と前記第2検出手段によって検出された前記背景用画像の略直線部分とが略合致するように、前記背景用画像と前記被写体画像を合成する合成手段とを備えたことを特徴としている。
In order to solve the above-described problem, an image composition device according to a first aspect of the present invention provides:
First detection means for detecting a substantially straight line portion having a predetermined length or more from the contour of the subject image, and second detection means for detecting a substantially straight line portion having a predetermined length or more from the background image to be combined with the subject image. And the background image and the substantially linear portion of the subject image detected by the first detection means and the substantially straight line portion of the background image detected by the second detection means substantially match. And a synthesizing unit for synthesizing the subject images.
請求項2に記載の発明は、請求項1に記載の画像合成装置において、
前記第1検出手段によって所定の長さ以上の略直線分が検出されたか否かを判断する判断手段と、この判断手段により前記所定の長さ以上の略直線分が検出されたと判断すると、前記合成手段に対し合成を行うよう制御する合成制御手段とを更に備えることを特徴としている。
According to a second aspect of the present invention, in the image composition device according to the first aspect,
Determining means for determining whether or not a substantially straight line segment having a predetermined length or more has been detected by the first detection unit; and determining that a substantially straight line segment having a predetermined length or more has been detected by the determining unit, It further comprises synthesis control means for controlling the synthesis means to perform synthesis.
請求項3に記載の発明は、請求項1又は2に記載の画像合成装置において、
前記合成手段は、前記第2検出手段によって前記背景用画像中から略直線分が検出されなかった場合に、前記第1検出手段によって検出された前記被写体画像の略直線分と前記背景用画像の縁部分とが略合致するように、前記背景用画像に前記被写体画像を合成することを特徴としている。
According to a third aspect of the present invention, in the image composition device according to the first or second aspect,
The synthesizing unit is configured to detect a substantially straight line segment of the subject image detected by the first detecting unit and a background image when the second detecting unit does not detect a substantially straight line segment from the background image. The subject image is synthesized with the background image so that the edge portion substantially matches.
請求項4に記載の発明は、請求項1〜3の何れか一項に記載の画像合成装置において、
前記合成手段は、前記第2検出手段によって検出された略直線分と、前記第1検出手段によって検出した略直線分とが略合致するように前記被写体画像を所定方向に回転させて前記背景用画像と合成することを特徴としている。
According to a fourth aspect of the present invention, in the image synthesizing device according to any one of the first to third aspects,
The synthesizing unit rotates the subject image in a predetermined direction so that the substantially straight line segment detected by the second detection unit and the substantially straight line segment detected by the first detection unit substantially coincide with each other. It is characterized by combining with images.
請求項5に記載の発明は、請求項1〜4の何れか一項に記載の画像合成装置において、
前記第2検出手段によって前記背景用画像から検出された略直線分の長さと、前記第1検出手段によって検出された前記被写体画像の略直線分の長さとを比較判定する判定手段を更に備え、前記合成手段は、前記判定手段による判定結果に基づいて、前記被写体画像の大きさを調整して前記背景用画像に合成することを特徴としている。
The invention according to
A determination unit for comparing and determining a length of the substantially straight line detected from the background image by the second detection unit and a length of the substantially straight line of the subject image detected by the first detection unit; The synthesizing unit adjusts the size of the subject image based on the determination result by the determining unit, and synthesizes it with the background image.
請求項6に記載の発明は、請求項1〜5の何れか一項に記載の画像合成装置において、
前記被写体存在画像を撮像する撮像手段と、前記撮像手段により撮像された前記被写体存在画像から被写体が含まれる領域を抽出して前記被写体画像を生成する画像生成手段と、を更に備えることを特徴としている。
The invention according to
An image pickup means for picking up the subject presence image, and an image generation means for extracting the region including the subject from the subject presence image picked up by the image pickup means and generating the subject image. Yes.
請求項7に記載の発明のプログラムは、
画像合成装置のコンピュータを、被写体画像の輪郭から所定の長さ以上の略直線分を検出する第1検出手段、前記被写体画像と合成すべき背景用画像から所定の長さ以上の略直線分を検出する第2検出手段、前記第1検出手段によって検出された前記被写体画像の略直線分と前記第2検出手段によって検出された前記背景用画像の略直線部分とが略合致するように、前記背景用画像と前記被写体画像を合成する合成手段として機能させることを特徴としている。
The program of the invention described in
A first detection unit configured to detect a substantially straight line portion having a predetermined length or more from the contour of the subject image; and a substantially straight line portion having a predetermined length or more from the background image to be combined with the subject image. Second detecting means for detecting, so that the substantially straight line portion of the subject image detected by the first detecting means and the substantially straight line portion of the background image detected by the second detecting means substantially match. It is characterized by functioning as a synthesis means for synthesizing the background image and the subject image.
本発明によれば、被写体画像と背景用画像の縁部分同士が略合致した違和感の少ない合成画像を生成することができる。 According to the present invention, it is possible to generate a composite image with little discomfort in which the edge portions of the subject image and the background image are substantially matched.
以下に、本発明について、図面を用いて具体的な態様を説明する。ただし、発明の範囲は、図示例に限定されない。 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.
[実施形態1]
図1は、本発明を適用した実施形態1の撮像装置100の概略構成を示すブロック図である。
実施形態1の撮像装置100は、被写体切り抜き画像P1(図7(b)参照)の縁部分に沿って延在する線分L1を検出して、当該被写体切り抜き画像P1の線分L1と背景用画像P2(図7(a)参照)の周縁部分Eとが略合致するように被写体切り抜き画像P1の背景用画像P2に対する合成位置に制限を加える。
具体的には、図1に示すように、撮像装置100は、レンズ部1と、電子撮像部2と、撮像制御部3と、画像データ生成部4と、画像メモリ5と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、記録媒体9と、表示制御部10と、表示部11と、操作入力部12と、CPU13とを備えている。
また、撮像制御部3と、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、CPU13は、例えば、カスタムLSI1Aとして設計されている。
[Embodiment 1]
FIG. 1 is a block diagram illustrating a schematic configuration of an
The
Specifically, as illustrated in FIG. 1, the
In addition, the
レンズ部1は、複数のレンズから構成され、ズームレンズやフォーカスレンズ等を備えている。
また、レンズ部1は、図示は省略するが、被写体の撮像の際に、ズームレンズを光軸方向に移動させるズーム駆動部、フォーカスレンズを光軸方向に移動させる合焦駆動部等を備えていても良い。
The
Although not shown, the
電子撮像部2は、例えば、CCD(Charge Coupled Device)やCMOS(Complementary Metal-oxide Semiconductor)等のイメージセンサから構成され、レンズ部1の各種レンズを通過した光学像を二次元の画像信号に変換する。
The
撮像制御部3は、図示は省略するが、タイミング発生器、ドライバなどを備えている。そして、撮像制御部3は、タイミング発生器、ドライバにより電子撮像部2を走査駆動して、所定周期毎に光学像を電子撮像部2により二次元の画像信号に変換させ、当該電子撮像部2の撮像領域から1画面分ずつ画像フレームを読み出して画像データ生成部4に出力させる。
また、撮像制御部3は、AF(自動合焦処理)、AE(自動露出処理)、AWB(自動ホワイトバランス)等の被写体を撮像する際の条件の調整制御を行う。
Although not shown, the
In addition, the
このように構成された撮像レンズ部1、電子撮像部2及び撮像制御部3は、撮像手段として、画像合成処理に係る被写体存在画像P3(図3(b)参照)や背景用画像P2(図7(a)参照)を撮像する。
また、撮像レンズ部1、電子撮像部2及び撮像制御部3は、被写体存在画像P3の撮像後、当該被写体存在画像P3の撮像の際の撮像条件を固定した状態で、被写体切り抜き画像P1の生成のための被写体非存在画像P4(図3(b)参照)を撮像する。
The
In addition, the
画像データ生成部4は、電子撮像部2から転送された画像フレームのアナログ値の信号に対してRGBの各色成分毎に適宜ゲイン調整した後に、サンプルホールド回路(図示略)でサンプルホールドしてA/D変換器(図示略)でデジタルデータに変換し、カラープロセス回路(図示略)で画素補間処理及びγ補正処理を含むカラープロセス処理を行った後、デジタル値の輝度信号Y及び色差信号Cb,Cr(YUVデータ)を生成する。
カラープロセス回路から出力される輝度信号Y及び色差信号Cb,Crは、図示しないDMAコントローラを介して、バッファメモリとして使用される画像メモリ5にDMA転送される。
The image
The luminance signal Y and the color difference signals Cb and Cr output from the color process circuit are DMA-transferred to an
画像メモリ5は、例えば、DRAM等により構成され、特徴量演算部6と、ブロックマッチング部7と、画像処理部8と、CPU13等によって処理されるデータ等を一時記憶する。
The
特徴量演算部6は、被写体非存在画像P4を基準として、当該被写体非存在画像P4から特徴点を抽出する特徴抽出処理を行う。具体的には、特徴量演算部6は、被写体非存在画像P4のYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレート(例えば、16×16画素の正方形)として抽出する。
ここで、特徴抽出処理とは、多数の候補ブロックから追跡に都合の良い特徴性の高いものを選択する処理である。
The feature
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は、被写体非存在画像P4と被写体存在画像P3の位置合わせのためのブロックマッチング処理を行う。具体的には、ブロックマッチング部7は、特徴抽出処理にて抽出されたテンプレートが被写体存在画像P3内のどこに対応するか、つまり、被写体存在画像P3内にてテンプレートの画素値が最適にマッチする位置(対応領域)を探索する。そして、画素値の相違度の評価値(例えば、差分二乗和(SSD)や差分絶対値和(SAD)等)が最も良かった被写体非存在画像P4と被写体存在画像P3間の最適なオフセットを当該テンプレートの動きベクトルとして算出する。
The
画像処理部8は、被写体存在画像P3と被写体非存在画像P4との位置合わせを行う位置合わせ部8aを具備している。
位置合わせ部8aは、被写体非存在画像P4から抽出した特徴点に基づいて、被写体非存在画像P4に対する被写体存在画像P3の各画素の座標変換式(射影変換行列)を算出し、当該座標変換式に従って被写体存在画像P3を座標変換して被写体非存在画像P4と位置合わせを行う。
The
The
また、画像処理部8は、位置合わせ部8aにより位置合わせされた被写体存在画像P3と被写体非存在画像P4との間で対応する各画素の差分情報を生成し、当該差分情報を基準として被写体存在画像P3から被写体が含まれる被写体画像Aを抽出する被写体画像抽出部8bを具備している。
Further, the
また、画像処理部8は、被写体存在画像P3内で抽出された被写体画像Aの位置を特定して、被写体存在画像P3における被写体画像Aの位置を示す位置情報を生成する位置情報生成部8cを具備している。
ここで、位置情報としては、例えば、アルファマップが挙げられ、アルファマップとは、被写体存在画像P3の各画素について、被写体画像Aの画像を所定の背景に対してアルファブレンディングする際の重みをアルファ値(0≦α≦1)として表したものである。
Further, the
Here, as the position information, for example, an alpha map can be cited. The alpha map is a weight for alpha blending the image of the subject image A with respect to a predetermined background for each pixel of the subject existing image P3. It is expressed as a value (0 ≦ α ≦ 1).
また、画像処理部8は、生成されたアルファマップに基づいて、被写体存在画像P3の各画素のうち、アルファ値が1の画素を所定の単一色画像(図示略)に対して透過させずに、且つ、アルファ値が0の画素を透過させるように、被写体画像Aを所定の単一色画像と合成して被写体切り抜き画像P1(図3(c)参照)の画像データを生成する切抜画像生成部8dを具備している。
これにより、切抜画像生成部8dは、背景と被写体とが存在する被写体存在画像P3から被写体が含まれる領域を切り抜いた被写体切り抜き画像P1を取得する。
Further, the
Thereby, the cut-out
また、画像処理部8は、被写体画像Aの所定方向に延在する線分L1を検出する線分検出部8eを具備している。
線分検出部8eは、被写体切り抜き画像P1の画像データに基づいて、当該画像の上下左右の周縁部分に被写体が含まれる被写体画像Aが存在しているか否かを検出する。具体的には、線分検出部8eは、被写体切り抜き画像P1の上下左右の周縁部分に、アルファマップのアルファ値が1である画素(即ち、単一色画像の単一色以外の部分)が所定長以上連続して配置されているか否かを判定し、所定長以上連続して配置されている部分(例えば、図7(b)における被写体画像Aの右端部分)を当該被写体切り抜き画像P1の縁部分に沿って延在する被写体画像Aの線分L1として検出する。
In addition, the
The line
また、画像処理部8は、被写体画像Aと背景用画像P2とを合成する画像合成部8fを具備している。具体的には、画像合成部8fは、記録媒体からユーザ所望の背景用画像P2を取得して、当該背景用画像P2の各画素のうち、アルファ値が0の画素は透過させ、アルファ値が1の画素は被写体切り抜き画像P1の対応する画素の画素値で上書きし、さらに、背景用画像P2の各画素のうち、アルファ値が0<α<1の画素は1の補数(1−α)を用いて被写体画像Aを切り抜いた画像(背景用画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き画像P1を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き画像P1から減算し、それを被写体画像Aを切り抜いた画像(背景用画像×(1−α))と合成する。
なお、被写体画像Aの背景用画像P2に対する合成位置については後述する。
In addition, the
The composition position of the subject image A with respect to the background image P2 will be described later.
また、画像処理部8は、被写体画像Aの背景用画像P2に対する合成位置に制限を加える合成制御部8gを具備している。
合成制御部8gは、線分検出部8eにより検出された被写体画像Aの線分L1と背景用画像P2の上下左右の一直線状の周縁部分Eとが略合致するように被写体画像Aの背景用画像P2に対する合成位置に制限を加える。ここで、被写体画像Aの線分L1と背景用画像P2の周縁部分Eとが略合致する位置とは、被写体画像Aの線分L1と背景用画像P2の周縁部分Eが一致した状態、或いは、被写体画像Aの線分L1と背景用画像P2の周縁部分Eが一致せずに所定の数画素を空けて配置されているが、略合致しているとみなせる状態等のことである。
例えば、図7(a)〜図7(c)に示すように、合成制御部8gは、被写体画像Aの右端の線分L1と背景用画像P2の右縁部分Eとが略合致する位置でのみ被写体画像Aを背景用画像P2に対して合成できるように、背景用画像P2の右縁部分Eと被写体画像Aの右端の線分L1とが略合致した状態でのみ当該被写体画像Aを移動配置可能とする。そして、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、被写体画像Aの合成位置が調整されて合成位置が決定されるか、或いは、被写体画像Aの右端の線分Lの背景用画像P2の右縁部分Eに対する割合などから自動的に合成位置が決定されると、画像合成部8fは、決定された合成位置で当該被写体画像Aと背景用画像P2とを画像合成して、被写体合成画像P5を生成する。
Further, the
The
For example, as shown in FIGS. 7A to 7C, the
記録媒体9は、例えば、不揮発性メモリ(フラッシュメモリ)等により構成され、画像処理部8のJPEG圧縮部(図示略)により符号化された背景用画像P2や被写体切り抜き画像P1の画像データを記憶する。
また、被写体画像Aの画像データは、画像処理部8の位置情報生成部8cにより生成されたアルファマップと対応付けられて、当該被写体切り抜き画像P1の画像データの拡張子を「.jpe」として保存されている。
The
The image data of the subject image A is associated with the alpha map generated by the position information generation unit 8c of the
表示制御部10は、画像メモリ5に一時的に記憶されている表示用の画像データを読み出して表示部11に表示させる制御を行う。
具体的には、表示制御部10は、VRAM、VRAMコントローラ、デジタルビデオエンコーダなどを備えている。そして、デジタルビデオエンコーダは、CPU13の制御下にて画像メモリ5から読み出されてVRAM(図示略)に記憶されている輝度信号Y及び色差信号Cb,Crを、VRAMコントローラを介してVRAMから定期的に読み出して、これらのデータを元にビデオ信号を発生して表示部11に出力する。
The
Specifically, the
表示部11は、例えば、液晶表示装置であり、表示制御部10からのビデオ信号に基づいて電子撮像部2により撮像された画像などを表示画面に表示する。具体的には、表示部11は、撮像モードにて、撮像レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示したり、本撮像画像として撮像されたレックビュー画像を表示する。
The
操作入力部12は、当該撮像装置100の所定操作を行うためのものである。具体的には、操作入力部12は、被写体の撮影指示に係るシャッタボタン12a、撮像モードや機能等の選択指示や被写体画像Aの合成位置の設定指示に係る選択決定ボタン12b、ズーム量の調整指示に係るズームボタン(図示略)等を備え、これらのボタンの操作に応じて所定の操作信号をCPU13に出力する。
The
CPU13は、撮像装置100の各部を制御するものである。具体的には、CPU13は、撮像装置100用の各種処理プログラム(図示略)に従って各種の制御動作を行うものである。
The
次に、撮像装置100による被写体切り抜き処理について、図2及び図3を参照して説明する。
図2は、被写体切り抜き処理に係る動作の一例を示すフローチャートである。また、図3(a)〜図3(c)は、被写体切り抜き処理に係る画像の一例を模式的に示す図である。
なお、以下に説明する被写体切り抜き処理にあっては、被写体が画角の右端で見切れた被写体存在画像P3の撮像を行うものとする。
Next, the subject clipping process performed by the
FIG. 2 is a flowchart illustrating an example of an operation related to the subject clipping process. 3A to 3C are diagrams schematically illustrating an example of an image related to the subject clipping process.
In the subject clipping process described below, it is assumed that the subject presence image P3 in which the subject is completely cut off at the right end of the angle of view is captured.
被写体切り抜き処理は、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から被写体切り抜きモードが選択指示された場合に実行される処理である。
図2に示すように、先ず、CPU13は、表示制御部10に、撮像レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体存在画像P3の撮像指示メッセージを表示部11の表示画面に表示させる(ステップS1)。
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
As shown in FIG. 2, first, the
次に、CPU13は、ユーザにより操作入力部12のシャッタボタン12aが撮像指示操作されたか否かを判定する(ステップS2)。ここで、シャッタボタン12aが撮像指示操作されたと判定されると(ステップS2;YES)、CPU13は、撮像制御部3に、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、被写体存在画像P3(図3(a)参照)の光学像を所定の条件で電子撮像部2により撮像させて、画像データ生成部4に、電子撮像部2から転送された被写体存在画像P3の画像フレームのYUVデータを生成させる(ステップS3)。なお、当該被写体存在画像P3のYUVデータは、画像メモリ5に一時記憶される。
また、CPU13は、撮像制御部3を制御して、当該被写体存在画像P3の撮像の際の合焦位置や露出条件やホワイトバランス等の条件を固定した状態を維持する。
Next, the
Further, the
そして、CPU13は、表示制御部10に、撮像レンズ部1、電子撮像部2及び撮像制御部3による被写体の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させるとともに、当該ライブビュー画像に重畳させて、被写体存在画像P3の半透過の表示態様の画像と被写体非存在画像P4の撮像指示メッセージを表示部11の表示画面に表示させる(ステップS4)。
この後、CPU13は、ユーザにより操作入力部12のシャッタボタン12aが撮像指示操作されたか否かを判定する(ステップS5)。そして、ユーザは、被写体を画角外に移動させるか、或いは被写体が移動するのを待った後、ユーザにより被写体非存在画像P4が被写体存在画像P3の半透過の画像と重なるようにカメラ位置が調整されて、操作入力部12のシャッタボタン12aが撮像指示操作されたと判定されると(ステップS5;YES)、CPU13は、撮像制御部3に、被写体非存在画像P4(図3(b)参照)の光学像を被写体存在画像P3の撮像後に固定された条件で電子撮像部2により撮像させて、画像データ生成部4に、電子撮像部2から転送された被写体非存在画像P4の画像フレームに基づいて、被写体非存在画像P4のYUVデータを生成させる(ステップS6)。なお、当該被写体存在画像P3のYUVデータは、画像メモリ5に一時記憶される。
Then, the
Thereafter, the
次に、CPU13は、特徴量演算部6、ブロックマッチング部7及び画像処理部8に、画像メモリ5に一時記憶されている被写体非存在画像P4のYUVデータを基準として、被写体存在画像P3のYUVデータを射影変換させるための射影変換行列を所定の画像変換モデル(例えば、相似変換モデル、或いは合同変換モデル)で算出させる(ステップS7)。
具体的には、特徴量演算部6は、被写体非存在画像P4のYUVデータに基づいて、所定数(或いは、所定数以上)の特徴の高いブロック領域(特徴点)を選択して、当該ブロックの内容をテンプレートとして抽出する。そして、ブロックマッチング部7は、特徴抽出処理にて抽出されたテンプレートの画素値が最適にマッチする位置を被写体存在画像P3内にて探索して、画素値の相違度の評価値が最も良かった被写体非存在画像P4と被写体存在画像P3間の最適なオフセットを当該テンプレートの動きベクトルとして算出する。そして、画像処理部8の位置合わせ部8aは、ブロックマッチング部7により算出された複数のテンプレートの動きベクトルに基づいて全体の動きベクトルを統計的に算出し、当該動きベクトルに係る特徴点対応を用いて被写体存在画像P3の射影変換行列を算出する。
Next, the
Specifically, the feature
次に、CPU13は、位置合わせ部8aに、算出された射影変換行例に基づいて被写体存在画像P3を射影変換させることで、被写体存在画像P3のYUVデータと被写体非存在画像P4のYUVデータとを位置合わせする処理を行わせる(ステップS8)。
Next, the
そして、CPU13は、画像処理部8の被写体画像抽出部8bに、被写体存在画像P3から被写体が含まれる被写体画像Aを抽出する処理を行わせる(ステップS9)。
具体的には、被写体画像抽出部8bは、被写体存在画像P3のYUVデータと被写体非存在画像P4のYUVデータの各々に対してローパスフィルタをかけて各画像の高周波成分を除去する。その後、被写体画像抽出部8bは、ローパスフィルタをかけた被写体存在画像P3と被写体非存在画像P4との間で対応する各画素について相違度を算出して相違度マップを生成する。続けて、被写体画像抽出部8bは、各画素に係る相違度マップを所定の閾値で2値化した後、相違度マップから細かいノイズや手ぶれにより相違が生じた領域を除去するために収縮処理を行う。その後、被写体画像抽出部8bは、ラベリング処理を行って、所定値以下の領域や最大領域以外の領域を除去した後、一番大きな島のパターンを被写体画像Aとして特定し、収縮分を修正するための膨張処理を行う。
Then, the
Specifically, the subject
次に、CPU13は、画像処理部8の位置情報生成部8cに、抽出された被写体画像Aの被写体存在画像P3内での位置を示すアルファマップを生成させる(ステップS10)。
Next, the
その後、CPU13は、画像処理部8の切抜画像生成部8dに、被写体画像Aを所定の単一色画像と合成した被写体切り抜き画像P1(図3(c)参照)の画像データを生成する処理を行わせる(ステップS11)。
具体的には、切抜画像生成部8dは、被写体存在画像P3、単一色画像及びアルファマップを読み出して画像メモリ5に展開した後、被写体存在画像P3の全ての画素について、アルファ値が0の画素については(α=0)、透過させ、アルファ値が0<α<1の画素については(0<α<1)、所定の単一色とブレンディングを行い、アルファ値が1の画素については(α=1)、何もせずに所定の単一色に対して透過させないようにする。
Thereafter, the
Specifically, the cut-out
その後、CPU13は、記録媒体9の所定の記憶領域に、画像処理部8の位置情報生成部8cにより生成されたアルファマップと被写体切り抜き画像P1の画像データを対応付けて、当該被写体切り抜き画像P1の画像データの拡張子を「.jpe」として一ファイルで保存させる(ステップS12)。
これにより、被写体切り抜き処理を終了する。この結果、画角の右端で見切れた状態で抽出された被写体画像Aを含んだ被写体切り抜き画像P1の画像データが生成される。
Thereafter, the
Thereby, the subject clipping process is completed. As a result, the image data of the subject cutout image P1 including the subject image A extracted in a state where it is completely cut off at the right end of the angle of view is generated.
次に、撮像装置100による背景用画像生成処理について、図4を参照して説明する。
図4は、背景用画像生成処理に係る動作の一例を示すフローチャートである。
Next, background image generation processing by the
FIG. 4 is a flowchart illustrating an example of an operation related to the background image generation processing.
背景用画像生成処理は、通常の静止画像の撮像処理であり、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から静止画撮像モードが選択指示された場合に実行される処理である。
図4に示すように、先ず、CPU13は、表示制御部10に、撮像レンズ部1、電子撮像部2及び撮像制御部3による背景用画像P2の撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示部11の表示画面に表示させる(ステップS21)。
The background image generation process is a normal still image imaging process, and a still image is selected from a plurality of imaging modes displayed on the menu screen based on a predetermined operation of the selection determination button 12b of the
As shown in FIG. 4, first, the
次に、CPU13は、ユーザにより操作入力部12のシャッタボタン12aが撮像指示操作されたか否かを判定する(ステップS22)。ここで、シャッタボタン12aが撮像指示操作されたと判定されると(ステップS22;YES)、CPU13は、撮像制御部3に、フォーカスレンズの合焦位置や露出条件(シャッター速度、絞り、増幅率等)やホワイトバランス等の条件を調整させて、背景用画像P2(図6(b)参照)の光学像を所定の条件で電子撮像部2により撮像させる(ステップS23)。
Next, the
続けて、CPU13は、画像データ生成部4に、電子撮像部2から転送された背景用画像P2の画像フレームのYUVデータを生成させた後、記録媒体9の所定の記憶領域に、背景用画像P2のYUVデータをExif形式の画像ファイルとして記憶させる(ステップS24)。
これにより、背景用画像生成処理を終了する。
Subsequently, the
Thus, the background image generation process is terminated.
次に、合成画像生成処理について図5〜図7を参照して詳細に説明する。
図5は、合成画像生成処理に係る動作の一例を示すフローチャートである。また、図6は、合成画像生成処理における画像合成処理に係る動作の一例を示すフローチャートである。また、図7(a)〜図7(c)は、合成画像生成処理に係る画像の一例を模式的に示す図である。
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. FIGS. 7A to 7C are diagrams schematically illustrating an example of an image related to the composite image generation process.
合成画像生成処理は、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から画像合成モードが選択指示された場合に実行される処理である。
図5のフローチャートに示すように、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で合成画像の背景となる所望の背景用画像P2(図7(a)参照)が選択して指定されると、画像処理部8は、指定された背景用画像P2の画像データを読み出して画像メモリ5に展開する(ステップS31)。
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
As shown in the flowchart of FIG. 5, based on a predetermined operation of the
次に、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で所望の被写体切り抜き画像P1(図7(b)参照)が選択して指定されると、画像処理部8は、指定された被写体切り抜き画像P1の画像データを読み出して画像メモリ5に展開する(ステップS32)。
続けて、画像処理部8の線分検出部8eは、被写体切り抜き画像P1の画像データに基づいて、当該画像の上下左右の周縁部分から上述した単一色以外の画素(被写体画像A)からなる線分L1を検出して、当該被写体画像Aの線分L1が所定長以上あるか否かを判定することで、被写体切り抜き画像P1の周縁部分に線分L1があるか否かを判断する(ステップS33)。
Next, based on a predetermined operation of the
Subsequently, based on the image data of the subject cutout image P1, the line
ここで、被写体切り抜き画像P1(被写体画像A)の周縁部分に線分L1があると判断されると(ステップS33;YES)、合成制御部8gは、被写体画像Aの背景用画像P2に対する合成位置に制限を加える(ステップS34)。例えば、被写体画像Aの右端の縁部分に線分L1がある場合には(図7(b)参照)、被写体画像Aの右端の縁部分と背景用画像P2の右縁部分Eとが略合致する位置でのみ被写体画像Aを背景用画像P2に対して合成できるように、背景用画像P2の右縁部分Eと被写体画像Aの右端の線分L1とが略合致した状態で当該被写体画像Aを移動配置可能とする(図7(c)参照)。
その後、被写体画像Aの合成位置が決定されると(ステップS35)、画像合成部8fは、背景用画像P2と被写体切り抜き画像P1とを合成する画像合成処理を行う(ステップS36)。
なお、ステップS34にて、被写体画像Aの背景用画像P2に対する合成位置に制限を加える処理を行うことなく、被写体画像Aの右端の線分Lの背景用画像P2の右縁部分Eに対する割合などから自動的に合成位置を決定するようにしても良い。
Here, when it is determined that the line segment L1 exists in the peripheral portion of the subject cutout image P1 (subject image A) (step S33; YES), the
Thereafter, when the composition position of the subject image A is determined (step S35), the
In step S34, the ratio of the rightmost line segment L of the subject image A to the right edge portion E of the background image P2, etc., without restricting the composition position of the subject image A with respect to the background image P2. Alternatively, the synthesis position may be automatically determined.
一方、ステップS33にて、被写体切り抜き画像P1の縁部分に線分L1がないと判断されると(ステップS33;NO)、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、ユーザ所望の被写体切り抜き画像P1の合成位置を指定して決定した後(ステップS37)、CPU13は、処理をステップS36に移行させて、背景用画像P2と被写体切り抜き画像P1とを合成する画像合成処理を行う。
On the other hand, if it is determined in step S33 that there is no line segment L1 in the edge portion of the subject cutout image P1 (step S33; NO), based on a predetermined operation of the selection determination button 12b of the
ここで、画像合成処理について図6を参照して詳細に説明する。
図6に示すように、画像合成部8fは、被写体切り抜き画像P1と対応付けて保存されているアルファマップを読み出して画像メモリ5に展開する(ステップS41)。
なお、図5のステップS35にて背景用画像P2における被写体切り抜き画像P1の合成位置が決定された際に、背景用画像P2とアルファマップとがずれてしまいアルファマップの範囲外となる領域については、α=0としてアルファ値が存在しない領域を生じさせないようにする。
Here, the image composition processing will be described in detail with reference to FIG.
As shown in FIG. 6, the
Note that when the synthesis position of the subject cutout image P1 in the background image P2 is determined in step S35 in FIG. 5, the background image P2 and the alpha map are shifted, and the region is outside the alpha map range. , Α = 0, so that an area where no alpha value exists is not generated.
次に、画像合成部8fは、背景用画像P2の何れか一の画素(例えば、左上隅部の画素)を指定して(ステップS42)、当該画素について、アルファマップのアルファ値に基づいて処理を分岐させる(ステップS43)。具体的には、画像合成部8fは、背景用画像P2の何れか一の画素のうち、アルファ値が1の画素については(ステップS43;α=1)、被写体切り抜き画像P1の対応する画素の画素値で上書きし(ステップS44)、アルファ値が0<α<1の画素については(ステップS43;0<α<1)、1の補数(1−α)を用いて被写体画像Aを切り抜いた画像(背景用画像×(1−α))を生成した後、アルファマップにおける1の補数(1−α)を用いて被写体切り抜き画像P1を生成した際に単一背景色とブレンドした値を計算し、当該値を被写体切り抜き画像P1から減算し、それを被写体画像Aを切り抜いた画像(背景用画像×(1−α))と合成し(ステップS45、アルファ値が0の画素については(ステップS43;α=0)、何もせずに背景用画像P2を透過さるようにする。
Next, the
続けて、画像合成部8fは、背景用画像P2の全ての画素について処理したか否かを判定する(ステップS46)。
ここで、全ての画素について処理していないと判定されると(ステップS46;NO)、画像合成部8fは、処理対象として次の画素を指定して当該画素に処理対象を移動させて(ステップS47)、処理をステップS43に移行させる。
上記の処理を、ステップS46にて全ての画素について処理したと判定されるまで(ステップS46;YES)、繰り返すことで、画像合成部8fは、被写体切り抜き画像P1と背景用画像P2とを合成した被写体合成画像P5の画像データを生成させる。
これにより、画像合成処理を終了する。
Subsequently, the
If it is determined that all the pixels have not been processed (step S46; NO), the
By repeating the above process until it is determined that all pixels have been processed in step S46 (step S46; YES), the
Thereby, the image composition process is terminated.
図5に示すように、その後、CPU13は、表示制御部10に、画像合成部8fにより生成された被写体合成画像P5の画像データに基づいて、背景用画像P2に被写体が重畳された被写体合成画像P5(図7(c)参照)を表示部11の表示画面に表示させる(ステップS38)。
これにより、合成画像生成処理を終了する。
As shown in FIG. 5, thereafter, the
Thus, the composite image generation process is finished.
以上のように、実施形態1の撮像装置100によれば、被写体存在画像P3を撮像して当該被写体存在画像P3から被写体が含まれる被写体画像Aを抽出した被写体切り抜き画像P1を生成する。そして、被写体画像Aの被写体切り抜き画像P1における周縁部分に沿って延在する線分L1を検出して、当該被写体画像Aの線分L1と背景用画像P2の一直線状の周縁部分Eとが略合致するように被写体画像Aの背景用画像P2に対する合成位置に制限を加える。具体的には、被写体切り抜き画像P1から所定の長さ以上の線分L1が検出された場合に、被写体画像Aの背景用画像P2に対する合成位置に制限を加える。
これにより、例えば、被写体が画角で見切れた被写体存在画像P3を撮影して、当該被写体存在画像P3から被写体切り抜き画像P1を生成して、被写体画像Aを背景用画像P2と合成すると、被写体画像Aの合成位置によっては当該画像の縁部分の線分L1が目立ってしまうが、被写体画像Aの背景用画像P2に対する合成位置に制限を加えることで、被写体画像Aの線分L1と背景用画像P2の一直線状の周縁部分Eとが略合致した違和感のない自然な被写体合成画像P5を生成することができる。
As described above, according to the
As a result, for example, when a subject existing image P3 in which the subject is completely viewed at an angle of view is captured, a subject cutout image P1 is generated from the subject existing image P3, and the subject image A is combined with the background image P2, the subject image Depending on the composition position of A, the line segment L1 of the edge portion of the image becomes conspicuous, but by limiting the composition position of the subject image A with the background image P2, the line segment L1 of the subject image A and the background image It is possible to generate a natural subject composite image P5 without any sense of incongruity in which the straight peripheral portion E of P2 substantially matches.
[実施形態2]
以下に、実施形態2の撮像装置100について、図8〜図10を参照して説明する。
実施形態2の撮像装置100は、背景用画像P2から所定方向に沿って延在する線分L2を検出し、当該背景用画像P2中の線分L2と被写体切り抜き画像P1の線分L1とが略合致するように合成位置に制限を加える。
なお、実施形態2の撮像装置100は、線分検出部8e及び合成制御部8gの構成が異なる以外の点で上記実施形態1の撮像装置100と略同様の構成をなし、その説明は省略する。
[Embodiment 2]
Hereinafter, the
The
Note that the
線分検出部8eは、被写体切り抜き画像P1の画像データに基づいて、当該画像中の被写体が含まれる被写体画像Aの縁部分に線分L1が存在しているか否かを検出する。例えば、画角内の柱の陰に体の一部分が隠れた人物を被写体存在画像P3(図8(a)参照)として撮影した場合、当該被写体存在画像P3と被写体非存在画像P4(図8(b)参照)を用いて被写体画像Aを検出して被写体切り抜き画像P1を生成すると、図8(c)に示すように、被写体切り抜き画像P1として、周縁部分以外の略中央部に上下方向に沿って延在する線分を被写体画像Aの縁部分に有するものが生成される。
かかる場合に、線分検出部8eは、被写体画像Aの縁部分に、アルファマップのアルファ値が1である画素(即ち、単一色画像の単一色以外の部分)が所定の一方向に沿って所定長以上連続して配置されているか否かを判定し、所定長以上連続して配置されている部分(例えば、図10(b)における被写体画像Aの右端部分)を線分L1として検出する。
Based on the image data of the subject cutout image P1, the line
In such a case, the line
また、線分検出部8eは、背景用画像P2中の所定方向に沿って延在する線分L2を検出する。具体的には、線分検出部8eは、背景用画像P2の画像データに対してハフ変換を行うことで、当該画像中の所定の一方向に沿って延在する線分L2を検出する。例えば、図10(a)に示すように、線分検出部8eは、背景用画像P2中の建物の画像の外面に沿って延在する線分L2を検出する。
Further, the line
合成制御部8gは、背景用画像P2中の線分L2と被写体画像Aの縁部分の線分L1とが略合致するように当該背景用画像P2と被写体切り抜き画像P1との合成位置に制限を加える。
例えば、図10(a)〜図10(c)に示すように、合成制御部8gは、被写体切り抜き画像P1の被写体画像Aの右端部分の線分L1と背景用画像P2中の建物の左外側面部分の線分L2とが略合致する位置でのみ被写体切り抜き画像P1を背景用画像P2に対して合成できるように、背景用画像P2の建物の左外側面部分の線分L2と被写体画像Aの右端部分の線分L1とが略合致した状態でのみ当該被写体切り抜き画像P1を移動配置可能とする。そして、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、被写体切り抜き画像P1の合成位置が調整されて合成位置が決定されるか、或いは、被写体画像Aの右端部分の線分L1の背景用画像P2の建物の左側面部分に対する割合などから自動的に合成位置が決定されると、画像合成部8fは、決定された被写体切り抜き画像P1の合成位置で当該被写体切り抜き画像P1と背景用画像P2とを画像合成して、被写体合成画像P5を生成する。
The
For example, as shown in FIG. 10A to FIG. 10C, the
次に、合成画像生成処理について図9及び図10を参照して詳細に説明する。
図9は、合成画像生成処理に係る動作の一例を示すフローチャートである。また、図10(a)〜図10(c)は、合成画像生成処理に係る画像の一例を模式的に示す図である。
なお、以下に説明する合成画像生成処理にあっては、略中央部に上下方向に沿って延在する線分L1を被写体画像Aの縁部分に有する被写体切り抜き画像P1を用いるものとする。
Next, the composite image generation process will be described in detail with reference to FIGS.
FIG. 9 is a flowchart illustrating an example of an operation related to the composite image generation process. FIGS. 10A to 10C are diagrams schematically illustrating an example of an image related to the composite image generation process.
In the composite image generation process described below, it is assumed that a subject cutout image P1 having a line segment L1 extending in the vertical direction at the substantially central portion at the edge portion of the subject image A is used.
図9のフローチャートに示すように、実施形態1と同様に、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で合成画像の背景となる所望の背景用画像P2(図10(a)参照)が選択して指定されると、画像処理部8は、指定された背景用画像P2の画像データを読み出して画像メモリ5に展開する(ステップS31)。
As shown in the flowchart of FIG. 9, as in the first embodiment, based on a predetermined operation of the
次に、実施形態1と同様に、ユーザによる操作入力部12の所定操作に基づいて、記録媒体9に記録されている複数の画像の中で所望の被写体切り抜き画像P1(図10(b)参照)が選択して指定されると、画像処理部8は、指定された被写体切り抜き画像P1の画像データを読み出して画像メモリ5に展開する(ステップS32)。
続けて、画像処理部8の線分検出部8eは、被写体切り抜き画像P1の画像データに基づいて、当該画像に所定長以上の線分L1があるか否かを判断する(ステップS51)。具体的には、線分検出部8eは、被写体切り抜き画像P1の上下左右の縁部分から単一色以外の画素(被写体画像A)からなる線分L1を検出するとともに、画像中の被写体画像Aの縁部分に線分L1が存在しているか否かを検出して、検出された被写体画像Aの線分L1が所定長以上あるか否かを判定することで、被写体切り抜き画像P1に線分L1があるか否かを判断する。
Next, as in the first embodiment, a desired subject cutout image P1 (see FIG. 10B) among a plurality of images recorded on the
Subsequently, the line
ここで、被写体切り抜き画像P1に線分L1があると判断されると(ステップS51;YES)、線分検出部8eは、検出した線分L1は被写体切り抜き画像P1の縁部分に沿って延在するものであったか否かを判定する(ステップS52)。
ここで、線分L1が被写体切り抜き画像P1の縁部分に沿って延在するものであったと判定されると(ステップS52;YES)、合成制御部8gは、実施形態1と同様に、当該被写体切り抜き画像P1の背景用画像P2に対する合成位置を背景用画像P2の周縁部分Eになるように制限を加える(ステップS53)。
If it is determined that the subject cutout image P1 has the line segment L1 (step S51; YES), the line
Here, when it is determined that the line segment L1 extends along the edge portion of the subject cutout image P1 (step S52; YES), the
一方、ステップS52にて、線分L1が被写体切り抜き画像P1の縁部分に沿って延在するものではなかったと判定されると(ステップS52;NO)、つまり、被写体切り抜き画像P1中の被写体画像Aの縁部分に線分L1が存在している場合(図10(a)参照)、線分検出部8eは、背景用画像P2の画像データに対してハフ変換を行うことで、当該画像中の所定の一方向に沿って延在する線分L2を検出して、背景用画像P2に線分L2があるか否かを判断する(ステップS54)。なお、線分検出部8eは、被写体切り抜き画像P1の被写体画像Aの線分L1と同じ方向に沿って延在する線分L2のみを検出するようにしても良い。
On the other hand, if it is determined in step S52 that the line segment L1 does not extend along the edge of the subject cutout image P1 (step S52; NO), that is, the subject image A in the subject cutout image P1. When the line segment L1 is present at the edge portion of the image (see FIG. 10A), the line
ここで、背景用画像P2中に線分L2があると判断されると(ステップS54;YES)、例えば、図10(a)に示すように、線分検出部8eが背景用画像P2中の建物の画像の外面に沿って延在する線分L2を検出した場合、合成制御部8gは、被写体切り抜き画像P1の背景用画像P2に対する合成位置を当該背景用画像P2中の線分L2になるように制限を加える(ステップS55)。例えば、合成制御部8gは、被写体切り抜き画像P1の被写体画像Aの右端の線分L1と背景用画像P2中の線分L2とが略合致する位置でのみ被写体画像Aを背景用画像P2に対して合成できるように、背景用画像P2中の線分L2と被写体切り抜き画像P1の被写体画像Aの右端の線分L1とが略合致した状態でのみ当該被写体切り抜き画像P1を移動配置可能とする(図10(c)参照)。
一方、ステップS54にて、背景用画像P2中に線分L2がないと判断されると(ステップS54;NO)、CPU13は処理をステップS53に移行させて、合成制御部8gは、被写体画像Aの背景用画像P2に対する合成位置を背景用画像P2の縁部分になるように制限を加える(ステップS53)。
その後、実施形態1と同様に、被写体画像Aの合成位置が決定されると(ステップS56)、画像合成部8fは、背景用画像P2と被写体画像Aとを合成する画像合成処理を行う(ステップS36)。
Here, if it is determined that the line segment L2 is present in the background image P2 (step S54; YES), for example, as illustrated in FIG. 10A, the line
On the other hand, if it is determined in step S54 that there is no line segment L2 in the background image P2 (step S54; NO), the
Thereafter, as in the first embodiment, when the synthesis position of the subject image A is determined (step S56), the
また、ステップS51にて、被写体切り抜き画像P1に線分L1がないと判断されると(ステップS51;NO)、ユーザによる操作入力部12の選択決定ボタン12bの所定操作に基づいて、ユーザ所望の被写体切り抜き画像P1の合成位置を指定して決定した後(ステップS37)、CPU13は、処理をステップS36に移行させて、背景用画像P2と被写体切り抜き画像P1とを合成する画像合成処理を行う。
If it is determined in step S51 that the subject cutout image P1 does not have the line segment L1 (step S51; NO), the user's desired operation is determined based on a predetermined operation of the selection determination button 12b of the
その後、実施形態1と同様に、CPU13は、表示制御部10に、画像合成部8fにより生成された被写体合成画像P5の画像データに基づいて、背景用画像P21に被写体が重畳された被写体合成画像P5(図10(c)参照)を表示部11の表示画面に表示させる(ステップS38)。
これにより、合成画像生成処理を終了する。
After that, as in the first embodiment, the
Thus, the composite image generation process is finished.
以上のように、実施形態2の撮像装置100によれば、背景用画像P2から所定方向に沿って延在する線分L2を検出し、当該背景用画像P2中の線分L2と被写体切り抜き画像P1中の線分L1とが略合致するように合成位置に制限を加える。また、背景用画像P2から線分L2が検出されなかった場合に、被写体画像Aの線分L1と背景用画像P2の周縁部分Eとが略合致するように合成位置に制限を加える。
これにより、被写体画像Aの背景用画像P2に対する合成の自由度を大きくすることができ、背景用画像P2の周縁部分Eだけでなく、背景用画像P2中から検出された線分L2に対しても被写体切り抜き画像P1の線分L1と略合致した違和感のない自然な被写体合成画像P5を生成することができる。
As described above, according to the
As a result, the degree of freedom of composition of the subject image A with the background image P2 can be increased, and not only the peripheral portion E of the background image P2 but also the line segment L2 detected from the background image P2. In addition, it is possible to generate a natural subject composite image P5 that is substantially in agreement with the line segment L1 of the subject cutout image P1 and has no sense of incongruity.
また、被写体切り抜き画像P1の被写体画像Aから所定の長さ以上の線分L1が検出された場合に、背景用画像P2から線分L2を検出するので、被写体画像Aの抽出用の被写体非存在画像P4の撮影環境によって見切れた被写体存在画像P3から被写体切り抜き画像P1を生成した場合に、背景用画像P2から線分L2を検出して被写体切り抜き画像P1の線分L1と背景用画像P2の線分L2とが略合致した違和感のない自然な被写体合成画像P5を生成することができる。
従って、被写体が画角で見切れた被写体存在画像P3だけでなく、被写体画像Aの抽出用の被写体非存在画像P4の撮影環境によって見切れた被写体存在画像P3の合成もより適正に行うことできる。
Further, when the line segment L1 having a predetermined length or more is detected from the subject image A of the subject cutout image P1, the line segment L2 is detected from the background image P2, so that no subject exists for extracting the subject image A. When the subject cutout image P1 is generated from the subject existence image P3 that has been cut off by the shooting environment of the image P4, the line segment L2 is detected from the background image P2 and the line segment L1 of the subject cutout image P1 and the line of the background image P2 are detected. It is possible to generate a natural subject composite image P5 that does not have a sense of incongruity that substantially matches the minute L2.
Therefore, not only the subject existence image P3 in which the subject is completely viewed at the angle of view, but also the composition of the subject presence image P3 that has been observed in the shooting environment of the subject nonexistence image P4 for extracting the subject image A can be more appropriately performed.
なお、本発明は、上記実施形態1、2に限定されることなく、本発明の趣旨を逸脱しない範囲において、種々の改良並びに設計の変更を行っても良い。
以下に、撮像装置100の変形例について説明する。
The present invention is not limited to the first and second embodiments, and various improvements and design changes may be made without departing from the spirit of the present invention.
Below, the modification of the
例えば、上記実施形態2において、被写体画像Aの縁部分の線分L1が背景用画像P2中の線分L2と異なる方向に延在する場合、即ち、図11(a)に示すように、被写体画像Aの縁部分の線分L1が斜めに延在する一方で背景用画像P2中の線分L2が上下方向に延在する場合のように互いの線分L1、L2の延在方向が略一致しない場合、合成制御部8gは、被写体画像Aの縁部分の線分L1と背景用画像P2中の線分L2の延在方向が略一致するように当該被写体画像Aを所定方向に回転させる処理を施すようにしても良い(図11(b)参照)。
これにより、被写体画像Aの縁部分の線分L1と背景用画像P2中の線分L2の延在方向が一致しない場合であっても、被写体切り抜き画像P1を所定方向に回転させて、被写体画像Aの縁部分の線分L1と背景用画像P2中の線分L2の延在方向が略一致した違和感のない自然な被写体合成画像P5を生成することができる。
For example, in the second embodiment, when the line segment L1 of the edge portion of the subject image A extends in a direction different from the line segment L2 in the background image P2, that is, as shown in FIG. The extending direction of the line segments L1 and L2 is substantially the same as when the line segment L1 of the edge portion of the image A extends obliquely while the line segment L2 in the background image P2 extends in the vertical direction. If they do not match, the
Thus, even when the extending direction of the line segment L1 of the edge portion of the subject image A and the line segment L2 in the background image P2 does not coincide with each other, the subject cut-out image P1 is rotated in a predetermined direction, and the subject image It is possible to generate a natural subject composite image P5 without a sense of incongruity in which the extending direction of the line segment L1 of the edge portion A and the line segment L2 in the background image P2 substantially match.
また、上記実施形態1、2において、合成制御部8gは、背景用画像P2中の線分L及び背景用画像P2の一直線状の周縁部分Eと、被写体切り抜き画像P1から検出された縁部分の線分(被写体画像Aの縁部分の線分L1を含む)の長さを比較判定して、当該判定結果に基づいて、被写体切り抜き画像P1の大きさを調整する処理を施すようにしても良い。
例えば、背景用画像P2中の線分L2及び背景用画像P2の一直線状の周縁部分Eに対して、被写体切り抜き画像P1から検出された縁部分の線分(被写体画像Aの縁部分の線分L1を含む)の長さが長い場合には、被写体切り抜き画像P1を所定の倍率で縮小する。
これにより、被写体画像Aの大きさが背景用画像P2に対する合成に不適当な場合であっても、被写体切り抜き画像P1を所定の倍率で縮小することで被写体画像Aの大きさを背景用画像P2に対してより自然なものとすることができ、違和感のない自然な被写体合成画像P5を得ることができる。
Further, in the first and second embodiments, the
For example, with respect to the line segment L2 in the background image P2 and the straight line peripheral portion E of the background image P2, the line segment of the edge portion detected from the subject cutout image P1 (the line segment of the edge portion of the subject image A) (Including L1) is long, the subject cutout image P1 is reduced at a predetermined magnification.
As a result, even if the size of the subject image A is inappropriate for synthesis with the background image P2, the size of the subject image A is reduced by reducing the subject cutout image P1 at a predetermined magnification. Therefore, it is possible to obtain a natural subject composite image P5 without any sense of incongruity.
さらに、上記実施形態1、2において、被写体切り抜き画像P1が二つ以上の線分L1を有する場合には、これらの線分L1のうち、より多くの線分L1が背景用画像P2の周縁部分Eや背景用画像P2中の所定の線分L2と略合致した状態となるように画像合成するのが好ましい。
また、上記実施形態1、2にあっては、背景用画像P2に一の被写体切り抜き画像P1を合成するようにしたが、被写体切り抜き画像P1の合成数は適宜任意に変更することができ、複数であっても良い。かかる場合には、全ての被写体切り抜き画像P1、…と背景用画像P2とが違和感を生じさせないように所定の画像処理や回転処理等を行うのが好ましい。
さらに、被写体切り抜き処理を行った後、背景用画像生成処理を行うようにしたが、これらの処理の順番は逆であっても良い。
Further, in the first and second embodiments, when the subject cutout image P1 has two or more line segments L1, among these line segments L1, more line segments L1 are peripheral portions of the background image P2. It is preferable to synthesize the images so as to be in a state that substantially matches a predetermined line segment L2 in E and the background image P2.
In the first and second embodiments, one subject cutout image P1 is synthesized with the background image P2. However, the number of subject cutout images P1 can be arbitrarily changed as appropriate. It may be. In such a case, it is preferable to perform predetermined image processing, rotation processing, or the like so that all the subject cutout images P1,...
Furthermore, after performing the subject clipping process, the background image generation process is performed, but the order of these processes may be reversed.
また、撮像装置100の構成は、上記実施形態1、2に例示したものは一例であり、これに限られるものではない。即ち、画像合成装置として、撮像装置を例示したが、これに限られるものではい。例えば、被写体切り抜き画像P1、背景用画像P2の生成は、当該撮像装置100とは異なる撮像装置にて行い、この撮像装置から転送された画像データのみを記録して、合成画像生成処理のみを実行する画像合成装置であっても良い。
In addition, the configuration of the
加えて、上記実施形態にあっては、第1検出手段、第2検出手段、合成手段としての機能を、CPU13の制御下にて、画像処理部8の線分検出部8e、画像合成部8f、合成制御部8gが駆動することにより実現される構成としたが、これに限られるものではなく、CPU13によって所定のプログラム等が実行されることにより実現される構成としても良い。
即ち、プログラムを記憶するプログラムメモリ(図示略)に、第1検出処理ルーチン、第2検出処理ルーチン、合成処理ルーチンを含むプログラムを記憶しておく。そして、第1検出処理ルーチンによりCPU13に、被写体画像Aの輪郭から所定の長さ以上の略直線分を検出させるようにしても良い。また、第2検出処理ルーチンによりCPU13に、被写体画像Aと合成すべき背景用画像P2から所定の長さ以上の略直線分を検出させるようにしても良い。また、合成処理ルーチンによりCPU13に、検出された被写体画像Aの略直線分と検出された背景用画像P2の略直線部分とが略合致するように、背景用画像P2と被写体画像Aを合成させるようにしても良い。
In addition, in the above embodiment, the functions of the first detection unit, the second detection unit, and the synthesis unit are controlled under the control of the
In other words, a program including a first detection processing routine, a second detection processing routine, and a synthesis processing routine is stored in a program memory (not shown) that stores the program. Then, the first detection processing routine may cause the
100 撮像装置
1 レンズ部
2 電子撮像部
3 撮像制御部
8 画像処理部
8d 切抜画像生成部
8e 線分検出部
8f 画像合成部
8g 合成制御部
9 記録媒体
11 表示部
13 CPU
DESCRIPTION OF
Claims (7)
前記被写体画像と合成すべき背景用画像から所定の長さ以上の略直線分を検出する第2検出手段と、
前記第1検出手段によって検出された前記被写体画像の略直線分と前記第2検出手段によって検出された前記背景用画像の略直線部分とが略合致するように、前記背景用画像と前記被写体画像を合成する合成手段と、
を備えたことを特徴とする画像合成装置。 First detection means for detecting a substantially straight line segment having a predetermined length or more from the contour of the subject image;
Second detection means for detecting a substantially straight line portion having a predetermined length or more from a background image to be combined with the subject image;
The background image and the subject image so that a substantially straight line segment of the subject image detected by the first detection unit and a substantially straight line portion of the background image detected by the second detection unit substantially match. A synthesis means for synthesizing
An image composition device comprising:
この判断手段により前記所定の長さ以上の略直線分が検出されたと判断すると、前記合成手段に対し合成を行うよう制御する合成制御手段と、
を更に備えることを特徴とする請求項1に記載の画像合成装置。 Determining means for determining whether or not a substantially straight line portion having a predetermined length or more has been detected by the first detecting means;
If it is determined by this determination means that a substantially straight line segment having a length equal to or greater than the predetermined length has been detected, a composition control means for controlling the composition means to perform composition;
The image synthesizing apparatus according to claim 1, further comprising:
前記第2検出手段によって検出された略直線分と、前記第1検出手段によって検出した略直線分とが略合致するように前記被写体画像を所定方向に回転させて前記背景用画像と合成することを特徴とする請求項1〜3の何れか一項に記載の画像合成装置。 The synthesis means includes
The subject image is rotated in a predetermined direction so that the substantially straight line segment detected by the second detector and the substantially straight line segment detected by the first detector substantially coincide with each other and synthesized with the background image. The image composition device according to any one of claims 1 to 3.
前記合成手段は、
前記判定手段による判定結果に基づいて、前記被写体画像の大きさを調整して前記背景用画像に合成することを特徴とする請求項1〜4の何れか一項に記載の画像合成装置。 A determination unit for comparing and determining a length of the substantially straight line detected from the background image by the second detection unit and a length of the substantially straight line of the subject image detected by the first detection unit;
The synthesis means includes
5. The image synthesizing apparatus according to claim 1, wherein a size of the subject image is adjusted based on a determination result by the determination unit and is synthesized with the background image. 6.
前記撮像手段により撮像された前記被写体存在画像から被写体が含まれる領域を抽出して前記被写体画像を生成する画像生成手段と、を更に備えることを特徴とする請求項1〜5の何れか一項に記載の画像合成装置。 Imaging means for imaging the subject presence image;
6. The image generating device according to claim 1, further comprising: an image generating unit configured to extract a region including a subject from the subject existing image captured by the imaging unit and generate the subject image. The image composition device described in 1.
被写体画像の輪郭から所定の長さ以上の略直線分を検出する第1検出手段、
前記被写体画像と合成すべき背景用画像から所定の長さ以上の略直線分を検出する第2検出手段、
前記第1検出手段によって検出された前記被写体画像の略直線分と前記第2検出手段によって検出された前記背景用画像の略直線部分とが略合致するように、前記背景用画像と前記被写体画像を合成する合成手段
として機能させることを特徴とするプログラム。 The computer of the image synthesizer
First detecting means for detecting a substantially straight line portion having a predetermined length or more from the contour of the subject image;
Second detection means for detecting a substantially straight line portion having a predetermined length or more from the background image to be synthesized with the subject image;
The background image and the subject image so that a substantially straight line segment of the subject image detected by the first detection unit and a substantially straight line portion of the background image detected by the second detection unit substantially match. A program that functions as a synthesis means for synthesizing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009069755A JP5381207B2 (en) | 2009-03-23 | 2009-03-23 | Image composition apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009069755A JP5381207B2 (en) | 2009-03-23 | 2009-03-23 | Image composition apparatus and program |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2010226291A true JP2010226291A (en) | 2010-10-07 |
JP2010226291A5 JP2010226291A5 (en) | 2012-04-26 |
JP5381207B2 JP5381207B2 (en) | 2014-01-08 |
Family
ID=43043026
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009069755A Expired - Fee Related JP5381207B2 (en) | 2009-03-23 | 2009-03-23 | Image composition apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5381207B2 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11289447A (en) * | 1998-04-02 | 1999-10-19 | Fuji Photo Film Co Ltd | Picture processing method and picture processor |
JP2004159158A (en) * | 2002-11-07 | 2004-06-03 | Make Softwear:Kk | Method and device for providing photographic print |
JP2010033246A (en) * | 2008-07-28 | 2010-02-12 | Fujifilm Corp | Device, method, and program for combining image |
-
2009
- 2009-03-23 JP JP2009069755A patent/JP5381207B2/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11289447A (en) * | 1998-04-02 | 1999-10-19 | Fuji Photo Film Co Ltd | Picture processing method and picture processor |
JP2004159158A (en) * | 2002-11-07 | 2004-06-03 | Make Softwear:Kk | Method and device for providing photographic print |
JP2010033246A (en) * | 2008-07-28 | 2010-02-12 | Fujifilm Corp | Device, method, and program for combining image |
Also Published As
Publication number | Publication date |
---|---|
JP5381207B2 (en) | 2014-01-08 |
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 | |
US20190075245A1 (en) | Imaging device configured to control a region of imaging | |
JP5267279B2 (en) | Image composition apparatus and program | |
JP5402166B2 (en) | Image composition apparatus and program | |
JP2011066827A (en) | Image processing apparatus, image processing method and program | |
JP5402148B2 (en) | Image composition apparatus, image composition method, and program | |
JP5636660B2 (en) | Image processing apparatus, image processing method, and program | |
JP5493839B2 (en) | Imaging apparatus, image composition method, and program | |
JP2011182014A (en) | Image pickup device, image processing method and program | |
JP5381207B2 (en) | Image composition apparatus and program | |
JP5476900B2 (en) | Image composition apparatus, image composition method, and program | |
JP5494537B2 (en) | Image processing apparatus and program | |
JP2011003057A (en) | Image composition device, image specifying method, image composition method, and program | |
JP5423296B2 (en) | Image processing apparatus, image processing method, and program | |
JP2010278701A (en) | Image combining device, and image combining method and program | |
JP5565227B2 (en) | Image processing apparatus, image processing method, and program | |
JP2011041041A (en) | Imaging apparatus, imaging method and program | |
JP4803319B2 (en) | Imaging apparatus, image processing method, and program | |
JP2011135619A (en) | Image processing apparatus and program | |
JP2010161526A (en) | Digital camera | |
JP2011175663A (en) | Imaging device, image processing method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120309 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120309 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20120309 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130308 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130402 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130516 |
|
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: 20130903 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130916 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5381207 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |