JP5131399B2 - Image processing apparatus, image processing method, and program - Google Patents
Image processing apparatus, image processing method, and program Download PDFInfo
- Publication number
- JP5131399B2 JP5131399B2 JP2012008810A JP2012008810A JP5131399B2 JP 5131399 B2 JP5131399 B2 JP 5131399B2 JP 2012008810 A JP2012008810 A JP 2012008810A JP 2012008810 A JP2012008810 A JP 2012008810A JP 5131399 B2 JP5131399 B2 JP 5131399B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- subject
- background
- extraction
- equal
- 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
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
本発明は、撮像された画像から被写体領域を抽出する画像処理装置、画像処理方法及びプログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and a program for extracting a subject area from a captured image.
従来、撮像装置を用いて、背景内に被写体が存在する画像と被写体が存在しない背景画像を撮影して、背景画像と被写体が存在する画像から差分情報を生成し、被写体のみを抽出するアプリケーションが知られている(例えば、特許文献1参照)。 Conventionally, an image capturing apparatus is used to capture an image with a subject in the background and a background image without the subject, generate difference information from the background image and the image with the subject, and extract only the subject. It is known (see, for example, Patent Document 1).
しかしながら、従来の被写体抽出処理では、例えばホワイトボードに書かれた文字列を被写体として抽出したい場合、最大連結領域しか被写体として認識されないため、適正に抽出することができないという問題があった。 However, in the conventional subject extraction processing, for example, when it is desired to extract a character string written on a whiteboard as a subject, only the maximum connected area is recognized as a subject, and thus there is a problem that it cannot be appropriately extracted.
そこで、本発明の課題は、一の撮像画像から複数の被写体領域を簡便に、且つ、適正に抽出することができる画像処理装置、画像処理方法及びプログラムを提供することである。 Therefore, an object of the present invention is to provide an image processing apparatus, an image processing method, and a program that can easily and appropriately extract a plurality of subject areas from one captured image.
上記課題を解決するため、請求項1に記載の発明の画像処理装置は、被写体が存在していない背景のみの背景画像及び被写体が存在する被写体存在画像を取得する取得手段と、前記取得手段により取得された被写体存在画像に含まれている非平坦度の値が所定の値以下である画像領域を特定し、前記特定された画像領域の範囲が所定の範囲以上であるか否かを判定する判定手段と、前記判定手段により前記画像領域の範囲が前記所定の範囲以上であると判定された場合に、前記画像領域の情報に基づいて、前記被写体存在画像から被写体領域を抽出するための抽出用背景画像を生成する背景生成手段と、前記背景生成手段が抽出用背景画像を生成することに成功したか失敗したかを判断する判断手段と、前記判断手段が抽出用背景画像を生成することに成功したと判断した際は、前記生成された抽出用背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する一方で、前記判断手段が抽出用背景画像を生成することに失敗したと判断した際は、前記背景画像を前記取得手段により取得し、前記取得された背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する被写体抽出手段と、を備えることを特徴とする。 In order to solve the above-described problem, an image processing apparatus according to a first aspect of the present invention includes an acquisition unit that acquires a background image of only a background in which no subject exists and a subject presence image in which the subject exists, and the acquisition unit. An image region in which the non-flatness value included in the acquired subject presence image is less than or equal to a predetermined value is specified, and it is determined whether or not the range of the specified image region is greater than or equal to a predetermined range. And an extraction for extracting a subject area from the subject-existing image based on the information of the image area when the range of the image area is determined to be greater than or equal to the predetermined range by the determination unit and the determination unit A background generation unit for generating a background image for use, a determination unit for determining whether the background generation unit has succeeded or failed in generating the background image for extraction, and the determination unit generates the background image for extraction. When it is determined that the extraction has succeeded, the determination unit fails to generate the extraction background image while extracting the object region from the object existing image based on the generated extraction background image. A subject extracting unit that acquires the background image by the acquiring unit and extracts a subject area from the subject existing image based on the acquired background image. .
請求項2に記載の発明の画像処理装置は、請求項1に記載の画像処理装置において、前記判定手段は、前記取得手段により取得された被写体存在画像を複数の画像ブロックに分割する分割手段と、前記分割手段により分割された前記複数の画像ブロックの各々について非平坦度の値が前記所定の値以下であるか否かを判定する第1の判定手段と、前記第1の判定手段により非平坦度の値が前記所定の値以下であると判定された画像ブロックの数が、全画像ブロック数に対して所定の割合以上であるか否かを判定する第2の判定手段と、を含み、前記背景生成手段は、前記第2の判定手段により、非平坦度の値が前記所定の値以下である画像ブロックの数が、全画像ブロック数に対して前記所定の割合以上であると判定した場合に、当該画像ブロックから前記抽出用背景画像を生成する、ことを特徴とする。 An image processing apparatus according to a second aspect of the present invention is the image processing apparatus according to the first aspect, wherein the determining means is a dividing means for dividing the subject existing image acquired by the acquiring means into a plurality of image blocks. The first determination means for determining whether or not the non-flatness value is less than or equal to the predetermined value for each of the plurality of image blocks divided by the dividing means, and the first determination means Second determining means for determining whether or not the number of image blocks whose flatness value is determined to be less than or equal to the predetermined value is greater than or equal to a predetermined ratio with respect to the total number of image blocks. The background generation means determines, by the second determination means, that the number of image blocks whose non-flatness value is equal to or less than the predetermined value is equal to or greater than the predetermined ratio with respect to the total number of image blocks. If the image Tsu generates the extraction background image from click, characterized in that.
請求項3に記載の発明の画像処理方法は、被写体が存在していない背景のみの背景画像と被写体が存在する被写体存在画像とを取得する取得ステップと、前記取得ステップにより取得された被写体存在画像に含まれている非平坦度の値が所定の値以下である画像領域を特定し、前記特定された画像領域の範囲が所定の範囲以上であるか否かを判定する判定ステップと、前記判定ステップにより前記画像領域の範囲が前記所定の範囲以上であると判定された場合に、前記画像領域の情報に基づいて、前記被写体存在画像から被写体領域を抽出するための抽出用背景画像を生成する背景生成ステップと、前記背景生成ステップで抽出用背景画像を生成することに成功したか失敗したかを判断する判断ステップと、前記判断ステップで抽出用背景画像を生成することに成功したと判断した際は、前記生成された抽出用背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する一方で、前記判断ステップで抽出用背景画像を生成することに失敗したと判断した際は、前記背景画像を前記取得ステップにより取得し、前記取得された背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する被写体抽出ステップと、を含むことを特徴とする。
The image processing method according to
請求項4に記載の発明のプログラムは、コンピュータに、被写体が存在していない背景のみの背景画像と被写体が存在する被写体存在画像とを取得する取得機能、前記取得機能により取得された被写体存在画像に含まれている非平坦度の値が所定の値以下である画像領域を特定し、前記特定された画像領域の範囲が所定の範囲以上であるか否かを判定する判定機能、前記判定機能により前記画像領域の範囲が前記所定の範囲以上であると判定された場合に、前記画像領域の情報に基づいて、前記被写体存在画像から被写体領域を抽出するための抽出用背景画像を生成する背景生成機能、前記背景生成機能が抽出用背景画像を生成することに成功したか失敗したかを判断する判断機能、前記判断機能が抽出用背景画像を生成することに成功したと判断した際は、前記生成された抽出用背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する一方で、前記判断機能が抽出用背景画像を生成することに失敗したと判断した際は、前記背景画像を前記取得機能により取得し、前記取得された背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する被写体抽出機能、を実現させる。 According to a fourth aspect of the present invention, there is provided a program for acquiring , in a computer, a background image of only a background in which no subject exists and a subject existing image in which the subject exists, and a subject existing image acquired by the acquisition function. A determination function for specifying an image region in which the value of the non-flatness included in the image is equal to or less than a predetermined value, and determining whether or not the range of the specified image region is equal to or greater than a predetermined range; A background for generating an extraction background image for extracting a subject area from the subject existing image based on the information of the image area when it is determined that the range of the image area is equal to or greater than the predetermined range. A generation function, a determination function for determining whether the background generation function has succeeded or failed to generate an extraction background image, and the determination function has successfully generated an extraction background image When the determination is made, based on the generated extraction background image, the subject area is extracted from the subject presence image, while the determination function determines that the generation of the extraction background image has failed. The object extraction function for acquiring the background image by the acquisition function and extracting a subject area from the subject existing image based on the acquired background image is realized.
本発明によれば、被写体領域を撮像画像から簡便に、且つ、適正に抽出することができる。 According to the present invention, a subject region can be easily and appropriately extracted from a captured image.
以下に、本発明について、図面を用いて具体的な態様を説明する。ただし、発明の範囲は、図示例に限定されない。
図1は、本発明の画像処理装置を適用した一実施形態の撮像装置100の概略構成を示すブロック図である。
Hereinafter, specific embodiments of the present invention will be described with reference to the drawings. However, the scope of the invention is not limited to the illustrated examples.
FIG. 1 is a block diagram illustrating a schematic configuration of an
本実施形態の撮像装置100は、被写体Sを撮像した撮像画像P1(被写体存在画像P1)(図5(a)参照)の非平坦度が所定値以下である画像領域の範囲が所定の範囲以上であると判定された場合に、当該被写体存在画像P1から被写体領域の抽出用の抽出用背景画像を生成して、抽出用背景画像と被写体存在画像P1の対応する各画素の差分情報に基づいて、被写体存在画像P1から被写体領域を抽出する画像処理装置として機能する。
具体的には、図1に示すように、撮像装置100は、レンズ部1と、電子撮像部2と、撮像制御部3と、画像データ生成部4と、画像メモリ5と、非平坦度演算部6と、画像処理部8と、記録媒体9と、表示制御部10と、表示部11と、操作入力部12と、CPU13とを備えている。
また、撮像制御部3と、非平坦度演算部6と、画像処理部8と、CPU13は、例えば、カスタムLSI1Aとして設計されている。
In the
Specifically, as illustrated in FIG. 1, the
In addition, the
レンズ部1は、複数のレンズから構成され、ズームレンズやフォーカスレンズ等を備えている。
また、レンズ部1は、図示は省略するが、被写体Sの撮像の際に、ズームレンズを光軸方向に移動させるズーム駆動部、フォーカスレンズを光軸方向に移動させる合焦駆動部等を備えていても良い。
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(自動ホワイトバランス)等の被写体Sの撮像条件の調整制御を行う。
Although not shown, the
In addition, the
レンズ部1、電子撮像部2及び撮像制御部3は、撮像画像として背景内に被写体Sが存在する被写体存在画像P1(図5(a)参照)を撮像して取得する取得手段を構成している。被写体Sは、例えばホワイトボードWに書かれた文字列のように、分離した領域を有していてもよい。
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 image memory 5 used as a buffer memory via a DMA controller (not shown).
なお、A/D変換後のデジタルデータを現像するデモザイク部(図示略)が、カスタムLSI1Aに実装されていても良い。 A demosaic unit (not shown) for developing the digital data after A / D conversion may be mounted on the custom LSI 1A.
画像メモリ5は、例えば、DRAM等により構成され、非平坦度演算部6と、画像処理部8と、CPU13等によって処理されるデータ等を一時記憶する。
The image memory 5 is composed of, for example, a DRAM or the like, and temporarily stores data processed by the
非平坦度演算部6は、非平坦度演算手段として、被写体存在画像P1の非平坦度を演算する。具体的には、非平坦度演算部6は、分割部6aと、ばらつき量算出部6bを具備している。
The
分割部6aは、背景生成処理にて、被写体存在画像P1のYUVデータに基づいて、当該被写体存在画像P1を複数の画像ブロックB、…に分割する(図5(b)参照)。
ここで、分割部6aは、被写体存在画像P1を複数の画像ブロック(画像領域)B、…に分割する分割手段を構成している。
In the background generation process, the dividing
Here, the dividing
ばらつき量算出部6bは、分割部6aにより分割された画像ブロックB内の画素値のばらつき量(非平坦度)を算出する。具体的には、ばらつき量算出部6bは、背景生成処理にて、被写体存在画像P1の複数の画像ブロックB、…の各々についてのばらつき量として、標準偏差を下記式(1)に従って算出する。
画像処理部8は、画像領域特定部8aと、画像領域判定部8bと、背景生成部8cと、マスク生成部8dと、切抜画像生成部8eとを具備している。
The
画像領域特定部8aは、被写体存在画像に含まれる非平坦度が所定値以下である画像領域を特定する。具体的には、画像領域特定部8aは、非平坦度演算部6により演算された各画像ブロックBの非平坦度の判定を行う非平坦度判定部8fを具備しており、当該非平坦度判定部8fによる判定結果に基づいて、非平坦度が所定値以下である画像ブロックBを特定する。
即ち、非平坦度判定部8fは、背景生成処理にて、ブロック内の画素値のばらつき量が所定値以下であるか否かを判定する。判定例を挙げて説明すると、非平坦度判定部8fは、例えば、図5(c)に示すように、被写体存在画像P1の複数の画像ブロックB、…のうちの被写体Sを含む画像ブロックB(図5(c)の網掛け部分)については、ブロック内の画素値のばらつき量が大きく、画素値のばらつき量が所定値以下であると判定しない。一方で、非平坦度判定部8fは、被写体存在画像P1の複数の画像ブロックBのうちの被写体Sを含まない画像ブロックBは、ブロック内の画素値のばらつき量が被写体Sを含む画像ブロックBに比して大幅に小さくなり、画素値のばらつき量が所定値以下であると判定する。
そして、画像領域特定部8aは、非平坦度判定部8fによる判定の結果、ブロック内の画素値の非平坦度が所定値以下であると判定された少なくとも一の画像ブロックBを含んでなる画像領域を特定する。
ここで、画像領域特定部8aは、被写体存在画像P1に含まれる非平坦度が所定値以下である画像領域を特定する特定手段を構成している。
The image
That is, the
Then, the image
Here, the image
画像領域判定部8bは、被写体存在画像P1のブロック内の画素値のばらつき量が所定値以下である画像ブロックBの数が必要ブロック数以上あるか否かを判定する判定手段を構成している。
即ち、例えば、画像領域判定部8bは、被写体存在画像P1のブロック内の画素値のばらつき量が所定値以下である画像ブロックBの数が必要ブロック数以上あるか否かにより、被写体存在画像P1における非平坦度が所定値以下である画像領域の範囲が所定の範囲以上であるか否かを判定する。
なお、必要ブロック数は、予め設定されており、その数は任意であるが、例えば全ての画像ブロックBの数Bmaxの半数が必要ブロック数として設定される。
The image
That is, for example, the image
Note that the number of necessary blocks is set in advance, and the number is arbitrary. For example, half of the number Bmax of all image blocks B is set as the number of necessary blocks.
背景生成部8cは、クロマキー技術を利用して被写体領域を抽出するための抽出用背景画像を生成する。
即ち、背景生成部8cは、画像領域判定部8bによって、被写体存在画像P1のブロック内の画素値のばらつき量が所定値以下である画像ブロックBの数が必要ブロック数以上あると判定された場合に、当該画像ブロックBの色とほぼ等しい色を背景色とする抽出用背景画像を生成する。例えば、図5(a)に示すように、背景生成部8cは、ホワイトボードWの場合のように無地の背景をバックに被写体Sを撮影した場合には、無地の背景とほぼ等しい色の抽出用背景画像を生成する。
なお、クロマキーとは、特定の色背景を用いて一の画像データから被写体Sを切り抜く手法である。クロマキーでは、通常、背景に被写体Sと補色の関係にある青や緑のスクリーンを用いるようになっており、被写体存在画像P1のブロック内の画素値のばらつき量が所定値以下である画像ブロックBとほぼ等しい色の抽出用背景画像を生成することで、抽出用背景画像と被写体存在画像P1の色情報を基にして背景部分と被写体部分を分離することができる。
ここで、背景生成部8cは、被写体存在画像P1の非平坦度が所定値以下である画像領域の範囲が所定の範囲以上であると判定された場合に、当該被写体存在画像P1に含まれる非平坦度が所定値以下である画像領域から被写体存在画像P1中の被写体Sが含まれる被写体領域の抽出用の抽出用背景画像を生成する背景生成手段を構成している。
The
That is, when the
Note that the chroma key is a method of cutting out the subject S from one image data using a specific color background. In the chroma key, a blue or green screen having a complementary color relationship with the subject S is normally used as the background, and the image block B in which the variation amount of the pixel value in the block of the subject existing image P1 is equal to or less than a predetermined value. Is generated, the background portion and the subject portion can be separated based on the color information of the extraction background image and the subject presence image P1.
Here, when the
マスク生成部8dは、被写体存在画像P1から被写体領域を抽出するためのマスク画像P2(図6(a)参照)を生成する。
即ち、マスク生成部8dは、抽出用背景画像と被写体存在画像P1の対応する各画素の相違度Dを下記式(2)に従って算出して相違度マップを生成する。
そして、マスク生成部8dは、生成した相違度マップを所定の閾値で二値化(0、255)してマスク画像P2を生成する。
The
That is, the
Then, the
また、マスク生成部8dは、細かいノイズを除去するための収縮処理を行って所定値よりも小さい画素集合を除いた後、収縮分を修正するための膨張処理を行い、その後、同じ連結成分を構成する画素集合に同じ番号を付けるラベリング処理により、有効領域の構成画素数における所定の比率以下の領域を有効領域に置き換えることで穴埋めも行う。さらに、マスク生成部8dは、領域情報に対して平均化フィルタをかけて領域の縁部に合成階調をつける。
Further, the
切抜画像生成部8eは、被写体Sの画像を所定の単一色背景画像P4と合成して被写体切り抜き画像P3の画像データを生成する。
即ち、切抜画像生成部8eは、クロマキー技術を利用して、マスク生成部8dにより生成されたマスク画像P2を用いて被写体存在画像P1から被写体領域を切り出して、単一色背景画像P4と合成して被写体切り抜き画像P3の画像データを生成する(図6(b)参照)。なお、マスク画像P2の縁部分には、合成階調がつけられているため、切り出された被写体領域と単一色背景画像P4との境界部分がはっきりしていない自然な感じに合成することができる。単一色背景画像P4の色は任意であるが、例えばグレー等の色が挙げられる。
ここで、切抜画像生成部8eは、抽出用背景画像と被写体存在画像P1の対応する各画素の差分情報に基づいて、被写体存在画像P1から被写体領域を抽出する被写体抽出手段を構成している。
The cut-out
That is, the cut-out
Here, the cut-out
記録媒体9は、例えば、不揮発性メモリ(フラッシュメモリ)等により構成され、画像処理部8のJPEG圧縮部(図示略)により符号化された撮像画像の記録用の画像データを記憶する。
また、記録媒体9は、画像処理部8のマスク生成部8dにより生成されたマスク画像P2と、被写体切り抜き画像P3の画像データをそれぞれ圧縮した上で対応付けて、当該被写体切り抜き画像P3の画像データの拡張子を「.jpe」として保存する。
The
In addition, the
表示制御部10は、画像メモリ5に一時的に記憶されている表示用画像データを読み出して表示部11に表示させる制御を行う。
具体的には、表示制御部10は、VRAM、VRAMコントローラ、デジタルビデオエンコーダなどを備えている。そして、デジタルビデオエンコーダは、CPU13の制御下にて画像メモリ5から読み出されてVRAM(図示略)に記憶されている輝度信号Y及び色差信号Cb,Crを、VRAMコントローラを介してVRAMから定期的に読み出して、これらのデータを元にビデオ信号を発生して表示部11に出力する。
The
Specifically, the
表示部11は、例えば、液晶表示装置であり、表示制御部10からのビデオ信号に基づいて電子撮像部2により撮像された画像などを表示画面11aに表示する。具体的には、表示部11は、撮像モードにて、レンズ部1、電子撮像部2及び撮像制御部3による被写体Sの撮像により生成された複数の画像フレームに基づいてライブビュー画像を表示したり、本撮像画像として撮像されたレックビュー画像を表示する。
The
操作入力部12は、当該撮像装置100の所定操作を行うためのものである。具体的には、操作入力部12は、被写体Sの撮影指示に係るシャッタボタン12a、メニュー画面にて撮像モードや機能等の選択指示に係るモードボタン12b、ズーム量の調整指示に係るズームボタン(図示略)等を備え、これらのボタンの操作に応じて所定の操作信号をCPU13に出力する。
The
CPU13は、撮像装置100の各部を制御するものである。具体的には、CPU13は、撮像装置100用の各種処理プログラム(図示略)に従って各種の制御動作を行うものである。撮像装置100用の各種処理プログラムは、ROM(図示略)等に記憶されており、処理内容に応じてCPU13が読み出して実行処理する。
The
次に、撮像装置100による画像処理方法に係る被写体切り抜き処理について、図2〜図8を参照して説明する。
図2及び図3は、被写体切り抜き処理に係る動作の一例を示すフローチャートである。
Next, the subject clipping process according to the image processing method performed by the
2 and 3 are flowcharts showing an example of an operation related to the subject clipping process.
被写体切り抜き処理は、ユーザによる操作入力部12のモードボタン12bの所定操作に基づいて、メニュー画面に表示された複数の撮像モードの中から被写体切り抜きモードが選択指示された場合に実行される処理である。
なお、以下の説明にあっては、被写体Sとして、例えば、ホワイトボードWに書かれた文字列を例示し、当該被写体Sの撮像回数(M)を1回とするが、撮像装置100を所定方向に動かしながら所定の被写体を撮像するモードでは、撮像回数(M)を複数回としても良い。
The subject clipping process is a process 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
In the following description, as the subject S, for example, a character string written on the whiteboard W is exemplified, and the number of times of imaging (M) of the subject S is 1. However, the
図2に示すように、先ず、ユーザによるシャッタボタン12aの所定操作に基づいて、撮像制御部3は、被写体S(例えばホワイトボードWに書かれた文字列等)の光学像を所定の撮像条件で電子撮像部2により撮像させ(ステップS1)、電子撮像部2から転送された被写体存在画像P1の画像フレームに基づいて、画像データ生成部4が被写体存在画像P1のYUVデータを生成する。
また、ステップS1の処理に基づいて、表示制御部10は、CPU13の制御下にて、被写体存在画像P1を表示部11の表示画面11aに表示させてもよい。
As shown in FIG. 2, first, based on a predetermined operation of the
Further, based on the processing in step S <b> 1, the
次に、CPU13は、ステップS1により得られた撮像画像の枚数を定数M(例えば、M=1)として設定し(ステップS2)、画像メモリに書き込む。
次に、CPU13は、非平坦度演算部6及び画像処理部8に、被写体存在画像P1から被写体領域を抽出するための抽出用背景画像を生成させる抽出用背景生成処理を行わせる(ステップS3)。
Next, the
Next, the
ここで、抽出用背景生成処理について図3を参照して詳細に説明する。
図3は、抽出用背景生成処理に係る動作の一例を示すフローチャートである。
図3に示すように、まず、CPU13は、処理ブロックカウンタSBC及び有効ブロックカウンタYBCをそれぞれ初期値0で設定し(ステップS21)、画像メモリ5に書き込む。
そして、分割部6aは、被写体存在画像P1のYUVデータに基づいて、当該被写体存在画像P1を複数の画像ブロックB、…(図5(b)参照)に分割し、分割された複数の画像ブロックの総数を定数Bmaxとして設定し(ステップS22)画像メモリ5に書き込む。
Here, the extraction background generation processing will be described in detail with reference to FIG.
FIG. 3 is a flowchart illustrating an example of an operation related to the extraction background generation process.
As shown in FIG. 3, first, the
Then, the dividing
続けて、ばらつき量算出部6bは、被写体存在画像P1の複数の画像ブロックB、…のうち、まだ画素値のばらつき量としての標準偏差を算出していない画像ブロックBのうち一つの画像ブロックBについて、画素値のばらつき量としての標準偏差を式(1)に従って算出する(ステップS23)。
次に、非平坦度判定部8fは、算出された画像ブロックBのばらつき量が所定値以下であるか否かを判定する(ステップS24)。
ここで、ばらつき量が所定値以下であると判定されると(ステップS24;YES)、画像処理部8は、ステップS24においてばらつき量が所定値以下であると判定された画像ブロックBの平均色を算出する(ステップS25)。そして、CPU13は、有効ブロックカウンタYBCに1を加算(YBC=YBC+1)する(ステップS26)。
そして、CPU13は、処理ブロックカウンタSBCに1を加算(SBC=SBC+1)する(ステップS27)。
Next, the
Here, when it is determined that the variation amount is equal to or smaller than the predetermined value (step S24; YES), the
Then, the
一方、ステップS24にて、ばらつき量が所定値以下でないと判定されると(ステップS24;NO)、CPU13は、ステップS25、S26の処理を行わず、処理をステップS27に移行して、処理ブロックカウンタSBCに1を加算(SBC=SBC+1)する。
On the other hand, when it is determined in step S24 that the variation amount is not equal to or smaller than the predetermined value (step S24; NO), the
ステップS27の処理後、CPU13は、処理ブロックカウンタSBCの値が画像ブロックの総数Bmaxの値と等しいか否かを判定する(ステップS28)。
ここで、処理ブロックカウンタSBCの値が画像ブロックの総数Bmaxの値と等しくないと判定されると(ステップS28;NO)、CPU13は、処理をステップS23に移行して、各部によるそれ以降の処理を行う。つまり、ばらつき量算出部6bが全ての画像ブロックBに対して画素値のばらつき量としての標準偏差を算出し、非平坦度判定部8fが画素値のばらつき量が所定値以下であるか否かを判定する。そして、CPU13は、ばらつき量が所定値以下であると判定された画像ブロックBの数を有効ブロックカウンタYBCの値によりカウントする。
After the processing in step S27, the
If it is determined that the value of the processing block counter SBC is not equal to the value of the total number Bmax of image blocks (step S28; NO), the
ステップS28にて、処理ブロックカウンタSBCの値が画像ブロックの総数Bmaxの値と等しいと判定される(ステップS28;YES)ということは、全ての画素ブロックに対する画素値のばらつき量としての標準偏差の算出及びそのばらつき量が所定値以下であるか否かの判定が完了したことを示す。
そして、処理ブロックカウンタSBCの値が画像ブロックの総数Bmaxの値と等しいと判定されると(ステップS28;YES)、画像領域判定部8bは、有効ブロックカウンタYBCの値が必要ブロック数以上であるか否かを判定する(ステップS29)。
In step S28, it is determined that the value of the processing block counter SBC is equal to the value of the total number Bmax of image blocks (step S28; YES) means that the standard deviation as the variation amount of the pixel values for all the pixel blocks. It indicates that the calculation and the determination of whether or not the variation amount is equal to or less than a predetermined value have been completed.
If it is determined that the value of the processing block counter SBC is equal to the value of the total number Bmax of image blocks (step S28; YES), the image
ステップS29にて、有効ブロックカウンタYBCの値が必要ブロック数以上であると判定されると(ステップS29;YES)、画像処理部8は、ばらつき量が所定値以下であると判定された画像ブロックBのうち、同一色であるとみなすことができる色のブロック数を同一ブロック数として算出する(ステップS30)。
そして、画像領域判定部8bは、同一ブロック数のうち最大の値をとる最多同一ブロック数を特定して、当該最多同一ブロック数が必要ブロック数以上であるか否かを判定する(ステップS31)。
If it is determined in step S29 that the value of the effective block counter YBC is equal to or greater than the required number of blocks (step S29; YES), the
Then, the image
ステップS31にて、最多同一ブロック数が必要ブロック数以上であると判定されると(ステップS31;YES)、背景生成部8cは、最多同一ブロック数に計数された画像ブロックBの平均色を背景色とする抽出用背景画像のYUVデータを生成(ステップS32)して、抽出用背景生成成功とする(ステップS33)。
If it is determined in step S31 that the number of the most identical blocks is equal to or greater than the required number of blocks (step S31; YES), the
一方、ステップS31にて最多同一ブロック数が必要ブロック数以上でないと判定された場合(ステップS31;NO)、例えば、ばらつきのない安定した画像ブロックBがあっても、ほぼ等しい色のブロックが必要ブロック数以上ない場合等には背景が特定できないため、背景生成部8cは、抽出用背景画像を生成せずに、抽出用背景生成失敗とする(ステップS34)。
また、ステップS29にて有効ブロックカウンタYBCの値が必要ブロック数以上でないと判定された場合(ステップS29;NO)、ばらつきのない安定した画像ブロックBがないために背景が特定できないことから、背景生成部8cは、抽出用背景画像を生成せずに、抽出用背景生成失敗とする(ステップS34)。
これにより、抽出用背景生成処理を終了する。
On the other hand, if it is determined in step S31 that the maximum number of identical blocks is not equal to or greater than the required number of blocks (step S31; NO), for example, even if there is a stable image block B with no variation, blocks of almost the same color are required. Since the background cannot be specified when the number of blocks is not more than the number of blocks, the
If it is determined in step S29 that the value of the effective block counter YBC is not equal to or greater than the required number of blocks (step S29; NO), the background cannot be identified because there is no stable image block B without variation. The
Thus, the extraction background generation process is terminated.
図3に示すように、次に、CPU13は、背景生成部8cに、抽出用背景生成が成功したか否かを判定させる(ステップS4)。
ここで、抽出用背景生成が成功したと判定されると(ステップS4;YES)、CPU13は、被写体切り抜き処理を完了した撮像画像の枚数を管理するためのカウンタNを初期値0で設定し(ステップS5)、画像メモリ5に書き込む。
そして、CPU13は、画像処理部8に、まだ領域検出処理を施されていない撮像画像のうち一つの撮像画像に対して、被写体存在画像P1から被写体Sが含まれる被写体領域を検出する領域検出処理を行わせる(ステップS6)。
As shown in FIG. 3, next, the
If it is determined that the extraction background generation has succeeded (step S4; YES), the
Then, the
ここで、領域検出処理について図4を参照して詳細に説明する。
図4は、領域検出処理に係る動作の一例を示すフローチャートである。
図4に示すように、画像処理部のマスク生成部8dは、抽出用背景画像(背景画像)のYUVデータと被写体存在画像P1のYUVデータとの間で対応する各画素の相違度Dを式(2)に従って算出して相違度マップを生成する(ステップS41)。
FIG. 4 is a flowchart illustrating an example of an operation related to the area detection process.
As shown in FIG. 4, the
次に、マスク生成部8dは、生成した相違度マップを所定の閾値で二値化してマスク画像データを生成する(ステップS42)。そして、マスク生成部8dは、例えば、背景(二値化;0)の領域が著しく小さいか否か等を判定することで、二値化が成功したか否かを判定する(ステップS43)。
ここで、二値化に成功したと判定されると(ステップS43;YES)、マスク生成部8dは、被写体領域の周辺部の残り過ぎを修正したり細かいノイズを除去するため、マスク画像データに対する収縮処理を行って所定値よりも小さい画素集合を除いた後(ステップS44)、収縮分を修正するための膨張処理を行う(ステップS45)。
Next, the
Here, if it is determined that the binarization has succeeded (step S43; YES), the
続けて、被写体Sに背景色と似たような色がある場合、マスク画像P2の被写体領域内が欠損するため、マスク生成部8dは、同じ連結成分を構成する画素集合に同じ番号を付けるラベリング処理により、マスク画像データの有効領域の構成画素数における所定の比率以下の領域を有効領域に置き換えることで穴埋めを行う(ステップS46)。
その後、マスク生成部8dは、マスク画像データに対して平均化フィルタをかけて、被写体領域の縁部に合成階調をつけて(ステップS47)、領域検出成功とする(ステップS48)。
Subsequently, when the subject S has a color similar to the background color, since the subject area of the mask image P2 is lost, the
Thereafter, the
一方、ステップS43にて、二値化に成功しなかったと判定されると(ステップS43;NO)、例えば、背景(二値化;0)の領域が著しく小さい場合などには、マスク生成部8dは、二値化に失敗したとみなして領域検出失敗とする(ステップS49)。
これにより、領域検出処理を終了する。
On the other hand, if it is determined in step S43 that the binarization is not successful (step S43; NO), for example, if the background (binarization; 0) region is extremely small, the
Thereby, the region detection process is terminated.
領域検出処理(ステップS6)の終了後、CPU13は、マスク生成部8dに、被写体領域の検出が成功したか否かを判定させる(ステップS7)。
ここで、被写体領域の検出が成功したと判定されると(ステップS23;YES)、CPU13は、切抜画像生成部8eに、クロマキー技術を利用して、領域検出処理にて生成されたマスク画像P2を用いて被写体存在画像P1から被写体領域を切り出して、単一色背景画像P4と合成して被写体切り抜き画像P3(図6(b)参照)の画像データを生成させる(ステップS8)。
After the region detection process (step S6) is completed, the
Here, if it is determined that the detection of the subject area has succeeded (step S23; YES), the
具体的には、切抜画像生成部8eは、被写体存在画像P1、単一色背景画像P4及びマスク画像データを読み出して画像メモリ5に展開した後、被写体存在画像P1のうち、マスク画像データの塗りつぶした部分(被写体S以外の部分)で覆われる画素については、単一色背景画像P4の所定の単一色で塗りつぶす一方で、被写体部分の画素については、何もせずに所定の単一色に対して透過させないようにする。なお、マスク画像P2の縁部分には、合成階調がつけられているため、切り出された被写体領域と単一色背景画像P4との境界部分がはっきりしていない自然な感じとなる。
Specifically, the cut-out
そして、CPU13は、記録媒体9の所定の記憶領域に、画像処理部8のマスク生成部8dにより生成されたマスク画像データと被写体切り抜き画像P3の画像データを対応付けて、当該被写体切り抜き画像P3の画像データの拡張子を「.jpe」として一ファイルで保存させる(ステップS9)。
その後、CPU13は、カウンタNに1を加算する(ステップS10)。
Then, the
Thereafter, the
一方、ステップS7において、被写体領域の検出が失敗したと判定されると(ステップS7;NO)、CPU13は、ステップS8、S9の処理を行わず、処理をステップS10に移行して、カウンタNに1を加算する。
On the other hand, if it is determined in step S7 that the detection of the subject area has failed (step S7; NO), the
ステップS10の処理後、CPU13は、カウンタNの値が撮像画像の枚数Mと等しいか否かを判定する(ステップS11)。
ここで、カウンタNの値が撮像画像の枚数Mと等しくないと判定されると(ステップS11;NO)、CPU13は、処理をステップS6に移行して、それ以降の処理を行う。つまり、CPU13は、全ての撮像画像に対して、領域検出処理、被写体領域の検出が成功したか否かの判定、被写体領域の検出が成功した場合における被写体切り抜き画像P3の画像データの生成及び被写体切り抜き画像P3の画像データの保存を行う。
After the process of step S10, the
Here, when it is determined that the value of the counter N is not equal to the number M of captured images (step S11; NO), the
一方、ステップS11にて、カウンタNの値が撮像画像の枚数Mと等しいと判定されると(ステップS11;YES)、CPU13は、被写体切り抜き処理を終了する。
On the other hand, if it is determined in step S11 that the value of the counter N is equal to the number M of captured images (step S11; YES), the
なお、ステップS4にて、抽出用背景生成が成功しなかったと判定されると(ステップS4;NO)、表示制御部10は、CPU13の制御下にて、被写体Sの切り抜きの失敗に係る所定のメッセージ(例えば、「被写体の切り抜きに失敗しました」等)を表示部11の表示画面11aに表示させて(ステップS12)、被写体切り抜き処理を終了する。
When it is determined in step S4 that the extraction background generation has not been successful (step S4; NO), the
以上のように、本実施形態の撮像装置100によれば、背景内に被写体Sが存在する被写体存在画像P1の非平坦度が所定値以下である画像領域を特定し、当該被写体存在画像P1に含まれる非平坦度が所定値以下である画像領域の範囲が所定の範囲以上であると判定された場合に、被写体存在画像P1から被写体領域の抽出用の抽出用背景画像を生成して、抽出用背景画像と被写体存在画像P1の対応する各画素の相違度Dに基づいて、被写体存在画像P1から被写体領域を抽出して被写体切り抜き画像P3を生成する。即ち、撮像装置100は、抽出用背景画像に対して非平坦な領域を被写体構成領域として抽出することができるので、被写体領域が連続して構成された一領域でなく、文字のように分離した領域を具備していても、各領域をそれぞれ抽出することができる。
従って、被写体存在画像P1から分離した構成領域を具備する被写体領域の抽出を簡便に、且つ、適正に行うことができる。
As described above, according to the
Therefore, the extraction of the subject area having the constituent area separated from the subject presence image P1 can be performed easily and appropriately.
また、撮像装置100は、被写体存在画像P1を複数の画像ブロックB、…に分割して、画像ブロックB毎に非平坦度を算出し、非平坦度が所定値以下であるか否かの判定結果に基づいて、非平坦度が所定値以下である画像ブロックBを特定する。具体的には、非平坦度として、ばらつき量算出部6bが画像ブロックB内の画素値のばらつき量を演算し、非平坦度判定部8fが演算された画素値のばらつき量が所定値以下であるか否かを判定し、当該判定結果に基づいて、非平坦度が所定値以下である画像ブロックを特定する。これにより、抽出用背景画像の生成に係る非平坦度が所定値以下である画像ブロックBの特定を適正に行うことができる。
そして、撮像装置100は、非平坦度が所定値以下である画像ブロックの数が全画像ブロック数に対して所定の割合以上であるか否かを判定し、非平坦度が所定値以下である画像ブロックの数が全画像ブロック数に対して所定の割合以上であると判定された場合に、当該画像ブロックから抽出用背景画像を生成する。
従って、撮像装置100は、上述の処理により被写体存在画像P1から良好に抽出用背景画像を生成することができ、背景画像を被写体存在画像P1とは別個に撮像する必要がなくなって、被写体存在画像P1からの被写体領域の抽出を簡便に行うことができる。
Further, the
Then, the
Therefore, the
また、非平坦度が所定値以下である画像領域の色とほぼ等しい色の抽出用背景画像を生成するので、抽出用背景画像に対して異なる色の画像領域を被写体領域と判断することができ、被写体領域が分離した領域を有していても、抽出用背景画像に対して異なる色の各領域をそれぞれ適正に抽出することができる。 In addition, since an extraction background image having a color that is substantially the same as the color of the image area whose non-flatness is equal to or less than a predetermined value is generated, an image area having a color different from that of the extraction background image can be determined as the subject area. Even if the subject area has a separated area, it is possible to appropriately extract areas of different colors from the background image for extraction.
さらに、撮像装置100を動かしながら被写体Sを連続して撮像する場合であっても、各被写体存在画像P1に含まれる非平坦度が所定値以下である画像領域の範囲が所定の範囲以上であれば、被写体領域の抽出用の抽出用背景画像を一つ生成するだけで、当該一の抽出用背景画像を用いて複数の被写体存在画像P1の各々から被写体Sを簡便に、且つ、適正に抽出することができる。
Further, even when the subject S is continuously imaged while moving the
なお、本発明は、上記実施形態に限定されることなく、本発明の趣旨を逸脱しない範囲において、種々の改良並びに設計の変更を行っても良い。
例えば、被写体切り抜き画像P3の被写体領域と被写体存在画像P1以外の他の画像とを合成して被写体合成画像を生成する合成画像生成手段(図示略)を撮像装置100に設けてもよい。合成画像生成手段は、例えば、被写体切り抜き画像P3と背景用画像(図7(a)の背景用画像P5)とを合成して被写体合成画像(図7(b)の被写体合成画像P6)を生成する。
この被写体合成画像を生成する処理においては、被写体切り抜き画像P3の画像データについて、マスク画像データの塗りつぶした部分(被写体S以外の部分)で覆われる画素については背景用画像P5の色を透過させ、一方、被写体部分の画素については、何もせずに背景用画像P5の色に対して透過させないようにする。これにより、被写体切り抜き画像P3の被写体領域が所定の背景用画像P5に重畳された被写体合成画像P6を生成することができる。
被写体合成画像を生成するときに、被写体存在画像P1以外の他の画像として必ずしも背景用画像を用いる必要はない。例えば、ふきだし等の所定のパターン画像(例えば図8のパターン画像P8等)を用いてもよく、当該所定のパターン画像と被写体切り抜き画像P3とを合成した被写体合成画像(例えば図7(c)の被写体合成画像P7)を生成しても良い。
The present invention is not limited to the above-described embodiment, and various improvements and design changes may be made without departing from the spirit of the present invention.
For example, the
In the process of generating the subject composite image, the image data of the subject cutout image P3 is transmitted through the color of the background image P5 for the pixels covered with the painted portion of the mask image data (the portion other than the subject S). On the other hand, the pixels in the subject portion are not transmitted without being transmitted with respect to the color of the background image P5. As a result, it is possible to generate a subject composite image P6 in which the subject region of the subject cutout image P3 is superimposed on the predetermined background image P5.
When generating a subject composite image, it is not always necessary to use a background image as an image other than the subject presence image P1. For example, a predetermined pattern image such as a balloon (for example, the pattern image P8 in FIG. 8) may be used, and a subject composite image (for example, FIG. 7C) obtained by combining the predetermined pattern image and the subject cutout image P3. A subject composite image P7) may be generated.
また、撮像装置100は、生成された被写体合成画像を記録媒体(記憶手段)9に記憶しても良い。
なお、所定の背景用画像P5や所定のパターン画像P8は、記録媒体9に記憶されていてもよいし、撮像装置100に設けられた別途専用の記憶装置に記憶されてもよい。
The
The predetermined background image P5 and the predetermined pattern image P8 may be stored in the
これによって、様々な背景用画像(例えば背景用画像P5等)やパターン画像(例えばパターン画像P8等)を合成対象として、被写体切り抜き画像P3を用いた様々な被写体合成画像P6、P7等を生成することができるので、被写体切り抜き画像P3を用いた興趣性の高い画像を得ることができる。よって、被写体切り抜き画像P3の活用の可能性を大幅に広げることができ、より使い勝手の良い撮像装置100を提供することができる。
As a result, various subject composite images P6, P7, etc. using the subject cutout image P3 are generated using various background images (for example, the background image P5) and pattern images (for example, the pattern image P8, etc.) as synthesis targets. Therefore, a highly interesting image using the subject cutout image P3 can be obtained. Therefore, the possibility of using the subject cutout image P3 can be greatly expanded, and the
また、被写体存在画像P1に台形補正を施す補正手段(図示略)を撮像装置100に設けてもよい。
例えば、図5に示すホワイトボードW等に記載された被写体Sを撮像する場合、ホワイトボードWが撮像装置100のレンズ部1に対して平行となるよう保持されるとは限らない。このため、ホワイトボードWが撮像装置100のレンズ部1に対して平行とならず傾きを生じると、その傾きに応じて、レンズ部1に近い側が大きく撮像される一方でレンズ部1に遠い側が小さく撮像され、結果として被写体Sが台形状に歪みを生じる。
In addition, the
For example, when imaging the subject S described on the whiteboard W shown in FIG. 5, the whiteboard W is not necessarily held parallel to the
そこで、撮像装置100に台形補正を施す補正手段を設けることで、台形状に歪みを生じた被写体Sを含む被写体存在画像P1に対して台形補正を施す。補正手段は、台形補正として、被写体存在画像P1に含まれるホワイトボードWの四隅を基準に射影変換処理を行う。これにより、補正手段は、被写体存在画像P1に生じた台形状の歪みを補正する。そして、画像領域特定部8aは、補正手段により台形補正を施された被写体存在画像P1から非平坦度が所定値以下である画像領域を特定する。
これによって、被写体存在画像P1に含まれる被写体Sが台形状に歪みを生じた場合であっても、被写体存在画像P1から歪みが取り除かれた利便性の高い被写体領域を抽出することができる。即ち、例えば、ホワイトボードWに書かれた文字列などを被写体Sとした場合には、被写体切り抜き処理にて抽出される文字列からホワイトボードWと撮像装置100との相対的な位置を原因とする歪みを排除することができ、見栄えの良い文字列を抽出することができる。
Therefore, by providing correction means for performing trapezoid correction in the
Accordingly, even when the subject S included in the subject presence image P1 is distorted in a trapezoidal shape, a highly convenient subject area from which the distortion is removed can be extracted. That is, for example, when a character string or the like written on the whiteboard W is the subject S, the relative position between the whiteboard W and the
また、撮像装置100に、抽出された被写体領域画像の色を変更する色変更手段(図示略)を設けてもよい。被写体領域画像の色は、例えば、所定のカラープリセットから選択された色に変更されるようにしてもよい。
即ち、被写体領域画像の色を変更することにより、一の被写体切り抜き画像P3から様々な色の被写体領域画像を得ることができ、被写体切り抜き画像P3の活用の可能性を大幅に広げることができることとなって、より使い勝手の良い撮像装置100を提供することができる。
Further, the
That is, by changing the color of the subject region image, it is possible to obtain subject region images of various colors from one subject cutout image P3, and greatly expand the possibilities of using the subject cutout image P3. Thus, it is possible to provide the
また、上記実施形態にあっては、マスク画像データと被写体切り抜き画像P3の画像データを対応付けて一ファイルで保存させるようにしたが、マスク画像データと被写体存在画像P1の画像データを対応付けて一ファイルで記録媒体(記憶手段)9に保存させるようにしても良い。この場合、当該ファイルの再生には、被写体存在画像P1を再生させるモードと、再生時にマスク画像データを適用して被写体切り抜き画像P3を合成して表示する2モードを用意しておくとよい。 In the above embodiment, the mask image data and the image data of the subject cutout image P3 are associated with each other and saved as one file. However, the mask image data and the image data of the subject existing image P1 are associated with each other. One file may be stored in the recording medium (storage means) 9. In this case, for the reproduction of the file, it is preferable to prepare a mode for reproducing the subject existing image P1 and two modes for combining and displaying the subject cutout image P3 by applying the mask image data at the time of reproduction.
また、前述の図2に示すフローチャートに示す被写体切り抜き処理では、背景生成失敗となった場合に当該被写体切り抜き処理を終了させるようにしたが、被写体存在画像P1から抽出用背景画像を生成できなかった場合に、背景のみを撮像して抽出用背景画像を生成するためのルーチンを加えてもよい。これによって、被写体存在画像P1から抽出用背景画像を生成することができない場合であっても、背景のみを撮像して抽出用背景画像を生成することにより、被写体存在画像P1から被写体切り抜き画像P3を得ることができる。 Further, in the subject clipping process shown in the flowchart of FIG. 2 described above, the subject clipping process is terminated when the background generation fails, but the extraction background image cannot be generated from the subject existing image P1. In this case, a routine for imaging only the background and generating a background image for extraction may be added. As a result, even if the extraction background image cannot be generated from the subject existing image P1, the subject cutout image P3 is obtained from the subject existing image P1 by capturing only the background and generating the extraction background image. Can be obtained.
また、撮像装置100は、被写体切り抜き処理にて、被写体Sに基づく光学文字認識(Optical Character Recognition、OCR)を行う光学文字認識手段を更に備えてもよい。これにより、被写体Sが文字列である場合に、被写体切り抜き処理にて被写体Sを文字列として認識することができるので、被写体Sの抽出精度を向上させることができる。
The
さらに、撮像装置100の構成は、上記実施形態に例示したものは一例であり、これに限られるものではない。また、上記実施形態にあっては、画像処理装置を適用した撮像装置100の構成としたが、これに限られるものではなく、撮像する代わりに記録媒体から画像を読み出して、上記実施形態と同様の処理を実行する画像処理装置であっても良い。
Furthermore, the configuration of the
加えて、上記実施形態にあっては、特定手段、判定手段、抽出用背景生成手段、被写体抽出手段としての機能を、CPU13の制御下にて、画像処理部8が駆動することにより実現される構成としたが、これに限られるものではなく、CPU13によって所定のプログラム等が実行されることにより実現される構成としても良い。
即ち、プログラムを記憶するプログラムメモリ(図示略)に、画像領域特定処理ルーチン、判定処理ルーチン、抽出用背景生成処理ルーチン、被写体抽出処理ルーチンを含むプログラムを記憶しておく。そして、画像領域特定処理ルーチンによりCPU13を、撮像手段により撮像された被写体存在画像P1の非平坦度が所定値以下である画像領域を特定する特定手段として機能させるようにしても良い。また、判定処理ルーチンによりCPU13を、被写体存在画像における特定手段により特定された非平坦度が所定値以下である画像領域の範囲が所定の範囲以上であるか否かを判定する判定手段として機能させるようにしても良い。また、抽出用背景生成処理ルーチンによりCPU13を、判定処理にて非平坦度が所定値以下である画像領域の範囲が所定の範囲以上であると判定された場合に、被写体存在画像P1から被写体存在画像P1中の被写体Sが含まれる被写体領域の抽出用の抽出用背景画像を生成する抽出用背景生成手段として機能させるようにしても良い。また、被写体抽出処理ルーチンによりCPU13を、抽出用背景画像と被写体存在画像P1の対応する各画素の差分情報に基づいて、被写体存在画像P1から被写体領域を抽出して被写体領域画像を取得する被写体抽出手段として機能させるようにしても良い。
In addition, in the above embodiment, the functions of the specifying unit, the determining unit, the extraction background generating unit, and the subject extracting unit are realized by driving the
That is, a program memory (not shown) that stores a program stores a program including an image area specifying process routine, a determination process routine, an extraction background generation process routine, and a subject extraction process routine. Then, the
同様に、合成画像生成手段、補正手段及び色変更手段についても、CPU13によって所定のプログラム等が実行されることにより実現される構成としても良い。
Similarly, the composite image generating unit, the correcting unit, and the color changing unit may be realized by executing a predetermined program or the like by the
以上の説明では、本発明に係るプログラムのコンピュータ読み取り可能な媒体としてROMを使用した例を開示したが、この例に限定されない。
その他のコンピュータ読み取り可能な媒体として、フラッシュメモリ等の不揮発性メモリ、CD-ROM等の可搬型記録媒体を適用することが可能である。
また、本発明に係るプログラムのデータを通信回線を介して提供する媒体として、キャリアウエーブ(搬送波)も本発明に適用される。
In the above description, the example in which the ROM is used as the computer-readable medium of the program according to the present invention has been disclosed, but the present invention is not limited to this example.
As other computer-readable media, a non-volatile memory such as a flash memory and a portable recording medium such as a CD-ROM can be applied.
Further, a carrier wave (carrier wave) is also applied to the present invention as a medium for providing program data according to the present invention via a communication line.
100 撮像装置
1 レンズ部
2 電子撮像部
3 撮像制御部
6 非平坦度演算部
6a 分割部
6b ばらつき量算出部
8 画像処理部
8a 画像領域特定部
8b 画像領域判定部
8c 背景生成部
8d マスク生成部
8e 切抜画像生成部
8f 非平坦度判定部
13 CPU
DESCRIPTION OF
Claims (4)
前記取得手段により取得された被写体存在画像に含まれている非平坦度の値が所定の値以下である画像領域を特定し、前記特定された画像領域の範囲が所定の範囲以上であるか否かを判定する判定手段と、An image region in which the non-flatness value included in the subject presence image acquired by the acquisition unit is less than or equal to a predetermined value is specified, and whether or not the range of the specified image region is greater than or equal to a predetermined range Determination means for determining whether or not
前記判定手段により前記画像領域の範囲が前記所定の範囲以上であると判定された場合に、前記画像領域の情報に基づいて、前記被写体存在画像から被写体領域を抽出するための抽出用背景画像を生成する背景生成手段と、When the determination unit determines that the range of the image area is equal to or greater than the predetermined range, an extraction background image for extracting a subject area from the subject presence image is obtained based on the information of the image area. Background generating means for generating;
前記背景生成手段が抽出用背景画像を生成することに成功したか失敗したかを判断する判断手段と、Determining means for determining whether the background generating means succeeded or failed to generate the background image for extraction;
前記判断手段が抽出用背景画像を生成することに成功したと判断した際は、前記生成された抽出用背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する一方で、前記判断手段が抽出用背景画像を生成することに失敗したと判断した際は、前記背景画像を前記取得手段により取得し、前記取得された背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する被写体抽出手段と、When the determination means determines that the extraction background image has been successfully generated, the determination means extracts a subject area from the subject presence image based on the generated extraction background image, while the determination means When it is determined that generation of a background image for extraction has failed, subject extraction is performed by acquiring the background image by the acquisition unit and extracting a subject region from the subject existing image based on the acquired background image. Means,
を備えることを特徴とする画像処理装置。An image processing apparatus comprising:
前記取得手段により取得された被写体存在画像を複数の画像ブロックに分割する分割手段と、A dividing unit for dividing the subject existing image acquired by the acquiring unit into a plurality of image blocks;
前記分割手段により分割された前記複数の画像ブロックの各々について非平坦度の値が前記所定の値以下であるか否かを判定する第1の判定手段と、First determination means for determining whether a non-flatness value is equal to or less than the predetermined value for each of the plurality of image blocks divided by the dividing means;
前記第1の判定手段により非平坦度の値が前記所定の値以下であると判定された画像ブロックの数が、全画像ブロック数に対して所定の割合以上であるか否かを判定する第2の判定手段と、を含み、The first determining means determines whether or not the number of image blocks whose non-flatness value is determined to be less than or equal to the predetermined value is greater than or equal to a predetermined ratio with respect to the total number of image blocks. Two determination means,
前記背景生成手段は、The background generation means includes
前記第2の判定手段により、非平坦度の値が前記所定の値以下である画像ブロックの数が、全画像ブロック数に対して前記所定の割合以上であると判定した場合に、当該画像ブロックから前記抽出用背景画像を生成する、When it is determined by the second determination means that the number of image blocks whose non-flatness value is equal to or less than the predetermined value is equal to or greater than the predetermined ratio with respect to the total number of image blocks, the image block Generating the extraction background image from:
ことを特徴とする請求項1に記載の画像処理装置。The image processing apparatus according to claim 1.
前記取得ステップにより取得された被写体存在画像に含まれている非平坦度の値が所定の値以下である画像領域を特定し、前記特定された画像領域の範囲が所定の範囲以上であるか否かを判定する判定ステップと、An image area in which the non-flatness value included in the subject existing image acquired by the acquisition step is less than or equal to a predetermined value is specified, and whether or not the range of the specified image area is greater than or equal to a predetermined range A determination step for determining whether or not
前記判定ステップにより前記画像領域の範囲が前記所定の範囲以上であると判定された場合に、前記画像領域の情報に基づいて、前記被写体存在画像から被写体領域を抽出するための抽出用背景画像を生成する背景生成ステップと、When the determination step determines that the range of the image area is equal to or greater than the predetermined range, an extraction background image for extracting a subject area from the subject presence image is obtained based on the information of the image area. A background generation step to generate;
前記背景生成ステップで抽出用背景画像を生成することに成功したか失敗したかを判断する判断ステップと、A determination step for determining whether the background image for extraction is successfully or unsuccessfully generated in the background generation step;
前記判断ステップで抽出用背景画像を生成することに成功したと判断した際は、前記生成された抽出用背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する一方で、前記判断ステップで抽出用背景画像を生成することに失敗したと判断した際は、前記背景画像を前記取得ステップにより取得し、前記取得された背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する被写体抽出ステップと、When it is determined that the extraction background image has been successfully generated in the determination step, a subject area is extracted from the subject presence image based on the generated extraction background image, while in the determination step When it is determined that generation of a background image for extraction has failed, subject extraction is performed by obtaining the background image by the obtaining step and extracting a subject region from the subject existing image based on the obtained background image. Steps,
を含むことを特徴とする画像処理方法。An image processing method comprising:
被写体が存在していない背景のみの背景画像と被写体が存在する被写体存在画像とを取得する取得機能、An acquisition function for acquiring a background image of only a background where no subject exists and a subject existing image where the subject exists,
前記取得機能により取得された被写体存在画像に含まれている非平坦度の値が所定の値以下である画像領域を特定し、前記特定された画像領域の範囲が所定の範囲以上であるか否かを判定する判定機能、An image region in which the non-flatness value included in the subject existing image acquired by the acquisition function is less than or equal to a predetermined value is specified, and whether or not the range of the specified image region is greater than or equal to a predetermined range Judgment function to judge whether
前記判定機能により前記画像領域の範囲が前記所定の範囲以上であると判定された場合に、前記画像領域の情報に基づいて、前記被写体存在画像から被写体領域を抽出するための抽出用背景画像を生成する背景生成機能、When the determination function determines that the range of the image area is equal to or greater than the predetermined range, an extraction background image for extracting a subject area from the subject presence image based on the information of the image area Background generation function to generate,
前記背景生成機能が抽出用背景画像を生成することに成功したか失敗したかを判断する判断機能、A determination function for determining whether the background generation function has succeeded or failed in generating a background image for extraction;
前記判断機能が抽出用背景画像を生成することに成功したと判断した際は、前記生成された抽出用背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する一方で、前記判断機能が抽出用背景画像を生成することに失敗したと判断した際は、前記背景画像を前記取得機能により取得し、前記取得された背景画像に基づいて、前記被写体存在画像から被写体領域を抽出する被写体抽出機能、When it is determined that the determination function has succeeded in generating the extraction background image, a subject area is extracted from the subject existing image based on the generated extraction background image, while the determination function When it is determined that generation of a background image for extraction has failed, subject extraction is performed by acquiring the background image by the acquisition function and extracting a subject region from the subject presence image based on the acquired background image. function,
を実現させるためのプログラム。A program to realize
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012008810A JP5131399B2 (en) | 2012-01-19 | 2012-01-19 | Image processing apparatus, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012008810A JP5131399B2 (en) | 2012-01-19 | 2012-01-19 | Image processing apparatus, image processing method, and program |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009293826A Division JP4947136B2 (en) | 2009-12-25 | 2009-12-25 | Image processing apparatus, image processing method, and program |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2012084178A JP2012084178A (en) | 2012-04-26 |
JP2012084178A5 JP2012084178A5 (en) | 2012-10-18 |
JP5131399B2 true JP5131399B2 (en) | 2013-01-30 |
Family
ID=46242896
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012008810A Expired - Fee Related JP5131399B2 (en) | 2012-01-19 | 2012-01-19 | Image processing apparatus, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5131399B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5692448B1 (en) * | 2014-07-04 | 2015-04-01 | フリュー株式会社 | Photo sticker making apparatus and photo sticker making method |
JP6295936B2 (en) * | 2014-12-08 | 2018-03-20 | フリュー株式会社 | Photo sticker creating apparatus and image processing method |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4407985B2 (en) * | 1999-09-02 | 2010-02-03 | キヤノン株式会社 | Image processing method and apparatus, and storage medium |
JP2004179740A (en) * | 2002-11-25 | 2004-06-24 | Omron Corp | Photograph seal forming method, its apparatus, and seal paper unit |
JP4481236B2 (en) * | 2005-11-17 | 2010-06-16 | 株式会社システム計画研究所 | Program, information storage medium, photo printing apparatus and photo printing method |
-
2012
- 2012-01-19 JP JP2012008810A patent/JP5131399B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2012084178A (en) | 2012-04-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4947136B2 (en) | Image processing apparatus, image processing method, and program | |
US8441554B2 (en) | Image capturing apparatus capable of extracting subject region from captured image | |
JP5488548B2 (en) | Image processing apparatus, image processing method, and program | |
JP5413002B2 (en) | Imaging apparatus and method, and program | |
US8125544B2 (en) | Image processing apparatus for extracting quadrangle area in image | |
JP2008244693A (en) | Image processor | |
JP4752941B2 (en) | Image composition apparatus and program | |
JP4868046B2 (en) | Image processing apparatus, image processing method, and program | |
JP5504990B2 (en) | Imaging apparatus, image processing apparatus, and program | |
JP4894708B2 (en) | Imaging device | |
JP5131399B2 (en) | Image processing apparatus, image processing method, and program | |
JP5267279B2 (en) | Image composition apparatus and program | |
JP5493839B2 (en) | Imaging apparatus, image composition method, and program | |
JP2014132771A (en) | Image processing apparatus and method, and program | |
JP2011041041A (en) | Imaging apparatus, imaging method and program | |
JP5212451B2 (en) | Region specifying method, region specifying device, program, server, and system | |
JP5740934B2 (en) | Subject detection apparatus, subject detection method, and program | |
JP5565227B2 (en) | Image processing apparatus, image processing method, and program | |
JP2010278701A (en) | Image combining device, and image combining method and program | |
JP5402361B2 (en) | Imaging apparatus, image processing method, and program | |
JP5310361B2 (en) | Imaging apparatus, image processing method, and program | |
JP6668646B2 (en) | Image processing apparatus, image processing method, and program | |
JP5594117B2 (en) | Image processing apparatus, image processing method, and program | |
JP2011175663A (en) | Imaging device, image processing method, and program | |
JP2014022826A (en) | Image processing apparatus, imaging apparatus, 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: 20120830 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120830 |
|
A871 | Explanation of circumstances concerning accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A871 Effective date: 20120830 |
|
TRDD | Decision of grant or rejection written | ||
A975 | Report on accelerated examination |
Free format text: JAPANESE INTERMEDIATE CODE: A971005 Effective date: 20120913 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20121009 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20121022 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20151116 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5131399 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 |