JP5182004B2 - Image processing apparatus and program - Google Patents
Image processing apparatus and program Download PDFInfo
- Publication number
- JP5182004B2 JP5182004B2 JP2008271485A JP2008271485A JP5182004B2 JP 5182004 B2 JP5182004 B2 JP 5182004B2 JP 2008271485 A JP2008271485 A JP 2008271485A JP 2008271485 A JP2008271485 A JP 2008271485A JP 5182004 B2 JP5182004 B2 JP 5182004B2
- Authority
- JP
- Japan
- Prior art keywords
- subject
- character
- image
- face
- detected
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Image Processing (AREA)
- Studio Circuits (AREA)
- Editing Of Facsimile Originals (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
本発明は、画像中の適切な位置に所定の画像を合成するのに好適な画像処理装置、並びに、これらをコンピュータにより実現するためのプログラムに関する。 The present invention relates to an image processing apparatus suitable for synthesizing a predetermined image at an appropriate position in an image, and a program for realizing these by a computer.
現在、あらかじめ用意されたキャラクタ画像やフレーム画像などの合成用画像を、ある被写体を撮像して得られた撮像画像に合成する画像処理装置が知られている。ここで、撮像画像に合成用画像を合成する際には、撮像画像の適切な位置に合成用画像を合成することが望ましい。例えば、撮像画像にキャラクタ画像を合成する場合、合成後の画像において、被写体とキャラクタとが重ならないように、撮像画像とキャラクタ画像とを合成することが望ましい。例えば、特許文献1には、かかる要望に応えるデジタルカメラが開示されている。
Currently, there is known an image processing apparatus that synthesizes a synthesis image such as a character image or a frame image prepared in advance with a captured image obtained by imaging a certain subject. Here, when synthesizing the synthesized image with the captured image, it is desirable to synthesize the synthesized image at an appropriate position of the captured image. For example, when a character image is combined with a captured image, it is desirable to combine the captured image and the character image so that the subject and the character do not overlap in the combined image. For example,
特許文献1に開示されたデジタルカメラは、被写体を撮像してデジタル画像データを得る撮像手段と、デジタル画像データを記憶する画像記憶手段と、画像を表示する画像表示手段と、合成用に参照する画像中の1つ以上の少なくとも一部領域を参照画像領域として指定する参照画像指定手段と、参照画像領域内の参照画像を、現在撮影中の撮影対象画像に重ねて画像表示手段に表示するように合成する画像合成手段と、を備える。当該デジタルカメラによれば、撮像者は、画像表示手段に表示された合成用画像(参照画像)を確認しながら被写体を撮像することができる。従って、撮像者は、合成用画像が被写体と重ならないように撮像することができる。
The digital camera disclosed in
しかしながら、特許文献1に開示されたデジタルカメラを用いる場合、撮像者自身が、撮像領域内における、合成用画像と被写体との位置関係を確認しながら撮像する必要があった。従って、撮像者が撮像の際に位置合わせするなどわずらわしい行為をすることなく、画像中の適切な位置に所定の画像を合成したいという要望が強かった。
However, when the digital camera disclosed in
本発明は、上記問題に鑑みてなされたものであり、画像中の適切な位置に所定の画像を合成するのに好適な画像処理装置、並びに、これらをコンピュータにより実現するためのプログラムを提供することを目的とする。 The present invention has been made in view of the above problems, and provides an image processing apparatus suitable for synthesizing a predetermined image at an appropriate position in an image, and a program for realizing these by a computer. For the purpose.
上記目的を達成するために、本発明の第1の観点に係る画像処理装置は、
被写体を撮像して得られた撮像画像にキャラクタ画像を合成して合成画像を生成する画像処理装置であって、
撮像画像とキャラクタ画像とを記憶する記憶手段と、
前記記憶手段に記憶されている撮像画像に含まれている被写体を検出する被写体検出手段と、
前記被写体検出手段により検出された被写体が、撮像者が撮像を予定していた撮像予定被写体であるか、撮像者が撮像を予定していなかった非撮像予定被写体であるかを判別する被写体判別手段と、
前記被写体検出手段により検出された被写体の撮像画像中の位置を検出する被写体位置検出手段と、
前記被写体位置検出手段により検出された被写体の位置のうち、前記被写体判別手段により判別された非撮像予定被写体の位置に基づいて、合成しようとするキャラクタの撮像画像中の位置を決定するキャラクタ位置決定手段と、
前記記憶手段に記憶されている撮像画像の前記キャラクタ位置決定手段により決定されたキャラクタの位置に前記記憶手段に記憶されているキャラクタ画像を合成して、合成画像を生成する合成手段と、
を備える、ことを特徴とする。
In order to achieve the above object, an image processing apparatus according to the first aspect of the present invention provides:
An image processing apparatus that generates a composite image by combining a character image with a captured image obtained by capturing an image of a subject,
Storage means for storing captured images and character images;
Subject detection means for detecting a subject included in the captured image stored in the storage means;
Subject discrimination means for discriminating whether the subject detected by the subject detection means is a subject to be imaged scheduled to be taken by the photographer or a non-imaging subject to be photographed by the imager. When,
Subject position detection means for detecting a position in the captured image of the subject detected by the subject detection means;
Character position determination for determining a position in the captured image of the character to be synthesized based on the position of the non-imaging scheduled subject determined by the subject determination means among the positions of the subjects detected by the subject position detection means Means,
A combining unit that combines the character image stored in the storage unit with the character position determined by the character position determination unit of the captured image stored in the storage unit to generate a combined image;
It is characterized by comprising.
前記記憶手段は、撮像予定被写体を示す画像である撮像予定被写体画像をさらに記憶し、
前記被写体判別手段は、前記記憶手段に記憶されている撮像画像のうち前記被写体検出手段により検出された被写体を示す画像部分が、前記記憶手段に記憶されている撮像予定被写体画像と一致するか否かにより、前記被写体検出手段により検出された被写体が撮像予定被写体であるか非撮像予定被写体であるかを判別してもよい。
The storage means further stores an imaging target subject image that is an image showing the imaging subject.
The subject discriminating means determines whether or not an image portion showing the subject detected by the subject detecting means in the captured image stored in the storage means coincides with the scheduled subject image stored in the storage means. Thus, it may be determined whether the subject detected by the subject detection means is a subject to be imaged or a subject not to be imaged.
前記キャラクタ位置決定手段は、撮像予定被写体の位置から撮像画像の一端までの距離と、キャラクタの位置から撮像画像の他端までの距離とが一致するようにキャラクタの位置を決定してもよい。 The character position determination means may determine the position of the character so that a distance from the position of the subject to be imaged to one end of the captured image matches a distance from the character position to the other end of the captured image.
前記キャラクタ位置決定手段は、撮像予定被写体を構成する画像部分の所定の座標軸における最も大きい座標と、キャラクタを構成する画像部分の当該所定の座標軸における最も小さい座標とが一致するようにキャラクタの位置を決定してもよい。 The character position determination means determines the position of the character so that the largest coordinate on the predetermined coordinate axis of the image portion constituting the imaging subject and the smallest coordinate on the predetermined coordinate axis of the image portion constituting the character match. You may decide.
前記キャラクタ位置決定手段は、前記被写体検出手段により複数の撮像予定被写体が検出された場合に、当該複数の撮像予定被写体の位置に基づいて、複数の撮像予定被写体とキャラクタとが合成画像上で所定の方向に並んで配置されるようにキャラクタの位置を決定してもよい。 The character position determining unit is configured to determine a plurality of scheduled imaging subjects and a character on a composite image based on positions of the scheduled imaging subjects when the subject detection unit detects a plurality of scheduled imaging subjects. The position of the character may be determined so as to be arranged side by side.
被写体は人物であり、
前記被写体検出手段により検出された被写体の視線が正面を向いているか否かを判別する視線判別手段、をさらに備え、
前記キャラクタ位置決定手段は、前記視線判別手段により視線が正面を向いていると判別された非撮像予定被写体の位置をキャラクタの位置に決定してもよい。
The subject is a person,
Line-of-sight discrimination means for determining whether or not the line of sight of the subject detected by the subject detection means is facing the front,
The character position determination means may determine the position of the non-imaging scheduled subject determined by the line-of-sight determination means that the line of sight is facing the front.
前記記憶手段に記憶されている撮像画像に含まれている所定の被写体特定物を検出する被写体特定物検出手段と、
前記被写体特定物検出手段により検出された被写体特定物の撮像画像中の位置を検出する被写体特定物位置検出手段と、をさらに備え、
前記被写体判別手段は、前記被写体検出手段により検出された被写体のうち、被写体の位置が前記被写体特定物検出手段により検出された被写体特定物の位置と所定の距離以下である被写体を撮像予定被写体であると判別してもよい。
Subject specific object detection means for detecting a predetermined subject specific object included in the captured image stored in the storage means;
Subject specific object position detection means for detecting a position in the captured image of the subject specific object detected by the subject specific object detection means;
The subject determination unit is a subject to be imaged among subjects detected by the subject detection unit and whose subject position is equal to or less than a predetermined distance from the subject specific object position detected by the subject specific object detection unit. It may be determined that there is.
撮像画像は動画像であり、
被写体特定物は所定のパターンで点滅する発光装置であり、
前記被写体判別手段は、前記記憶手段に記憶されている撮像画像のうち時間経過とともに所定のパターンで輝度が変化する画像部分を検出することにより被写体特定物を検出してもよい。
The captured image is a moving image,
The subject specific object is a light emitting device that blinks in a predetermined pattern,
The subject determination unit may detect a subject specific object by detecting an image portion whose luminance changes with a predetermined pattern with time in the captured image stored in the storage unit.
上記目的を達成するために、本発明のその他の観点に係るプログラムは、
コンピュータを、
被写体を撮像して得られた撮像画像にキャラクタ画像を合成して合成画像を生成する画像処理装置として機能させるためのプログラムであって、
当該画像処理装置は、
撮像画像とキャラクタ画像とを記憶する記憶手段、
を備え、
前記記憶手段に記憶されている撮像画像に含まれている被写体を検出する被写体検出手段、
前記被写体検出手段により検出された被写体が、撮像者が撮像を予定していた撮像予定被写体であるか、撮像者が撮像を予定していなかった非撮像予定被写体であるかを判別する被写体判別手段、
前記被写体検出手段により検出された被写体の撮像画像中の位置を検出する被写体位置検出手段、
前記被写体位置検出手段により検出された被写体の位置のうち、前記被写体判別手段により判別された非撮像予定被写体の位置に基づいて、合成しようとするキャラクタの撮像画像中の位置を決定するキャラクタ位置決定手段、
前記記憶手段に記憶されている撮像画像の前記キャラクタ位置決定手段により決定されたキャラクタの位置に前記記憶手段に記憶されているキャラクタ画像を合成して、合成画像を生成する合成手段、
として機能させる、ことを特徴とする。
In order to achieve the above object, a program according to another aspect of the present invention provides:
Computer
A program for functioning as an image processing apparatus that combines a character image with a captured image obtained by imaging a subject to generate a composite image,
The image processing apparatus
Storage means for storing captured images and character images;
With
Subject detection means for detecting a subject included in the captured image stored in the storage means;
Subject discrimination means for discriminating whether the subject detected by the subject detection means is a subject to be imaged scheduled to be taken by the photographer or a non-imaging subject to be photographed by the imager. ,
Subject position detection means for detecting a position in the captured image of the subject detected by the subject detection means;
Character position determination for determining a position in the captured image of the character to be synthesized based on the position of the non-imaging scheduled subject determined by the subject determination means among the positions of the subjects detected by the subject position detection means means,
A combining unit that combines the character image stored in the storage unit with the character position determined by the character position determination unit of the captured image stored in the storage unit to generate a combined image;
It is made to function as.
本発明によれば、画像中の適切な位置に所定の画像を合成するのに好適な画像処理装置、並びに、これらをコンピュータにより実現するためのプログラムを提供することができる。 ADVANTAGE OF THE INVENTION According to this invention, the image processing apparatus suitable for synthesize | combining a predetermined image in the appropriate position in an image, and the program for implement | achieving these with a computer can be provided.
以下、図面に基づき、本発明の実施形態に係る撮像装置の一例について説明する。なお、本発明は、デジタルカメラなどの撮像装置の他、パーソナルコンピュータなどあらゆる画像処理装置に適用することができる。 Hereinafter, an example of an imaging apparatus according to an embodiment of the present invention will be described with reference to the drawings. The present invention can be applied to any image processing apparatus such as a personal computer in addition to an imaging apparatus such as a digital camera.
まず、図1を用いて、本発明の実施形態に係る撮像装置100の構成を説明する。撮像装置100は、被写体を含む空間を撮像して画像を生成し、生成した画像にCG(Computer Graphics)技術などを用いて生成したキャラクタ画像を合成する装置である。なお、本実施形態においては、被写体は人物の顔であり、キャラクタは動物のキャラクタであるものとして説明する。そして、人物の顔とキャラクタの顔との画像上における位置に基づいて、キャラクタの配置位置を算出する例を示す。
First, the configuration of the
図1に示すように、撮像装置100は、制御部10と、光学系11と、光学系制御部12と、光学系駆動部13と、撮像素子14と、A/D(Analog/Digital)変換器15と、画像処理部16と、画像処理メモリ17と、フラッシュ制御部18と、フラッシュ発光部19と、CG生成部20と、画像合成部21と、画像合成メモリ22と、記憶部23と、操作部24と、表示部25と、電源制御部26と、を備える。
As shown in FIG. 1, the
制御部10は、撮像装置100全体の動作を制御する。制御部10は、例えば、CPU、ROM及びRAMなどから構成される。この場合、CPUがRAMをワークエリアとしてROMに記憶されているプログラムを実行することにより、CPU、ROM及びRAMが全体として制御部10として機能する。
The
光学系11は、ズームレンズ、フォーカスレンズ、絞り、シャッターなどから構成される。
The
光学系制御部12は、制御部10や画像処理部16による制御に従って、光学系駆動部13を制御する。具体的には、光学系制御部12は、光学系駆動部13を制御することにより、光学系11が備えるズームレンズの位置を調節してズームを合わせるとともに、光学系11が備えるフォーカスレンズの位置を調節して焦点を合わせる。また、光学系制御部12は、光学系駆動部13を制御することにより、光学系11が備える絞りやシャッターを駆動する。
The optical
撮像素子14は、光学系11から入射された光を電気信号に変換する素子である。撮像素子14は、CCD(Charge Coupled Device)などから構成され、変換した電気信号をアナログ信号として出力する。
The
A/D変換器15は、撮像素子14から供給されたアナログ信号をデジタル信号に変換して出力する。
The A /
画像処理部16は、A/D変換器15から供給されたデジタル信号を処理して、撮像された画像を示す画像データを生成する。また、画像処理部16は、供給された画像のノイズ除去、配列変換、色変換、認識処理、圧縮処理を実行する。画像処理部16は、シャッターボタンが押されたときは、比較的高画質の画像を示す大容量の画像データを生成し、プレビュー表示(スルー表示)をするときは、比較的低画質の画像を示す小容量の画像データを生成することもできる。しかしながら、本実施形態においては、理解を容易にするため、シャッターボタンが押されたときに生成される画像の画質と、プレビュー表示をするときに生成される画像の画質は同じものとする。すなわち、撮像装置100は、シャッターボタンが押されたときは、プレビュー表示している画像を保存するものとして説明する。なお、画像処理部16は、画像データを生成する際に、画像処理メモリ17をバッファとして用いる。画像処理部16は、例えば、CPU、ROM及びRAMなどから構成される。
The
画像処理メモリ17は、画像処理部16がデジタル信号から画像データを生成するまでに生成される中間データなどを記憶する。画像処理メモリ17は、例えば、DRAM(Dynamic Random Access Memory)などから構成される。
The
フラッシュ制御部18は、制御部10による制御に従って、フラッシュ発光部19を制御する。フラッシュ発光部19は、閃光電球などから構成される。
The
CG生成部20は、記憶部23に記憶されているキャラクタ生成情報などに基づいて、三次元の仮想空間上のキャラクタのCGを生成する。CG生成部20は、例えば、CPU、ROM及びRAMなどから構成される。
The
画像合成部21は、画像処理部16から供給された画像データにより示される画像とCG生成部20から供給されたCGとを合成する。なおCG生成部20から供給されるCGは三次元の仮想空間上のキャラクタのCGである。従って、画像合成部21は、当該CGを、三次元の仮想空間上の所定の点を基準として、三次元の仮想空間上の所定の投影面に投影したときに得られる画像(以下「キャラクタ画像」という。)を抽出し、抽出したキャラクタ画像を画像処理部16から供給された画像データにより示される画像と合成する。なお、画像合成部21は、画像を合成する際に、画像合成メモリ22をバッファとして用いる。画像合成部21は、例えば、CPU、ROM及びRAMなどから構成される。
The
画像合成メモリ22は、画像合成部21が画像を合成するまでに生成される中間データなどを記憶する。画像合成メモリ22は、例えば、DRAM(Dynamic Random Access Memory)などから構成される。
The
記憶部23は、画像処理部16が生成した画像データ、画像合成部21が生成した画像データ、3次元の仮想空間上のキャラクタのCGを生成するためのキャラクタ生成情報などを記憶する。記憶部23は、フラッシュメモリなどから構成される。
The
操作部24は、ユーザから各種のキー操作を受け付ける。操作部24は、シャッターボタン、ズームボタン、カーソルキー、決定ボタン、メニューボタンなどを備える。操作部24は、ユーザから受け付けた各種のキー操作を示す信号を制御部10に供給する。一方、制御部10は、操作部24からこれらの信号を受信すると、受信した信号に基づいた処理を実行する。
The
表示部25は、記憶部23に記憶されている画像データにより表現される画像などを表示する。表示部25は、液晶ディスプレイなどから構成される。
The
電源制御部26は、図示しない電源のオン/オフの制御や、充電の制御を実行する。電源制御部26は、例えば、所定の時間継続して操作部24に操作入力がない場合に、電源をオフにする機能を有する。電源制御部26は、例えば、CPU、ROM及びRAMなどから構成される。
The power
次に、図2に示すフローチャートを用いて、撮像装置100が実行する画像合成処理を説明する。撮像装置100は、電源が投入されると、図2のフローチャートにより示される画像合成処理を実行する。また、画像合成処理は、シャッターボタンが押されるまでは、スルー画像とキャラクタ画像とを合成して合成画像を生成してプレビュー表示する処理を繰り返し、シャッターボタンが押されたことに応答して、合成画像を保存する処理である。なお、理解を容易にするため、「撮像された画像」を「スルー画像」、「スルー画像とキャラクタ画像とを合成して得られる画像」を「合成画像」とする。
Next, an image composition process executed by the
まず、制御部10は、スルー画像を取得する(ステップS101)。具体的には、制御部10は、画像処理部16を制御してスルー画像を生成する。
First, the
そして、制御部10は、キャラクタの選択を求める要求があるか否かを判別する(ステップS102)。例えば、制御部10は、キャラクタの選択を求める操作入力がユーザから操作部24になされたか否かを判別することにより、キャラクタの選択を求める要求があるか否かを判別する。なお、キャラクタの選択を求める要求は、ユーザからのものに限られない。例えば、制御部10は、記憶部23に記憶されているデータに基づいてキャラクタの選択を求める要求があるか否かを判別してもよい。
And the
制御部10は、キャラクタの選択を求める要求があると判別すると(ステップS102:YES)、キャラクタの選択を実行する(ステップS103)。具体的には、制御部10は、キャラクタの選択を促す画面を表示部25に表示し、操作部24を介してユーザからのキャラクタの選択を受け付ける。
When determining that there is a request for character selection (step S102: YES), the
なお、制御部10は、キャラクタを指定する情報とともに、キャラクタの顔の中心の座標の初期値を指定する情報や、キャラクタの顔の半径を指定する情報などをキャラクタ指定情報として、ユーザから受け付けるようにしてもよい。キャラクタの顔の中心の座標の初期値は、キャラクタの配置位置の初期値を示し、スルー画像上の座標で示される。キャラクタの顔の半径は、キャラクタのスルー画像上での大きさを示し、画素数(ピクセル)で示される。以下、本明細書において、座標は、スルー画像(または、合成画像)上の座標を示し、顔の半径は、スルー画像(または、合成画像)上での顔の半径を示す。
The
図3に示す例では、キャラクタとして犬が指定され、キャラクタの顔の中心座標の初期値として(Xc0,Yc0)が指定され、キャラクタの顔の半径として20(ピクセル)が指定されている。なお、キャラクタの顔の中心座標の初期値、キャラクタの顔の半径などは、ユーザから受け付けずに、あらかじめ記憶部23に記憶されている値などを使用してもよい。
In the example shown in FIG. 3, a dog is designated as the character, (Xc0, Yc0) is designated as the initial value of the center coordinate of the character's face, and 20 (pixels) is designated as the radius of the character's face. Note that the initial value of the center coordinate of the character's face, the radius of the character's face, and the like may be values stored in advance in the
次に、制御部10は、選択されたキャラクタのキャラクタ画像を生成する(ステップS104)。具体的には、まず、制御部10は、三次元の仮想空間上のキャラクタのCGをCG生成部20に生成させる。例えば、制御部10は、犬を指定する情報をCG生成部20に供給する。そして、CG生成部20は、記憶部23に記憶されているキャラクタ生成情報のうち、三次元の仮想空間上の犬のCGを生成するためのキャラクタ生成情報を読み出す。CG生成部20は、読み出したキャラクタ生成情報に基づいて、三次元の仮想空間上の犬のCGを生成する。そして、制御部10は、生成された犬のCGを変換して犬のキャラクタ画像を生成する。具体的には、制御部10は、CG生成部20により生成された犬のCGと、キャラクタの顔の半径とを画像合成部21に供給し、画像合成部21を制御して、犬のキャラクタ画像を生成する。
Next, the
次に、制御部10は、生成したキャラクタ画像を保存する(ステップS105)。具体的には、制御部10は、生成した犬のキャラクタ画像を記憶部23に記憶する。
Next, the
制御部10は、キャラクタの選択を求める要求がないと判別する(ステップS102:NO)、若しくは、キャラクタ画像の保存(ステップS105)を終了すると、キャラクタ配置方法の変更を求める要求があるか否かを判別する(ステップS106)。例えば、制御部10は、キャラクタ配置方法の変更を求める操作入力がユーザから操作部24になされたか否かを判別することにより、キャラクタ配置方法の変更を求める要求があるか否かを判別する。なお、キャラクタ配置方法の変更を求める要求は、ユーザからのものに限られない。例えば、制御部10は、記憶部23に記憶されているデータに基づいてキャラクタ配置方法の変更を求める要求があるか否かを判別してもよい。
The
制御部10は、キャラクタ配置方法の変更を求める要求があると判別すると(ステップS106:YES)、キャラクタ配置方法を変更する(ステップS107)。具体的には、制御部10は、キャラクタ配置方法の変更を促す画面を表示部25に表示し、操作部24を介してユーザからのキャラクタ配置方法の変更を受け付ける。
When determining that there is a request for changing the character arrangement method (step S106: YES), the
なお、制御部10は、キャラクタ配置方法を指定する情報とともに、配置パラメータや、優先度を指定する情報などをキャラクタ配置方法指定情報として、ユーザから受け付けるようにしてもよい。
Note that the
図3(B)にキャラクタ配置方法指定情報の一例を示す。キャラクタ配置方法指定情報は、キャラクタ配置方法を示す情報と、配置パラメータと、優先度を示す情報とを含む。ここで、配置パラメータは、キャラクタ配置方法毎に用意されるパラメータである。優先度は、対応するキャラクタ配置方法でのキャラクタ配置を実行するか否かを示すとともに、複数のキャラクタ配置方法でキャラクタ配置を実行する場合の優先度を示す。例えば、優先度が−1に設定されたキャラクタ配置方法でのキャラクタ配置は実行されず、優先度が0に設定されたキャラクタ配置方法でのキャラクタ配置は実行される。そして、例えば、優先度が−1、0以外に設定された場合、優先度に従って、対応するキャラクタ配置方法でのキャラクタ配置が実行されるか否かが決定される。具体的には、例えば、キャラクタ配置を実行しようとしているキャラクタ配置方法に対応する優先度よりも高い優先度(数字が小さい優先度)に対応するキャラクタ配置方法でのキャラクタ配置が全て失敗している場合は、当該キャラクタ配置方法によるキャラクタ配置を実行する。一方、キャラクタ配置を実行しようとしているキャラクタ配置方法に対応する優先度よりも高い優先度(数字が小さい優先度)に対応するキャラクタ配置方法でのキャラクタ配置が成功している場合は、当該キャラクタ配置方法によるキャラクタ配置は実行しない。 FIG. 3B shows an example of character placement method designation information. The character placement method designation information includes information indicating a character placement method, placement parameters, and information indicating priority. Here, the placement parameter is a parameter prepared for each character placement method. The priority indicates whether or not the character placement by the corresponding character placement method is executed, and indicates the priority when the character placement is executed by a plurality of character placement methods. For example, character placement using the character placement method with the priority set to −1 is not executed, and character placement using the character placement method with the priority set to 0 is executed. For example, when the priority is set to other than −1 and 0, it is determined whether or not the character placement by the corresponding character placement method is executed according to the priority. Specifically, for example, all character placements in the character placement method corresponding to the priority (priority with a lower number) than the priority corresponding to the character placement method for which character placement is to be executed have failed. In this case, character placement by the character placement method is executed. On the other hand, if the character placement in the character placement method corresponding to the priority (priority with a lower number) is higher than the priority corresponding to the character placement method in which the character placement is to be executed, Character placement by method is not executed.
なお、例えば、キャラクタの顔が撮像領域からはみ出る場合やキャラクタの顔が撮像しようとする人の顔と重なる場合にキャラクタ配置が失敗したものとみなすことができる。なお、優先度などを設定せずに、所定のキャラクタ配置方法でキャラクタ配置を実行するようにしてもよい。 Note that, for example, when the character's face protrudes from the imaging area or when the character's face overlaps the face of the person to be imaged, it can be considered that the character placement has failed. Note that character placement may be executed by a predetermined character placement method without setting priority or the like.
ここで、図3(B)を参照して、各キャラクタ配置方法について説明する。図3(B)に示すように、キャラクタ配置方法には、左右均等配置、左右隣接配置、上下隣接配置、等間隔配置、非登録顔置換配置などがある。 Here, with reference to FIG. 3B, each character arrangement method will be described. As shown in FIG. 3B, the character placement methods include left and right equal placement, left and right adjacent placement, top and bottom adjacent placement, equidistant placement, unregistered face replacement placement, and the like.
左右均等配置は、検出された顔とキャラクタの顔とが合成画像上で左右均等に配置されるようにキャラクタを配置する方法である。なお、左右均等配置は、検出された顔が1つの場合にのみ実行され、検出された顔が複数ある場合は、当該キャラクタ配置は失敗となる。 The left and right equal arrangement is a method of arranging characters so that the detected face and the character's face are arranged equally on the left and right on the composite image. Note that the left and right equal placement is executed only when there is one detected face, and when there are a plurality of detected faces, the character placement fails.
左右隣接配置は、検出された顔の左端部の左右方向の座標とキャラクタの顔の右端部の左右方向の座標とが一致、若しくは、検出された顔の右端部の左右方向の座標とキャラクタの顔の左端部の左右方向の座標とが一致するようにキャラクタを配置する方法である。また、左右隣接配置は、検出された顔の左/右のどちらにキャラクタの顔を配置するかを示す情報を配置パラメータとして有する。なお、左右隣接配置は、検出された顔が1つの場合にのみ実行され、検出された顔が複数ある場合は、当該キャラクタ配置は失敗となる。 In the left and right adjacent arrangement, the left and right coordinates of the left end of the detected face coincide with the left and right coordinates of the right end of the character's face, or the left and right coordinates of the detected right end of the face and the character's This is a method of arranging characters so that the left and right coordinates of the left end of the face coincide. Further, the left and right adjacent arrangement has information indicating whether the character face is arranged on the left or right of the detected face as an arrangement parameter. Note that the left and right adjacent arrangement is executed only when there is one detected face, and when there are a plurality of detected faces, the character arrangement fails.
上下隣接配置は、検出された顔の下端部の上下方向の座標とキャラクタの顔の上端部の上下方向の座標とが一致、若しくは、検出された顔の上端部の上下方向の座標とキャラクタの顔の下端部の上下方向の座標とが一致するようにキャラクタを配置する方法である。また、上下隣接配置は、検出された顔の上/下のどちらにキャラクタの顔を配置するかを示す情報を配置パラメータとして有する。なお、上下隣接配置は、検出された顔が1つの場合にのみ実行され、検出された顔が複数ある場合は、当該キャラクタ配置は失敗となる。 In the vertically adjacent arrangement, the vertical coordinate of the lower end of the detected face matches the vertical coordinate of the upper end of the character's face, or the vertical coordinate of the detected upper end of the face and the character's This is a method of arranging characters so that the vertical coordinates of the lower end of the face coincide. Further, the vertically adjacent layout has information indicating whether the character's face is placed above or below the detected face as a placement parameter. Note that the upper and lower adjacent placement is executed only when there is one detected face, and when there are a plurality of detected faces, the character placement fails.
等間隔配置は、検出された複数の顔とキャラクタの顔とが合成画像上で等間隔に配置されるようにキャラクタを配置する方法である。等間隔配置は、複数の顔の左/右のどちらにキャラクタの顔を配置するかを示す情報を配置パラメータとして有する。なお、等間隔配置は、複数の顔が検出された場合にのみ実行され、検出された顔が1つである場合は、当該キャラクタ配置は失敗となる。 The equidistant arrangement is a method of arranging characters such that a plurality of detected faces and the character's face are arranged at equal intervals on the composite image. The equidistant arrangement has information indicating whether the character's face is arranged on the left / right of the plurality of faces as an arrangement parameter. Note that the equidistant arrangement is executed only when a plurality of faces are detected. If there is one detected face, the character arrangement fails.
非登録顔置換配置は、検出された顔のうち、登録されていない顔、すなわち、顔認証で認証されない顔の中心の座標と、キャラクタの顔の中心の座標とが一致するように、キャラクタを配置する方法である。なお、非登録顔置換配置は、登録されていない顔のうち正面向きの顔(視線方向が撮像装置である顔)のみを対象とするか、若しくは、登録されていない全ての顔を対象にするかを示す情報を配置パラメータとして有する。 The non-registered face replacement arrangement allows the character to be matched so that the coordinates of the center of the detected face that is not registered, that is, the face that is not authenticated by face authentication, coincide with the coordinates of the center of the character's face. It is a method of arrangement. Note that the unregistered face replacement arrangement targets only the front-facing faces (faces whose line-of-sight direction is the imaging device) among unregistered faces or all unregistered faces. This information is included as an arrangement parameter.
次に、制御部10は、キャラクタ配置方法指定情報を保存する(ステップS108)。具体的には、制御部10は、ステップS107で変更したキャラクタ配置方法指定情報を記憶部23に記憶する。
Next, the
制御部10は、キャラクタ配置方法の変更を求める要求がないと判別する(ステップS106:NO)、若しくは、キャラクタ配置方法指定情報の保存(ステップS108)を終了すると、キャラクタを配置する位置を算出する処理を実行する(ステップS109)。
The
キャラクタ配置位置算出処理(ステップS109)については、図4に示すフローチャートを参照して詳細に説明する。 The character placement position calculation process (step S109) will be described in detail with reference to the flowchart shown in FIG.
まず、制御部10は、スルー画像から顔を検出する(ステップS201)。具体的には、制御部10は、記憶部23に記憶されているスルー画像を示す画像データを解析することにより、スルー画像に含まれる顔を検出する。例えば、制御部10は、スルー画像から主に肌色と黒とから構成される画像部分を検出し、当該検出された画像部分を、顔を示す画像部分であると判別する。或いは、あらかじめ記憶部23に記憶されている顔を示す画像と類似する画像部分をスルー画像から検出し、検出された画像部分を、顔を示す画像部分であると判別する。なお、制御部10は、スルー画像に複数の顔が含まれる場合は、スルー画像に含まれる全ての顔を検出する。
First, the
そして、制御部10は、検出した顔の中心の座標を取得する(ステップS202)。例えば、制御部10は、検出した顔を示す画像部分をスルー画像から抽出する。そして、制御部10は、抽出した画像部分を構成する全ての画素についてスルー画像上の座標の平均値を求め、求めた平均値を当該顔の中心の座標に設定する。制御部10は、検出した顔の中心の座標を示す情報を記憶部23に記憶する。なお、制御部10は、スルー画像に複数の顔が含まれる場合は、スルー画像に含まれる全ての顔の中心の座標を取得する。
And the
また、制御部10は、検出した顔の半径を取得する(ステップS203)。例えば、制御部10は、検出した顔を示す画像部分を構成する画素数を求め、求めた画素数の画素から構成される円の半径を当該顔の半径に設定する。制御部10は、検出した顔の半径を示す情報を記憶部23に記憶する。なお、制御部10は、スルー画像に複数の顔が含まれる場合は、スルー画像に含まれる全ての顔の半径を取得する。
Further, the
次に、制御部10は、検出した顔について顔認証を行う(ステップS204)。具体的には、制御部10は、検出した顔があらかじめ登録されている顔と一致するか否かを判別し、判別結果を記憶部23に記憶する。検出した顔とあらかじめ登録されている顔とが一致するか否かを判別する手法は任意であるが、例えば、制御部10は、パターンマッチングにより判別する。この場合、顔画像を示す画像データをあらかじめ複数個記憶部23に記憶しておく。そして、制御部10は、検出した顔を示す画像と当該記憶部23に記憶されている顔画像とのマッチングを試みる。そして、制御部10は、検出した顔を示す画像が記憶部23に記憶されているいずれかの顔画像とマッチするか否かを判別する。なお、制御部10は、スルー画像に複数の顔が含まれる場合は、スルー画像に含まれる全ての顔について顔認証を行う。
Next, the
顔画像を示す画像データの代わりに、当該顔画像から抽出された特徴量を示すデータを記憶部23に記憶しておき、当該特徴量を示すデータと検出した顔から抽出された特徴量を示すデータとを比較することにより、顔認証を行うようにしてもよい。
Instead of the image data indicating the face image, data indicating the feature amount extracted from the face image is stored in the
次に、制御部10は、検出した顔がカメラ目線であるか否かを判別する(ステップS205)。具体的には、例えば、制御部10は、スルー画像に基づいて、顔の向きと目に対する瞳(黒目)の相対的な位置とを検出し、検出した顔の向きと瞳の位置とに基づいて、カメラ目線であるか否かを判別する。例えば、顔の向きが正面向きであり、瞳の位置が目の中心にある場合は、カメラ目線であると判別する。また、例えば、顔の向きが左(右)向きであり、瞳の位置が目の中心から右(左)にずれている場合は、カメラ目線であると判別する。また、例えば、顔の向きが上(下)向きであり、瞳の位置が目の中心から下(上)にずれている場合は、カメラ目線であると判別する。なお、顔を示す画像部分において、肌色と黒とがどのように分布しているかを解析することにより、顔の向きを検出することができる。また、目を示す画像部分において、白と黒とがどのように分布しているかを解析することにより、目に対する瞳の相対的な位置を検出することができる。
Next, the
或いは、制御部10は、検出した顔を示す画像部分が、あらかじめ記憶部23に記憶されているカメラ目線である顔を示す画像と類似すると判別した場合に、検出した顔がカメラ目線であると判別する。制御部10は、検出した顔がカメラ目線であるか否かを示す情報を記憶部23に記憶する。なお、制御部10は、スルー画像に複数の顔が含まれる場合は、スルー画像に含まれる全ての顔についてカメラ目線であるか否かを判別する。
Alternatively, when the
そして、制御部10は、左右均等配置を実行するか否かを判別する(ステップS206)。具体的には、制御部10は、左右均等配置に対応付けられて記憶部23に記憶されている優先度が−1でなく、且つ、当該優先度よりも優先度が高いキャラクタ配置方法に対応する配置成功フラグが1にセットされていない場合に、左右均等配置を実行すると判別する。なお、配置成功フラグは、キャラクタ配置方法に対応付けられて記憶部23に記憶されているフラグである。そして、配置成功フラグは、当該キャラクタ配置方法によるキャラクタ配置が成功である場合に1にセットされ、当該キャラクタ配置方法によるキャラクタ配置が失敗である場合に0にクリアされる。
And the
制御部10は、左右均等配置を実行すると判別すると(ステップS206:YES)、左右均等配置用のキャラクタ配置位置算出処理を実行する(ステップS207)。左右均等配置用のキャラクタ配置位置算出処理(ステップS207)については、図5に示すフローチャートを参照して詳細に説明する。なお、理解を容易にするため、左右均等配置用のキャラクタ配置位置算出処理の説明においては、スルー画像からは1つの顔のみが検出されたものとして説明する。
When it is determined that the left and right equal arrangement is to be executed (step S206: YES), the
まず、図6(A)、(B)、並びに、図7を参照して合成画像を説明する。 First, a synthesized image will be described with reference to FIGS. 6A and 6B and FIG.
図6(A)は、スルー画像の一例を示す図である。図6(A)に示す例では、スルー画像には人物31を示す画像部分が含まれている。図6(B)は、キャラクタの一例を示す図である。図6(B)には、ステップS103において選択されたキャラクタ41が例示されている。
FIG. 6A is a diagram illustrating an example of a through image. In the example shown in FIG. 6A, the through image includes an image portion showing the
図7は、スルー画像にキャラクタ画像を合成することにより得られる合成画像の一例を示す図である。ここで、図7に示されている記号について説明する。XmaxはX軸方向の画素数であり、YmaxはY軸方向の画素数である。すなわち、合成画像の画像サイズは、Xmax×Ymaxである。Xf1は、人物31の顔の中心のX軸方向の座標(合成画像上、または、スルー画像上の座標)であり、Yf1は、人物31の顔の中心のY軸方向の座標である。すなわち、人物31の顔の中心の座標は(Xf1,Yf1)である。Rf1は、人物31の顔の半径(合成画像上、または、スルー画像上の顔の半径)である。Xcは、キャラクタ41の顔の中心のX軸方向の座標であり、Ycは、キャラクタ41の顔の中心のY軸方向の座標である。すなわち、キャラクタ41の顔の中心の座標は(Xc,Yc)である。Rcは、キャラクタ41の顔の半径である。なお、X座標の基準は合成画像の左端であり、Y座標の基準は合成画像の上端であるものとして説明する。従って、合成画像の左上端の画素の座標は(0,0)となる。
FIG. 7 is a diagram illustrating an example of a combined image obtained by combining a character image with a through image. Here, the symbols shown in FIG. 7 will be described. Xmax is the number of pixels in the X-axis direction, and Ymax is the number of pixels in the Y-axis direction. That is, the image size of the composite image is Xmax × Ymax. Xf1 is the coordinate in the X-axis direction (coordinate on the composite image or through image) of the center of the face of the
本実施形態においては、人物31の顔(検出された顔)の中心の座標に基づいて、キャラクタ41の顔の中心の座標を定める。なお、図7において、太線で囲まれた部分が人物31若しくはキャラクタ41の顔を示す画像部分である。
In the present embodiment, the coordinates of the center of the face of the
図5のフローチャートの説明に戻る。
制御部10は、キャラクタの顔の中心のX座標を算出する(ステップS301)。具体的には、制御部10は、キャラクタ41の顔の中心のX座標Xcを式(1)により算出する。なお、キャラクタ41の顔の中心の座標の初期値は(Xc0,Yc0)である。従って、キャラクタ41の顔の中心のY座標はYc=Yc0である。
Xc=Xmax−Xf1 (1)
Returning to the flowchart of FIG.
The
Xc = Xmax-Xf1 (1)
次に、制御部10は、検出した顔とキャラクタの顔とが合成画像上で重なるか否かを判別する(ステップS302)。具体的には、例えば、制御部10は、式(2)を満たすと判別した場合に、検出した顔とキャラクタの顔とが合成画像上で重なると判別する。
(Xf1−Xc)2+(Yf1−Yc)2<(Rf1+Rc)2 (2)
Next, the
(Xf1-Xc) 2 + (Yf1-Yc) 2 <(Rf1 + Rc) 2 (2)
制御部10は、検出した顔とキャラクタの顔とが合成画像上で重ならないと判別した場合(ステップS302:NO)、キャラクタの顔が合成画像の画像領域からはみ出るか否かを判別する(ステップS303)。具体的には、例えば、制御部10は、式(3)〜(6)の少なくとも1つの式を満たすと判別した場合に、キャラクタの顔が合成画像の画像領域からはみ出ると判別する。
Xc+Rc>Xmax (3)
Xc<Rc (4)
Yc+Rc>Ymax (5)
Yc<Rc (6)
When determining that the detected face and the character's face do not overlap on the composite image (step S302: NO), the
Xc + Rc> Xmax (3)
Xc <Rc (4)
Yc + Rc> Ymax (5)
Yc <Rc (6)
制御部10は、キャラクタの顔が合成画像の画像領域からはみ出ないと判別した場合(ステップS303:NO)、配置成功フラグをセットする(ステップS304)。具体的には、制御部10は、キャラクタ配置方法に対応付けられて記憶部23に記憶されている配置成功フラグを1にセットする。
When it is determined that the character's face does not protrude from the image area of the composite image (step S303: NO), the
一方、制御部10は、検出した顔とキャラクタの顔とが合成画像上で重なると判別した場合(ステップS302:YES)、若しくは、キャラクタの顔が合成画像の画像領域からはみ出ると判別した場合(ステップS303:YES)、配置成功フラグをクリアする(ステップS305)。具体的には、制御部10は、キャラクタ配置方法に対応付けられて記憶部23に記憶されている配置成功フラグを0にクリアする。
On the other hand, the
制御部10は、配置成功フラグのセット(ステップS304)、若しくは、配置成功フラグのクリア(ステップS305)を終了すると、左右均等配置用キャラクタ配置位置算出処理を終了する。
When the placement success flag is set (step S304) or the placement success flag is cleared (step S305), the
図4に示すフローチャートの説明に戻る。左右均等配置を実行しない(ステップS206:NO)、若しくは、左右均等配置用キャラクタ配置位置算出処理(ステップS207)を終了すると、制御部10は、左右隣接配置を実行するか否かを判別する(ステップS208)。具体的には、制御部10は、左右隣接配置に対応付けられて記憶部23に記憶されている優先度が−1でなく、且つ、当該優先度よりも優先度が高いキャラクタ配置方法に対応する配置成功フラグが1にセットされていない場合に、左右隣接配置を実行すると判別する。
Returning to the description of the flowchart shown in FIG. When the left and right equal placement is not executed (step S206: NO), or when the left and right even placement character placement position calculation processing (step S207) is finished, the
制御部10は、左右隣接配置を実行すると判別すると(ステップS208:YES)、左右隣接配置用のキャラクタ配置位置算出処理を実行する(ステップS209)。左右隣接配置用のキャラクタ配置位置算出処理(ステップS209)については、図8に示すフローチャートを参照して詳細に説明する。なお、理解を容易にするため、左右隣接配置用のキャラクタ配置位置算出処理の説明においては、スルー画像からは1つの顔のみが検出されたものとして説明する。
If it is determined that the left and right adjacent arrangement is to be executed (step S208: YES), the
まず、制御部10は、キャラクタを右に配置するか否かを判別する(ステップS401)。具体的には、制御部10は、記憶部23に記憶されている配置パラメータが右を示す情報であるか否かを判別する。
First, the
制御部10は、キャラクタを右に配置すると判別した場合(ステップS401:YES)、右配置用の計算式によりキャラクタの顔の中心のX座標を算出する(ステップS402)。具体的には、制御部10は、キャラクタ41の顔の中心のX座標Xcを式(7)により算出する。
Xc=Xf1+Rf1+Rc (7)
If it is determined that the character is to be placed on the right (step S401: YES), the
Xc = Xf1 + Rf1 + Rc (7)
一方、制御部10は、キャラクタを右に配置しないと判別した場合(ステップS401:NO)、左配置用の計算式によりキャラクタの顔の中心のX座標を算出する(ステップS403)。具体的には、制御部10は、キャラクタ41の顔の中心のX座標Xcを式(8)により算出する。
Xc=Xf1−Rf1−Rc (8)
On the other hand, if it is determined that the character is not placed on the right (step S401: NO), the
Xc = Xf1-Rf1-Rc (8)
次に、制御部10は、検出した顔とキャラクタの顔とが合成画像上で重なるか否かを判別する(ステップS404)。
Next, the
制御部10は、検出した顔とキャラクタの顔とが合成画像上で重ならないと判別した場合(ステップS404:NO)、キャラクタの顔が合成画像の画像領域からはみ出るか否かを判別する(ステップS405)。
When determining that the detected face and the character's face do not overlap on the composite image (step S404: NO), the
制御部10は、キャラクタの顔が合成画像の画像領域からはみ出ないと判別した場合(ステップS405:NO)、配置成功フラグをセットする(ステップS406)。
When it is determined that the character's face does not protrude from the image area of the composite image (step S405: NO), the
一方、制御部10は、検出した顔とキャラクタの顔とが合成画像上で重なると判別した場合(ステップS404:YES)、若しくは、キャラクタの顔が合成画像の画像領域からはみ出ると判別した場合(ステップS405:YES)、配置成功フラグをクリアする(ステップS407)。
On the other hand, the
制御部10は、配置成功フラグのセット(ステップS406)、若しくは、配置成功フラグのクリア(ステップS407)を終了すると、左右隣接配置用キャラクタ配置位置算出処理を終了する。
When the placement success flag is set (step S406) or the placement success flag is cleared (step S407), the
ここで、図9(A)、(B)を参照して合成画像を説明する。 Here, the synthesized image will be described with reference to FIGS.
図9(A)は、キャラクタ配置方法が左右隣接配置であって、配置パラメータが右である場合に生成される合成画像の一例を示す図である。図9(A)に示すように、配置パラメータが右である場合は、人物31の顔の右端を示す画素のX座標とキャラクタ41の顔の左端を示す画素のX座標とがほぼ同じ値になるように、人物31の顔の右側にキャラクタ41の顔が隣接して並ぶように配置される。
FIG. 9A is a diagram illustrating an example of a composite image generated when the character placement method is left-right adjacent placement and the placement parameter is right. As shown in FIG. 9A, when the arrangement parameter is right, the X coordinate of the pixel indicating the right end of the face of the
一方、図9(B)は、キャラクタ配置方法が左右隣接配置であって、配置パラメータが左である場合に生成される合成画像の一例を示す図である。図9(B)に示すように、配置パラメータが左である場合は、人物31の顔の左端を示す画素のX座標とキャラクタ41の顔の右端を示す画素のX座標とがほぼ同じ値になるように、人物31の顔の左側にキャラクタ41の顔が隣接して並ぶように配置される。
On the other hand, FIG. 9B is a diagram illustrating an example of a composite image generated when the character placement method is left-right adjacent placement and the placement parameter is left. As shown in FIG. 9B, when the placement parameter is left, the X coordinate of the pixel indicating the left end of the face of the
図4に示すフローチャートの説明に戻る。制御部10は、左右隣接配置を実行しない(ステップS208:NO)、若しくは、左右隣接配置用キャラクタ配置位置算出処理(ステップS209)を終了すると、上下隣接配置を実行するか否かを判別する(ステップS210)。具体的には、制御部10は、上下隣接配置に対応付けられて記憶部23に記憶されている優先度が−1でなく、且つ、当該優先度よりも優先度が高いキャラクタ配置方法に対応する配置成功フラグが1にセットされていない場合に、上下隣接配置を実行すると判別する。
Returning to the description of the flowchart shown in FIG. The
制御部10は、上下隣接配置を実行すると判別すると(ステップS210:YES)、上下隣接配置用のキャラクタ配置位置算出処理を実行する(ステップS211)。上下隣接配置用のキャラクタ配置位置算出処理(ステップS211)については、図10に示すフローチャートを参照して詳細に説明する。なお、理解を容易にするため、上下隣接配置用のキャラクタ配置位置算出処理の説明においては、スルー画像からは1つの顔のみが検出されたものとして説明する。
When determining that the upper and lower adjacent arrangements are to be executed (step S210: YES), the
まず、制御部10は、キャラクタを下に配置するか否かを判別する(ステップS501)。具体的には、制御部10は、記憶部23に記憶されている配置パラメータが下を示す情報であるか否かを判別する。
First, the
制御部10は、キャラクタを下に配置すると判別した場合(ステップS501:YES)、下配置用の計算式によりキャラクタの顔の中心のY座標を算出する(ステップS502)。具体的には、制御部10は、キャラクタ41の顔の中心のY座標Ycを式(9)により算出する。
Yc=Yf1+Rf1+Rc (9)
When it is determined that the character is to be placed below (step S501: YES), the
Yc = Yf1 + Rf1 + Rc (9)
一方、制御部10は、キャラクタを下に配置しないと判別した場合(ステップS501:NO)、上配置用の計算式によりキャラクタの顔の中心のY座標を算出する(ステップS503)。具体的には、制御部10は、キャラクタ41の顔の中心のY座標Ycを式(10)により算出する。
Yc=Yf1−Rf1−Rc (10)
On the other hand, if it is determined that the character is not placed below (step S501: NO), the
Yc = Yf1-Rf1-Rc (10)
次に、制御部10は、検出した顔とキャラクタの顔とが合成画像上で重なるか否かを判別する(ステップS504)。
Next, the
制御部10は、検出した顔とキャラクタの顔とが合成画像上で重ならないと判別した場合(ステップS504:NO)、キャラクタの顔が合成画像の画像領域からはみ出るか否かを判別する(ステップS505)。
When it is determined that the detected face and the character's face do not overlap on the composite image (step S504: NO), the
制御部10は、キャラクタの顔が合成画像の画像領域からはみ出ないと判別した場合(ステップS505:NO)、配置成功フラグをセットする(ステップS506)。
When it is determined that the character's face does not protrude from the image area of the composite image (step S505: NO), the
一方、制御部10は、検出した顔とキャラクタの顔とが合成画像上で重なると判別した場合(ステップS504:YES)、若しくは、キャラクタの顔が合成画像の画像領域からはみ出ると判別した場合(ステップS505:YES)、配置成功フラグをクリアする(ステップS507)。
On the other hand, the
制御部10は、配置成功フラグのセット(ステップS506)、若しくは、配置成功フラグのクリア(ステップS507)を終了すると、上下隣接配置用キャラクタ配置位置算出処理を終了する。
When the placement success flag is set (step S506) or the placement success flag is cleared (step S507), the
ここで、図11(A)、(B)を参照して合成画像を説明する。 Here, the composite image will be described with reference to FIGS.
図11(A)は、キャラクタ配置方法が左右隣接配置であって、キャラクタ画像が合成画像の画像領域からはみ出る場合に生成される合成画像の一例を示す図である。キャラクタ配置方法が左右隣接配置であって、式(4)を満たす場合は(Xc<Rc)は、図11(A)に示すように、キャラクタ画像が合成画像の画像領域からはみ出てしまう。このような場合に、キャラクタ配置方法として上下隣接配置が設定されていれば、図11(B)に示すように、キャラクタ画像が合成画像の画像領域からはみ出ないように合成画像を生成することができる。なお、図11(B)には、キャラクタ配置方法が上下隣接配置であって、配置パラメータが下である場合を示す。 FIG. 11A is a diagram illustrating an example of a composite image generated when the character placement method is left-right adjacent placement and the character image protrudes from the image area of the composite image. When the character arrangement method is left and right adjacent arrangement and Expression (4) is satisfied (Xc <Rc), as shown in FIG. 11A, the character image protrudes from the image area of the composite image. In such a case, if the upper and lower adjacent arrangement is set as the character arrangement method, as shown in FIG. 11B, the composite image may be generated so that the character image does not protrude from the image area of the composite image. it can. FIG. 11B shows a case where the character arrangement method is the vertically adjacent arrangement and the arrangement parameter is below.
図4に示すフローチャートの説明に戻る。制御部10は、上下隣接配置を実行しない(ステップS210:NO)、若しくは、上下隣接配置用キャラクタ配置位置算出処理(ステップS211)を終了すると、等間隔配置を実行するか否かを判別する(ステップS212)。具体的には、制御部10は、等間隔配置に対応付けられて記憶部23に記憶されている優先度が−1でなく、且つ、当該優先度よりも優先度が高いキャラクタ配置方法に対応する配置成功フラグが1にセットされていない場合に、等間隔配置を実行すると判別する。
Returning to the description of the flowchart shown in FIG. The
制御部10は、等間隔配置を実行すると判別すると(ステップS212:YES)、等間隔配置用のキャラクタ配置位置算出処理を実行する(ステップS213)。等間隔配置用のキャラクタ配置位置算出処理(ステップS213)については、図12に示すフローチャートを参照して詳細に説明する。なお、理解を容易にするため、等間隔配置用のキャラクタ配置位置算出処理の説明においては、スルー画像からは5つの顔が検出され、そのうちの3つの顔がステップS204において顔認証されたものとして説明する。
If the
まず、図13(A)、(B)を参照して合成画像を説明する。 First, a composite image will be described with reference to FIGS. 13 (A) and 13 (B).
図13(A)は、スルー画像の一例を示す図である。図13(A)に示す例では、スルー画像には人物31〜35をそれぞれが示す画像部分が含まれている。なお、人物31〜33は、ステップS204において顔認証された人物であり、人物34、35は、ステップS204において顔認証されなかった人物である。なお、図13(A)において、認証された顔を太線の実線で囲み、認証されなかった顔を太線の破線で囲んでいる。人物31の顔の中心の座標は(Xf1,Yf1)であり、人物32の顔の中心の座標は(Xf2,Yf2)であり、人物33の顔の中心の座標は(Xf3,Yf3)である。また、Rf1は人物31の顔の半径であり、Rf2は人物32の顔の半径であり、Rf3は人物33の顔の半径である。
FIG. 13A is a diagram illustrating an example of a through image. In the example illustrated in FIG. 13A, the through image includes image portions respectively representing the
図13(B)は、スルー画像にキャラクタ画像を合成することにより得られる合成画像の一例を示す図である。ここで、キャラクタ41の顔の中心の座標は(Xc,Yc)である。また、Rcは、キャラクタ41の顔の半径である。そして、d12は、顔認証された人物の中で左から1番目の人物31の顔と顔認証された人物の中で左から2番目の人物32の顔との間隔である。d23は、顔認証された人物の中で左から2番目の人物32の顔と顔認証された人物の中で左から3番目の人物33の顔との間隔である。dcは、顔認証された人物の中で最もキャラクタ41に近い人物31の顔とキャラクタ41の顔との間隔である。
FIG. 13B is a diagram illustrating an example of a combined image obtained by combining a character image with a through image. Here, the coordinates of the center of the face of the
図12のフローチャートの説明に戻る。
まず、制御部10は、左から1番目の人物の顔と左から2番目の人物の顔との間隔を算出する(ステップS601)。具体的には、制御部10は、顔認証された人物の中で左から1番目の人物31の顔と顔認証された人物の中で左から2番目の人物32の顔との間隔であるd12を式(11)により算出する。
d12=Xf2−Xf1−Rf2−Rf1 (11)
Returning to the flowchart of FIG.
First, the
d12 = Xf2-Xf1-Rf2-Rf1 (11)
次に、制御部10は、左から2番目の人物の顔と左から3番目の人物の顔との間隔を算出する(ステップS602)。具体的には、制御部10は、顔認証された人物の中で左から2番目の人物の顔と顔認証された人物の中で左から3番目の人物の顔との間隔であるd23を式(12)により算出する。
d23=Xf3−Xf2−Rf3−Rf2 (12)
Next, the
d23 = Xf3-Xf2-Rf3-Rf2 (12)
そして、制御部10は、キャラクタと最も近い人物の顔とキャラクタの顔との間隔を算出する(ステップS603)。具体的には、制御部10は、顔認証された人物の中で最もキャラクタ41に近い人物31の顔とキャラクタ41の顔との間隔であるdcを式(13)により算出する。
dc=(d12+d23)/2 (13)
Then, the
dc = (d12 + d23) / 2 (13)
そして、制御部10は、キャラクタを左に配置するか否かを判別する(ステップS604)。具体的には、制御部10は、記憶部23に記憶されている配置パラメータが左を示す情報であるか否かを判別する。
And the
制御部10は、キャラクタを左に配置すると判別した場合(ステップS604:YES)、左配置用の計算式によりキャラクタの顔の中心のX座標を算出する(ステップS605)。具体的には、制御部10は、キャラクタ41の顔の中心のX座標Xcを式(14)により算出する。
Xc=Xf1−Rf1−Rc−dc (14)
If it is determined that the character is to be placed on the left (step S604: YES), the
Xc = Xf1-Rf1-Rc-dc (14)
一方、制御部10は、キャラクタを左に配置しないと判別した場合(ステップS604:NO)、右配置用の計算式によりキャラクタの顔の中心のX座標を算出する(ステップS606)。具体的には、制御部10は、キャラクタ41の顔の中心のX座標Xcを式(15)により算出する。
Xc=Xf3+Rf3+Rc+dc (15)
On the other hand, if it is determined that the character is not placed on the left side (step S604: NO), the
Xc = Xf3 + Rf3 + Rc + dc (15)
次に、制御部10は、認証された顔のいずれかとキャラクタの顔とが合成画像上で重なるか否かを判別する(ステップS607)。具体的には、例えば、制御部10は、式(16)〜(18)の少なくとも1つの式を満たすと判別した場合に、認証された顔とキャラクタの顔とが合成画像上で重なると判別する。
(Xf1−Xc)2+(Yf1−Yc)2<(Rf1+Rc)2 (16)
(Xf2−Xc)2+(Yf2−Yc)2<(Rf2+Rc)2 (17)
(Xf3−Xc)2+(Yf3−Yc)2<(Rf3+Rc)2 (18)
Next, the
(Xf1-Xc) 2 + ( Yf1-Yc) 2 <(Rf1 + Rc) 2 (16)
(Xf2-Xc) 2 + (Yf2-Yc) 2 <(Rf2 + Rc) 2 (17)
(Xf3-Xc) 2 + ( Yf3-Yc) 2 <(Rf3 + Rc) 2 (18)
制御部10は、認証された顔のいずれともキャラクタの顔が合成画像上で重ならないと判別した場合(ステップS607:NO)、キャラクタの顔が合成画像の画像領域からはみ出るか否かを判別する(ステップS608)。
When determining that the face of the character does not overlap the composite image with any of the authenticated faces (step S607: NO), the
制御部10は、キャラクタの顔が合成画像の画像領域からはみ出ないと判別した場合(ステップS608:NO)、配置成功フラグをセットする(ステップS609)。
When it is determined that the character's face does not protrude from the image area of the composite image (step S608: NO), the
一方、制御部10は、認証された顔のいずれかとキャラクタの顔とが合成画像上で重なると判別した場合(ステップS607:YES)、若しくは、キャラクタの顔が合成画像の画像領域からはみ出ると判別した場合(ステップS608:YES)、配置成功フラグをクリアする(ステップS610)。
On the other hand, the
制御部10は、配置成功フラグのセット(ステップS609)、若しくは、配置成功フラグのクリア(ステップS610)を終了すると、等間隔配置用キャラクタ配置位置算出処理を終了する。
When the placement success flag is set (step S609) or the placement success flag is cleared (step S610), the
図4に示すフローチャートの説明に戻る。制御部10は、等間隔配置を実行しない(ステップS212:NO)、若しくは、等間隔配置用キャラクタ配置位置算出処理(ステップS213)を終了すると、非登録顔置換配置を実行するか否かを判別する(ステップS214)。具体的には、制御部10は、非登録顔置換配置に対応付けられて記憶部23に記憶されている優先度が−1でなく、且つ、当該優先度よりも優先度が高いキャラクタ配置方法に対応する配置成功フラグが1にセットされていない場合に、非登録顔置換配置を実行すると判別する。
Returning to the description of the flowchart shown in FIG. The
制御部10は、非登録顔置換配置を実行すると判別すると(ステップS214:YES)、非登録顔置換配置用のキャラクタ配置位置算出処理を実行する(ステップS215)。非登録顔置換配置用のキャラクタ配置位置算出処理(ステップS215)については、図14に示すフローチャートを参照して詳細に説明する。なお、理解を容易にするため、非登録顔置換配置用のキャラクタ配置位置算出処理の説明においては、スルー画像からは5つの顔が検出され、そのうちの3つの顔がステップS204において顔認証され、顔認証されなかった2つの顔のうち1つの顔がステップS205においてカメラ目線であると判別されたものとして説明する。
When determining that the unregistered face replacement arrangement is to be executed (step S214: YES), the
まず、図15(A)、(B)を参照して合成画像を説明する。 First, the composite image will be described with reference to FIGS. 15 (A) and 15 (B).
図15(A)は、スルー画像の一例を示す図である。図15(A)に示す例では、スルー画像には人物31〜35をそれぞれが示す画像部分が含まれている。なお、人物31〜33は、ステップS204において顔認証された人物であり、人物34、35は、ステップS204において顔認証されなかった人物である。また、人物34は、ステップS205においてカメラ目線であると判別された人物である。なお、図15(A)において、認証された顔を太線の実線で囲み、認証されなかった顔のうちカメラ目線である顔を太線の破線で囲んでいる。
FIG. 15A is a diagram illustrating an example of a through image. In the example shown in FIG. 15A, the through image includes image portions respectively representing the
図15(B)は、スルー画像にキャラクタ画像を合成することにより得られる合成画像の一例を示す図である。人物34の顔の中心の座標は(Xd1,Yd1)である。そして、キャラクタ41の顔の中心の座標は(Xc,Yc)である。
FIG. 15B is a diagram illustrating an example of a combined image obtained by combining a character image with a through image. The coordinates of the center of the face of the
図14のフローチャートの説明に戻る。
まず、制御部10は、認証されない顔のうちカメラ目線である顔の中心の座標を取得する(ステップS701)。具体的には、制御部10は、ステップS204において顔認証された人物の中でステップS205においてカメラ目線であると判別された人物34の顔の中心の座標である(Xd1,Yd1)を記憶部23から読み出す。
Returning to the flowchart of FIG.
First, the
そして、制御部10は、キャラクタの顔の中心の座標を算出する(ステップS702)。具体的には、制御部10は、キャラクタの顔の中心の座標を式(19)、(20)により算出する。すなわち、人物34の顔の中心の座標をキャラクタの顔の中心の座標とする。
Xc=Xd1 (19)
Yc=Yd1 (20)
Then, the
Xc = Xd1 (19)
Yc = Yd1 (20)
次に、制御部10は、認証された顔のいずれかとキャラクタの顔とが合成画像上で重なるか否かを判別する(ステップS703)。
Next, the
制御部10は、認証された顔のいずれともキャラクタの顔が合成画像上で重ならないと判別した場合(ステップS703:NO)、キャラクタの顔が合成画像の画像領域からはみ出るか否かを判別する(ステップS704)。
When determining that the face of the character does not overlap the composite image with any of the authenticated faces (step S703: NO), the
制御部10は、キャラクタの顔が合成画像の画像領域からはみ出ないと判別した場合(ステップS704:NO)、配置成功フラグをセットする(ステップS705)。
When determining that the character's face does not protrude from the image area of the composite image (step S704: NO), the
一方、制御部10は、認証された顔のいずれかとキャラクタの顔とが合成画像上で重なると判別した場合(ステップS703:YES)、若しくは、キャラクタの顔が合成画像の画像領域からはみ出ると判別した場合(ステップS704:YES)、配置成功フラグをクリアする(ステップS706)。
On the other hand, the
制御部10は、配置成功フラグのセット(ステップS705)、若しくは、配置成功フラグのクリア(ステップS706)を終了すると、非登録顔置換配置用キャラクタ配置位置算出処理を終了する。
When the placement success flag is set (step S705) or the placement success flag is cleared (step S706), the
制御部10は、非登録顔置換配置を実行しない(ステップS214:NO)、若しくは、非登録顔置換配置用キャラクタ配置位置算出処理(ステップS215)を終了すると、キャラクタ配置位置算出処理(ステップS109)を終了する。
The
図4に示すフローチャートの説明に戻る。次に、制御部10は、スルー画像とキャラクタ画像とを合成して合成画像を生成する(ステップS110)。具体的には、制御部10は、画像合成部21を制御して、画像処理部16により生成された画像データにより示されるスルー画像と、CG生成部20により生成されたCGを変換して得られたキャラクタ画像とを合成し、合成画像を示す画像データを生成する。なお、CGは三次元の仮想空間上のものであるため、スルー画像と合成するのはキャラクタ画像である。
Returning to the description of the flowchart shown in FIG. Next, the
そして、制御部10は、合成画像を表示する(ステップS111)。具体的には、制御部10は、ステップS110で生成した合成画像を表示部25に供給することにより、合成画像を表示部25に表示する。なお、ステップS103においてキャラクタが選択されるまでは、制御部10は、合成画像を表示する代わりにスルー画像を表示する。なお、表示する合成画像は、キャラクタ配置位置算出処理(ステップS109)において図面を参照して説明したため、ここでの説明は省略する。
And the
次に、制御部10は、シャッターボタンが押圧されているか否かを判別する(ステップS112)。具体的には、制御部10は、操作部24を監視することにより、ユーザによりシャッターボタンが押されているか否かを判別する。制御部10は、シャッターボタンが押圧されていないと判別した場合(ステップS112:NO)、スルー画像を取得する処理(ステップS101)に処理を戻す。一方、制御部10は、シャッターボタンが押圧されていると判別した場合(ステップS112:YES)、合成画像を圧縮する(ステップS113)。制御部10は、合成画像を表現する画像データを圧縮して、JPEG(Joint Photographic Experts Group)形式、或いは、GIF(Graphic Interchange Format)形式の画像データを生成する。
Next, the
そして、制御部10は、合成画像を保存する(ステップS114)。具体的には、制御部10は、ステップS113において圧縮された画像データを記憶部23に記憶する。
And the
制御部10は、合成画像の保存(ステップS114)を終了すると、スルー画像を取得する処理(ステップS101)に処理を戻す。以下、制御部10は、撮像装置100の電源がオフになるまで、上述した処理を繰り返す。
When the storage of the composite image (step S114) ends, the
ここで、図16(A)、(B)を参照して、合成画像の記録形式について説明する。図16(A)に示す例では、合成画像は、ヘッダーと、圧縮された合成画像とから構成される。このように、合成画像を記録することにより、一般的な画像処理装置において合成画像を編集することができる。 Here, the recording format of the composite image will be described with reference to FIGS. In the example shown in FIG. 16A, the composite image is composed of a header and a compressed composite image. Thus, by recording the composite image, the composite image can be edited in a general image processing apparatus.
一方、図16(B)に示す例では、合成画像は、ヘッダーと、キャラクタ配置座標と、キャラクタサイズと、キャラクタ生成情報と、圧縮されたスルー画像(圧縮された撮像画像)とから構成される。このように、キャラクタ配置座標、キャラクタサイズ、キャラクタ生成情報、などのキャラクタを生成するための情報と、圧縮されたスルー画像とを分離して保存することにより、後にキャラクタの配置位置や大きさなどを編集することが可能となる。 On the other hand, in the example shown in FIG. 16B, the composite image includes a header, character placement coordinates, character size, character generation information, and a compressed through image (compressed captured image). . In this way, information for generating a character such as character placement coordinates, character size, character generation information, and the like and a compressed through image are separated and saved, so that the character placement position and size can be later Can be edited.
以上、説明したように、本実施形態にかかる撮像装置100によれば、撮像した画像の適切な位置にキャラクタ画像を合成することができる。より詳細には、登録済の被写体と非登録の被写体とを区別してキャラクタを配置することにより、撮像者の意に叶った合成画像を生成することができる。
As described above, according to the
また、種々のキャラクタ配置方法を組み合わせることにより、撮像領域における被写体(人物の顔)の位置や大きさなどに応じた柔軟なキャラクタ(動物のキャラクタ)の配置が可能となる。すなわち、優先して実行させたいキャラクタ配置方法におけるキャラクタ配置が失敗した場合(キャラクタが被写体と重なる、キャラクタが撮像領域内に収まらない場合など)、次に優先して実行させたいキャラクタ配置方法におけるキャラクタ配置を実行できる。なお、各キャラクタ配置方法におけるキャラクタ配置を単独で実行した場合であっても、以下に示すような効果がある。 Also, by combining various character placement methods, flexible characters (animal characters) can be placed according to the position and size of the subject (person's face) in the imaging region. In other words, if character placement in the character placement method that you want to execute with priority fails (such as when the character overlaps the subject or the character does not fit in the imaging area), the character in the character placement method that you want to execute next Placement can be performed. Even when the character placement in each character placement method is executed independently, the following effects can be obtained.
例えば、左右均等配置では、被写体とキャラクタとが撮像領域内で左右均等に配置されるため、バランスの良い合成画像を生成することができる。 For example, in the left-right equal arrangement, the subject and the character are arranged equally in the left-right direction within the imaging region, so that a well-balanced composite image can be generated.
例えば、左右隣接配置では、被写体とキャラクタとが撮像領域内で左右に隣接して配置されるため、あたかも被写体とキャラクタとが一緒に撮像されているような合成画像を生成することができる。 For example, in the left and right adjacent arrangement, the subject and the character are arranged adjacent to each other in the left and right within the imaging region, so that it is possible to generate a composite image as if the subject and the character were imaged together.
例えば、上下隣接配置では、被写体とキャラクタとが撮像領域内で上下に隣接して配置されるため、あたかも被写体とキャラクタとが一緒に撮像されているような合成画像を生成することができる。特に、被写体の左右方向の位置とキャラクタの左右方向の位置とが近い場合、あたかも被写体がキャラクタとが一緒に撮像されているような合成画像を生成することができる。 For example, in the vertically adjacent arrangement, the subject and the character are arranged vertically adjacent in the imaging region, so that it is possible to generate a composite image as if the subject and the character were imaged together. In particular, when the position of the subject in the left-right direction is close to the position of the character in the left-right direction, it is possible to generate a composite image as if the subject was imaged together with the character.
例えば、等間隔配置では、複数の被写体とキャラクタとが撮像領域内で等間隔に並んで配置されるため、あたかもキャラクタが複数の被写体と一緒に並んで撮像されているような合成画像を生成することができる。 For example, in the equidistant arrangement, a plurality of subjects and characters are arranged at equal intervals in the imaging region, so that a composite image is generated as if the characters were imaged side by side with the plurality of subjects. be able to.
例えば、非登録顔置換配置では、非登録の被写体に重なるようにキャラクタが配置される。このため、撮像したくない被写体(非登録の被写体)を撮像してしまった場合に、撮像したくなかった被写体にキャラクタを重ねて、当該被写体が表示されないように合成画像を生成することができる。特に撮像したくない被写体(登録されていない被写体)の視線が撮像装置の方を向いていた場合(カメラ目線であった場合)、撮像したい人物(登録されている被写体)と一緒に撮像しているような不自然な合成画像ができてしまう。このような場合に、非登録の被写体のうちカメラ目線である被写体にキャラクタが重なるように構成することにより、自然な合成画像を生成することができる。 For example, in the non-registered face replacement arrangement, the character is arranged so as to overlap the non-registered subject. For this reason, when a subject that is not desired to be captured (non-registered subject) is captured, a composite image can be generated so that the character is superimposed on the subject that is not desired to be captured and the subject is not displayed. . In particular, if the line of sight of an object you do not want to capture (unregistered object) is looking toward the image pickup device (when you are looking at the camera), take an image with the person you want to image (registered object). An unnatural composite image is created. In such a case, it is possible to generate a natural composite image by configuring the character so that it overlaps the subject that is the camera line of sight among the unregistered subjects.
(変形例)
本発明は、上記実施形態において示したものに限定されず、様々な変形が可能である。
(Modification)
The present invention is not limited to the one shown in the above embodiment, and various modifications are possible.
上記実施形態では、非登録顔置換配置において、非登録の顔(非登録の被写体)のうちカメラ目線である顔のみにキャラクタの顔を重ねるように合成画像を生成した。しかし、全ての非登録の顔にキャラクタを重ねるようにしてもよい。ここでは、スルー画像が、図17(A)に示すように、顔認証された人物31〜33と、顔認証されなかった人物34、35とがスルー画像に含まれ、人物34がカメラ目線であり人物35がカメラ目線でない場合について説明する。
In the above-described embodiment, in the non-registered face replacement arrangement, the composite image is generated so that the face of the character is superimposed only on the face that is looking at the camera among the non-registered faces (non-registered subjects). However, the character may be superimposed on all unregistered faces. Here, as shown in FIG. 17A, the through image includes the
人物35は、カメラ目線でないが顔認証されなかった人物である。従って、撮像装置100は、非登録顔置換配置において、人物34の顔だけでなく人物35の顔にもキャラクタが重なるように合成画像を生成する。
The
また、上記実施形態においては、各キャラクタ配置方法におけるキャラクタ配置を別々に説明した。しかし、複数のキャラクタ配置方法におけるキャラクタ配置を実行するようにしてもよい。例えば、図17(B)に示すように、等間隔配置におけるキャラクタ配置と、非登録顔置換配置におけるキャラクタ配置とを共に実行してもよい。また、図17(B)に示すように、キャラクタは同じキャラクタでなく、異なるキャラクタを用いても良い。 Moreover, in the said embodiment, the character arrangement | positioning in each character arrangement | positioning method was demonstrated separately. However, character placement in a plurality of character placement methods may be executed. For example, as shown in FIG. 17B, the character arrangement in the equidistant arrangement and the character arrangement in the non-registered face replacement arrangement may be executed together. Further, as shown in FIG. 17B, different characters may be used instead of the same character.
上記実施形態では、非登録顔置換配置において、スルー画像中から検出された顔のうちどの顔が撮像対象の顔であるか否かを判別するために、スルー画像とあらかじめ記憶部23に記憶されている複数の顔画像とを比較することにより顔認証を行う手法を示した。しかしながら、撮像対象の顔であるか否かを判別する手法は、この方法に限られない。
In the above embodiment, in the non-registered face replacement arrangement, the through image is stored in advance in the
例えば、撮像対象の顔の人物には、所定のパターンで点滅する発光機器を身につけさせた状態で撮像する。そして、制御部10は、スルー画像中で所定のパターンで点滅する画像部分があるか否かを検出し、スルー画像上で当該画像部分から所定の距離以内の顔を撮像対象の顔であると判別する。
For example, the person who is the face to be imaged is imaged while wearing a light-emitting device that blinks in a predetermined pattern. Then, the
ここでは、スルー画像が、図18(A)に示すように、撮像対象の顔の人物31、32、34と、撮像対象でない顔の人物33、35とがスルー画像に含まれ、撮像対象の顔の人物31、32、34はそれぞれ発光機器51を身につけている場合について説明する。なお、図18(A)において、撮像対象の顔を太線の実線で囲み、撮像対象でない顔を太線の破線で囲んでいる。
Here, as shown in FIG. 18A, the through images include
制御部10は、ステップS204において検出した顔の顔認証を実行する代わりに、検出した顔の人物が発光機器51を身につけているか否かを判別する処理を実行する。具体的には、まず、制御部10は、スルー画像に含まれている発光機器51を検出し、検出した発光機器51の中心の座標を検出する。そして、制御部10は、検出した顔の中心と検出した発光機器51の中心とのスルー画像上での距離を求める。制御部10は、検出した顔のうち、顔の中心と発光機器51の中心とのスルー画像上での距離が所定の距離以内である顔を発光機器51を身につけている人物の顔であると判別する。以降の処理では、発光機器51を身につけている人物の顔であると判別した顔を、撮像対象の顔であるものとして取り扱う。
Instead of executing the face authentication of the face detected in step S <b> 204, the
なお、所定のパターンで点滅する発光機器51を検出するためには、当該所定のパターンに対応する時間間隔でスルー画像を複数回抽出し、時間経過と共に輝度が大きく変化する部分を検出すればよい。
In order to detect the
また、撮像対象の顔であるか否かを判別するために、撮像対象の顔の人物に持たせるのは、所定のパターンで点滅する発光機器に限られず、継続して点灯する発光機器であってもよいし、発光機器でなくてもよい。なお、スルー画像から継続して点灯する発光機器を検出する場合は、輝度が高い画像部分を検出すればよい。撮像対象の顔の人物に持たせるものが発光機器でない場合は、特徴のある形状、模様などを有するものであることが望ましい。 In addition, in order to determine whether or not the face is the target to be imaged, the person whose face is to be imaged is not limited to the light-emitting device that flashes in a predetermined pattern, but a light-emitting device that is continuously lit. It does not have to be a light emitting device. Note that when detecting a light emitting device that is continuously lit from a through image, an image portion with high luminance may be detected. In the case where an object to be imaged is to be held by a person who is not a light-emitting device, it is desirable that the person who has the face to be imaged has a characteristic shape or pattern.
このように、撮像対象の顔の人物に所定のパターンで点滅する発光機器等を持たせることにより、顔認証など複雑な処理を行うことなく撮像対象の顔を特定することができる。 In this way, by providing a person on the face to be imaged with a light emitting device that blinks in a predetermined pattern, the face to be imaged can be specified without performing complicated processing such as face authentication.
上記実施形態では、キャラクタは動物のキャラクタであり、被写体は人物の顔である場合について説明した。しかしながら、キャラクタは、動物に限られず、物品や文字など、画像と認識できるものであれば何でもよい。また、被写体も、人物の顔に限られず、人物、動物、植物、建築物など何でもよい。 In the above embodiment, the case where the character is an animal character and the subject is a human face has been described. However, the character is not limited to an animal and may be anything such as an article or a character that can be recognized as an image. Also, the subject is not limited to a person's face, and may be anything such as a person, an animal, a plant, or a building.
上記実施形態では、キャラクタの頭の中心の座標、キャラクタの頭の半径、人物の頭の中心の座標、人物の頭の半径などに基づいて、キャラクタを配置する位置を決定する例を示した。これは、キャラクタが動物であり、被写体が人物の頭であるためであり、頭の位置や大きさを重視してキャラクタを配置することが望ましいと考えられるためである。しかしながら、キャラクタ全体の中心の座標、キャラクタ全体の大きさなどに基づいて、キャラクタを配置する位置を決定するように構成してもよい。また、人物そのものを被写体として、人物の中心の座標、人物の大きさなどに基づいて、キャラクタを配置する位置を決定するように構成してもよい。さらに、キャラクタや被写体の大きさは、半径でなく面積で定義してもよいし、形状などを考慮して定義してもよい。 In the above-described embodiment, the example in which the position where the character is arranged is determined based on the coordinates of the character's head center, the character's head radius, the coordinates of the person's head center, the person's head radius, and the like. This is because the character is an animal and the subject is the head of a person, and it is considered desirable to place the character with an emphasis on the position and size of the head. However, the position where the character is arranged may be determined based on the coordinates of the center of the entire character, the size of the entire character, and the like. Alternatively, the position of the character may be determined based on the coordinates of the center of the person, the size of the person, etc., with the person itself as the subject. Furthermore, the size of the character or subject may be defined not by the radius but by the area, or may be defined in consideration of the shape or the like.
上記実施形態では、左右均等配置、左右隣接配置、及び、上下隣接配置においては、スルー画像中に検出された顔が1つである場合にのみ、キャラクタ配置が成功するものとして説明した。しかしながら、検出された顔が複数ある場合でもキャラクタ配置が可能となるように構成してもよい。この場合、例えば、配置パラメータとして、左から何番目の顔をキャラクタ配置の基準とするかを示す情報を設定するように構成する。 In the above-described embodiment, it has been described that the character arrangement succeeds only in the case where only one face is detected in the through image in the left and right equal arrangement, the left and right adjacent arrangement, and the upper and lower adjacent arrangement. However, the character arrangement may be made possible even when there are a plurality of detected faces. In this case, for example, information indicating what number face from the left is a reference for character placement is set as the placement parameter.
上記実施形態では、撮像装置100が静止画像を撮像する場合について説明したが、動画像を撮像する場合にも本発明を適用することができる。また、本発明は、撮像装置だけでなく、あらゆる画像処理装置に適用することができる。
In the above embodiment, the case where the
さらに、本発明は、上述した構成例やフローチャートに示される手順に限定されないことは勿論である。 Furthermore, it goes without saying that the present invention is not limited to the procedures shown in the configuration examples and flowcharts described above.
上記実施形態では、プログラムが、記憶装置に予め記憶されているものとして説明した。しかし、撮像装置を、装置の全部又は一部として動作させ、あるいは、上述の処理を実行させるためのプログラムを、フレキシブルディスク、CD−ROM(Compact Disk Read−Only Memory)、DVD(Digital Versatile Disk)、MO(Magneto Optical Disk)などのコンピュータ読み取り可能な記録媒体に格納して配布し、これを別のコンピュータにインストールし、上述の手段として動作させ、あるいは、上述の工程を実行させてもよい。 In the above-described embodiment, the program is described as being stored in the storage device in advance. However, a program for operating the imaging apparatus as all or part of the apparatus or executing the above-described processing is a flexible disk, a CD-ROM (Compact Disk Read-Only Memory), or a DVD (Digital Versatile Disk). , Stored in a computer-readable recording medium such as MO (Magneto Optical Disk), distributed, installed in another computer, operated as the above-mentioned means, or the above-described steps may be executed.
さらに、インターネット上のサーバ装置が有するディスク装置等にプログラムを格納しておき、例えば、搬送波に重畳させて、コンピュータにダウンロード等してプログラムを実行してもよい。 Furthermore, the program may be stored in a disk device or the like of a server device on the Internet, and may be executed by being superimposed on a carrier wave and downloaded to a computer.
10・・・制御部、11・・・光学系、12・・・光学系制御部、13・・・光学系駆動部、14・・・撮像素子、15・・・A/D変換器、16・・・画像処理部、17・・・画像処理メモリ、18・・・フラッシュ制御部、19・・・フラッシュ発光部、20・・・CG生成部、21・・・画像合成部、22・・・画像合成メモリ、23・・・記憶部、24・・・操作部、25・・・表示部、26・・・電源制御部、31、32、33、34、35・・・人物、41、42、43・・・キャラクタ、51・・・発光機器、100・・・撮像装置
DESCRIPTION OF
Claims (9)
撮像画像とキャラクタ画像とを記憶する記憶手段と、
前記記憶手段に記憶されている撮像画像に含まれている被写体を検出する被写体検出手段と、
前記被写体検出手段により検出された被写体が、撮像者が撮像を予定していた撮像予定被写体であるか、撮像者が撮像を予定していなかった非撮像予定被写体であるかを判別する被写体判別手段と、
前記被写体検出手段により検出された被写体の撮像画像中の位置を検出する被写体位置検出手段と、
前記被写体位置検出手段により検出された被写体の位置のうち、前記被写体判別手段により判別された非撮像予定被写体の位置に基づいて、合成しようとするキャラクタの撮像画像中の位置を決定するキャラクタ位置決定手段と、
前記記憶手段に記憶されている撮像画像の前記キャラクタ位置決定手段により決定されたキャラクタの位置に前記記憶手段に記憶されているキャラクタ画像を合成して、合成画像を生成する合成手段と、
を備える、ことを特徴とする画像処理装置。 An image processing apparatus that generates a composite image by combining a character image with a captured image obtained by capturing an image of a subject,
Storage means for storing captured images and character images;
Subject detection means for detecting a subject included in the captured image stored in the storage means;
Subject discrimination means for discriminating whether the subject detected by the subject detection means is a subject to be imaged scheduled to be taken by the photographer or a non-imaging subject to be photographed by the imager. When,
Subject position detection means for detecting a position in the captured image of the subject detected by the subject detection means;
Character position determination for determining a position in the captured image of the character to be synthesized based on the position of the non-imaging scheduled subject determined by the subject determination means among the positions of the subjects detected by the subject position detection means Means,
A combining unit that combines the character image stored in the storage unit with the character position determined by the character position determination unit of the captured image stored in the storage unit to generate a combined image;
An image processing apparatus comprising:
前記被写体判別手段は、前記記憶手段に記憶されている撮像画像のうち前記被写体検出手段により検出された被写体を示す画像部分が、前記記憶手段に記憶されている撮像予定被写体画像と一致するか否かにより、前記被写体検出手段により検出された被写体が撮像予定被写体であるか非撮像予定被写体であるかを判別する、
ことを特徴とする請求項1に記載の画像処理装置。 The storage means further stores an imaging target subject image that is an image showing the imaging subject.
The subject discriminating means determines whether or not an image portion showing the subject detected by the subject detecting means in the captured image stored in the storage means coincides with the scheduled subject image stored in the storage means. Thus, it is determined whether the subject detected by the subject detection means is a subject to be imaged or a subject not to be imaged.
The image processing apparatus according to claim 1.
ことを特徴とする請求項1に記載の画像処理装置。 The character position determining means determines the position of the character so that the distance from the position of the subject to be imaged to one end of the captured image matches the distance from the character position to the other end of the captured image.
The image processing apparatus according to claim 1.
ことを特徴とする請求項1に記載の画像処理装置。 The character position determination means determines the position of the character so that the largest coordinate on the predetermined coordinate axis of the image portion constituting the imaging subject and the smallest coordinate on the predetermined coordinate axis of the image portion constituting the character match. decide,
The image processing apparatus according to claim 1.
ことを特徴とする請求項1に記載の画像処理装置。 The character position determining unit is configured to determine a plurality of scheduled imaging subjects and a character on a composite image based on positions of the scheduled imaging subjects when the subject detection unit detects a plurality of scheduled imaging subjects. Determine the position of the character so that it is placed side by side in the direction of
The image processing apparatus according to claim 1.
前記被写体検出手段により検出された被写体の視線が正面を向いているか否かを判別する視線判別手段、をさらに備え、
前記キャラクタ位置決定手段は、前記視線判別手段により視線が正面を向いていると判別された非撮像予定被写体の位置をキャラクタの位置に決定する、
ことを特徴とする請求項1に記載の画像処理装置。 The subject is a person,
Line-of-sight discrimination means for determining whether or not the line of sight of the subject detected by the subject detection means is facing the front,
The character position determining means determines the position of the non-imaging scheduled subject determined by the line-of-sight determining means that the line of sight is facing the front;
The image processing apparatus according to claim 1 .
前記被写体特定物検出手段により検出された被写体特定物の撮像画像中の位置を検出する被写体特定物位置検出手段と、をさらに備え、
前記被写体判別手段は、前記被写体検出手段により検出された被写体のうち、被写体の位置が前記被写体特定物検出手段により検出された被写体特定物の位置と所定の距離以下ある被写体を撮像予定被写体であると判別する、
ことを特徴とする請求項1に記載の画像処理装置。 Subject specific object detection means for detecting a predetermined subject specific object included in the captured image stored in the storage means;
Subject specific object position detection means for detecting a position in the captured image of the subject specific object detected by the subject specific object detection means;
The subject discriminating unit is a subject to be imaged among subjects detected by the subject detecting unit and whose subject position is equal to or less than a predetermined distance from the subject specific object position detected by the subject specific object detecting unit. To determine,
The image processing apparatus according to claim 1.
被写体特定物は所定のパターンで点滅する発光装置であり、
前記被写体判別手段は、前記記憶手段に記憶されている撮像画像のうち時間経過とともに所定のパターンで輝度が変化する画像部分を検出することにより被写体特定物を検出する、
ことを特徴とする請求項7に記載の画像処理装置。 The captured image is a moving image,
The subject specific object is a light emitting device that blinks in a predetermined pattern,
The subject determination means detects a subject specific object by detecting an image portion whose luminance changes in a predetermined pattern with time in the captured image stored in the storage means;
The image processing apparatus according to claim 7 .
被写体を撮像して得られた撮像画像にキャラクタ画像を合成して合成画像を生成する画像処理装置として機能させるためのプログラムであって、
当該画像処理装置は、
撮像画像とキャラクタ画像とを記憶する記憶手段、
を備え、
前記記憶手段に記憶されている撮像画像に含まれている被写体を検出する被写体検出手段、
前記被写体検出手段により検出された被写体が、撮像者が撮像を予定していた撮像予定被写体であるか、撮像者が撮像を予定していなかった非撮像予定被写体であるかを判別する被写体判別手段、
前記被写体検出手段により検出された被写体の撮像画像中の位置を検出する被写体位置検出手段、
前記被写体位置検出手段により検出された被写体の位置のうち、前記被写体判別手段により判別された非撮像予定被写体の位置に基づいて、合成しようとするキャラクタの撮像画像中の位置を決定するキャラクタ位置決定手段、
前記記憶手段に記憶されている撮像画像の前記キャラクタ位置決定手段により決定されたキャラクタの位置に前記記憶手段に記憶されているキャラクタ画像を合成して、合成画像を生成する合成手段、
として機能させる、ことを特徴とするプログラム。 Computer
A program for functioning as an image processing apparatus that combines a character image with a captured image obtained by imaging a subject to generate a composite image,
The image processing apparatus
Storage means for storing captured images and character images;
With
Subject detection means for detecting a subject included in the captured image stored in the storage means;
Subject discrimination means for discriminating whether the subject detected by the subject detection means is a subject to be imaged scheduled to be taken by the photographer or a non-imaging subject to be photographed by the imager. ,
Subject position detection means for detecting a position in the captured image of the subject detected by the subject detection means;
Character position determination for determining a position in the captured image of the character to be synthesized based on the position of the non-imaging scheduled subject determined by the subject determination means among the positions of the subjects detected by the subject position detection means means,
A combining unit that combines the character image stored in the storage unit with the character position determined by the character position determination unit of the captured image stored in the storage unit to generate a combined image;
A program characterized by functioning as
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008271485A JP5182004B2 (en) | 2008-10-22 | 2008-10-22 | Image processing apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008271485A JP5182004B2 (en) | 2008-10-22 | 2008-10-22 | Image processing apparatus and program |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2010103651A JP2010103651A (en) | 2010-05-06 |
JP2010103651A5 JP2010103651A5 (en) | 2011-12-01 |
JP5182004B2 true JP5182004B2 (en) | 2013-04-10 |
Family
ID=42293909
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008271485A Expired - Fee Related JP5182004B2 (en) | 2008-10-22 | 2008-10-22 | Image processing apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5182004B2 (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105147702B (en) | 2009-10-05 | 2018-05-11 | 花王株式会社 | Ceramide production accelerant and moisturizer |
JP2011244224A (en) * | 2010-05-19 | 2011-12-01 | Casio Comput Co Ltd | Image synthesizing apparatus, program and image synthesizing method |
JP5304751B2 (en) * | 2010-08-06 | 2013-10-02 | フリュー株式会社 | Image creating apparatus and method, and program |
JP2013003412A (en) * | 2011-06-17 | 2013-01-07 | Tatsumi Denshi Kogyo Kk | Automatic photograph creation device, automatic photograph creation method and program |
JP2013115692A (en) * | 2011-11-30 | 2013-06-10 | Jvc Kenwood Corp | Imaging apparatus and control program for use in imaging apparatus |
JP2013115691A (en) * | 2011-11-30 | 2013-06-10 | Jvc Kenwood Corp | Imaging apparatus and control program for use in imaging apparatus |
JP6723720B2 (en) * | 2015-10-20 | 2020-07-15 | キヤノン株式会社 | Display system, information processing method and program |
JP6616668B2 (en) | 2015-11-17 | 2019-12-04 | キヤノン株式会社 | Image processing apparatus and image processing method |
JP6620572B2 (en) * | 2016-01-28 | 2019-12-18 | 辰巳電子工業株式会社 | Game shooting apparatus and image processing method |
JP7128347B2 (en) * | 2019-03-25 | 2022-08-30 | 富士フイルム株式会社 | Image processing device, image processing method and program, imaging device |
JP7169431B2 (en) * | 2019-03-25 | 2022-11-10 | 富士フイルム株式会社 | Image processing device, image processing method and program, imaging device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4291963B2 (en) * | 2000-04-13 | 2009-07-08 | 富士フイルム株式会社 | Image processing method |
JP4131097B2 (en) * | 2000-12-27 | 2008-08-13 | カシオ計算機株式会社 | Image processing method, image processing apparatus, and image processing program |
JP3901015B2 (en) * | 2002-05-28 | 2007-04-04 | カシオ計算機株式会社 | Image output apparatus, image output processing program, and image output method |
-
2008
- 2008-10-22 JP JP2008271485A patent/JP5182004B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010103651A (en) | 2010-05-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5182004B2 (en) | Image processing apparatus and program | |
KR101642402B1 (en) | Apparatus and method for capturing digital image for guiding photo composition | |
JP4663700B2 (en) | Imaging apparatus and imaging method | |
TW201202828A (en) | Image-processing apparatus and method, and program | |
CN109639959B (en) | Image processing apparatus, image processing method, and recording medium | |
US9014475B2 (en) | Image pickup apparatus and photographing method of image pickup apparatus | |
JP2009194644A (en) | Image processor, image processing method and image pick-up device | |
JP5042896B2 (en) | Image processing apparatus and image processing program | |
CN115086547A (en) | Image pickup apparatus, portable device, calibrator, control method thereof, and storage medium | |
JP2007208425A (en) | Display method for displaying denoting identification region together with image, computer-executable program, and imaging apparatus | |
GB2611154A (en) | Image pickup apparatus used as action camera, control method therefor, and storage medium storing control program therefor | |
JP2013254151A (en) | Image processing apparatus and image processing method | |
JP2011186816A (en) | Face image synthesis apparatus | |
JP6858007B2 (en) | Image processing system, image processing method | |
JP2017188787A (en) | Imaging apparatus, image synthesizing method, and image synthesizing program | |
CN108476290B (en) | Electronic device for providing panoramic image and control method thereof | |
JP2006324727A (en) | Imaging apparatus and image processing method thereof | |
JP2000132329A (en) | Device and method for recognizing surface and virtual image solid synthesizer | |
JP2010154323A (en) | Image processing apparatus, image extraction method, and, program | |
JP5088612B2 (en) | Imaging apparatus, processing execution method of imaging apparatus, and program thereof | |
JP2007172271A (en) | Image processing system, image processor, image processing method and image processing program | |
JP2015126369A (en) | Imaging apparatus | |
US20240251154A1 (en) | Image capture apparatus, image processing apparatus, and method | |
JP7110657B2 (en) | Image processing device, image processing method and program | |
WO2023002776A1 (en) | Image processing device, image processing system, image processing method, and image processing program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111012 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20111012 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20121002 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20121003 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20121129 |
|
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: 20121218 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20121231 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5182004 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160125 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |