Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5207941B2 - Image processing apparatus, image processing method, and program - Google Patents
[go: Go Back, main page]

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

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

Info

Publication number
JP5207941B2
JP5207941B2 JP2008313476A JP2008313476A JP5207941B2 JP 5207941 B2 JP5207941 B2 JP 5207941B2 JP 2008313476 A JP2008313476 A JP 2008313476A JP 2008313476 A JP2008313476 A JP 2008313476A JP 5207941 B2 JP5207941 B2 JP 5207941B2
Authority
JP
Japan
Prior art keywords
area
image
region
color
shape
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
Application number
JP2008313476A
Other languages
Japanese (ja)
Other versions
JP2010140093A (en
Inventor
泰弘 奥野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2008313476A priority Critical patent/JP5207941B2/en
Publication of JP2010140093A publication Critical patent/JP2010140093A/en
Application granted granted Critical
Publication of JP5207941B2 publication Critical patent/JP5207941B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

本発明は、現実空間の現実画像とCG画像とを合成処理する画像処理装置、画像処理方法、及び、当該画像処理方法をコンピュータに実行させるためのプログラムに関するものである。   The present invention relates to an image processing apparatus, an image processing method, and a program for causing a computer to execute the image processing method for synthesizing a real image in a real space and a CG image.

従来から、現実世界の映像(画像)と、三次元モデリングされたCGの映像(画像)とを合成して表示し、あたかも現実の世界にCGの物体(仮想物体)が存在しているかのように見せる複合現実感(MR:Mixed Reality)提示装置が存在している。このような装置としては、例えば、下記の特許文献1に示すものが挙げられる。具体的に、特許文献1には、現実の映像(画像)を撮影するための現実映像撮影手段と、現実映像撮影手段の位置姿勢から見たようにCG映像(CG画像)を作り出すCG映像生成手段と、現実映像とCG映像とを合成する合成手段等からなる装置が示されている。   Conventionally, a real world image (image) and a 3D modeled CG image (image) are combined and displayed, as if a CG object (virtual object) exists in the real world. There is a mixed reality (MR) presentation device shown in FIG. As such an apparatus, for example, one shown in Patent Document 1 below can be cited. Specifically, Patent Document 1 discloses a real video shooting unit for shooting a real video (image) and a CG video generation for creating a CG video (CG image) as seen from the position and orientation of the real video shooting unit. An apparatus comprising a means and a composition means for synthesizing a real image and a CG image is shown.

このような複合現実感提示装置においては、現実画像の上に仮想オブジェクトの画像が重畳描画されてしまうため、現実物体と仮想物体の奥行き関係が正しく表示されないという問題があった。特に、複合現実感(MR)の体験者が仮想オブジェクトに対して自分の手を差し出す状況が頻繁に起こり得るが、手より奥にあるはずの仮想物体が手よりも手前に描画されてしまい、体験者が強い違和感を覚えることが多かった。   In such a mixed reality presentation device, the virtual object image is superimposed and drawn on the real image, so that there is a problem that the depth relationship between the real object and the virtual object is not correctly displayed. In particular, a situation where an experienced person of mixed reality (MR) presents his / her hand against a virtual object can frequently occur, but a virtual object that should be behind the hand is drawn in front of the hand, Experienced people often felt a strong sense of incongruity.

この問題を解決するためには、現実画像の撮影点から見た現実空間の奥行き情報を取得する必要があるが、その場合には特別な測定装置が必要であった。また、奥行き情報の精度によっては、現実物体の輪郭とCGの境界とがきれいに表現されないという問題もあった。この問題に対して、特許文献1では、体験者の手及び腕の肌色と略同じ色を有する画像領域にはCGを描画しないようにする構成を有することにより、問題の解決を図っている。この構成によれば、現実空間の奥行き情報を取得する必要がないシンプルな構成でありながら、頻繁に起こり得る状況の問題を解決することが可能である。また、奥行き情報による判定ではなく画像の情報から判断することにより、手及び腕の輪郭がきれいに表現されるという利点があった。さらに、特許文献1には、肌色と略同じ色を有する領域の占める面積によって、CGを描画するべき領域か否かを判断する構成も示されている。   In order to solve this problem, it is necessary to acquire depth information of the real space viewed from the shooting point of the real image. In that case, a special measurement device is required. In addition, depending on the accuracy of the depth information, there is a problem that the contour of the real object and the boundary of the CG are not clearly expressed. In order to solve this problem, Patent Document 1 attempts to solve the problem by having a configuration in which CG is not drawn in an image region having substantially the same color as the skin color of the hands and arms of the experiencer. According to this configuration, although it is a simple configuration that does not require acquisition of depth information of the real space, it is possible to solve a problem of a situation that frequently occurs. In addition, there is an advantage that the contours of the hand and the arm are expressed beautifully by judging from the information of the image instead of the judgment based on the depth information. Further, Patent Document 1 also shows a configuration in which it is determined whether or not a region where CG is to be drawn is based on an area occupied by a region having substantially the same color as the skin color.

特開2006−343953号公報JP 2006-343953 A

しかしながら、従来の技術では、例えば、CGオブジェクトの奥の位置に他の人物がいたときなどに、その人物の顔の領域が手や腕の肌色と同じ色の領域として抽出されてしまうという問題があった。また、肌色領域の面積によって判断する手段を有する場合でも、顔の領域の面積が手及び腕の領域の面積と比べて大差がない広い面積で撮影される状況が多々あるために、意図どおりに処理できない場合があった。   However, in the conventional technology, for example, when another person is in the back of the CG object, the face area of the person is extracted as an area having the same color as the skin color of the hand or arm. there were. Even when there is a means for judging by the area of the skin color area, there are many situations where the area of the face area is photographed in a wide area that is not much different from the area of the hand and arm areas, so that it is as intended. In some cases, it could not be processed.

本発明は、このような問題点に鑑みてなされたものであり、現実画像とCG画像とを合成して合成画像を生成する際に、違和感のない、より自然な合成画像の生成を実現する画像処理装置、画像処理方法及びプログラムを提供することを目的とする。   The present invention has been made in view of such problems, and realizes the generation of a more natural composite image without a sense of incongruity when a composite image is generated by combining a real image and a CG image. An object is to provide an image processing apparatus, an image processing method, and a program.

本発明の画像処理装置は、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出手段と、仮想シーンデータに基づいてCG画像を生成するCG画像生成手段と、前記現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出手段と、前記色領域抽出手段で抽出された領域のうち、前記形状領域抽出手段で抽出された特定形状領域以外の領域を除外して、前記現実画像と前記CG画像とを合成処理する合成手段とを有する。
本発明の画像処理装置における他の態様は、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出手段と、仮想シーンデータに基づいてCG画像を生成するCG画像生成手段と、前記CG画像の中から、前記仮想シーンデータのCGオブジェクトが描画されている領域をCG描画領域として抽出するCG描画領域抽出手段と、前記現実画像の中から、前記CG描画領域に相当する領域を切り出す現実画像切り出し手段と、前記現実画像切り出し手段により切り出された現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出手段と、前記色領域抽出手段で抽出された色領域と、前記形状領域抽出手段で抽出された特定形状領域とに基づいて、前記現実画像と前記CG画像とを合成処理する合成手段とを有する。
The image processing apparatus of the present invention includes a color area extraction unit that extracts a color area included in a specific color range from a real image, a CG image generation unit that generates a CG image based on virtual scene data, A shape area extraction unit that extracts a region having a specific shape as a specific shape region from a real image, and a specific shape region extracted by the shape region extraction unit among the regions extracted by the color region extraction unit And a synthesizing unit that synthesizes the real image and the CG image by excluding a region other than .
According to another aspect of the image processing apparatus of the present invention, color area extraction means for extracting a color area included in a specific color range from a real image, and CG image generation for generating a CG image based on virtual scene data are provided. Means corresponding to the CG drawing area out of the real image, and CG drawing area extracting means for extracting the area where the CG object of the virtual scene data is drawn as a CG drawing area from the CG image A real image cutout unit that cuts out a region to be processed, a shape region extraction unit that extracts a region having a specific shape from the real image cut out by the real image cutout unit, and the color region extraction unit. Based on the extracted color area and the specific shape area extracted by the shape area extraction means, the real image and the CG image are combined. And a forming means.

本発明の画像処理方法は、色領域抽出手段が、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、CG画像生成手段が、仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、形状領域抽出手段が、前記現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、合成手段が、前記色領域抽出ステップで抽出された領域のうち、前記形状領域抽出ステップで抽出された特定形状領域以外の領域を除外して、前記現実画像と前記CG画像とを合成処理する合成ステップとを有する。
本発明の画像処理方法における他の態様は、色領域抽出手段が、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、CG画像生成手段が、仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、CG描画領域抽出手段が、前記CG画像の中から、前記仮想シーンデータのCGオブジェクトが描画されている領域をCG描画領域として抽出するCG描画領域抽出ステップと、現実画像切り出し手段が、前記現実画像の中から、前記CG描画領域に相当する領域を切り出す現実画像切り出しステップと、形状領域抽出手段が、前記現実画像切り出しステップにより切り出された現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、合成手段が、前記色領域抽出ステップで抽出された色領域と、前記形状領域抽出ステップで抽出された特定形状領域とに基づいて、前記現実画像と前記CG画像とを合成処理する合成ステップとを有する。
According to the image processing method of the present invention, the color region extracting unit extracts a color region included in a specific color range from the real image, and the CG image generating unit is based on the virtual scene data. A CG image generation step for generating a CG image, a shape region extraction unit for extracting a region having a specific shape from the real image as a specific shape region, and a synthesis unit for the color region of the extracted in the extraction step region, and a synthesizing step to exclude regions other than the particular shape region extracted by said shape region extraction step, synthesizing processing and the CG image and the real image.
According to another aspect of the image processing method of the present invention, the color region extracting unit extracts a color region included in a specific color range from the real image, and the CG image generating unit includes a virtual scene. A CG image generation step for generating a CG image based on the data, and a CG drawing area extracting means for extracting, from the CG image, an area in which the CG object of the virtual scene data is drawn as a CG drawing area The drawing area extraction step and the real image cutout means cut out the area corresponding to the CG drawing area from the real image, and the shape area extraction means was cut out by the real image cutout step. A shape region extraction step for extracting a region having a specific shape as a specific shape region from a real image; Has a color region extracted by the color region extraction step, the shaped region extracted based on the particular shape region extracted in step, and a synthesis step of synthesizing processing and the CG image and the real image.

本発明のプログラムは、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、前記現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、前記色領域抽出ステップで抽出された領域のうち、前記形状領域抽出ステップで抽出された特定形状領域以外の領域を除外して、前記現実画像と前記CG画像とを合成処理する合成ステップとをコンピュータに実行させるためのものである。
本発明のプログラムにおける他の態様は、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、前記CG画像の中から、前記仮想シーンデータのCGオブジェクトが描画されている領域をCG描画領域として抽出するCG描画領域抽出ステップと、前記現実画像の中から、前記CG描画領域に相当する領域を切り出す現実画像切り出しステップと、前記現実画像切り出しステップにより切り出された現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、前記色領域抽出ステップで抽出された色領域と、前記形状領域抽出ステップで抽出された特定形状領域とに基づいて、前記現実画像と前記CG画像とを合成処理する合成ステップとをコンピュータに実行させるためのものである。
The program of the present invention includes a color region extraction step for extracting a color region included in a specific color range from a real image, a CG image generation step for generating a CG image based on virtual scene data, and the real image A region having a specific shape as a specific shape region , and a region other than the specific shape region extracted in the shape region extraction step among the regions extracted in the color region extraction step . This is for causing a computer to execute a synthesizing step of synthesizing the real image and the CG image by excluding a region .
According to another aspect of the program of the present invention, a color area extraction step for extracting a color area included in a specific color range from a real image, and a CG image generation step for generating a CG image based on virtual scene data, A CG drawing area extracting step for extracting, as a CG drawing area, an area in which the CG object of the virtual scene data is drawn from the CG image, and an area corresponding to the CG drawing area from the real image A real image cutout step, a shape region extraction step for extracting a region having a specific shape as a specific shape region from the real image cut out by the real image cutout step, and the color region extraction step. The real image based on the color area and the specific shape area extracted in the shape area extraction step. It is intended for executing a combining step of combining processing and the CG image into the computer.

本発明によれば、現実画像とCG画像とを合成して合成画像を生成する際に、従来手法と比べて、違和感のない、より自然な合成画像の生成を実現することができる。   According to the present invention, when a synthesized image is generated by synthesizing a real image and a CG image, it is possible to realize generation of a more natural synthesized image without a sense of incompatibility compared to the conventional method.

以下に、図面を参照しながら、本発明を実施するための最良の形態(実施形態)について説明する。   The best mode (embodiment) for carrying out the present invention will be described below with reference to the drawings.

図1は、本発明の実施形態に係る画像処理装置100の概略構成の一例を示す模式図である。
図1に示すように、画像処理装置100は、CPU110と、ディスプレイ120と、ビデオカメラ130と、第1のメモリ140と、第2のメモリ150と、情報入力装置160と、バス170を有して構成されている。
FIG. 1 is a schematic diagram illustrating an example of a schematic configuration of an image processing apparatus 100 according to an embodiment of the present invention.
As shown in FIG. 1, the image processing apparatus 100 includes a CPU 110, a display 120, a video camera 130, a first memory 140, a second memory 150, an information input device 160, and a bus 170. Configured.

CPU110は、画像処理装置100における動作を統括的に制御するものであり、必要に応じて、画像処理装置100の各構成部(120〜160)の制御を行う。   The CPU 110 controls the operation of the image processing apparatus 100 as a whole, and controls each component (120 to 160) of the image processing apparatus 100 as necessary.

ディスプレイ120は、CPU110の制御に基づいて、各種の画像や各種の情報を表示する表示装置を構成するものである。   The display 120 constitutes a display device that displays various images and various information based on the control of the CPU 110.

ビデオカメラ130は、CPU110の制御に基づいて、被写体等の画像を撮像する撮像装置を構成するものである。   The video camera 130 constitutes an imaging device that captures an image of a subject or the like based on the control of the CPU 110.

第1のメモリ140には、プログラム1400が記憶されている。そして、例えば、CPU110がプログラム1400を実行することによって、色領域抽出手段1401、形状領域抽出手段1402、合成手段1403、CG描画領域抽出手段1404、現実画像切り出し手段1405、形状周辺領域抽出手段1406、形状周辺領域面積判定手段1407、及び、形状周辺領域削減手段1408が構成される。   A program 1400 is stored in the first memory 140. For example, when the CPU 110 executes the program 1400, a color area extraction unit 1401, a shape area extraction unit 1402, a synthesis unit 1403, a CG drawing area extraction unit 1404, a real image cutout unit 1405, a shape peripheral area extraction unit 1406, A shape peripheral area determination unit 1407 and a shape peripheral area reduction unit 1408 are configured.

第2のメモリ150には、各種のデータや各種の画像が格納される。具体的に、図1には、各種のデータとして、仮想シーンデータ1501、第1の色範囲データ1502、第2の色範囲データ1511、特定形状領域画素数データ1512、特定形状周辺領域画素数データ1513、判定パラメータデータ1514が格納される。また、各種の画像として、現実画像1503、特定色領域画像1504、CG画像1505、CG描画領域画像1506、被重畳現実画像1507、特定形状領域画像1508、特定形状周辺領域画像1509、合成画像1510、マスク画像1515が格納される。   Various data and various images are stored in the second memory 150. Specifically, FIG. 1 shows virtual scene data 1501, first color range data 1502, second color range data 1511, specific shape area pixel number data 1512, specific shape peripheral area pixel number data as various data. 1513 and determination parameter data 1514 are stored. As various images, a real image 1503, a specific color region image 1504, a CG image 1505, a CG drawing region image 1506, a superimposed real image 1507, a specific shape region image 1508, a specific shape peripheral region image 1509, a composite image 1510, A mask image 1515 is stored.

なお、図1において、第1のメモリ140と第2のメモリ150は、説明の便宜上区別しているだけであり、例えば、1つのメモリで構成されていてもよい。   In FIG. 1, the first memory 140 and the second memory 150 are only distinguished for convenience of explanation, and may be configured by one memory, for example.

情報入力装置160は、当該画像処理装置100に対して、情報の入力を行なうものである。   The information input device 160 inputs information to the image processing device 100.

バス170は、CPU110、ディスプレイ120、ビデオカメラ130、第1のメモリ140、第2のメモリ150及び情報入力装置160を通信可能に接続するためのものである。   The bus 170 is for connecting the CPU 110, the display 120, the video camera 130, the first memory 140, the second memory 150, and the information input device 160 so that they can communicate with each other.

ここで、本実施形態において、描画する仮想シーンを表す3Dデータは、事前に、情報入力装置160等を介して、第2のメモリ150の内部に、仮想シーンデータ1501として記憶されているものである。また、特定の色範囲を表現するためのデータは、事前に、情報入力装置160等を介して、第2のメモリ150の内部に、第1の色範囲データ1502として記憶されているものである。この第1の色範囲データ1502としては、例えば、適切な色空間表現(例えば、YUV、RGBなど)において色を表現する3値の、それぞれの上限・下限を色範囲として設定しておくなどすればよい。これにより、色領域抽出手段1401では、拝呈対象の画素値を表現する3つの値がいずれもそれぞれに設けられた上限・下限の色範囲に含まれているか否かを判定することによって、色領域の抽出を行うことができる。また、特定の色範囲(第1の色範囲)を代表する多数のサンプル色を第1の色範囲データ1502として予め記憶しておき、色領域抽出手段1401では、上記サンプル色との色の近似度を比較することによって、色領域の抽出を行うようにしてもよい。   Here, in this embodiment, 3D data representing a virtual scene to be drawn is stored in advance as virtual scene data 1501 in the second memory 150 via the information input device 160 or the like. is there. Data for expressing a specific color range is stored in advance as first color range data 1502 in the second memory 150 via the information input device 160 or the like. . As the first color range data 1502, for example, the upper and lower limits of three values representing colors in appropriate color space representation (for example, YUV, RGB, etc.) are set as color ranges. That's fine. As a result, the color region extraction unit 1401 determines whether the three values representing the pixel value to be presented are included in the upper and lower limit color ranges respectively provided, thereby determining the color Region extraction can be performed. In addition, a large number of sample colors representing a specific color range (first color range) are stored in advance as first color range data 1502, and the color area extraction unit 1401 approximates the color to the sample color. The color area may be extracted by comparing the degrees.

さらに、本実施形態においては、第1の色範囲データ1502の第1の色範囲と異なる第2の色範囲を表現するためのデータが、事前に、情報入力装置160等を介して、第2のメモリ150の内部に、第2の色範囲データ1511として記憶されている。また、形状周辺領域面積判定手段1407による判定で用いるためのデータが、事前に、情報入力装置160等を介して、第2のメモリ150の内部に、判定パラメータデータ1514として記憶されている。   Furthermore, in this embodiment, data for expressing a second color range different from the first color range of the first color range data 1502 is stored in advance via the information input device 160 or the like. The second color range data 1511 is stored in the memory 150. Further, data to be used for determination by the shape peripheral area determination unit 1407 is stored in advance as determination parameter data 1514 in the second memory 150 via the information input device 160 or the like.

以下、本実施形態の画像処理装置100による画像処理方法の処理手順について説明する。   Hereinafter, the processing procedure of the image processing method by the image processing apparatus 100 of the present embodiment will be described.

図2は、本発明の実施形態に係る画像処理装置100による画像処理方法の処理手順の一例を示すフローチャートである。   FIG. 2 is a flowchart showing an example of the processing procedure of the image processing method by the image processing apparatus 100 according to the embodiment of the present invention.

まず、ステップS101において、例えばCPU110は、ビデオカメラ130を用いて現実映像(現実画像)をキャプチャして取得し、これを第2のメモリ150の内部に現実画像1503として記憶する。   First, in step S <b> 101, for example, the CPU 110 captures and acquires a real video (real image) using the video camera 130, and stores this as a real image 1503 in the second memory 150.

図3は、図1に示す現実画像1503の一例を示す模式図である。この現実画像1503は、例えば、フルカラーの画像である。   FIG. 3 is a schematic diagram showing an example of the real image 1503 shown in FIG. The real image 1503 is, for example, a full color image.

続いて、ステップS102において、CPU110はプログラム1400を実行し、色領域抽出手段1401によって、ステップS101で取得した現実画像1503の中から、特定の色範囲(第1の色範囲)に含まれる色をした画像領域(色領域)を抽出する。具体的に、色領域抽出手段1401は、現実画像1503の全画素について、第1の色範囲データ1502に示された特定の色範囲(第1の色範囲)に含まれる色であるか否かを判定し、当該特定の色範囲に含まれる色の色領域を抽出する。また、この際、従来から行われているように、特定の色範囲であるとされた画素をラベリングし、ラベリングされた領域の面積が予め定めた値よりも小さいものや、他と比べて相対的に小さいものは、色領域として抽出しないとする処理などを加えてもよい。その後、例えばCPU110(色領域抽出手段1401)は、ステップS102で抽出した色領域を特定色領域画像1504として第2のメモリ150に記憶する。   Subsequently, in step S102, the CPU 110 executes the program 1400, and the color area extraction unit 1401 selects colors included in the specific color range (first color range) from the real image 1503 acquired in step S101. Extracted image areas (color areas) are extracted. Specifically, the color area extraction unit 1401 determines whether or not all pixels in the real image 1503 are in a specific color range (first color range) indicated in the first color range data 1502. And a color region of a color included in the specific color range is extracted. At this time, as is conventionally done, pixels that are in a specific color range are labeled, and the area of the labeled area is smaller than a predetermined value or relative to other areas. For example, a process of not extracting a small area as a color area may be added. Thereafter, for example, the CPU 110 (color area extracting unit 1401) stores the color area extracted in step S102 in the second memory 150 as the specific color area image 1504.

図4は、図1に示す特定色領域画像1504の一例を示す模式図である。
この特定色領域画像1504は、画素値として0か1かを持つ画像である。ここでは、図3に示す現実画像1503の中から特定の色範囲(第1の色範囲)であるとして抽出された色領域(図4の画像領域402、403及び404)の画素値を1、そうでない領域(図4の画像領域401)の画素値を0としている。ここで、画像領域402及び403は、観察者の手の画像領域を示し、画像領域405は、正面に立っている人物の顔の画像領域を示している。
FIG. 4 is a schematic diagram showing an example of the specific color area image 1504 shown in FIG.
The specific color area image 1504 is an image having 0 or 1 as a pixel value. Here, the pixel values of the color regions (image regions 402, 403, and 404 in FIG. 4) extracted as being a specific color range (first color range) from the real image 1503 shown in FIG. The pixel value of the other area (image area 401 in FIG. 4) is set to 0. Here, the image regions 402 and 403 indicate the image region of the observer's hand, and the image region 405 indicates the image region of the face of the person standing in front.

続いて、ステップS103において、例えばCPU110は、第2のメモリ150に記憶されている仮想シーンデータ1501をレンダリングして、CG画像を生成し、これを第2のメモリ150の内部にCG画像1505として記憶する。ここで、CG画像を生成する処理(S103の処理)を行う例えばCPU110は、CG画像生成手段を構成する。ここで、従来の複合現実感システムで行われているように、現実のビデオカメラ130の位置・姿勢と、CGレンダリングの仮想カメラの位置・姿勢とを一致させてもよい。例えば、ビデオカメラ130の位置・姿勢を取得する位置・姿勢センサを用いたり、現実画像1503の画像の特徴によってビデオカメラ130の位置・姿勢を推定したりする方法を用いることができる。   Subsequently, in step S <b> 103, for example, the CPU 110 renders the virtual scene data 1501 stored in the second memory 150 to generate a CG image, and this is generated as a CG image 1505 in the second memory 150. Remember. Here, for example, the CPU 110 that performs the process of generating the CG image (the process of S103) constitutes a CG image generating unit. Here, as is done in the conventional mixed reality system, the position / posture of the actual video camera 130 may be matched with the position / posture of the virtual camera for CG rendering. For example, a position / posture sensor that acquires the position / posture of the video camera 130 or a method of estimating the position / posture of the video camera 130 based on the characteristics of the real image 1503 can be used.

図5は、図1に示すCG画像1505の一例を示す模式図である。この図5には、CG画像1505として、球状の物体の画像が示されている。   FIG. 5 is a schematic diagram showing an example of the CG image 1505 shown in FIG. FIG. 5 shows a spherical object image as the CG image 1505.

続いて、ステップS104において、CPU110はプログラム1400を実行し、CG描画領域抽出手段1404により、CG画像1505の中から、仮想シーンデータ1501中のCGオブジェクトがレンダリングされている領域(CG描画領域)を抽出する。具体的に、CG描画領域抽出手段1404は、当該CGオブジェクトが描画されている部分(領域)とそうでない部分(領域)とを判定して、CGオブジェクトが描画されているCG描画領域の抽出を行う。この際、CGオブジェクトが描画されている画素(領域)であるか否かは、例えば、CGのZバッファの値を検査することや、CG描画前にクリアした画素値と変化があったか否かなどにより判定すればよい。その後、例えばCPU110(CG描画領域抽出手段1404)は、ステップS104で抽出したCG描画領域をCG描画領域画像1506として第2のメモリ150に記憶する。   Subsequently, in step S104, the CPU 110 executes the program 1400, and an area (CG drawing area) in which the CG object in the virtual scene data 1501 is rendered from the CG image 1505 by the CG drawing area extraction unit 1404. Extract. Specifically, the CG drawing area extraction unit 1404 determines a portion (area) where the CG object is drawn and a portion (area) where the CG object is drawn, and extracts a CG drawing area where the CG object is drawn. Do. At this time, whether or not the CG object is a pixel (area) on which the CG object is drawn is determined by, for example, checking the value of the CG Z buffer, whether or not there is a change from the pixel value cleared before CG drawing, etc. It may be determined by the following. Thereafter, for example, the CPU 110 (CG drawing area extraction unit 1404) stores the CG drawing area extracted in step S104 in the second memory 150 as a CG drawing area image 1506.

図6は、図1に示すCG描画領域画像1506の一例を示す模式図である。
このCG描画領域画像1506は、画素値として0か1かを持つ画像である。ここでは、図5に示すCG画像1505の中から、仮想シーンデータ1501中のCGオブジェクトがレンダリングされたとして抽出された領域(図6の画像領域601)の画素値を1、そうでない領域(図6の画像領域602)の画素値を0としている。
FIG. 6 is a schematic diagram showing an example of the CG drawing area image 1506 shown in FIG.
This CG drawing area image 1506 is an image having 0 or 1 as a pixel value. Here, the pixel value of an area (image area 601 in FIG. 6) extracted from the CG image 1505 shown in FIG. The pixel value of the sixth image area 602) is set to zero.

続いて、ステップS105において、CPU110はプログラム1400を実行し、現実画像切り出し手段1405によって、現実画像1503の中から、合成時にCGオブジェクトが重畳されるであろう画像領域(CG描画領域に相当する領域)を切り出す。その後、例えばCPU110(現実画像切り出し手段1405)は、ステップS105で切り出した画像領域を被重畳現実画像1507として第2のメモリ150に記憶する。この被重畳現実画像1507は、現実画像1503の各画素値に対して、それぞれ、CG描画領域画像1506の各画素値を掛け合わせることで生成することができる。即ち、被重畳現実画像1507は、CG描画領域画像1506で画素値が1である領域(図6の601)は、現実画像1503のままの値として生成され、CG描画領域画像1506で画素値が0である領域(図6の画像領域602)の画素値は0として生成される。   Subsequently, in step S105, the CPU 110 executes the program 1400, and an image area (an area corresponding to a CG drawing area) on which a CG object is to be superimposed from the real image 1503 during synthesis by the real image cutout unit 1405. ). Thereafter, for example, the CPU 110 (real image cutout unit 1405) stores the image region cut out in step S105 in the second memory 150 as a superimposed real image 1507. This superimposed real image 1507 can be generated by multiplying each pixel value of the real image 1503 by each pixel value of the CG drawing region image 1506. In other words, the superimposed real image 1507 is generated as the value of the actual image 1503 in the region where the pixel value is 1 in the CG drawing region image 1506 (601 in FIG. 6), and the pixel value is generated in the CG drawing region image 1506. The pixel value of the area that is 0 (image area 602 in FIG. 6) is generated as 0.

図7は、図1に示す被重畳現実画像1507の一例を示す模式図である。
図7において、画像領域701は、図3に示す現実画像1503のままの画素値の領域であり、画像領域702は、図6に示すCG描画領域画像1506で画素値が0である領域(画像領域602)に対応する画素値が0の領域である。なお、上述した、現実画像1503の各画素値にCG描画領域画像1506の各画素値を掛け合わせる際、CG描画領域画像1506において画素値が1である領域を適当な幅だけ広げた後に、掛け合わせるようにしてもよい。この場合、例えば、予め決められた画素分だけ外側に広げるなどすればよい。このようにすることにより、現実画像1503として撮影された人物の顔の領域が、CG描画領域の端の部分で一部分だけ重畳するような場合への対策となる。
FIG. 7 is a schematic diagram showing an example of the superimposed real image 1507 shown in FIG.
In FIG. 7, an image area 701 is an area having a pixel value as it is in the real image 1503 shown in FIG. 3, and an image area 702 is an area where the pixel value is 0 in the CG drawing area image 1506 shown in FIG. This is an area having a pixel value of 0 corresponding to the area 602). When multiplying each pixel value of the real image 1503 with each pixel value of the CG drawing area image 1506, the area having the pixel value of 1 in the CG drawing area image 1506 is expanded by an appropriate width, and then multiplied. You may make it match. In this case, for example, it may be expanded outward by a predetermined number of pixels. By doing so, it becomes a measure against a case where the face area of the person photographed as the real image 1503 is partially overlapped at the end of the CG drawing area.

続いて、ステップS106において、CPU110はプログラム1400を実行し、形状領域抽出手段1402によって、被重畳現実画像1507の中から、特定の形状をしていると認識される領域(特定形状領域)を抽出する。ここで、特定の形状とは、例えば人間の顔の形状である。この際、ある画像の中から人間の顔であると認識される領域を抽出する技術は既知のものである。ここで、抽出される領域がどのようなものになるのかについては、顔認識のアルゴリズムによる。例えば、画像上の肌色領域の中で特徴抽出を行い、眼と口と認識できる部分があれば、両眼と口の位置を含む矩形領域を顔領域として抽出することができる。その後、例えばCPU110(形状領域抽出手段1402)は、ステップS106で抽出した特定形状領域を特定形状領域画像1508として第2のメモリ150に記憶する。   Subsequently, in step S106, the CPU 110 executes the program 1400, and the shape region extraction unit 1402 extracts a region (specific shape region) recognized as having a specific shape from the superimposed real image 1507. To do. Here, the specific shape is, for example, the shape of a human face. At this time, a technique for extracting an area recognized as a human face from a certain image is known. Here, what kind of region is extracted depends on a face recognition algorithm. For example, if feature extraction is performed in the skin color area on the image and there is a part that can be recognized as the eyes and mouth, a rectangular area including the positions of both eyes and mouth can be extracted as the face area. Thereafter, for example, the CPU 110 (shape area extraction unit 1402) stores the specific shape area extracted in step S106 in the second memory 150 as the specific shape area image 1508.

図8は、図1に示す特定形状領域画像1508の一例を示す模式図である。
図8は、図7に示す被重畳現実画像1507に対して特定の形状(ここでは顔)の認識処理を行い、認識した形状のものがどの位置にあったかを矩形で表現したものである。ここでは、図7に示す被重畳現実画像1507の中から特定の形状のものがあるとして抽出された領域(図8の画像領域801)の画素値を1、それ以外の領域(図8の画像領域802)の画素値を0としている。なお、図8に示す例では、説明を容易にするために抽出される領域を矩形としたが、不定形であることも考えられる。例えば、眼・口と認識された部分を含んで連続している肌色の領域を不定形で抽出するようなことも考えられる。
FIG. 8 is a schematic diagram showing an example of the specific shape region image 1508 shown in FIG.
FIG. 8 shows a recognition process of a specific shape (here, a face) on the superimposed real image 1507 shown in FIG. 7, and the position of the recognized shape is represented by a rectangle. Here, the pixel value of an area (image area 801 in FIG. 8) extracted as having a specific shape from the superimposed real image 1507 shown in FIG. 7 is 1, and the other area (image in FIG. 8) is selected. The pixel value in the area 802) is set to 0. In the example shown in FIG. 8, the extracted region is rectangular for ease of explanation, but it may be indefinite. For example, it may be possible to extract a continuous skin-color region including a portion recognized as an eye / mouth in an irregular shape.

続いて、ステップS107において、CPU110はプログラム1400を実行し、形状周辺領域抽出手段1406により、ステップS106で抽出された特定形状領域に連続し、かつ、第2の色範囲データ1511の色範囲に基づく特定形状周辺領域を抽出する。このステップS107の処理の詳細については、図10を用いて後述する。その後、例えばCPU110(形状周辺領域抽出手段1406)は、ステップS107で抽出した特定形状周辺領域を特定形状周辺領域画像1509として第2のメモリ150に記憶する。   Subsequently, in step S107, the CPU 110 executes the program 1400, is continuous with the specific shape area extracted in step S106 by the shape peripheral area extraction unit 1406, and is based on the color range of the second color range data 1511. Extract the area around the specific shape. Details of the processing in step S107 will be described later with reference to FIG. Thereafter, for example, the CPU 110 (shape peripheral region extraction unit 1406) stores the specific shape peripheral region extracted in step S107 as the specific shape peripheral region image 1509 in the second memory 150.

図9は、図1に示す特定形状周辺領域画像1509の一例を示す模式図である。
図9では、特定形状周辺領域として抽出された領域(図9の画像領域901、902及び903)の画素値が1であり、その以外の領域(図9の画像領域904)の画素値が0である。画像領域901は、図3に示す現実画像1503の人物の顔の額における領域、画像領域902は、図3に示す現実画像1503の人物の耳における領域、画像領域903は、図3に示す現実画像1503の人物のあご・首における領域である。これらの領域は、顔と認識された領域(図8の画像領域801)に連続しており、かつ、第2の色範囲の色(ここでは肌色)をしている領域である。なお、手が撮影されている領域は、肌色ではあるが、顔と認識された領域と連続していないため、ここでは抽出されない。
FIG. 9 is a schematic diagram showing an example of the specific shape peripheral area image 1509 shown in FIG.
In FIG. 9, the pixel value of the region (image regions 901, 902, and 903 in FIG. 9) extracted as the peripheral region of the specific shape is 1, and the pixel value of the other region (image region 904 in FIG. 9) is 0. It is. An image area 901 is an area in the forehead of the person's face in the real image 1503 shown in FIG. 3, an image area 902 is an area in the ear of the person in the real image 1503 shown in FIG. 3, and an image area 903 is the reality shown in FIG. This is an area on the chin / neck of the person in the image 1503. These areas are areas that are continuous with an area recognized as a face (image area 801 in FIG. 8) and have a color in the second color range (here, skin color). Note that the region where the hand is photographed is a skin color, but is not extracted here because it is not continuous with the region recognized as a face.

続いて、ステップS108において、CPU110はプログラム1400を実行し、形状周辺領域面積判定手段1407を動作させる。そして、形状周辺領域面積判定手段1407は、特定形状領域画像1508中の画素値が1である画素の数と、特定形状周辺領域画像1509中の画素値が1である画素の数とを比較し、その比が一定値以上であるか否かを判断する。即ち、このステップS108の処理は、特定形状領域における特定形状周辺領域に対する面積比が一定値以上であるか否かを判断(判定)するものである。このステップS108の処理の詳細については、図14を用いて後述する。   Subsequently, in step S108, the CPU 110 executes the program 1400 to operate the shape peripheral area determination unit 1407. Then, the shape peripheral area determination unit 1407 compares the number of pixels having a pixel value of 1 in the specific shape area image 1508 with the number of pixels having a pixel value of 1 in the specific shape peripheral area image 1509. Then, it is determined whether or not the ratio is a certain value or more. That is, the process of step S108 determines (determines) whether or not the area ratio of the specific shape region to the specific shape peripheral region is a certain value or more. Details of the processing in step S108 will be described later with reference to FIG.

ステップS108の判断の結果、特定形状領域画像1508中の画素値が1である画素の数と、特定形状周辺領域画像1509中の画素値が1である画素の数との比が一定値以上である場合には(S108/YES)、ステップS109に進む。   As a result of the determination in step S108, the ratio between the number of pixels having a pixel value of 1 in the specific shape region image 1508 and the number of pixels having a pixel value of 1 in the specific shape peripheral region image 1509 is greater than or equal to a certain value. If there is (S108 / YES), the process proceeds to step S109.

ステップS109に進むと、CPU110はプログラム1400を実行し、形状周辺領域削減手段1408によって、ステップS107で抽出した特定形状周辺領域を削減する削減処理を行う。このステップS109の処理の詳細については、図15を用いて後述する。   In step S109, the CPU 110 executes the program 1400, and the shape peripheral area reduction unit 1408 performs a reduction process for reducing the specific shape peripheral area extracted in step S107. Details of the processing in step S109 will be described later with reference to FIG.

ステップS109の処理が終了した場合、或いは、ステップS108において特定形状領域画像1508と特定形状周辺領域画像1509との所定の画素値における画素数の比が一定値以上でない場合には(S108/NO)、ステップS110に進む。   When the process of step S109 is completed, or when the ratio of the number of pixels in a predetermined pixel value between the specific shape area image 1508 and the specific shape peripheral area image 1509 is not a predetermined value or more in step S108 (S108 / NO). The process proceeds to step S110.

ステップS110に進むと、CPU110はプログラム1400を実行し、合成手段1403によって、現実画像1503とCG画像1505とを合成処理して、合成画像を生成する。このステップS110の処理の詳細については、図16を用いて後述する。その後、例えばCPU110(合成手段1403)は、ステップS110で生成した合成画像を合成画像1510として第2のメモリ150に記憶する。   In step S110, the CPU 110 executes the program 1400, and the synthesizing unit 1403 synthesizes the real image 1503 and the CG image 1505 to generate a synthesized image. Details of the processing in step S110 will be described later with reference to FIG. Thereafter, for example, the CPU 110 (compositing means 1403) stores the composite image generated in step S110 as the composite image 1510 in the second memory 150.

続いて、ステップS111において、CPU110は、ステップS110で生成した合成画像1510をディスプレイ120に出力して表示する。   Subsequently, in step S111, the CPU 110 outputs and displays the composite image 1510 generated in step S110 on the display 120.

以上の図2に示す一連の処理を経ることにより、1フレーム分の合成画像1510がディスプレイ120に出力表示される。そして、必要に応じて、図2に示す一連の処理を繰り返し行うことによって、合成画像1510を動画としてディスプレイ120に表示することが可能である。   Through the series of processes shown in FIG. 2 described above, a composite image 1510 for one frame is output and displayed on the display 120. If necessary, the composite image 1510 can be displayed as a moving image on the display 120 by repeatedly performing a series of processes shown in FIG.

次に、形状周辺領域抽出手段1406が行う、図2のステップS107の詳細な処理について説明する。
図10は、図2に示すステップS107の詳細な処理手順の一例を示すフローチャートである。
Next, detailed processing in step S107 of FIG. 2 performed by the shape peripheral area extraction unit 1406 will be described.
FIG. 10 is a flowchart illustrating an example of a detailed processing procedure of step S107 illustrated in FIG.

まず、図10のステップS201において、形状周辺領域抽出手段1406は、第2の色範囲データ1511を用いて、現実画像1503の中から、第2の色範囲に含まれる画素値を持つ色領域を抽出する。   First, in step S201 of FIG. 10, the shape peripheral area extraction unit 1406 uses the second color range data 1511 to select a color area having a pixel value included in the second color range from the real image 1503. Extract.

図11は、図10のステップS201の抽出された色領域の画像の一例を示す模式図である。
図11に示す色領域の画像では、第2の色範囲であると判定された領域(図11の画像領域1101、1102及び1103)の画素値を1、それ以外の領域(図11の画像領域1104)の画素値を0としている。
FIG. 11 is a schematic diagram showing an example of an image of the color region extracted in step S201 of FIG.
In the image of the color area shown in FIG. 11, the pixel value of the area determined to be the second color range (image areas 1101, 1102, and 1103 in FIG. 11) is 1, and the other area (image area in FIG. 11). 1104) is set to 0.

続いて、ステップS202において、形状周辺領域抽出手段1406は、ステップS201で抽出した色領域の画像(図11)に、特定形状領域画像1508の画素値をORする(即ち足す)。   Subsequently, in step S202, the shape peripheral area extraction unit 1406 ORs (that is, adds) the pixel value of the specific shape area image 1508 to the color area image (FIG. 11) extracted in step S201.

図12は、図10のステップS202の処理で得られた画像の一例を示す模式図である。この図12に示す画像は、図11に示す色領域の画像と、図8に示す特定形状領域画像1508とを足したものである。即ち、図12の画像領域1201は、図11の画像領域1101と図8の画像領域801とを足した領域ということになる。   FIG. 12 is a schematic diagram illustrating an example of an image obtained by the process of step S202 of FIG. The image shown in FIG. 12 is obtained by adding the color region image shown in FIG. 11 and the specific shape region image 1508 shown in FIG. That is, the image area 1201 in FIG. 12 is an area obtained by adding the image area 1101 in FIG. 11 and the image area 801 in FIG.

続いて、ステップS203において、形状周辺領域抽出手段1406は、ステップS202の処理で得られた画像(図12)をラベリングして、連続している領域をそれぞれまとめ、相互に区別できるようにする。例えば、ここで付けられたラベルの番号を画素値に入れてもよい。ここでは、例えば、図12の画像領域1201の画素値を1、画像領域1202の画素値を2、画像領域1203の画素値を3にする。   Subsequently, in step S203, the shape peripheral region extraction unit 1406 labels the image (FIG. 12) obtained by the processing in step S202 so that continuous regions can be collected and distinguished from each other. For example, the label number assigned here may be included in the pixel value. Here, for example, the pixel value of the image region 1201 in FIG. 12 is set to 1, the pixel value of the image region 1202 is set to 2, and the pixel value of the image region 1203 is set to 3.

続いて、ステップS204において、形状周辺領域抽出手段1406は、特定形状領域画像1508で画素値が1である領域(図8の画像領域801)に対応する領域と同じラベルが付けられた領域の画素値を1とする。そして、形状周辺領域抽出手段1406は、他のラベルがつけられた領域の画素値を0に変更する。   Subsequently, in step S204, the shape peripheral region extraction unit 1406 performs pixel processing in the region having the same label as the region corresponding to the region having the pixel value 1 in the specific shape region image 1508 (image region 801 in FIG. 8). The value is 1. Then, the shape peripheral region extraction unit 1406 changes the pixel value of the region with another label to 0.

図13は、図10のステップS204の処理で得られた画像の一例を示す模式図である。図13において、画像領域1301は画素値が1の領域であり、画像領域1302は画素値が0の領域である。   FIG. 13 is a schematic diagram illustrating an example of an image obtained by the process of step S204 of FIG. In FIG. 13, an image area 1301 is an area having a pixel value of 1, and an image area 1302 is an area having a pixel value of 0.

続いて、ステップS205において、形状周辺領域抽出手段1406は、ステップS204の処理で得られた画像に対して、特定形状領域画像1508で画素値が1である領域(図8の画像領域801)に相当する画素の値を0にセットする。この結果、図9に示す特定形状周辺領域画像1509が得られる。   Subsequently, in step S205, the shape peripheral area extraction unit 1406 converts the image obtained in the process of step S204 into an area having a pixel value of 1 in the specific shape area image 1508 (image area 801 in FIG. 8). The corresponding pixel value is set to zero. As a result, a specific shape peripheral area image 1509 shown in FIG. 9 is obtained.

以上のステップS201〜S205の処理を経ることにより、特定形状周辺領域画像1509の生成が行われる。   Through the processes in steps S201 to S205 described above, the specific shape peripheral area image 1509 is generated.

ここで、本実施形態では、上述したように、ステップS201における色領域の抽出の際に用いる色範囲(第2の色範囲)を、第1の色範囲データ1502の特定の色範囲(第1の色範囲)とは異なるものにしている。その理由としては、特定形状の周辺領域をより安定して抽出するためである。具体的に、第1の色範囲データ1502によって手・腕の領域を抽出しようとしている場合、この色範囲を広くしてしまうと、手・腕でない画素が多く抽出されしまうため、色範囲をあまり広く設定できない。一方、形状周辺領域抽出手段1406で抽出したい領域は、手・腕ではない領域に連続する色領域を抽出しようとしているので、色範囲が少々広くても問題にならない。例えば、顔として認識された領域に連続する肌色領域を抽出する場合、第1の色範囲データ1502よりもやや広めの色範囲を設定すると、顔領域に連続する肌色領域がつながりやすくなるという利点がある。以上のように、ステップS201の処理において、第1の色範囲データ1502と異なる第2の色範囲データ1511を用いるのには利点がある。しかしながら、簡便のために、ステップS201で用いる色範囲として、第2の色範囲ではなく、第1の色範囲データ1502における特定の色範囲(第1の色範囲)を用いる形態であってもよい。   Here, in the present embodiment, as described above, the color range (second color range) used when extracting the color region in step S201 is set to the specific color range (first color range) of the first color range data 1502. Color range). The reason is that the peripheral area of the specific shape is extracted more stably. Specifically, when the hand / arm region is to be extracted by the first color range data 1502, if the color range is widened, pixels that are not the hand / arm are extracted, so that the color range is not much. Cannot be set widely. On the other hand, the region desired to be extracted by the shape peripheral region extraction unit 1406 is trying to extract a color region that is continuous with a region that is not a hand / arm, so there is no problem even if the color range is a little wide. For example, when a skin color region continuous to a region recognized as a face is extracted, if a color range slightly wider than the first color range data 1502 is set, there is an advantage that the skin color region continuous to the face region is easily connected. is there. As described above, it is advantageous to use the second color range data 1511 different from the first color range data 1502 in the process of step S201. However, for the sake of simplicity, the color range used in step S201 may use a specific color range (first color range) in the first color range data 1502 instead of the second color range. .

次に、形状周辺領域面積判定手段1407が行う、図2のステップS108の詳細な処理について説明する。
図14は、図2に示すステップS108の詳細な処理手順の一例を示すフローチャートである。
Next, detailed processing in step S108 of FIG. 2 performed by the shape peripheral area determination unit 1407 will be described.
FIG. 14 is a flowchart illustrating an example of a detailed processing procedure of step S108 illustrated in FIG.

まず、ステップS301において、形状周辺領域面積判定手段1407は、特定形状領域画像1508について、画素値が1である画素の数(特定形状領域画素数)を計算する。そして、例えばCPU110(形状周辺領域面積判定手段1407)は、ステップS301の計算の結果得られたデータを特定形状領域画素数データ1512として第2のメモリ150に記憶する。   First, in step S <b> 301, the shape peripheral region area determination unit 1407 calculates the number of pixels having a pixel value of 1 (specific shape region pixel number) for the specific shape region image 1508. For example, the CPU 110 (shape peripheral region area determination unit 1407) stores the data obtained as a result of the calculation in step S301 in the second memory 150 as the specific shape region pixel number data 1512.

続いて、ステップS302において、形状周辺領域面積判定手段1407は、特定形状周辺領域画像1509について、画素値が1である画素の数(特定形状周辺領域画素数)を計算する。そして、例えばCPU110(形状周辺領域面積判定手段1407)は、ステップS302の計算の結果得られたデータを特定形状周辺領域画素数データ1513として第2のメモリ150に記憶する。   Subsequently, in step S302, the shape peripheral region area determination unit 1407 calculates the number of pixels having a pixel value of 1 (number of specific shape peripheral region pixels) for the specific shape peripheral region image 1509. Then, for example, the CPU 110 (shape peripheral region area determination unit 1407) stores the data obtained as a result of the calculation in step S302 in the second memory 150 as the specific shape peripheral region pixel number data 1513.

続いて、ステップS303において、形状周辺領域面積判定手段1407は、ステップS301及びS302で計算した、特定形状周辺領域画素数に対する特定形状領域画素数の比を計算し、これを判定パラメータデータ1514の一定値と比較する。そして、形状周辺領域面積判定手段1407は、当該比が判定パラメータデータ1514の一定値以上であるか否かを判断する。   Subsequently, in step S303, the shape peripheral region area determination unit 1407 calculates the ratio of the number of specific shape region pixels to the number of specific shape peripheral region pixels calculated in steps S301 and S302. Compare with value. Then, the shape peripheral area determination unit 1407 determines whether or not the ratio is equal to or greater than a certain value of the determination parameter data 1514.

ここで、判定パラメータデータ1514について説明する。
この判定パラメータデータ1514は、特定の形状、例えば人間の顔と認識された領域が、それ以外の領域、例えば手・腕である領域と連結してしまう場合を判断するためのものである。即ち、特定形状である顔として認識された領域の面積よりも、顔につながっている周辺の肌色領域が相対的に大きすぎるかどうかを判断することで、別の肌色領域につながっているか否かを判断するものである。
Here, the determination parameter data 1514 will be described.
The determination parameter data 1514 is used to determine a case where a specific shape, for example, a region recognized as a human face is connected to other regions, for example, regions that are hands and arms. That is, whether or not it is connected to another skin color area by determining whether the surrounding skin color area connected to the face is relatively larger than the area of the area recognized as a face having a specific shape Is to judge.

したがって、例えば顔と認識された特定形状領域における、それに連続する肌色領域等の特定形状周辺領域に対する面積比が、判定パラメータデータ1514の一定値以上である場合には(S303/YES)、ステップS304に進む。そして、ステップS304において、形状周辺領域面積判定手段1407は、顔等の特定形状領域に何か別の肌色物体(例えば手・腕)の特定形状周辺領域が重なってしまったと判定する。この場合には、後工程のステップS109において、形状周辺領域削減手段1408の処理によって、当該特定形状周辺領域を適当な範囲(例えば特定形状領域に重ならない範囲)におさめるようにするものである。   Therefore, for example, when the area ratio of the specific shape region recognized as the face to the specific shape peripheral region such as the skin color region continuous thereto is equal to or larger than the predetermined value of the determination parameter data 1514 (S303 / YES), step S304. Proceed to In step S304, the shape peripheral region area determining unit 1407 determines that the specific shape peripheral region of another skin color object (for example, a hand / arm) has overlapped the specific shape region such as the face. In this case, in the subsequent step, step S109, the shape peripheral area reduction unit 1408 performs processing so that the specific shape peripheral area falls within an appropriate range (for example, a range that does not overlap the specific shape area).

一方、ステップS303の判断の結果、否定判断された場合には(S303/NO)、ステップS305において、形状周辺領域面積判定手段1407は、顔等の特定形状領域に特定形状周辺領域が重なっていないと判定する。   On the other hand, if a negative determination is made as a result of the determination in step S303 (S303 / NO), in step S305, the shape peripheral area determination unit 1407 does not overlap the specific shape peripheral area with the specific shape area such as the face. Is determined.

なお、本実施形態では、ここでの判定方法として単純な面積比によるものを用いたが、特定形状周辺領域が特定形状領域に比べて大きすぎることを判定できるものであれば、別途定めた方式によるものであってもよい。   In the present embodiment, the determination method here uses a simple area ratio. However, if it can be determined that the specific shape peripheral region is too large compared to the specific shape region, a separately defined method is used. It may be due to.

以上のステップS301〜S305の処理を経ることにより、図2のステップS108の処理が終了する。   The process of step S108 of FIG. 2 is completed through the processes of steps S301 to S305.

次に、形状周辺領域削減手段1408が行う、図2のステップS109の詳細な処理について説明する。
図15は、図2に示すステップS109の詳細な処理手順の一例を示すフローチャートである。
Next, detailed processing in step S109 of FIG. 2 performed by the shape peripheral area reduction unit 1408 will be described.
FIG. 15 is a flowchart illustrating an example of a detailed processing procedure of step S109 illustrated in FIG.

まず、ステップS401において、形状周辺領域削減手段1408は、特定形状領域画像1508の重心Pを設定する。ここでは、重心Pとして、重心位置を一時的な変数として設定する。   First, in step S <b> 401, the shape peripheral area reduction unit 1408 sets the center of gravity P of the specific shape area image 1508. Here, the gravity center position is set as a temporary variable as the gravity center P.

続いて、ステップS402において、形状周辺領域削減手段1408は、特定形状周辺領域画像1509のうち、画素値が1である全ての画素について、重心Pに相当する位置からの距離と座標を求め、配列Aに格納する。ここで、配列Aは、例えば、重心Pからの距離、画素のx座標、画素のy座標の3つの内容からなる配列である。また、その配列の
サイズは、特定形状周辺領域画素数データ1513の値と等しくなる。
Subsequently, in step S402, the shape peripheral area reduction unit 1408 obtains the distance and coordinates from the position corresponding to the center of gravity P for all the pixels having a pixel value of 1 in the specific shape peripheral area image 1509, and arranges them. Store in A. Here, the array A is an array composed of three contents, for example, the distance from the center of gravity P, the x coordinate of the pixel, and the y coordinate of the pixel. In addition, the size of the array is equal to the value of the specific shape peripheral area pixel number data 1513.

続いて、ステップS403において、形状周辺領域削減手段1408は、配列Aを距離の小さい順にソートする。   Subsequently, in step S403, the shape peripheral area reduction unit 1408 sorts the array A in ascending order of distance.

続いて、ステップS404において、形状周辺領域削減手段1408は、N=(特定形状領域画素数データ1512)×(判定パラメータデータ1514)で算出される値Nを求める。この値Nは、特定形状領域画素数と特定形状周辺領域画素数との比が、判定パラメータデータ1514の一定値未満(或いは以下)になるような、特定形状周辺領域画素数を求めたものである。   Subsequently, in step S404, the shape peripheral area reduction unit 1408 obtains a value N calculated by N = (specific shape area pixel number data 1512) × (determination parameter data 1514). This value N is obtained by obtaining the number of pixels in the specific shape surrounding area such that the ratio between the number of pixels in the specific shape area and the number of pixels in the peripheral area of the specific shape is less than (or less than) the determination parameter data 1514 is there.

続いて、ステップS405において、形状周辺領域削減手段1408は、値Nが、特定形状周辺領域画素数未満であるか否かを判断する。   Subsequently, in step S405, the shape peripheral area reduction unit 1408 determines whether the value N is less than the specific shape peripheral area pixel number.

ステップS405の判断の結果、値Nが、特定形状周辺領域画素数未満でない、即ち以上である場合には(S405/NO)、ステップS406に進む。   As a result of the determination in step S405, if the value N is not less than the number of pixels in the peripheral area of the specific shape, that is, it is more than that (S405 / NO), the process proceeds to step S406.

ステップS406に進むと、形状周辺領域削減手段1408は、ステップS403でソートした配列AのN番目の要素Anに対応する画素に0をセットする。その後、ステップS407において、形状周辺領域削減手段1408は、現在の値Nに1を加算して、現在の値Nを変更した後、ステップS405に戻る。   In step S406, the shape peripheral area reduction unit 1408 sets 0 to the pixel corresponding to the Nth element An of the array A sorted in step S403. Thereafter, in step S407, the shape peripheral area reduction unit 1408 adds 1 to the current value N, changes the current value N, and then returns to step S405.

即ち、ステップS405からステップS407では、ステップS403でソートした配列AのN番目の要素Anから最後の要素(配列Aの全要素数は特定形状周辺領域画素数データ1513の値に等しい)までの画素に対応する画素値を0にセットする。ここで、配列Aの各要素には、画素の特定形状周辺領域画像1509中におけるx座標、y座標が格納されているため、特定形状周辺領域画像1509中で対応する画素の値をセットすることができる。   That is, in steps S405 to S407, pixels from the Nth element An of the array A sorted in step S403 to the last element (the total number of elements of the array A is equal to the value of the specific shape peripheral area pixel number data 1513). The pixel value corresponding to is set to 0. Here, since each element of the array A stores the x-coordinate and y-coordinate in the specific shape peripheral area image 1509 of the pixel, the value of the corresponding pixel in the specific shape peripheral area image 1509 is set. Can do.

一方、ステップS405の判断の結果、値Nが、特定形状周辺領域画素数未満である場合には(S405/YES)、図15に示すフローチャートの処理を終了する。   On the other hand, if the result of determination in step S405 is that the value N is less than the specific shape peripheral area pixel number (S405 / YES), the processing of the flowchart shown in FIG.

以上のステップS401〜S407の処理を経ることによって、特定形状領域画像1508中で画素値が1である画素数と特定形状周辺領域画像1509中で画素値が1である画素数との比は、判定パラメータデータ1514の一定値未満におさまることになる。   Through the processes of steps S401 to S407, the ratio between the number of pixels having a pixel value of 1 in the specific shape area image 1508 and the number of pixels having a pixel value of 1 in the specific shape peripheral area image 1509 is The determination parameter data 1514 falls below a certain value.

本実施形態においては、特定形状周辺領域画像1509は、特定形状領域画像1508の重心Pに近いものを画素値1として残し、重心Pから遠いものを削除する(画素値が0になる)ようにしているが、他の手法を用いても構わない。この場合、例えば、本実施形態の処理においては、特定形状周辺領域画像1509で画素値が1である領域は結果的に円形になるが、特定形状として認識される対象が人物の顔であることを鑑みて、残される領域が楕円形になるように処理することなども考えられる。   In the present embodiment, in the specific shape peripheral area image 1509, an object close to the centroid P of the specific shape area image 1508 is left as a pixel value 1 and an object far from the centroid P is deleted (the pixel value becomes 0). However, other methods may be used. In this case, for example, in the processing of the present embodiment, the region having the pixel value of 1 in the specific shape peripheral region image 1509 is circular as a result, but the target recognized as the specific shape is a human face. In view of the above, it may be possible to process the remaining area to be elliptical.

次に、合成手段1403が行う、図2のステップS110の詳細な処理について説明する。
図16は、図2に示すステップS110の詳細な処理手順の一例を示すフローチャートである。
Next, detailed processing in step S110 of FIG. 2 performed by the synthesizing unit 1403 will be described.
FIG. 16 is a flowchart illustrating an example of a detailed processing procedure of step S110 illustrated in FIG.

まず、ステップS501において、合成手段1403は、特定色領域画像1504(図4)を第2のメモリ150のマスク画像1515にコピーする。   First, in step S501, the synthesizing unit 1403 copies the specific color area image 1504 (FIG. 4) to the mask image 1515 of the second memory 150.

続いて、ステップS502において、合成手段1403は、特定形状領域画像1508(図8)の画素値を全て反転する処理を行う。   Subsequently, in step S502, the synthesizing unit 1403 performs a process of inverting all the pixel values of the specific shape region image 1508 (FIG. 8).

続いて、ステップS503において、合成手段1403は、マスク画像1515の全画素について、それに対応する位置の特定形状領域画像1508(ステップS502で反転させたもの)の画素とのANDをとり、その結果をマスク画像1515に反映する。   Subsequently, in step S503, the synthesizing unit 1403 ANDs all the pixels of the mask image 1515 with the pixels of the specific shape region image 1508 at the corresponding position (inverted in step S502), and obtains the result. Reflected in the mask image 1515.

図17は、図16のステップS503の処理で得られたマスク画像1515の一例を示す模式図である。   FIG. 17 is a schematic diagram showing an example of the mask image 1515 obtained by the process of step S503 of FIG.

続いて、ステップS504において、合成手段1403は、特定形状周辺領域画像1509(図9)の画素値を全て反転する処理を行う。   Subsequently, in step S504, the synthesizing unit 1403 performs a process of inverting all the pixel values of the specific shape peripheral area image 1509 (FIG. 9).

続いて、ステップS505において、合成手段1403は、マスク画像1515の全画素について、それに対応する位置の特定形状周辺領域画像1509(ステップS504で反転させたもの)の画素とのANDをとり、その結果をマスク画像1515に反映する。   Subsequently, in step S505, the synthesizing unit 1403 ANDs all the pixels of the mask image 1515 with the pixels of the specific shape peripheral area image 1509 at the corresponding position (inverted in step S504), and the result. Is reflected in the mask image 1515.

図18は、図16のステップS505の処理で得られたマスク画像1515の一例を示す模式図である。   FIG. 18 is a schematic diagram showing an example of a mask image 1515 obtained by the process of step S505 of FIG.

続いて、ステップS506において、合成手段1403は、マスク画像1515の画素値を全て反転する処理を行う。   Subsequently, in step S506, the synthesizing unit 1403 performs a process of inverting all the pixel values of the mask image 1515.

続いて、ステップS507において、合成手段1403は、CG画像1505と、ステップS506で反転したマスク画像1515とにおいて対応する各画素値を掛け合わせ、その結果をCG画像1505に反映する。   Subsequently, in step S507, the synthesizing unit 1403 multiplies corresponding pixel values in the CG image 1505 and the mask image 1515 inverted in step S506, and reflects the result in the CG image 1505.

続いて、ステップS508において、合成手段1403は、現実画像1503を第2のメモリ150の内部の合成画像1510にコピーする。   Subsequently, in step S <b> 508, the synthesizing unit 1403 copies the real image 1503 to the synthesized image 1510 inside the second memory 150.

続いて、ステップS509において、合成手段1403は、ステップS507で処理したCG画像1505を合成画像1510の上に上書して重畳し、現実画像1503とCG画像1505を合成する処理を行う。なお、この際、CG画像1505に半透明領域がある場合には、適宜ブレンディングなどの処理を行う。その後、図16に示すフローチャートの処理を終了する。   Subsequently, in step S509, the synthesizing unit 1403 performs processing for overwriting and superimposing the CG image 1505 processed in step S507 on the synthesized image 1510 to synthesize the real image 1503 and the CG image 1505. At this time, if the CG image 1505 includes a semi-transparent region, processing such as blending is appropriately performed. Then, the process of the flowchart shown in FIG.

以上のステップS501〜S509の処理を経ることにより、図2のステップS110における合成画像1510の合成処理が行われる。   Through the processes in steps S501 to S509, the composite image 1510 is combined in step S110 in FIG.

図19は、図2のステップS110(或いは図16)の合成処理で得られた合成画像1510の一例を示す模式図である。
図19に示す合成画像1510では、図5に示すCG画像1505に重なった手の画像領域が肌色の色領域であるとして抽出されたことによって、CG画像1505がマスクされているために、図3に示す現実画像1503の手が見えている。また、CG画像1505に重なった顔の領域とそれに連続する肌色の領域は、肌色ではあったが、特定の形状及びそれに連続する所定色領域であるとして抽出されたため、当該領域のCG画像1505はマスクされることなく、そのまま重畳されている。
FIG. 19 is a schematic diagram showing an example of a composite image 1510 obtained by the composite processing in step S110 (or FIG. 16) in FIG.
In the synthesized image 1510 shown in FIG. 19, the CG image 1505 is masked by extracting the hand image area that overlaps the CG image 1505 shown in FIG. 5 as a skin color area. The hand of the real image 1503 shown in FIG. In addition, since the face area that overlaps the CG image 1505 and the skin color area that is continuous with the face area are skin colors, they are extracted as having a specific shape and a predetermined color area that is continuous with the skin color. They are superimposed as they are without being masked.

なお、ステップS507のように反転させたマスク画像1515とCG画像1505を掛け合わせるのではなく、マスク画像1515を反転させずにステンシルバッファに格納した後に、仮想シーンをレンダリングしてCG画像1505を得る方法も考えられる。本実施形態では、形状認識を行う領域を限定するために、CG画像1505が既に生成済みであった。しかしながら、形状認識を行う領域を限定して効率化するような処理を行わないのであれば、本処理に至るまで仮想シーンをレンダリングしなくても構わない。そのような場合には、合成処理中でステンシルバッファを用いてCG描画を行う手法も有効である。   Instead of multiplying the inverted mask image 1515 and the CG image 1505 as in step S507, the mask image 1515 is stored in the stencil buffer without being inverted, and then the virtual scene is rendered to obtain the CG image 1505. A method is also conceivable. In the present embodiment, the CG image 1505 has already been generated in order to limit the region for shape recognition. However, if the processing for limiting the shape recognition region and improving the efficiency is not performed, the virtual scene may not be rendered until this processing is reached. In such a case, it is also effective to perform CG drawing using a stencil buffer during the synthesis process.

本実施形態によれば、現実画像とCG画像とを合成して合成画像を生成する際に、従来手法と比べて、違和感のない、より自然な合成画像の生成を実現することができる。   According to the present embodiment, when a synthesized image is generated by synthesizing a real image and a CG image, it is possible to realize generation of a more natural synthesized image without a sense of incompatibility compared to the conventional method.

(本発明の他の実施形態)
前述した本発明の実施形態に係る画像処理装置100に含まれる各手段(1401〜1408)、並びに、画像処理方法を示す図2、図10、図14〜図16の各ステップは、CPU110がプログラム1400を実行することによって実現できる。このプログラム1400及び当該プログラム1400を記録したコンピュータ読み取り可能な記録媒体(例えば、第1のメモリ140)は本発明に含まれる。
(Other embodiments of the present invention)
Each unit (1401 to 1408) included in the above-described image processing apparatus 100 according to the embodiment of the present invention and each step of FIGS. 2, 10, and 14 to 16 showing the image processing method are programmed by the CPU 110. This can be realized by executing 1400. The program 1400 and a computer-readable recording medium (for example, the first memory 140) on which the program 1400 is recorded are included in the present invention.

また、本発明は、例えば、システム、装置、方法、プログラム若しくは記憶媒体等としての実施形態も可能であり、具体的には、複数の機器から構成されるシステムに適用してもよいし、また、1つの機器からなる装置に適用してもよい。   In addition, the present invention can be implemented as, for example, a system, apparatus, method, program, storage medium, or the like. Specifically, the present invention may be applied to a system including a plurality of devices. You may apply to the apparatus which consists of one apparatus.

なお、本発明は、前述した実施形態の機能を実現するソフトウェアのプログラム(実施形態では図2、図10、図14〜図16に示すフローチャートに対応したプログラム)を、システム或いは装置に直接、或いは遠隔から供給するものを含む。そして、そのシステム或いは装置のコンピュータが前記供給されたプログラムコードを読み出して実行することによっても達成される場合も本発明に含まれる。   In the present invention, a software program that realizes the functions of the above-described embodiments (in the embodiment, programs corresponding to the flowcharts shown in FIGS. 2, 10, and 14 to 16) is directly or directly stored in a system or apparatus. Includes remote supplies. The present invention also includes a case where the system or the computer of the apparatus is achieved by reading and executing the supplied program code.

したがって、本発明の機能処理をコンピュータで実現するために、前記コンピュータにインストールされるプログラムコード自体も本発明を実現するものである。つまり、本発明は、本発明の機能処理を実現するためのコンピュータプログラム自体も含まれる。   Accordingly, since the functions of the present invention are implemented by computer, the program code installed in the computer also implements the present invention. In other words, the present invention includes a computer program itself for realizing the functional processing of the present invention.

その場合、プログラムの機能を有していれば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等の形態であってもよい。   In that case, as long as it has the function of a program, it may be in the form of object code, a program executed by an interpreter, script data supplied to the OS, and the like.

プログラムを供給するための記録媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、MO、CD−ROM、CD−R、CD−RWなどがある。また、磁気テープ、不揮発性のメモリカード、ROM、DVD(DVD−ROM,DVD−R)などもある。   Examples of the recording medium for supplying the program include a flexible disk, hard disk, optical disk, magneto-optical disk, MO, CD-ROM, CD-R, and CD-RW. In addition, there are magnetic tape, nonvolatile memory card, ROM, DVD (DVD-ROM, DVD-R), and the like.

その他、プログラムの供給方法としては、クライアントコンピュータのブラウザを用いてインターネットのホームページに接続する。そして、前記ホームページから本発明のコンピュータプログラムそのもの、若しくは圧縮され自動インストール機能を含むファイルをハードディスク等の記録媒体にダウンロードすることによっても供給できる。   As another program supply method, a browser on a client computer is used to connect to an Internet home page. The computer program itself of the present invention or a compressed file including an automatic installation function can be downloaded from the homepage by downloading it to a recording medium such as a hard disk.

また、本発明のプログラムを構成するプログラムコードを複数のファイルに分割し、それぞれのファイルを異なるホームページからダウンロードすることによっても実現可能である。つまり、本発明の機能処理をコンピュータで実現するためのプログラムファイルを複数のユーザに対してダウンロードさせるWWWサーバも、本発明に含まれるものである。   It can also be realized by dividing the program code constituting the program of the present invention into a plurality of files and downloading each file from a different homepage. That is, a WWW server that allows a plurality of users to download a program file for realizing the functional processing of the present invention on a computer is also included in the present invention.

また、本発明のプログラムを暗号化してCD−ROM等の記憶媒体に格納してユーザに配布し、所定の条件をクリアしたユーザに対し、インターネットを介してホームページから暗号化を解く鍵情報をダウンロードさせる。そして、ダウンロードした鍵情報を使用することにより暗号化されたプログラムを実行してコンピュータにインストールさせて実現することも可能である。   In addition, the program of the present invention is encrypted, stored in a storage medium such as a CD-ROM, distributed to users, and key information for decryption is downloaded from a homepage via the Internet to users who have cleared predetermined conditions. Let It is also possible to execute the encrypted program by using the downloaded key information and install the program on a computer.

また、コンピュータが、読み出したプログラムを実行することによって、前述した実施形態の機能が実現される。その他、そのプログラムの指示に基づき、コンピュータ上で稼動しているOSなどが、実際の処理の一部又は全部を行い、その処理によっても前述した実施形態の機能が実現され得る。   Further, the functions of the above-described embodiments are realized by the computer executing the read program. In addition, based on the instructions of the program, an OS or the like running on the computer performs part or all of the actual processing, and the functions of the above-described embodiments can also be realized by the processing.

さらに、記録媒体から読み出されたプログラムが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれる。その後、そのプログラムの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部又は全部を行い、その処理によっても前述した実施形態の機能が実現される。   Further, the program read from the recording medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. Thereafter, the CPU of the function expansion board or function expansion unit performs part or all of the actual processing based on the instructions of the program, and the functions of the above-described embodiments are realized by the processing.

なお、前述した各実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。即ち、本発明はその技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   Note that each of the above-described embodiments is merely a specific example for carrying out the present invention, and the technical scope of the present invention should not be construed as being limited thereto. . That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

本発明の実施形態に係る画像処理装置の概略構成の一例を示す模式図である。1 is a schematic diagram illustrating an example of a schematic configuration of an image processing apparatus according to an embodiment of the present invention. 本発明の実施形態に係る画像処理装置による画像処理方法の処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the process sequence of the image processing method by the image processing apparatus which concerns on embodiment of this invention. 図1に示す現実画像の一例を示す模式図である。It is a schematic diagram which shows an example of the real image shown in FIG. 図1に示す特定色領域画像の一例を示す模式図である。It is a schematic diagram which shows an example of the specific color area image shown in FIG. 図1に示すCG画像の一例を示す模式図である。It is a schematic diagram which shows an example of the CG image shown in FIG. 図1に示すCG描画領域画像の一例を示す模式図である。It is a schematic diagram which shows an example of the CG drawing area | region image shown in FIG. 図1に示す被重畳現実画像の一例を示す模式図である。It is a schematic diagram which shows an example of the to-be-superimposed real image shown in FIG. 図1に示す特定形状領域画像の一例を示す模式図である。It is a schematic diagram which shows an example of the specific shape area | region image shown in FIG. 図1に示す特定形状周辺領域画像の一例を示す模式図である。It is a schematic diagram which shows an example of the specific shape periphery area | region image shown in FIG. 図2に示すステップS107の詳細な処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the detailed process sequence of step S107 shown in FIG. 図10のステップS201の抽出された色領域の画像の一例を示す模式図である。It is a schematic diagram which shows an example of the image of the extracted color area | region of step S201 of FIG. 図10のステップS202の処理で得られた画像の一例を示す模式図である。It is a schematic diagram which shows an example of the image obtained by the process of step S202 of FIG. 図10のステップS204の処理で得られた画像の一例を示す模式図である。It is a schematic diagram which shows an example of the image obtained by the process of step S204 of FIG. 図2に示すステップS108の詳細な処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the detailed process sequence of step S108 shown in FIG. 図2に示すステップS109の詳細な処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the detailed process sequence of step S109 shown in FIG. 図2に示すステップS110の詳細な処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the detailed process sequence of step S110 shown in FIG. 図16のステップS503の処理で得られたマスク画像の一例を示す模式図である。It is a schematic diagram which shows an example of the mask image obtained by the process of step S503 of FIG. 図16のステップS505の処理で得られたマスク画像の一例を示す模式図である。It is a schematic diagram which shows an example of the mask image obtained by the process of step S505 of FIG. 図2のステップS110(或いは図16)の合成処理で得られた合成画像の一例を示す模式図である。It is a schematic diagram which shows an example of the synthesized image obtained by the synthesis process of step S110 (or FIG. 16) of FIG.

符号の説明Explanation of symbols

100 画像処理装置
110 CPU
120 ディスプレイ
130 ビデオカメラ
140 第1のメモリ
1401 色領域抽出手段
1402 形状領域抽出手段
1403 合成手段
1404 CG描画領域抽出手段
1405 現実画像切り出し手段
1406 形状周辺領域抽出手段
1407 形状周辺領域面積判定手段
1408 形状周辺領域削減手段
150 第2のメモリ
1501 仮想シーンデータ
1502 第1の色範囲データ
1503 現実画像
1504 特定色領域画像
1505 CG画像
1506 CG描画領域画像
1507 被重畳現実画像
1508 特定形状領域画像
1509 特定形状周辺領域画像
1510 合成画像
1511 第2の色範囲データ
1512 特定形状領域画素数データ
1513 特定形状周辺領域画素数データ
1514 判定パラメータデータ
1515 マスク画像
160 情報入力装置
170 バス
100 Image processing apparatus 110 CPU
120 Display 130 Video camera 140 First memory 1401 Color area extraction means 1402 Shape area extraction means 1403 Composition means 1404 CG drawing area extraction means 1405 Real image extraction means 1406 Shape peripheral area extraction means 1407 Shape peripheral area area determination means 1408 Shape periphery Area reduction means 150 Second memory 1501 Virtual scene data 1502 First color range data 1503 Real image 1504 Specific color area image 1505 CG image 1506 CG drawing area image 1507 Overlaid real image 1508 Specific shape area image 1509 Specific shape peripheral area Image 1510 Composite image 1511 Second color range data 1512 Specific shape region pixel number data 1513 Specific shape peripheral region pixel number data 1514 Determination parameter data 1515 Mask image 160 Information input Power device 170 bus

Claims (16)

現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出手段と、
仮想シーンデータに基づいてCG画像を生成するCG画像生成手段と、
前記現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出手段と、
前記色領域抽出手段で抽出された領域のうち、前記形状領域抽出手段で抽出された特定形状領域以外の領域を除外して、前記現実画像と前記CG画像とを合成処理する合成手段と
を有することを特徴とする画像処理装置。
Color area extraction means for extracting a color area included in a specific color range from a real image;
CG image generation means for generating a CG image based on virtual scene data;
A shape region extracting means for extracting a region having a specific shape from the real image as a specific shape region;
Combining means for synthesizing the real image and the CG image by excluding areas other than the specific shape area extracted by the shape area extracting means from among the areas extracted by the color area extracting means. An image processing apparatus.
前記CG画像の中から、前記仮想シーンデータのCGオブジェクトが描画されている領域をCG描画領域として抽出するCG描画領域抽出手段と、
前記現実画像の中から、前記CG描画領域に相当する領域を切り出す現実画像切り出し手段と
を更に有し、
前記形状領域抽出手段は、前記現実画像切り出し手段により切り出された現実画像の中から、前記特定形状領域を抽出することを特徴とする請求項1に記載の画像処理装置。
CG drawing area extracting means for extracting, as a CG drawing area, an area in which the CG object of the virtual scene data is drawn from the CG image;
A real image cutout unit for cutting out an area corresponding to the CG drawing area from the real image;
The image processing apparatus according to claim 1, wherein the shape area extraction unit extracts the specific shape area from a real image cut out by the real image cutout unit.
前記特定形状領域に連続し、かつ、前記特定の色範囲に含まれる色領域を特定形状周辺領域として抽出する形状周辺領域抽出手段を更に有し、
前記合成手段は、前記色領域抽出手段で抽出された色領域および前記形状領域抽出手段で抽出された特定形状領域に加えて、更に、前記形状周辺領域抽出手段で抽出された特定形状周辺領域に基づいて、前記合成処理を行うことを特徴とする請求項1または2に記載の画像処理装置。
A shape peripheral area extracting unit that extracts a color area that is continuous with the specific shape area and that is included in the specific color range as a specific shape peripheral area;
In addition to the color region extracted by the color region extraction unit and the specific shape region extracted by the shape region extraction unit, the synthesizing unit further adds a specific shape peripheral region extracted by the shape peripheral region extraction unit. The image processing apparatus according to claim 1, wherein the composition processing is performed based on the image processing device.
前記特定形状領域における前記特定形状周辺領域に対する面積の比が一定値以上であるか否かを判定する形状周辺領域面積判定手段と、
前記面積の比が一定値以上である場合に、前記特定形状周辺領域のうち、前記特定形状領域の重心からの距離が遠い領域を削減処理する形状周辺領域削減手段と
を更に有し、
前記合成手段は、前記特定形状周辺領域に基づく前記合成処理を行う際に、前記形状周辺領域削減手段で削減処理された特定形状周辺領域に基づく前記合成処理を行うことを特徴とする請求項3に記載の画像処理装置。
A shape peripheral region area determining means for determining whether a ratio of an area of the specific shape region to the specific shape peripheral region is a certain value or more;
When the ratio of the areas is a certain value or more, further comprising a shape peripheral area reduction means for reducing a region far from the center of gravity of the specific shape area among the specific shape peripheral area,
The said synthesis | combination means performs the said synthetic | combination process based on the specific shape peripheral area reduced by the said shape peripheral area reduction means, when performing the said synthetic | combination process based on the said specific shape peripheral area. An image processing apparatus according to 1.
形状周辺領域面積判定手段は、前記面積の比として、前記特定形状領域における画素数と前記特定形状周辺領域における画素数との比を用いることを特徴とする請求項4に記載の画像処理装置。   The image processing apparatus according to claim 4, wherein the shape peripheral area determination unit uses a ratio between the number of pixels in the specific shape area and the number of pixels in the specific shape peripheral area as the ratio of the areas. 前記形状周辺領域抽出手段は、前記特定形状周辺領域を抽出する際に、前記特定の色範囲に含まれる色領域にかえて、当該特定の色範囲とは異なる第2の色範囲に含まれる色領域を用いることを特徴とする請求項3乃至5のいずれか1項に記載の画像処理装置。   The shape surrounding area extracting unit, when extracting the specific shape surrounding area, replaces the color area included in the specific color range with a color included in a second color range different from the specific color range. The image processing apparatus according to claim 3, wherein a region is used. 前記形状領域抽出手段は、前記特定形状領域として人間の身体の所定の領域を抽出し、The shape area extraction means extracts a predetermined area of the human body as the specific shape area,
前記合成手段は、前記色領域抽出手段で抽出された領域のうち、前記人間の身体の所定の領域以外の領域を除外して、前記現実画像と前記CG画像とを合成処理することを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。The synthesizing unit is configured to synthesize the real image and the CG image by excluding a region other than the predetermined region of the human body from the regions extracted by the color region extracting unit. The image processing apparatus according to any one of claims 1 to 6.
色領域抽出手段が、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、
CG画像生成手段が、仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、
形状領域抽出手段が、前記現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、
合成手段が、前記色領域抽出ステップで抽出された領域のうち、前記形状領域抽出ステップで抽出された特定形状領域以外の領域を除外して、前記現実画像と前記CG画像とを合成処理する合成ステップと
を有することを特徴とする画像処理方法。
A color region extracting step in which the color region extracting means extracts a color region included in a specific color range from the real image;
A CG image generation step in which the CG image generation means generates a CG image based on the virtual scene data;
A shape region extracting step, wherein the shape region extracting means extracts a region having a specific shape from the real image as the specific shape region;
A synthesis unit that synthesizes the real image and the CG image by excluding a region other than the specific shape region extracted in the shape region extraction step from the regions extracted in the color region extraction step. An image processing method comprising: steps.
現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、
仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、
前記現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、
前記色領域抽出ステップで抽出された領域のうち、前記形状領域抽出ステップで抽出された特定形状領域以外の領域を除外して、前記現実画像と前記CG画像とを合成処理する合成ステップと
をコンピュータに実行させるためのプログラム。
A color region extraction step for extracting a color region included in a specific color range from a real image;
A CG image generation step for generating a CG image based on the virtual scene data;
A shape region extraction step for extracting a region having a specific shape as a specific shape region from the real image;
Among the color area extraction step is extracted in the region, the shaped region extracted by excluding an area other than the specific shaped region extracted in step, the real image and the CG image and the computer and synthesis steps of synthesis process A program to make it run.
現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出手段と、Color area extraction means for extracting a color area included in a specific color range from a real image;
仮想シーンデータに基づいてCG画像を生成するCG画像生成手段と、CG image generation means for generating a CG image based on virtual scene data;
前記CG画像の中から、前記仮想シーンデータのCGオブジェクトが描画されている領域をCG描画領域として抽出するCG描画領域抽出手段と、CG drawing area extracting means for extracting, as a CG drawing area, an area in which the CG object of the virtual scene data is drawn from the CG image;
前記現実画像の中から、前記CG描画領域に相当する領域を切り出す現実画像切り出し手段と、A real image cutout means for cutting out an area corresponding to the CG drawing area from the real image;
前記現実画像切り出し手段により切り出された現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出手段と、A shape area extracting means for extracting an area having a specific shape as a specific shape area from the real image cut out by the real image cutout means;
前記色領域抽出手段で抽出された色領域と、前記形状領域抽出手段で抽出された特定形状領域とに基づいて、前記現実画像と前記CG画像とを合成処理する合成手段とA combining unit configured to combine the real image and the CG image based on the color region extracted by the color region extracting unit and the specific shape region extracted by the shape region extracting unit;
を有することを特徴とする画像処理装置。An image processing apparatus comprising:
前記特定形状領域に連続し、かつ、前記特定の色範囲に含まれる色領域を特定形状周辺領域として抽出する形状周辺領域抽出手段を更に有し、A shape peripheral area extracting unit that extracts a color area that is continuous with the specific shape area and that is included in the specific color range as a specific shape peripheral area;
前記合成手段は、前記色領域抽出手段で抽出された色領域および前記形状領域抽出手段で抽出された特定形状領域に加えて、更に、前記形状周辺領域抽出手段で抽出された特定形状周辺領域に基づいて、前記合成処理を行うことを特徴とする請求項10に記載の画像処理装置。In addition to the color region extracted by the color region extraction unit and the specific shape region extracted by the shape region extraction unit, the synthesizing unit further adds a specific shape peripheral region extracted by the shape peripheral region extraction unit. The image processing apparatus according to claim 10, wherein the composition processing is performed based on the image processing.
前記特定形状領域における前記特定形状周辺領域に対する面積の比が一定値以上であるか否かを判定する形状周辺領域面積判定手段と、A shape peripheral region area determining means for determining whether a ratio of an area of the specific shape region to the specific shape peripheral region is a certain value or more;
前記面積の比が一定値以上である場合に、前記特定形状周辺領域のうち、前記特定形状領域の重心からの距離が遠い領域を削減処理する形状周辺領域削減手段とWhen the ratio of the areas is equal to or greater than a certain value, a shape peripheral area reduction unit that performs reduction processing of an area that is far from the center of gravity of the specific shape area among the peripheral areas of the specific shape;
を更に有し、Further comprising
前記合成手段は、前記特定形状周辺領域に基づく前記合成処理を行う際に、前記形状周辺領域削減手段で削減処理された特定形状周辺領域に基づく前記合成処理を行うことを特徴とする請求項11に記載の画像処理装置。12. The synthesizing unit, when performing the synthesizing process based on the specific shape peripheral area, performs the synthesizing process based on the specific shape peripheral area reduced by the shape peripheral area reducing unit. An image processing apparatus according to 1.
形状周辺領域面積判定手段は、前記面積の比として、前記特定形状領域における画素数と前記特定形状周辺領域における画素数との比を用いることを特徴とする請求項12に記載の画像処理装置。13. The image processing apparatus according to claim 12, wherein the shape peripheral area determination unit uses a ratio between the number of pixels in the specific shape area and the number of pixels in the specific shape peripheral area as the ratio of the areas. 前記形状周辺領域抽出手段は、前記特定形状周辺領域を抽出する際に、前記特定の色範囲に含まれる色領域にかえて、当該特定の色範囲とは異なる第2の色範囲に含まれる色領域を用いることを特徴とする請求項11乃至13のいずれか1項に記載の画像処理装置。The shape surrounding area extracting unit, when extracting the specific shape surrounding area, replaces the color area included in the specific color range with a color included in a second color range different from the specific color range. The image processing apparatus according to claim 11, wherein a region is used. 色領域抽出手段が、現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、A color region extracting step in which the color region extracting means extracts a color region included in a specific color range from the real image;
CG画像生成手段が、仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、A CG image generation step in which the CG image generation means generates a CG image based on the virtual scene data;
CG描画領域抽出手段が、前記CG画像の中から、前記仮想シーンデータのCGオブジェクトが描画されている領域をCG描画領域として抽出するCG描画領域抽出ステップと、A CG drawing area extracting means for extracting, from the CG image, an area in which the CG object of the virtual scene data is drawn as a CG drawing area;
現実画像切り出し手段が、前記現実画像の中から、前記CG描画領域に相当する領域を切り出す現実画像切り出しステップと、A real image cutout unit that cuts out an area corresponding to the CG drawing area from the real image;
形状領域抽出手段が、前記現実画像切り出しステップにより切り出された現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、A shape region extracting unit that extracts a region having a specific shape as a specific shape region from the real image cut out by the real image cutting step;
合成手段が、前記色領域抽出ステップで抽出された色領域と、前記形状領域抽出ステップで抽出された特定形状領域とに基づいて、前記現実画像と前記CG画像とを合成処理する合成ステップとA synthesis step for synthesizing the real image and the CG image based on the color region extracted in the color region extraction step and the specific shape region extracted in the shape region extraction step;
を有することを特徴とする画像処理方法。An image processing method comprising:
現実画像の中から、特定の色範囲に含まれる色領域を抽出する色領域抽出ステップと、A color region extraction step for extracting a color region included in a specific color range from a real image;
仮想シーンデータに基づいてCG画像を生成するCG画像生成ステップと、A CG image generation step for generating a CG image based on the virtual scene data;
前記CG画像の中から、前記仮想シーンデータのCGオブジェクトが描画されている領域をCG描画領域として抽出するCG描画領域抽出ステップと、A CG drawing area extracting step of extracting, from the CG image, an area where a CG object of the virtual scene data is drawn as a CG drawing area;
前記現実画像の中から、前記CG描画領域に相当する領域を切り出す現実画像切り出しステップと、A real image cutout step of cutting out an area corresponding to the CG drawing area from the real image;
前記現実画像切り出しステップにより切り出された現実画像の中から、特定の形状を有する領域を特定形状領域として抽出する形状領域抽出ステップと、A shape region extraction step for extracting a region having a specific shape as a specific shape region from the real image cut out by the real image cutting step;
前記色領域抽出ステップで抽出された色領域と、前記形状領域抽出ステップで抽出された特定形状領域とに基づいて、前記現実画像と前記CG画像とを合成処理する合成ステップとA synthesis step for synthesizing the real image and the CG image based on the color region extracted in the color region extraction step and the specific shape region extracted in the shape region extraction step;
をコンピュータに実行させるためのプログラム。A program that causes a computer to execute.
JP2008313476A 2008-12-09 2008-12-09 Image processing apparatus, image processing method, and program Expired - Fee Related JP5207941B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008313476A JP5207941B2 (en) 2008-12-09 2008-12-09 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008313476A JP5207941B2 (en) 2008-12-09 2008-12-09 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2010140093A JP2010140093A (en) 2010-06-24
JP5207941B2 true JP5207941B2 (en) 2013-06-12

Family

ID=42350212

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008313476A Expired - Fee Related JP5207941B2 (en) 2008-12-09 2008-12-09 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP5207941B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3530772B2 (en) * 1999-06-11 2004-05-24 キヤノン株式会社 Mixed reality device and mixed reality space image generation method
JP4537104B2 (en) * 2004-03-31 2010-09-01 キヤノン株式会社 Marker detection method, marker detection device, position and orientation estimation method, and mixed reality space presentation method

Also Published As

Publication number Publication date
JP2010140093A (en) 2010-06-24

Similar Documents

Publication Publication Date Title
US11961189B2 (en) Providing 3D data for messages in a messaging system
US20250316035A1 (en) Generating 3d data in a messaging system
US12231609B2 (en) Effects for 3D data in a messaging system
US9858473B2 (en) Makeup supporting device, makeup supporting method, and non-transitory computer-readable recording medium
JP5976103B2 (en) Generate an avatar that reflects the player&#39;s appearance
US9563975B2 (en) Makeup support apparatus and method for supporting makeup
JP6874772B2 (en) Image generator, image generator, and program
EP4136623A1 (en) Augmented reality content generators including 3d data in a messaging system
WO2021042134A1 (en) Generating 3d data in a messaging system
Goesele et al. Ambient point clouds for view interpolation
JP3810943B2 (en) Image processing apparatus, image processing method, and recording medium recording image processing program
CN111985344A (en) Information processing apparatus and method, and non-volatile computer-readable storage medium
KR102193638B1 (en) Method, system and non-transitory computer-readable recording medium for providing hair styling simulation service
CN114581987A (en) Image processing method, device, electronic device and storage medium
JP2009211513A (en) Image processing apparatus and method therefor
JP6402301B2 (en) Line-of-sight conversion device, line-of-sight conversion method, and program
JP4323910B2 (en) Image composition apparatus and method
CN112836545A (en) A 3D face information processing method, device and terminal
CN120186281A (en) Image processing method and device
JP5207941B2 (en) Image processing apparatus, image processing method, and program
CN109816586B (en) Image processing method, device, terminal equipment and storage medium
JP2003044841A (en) Model generation device, model generation method, and recording medium storing model generation program
JPH11175765A (en) Method and device for generating three-dimensional model and storage medium
US10866688B2 (en) Augmented reality tour guide
CN111083345B (en) Single photo generating apparatus and method and non-volatile computer readable medium thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20111201

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121011

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121023

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121225

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130219

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160301

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5207941

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160301

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees