JP3586880B2 - Image extraction apparatus and image extraction method - Google Patents

Image extraction apparatus and image extraction method Download PDF

Info

Publication number
JP3586880B2
JP3586880B2 JP04574294A JP4574294A JP3586880B2 JP 3586880 B2 JP3586880 B2 JP 3586880B2 JP 04574294 A JP04574294 A JP 04574294A JP 4574294 A JP4574294 A JP 4574294A JP 3586880 B2 JP3586880 B2 JP 3586880B2
Authority
JP
Japan
Prior art keywords
image
processing
signal
bat
screen
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
JP04574294A
Other languages
Japanese (ja)
Other versions
JPH07254064A (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP04574294A priority Critical patent/JP3586880B2/en
Publication of JPH07254064A publication Critical patent/JPH07254064A/en
Application granted granted Critical
Publication of JP3586880B2 publication Critical patent/JP3586880B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
本発明は、例えばテレビゲームなどにおいて、撮像された画面から、色信号に基づいて特定条件の画像領域を抽出する画像抽出装置及び画像抽出方法に関する。
【0002】
従来、この種の画像抽出装置としては、撮像された画面のうちの所定色、例えば鮮やかな青色の画像領域をクロマキーとして検出するクロマキー検出装置が知られている。
【0003】
このようなクロマキー検出装置は、テレビジョン撮影などにおいて画像を合成する目的などに使用されるほか、例えばユーザが持った所定色のバットの位置を順次クロマキー検出し、その検出位置に基づいて表示画像を制御するテレビゲームなどの画像制御装置にも応用することができる。
【0004】
【発明が解決しようとする課題】
しかし、従来のクロマキー検出装置は、単に撮像された画像のうち所定色の画像を検出するだけであり、例えば、上述したテレビゲームなどにおいて、バットなどの常に動く物体をクロマキー検出したい場合において、背景にバットと同じ色彩を有する対象物が存在する場合には、その対象物がバットなどとして検出されてしまい、目的とするクロマキー検出が行えなくなるおそれがあるという問題点を有していた。
【0005】
本発明の課題は、撮像された画面から、目的とする画像領域を正確に抽出できるようにすることにある。
【0006】
【課題を解決するための手段】
本発明の画像抽出装置は、予め抽出すべき所定色の画像領域を設定する設定手段と、撮像手段と、該撮像手段による撮像領域に含まれる所定色の画像領域を抽出する抽出手段とを備えた画像抽出装置において、上記撮像手段により撮像される撮像領域から上記設定手段によって設定された画像領域が有する所定色と同じ所定色が検知され続ける間、上記抽出手段による抽出動作を禁止すると共に、上記同じ所定色が検知されなくなると、上記抽出手段による抽出動作を開始させる制御手段(図34及び図35の動作フローチャートを実行する画像認識回路508及び図36〜図38の動作フローチャートを実行するCPU509)を備える。ここで、画像領域とは、例えばバットなどを持ったユーザの動作を順次撮像して得られるものである。また、上記の抽出動作を禁止している状態と、抽出動作を開始した後の状態は、例えばテレビゲームの例では、それぞれ、ゲーム開始前の状態と、ゲーム開始後の状態に対応する。
【0011】
加えて、出力すべきオブジェクト画面データを記憶する画像記憶手段(図5におけるアプリケーションROM514、DRAM507等)と、この画像記憶手段に記憶されたオブジェクト画面データの表示画面に出力される位置を指定する表示位置指定手段(図5におけるCPU509等)と、この表示位置指定手段により指定された位置に上記画像記憶手段に記憶されたオブジェクト画面データに対応する画像を出力するよう制御する出力制御手段(図8におけるオブジェクトコントロール回路803等)と、上記制御手段によって開始された上記抽出手段による抽出動作で抽出された所定色の画像領域の撮像された画面における位置と、上記オブジェクト画面データが表示される位置との位置関係を判断する判断手段(図10におけるステップ1006等を実行する画像認識回路508等)と、この判断手段による判断の内容に基づき、次に表示されるべき画面に対応する信号を生成する信号生成手段(図5におけるCPU509等)と、を更に有することも可能である。ここで、画像記憶手段は、オブジェクト画面データを複数記憶するように構成することができる。その場合、表示位置指定手段は、画像記憶手段に記憶された複数のオブジェクト画面データのうち少なくとも1つの種類を指定するように構成されてもよい。また、位置関係とは、例えば互いの位置の重なりである。
【0012】
また、撮像された画面の色信号に基づいてクロマキー信号を出力する信号出力手段(図7のビデオ信号変換回路505におけるクロマキー回路706等)を更に備えることも可能であり、この場合、上記制御手段によって開始される上記抽出手段による抽出動作とは、上記信号出力手段によって出力されたクロマキー信号を認識することによる、上記所定色の画像領域の抽出である。
【0013】
次に、本発明の画像抽出方法は、予め抽出すべき所定色の画像領域を設定し、撮像部にて撮像される領域に含まれる所定色の画像領域を抽出する画像抽出方法であって、上記撮像部にて撮像される撮像領域から予め設定された画像領域が有する所定色と同じ所定色が検知され続ける間、抽出動作を禁止すると共に、前記同じ所定色が検知されなくなると、抽出動作を開始させる(図34〜図38の動作フローチャート)ここで、上記の抽出動作を禁止している状態と、抽出動作を開始した後の状態は、例えばテレビゲームの例では、それぞれ、ゲーム開始前の状態と、ゲーム開始後の状態に対応する。
【0014】
この本発明の画像抽出方法において、撮像された画面の色信号に基づいてクロマキー信号を出力する信号出力ステップ(図10の画面認識回路の全体動作フローチャートにおけるステップ1003等)を更に含むことが可能であり、その場合、上記開始される抽出動作とは、上記信号出力ステップにて出力されたクロマキー信号を認識することによる、上記所定色の画像領域の抽出である。
【0020】
【作用】
本発明においては、例えばテレビゲームの開始前の状態である第1の状態(上記の抽出動作を禁止している状態)において、例えばバットなどの目的物を示す所定色の画像領域と同じ所定色が検知され続ける限り、上記第1の状態が維持され続ける。その後、上記所定色が検知されなくなると、上記第1の状態の維持が解除(上記の抽出動作が開始)され、例えばテレビゲームの開始後(進行中)の状態である第2の状態が開始され、バットなどの目的物を示す所定色の画像領域が順次得られていく。
【0025】
このようにすることで、撮像すべき対象が安定した状態に移行してから、すなわち、バットなどの目的物と同じ所定色を有する背景対象物が撮像範囲内からなくなってから、バットなどの目的物のみを示す所定色の画像領域を安定に抽出できる。
【0027】
更に、第2の状態において、バットを振るユーザなどの現実の情景を撮像して得られる画面から抽出された、バットなどの所定色の画像領域の位置と、オブジェクト画面データの表示画面上での位置との位置関係を判断し、その判断内容に基づき、次に表示されるべき画面に対応する信号が生成されるようにすれば、ユーザは、あたかも実際のプレーをするようにバットを振る動作などを行うことにより、CG画像などによって表示されるテレビゲームに参加することなどができる。
【0028】
この場合特に、撮像された画面からバットなどの特定の画像領域を抽出する際、クロマキーなどによる所定色の画像領域として抽出することによって、ユーザの動作を正確に把握することができる。
【0029】
【実施例】
以下、図面を参照しながら本発明の第1〜第4の実施例について詳細に説明する。
<実施例におけるユーザの動作の外観と実施例の動作原理>
第1〜第4の実施例の構成及び具体的な動作について説明する前に、これらの実施例におけるユーザの共通の動作の外観と実施例の共通の動作原理について、簡単に説明する。
【0030】
第1〜第4の実施例は本発明を野球のテレビゲームに適用したものである。
図1に示されるように、ユーザは、所定色例えば青色に塗られたバット101を持って構え、表示装置103にCG(コンピュータグラフィックス)画像104として表示される、投手が投げたCGによるボール105に向かって、バット101を振る。
【0031】
カメラ102は、バット101を持ったユーザが含まれる情景を撮像する。この撮像された画像から、上述の所定色に関するクロマキー信号が抽出されることにより、図2に示されるようなバット101の座標マップ202が作成され、更に、その座標マップ202上でのバット101の重心座標(図中×印)が検出される。そして、このバット101の座標マップ202及び重心座標と、予め記憶されている図2に示されるようなCGによるボール105の座標201及びその重心座標(図中×印)との位置関係203が判定されることにより、バット101とCGによるボール105の衝突発生の有無と、衝突が発生した場合におけるバット101の重心座標とCGによるボール105の重心座標との位置関係が抽出される。
【0032】
図2に示されるように、バット101にCGによるボール105が当ったと判定された場合において、バット101の重心座標とCGによるボール105の重心座標とのずれが所定の許容範囲内にある場合には、例えばユーザがホームランを打ったと判定されCG画像104がホームランに対応する画像に変化する。
【0033】
或いは、図3に示されるように、バット101にCGによるボール105が当ったと判定された場合において、CGによるボール105の重心座標がバット101の重心座標の下方にずれている場合には、例えばユーザがゴロを打ったと判定されCG画像104がゴロに対応する画像に変化する。
【0034】
更に、図4に示されるように、バット101にCGによるボール105が当ったと判定された場合において、CGによるボール105の重心座標がバット101の重心座標の上方にずれている場合には、例えばユーザがフライを打ったと判定されCG画像104がフライに対応する画像に変化する。
【0035】
このように、第1〜第4の実施例では、ユーザは、あたかも実際のプレーをするようにバット101を振ることにより、CG画像104によって表示されるテレビゲームに参加することができる。
<実施例の構成>
上述の動作を実現する第1〜第4の実施例の共通の具体的な構成について、以下に説明する。
【0036】
図5は、本発明の第1〜第4の実施例の共通の全体構成図である。
まず、クロックドライバー502は、ビデオ信号入出力回路503を介して発振器(OSC)504から入力するクロックに基づいて、図1のカメラ102内に設けられているCCD501の動作を直接制御すると共に、HSYNC信号及びVSYNC信号などの同期信号519を生成し、それをビデオ信号入出力回路503、VDP506、画像認識回路508、及びCPU509に供給する。従って、これらの回路は、同期信号519に基づいて、互いに同期して動作することができる。
【0037】
CCD501から出力されるCCD出力信号518は、ビデオ信号入出力回路503に入力される。
ビデオ信号入出力回路503は、CCD出力信号518をデジタルコンポジットビデオ入力信号520に変換する動作、ビデオ信号変換回路505からのデジタルコンポジットビデオ出力信号521をアナログコンポジットビデオ出力信号522に変換する動作を行う。
【0038】
ビデオ信号入出力回路503の構成を図6に示す。
図6において、CCD501(図5)からのCCD出力信号518は、サンプリング回路601によりアナログ的にサンプリングされる。
【0039】
サンプリング回路601の出力は、自動利得調整回路(AGC)602によって、その振幅レベルが調整される。
AGC602の出力は、γ補正回路603によって、光のパワーに対する信号レベルが所定のγ特性になるように変換される。
【0040】
γ補正回路603の出力は、8ビットA/D変換器604によって、8ビットのデジタルコンポジットビデオ入力信号520に変換される。このデジタルコンポジットビデオ入力信号520は、図5のビデオ信号変換回路505に出力される。
【0041】
一方、ビデオ信号変換回路505から出力される8ビットのデジタルコンポジットビデオ出力信号521は、8ビットD/A変換器605により、アナログコンポジットビデオ出力信号522に変換される。このアナログコンポジットビデオ出力信号522は、図1の表示装置103に出力される。この結果、表示装置103は、アナログコンポジットビデオ出力信号522に対応するCG画像104を表示する。
【0042】
図5に戻り、ビデオ信号変換回路505は、デジタルコンポジットビデオ入力信号520からクロマキー信号523を生成しそれを画像認識回路508へ出力する動作、画像認識回路508からのスーパーインポーズ信号525に基づき、ビデオ信号入出力回路503から入力されるデジタルコンポジットビデオ出力信号521に対応する色信号又はビデオディスプレイプロセッサ(VDP)506から出力されるデジタルRGB信号524の何かを選択し、選択された色信号に対応するデジタルコンポジットビデオ出力信号521を出力する動作を行う。
【0043】
ビデオ信号変換回路505の構成を図7に示す。
色分離フィルター701は、ビデオ信号入出力回路503(図5)から入力されるデジタルコンポジットビデオ入力信号520を入力し、その信号に対応するG(グリーン)信号、Cy(シアン)信号、及びYe(イエロー)信号の3種類の色信号を出力する。
【0044】
輪郭補正回路702は、上述の3種類の色信号を入力し、これらの色信号によって決定される画像の輪郭を補正する処理を行う。
輪郭補正回路702の出力のうち、G(グリーン)信号以外の信号は、ホワイトバランス回路703に入力される。ホワイトバランス回路703は、入力信号に対してホワイトバランスの調整を行う。
【0045】
ホワイトバランス回路703の出力は、選択フィルター704に入力される。選択フィルター704は、入力に対応するR(レッド)信号及びB(ブルー)信号を出力する。
【0046】
マトリクス回路705は、上述のR(レッド)信号、B(ブルー)信号と、輪郭補正回路702から出力されるG(グリーン)信号を入力し、これらに対し、次式で示される変換に対応する演算を実行することにより、輝度信号Yと、色差信号R−Y及びB−Yを出力する。
Y= ( 8/27)R+(16/27)G+( 1/9)B
R−Y= (15/27)R−(16/27)G−( 1/9)B
B−Y=−( 8/27)R−(16/27)G+( 8/9)B
クロマキー回路706は、図9に示されるように、色差信号R−Yが、最小値R−Yminから最大値R−Ymaxの範囲の値となり、かつ、色差信号B−Yが、最小値B−Yminから最大値B−Ymaxの範囲の値となったときに、論理値“1”を有するクロマキー信号523を出力する。このクロマキー信号523は、例えば、図1のバット101に対応する鮮やかなブルーを示す色信号が入力されたときに、論理値“1”を示す。このクロマキー信号523を用いることにより、後述する画像認識回路508(図5)は、ユーザが振るバット101の位置を検出することができ、バット101とCGによるボール105とが衝突したか否かを判定できる。
【0047】
次に、マトリクス回路708は、VDP506からのデジタルRGB信号524を入力し、それらに対応する輝度信号Yと、色差信号R−Y及びB−Yを出力する。
【0048】
選択回路707は、画像認識回路508(図5)からのスーパーインポーズ信号525に基づき、マトリクス回路705又は708の何れかの出力を選択し、変調回路709へ出力する。変調回路709は、入力に対応するデジタルコンポジットビデオ出力信号521を生成し出力する。第1〜第4の実施例では、画像認識回路508(図5)からのスーパーインポーズ信号525は、選択回路707に、マトリクス回路708の出力を常に選択させる仕様となっている。この結果、図1の表示装置103には、VDP506によって生成されるデジタルRGB信号524に対応するCG画像104が常に表示されることになる。但し、このスーパーインポーズ信号525を制御することにより、カメラ102の撮像結果に基づいて生成されるデジタルコンポジットビデオ入力信号520に対応する実画像とVDP506によって生成されるCG画像を合成し、その合成された画像を表示装置103に表示させることも可能である。
【0049】
図5に戻り、ビデオディスプレイプロセッサ(VDP)506は、CPU509からの指定に基づいて、CG画像104を構成するオブジェクト画面データ及びバックグランド画面データをDRAM507に随時記憶させ、CPU509からの指定に基づいて、それらのデータを指定された座標位置に配置し、その配置結果に対応するデジタルRGB信号524を生成して、ビデオ信号変換回路505へ出力する。この結果、ビデオ信号変換回路505は、前述したように、このデジタルRGB信号524に対応するデジタルコンポジットビデオ出力信号521を生成し、ビデオ信号入出力回路503が、そのデジタルコンポジットビデオ出力信号521に対応するアナログコンポジットビデオ出力信号522を生成することにより、表示装置103(図1)にCG画像104が表示されることになる。
【0050】
VDP506の構成を図8に示す。
CPU509からバス526上を転送されてくるオブジェクト画面データ及びバックグランド画面データは、CPUインタフェース回路801及びDRAMコントロール回路802を介して、DRAM507(図5)に記憶される。
【0051】
また、CPU509からバス526上を転送されてくるオブジェクトテーブルデータは、CPUインタフェース回路801及びオブジェクトコントロール回路803を介して、オブジェクトテーブルRAM804に記憶される。このオブジェクトテーブルデータは、DRAM507に記憶されている各オブジェクト画面データとそれぞれに対応するID番号との対応テーブルを示すテーブルである。CPU509は、時間経過と共に、各オブジェクト画面データのCG画像104(図1)上での表示位置を指定する場合に、各オブジェクト画面データに対応するID番号と、それぞれの表示位置を指定する。この結果、オブジェクトコントロール回路803は、指定されたID番号に対応するオブジェクト画面データをDRAMコントロール回路802を介してDRAM507から読み出し、ラインバッファRAM808に展開した後、その内容をRGB色差データ処理回路806に出力する。また、オブジェクトコントロール回路803は、CPU509からの指定に基づいて、現在表示しているボール105(図1)を示すオブジェクトの重心位置を、CPUインタフェース回路801からバス526を介してCPU509に通知する。
【0052】
一方、バックグランドコントロール回路805は、CPU509から指定されたバックグランド画面データを、RAMコントロール回路802を介してDRAM507から読み出し、そのデータに対して表示位置の制御又はスクロールの制御を行った後、RGB色差データ処理回路806に出力する。
【0053】
RGB色差データ処理回路806は、カラールックアップテーブルRAM807内のカラールックアップテーブルを参照することにより、オブジェクトコントロール回路803から指定されるオブジェクト画面データ及びバックグランドコントロール回路805から指定されるバックグランド画面データに対応するデジタルRGB信号524を生成し、それらをビデオ信号変換回路505(図5)に出力する。この場合、RGB色差データ処理回路806は、表示位置毎に、オブジェクト画面データとバックグランド画面データのどちらを表示させるかを決定するための制御も行う。そして、RGB色差データ処理回路806は、オブジェクト画面データを出力しているときには、オブジェクト画面データ出力中信号YSOBJ(以下、YSOBJ信号という)の論理値を“1”にし、バックグランド画面データを出力しているときには、バックグランド画面データ出力中信号YSBG(以下、YSBG信号という)の論理値を“1”にする。YSOBJ信号及びYSBG信号は、画像認識回路508へ出力される。
【0054】
図5に戻り、画像認識回路508は、同期信号519に同期して決定されるフレーム周期毎に、ビデオ信号変換回路505から入力される1フレーム分のクロマキー信号523を内部の2つのクロマキー信号用バッファに交互に保持し、同時に、VDP506内のRGB色差データ処理回路806から出力される1画面マップ(後述する)分のYSOBJ信号を内部の2つのYSOBJ信号用バッファに交互に保持する。これと共に、画像認識回路508は、前回のフレーム周期において2つのクロマキー信号用バッファのうちの1つに保持された1フレーム分のクロマキー信号523に基づいて、ユーザが振るバット101(図1)の位置を示す画面マップを作成する。そして、画像認識回路508は、この処理の過程において、画面マップ上の現在処理中のブロック位置(後述する)にバット101が存在すると判定した場合には、前回のフレーム周期において2つのYSOBJ信号用バッファのうちの1つに保持された1画面マップ分のYSOBJ信号において、上記ブロック位置に対応するYSOBJ信号の論理値が“1”であるか否か、即ち、バット101が存在すると判定された現在のブロック位置にボール105(図1)を示すオブジェクト画面データが存在するか否かを判定する。このようにして、画像認識回路508は、バット101とボール105との衝突の有無を検出する。また、画像認識回路508は、1画面分の画面マップの作成が終了する毎に画面マップ上のバット101の重心位置を計算し、計算結果をバス526を介してDRAM510に記憶すると共に、衝突状態を検出した場合には、CPU509への割込みフラグとして、衝突フラグをセットする。
【0055】
CPU509は、OS ROM511に記憶されたオペレーティングシステムに従って動作し、特には図示しないスロットに挿入されたアプリケーションカートリッジ513内のアプリケーションROM514(#1又は#2の何れか)からDRAM510上のプログラム領域にアプリケーションプログラムをロードすることにより、第1〜第4の実施例で説明している野球ゲームなどのテレビゲームを実行する。この場合に、CPU509は、特には図示しないスタートスイッチ及びストップスイッチなどから入力されるキースキャン信号527を処理しながら、時間経過と共に、アプリケーションカートリッジ513内のアプリケーションROM514からCG画像104(図1)を構成するオブジェクト画面データ及びバックグランド画面データなどを順次読み出し、同期信号519に同期した垂直ブランキング期間内に、それらのデータをバス526からVDP506を介してDRAM507などに転送する。
【0056】
同時に、CPU509は、時間経過と共に、DRAM507に転送した各オブジェクト画面データのCG画像104(図1)上での表示位置を、VDP506に対して順次指定する。
【0057】
また、CPU509は、画像認識回路508が衝突状態を検出したことを示す衝突フラグをセットしたタイミングで、衝突フラグ割込み処理を実行する。この割込み処理において、CPU509は、DRAM510に記憶されている画像認識回路508が計算した画面マップ上のバット101の重心位置と、VDP506内のオブジェクトコントロール回路803から取得した現在表示されているボール105(図1)を示すオブジェクトの重心位置との位置関係を判定する。そして、その判定結果に基づき、CPU509は、必要な画像処理を実行する。
【0058】
更に、CPU509は、アプリケーションカートリッジ513内の音源回路515に必要なデータを順次転送することにより、音源回路515に楽音信号の生成を行わせる。また、CPU509は、必要に応じて、本体内の音源回路516に対しても、楽音信号の生成を行わせる。音源回路515で生成された楽音信号は、CPU509及び音源回路516を介して、アンプ517に送られ、ここで増幅された後、特には図示しないスピーカに、音声出力信号528として出力される。
【0059】
加えて、CPU509は、アプリケーションカートリッジ513が模造されたものでないか否かの検査処理も行う。
次に、上述した構成を有する実施例の具体的な動作につき、以下に順次説明する。
<第1の実施例の具体的な動作>
まず、第1の実施例の具体的な動作につき説明する。
【0060】
図10は、画像認識回路508が特には図示しないメモリに記憶されたプログラムを実行する動作として実現される、全体動作フローチャートである。
画像認識回路508は、ビデオ信号変換回路505からのクロマキー信号523に基づいて、ユーザが振るバット101(図1)の位置を示す画面マップを作成し、これに基づいて、VDP506からYSOBJ信号として供給される図1のボール105を示すオブジェクト画面データとバット101との衝突の有無を検出する。
【0061】
ここで、図5のCCD501における1画面分の撮像単位であるフレームは、図26に示されるように、水平方向576列×垂直方向192行からなる構成を有する。従って、ビデオ信号変換回路505から出力されるクロマキー信号523は、576×192画素分の論理値を示す信号となっている。そして、処理負荷を軽減するため、画像認識回路508は、図26に示されるように、クロマキー信号523における水平方向6画素×垂直方向2画素からなる合計12画素分の論理値を、1つの論理値に圧縮する処理を行う。この論理値が格納される単位をブロックと呼ぶ。この結果、図26に示されるように、クロマキー信号523における576×192画素分の論理値が、水平方向96列×垂直方向96行分のブロックの論理値に圧縮されることになる。このような96×96ブロック分の論理値の集合によって、クロマキーに関する画面マップが定義される。
【0062】
一方、YSOBJ信号及びYSBG信号によって特定されるオブジェクト画面データ及びバックグランド画面データは、水平方向96列×垂直方向96行の解像度で表現されており、従って、VDP506からこれらの画面データに基づいてデジタルRGB信号524が生成される際には、これらの画面データが表示装置103(図1)の表示解像度に合せて伸張される。
【0063】
図10において、まず、ステップ1001で、画像認識回路508内の特には図示しないRAM(後述する図27参照)の内容がイニシャライズされる。
次に、電源投入後、ステップ1002で、初期画面マップが作成済みでないと判定された場合には、ステップ1003で、初期画面マップ作成処理が実行される。
【0064】
初期画面マップとは、図1のカメラ102によって撮像される、バット101を持ったユーザが存在しない情景についてのクロマキーに関する画面マップである。初期画面マップを作成する目的は、後述する処理画面マップとしてバット101に対応するクロマキーが検出されるときに、バット101と同じ色彩の対象物が背景に存在する場合にその背景がバット101の誤った位置として検出されてしまうことを防止するために、バット101と同じ色彩の背景対象物の位置を予め検出しておくことにある。後述するステップ1005の処理画面マップ作成処理では、図1のカメラ102がバット101を持ったユーザが存在する情景を撮像した結果に基づいてフレーム周期毎に処理画面マップが作成されるが、第1の実施例においては、処理画面マップ上でクロマキーに関する部分として認識される位置が、同時に、初期画面マップ上でバット101と同じ色彩を有する背景対象物が存在する位置として認識されている場合には、その位置にはバット101は存在しないものとして処理されることになる。
【0065】
ステップ1003の初期画面マップ作成処理が実行される結果、画像認識回路508内の特には図示しないRAM上に、図27に示されるデータフォーマットで、96×96ブロックのサイズを有する初期画面マップが作成される。なお、このRAMは、16ビットを1ワードとしてデータを記憶するため、1行分の論理値は6ワード(=96/16)のデータとして記憶される。従って、RAM上では、初期画面マップは、6×96ワード分のデータ領域を占有する。
【0066】
ステップ1003の初期画面マップ作成処理の詳細な動作フローチャートを図11に示す。
以下の処理では、初期画面マップを安定して取得するために、複数フレーム分(複数画面分)のクロマキー信号523について処理が繰り返し実行され、画面マップ上のブロック位置毎に各繰返し処理で得られる論理値の論理和(OR)が演算されることによって、ブロック位置毎の最終的な論理値が決定される。そのために、ステップ1101で処理の繰返し回数であるサンプリング回数が設定され、後述するステップ1114の判定がYESとなって1フレーム分の処理が終了する毎に、レジスタnの値が設定回数に達したと判定されるまで、ステップ1116でレジスタnの値が+1ずつインクリメントされ、ステップ1102〜ステップ1114で示されるフレーム毎の処理が実行される。
【0067】
ここで、特には図示しないが、前述したように、画像認識回路508は、それぞれ図26(a) に示されるサイズを有するクロマキー信号用バッファを2フレーム分(2画面分)有しており、同期信号519(図5)に同期して決定されるフレーム周期毎に、ビデオ信号変換回路505から入力される図26(a) に示される1フレーム分のクロマキー信号523を、上述の2つのクロマキー信号用バッファに交互に保持する。そして、図11のステップ1102〜ステップ1114で示されるフレーム毎の処理は、前回のフレーム周期において2つのクロマキー信号用バッファのうちの1つに保持された1フレーム分のクロマキー信号523に対して実行される。このとき同時に、他方のクロマキー信号用バッファには、現在のフレーム周期に対応するクロマキー信号523が順次入力されている。そして、ステップ1114の判定がNOとなる毎に、処理対象となるクロマキー信号用バッファが切り替えられる。
【0068】
なお、図26(a) に示されるサイズを有する1つのクロマキー信号用バッファは、各画素に対応してクロマキー信号523の“0”又は“1”の論理値を記憶する1ビットのデータを記憶できればよいから、1ビット×576×192=110592ビット=6912ワードの記憶容量を有すればよい。
【0069】
次に、ステップ1102〜ステップ1114で示されるフレーム毎の処理の詳細について説明する。
始めに、ステップ1102で、生成される初期画面マップの水平方向の列位置を示すレジスタXと垂直方向の行位置を示すレジスタYの値が0にリセットされた後、ステップ1113でレジスタXの値がクリアされると共にレジスタYの値が+1ずつインクリメントされながら、ステップ1114でレジスタYの値が96に達した(95を越えた)と判定されるまで、ステップ1103〜ステップ1112→ステップ1113→ステップ1114→ステップ1103の処理が繰り返し実行される。このようにして、初期画面マップにおける96行分の処理が実行される。
【0070】
また、ステップ1111でレジスタXの値が+1ずつインクリメントされながら、ステップ1112でレジスタXの値が96に達した(95を越えた)と判定されるまで、ステップ1103〜ステップ1112→ステップ1103の処理が繰り返し実行される。このようにして、初期画面マップにおける1行内の96ブロック分の処理が実行される。
【0071】
そして、レジスタXとYの現在値毎に実行されるステップ1103〜ステップ1110が、初期画面マップにおける1ブロック分の処理ということになる。以下の説明では、レジスタXとYのそれぞれの現在値を単にX、Yと記載し、現在のXとYの各値によって特定されるブロックを処理対象ブロックと呼ぶ。
【0072】
ステップ1103においては、処理対象となっているクロマキー信号用バッファから、水平方向に列位置(6X+1)〜(6X+6)、垂直方向に行位置(2Y+1)及び(2Y+2)におけるクロマキー信号523の各論理値が読み出される。例えば、X=0、Y=0なら、水平方向に列位置1〜6、垂直方向に行位置1及び2におけるデータ(図26(a) のブロック1)が読み出される。また、X=1、Y=0なら、水平方向に列位置7〜12、垂直方向に行位置1及び2におけるデータ(図26(a) のブロック2)が読み出される。更に、X=0、Y=1ならば、水平方向に列位置1〜6、垂直方向に行位置3及び4におけるデータ(図26(a) のブロック97)が読み出される。
【0073】
ステップ1104では、ステップ1103で読み出された処理対象ブロック内の12画素分のクロマキー信号523の論理値のうち、論理値“1”が6画素分以上あるか否かが判定される。
【0074】
ステップ1104の判定がYESなら、ステップ1105で所定のレジスタに処理対象ブロックに対応する論理値として“1”がセットされ、ステップ1104の判定がNOなら、ステップ1106で上記レジスタに論理値として“0”がセットされる。
【0075】
そして、ステップ1107で、現在の処理が、初期画面マップを作成するための前述した複数フレーム分の処理のうち最初のフレーム内の処理であると判定された場合は、ステップ1110において、ステップ1105又はステップ1106で所定のレジスタにセットされた処理対象ブロックの論理値が、RAM(図27)内の初期画面マップ領域における水平方向にX列目、垂直方向にY行目の処理対象ブロックに対応するアドレスに、そのまま書き込まれる。
【0076】
一方、ステップ1107で、現在の処理が、上記複数フレーム分の処理のうち2つ目以降のフレーム内の処理であると判定された場合には、RAM(図27)内の初期画面マップ領域における水平方向にX列目、垂直方向にY行目の処理対象ブロックに対応するアドレスの論理値が読み出され、その論理値と、ステップ1105又はステップ1106で所定のレジスタにセットされた処理対象ブロックの論理値とで、論理和(OR)が演算され、上記所定のレジスタの内容がその演算結果に書き換えられる。その後、ステップ1110において、RAM(図27)内の初期画面マップ領域における水平方向にX列目、垂直方向にY行目の処理対象ブロックに対応するアドレスの内容が、上記レジスタにセットされた論理値に書き換えられる。
【0077】
以上のステップ1103〜ステップ1110の処理が、前述したようにして、初期画面マップの96×96ブロック分について繰り返されて1フレーム分の初期画面マップが作成され、更にそのような初期画面マップが複数フレーム分作成され、各ブロック位置毎にフレーム間で論理和が演算されることにより、最終的に、RAM(図27)に1画面分の初期画面マップが得られ、図10のステップ1003の処理を終了する。
【0078】
なお、ステップ1003の初期画面マップ作成処理は、ステップ1002で初期画面マップが作成済みでないと判定された場合に自動的に実行されるように構成されているが、例えばユーザが図1のカメラ102で撮像されない位置で特には図示しない所定のセットボタンを押したタイミングでステップ1003の初期画面マップ作成処理が実行されるように構成してもよい。
【0079】
次に、同期信号519(図5)によって決定されるフレーム周期に同期して、図10のステップ1004〜ステップ1015の処理が繰り返し実行される。ここでは主に、ユーザが振るバット101(図1)の位置を示す処理画面マップと後述するステップ1011で実行される重心計算処理に必要なデータを順次作成する処理画面マップ作成処理(ステップ1005)、この処理によりバット101の存在が検出されたブロック位置にボール105(図1)を示すオブジェクト画面データが存在するか否かを判定する衝突座標検出処理(ステップ1006)、処理画面マップ上のバット101の重心位置を計算する重心計算処理(ステップ1011)、及びバット101とボール105とが衝突したと判定された場合に、CPU509への割込みフラグとして、衝突フラグをセットする処理(ステップ1013)が実行される。
【0080】
この場合、特には図示しないが、前述したように、画像認識回路508は、それぞれ図26(a) に示されるサイズを有するクロマキー信号用バッファを2フレーム分(2画面分)有しており、同期信号519(図5)に同期して決定されるフレーム周期毎に、ビデオ信号変換回路505から入力される図26(a) に示される1フレーム分のクロマキー信号523を、2つのクロマキー信号用バッファに交互に保持する。また、特には図示しないが、前述したように、画像認識回路508は、それぞれ図26(b) に示されるサイズを有するYSOBJ信号用バッファを2画面マップ分有しており、同期信号519(図5)に同期して決定されるフレーム周期毎に、VDP506内のRGB色差データ処理回路806から出力される1画面マップ分のYSOBJ信号を2つのYSOBJ信号用バッファに交互に保持する。そして、図10のステップ1004〜ステップ1015で示されるフレーム毎の処理は、前回のフレーム周期において2つのクロマキー信号用バッファのうちの1つに保持された1フレーム分のクロマキー信号523、及び同じく前回のフレーム周期において2つのYSOBJ信号用バッファのうちの1つに保持された1画面マップ分のYSOBJ信号に対して、実行される。このとき同時に、他方のクロマキー信号用バッファ及びYSOBJ信号用バッファのそれぞれには、現在のフレーム周期に対応するクロマキー信号523及びYSOBJ信号がそれぞれ順次入力されている。そして、ステップ1015の処理が終了する毎に、処理対象となるクロマキー信号用バッファ及びYSOBJ信号用バッファが切り替えられる。
【0081】
図10において、ステップ1005の処理画面マップ作成処理とステップ1006の衝突座標検出処理は、ブロック位置(図26参照)毎に実行される。
従って、図11で説明した初期画面マップ作成処理の場合と同様に、まず、ステップ1004で、生成される処理画面マップの水平方向の列位置を示すレジスタXと垂直方向の行位置を示すレジスタYの値が0にリセットされた後に、ステップ1009でレジスタXの値がクリアされると共にレジスタYの値が+1ずつインクリメントされながら、ステップ1010でレジスタYの値が96に達した(95を越えた)と判定されるまで、ステップ1005〜ステップ1008→ステップ1009→ステップ1010→ステップ1005の処理が繰り返し実行される。このようにして処理画面マップにおける96行分の処理が実行される。
【0082】
また、ステップ1007でレジスタXの値が+1ずつインクリメントされながら、ステップ1008でレジスタXの値が96に達した(95を越えた)と判定されるまで、ステップ1005〜ステップ1008→ステップ1005の処理が繰り返し実行される。このようにして、処理画面マップにおける1行内の96ブロック分の処理が実行される。
【0083】
そして、レジスタXとYの現在値毎に実行されるステップ1005の処理画面マップ作成処理とステップ1006の衝突座標検出処理が、処理画面マップにおける1ブロック分の処理ということになる。
【0084】
なお、ステップ1004においては、後述するステップ1005の処理画面マップ作成処理で使用される図27のRAMに記憶される上端座標と左端座標の値が97に初期化され、同じく下端座標と右端座標の値が0に初期化され、また、同じく処理画面マップ作成処理で使用される重心計算処理用データS_M、S_MxX、及びS_MyYの値が0に初期化される。なお、これらのデータは、図27のRAMと同じRAM内の特には図示しないワーク領域に確保される。
【0085】
以下の説明では、レジスタXとYのそれぞれの現在値を単にX、Yと記載し、現在のXとYの各値によって特定されるブロックを処理対象ブロックと呼ぶ。
ステップ1005の処理画面マップ作成処理の詳細な動作フローチャートを図12及び図13に示す。ここでは、図27に示されるRAMに記憶される処理画面マップを作成する処理と、同じく図27に示されるRAMに記憶されるバット101の存在範囲を示す上端座標、下端座標、左端座標、及び右端座標を検出する処理、並びに、バット101の重心座標を求めるためのデータを計算する処理が実行される。
【0086】
まず、ステップ1201においては、処理対象となっているクロマキー信号用バッファから、水平方向に列位置(6X+1)〜(6X+6)、垂直方向に行位置(2Y+1)及び(2Y+2)におけるクロマキー信号523の各論理値が読み出される。初期画面マップ作成処理の場合と同様に、例えば、X=0、Y=1なら、水平方向に列位置1〜6、垂直方向に行位置3及び4におけるデータ(図26(a) のブロック97)が読み出される。
【0087】
ステップ1202では、ステップ1201で読み出された処理対象ブロック内の12画素分のクロマキー信号523の論理値のうち、論理値“1”が6画素分以上あるか否かが判定される。
【0088】
ステップ1202の判定がYESで、かつステップ1203で特には図示しないリジェクトスイッチがオフなら、ステップ1206で所定のレジスタに処理対象ブロックに対応する論理値として“1”がセットされ、ステップ1202の判定がNOなら、ステップ1207で上記レジスタに論理値として“0”がセットされる。
【0089】
ここで、リジェクトスイッチは、ユーザによって操作される。処理画面マップ上でクロマキーに関する部分として認識される位置が、同時に、初期画面マップ上でバット101と同じ色彩を有する背景対象物が存在する位置として認識されている場合に、その位置にはバット101は存在しないものとして処理することをユーザが希望する場合には、ユーザはこのスイッチをオンする。
【0090】
そして、ステップ1202の判定がYES、即ち、処理対象ブロックがクロマキーに関する部分として認識される場合において、ステップ1203で特には図示しないリジェクトスイッチがオンされていると判定される場合は、ステップ1204で、RAM(図27)内の初期画面マップ領域から、水平方向にX列目、垂直方向にY行目の処理対象ブロックと同じブロック位置の論理値が読み出される。
【0091】
続いて、ステップ1205では、その論理値が“1”であるか否かが判定される。
ステップ1205の判定がYES、即ち、処理画面マップ上でクロマキーに関する部分として認識される処理対象ブロックの位置が、同時に、初期画面マップ上でバット101と同じ色彩を有する背景対象物が存在する位置として認識されている場合は、ステップ1207で前述の所定のレジスタに論理値として“0”がセットされることにより、そのブロック位置にはバット101は存在しないものとして処理される。
【0092】
一方、ステップ1205の判定がNO、即ち、処理画面マップ上でクロマキーに関する部分として認識される処理対象ブロック位置が、初期画面マップ上ではバット101と同じ色彩を有する背景対象物が存在する位置として認識されていない場合は、ステップ1206で前述した所定のレジスタに論理値として“1”がセットされることにより、そのブロック位置にはバット101は存在するものとして処理される。
【0093】
ステップ1207の処理の後、即ち、処理画面マップ上でバット101が存在しないと認識された処理対象ブロックについては、後述する図13のステップ1219が実行される。
【0094】
一方、ステップ1206の処理の後、即ち、処理画面マップ上でバット101が存在すると認識された処理対象ブロックについては、更に図13のステップ1208〜ステップ1218が実行される。ここでは、処理画面マップ上でのバット101の存在範囲を示す図27のRAMに記憶される上端座標、下端座標、左端座標、及び右端座標を更新する処理、並びに、バット101の重心座標を求めるためのデータを計算する処理が実行される。
【0095】
即ち、まず、ステップ1208で、値(Y+1)が、RAM(図27)に記憶されている上端座標の値よりも小さいか否かが判定され、この判定がYESならば、ステップ1209で、上端座標の値が値(Y+1)に書き換えられる。
【0096】
ステップ1209の後又はステップ1208の判定がNOの場合には、ステップ1210で、値(Y+1)が、RAM(図27)に記憶されている下端座標の値よりも大きいか否かが判定され、この判定がYESならば、ステップ1211で、下端座標の値が値(Y+1)に書き換えられる。
【0097】
ステップ1211の後又はステップ1210の判定がNOの場合には、ステップ1212で、値(X+1)が、RAM(図27)に記憶されている左端座標の値よりも小さいか否かが判定され、この判定がYESならば、ステップ1213で、左端座標の値が値(X+1)に書き換えられる。
【0098】
ステップ1213の後又はステップ1212の判定がNOの場合には、ステップ1214で、値(X+1)が、RAM(図27)に記憶されている右端座標の値よりも大きいか否かが判定され、この判定がYESならば、ステップ1215で、右端座標の値が値(X+1)に書き換えられる。
【0099】
以上のステップ1208〜ステップ1215の処理により、処理画面マップ上で論理値“1”を有するブロックの範囲において、例えば図28に示されるように、その範囲を示す上端座標、下端座標、左端座標、及び右端座標が図27のRAMに得られる。この値は、同時に、図5のDRAM510に転送される。
【0100】
ステップ1215の後又はステップ1214の判定がNOの場合には、ステップ1216で、データS_Mの値が+1だけインクリメントされると共に、ステップ1217で、データS_MxXの値がXだけインクリメントされ、同様にステップ1218で、データS_MyYの値がYだけインクリメントされる。これらのデータから重心座標を求める原理については後述する。
【0101】
ステップ1218の処理の後又は前述したステップ1207(図12)の処理の後は、ステップ1219で、図27に示されるRAM内の処理画面マップ領域における水平方向にX列目、垂直方向にY行目の処理対象ブロックに対応するアドレスの内容が、前述したステップ1206又はステップ1207において所定のレジスタにセットされた論理値に書き換えられる。
【0102】
以上の図12及び図13の動作フローチャートで示される図10のステップ1005の処理画面マップ作成処理が、ステップ1005〜ステップ1010の繰返し処理の一部として実行されることにより、フレーム周期毎に図27に示されるRAMに1画面分の処理画面マップが作成され、同じく図27に示されるRAMにバット101の存在範囲を示す上端座標、下端座標、左端座標、及び右端座標が得られ、更に、図27に示されるRAM上の特には図示しない領域にデータS_M、S_MxX、及びS_MyYが得られる。
【0103】
次に、図10のステップ1006の衝突検出処理の詳細な動作フローチャートを図14に示す。
まず、ステップ1401で、RAM(図27)内の処理画面マップ領域から、水平方向にX列目、垂直方向にY行目の処理対象ブロックの論理値が読み出される。
【0104】
ステップ1402では、その論理値が“1”であるか否か、即ち、処理対象ブロックの位置に、バット101が存在するか否かが判定される。
ステップ1402の判定がNOの場合には、そのまま図14の衝突検出処理を終了し、図10の動作フローチャートに戻って次のブロック位置に対する処理が続行される。
【0105】
ステップ1402の判定がYESの場合には、ステップ1403で、処理対象となっているYSOBJ信号用バッファから、水平方向にX列目、垂直方向にY行目の処理対象ブロックに対応するYSOBJ信号(CGデータ)の論理値が読み出される。
【0106】
ステップ1404では、読み出されたYSOBJ信号の論理値が“1”であるか否か、即ち、処理対象ブロックにボール105(図1)を示すオブジェクト画面データが存在するか否かが判定される。
【0107】
ステップ1404の判定がNOならば、そのまま図14の衝突検出処理を終了し、図10の動作フローチャートに戻って次のブロック位置に対する処理が続行される。
【0108】
ステップ1404の判定がYESなら、ステップ1405で、所定の衝突レジスタの値が“0”であるか否か、即ち、今まで衝突が検出されておらず今回の衝突検出が初めてであるか否かが判定される。
【0109】
ステップ1405の判定がYESの場合には、ステップ1406とステップ1407で、図27のRAM内に保持される最初の衝突座標のX座標とY座標がレジスタX及びYの各値に更新される。続いて、ステップ1408で、衝突レジスタの値が、衝突が発生したことを示す値“1”にセットされる。その後、図14の衝突検出処理を終了し、図10の動作フローチャートに戻って次のブロック位置に対する処理が続行される。
【0110】
一方、ステップ1405の判定がNOの場合には、ステップ1409とステップ1410で、図27のRAM内に保持される最後の衝突座標のX座標とY座標がレジスタX及びYの各値に更新される。その後、図14の衝突検出処理を終了し、図10の動作フローチャートに戻って次のブロック位置に対する処理が続行される。
【0111】
以上の図14の動作フローチャートで示される図10のステップ1006の衝突検出処理が、ステップ1005〜ステップ1010の処理の繰返しに基づいて処理画面マップの全範囲に渡って実行されることにより、衝突の有無と衝突が発生した処理画面マップ上のブロック範囲が検出される。
【0112】
次に、図10のステップ1011の重心計算処理は、1フレーム周期に1回、即ち、1画面分の処理画面マップの作成が終了しステップ1010の判定がYESとなる毎に実行される。この処理では、RAM(図27)に記憶された処理画面マップ上のバット101の重心位置が計算される。
【0113】
一般に、2次元座標上に存在する領域の重心のx座標XG及びy座標YGは、次の数1式及び数2式によって計算することができる。
【0114】
【数1】
XG=Σ(mxi・x)/Σmxi=Σ(mxi・x)/M
【0115】
【数2】
YG=Σ(myj・y)/Σmyj=Σ(myj・y)/M
ここで、サフィックスiとjはそれぞれ列方向(x方向)及び行方向(y方向)の重心計算領域の各位置であり、xとyはそれぞれ列方向位置iと行方向位置jにおけるx座標値とy座標値であり、mxiとmyjはそれぞれ列方向位置iと行方向位置jにおける質量の総和である。また、Mは、2次元座標上に存在する領域の質量の総和である。
【0116】
ここで、x座標値及びy座標値が前述したブロックを単位とする値である場合には、mxi及びmyjはそれぞれ列方向ブロック位置i及び行方向ブロック位置jにおけるブロックの総数に等価である。そして、前述した図10のステップ1005に対応する図12及び図13の処理画面マップ作成処理において、数1式及び数2式における分母項である質量Mは、図13のステップ1216において面積S_Mとして計算され、数1式における項Σ(mxi・x)は、図13のステップ1217の繰返しによってデータS_MxXとして計算され、数2式における項Σ(myj・y)は、図13のステップ1218の繰返しによってデータS_MyYとして計算されている。
【0117】
上述のデータS_M、S_MxX、S_MyY、並びに数1式と数2式の計算式に基づく図10のステップ1011の重心計算処理の更に詳細な動作フローチャートを図15に示す。
【0118】
即ち、ステップ1501で、数1式及び数2式に対応する以下の数3式及び数4式によって、処理画面マップ上に存在するバット101の重心座標(XG、YG)が得られる。
【0119】
【数3】
XG=S_MxX/S_M
【0120】
【数4】
YG=S_MyY/S_M
例えば、図28に示される例では、次式の計算が実行されることにより、重心座標(XG、YG)=(32.6、16.1)が得られる。
【0121】

Figure 0003586880
以上の図15の動作フローチャートで示される図10のステップ1011の重心計算処理の後、図10のステップ1012で、衝突レジスタの値が“1”になっているか否かが判定される。このレジスタの値は、前述したステップ1006の衝突座標検出処理において、処理画面マップ上のバット101の存在を示す論理値が“1”であるブロックが1つでも、ボール105の存在を示すYSOBJ信号と重なっている場合に、“1”にセットされる(図14のステップ1408参照)。
【0122】
そして、ステップ1012の判定がYESの場合は、ステップ1013で、図5のCPU509への割込みフラグである衝突フラグが“1”にセットされる。この結果、CPU509において後述する衝突フラグ割込み処理(図20)が発生し、この割込み処理において、図1のバット101がボール105に当ったことに対応して表示装置103に表示されるCG画像104を制御する処理が実行される。なお、画像認識回路508は、上述の衝突フラグのセット処理と共に、ステップ1011で計算した重心座標(XG、YG)を、図5のDRAM507に転送する。また、画像認識回路508は、ステップ1006の衝突座標検出処理によってRAM(図26)に記憶した最初の衝突座標及び最後の衝突座標、並びに、ステップ1005の処理画面マップ作成処理によって上述のRAMに記憶した上端座標、下端座標、左端座標、及び右端座標を、必要に応じて、DRAM507に転送する。
【0123】
ステップ1013の処理の後は、ステップ1014で、衝突フラグが“0”に戻ったか否かが判定される。この衝突フラグの値は、CPU509が実行する後述する衝突フラグ割込み処理が終了する時点で“0”に戻される。この結果、例えばホームラン画像が進行している複数フレーム周期の間は、図5の画像認識回路508は図10の動作フローチャートの処理をステップ1014より先に進めないことになる。なお、衝突フラグ割込み処理が実行されている間にも、ステップ1004〜ステップ1015の処理をフレーム周期に同期して進行させる構成にし衝突レジスタの値に応じてCPU509に更に別の割込みがかけられるようにしてもよい。
【0124】
衝突フラグの値が“0”に戻りステップ1014の判定がYESとなると、ステップ1015で衝突レジスタの値も“0”に戻される。
ステップ1015の処理の後又はステップ1012の判定がNOであった場合には、次のフレーム周期の開始時点に同期してステップ1004の処理に戻る。この場合、前述したように、処理対象となるクロマキー信号用バッファ及びYSOBJ信号用バッファが変更される。
【0125】
次に、図16及び図17は、図5のCPU509が実行するCPU処理の動作フローチャートである。
CPU509は、基本的には、特には図示しないスタートスイッチ及びストップスイッチなどから入力されるキースキャン信号527を処理しながら、時間経過と共に、アプリケーションカートリッジ513内のアプリケーションROM514からCG画像104(図1)を構成するオブジェクト画面データ、オブジェクトテーブルデータ、及びバックグランド画面データを順次読み出し、同期信号519に同期した垂直ブランキング期間内に、それらのデータをバス526からVDP506に転送し、更に時間経過と共に、DRAM507に転送した各オブジェクト画面データのCG画像104(図1)上での表示位置を、VDP506に対して順次指定する。
【0126】
図16において、まず、ステップ1601では、図5のDRAM507の内容などがイニシャライズされる。
ステップ1602では、後述する各種割込み処理が許可される。
【0127】
ステップ1603では、特には図示しないスロットに挿入された図5のアプリケーションカートリッジ513内のアプリケーションROM514(#1又は#2の何れか)から、図5のDRAM510上のプログラム領域にアプリケーションプログラムがロードされる。以下、CPU509は、このアプリケーションプログラムに従って、ステップ1604以降の動作を実行する。
【0128】
ステップ1604では、CPU509内のDMAC(ダイレクトメモリアクセスコントローラ)に、CG画像104(図1)を構成するバックグランド画面データのアプリケーションカートリッジ513内のアプリケーションROM514上での読出し開始アドレスと読出しデータ数がセットされる。
【0129】
ステップ1605では、上記DMACに、CG画像104(図1)を構成する最初のオブジェクト画面データの上記アプリケーションROM514上での読出し開始アドレスと読出しデータ数がセットされる。
【0130】
ステップ1606では、上記DMACに、オブジェクトテーブルデータの上記アプリケーションROM514上での読出し開始アドレスと読出しデータ数がセットされる。このオブジェクトテーブルデータは、前述したように、DRAM507に記憶される各オブジェクト画面データとそれぞれに対応するID番号との対応テーブルを示すテーブルである。
【0131】
上記ステップ1604〜ステップ1606の処理の後、ステップ1607で、レジスタACKFに“1”がセットされる。そして、ステップ1608で、レジスタACKFの値が“0”に戻るまで待機状態となる。
【0132】
ここで、CPU509は、同期信号519に基づいて決定される各フレーム周期内の垂直ブランキング期間が開始される時点毎に、ステップ1608の処理を中断して、図18の動作フローチャートで示される垂直ブランキング割込み処理を実行する。
【0133】
そして、上述のCPU処理によってレジスタACKFに“1”がセットされた場合は、この割込み処理が実行されるタイミングで、ステップ1801の判定がYESとなることにより、前述した図16のステップ1604〜ステップ1606の処理によってCPU509内のDMACに設定された各データに基づいて、アプリケーションカートリッジ513内のアプリケーションROM514に記憶されている各データがVDP506に転送される。
【0134】
即ち、図16のステップ1604〜ステップ1606の処理は電源オン直後に実行されるため、図18のステップ1802の判定がYESとなる。
この結果、まず、ステップ1803で、DMACは、ステップ1604の処理により設定されたバックグランド画面データの読出し開始アドレスと読出しデータ数に基づいて、アプリケーションROM514内のバックグランド画面データを、バス526を介してVDP506にDMA転送する。VDP506は、このバックグランド画面データを、図8のCPUインタフェース回路801からDRAMコントロール回路802を介して図5のDRAM507に転送する。
【0135】
次に、ステップ1804で、DMACは、ステップ1605の処理により設定されたオブジェクト画面データの読出し開始アドレスと読出しデータ数に基づいて、アプリケーションROM514内のオブジェクト画面データを、バス526を介してVDP506にDMA転送する。VDP506は、このオブジェクト画面データも、図8のCPUインタフェース回路801からDRAMコントロール回路802を介して図5のDRAM507に転送する。
【0136】
更に、ステップ1805で、DMACは、ステップ1606の処理により設定されたオブジェクトテーブルデータの読出し開始アドレスと読出しデータ数に基づき、アプリケーションROM514内のオブジェクトテーブルデータを、バス526を介してVDP506にDMA転送する。VDP506は、このオブジェクトテーブルデータを、CPUインタフェース回路801からオブジェクトコントロール回路803を介してオブジェクトテーブルRAM804に転送する。
【0137】
その後、ステップ1806で、レジスタACKFの値が“0”に戻され、図18に示される垂直ブランキング割込み処理を終了する。
この結果、図16のステップ1608の処理が再開され、この処理における判定がYESとなることにより、まず、ユーザが特には図示しないスタートスイッチを押しそれに対応するキースキャン信号527(図5)が入力されるまで、ステップ1609の判定がNO→ステップ1612の判定がNO→ステップ1609の判定がNO・・・という処理ループが繰り返され、待機状態となる。なお、レジスタSTFの内容は、図16のステップ1601において“0”にイニシャライズされている。
【0138】
スタートスイッチが押されそれに対応するキースキャン信号527が入力されると、ステップ1609の判定がYESとなる。
この結果、まず、ステップ1610において、レジスタtに時刻0がセットされる。このレジスタtは、ユーザがスタートスイッチを押することによってゲームを開始させた時点からの経過時刻を示すレジスタであり、このレジスタtの値は、バス526に接続されているクロック回路512(図5)から一定時間毎に入力される割込み要求に基づいて実行される、図19のステップ1901として示されるタイマー割込み処理によって、+1ずつインクリメントされる。
【0139】
次に、ステップ1611で、レジスタSTFに“1”がセットされる。
この結果、ステップ1612の判定がYESとなり、これ以降、通常は、図17のステップ1613〜ステップ1617→ステップ1619→ステップ1609(図16)→ステップ1612→ステップ1613という処理ループが繰り返される。
【0140】
上述の処理ループにおいて、ステップ1614では、時間経過を示す現在のレジスタtの値に基づいて、表示をすべきオブジェクト画面データに対応するオブジェクトテーブルデータに対して指定するID番号が演算され、ステップ1615では、現在のレジスタtの値に基づいて、オブジェクト画面データの表示位置が演算される。これらのデータは、DRAM507上の所定のアドレスにセットされ、その読出し開始アドレスと読出しデータ数がCPU509内のDMACにセットされる。なお、ステップ1614又はステップ1615では、後述する音源割込み処理(図22参照)においてアプリケーションカートリッジ513内の音源回路515に転送される発音指示データも生成され、DRAM507などにセットされる。
【0141】
また、オブジェクト画面データを変更する必要がある場合には、ステップ1614で、CPU509内のDMACに、新たなオブジェクト画面データに対応するオブジェクトテーブルデータのアプリケーションROM514上での読出し開始アドレスと読出しデータ数がセットされる。また、ステップ1615で、DMACに、新たなオブジェクト画面データのアプリケーションROM514上での読出し開始アドレスと読出しデータ数がセットされる。
【0142】
ステップ1616では、レジスタACKFに“1”がセットされる。
その後、前述の垂直ブランキング割込み処理が実行されてレジスタACKFの値が“0”に戻されるまでは、通常、ステップ1617の判定がNO→ステップ1619の判定がNO→ステップ1609(図16)の判定がNO→ステップ1612の判定がYES→ステップ1613(図17)の判定がNO→ステップ1617の判定がNO・・・という処理ループが繰り返され、待機状態となる。
【0143】
CPU509は、前述したように、垂直ブランキング期間が開始される時点毎に、上述の処理ループの処理を中断して、図18の動作フローチャートで示される垂直ブランキング割込み処理を実行する。
【0144】
この結果、ステップ1801の判定がYES→ステップ1802の判定がNOとなることにより、ステップ1804が実行される。
ステップ1804では、CPU509内のDMACは、ステップ1615の処理による設定に基づいて、オブジェクト画面データの表示位置を示すデータを、バス526を介してVDP506にDMA転送する。また、ステップ1805では、DMACは、ステップ1614の処理による設定に基づいて、表示を行うべきオブジェクト画面データのID番号を、バス526を介してVDP506にDMA転送する。この結果、VDP506内のオブジェクトコントロール回路803は、CPU509から指定されたID番号によってオブジェクトテーブルRAM804を参照することにより、そのID番号に対応するオブジェクト画面データをDRAMコントロール回路802を介してDRAM507から読み出し、CPU509から指定された表示位置の情報に基づいてラインバッファRAM808に展開した後、その内容をRGB色差データ処理回路806に出力する。
【0145】
新たなオブジェクト画面データ及びオブジェクトテーブルデータが転送される場合のステップ1804と1805の処理は、前述した図16のステップ1604〜ステップ1606が実行された直後の場合と同様である。
【0146】
その後、ステップ1806で、レジスタACKFの値が“0”に戻され、図18に示される垂直ブランキング割込み処理を終了する。
この結果、CPU処理における前述した処理ループが再開され、ステップ1613の判定がYESとなることにより、次の画面制御処理が実行される。
【0147】
上述の処理ループの実行過程で、ユーザが特には図示しないストップスイッチを押しそれに対応するキースキャン信号527(図5)が入力されると、ステップ1617の判定がYESとなる。この結果、ステップ1618で、レジスタSTFに“0”がセットされる。従って、この時点以降は、ユーザが特には図示しないスタートスイッチを再び押しそれに対応するキースキャン信号527が入力されるまで、ステップ1609(図16)の判定がNO→ステップ1612の判定がNO→ステップ1609の判定がNO・・・という処理ループが繰り返されて、待機状態となる。なお、レジスタtの値はクリアされないため、次にスタートスイッチが押されると、ストップスイッチが押された時点からゲームの進行が再開される。
【0148】
また、上述の処理ループの実行過程で、レジスタtの値が予め設定された終了時刻Tになると、ステップ1619の判定がYESとなる。この結果、ステップ1620で、レジスタtの値が0にリセットされる。従って、この時点以降は、ゲームが再び最初から繰り返されることになる。
【0149】
更に、上述の処理ループの実行過程で、ユーザが特には図示しないスタートスイッチを再度押しそれに対応するキースキャン信号527が入力されると、ステップ1609の判定がYESとなる。この結果、ステップ1610でレジスタtの値が強制的に0にリセットされる。従って、この時点以降も、ゲームが再び最初から繰り返されることになる。
【0150】
一方、上述の処理ループの実行過程で、画像認識回路508によって、前述したように衝突フラグが1にセットされると(図10のステップ1013参照)、CPU509は、上述の処理ループの処理を中断して、図20の動作フローチャートで示される衝突フラグ割込み処理を実行する。
【0151】
まず、ステップ2001では、レジスタtによって示されている現在の時刻tが、予め設定された所定の衝突判定期間T〜Tの範囲に入っているか否かが判定される。このような衝突判定期間を設けた理由は、本来、図1のバット101がボール105に当るべき時間以外の時間で、バット101に対応するクロマキーがボール105に対応するオブジェクト画面データと重なってしまった場合に、誤った処理が実行されてしまうことを防止するためである。
【0152】
ステップ2002においては、画像認識回路508からDRAM510に転送されているバット101を示すクロマキーの重心座標が、CPU509内に取り込まれる。
【0153】
ステップ2003においては、上述のバット101を示すクロマキーの重心座標と、VDP506内のオブジェクトコントロール回路803から取得した現在表示されているボール105を示すオブジェクト画面データの重心座標との位置関係が判定される。
【0154】
この結果、図2に示されるように、2つの重心座標のずれが所定の許容範囲内にある場合には、図1の表示装置103上のCG画像104を例えばホームランに対応する画像に変化させるべく、ステップ2004で、第1画像処理が実行される。なお、処理画面マップ上におけるバット101を示すクロマキーの重心座標と、ボール105を示すオブジェクト画面データの重心座標は、ユーザがバット101をちょうどストライクゾーンに対応する位置に振り下ろしたときに一致するように、予め図1のカメラ102の方向が調整されているものとする。
【0155】
また、図3に示されるように、ボール105を示すオブジェクト画面データの重心座標がバット101を示すクロマキーの重心座標の下方にずれている場合には、図1の表示装置103上のCG画像104を例えばゴロに対応する画像に変化させるべく、ステップ2005で、第2画像処理が実行される。
【0156】
更に、図4に示されるように、ボール105を示すオブジェクト画面データの重心座標がバット101を示すクロマキーの重心座標の上方にずれている場合には、図1の表示装置103上のCG画像104を例えばフライに対応する画像に変化させるべく、ステップ2006で、第3画像処理が実行される。
【0157】
図21は、ステップ2004〜ステップ2006に示される第1〜第3画像処理を一般的に表した第n画像処理の動作フローチャートである。
ステップ2101では、現在の処理が第1、第2、又は第3の何れの画像処理かによって、また、時間経過を示す現在のレジスタtの値に基づいて、オブジェクト画面データの表示位置が演算される。また、ステップ2102では、現在の処理が第1、第2、又は第3の何れの画像処理かによって、また、現在のレジスタtの値に基づいて、表示をすべきオブジェクト画面データに対応するオブジェクトテーブルデータに対して指定するID番号が演算される。なお、ステップ2101又はステップ2102では、後述する音源割込み処理(図22参照)においてアプリケーションカートリッジ513内の音源回路515に転送される発音指示データも生成され、DRAM507などにセットされる。
【0158】
ステップ2103では、レジスタACKFに“1”がセットされる。
その後、前述した垂直ブランキング割込み処理が実行されてレジスタACKFの値が“0”に戻されるまでは、通常は、ステップ2104の判定がNO→ステップ2105の判定がNO→ステップ2106の判定がNO→ステップ2104の判定がNO・・・という処理ループが繰り返され、待機状態となる。
【0159】
CPU509は、前述したように、垂直ブランキング期間が開始される時点毎に、上述の処理ループの処理を中断して、図18の動作フローチャートで示される垂直ブランキング割込み処理を実行する。
【0160】
この結果、ステップ1801の判定がYES→ステップ1802の判定がNOとなることにより、ステップ1804が実行される。
ステップ1804では、CPU509内のDMACは、ステップ2101の処理による設定に基づいて、オブジェクト画面データの表示位置を示すデータを、バス526を介してVDP506にDMA転送する。また、ステップ1805では、DMACは、ステップ2102の処理による設定に基づいて、表示を行うべきオブジェクト画面データのID番号を、バス526を介してVDP506にDMA転送する。この結果、VDP506内のオブジェクトコントロール回路803は、CPU509から指定されたID番号によってオブジェクトテーブルRAM804を参照することにより、そのID番号に対応するオブジェクト画面データをDRAMコントロール回路802を介してDRAM507から読み出し、CPU509から指定された表示位置の情報に基づいてラインバッファRAM808に展開した後、その内容をRGB色差データ処理回路806に出力する。
【0161】
その後、ステップ1806で、レジスタACKFの値が“0”に戻され、図18に示される垂直ブランキング割込み処理を終了する。
この結果、第n画像処理における前述した処理ループが再開され、ステップ2106の判定がYESとなることにより、第n画像処理の次のレジスタtの値に対応する画面制御処理が実行される。
【0162】
上述の処理ループの実行過程で、ユーザが特には図示しないストップスイッチを押しそれに対応するキースキャン信号527(図5)が入力されると、ステップ2105の判定がYESとなる。この結果、ステップ2108で、レジスタSTFに“0”がセットされ、図21の第n画像処理を終了する。この結果、後述する図20のステップ2007を実行した後に衝突フラグ割込み処理も終了し、CPU509処理のループに戻る。従って、この時点以降は、ユーザが特には図示しないスタートスイッチを再び押しそれに対応するキースキャン信号527が入力されるまで、ステップ1609(図16)の判定がNO→ステップ1612の判定がNO→ステップ1609の判定がNO・・・という処理ループが繰り返されて、待機状態となる。
【0163】
また、図21の第n画像処理の実行過程で、レジスタtの値が予め設定された第n画像処理の終了時刻ENDになると、ステップ2104の判定がYESとなる。この結果、ステップ2107で、レジスタtの値が0にリセットされ、図21の第n画像処理を終了し、更に、後述する図20のステップ2007を実行した後に衝突フラグ割込み処理も終了し、CPU509処理のループに戻る。従って、この時点以降は、ゲームが再び最初から繰り返されることになる。
【0164】
なお、ステップ2107で、レジスタtの値を0にリセットせず、強制的に予め定められた所定の値にセットすることにより、表示装置103上のCG画像104の表示を、次の場面に移行させることも可能である。
【0165】
図21の第n画像処理を終了した後に実行される図20の衝突フラグ割込み処理におけるステップ2007においては、衝突フラグが“0”に戻される。この処理は、前述したように、画像認識回路508が実行する図10に示される動作フローチャートにおいて、ステップ1014より先に処理を進ませるための処理である。
【0166】
次に、図22は、CPU509が実行する音源割込み処理の動作フローチャートである。この割込み処理は、図5のアプリケーションカートリッジ513内の音源回路515が、後述する音源処理(図25)を実行する過程において、CPU509への割込みフラグとして、音源割込み要求フラグをセットした時点で実行される。
【0167】
まず、ステップ2201では、監視タイマーがリセットされる。監視タイマーは、模造されたアプリケーションカートリッジ513の使用を阻止するために使用される。
【0168】
上述の監視タイマーの値は、バス526に接続されているクロック回路512(図5)から一定時間毎に入力される割込み要求に基づいて実行される図23の動作フローチャートで示される監視タイマーカウント処理のステップ2301において、順次インクリメントされる。そして、ステップ2302で、この監視タイマーの値が、オーバーフローしたか否かが判定されている。
【0169】
ここで、アプリケーションカートリッジ513が正規のメーカによって製造されたものである場合には、アプリケーションカートリッジ513は、後述する音源処理(図25)を実行する過程において、CPU509への割込みフラグである音源割込み要求フラグをセット及びリセットする動作を順次実行する。これに対して、CPU509は、音源割込み要求フラグがセットされる毎に、図22の音源割込み処理のステップ2201を実行することにより、監視タイマーは適当な時間間隔でリセットされることになる。
【0170】
従って、アプリケーションカートリッジ513が正規のメーカによって製造されたものである場合には、図23の監視タイマーカウント処理のステップ2302の判定は常にNOとなる。
【0171】
一方、アプリケーションカートリッジ513が模造されたものである場合は、コスト的な理由などからCPU509への割込みフラグである音源割込み要求フラグをセット及びリセットする動作が装備されていない場合がほとんどとなるため、音源回路515がCPU509に対して適度に短い時間間隔で音源割込み要求を発生することがなくなり、この結果、監視タイマーがリセットされなくなるか或いは適度に短い時間間隔でリセットされることがなくなり、やがて、監視タイマーがオーバーフローすることにより図23の監視タイマーカウント処理のステップ2302の判定がYESとなる。
【0172】
この場合には、ステップ2303で、CPU509への再度の割込みフラグとして、オーバーフローフラグOVFが1にセットされる。
この結果、CPU509は、再度の割込み処理として、図24の動作フローチャートで示されるオーバーフロー割込み処理を実行し、ステップ2401で、CPU509自身の動作を停止(ホールト)させる。
【0173】
以上の監視タイマーを使って制御により、模造されたアプリケーションカートリッジ513の使用が阻止される。
次に、図22の音源割込み処理において、ステップ2202では、予めDRAM507上に作成されている発音指示データが、バス526を介して、アプリケーションカートリッジ513内の音源回路515に転送される。この発音指示データは、CPU509が前述した図17のステップ1614又はステップ1615、或いは、図21のステップ2101又はステップ2102などのCG画像104(図1)の制御処理を実行するのに合せて生成され、DRAM507に記憶されている。
【0174】
なお、アプリケーションカートリッジ513内の音源回路515に対してのみではなく、本体側に装備されている音源回路516に対しても同様の制御が実行されてもよい。
【0175】
以上説明した図16〜図24の動作フローチャートで示される各処理が、CPU509が実行する処理である。
最後に、図25は、アプリケーションカートリッジ513内の音源回路515が実行する音源処理の動作フローチャートである。
【0176】
アプリケーションカートリッジ513が特には図示しないホルダーに装着されると、図25の動作フローチャートの実行が開始され、まず、ステップ2501において、音源回路515内部のレジスタやワークRAMの内容などがイニシャライズされる。
【0177】
その後、ステップ2502〜ステップ2507の各処理が、繰り返し実行される。
まず、音源回路515は、1発音単位分の楽音信号を生成する毎(例えば数秒分の楽音波形データの読出しを完了する毎)に、ステップ2502で、図5のCPU509への割込みフラグである音源割込み要求フラグをセットする。これに対しCPU509は、前述した図22の音源割込み処理を実行することにより、次の発音単位に対する発音指示データを音源回路515に出力する。
【0178】
音源回路515は、ステップ2503において、入力されるデータに変化が起こるまで待機状態とする。入力されるデータに変化が起こると、更にステップ2504で、入力されるデータが安定するまで待機状態となる。
【0179】
入力されるデータが安定すると、ステップ2505で音源割込み要求フラグを0にリセットした後、ステップ2506で、入力される発音指示データを解釈する。
【0180】
そして、ステップ2507で、そのデータに対応する楽音信号を生成する。
1発音単位分の楽音信号の生成を完了すると、音源回路515は、再びステップ2502を実行し、図5のCPU509への割込みフラグである音源割込み要求フラグをセットする。
【0181】
以上のようにして音源回路515で生成された楽音信号は、CPU509及び音源回路516を介して、アンプ517に送られ、ここで増幅された後、特には図示しないスピーカに、音声出力信号528として出力される。
<第2の実施例の具体的な動作>
次に、本発明の第2の実施例の具体的な動作について説明する。
【0182】
第2の実施例では、ゲームをスタートさせる前に、ユーザが、処理画面マップ上のどのブロック位置がクロマキーに関する部分として認識されているかを確認することを可能にする。前述したように、バット101がそれと同じ色彩を有する背景対象物と重なった場合は、そこにはバット101は存在しないものとして処理される(図12のステップ1203〜ステップ1205参照)。この結果、バット101の位置の検出精度が下がり、ゲームの進行に影響を与えるおそれがある。従って、第2の実施例の機能により、ユーザは、バット101と同じ色彩を有する背景対象物が存在する位置にバット101を持っていかないように注意することができる。
【0183】
第2の実施例が前述した第1の実施例と異なる部分は、図5のCPU509が実行するCPU処理の部分である。図29〜図32に、第2の実施例におけるCPU処理の動作フローチャートを示す。この動作フローチャートは、第1の実施例における図16に示されるCPU処理に対応する。
【0184】
まず、図29において、ステップ2901〜ステップ2903の機能は、図16のステップ1601〜ステップ1603の機能と同じである。
次に、ステップ2904において、図5のVDP506に対して画面クリア命令が実行される。これによって、図1の表示装置103の表示画面がクリアされる。また、ステップ2904では、処理画面マップの水平方向の列位置を示すレジスタXと垂直方向の行位置を示すレジスタYの値が0にリセットされる。
【0185】
続いて、ステップ2911でレジスタXの値がクリアされると共にレジスタYの値が+1ずつインクリメントされながら、ステップ2912でレジスタYの値が96に達した(95を越えた)と判定されるまで、ステップ2905〜ステップ2907→ステップ2911→ステップ2912→ステップ2905の処理が繰り返し実行される。このようにして、処理画面マップにおける96行分の処理が実行される。
【0186】
また、ステップ2910でレジスタXの値が+1ずつインクリメントされながら、ステップ2909でレジスタXの値が96に達した(95を越えた)と判定されるまで、ステップ2905〜ステップ2909→ステップ2910の処理が繰り返し実行される。このようにして、処理画面マップにおける1行内の96ブロック分の処理が実行される。
【0187】
そして、レジスタXとYの現在値毎に実行されるステップ2905〜ステップ2908が、処理画面マップにおける1ブロック分の処理ということになる。以下の説明では、レジスタXとYのそれぞれの現在値を単にX、Yと記載し、現在のXとYの各値によって特定されるブロックを処理対象ブロックと呼ぶ。
【0188】
ステップ2905では、図5の画像認識回路508内の図26に示されるRAMの処理画面マップ領域からバス526を介して、水平方向に列位置X、垂直方向に行位置Yの処理対象ブロックの位置の論理値が読み出されて、その論理値が“1”であるか否かが判定される。
【0189】
ここで、図5の画像認識回路508が実行する、前述した図12の動作フローチャートで示される図10のステップ1005の処理画面マップ作成処理において、ユーザが特には図示しないスタートスイッチを押すまでは、特には図示しないリジェクトスイッチは無効にされている。この結果、スタートスイッチが押される前に画像認識回路508において実行されている処理画面マップ作成処理では、ステップ1203の判定は必ずNOとなるため、クロマキー信号523に基づいてクロマキーに関する部分として認識されるブロック位置の論理値は、必ず“1”となる。
【0190】
なお、リジェクトスイッチは有効にしておき、ステップ2905では、図5の画像認識回路508内の図26に示されるRAMの初期画面マップ領域及び処理画面マップ領域の両方の領域からバス526を介して、水平方向に列位置X、垂直方向に行位置Yの処理対象ブロックの位置の論理値が読み出されて、その何れかの論理値が“1”であるか否かが判定されるように構成されてもよい。
【0191】
図29の説明に戻って、ステップ2905の判定がNOならば、ステップ2909に進み、次の処理対象ブロックに対する処理に移る。
これに対して、ステップ2905の判定がYESなら、現在の処理対象ブロックの位置には、バット101又はバット101と同じ色彩を有する背景対象物が存在することになる。
【0192】
この場合には、ステップ2906で、X及びYの値がそれぞれ6倍及び2倍されることにより、処理対象ブロックの位置から元のフレーム上での座標x、yが算出され、その算出結果が図5のDRAM507に記憶される(前述した図25に関する説明参照)。
【0193】
ステップ2907では、CPU509内のDMACに、DRAM507に記憶された上記表示位置(x、y)を示すデータの読出し開始アドレスと読出しデータ数を示すオブジェクトテーブルデータの転送指示がセットされる。
【0194】
また、ステップ2908では、クロマキー表示を行わせるための所定のオブジェクト画面データ(例えば矩形オブジェクトなど)の、アプリケーションカートリッジ513内のアプリケーションROM514上での読出し開始アドレスと読出しデータ数がセットされる。
【0195】
その後、ステップ2909に進み次の処理対象ブロックの位置に対する処理に移る。
以上の動作が96×96ブロックのサイズを有する処理画面マップの1画面分に対して実行される結果、ステップ2912の判定がYESとなった時点で、CPU509内のDMACには、バット101又はバット101と同じ色彩を有する背景対象物が存在するフレーム内位置に所定のオブジェクト画面データを表示させるためのデータ群がセットされたことになる。
【0196】
その後、ステップ2913で、レジスタACKFに“1”がセットされる。そして、ステップ2914で、レジスタACKFの値が“0”に戻るまで待機状態となる。
【0197】
前述したように、CPU509は、同期信号519に基づいて決定される各フレーム周期内の垂直ブランキング期間が開始される時点毎に、ステップ2914の処理を中断して、図18の動作フローチャートで示される垂直ブランキング割込み処理を実行する。これによって、上述したようにしてDMACにセットされた、バット101又はバット101と同じ色彩を有する背景対象物が存在するフレーム内位置に所定のオブジェクト画面データを表示させるためのデータ群が、VDP506に転送される。そして、VDP506は、指定されたフレーム内位置に指定されたオブジェクト画面データが配置されたCG画像104(図1)を表示する。
【0198】
転送が終了すると、レジスタACKFの値が“0”に戻され(図18のステップ1806参照)、図18に示される垂直ブランキング割込み処理を終了するため、再開された図29のステップ2914の判定がYESとなる。
【0199】
従って、ユーザが特には図示しないスタートスイッチを押しそれに対応するキースキャン信号527(図5)が入力されるまでの間、ステップ2915(図30)の判定がNOとなり、図29のステップ2904〜ステップ2914→図30のステップ2915・・・という処理ループが繰り返され、スタート待機状態となる。そして、この間は、上述したように、フレーム周期毎に順次変化する処理画面マップの内容に従って、バット101又はバット101と同じ色彩を有する背景対象物が存在するフレーム内位置に所定のオブジェクト画面データを表示させるためのデータ群が順次VDP506に転送され、VDP506において、指定されたフレーム内位置に指定されたオブジェクト画面データが配置されたCG画像104が順次表示される。
【0200】
以上の動作の結果、図1のカメラ102が、例えば図32(a) に示されるようは情景を撮像している場合、CPU509からVDP506に対し、図32(b) に示されるようなCG画像104の表示指示が行われ、ユーザは、図32(c) に示されるような、CG画像104とカメラ102によって撮像された実画像とが合成された画像を、表示装置103上で確認することができる。
【0201】
なお、CG画像104とカメラ102により撮像された実画像の合成処理は、図5の画像認識回路508が特には図示しない制御処理に基づいてビデオ信号変換回路505内の選択回路707(図7)にスーパーインポーズ信号525を出力することにより実現される。
【0202】
この場合、バット101に対応する部分はユーザの動きに合せて常に動き続けているが、バット101と同じ色彩を有する背景対象物の部分は静止している。このようにして、ユーザは、バット101と、バット101と同じ色彩を有する背景対象物とを確認することができる。
【0203】
スタートスイッチが押されそれに対応するキースキャン信号527が入力されると、図30のステップ2915の判定がYESとなる。
その後の図30のステップ2916〜ステップ2920、ステップ2921〜ステップ2923、図31のステップ2924〜ステップ2931の機能は、それぞれ、第1の実施例における図16のステップ1604〜ステップ1608、ステップ1610〜ステップ1612、図17のステップ1613〜ステップ1620の機能と同じである。
<第3の実施例の具体的な動作>
続いて、本発明の第3の実施例の具体的な動作について説明する。
【0204】
第3の実施例では、第1の実施例で説明した初期画面マップの作成時に、ユーザが持っているバット101が、バット101と同じ色彩の背景対象物として初期画面マップに記憶されてしまうことを防止することができる。
【0205】
第3の実施例が前述した第1の実施例と異なる部分は、図5の画像認識回路508が実行する図10のステップ1003の初期画面マップ作成処理である。図33に、第3の実施例における図10のステップ1003の初期画面マップ作成処理の詳細な動作フローチャートを示す。この動作フローチャートは、第1の実施例における図11に示される動作フローチャートに対応しており、図33と図11とで、同じステップ番号が付加されたステップは、同じ機能を有する。
【0206】
第3の実施例における図33の動作フローチャートが第1の実施例における図11の動作フローチャートと異なる点は、図11のステップ1109が図33のステップ1109′に変更されている点のみである。
【0207】
前述したように、第1の実施例に関する図11の動作フローチャートで示される初期画面マップ作成処理では、初期画面マップを安定して取得するために、複数フレーム分(複数画面分)のクロマキー信号523(図5)について処理が繰り返し実行され、ステップ1109で、画面マップ上のブロック位置毎に各繰返し処理で得られる論理値の論理和(OR)が演算された。この結果、上記複数のフレームにおいて撮像された情景内に存在するクロマキーは、全てバット101と同じ色彩の背景対象物として初期画面マップに記憶される。
【0208】
これに対して、第3の実施例に関する図33の動作フローチャートで示される初期画面マップ作成処理では、複数フレーム分(複数画面分)のクロマキー信号523(図5)について処理が繰り返し実行され、ステップ1109′で、画面マップ上のブロック位置毎に各繰返し処理で得られる論理値の論理積(AND)が演算される。
【0209】
この結果、上記複数のフレーム期間でユーザが持っているバット101が撮像されてしまっても、そのバット101に対応するクロマキーは、フレーム間で常にゆれ動いているため、ブロック位置毎にフレーム間で論理積を演算した結果は“0”となる。このようにして、ユーザが持っているバット101が、バット101と同じ色彩の背景対象物として初期画面マップに記憶されてしまうことを防止することができるのである。
<第4の実施例の具体的な動作>
最後に、本発明の第4の実施例の具体的な動作について説明する。
【0210】
第4の実施例では、ゲームをスタートさせる場合に、撮像される情景内から、バット101と同じ色彩を有する背景対象物が完全になくなったことが検知された場合に初めて、ゲームをスタートできるように動作する。前述したように、バット101がそれと同じ色彩を有する背景対象物と重なった場合は、それがバット101であるか背景対象物であるか区別がつかなくなる。この結果、バット101の位置の検出精度が下がり、ゲームの進行に影響を与えるおそれがある。従って、第4の実施例の機能により、ユーザは、バット101と同じ色彩を有する背景対象物が撮像される情景内から完全になくなったことを確認した後にゲームを開始することができる。
【0211】
第4の実施例が前述した第1の実施例と異なる部分は、図5の画像認識回路508が実行する全体動作フローチャートの処理、及びCPU509が実行するCPU処理の部分である。
【0212】
まず、図34及び図35に、第4の実施例において画像認識回路508が実行する全体動作フローチャートを示す。この動作フローチャートは、第1の実施例における図10に示される動作フローチャートに対応する。
【0213】
図34において、まず、ステップ3401とステップ3402の機能は、図10のステップ1001、ステップ1002の機能と同じである。
次に、ステップ3403では、初期画面マップが作成される毎に、レジスタIFに“0”がセットされ、この値は図5のバス526を介してCPU509に常に通知されている。
【0214】
また、ステップ3405の初期画面マップ作成処理は、図10のステップ1003の処理と同じであり、前述した図11の動作フローチャートによって示される。
【0215】
次に、ステップ3406において、ステップ3405で生成された初期画面マップの水平方向の列位置を示すレジスタXと垂直方向の行位置を示すレジスタYの値が0にリセットされた後、ステップ3410でレジスタXの値がクリアされると共にレジスタYの値が+1ずつインクリメントされながら、ステップ3411でレジスタYの値が96に達した(95を越えた)と判定されるまで、ステップ3407〜ステップ3409→ステップ3410→ステップ3411→ステップ3407の処理が繰り返し実行される。このようにして、初期画面マップにおける96行分の処理が実行される。
【0216】
また、ステップ3408でレジスタXの値が+1ずつインクリメントされながら、ステップ3409でレジスタXの値が96に達した(95を越えた)と判定されるまで、ステップ3407〜ステップ3409→ステップ3407、・・・の処理が繰り返し実行される。このようにして、初期画面マップにおける1行内の96ブロック分の処理が実行される。
【0217】
そして、ステップ3407において、初期画面マップのレジスタXとYの現在値によって特定されるブロック位置毎に、そのブロック位置の論理値が図26のRAM内の初期画面マップ領域から読み出され、その論理値が“1”であるか否かが判定される。
【0218】
ステップ3407の判定がNOならば、ステップ3408に進んで次のブロック位置に対する処理に移る。
そして、ステップ3407の判定がYESとなったら、再びステップ3405の初期画面マップ作成処理に戻る。
【0219】
以上のようにして、第4の実施例では、生成された初期画面マップ内に1ブロックでも論理値が“1”である、即ち、1ブロックでもバット101と同じ色彩を有する背景対象物が存在すると判定された場合には、ユーザが、バット101と同じ色彩を有する背景対象物を撮像される情景内から除去しない限り、又は、撮像範囲をバット101と同じ色彩を有する背景対象物が存在しない範囲に移動させない限り、初期画面マップ作成処理が延々と繰り返される。
【0220】
撮像される情景内にバット101と同じ色彩を有する背景対象物が存在しなくなると、初期画面マップの全ブロックの論理値が“0”となるため、全ブロックについてステップ3407の判定がNOとなり、やがてステップ3411の判定がYESとなる。
【0221】
この結果、図35のステップ3412で、レジスタIFの値が“0”にリセットされ、この値が図5のバス526を介してCPU509に通知される。
その後のステップ3413〜ステップ3424の処理は、第1の実施例における図10のステップ1004〜ステップ1015の処理と同じである。
【0222】
なお、第4の実施例では、最終的に得られる初期画面マップの全ブロックの論理値は“0”である。従って、図35のステップ3414の処理画面マップ作成処理に対応する前述した図12の動作フローチャートにおいて、処理画面マップのブロック位置毎に、その論理値を初期画面マップの対応するブロック位置の論理値と比較する必要はない。従って、ステップ1202の判定がYESとなった場合には、ステップ1203〜ステップ1205の処理を実行する必要はなく、すぐにステップ1206が実行されるように動作する。
【0223】
図5の画像認識回路508の以上説明した動作に対して、図5のCPU509は、図36〜図38に示される動作フローチャートの処理を実行する。この動作フローチャートの機能は、基本的には前述した第2の実施例に関する図29〜図31の動作フローチャートの機能と同じである。
【0224】
即ち、図36〜図38と図29〜図31とで、同じステップ番号が付加されたステップは、同じ機能を有する。具体的には、第4の実施例では、第2の実施例の場合と同様に、ゲームをスタートさせる前に、ユーザが、処理画面マップ上のどのブロック位置がクロマキーに関する部分として認識されているかを確認することができる。但し、第4の実施例では、図34及び図35の動作フローチャートとして説明したように、図5の画像認識回路508において作成される初期画面マップ上の全ブロックの論理値が“0”になった後でないと、図35のステップ3414の処理画面マップ作成処理は実行されない。このため、ゲームをスタートさせる前にユーザが処理画面マップ上で確認するのは、背景対象物ではなくて、ユーザが手に持っているバット101の存在するブロック位置ということになる。
【0225】
第4の実施例における図36〜図38の動作フローチャートが第2の実施例における図29〜図31の動作フローチャートと異なる点は、図30のステップ2915が図37のステップ2915′に変更されている点のみである。
【0226】
即ち、第2の実施例では、ユーザが特には図示しないスタートスイッチを押せば、ステップ2915の判定がYESとなって、ゲームがスタートした。これに対して、第4の実施例では、図5の画像認識回路508からバス526を介してCPU509に通知されるレジスタIFの値が“0”になるまで、ゲームはスタートしない。
【0227】
このレジスタIFの値は、撮像される情景からバット101と同じ色彩を有する背景対象物が除去されずに初期画面マップ作成処理が繰り返されている間は、図34のステップ3403で“1”にセットされ続けている。そして、撮像される情景からバット101と同じ色彩を有する背景対象物が除去され、初期画面マップ上の全てのブロックの論理値が“0”となった時点において、図35のステップ3412において“0”にリセットされる。
【0228】
従って、第4の実施例では、撮像される情景からバット101と同じ色彩を有する背景対象物が除去された時点で初めて、ゲームのスタートが可能になるのである。
<他の実施例>
以上説明した実施例では、CPU509は、画像認識回路508からDRAM510に転送されてきた処理画面マップ(図26参照)上のバット101の重心位置と、VDP506内のオブジェクトコントロール回路803から取得した現在表示されているボール105(図1)を示すオブジェクトの重心位置との位置関係のみに基づいて、図1の表示装置103に表示されるCG画像104を制御している。しかし、本発明はこれに限られるものではなく、画像認識回路508が、図10のステップ1006の衝突座標検出処理によってRAM(図26)に記憶した最初の衝突座標及び最後の衝突座標、並びに、ステップ1005の処理画面マップ作成処理によって上述のRAMに記憶したバット101の存在範囲を示す上端座標、下端座標、左端座標、及び右端座標を、DRAM507に転送するように構成し、これらの各種位置データに基づいて図1の表示装置103に表示されるCG画像104を制御するように構成されてもよい。
【0231】
【発明の効果】
本発明によれば、第1の状態において所定色の画像領域と同じ所定色が検知されなくなってから、第1の状態を解除して第2の状態を開始し、撮像画面内から所定色の画像領域の抽出を行うようにしているので、撮像すべき対象が安定した状態に移行してから、すなわち、バットなどの目的物と同じ所定色を有する背景対象物が撮像範囲内からなくなってから、バットなどの目的物のみを示す所定色の画像領域を安定に抽出できる。
【0232】
また、バットを振るユーザなどの現実の情景を撮像して得られる画面から抽出された、バットなどの所定色の画像領域の位置と、オブジェクト画面データの表示画面上での位置との位置関係を判断し、その判断内容に基づき、次に表示されるべき画面に対応する信号が生成されるようにすることも可能であり、そのようにすれば、ユーザは、あたかも実際のプレーをするようにバットを振る動作などを行うことにより、CG画像などによって表示されるテレビゲームに参加することなどが可能となる。この場合特に、撮像された画面からバットなどの特定の画像領域を抽出する際、クロマキーなどによる所定色の画像領域として抽出することによって、ユーザの動作を正確に把握することが可能となる。
【0233】
なお、本発明によれば、ユーザの動作に反応して画像制御を行うテレビゲームだけでなく、現実の様々な情景を撮像した結果に基づいて様々な画像制御を行う装置を実現することが可能となる。
【図面の簡単な説明】
【図1】実施例の動作の外観図(第1〜第4の実施例)である。
【図2】実施例の動作原理図(その1)(第1〜第4の実施例)である。
【図3】実施例の動作原理図(その2)(第1〜第4の実施例)である。
【図4】実施例の動作原理図(その3)(第1〜第4の実施例)である。
【図5】本発明の実施例の全体構成図(第1〜第4の実施例)である。
【図6】ビデオ信号入出力回路の構成図(第1〜第4の実施例)である。
【図7】ビデオ信号変換回路の構成図(第1〜第4の実施例)である。
【図8】VDPの構成図(第1〜第4の実施例)である。
【図9】クロック回路の説明図(第1〜第4の実施例)である。
【図10】画像認識回路の全体動作フローチャート(第1、第2、第3の実施例)である。
【図11】初期画面マップ作成処理の動作フローチャート(第1、第2、第4の実施例)である。
【図12】処理画面マップ作成処理の動作フローチャート(その1)(第1〜第4の実施例)である。
【図13】処理画面マップ作成処理の動作フローチャート(その2)(第1〜第4の実施例)である。
【図14】衝突検出処理の動作フローチャート(第1〜第4の実施例)である。
【図15】重心計算処理の動作フローチャート(第1〜第4の実施例)である。
【図16】CPU処理の動作フローチャート(その1)(第1、第3の実施例)である。
【図17】CPU処理の動作フローチャート(その2)(第1、第3の実施例)である。
【図18】垂直ブランキング割込み処理の動作フローチャート(第1〜第4の実施例)である。
【図19】タイマー割込み処理の動作フローチャート(第1〜第4の実施例)である。
【図20】衝突フラグ割込み処理の動作フローチャート(第1〜第4の実施例)である。
【図21】第n画像処理の動作フローチャート(第1〜第4の実施例)である。
【図22】音源割込み処理の動作フローチャート(第1〜第4の実施例)である。
【図23】監視タイマーカウント処理の動作フローチャート(第1〜第4の実施例)である。
【図24】オーバーフロー割込み処理の動作フローチャート(第1〜第4の実施例)である。
【図25】音源処理の動作フローチャート(第1〜第4の実施例)である。
【図26】フレームの画素構成と画面マップとの関係図(第1〜第4の実施例)である。
【図27】画像認識回路のRAMマップを示した図(第1〜第4の実施例)である。
【図28】上・下・左・右端座標の検出処理の説明図(第1〜第4の実施例)である。
【図29】CPU処理の動作フローチャート(その1)(第2の実施例)である。
【図30】CPU処理の動作フローチャート(その2)(第2の実施例)である。
【図31】CPU処理の動作フローチャート(その3)(第2の実施例)である。
【図32】第2の実施例の説明図である。
【図33】初期画面マップ作成処理の動作フローチャート(第3の実施例)である。
【図34】画像認識回路の全体動作フローチャート(その1)(第4の実施例)である。
【図35】画像認識回路の全体動作フローチャート(その2)(第4の実施例)である。
【図36】CPU処理の動作フローチャート(その1)(第4の実施例)である。
【図37】CPU処理の動作フローチャート(その2)(第4の実施例)である。
【図38】CPU処理の動作フローチャート(その3)(第4の実施例)である。
【符号の説明】
101 バット
102 カメラ
103 表示装置
104 CG画像
105 ボール
501 CCD
502 クロックドライバー
503 ビデオ信号入出力回路
504 発振器(OSC)
505 ビデオ信号変換回路
506 VDP
507 DRAM
508 画像認識回路
509 CPU
510 DRAM
511 OS ROM
512 クロック回路
513 アプリケーションカートリッジ
514 アプリケーションROM
515、516 音源回路
517 アンプ
518 CCD出力信号
519 同期信号
520 デジタルコンポジットビデオ入力信号
521 デジタルコンポジットビデオ出力信号
522 アナログコンポジットビデオ出力信号
523 クロマキー信号
524 デジタルRGB信号
525 スーパーインポーズ信号
526 バス
527 キースキャン信号
528 音声出力信号528[0001]
[Industrial application fields]
The present inventionFor example, in a video game or the like, an image extraction apparatus and an image extraction method for extracting an image area of a specific condition from a captured screen based on a color signalAbout.
[0002]
Traditionally,As this kind of image extraction device,ImagedscreenA predetermined color, for example, a bright blue imageregionThere is known a chroma key detection device that detects a key as a chroma key.
[0003]
Such a chroma key detecting device is used for the purpose of synthesizing an image in television shooting or the like, and for example, sequentially detects the position of a bat of a predetermined color held by a user and displays a display image based on the detected position. The present invention can also be applied to an image control apparatus such as a video game that controls the image.
[0004]
[Problems to be solved by the invention]
However, the conventional chroma key detection device simply detects an image of a predetermined color from among the captured images. For example, in the above-described video game or the like, in the case where it is desired to detect a chroma key of a constantly moving object such as a bat, When there is an object having the same color as the bat, the object is detected as a bat or the like, and there is a possibility that the intended chroma key cannot be detected.
[0005]
The subject of the present invention isFrom the captured screen,AimImage areaExactlyAllow extractionThere is.
[0006]
[Means for Solving the Problems]
The image extraction apparatus of the present invention isSetting means for setting an image area of a predetermined color to be extracted in advance, an imaging means, and an imaging area by the imaging meansExtract an image area of a predetermined colorWith extraction meansIn the image extraction device,A predetermined color included in an image area set by the setting means from an imaging area imaged by the imaging means;The same predetermined color continues to be detectedDuring this time, the extraction operation by the extraction means is prohibited, and when the same predetermined color is no longer detected, the control means for starting the extraction operation by the extraction means (the image recognition circuit 508 for executing the operation flowcharts of FIGS. 34 and 35). And CPU 509 for executing the operation flowcharts of FIGS.. Here, the image area is obtained by sequentially capturing, for example, a user's action with a bat or the like.Further, the state in which the extraction operation is prohibited and the state after the extraction operation is started correspond to the state before the game start and the state after the game start in the example of the video game, for example.
[0011]
In addition, image storage means (application ROM 514, DRAM 507, etc. in FIG. 5) for storing the object screen data to be output, and a display for designating the position to be output on the display screen of the object screen data stored in the image storage means Position specifying means (such as CPU 509 in FIG. 5) and output control means (FIG. 8) for controlling to output an image corresponding to the object screen data stored in the image storage means at the position specified by the display position specifying means. The object control circuit 803 in FIG.controlInitiated by meansExtraction operation by the extraction meansDetermining means (image recognition circuit 508 for executing step 1006 in FIG. 10 and the like) for determining the positional relationship between the position of the image area of the predetermined color extracted in step S3 on the imaged screen and the position where the object screen data is displayed. Etc.) and signal generation means (CPU 509 in FIG. 5) for generating a signal corresponding to the screen to be displayed next based on the content of the determination by the determination means. Here, the image storage means can be configured to store a plurality of object screen data. In that case, the display position specifying means may be configured to specify at least one type of the plurality of object screen data stored in the image storage means. Further, the positional relationship is, for example, the overlapping of positions.
[0012]
Further, it is possible to further include signal output means (such as the chroma key circuit 706 in the video signal conversion circuit 505 in FIG. 7) for outputting a chroma key signal based on the color signal of the imaged screen.controlInitiated by meansExtraction operation by the extraction meansIs extraction of the image area of the predetermined color by recognizing the chroma key signal output by the signal output means.
[0013]
Next, the image extraction method of the present invention includes:An image area of a predetermined color to be extracted in advance is set and included in the area captured by the imaging unitAn image extraction method for extracting an image area of a predetermined color,the aboveCaptured by the imaging unitA predetermined color included in an image area set in advance from the imaging area;The same predetermined color continues to be detectedWhile the extraction operation is prohibited, the same as aboveWhen the predetermined color is not detected,The extraction operation is started (operation flowchart in FIGS. 34 to 38)..Here, the state in which the extraction operation is prohibited and the state after the extraction operation is started correspond to the state before the game start and the state after the game start in the example of the video game, for example.
[0014]
This image extraction method of the present invention can further include a signal output step (such as step 1003 in the overall operation flowchart of the screen recognition circuit in FIG. 10) for outputting a chroma key signal based on the color signal of the captured screen. Yes, in that caseExtraction operation started aboveIs the extraction of the image area of the predetermined color by recognizing the chroma key signal output in the signal output step.
[0020]
[Action]
In the present invention, for example, a first state which is a state before the start of the video game(The above extraction operation is prohibited)The first state is maintained as long as the same predetermined color as the predetermined color image region indicating the target object such as a bat is continuously detected. Thereafter, when the predetermined color is no longer detected, the maintenance of the first state is canceled.(The above extraction operation starts)Then, for example, a second state, which is a state after the start (in progress) of the video game, is started, and an image region of a predetermined color indicating an object such as a bat is sequentially obtained.
[0025]
By doing this,After the subject to be imaged has shifted to a stable state,That is, after the background object having the same predetermined color as the object such as the bat disappears from the imaging range,Show only objects such as batsPredetermined colorCan be extracted stably.
[0027]
Furthermore,In the second state,The bat etc. extracted from the screen obtained by imaging the real scene such as the user shaking the batPredetermined colorIf the positional relationship between the position of the image area and the position of the object screen data on the display screen is determined, and a signal corresponding to the screen to be displayed next is generated based on the determination content The user can participate in a video game displayed by a CG image or the like by performing an operation such as swinging a bat so as to actually play.
[0028]
Especially in this case,When extracting a specific image area such as a bat from the imaged screen,Predetermined color image with chroma key etc.regionAsExtractionBy doing so, it is possible to accurately grasp the user's operation.
[0029]
【Example】
Hereinafter, first to fourth embodiments of the present invention will be described in detail with reference to the drawings.
<Appearance of user's operation in embodiment and operation principle of embodiment>
Before describing the configurations and specific operations of the first to fourth embodiments, the appearance of the user's common operations and the common operation principles of these embodiments will be briefly described.
[0030]
In the first to fourth embodiments, the present invention is applied to a baseball video game.
As shown in FIG. 1, a user holds a bat 101 painted in a predetermined color, for example, blue, and is displayed on a display device 103 as a CG (computer graphics) image 104. Shake bat 101 toward 105.
[0031]
The camera 102 images a scene including a user with the bat 101. By extracting the chroma key signal related to the predetermined color from the captured image, a coordinate map 202 of the bat 101 as shown in FIG. 2 is created, and further, the bat 101 on the coordinate map 202 is created. The barycentric coordinate (x mark in the figure) is detected. Then, a positional relationship 203 between the coordinate map 202 and the barycentric coordinates of the bat 101 and the coordinates 201 of the ball 105 and the barycentric coordinates (marked in the drawing) by the CG as shown in FIG. Thus, the presence / absence of the collision of the ball 105 with the bat 101 and the CG and the positional relationship between the gravity center coordinate of the bat 101 and the gravity center coordinate of the ball 105 when the collision occurs are extracted.
[0032]
As shown in FIG. 2, when it is determined that the CG ball 105 hits the bat 101 and the deviation between the centroid coordinates of the bat 101 and the CG coordinates of the ball 105 is within a predetermined allowable range. For example, it is determined that the user has hit a home run, and the CG image 104 changes to an image corresponding to the home run.
[0033]
Alternatively, as shown in FIG. 3, when it is determined that the CG 101 hits the bat 101 and the center of gravity coordinates of the CG 101 are shifted below the center of gravity of the bat 101, for example, It is determined that the user has hit the ball, and the CG image 104 changes to an image corresponding to the ball.
[0034]
Further, as shown in FIG. 4, when it is determined that the CG ball 105 hits the bat 101 and the center of gravity coordinates of the ball 105 by CG are shifted above the center of gravity coordinates of the bat 101, for example, It is determined that the user hits the fly, and the CG image 104 changes to an image corresponding to the fly.
[0035]
As described above, in the first to fourth embodiments, the user can participate in the video game displayed by the CG image 104 by swinging the bat 101 as if playing the actual game.
<Configuration of Example>
A specific specific configuration common to the first to fourth embodiments for realizing the above-described operation will be described below.
[0036]
FIG. 5 is a common overall configuration diagram of the first to fourth embodiments of the present invention.
First, the clock driver 502 directly controls the operation of the CCD 501 provided in the camera 102 of FIG. 1 based on the clock input from the oscillator (OSC) 504 via the video signal input / output circuit 503 and at the same time HSYNC. A synchronization signal 519 such as a signal and a VSYNC signal is generated and supplied to a video signal input / output circuit 503, a VDP 506, an image recognition circuit 508, and a CPU 509. Therefore, these circuits can operate in synchronization with each other based on the synchronization signal 519.
[0037]
A CCD output signal 518 output from the CCD 501 is input to the video signal input / output circuit 503.
The video signal input / output circuit 503 performs an operation of converting the CCD output signal 518 into a digital composite video input signal 520 and an operation of converting the digital composite video output signal 521 from the video signal conversion circuit 505 into an analog composite video output signal 522. .
[0038]
The configuration of the video signal input / output circuit 503 is shown in FIG.
In FIG. 6, a CCD output signal 518 from a CCD 501 (FIG. 5) is sampled in an analog manner by a sampling circuit 601.
[0039]
The amplitude level of the output of the sampling circuit 601 is adjusted by an automatic gain adjustment circuit (AGC) 602.
The output of the AGC 602 is converted by the γ correction circuit 603 so that the signal level with respect to the optical power has a predetermined γ characteristic.
[0040]
The output of the γ correction circuit 603 is converted into an 8-bit digital composite video input signal 520 by an 8-bit A / D converter 604. The digital composite video input signal 520 is output to the video signal conversion circuit 505 in FIG.
[0041]
On the other hand, the 8-bit digital composite video output signal 521 output from the video signal conversion circuit 505 is converted into an analog composite video output signal 522 by the 8-bit D / A converter 605. The analog composite video output signal 522 is output to the display device 103 in FIG. As a result, the display device 103 displays the CG image 104 corresponding to the analog composite video output signal 522.
[0042]
Returning to FIG. 5, the video signal conversion circuit 505 generates the chroma key signal 523 from the digital composite video input signal 520 and outputs it to the image recognition circuit 508, based on the superimpose signal 525 from the image recognition circuit 508, A color signal corresponding to the digital composite video output signal 521 input from the video signal input / output circuit 503 or a digital RGB signal 524 output from the video display processor (VDP) 506 is selected, and the selected color signal is selected. An operation for outputting the corresponding digital composite video output signal 521 is performed.
[0043]
The configuration of the video signal conversion circuit 505 is shown in FIG.
The color separation filter 701 receives a digital composite video input signal 520 input from the video signal input / output circuit 503 (FIG. 5), and receives a G (green) signal, a Cy (cyan) signal, and Ye (corresponding to the signal). The three types of color signals are output.
[0044]
The contour correction circuit 702 receives the above-described three kinds of color signals and performs a process of correcting the contour of an image determined by these color signals.
Of the outputs from the contour correction circuit 702, signals other than the G (green) signal are input to the white balance circuit 703. The white balance circuit 703 performs white balance adjustment on the input signal.
[0045]
The output of the white balance circuit 703 is input to the selection filter 704. The selection filter 704 outputs an R (red) signal and a B (blue) signal corresponding to the input.
[0046]
The matrix circuit 705 inputs the R (red) signal, the B (blue) signal, and the G (green) signal output from the contour correction circuit 702, and corresponds to the conversion represented by the following equation. By executing the calculation, the luminance signal Y and the color difference signals RY and BY are output.
Y = (8/27) R + (16/27) G + (1/9) B
RY = (15/27) R- (16/27) G- (1/9) B
B−Y = − (8/27) R− (16/27) G + (8/9) B
In the chroma key circuit 706, as shown in FIG. 9, the color difference signal RY has a value in the range from the minimum value RYmin to the maximum value RYmax, and the color difference signal BY has a minimum value B-. When the value falls within the range of Ymin to the maximum value B−Ymax, a chroma key signal 523 having a logical value “1” is output. The chroma key signal 523 indicates a logical value “1” when, for example, a color signal indicating bright blue corresponding to the bat 101 in FIG. 1 is input. By using the chroma key signal 523, an image recognition circuit 508 (FIG. 5), which will be described later, can detect the position of the bat 101 shaken by the user, and determines whether or not the bat 101 and the ball 105 by the CG collide. Can be judged.
[0047]
Next, the matrix circuit 708 receives the digital RGB signal 524 from the VDP 506 and outputs a luminance signal Y and color difference signals RY and BY corresponding thereto.
[0048]
The selection circuit 707 selects one of the outputs of the matrix circuit 705 or 708 based on the superimpose signal 525 from the image recognition circuit 508 (FIG. 5) and outputs the selected output to the modulation circuit 709. The modulation circuit 709 generates and outputs a digital composite video output signal 521 corresponding to the input. In the first to fourth embodiments, the superimpose signal 525 from the image recognition circuit 508 (FIG. 5) has a specification that causes the selection circuit 707 to always select the output of the matrix circuit 708. As a result, the CG image 104 corresponding to the digital RGB signal 524 generated by the VDP 506 is always displayed on the display device 103 of FIG. However, by controlling the superimpose signal 525, the actual image corresponding to the digital composite video input signal 520 generated based on the imaging result of the camera 102 and the CG image generated by the VDP 506 are combined and combined. The displayed image can be displayed on the display device 103.
[0049]
Returning to FIG. 5, the video display processor (VDP) 506 stores the object screen data and background screen data constituting the CG image 104 in the DRAM 507 as needed based on the designation from the CPU 509, and based on the designation from the CPU 509. These data are arranged at designated coordinate positions, a digital RGB signal 524 corresponding to the arrangement result is generated, and output to the video signal conversion circuit 505. As a result, the video signal conversion circuit 505 generates the digital composite video output signal 521 corresponding to the digital RGB signal 524 as described above, and the video signal input / output circuit 503 corresponds to the digital composite video output signal 521. By generating the analog composite video output signal 522, the CG image 104 is displayed on the display device 103 (FIG. 1).
[0050]
The configuration of the VDP 506 is shown in FIG.
Object screen data and background screen data transferred from the CPU 509 on the bus 526 are stored in the DRAM 507 (FIG. 5) via the CPU interface circuit 801 and the DRAM control circuit 802.
[0051]
The object table data transferred from the CPU 509 on the bus 526 is stored in the object table RAM 804 via the CPU interface circuit 801 and the object control circuit 803. This object table data is a table showing a correspondence table between each object screen data stored in the DRAM 507 and the corresponding ID number. When the CPU 509 designates the display position of each object screen data on the CG image 104 (FIG. 1) as time passes, the CPU 509 designates an ID number corresponding to each object screen data and each display position. As a result, the object control circuit 803 reads the object screen data corresponding to the designated ID number from the DRAM 507 via the DRAM control circuit 802, develops it in the line buffer RAM 808, and then stores the contents in the RGB color difference data processing circuit 806. Output. Further, the object control circuit 803 notifies the CPU 509 of the center of gravity of the object indicating the ball 105 (FIG. 1) currently displayed based on the designation from the CPU 509 via the bus 526 from the CPU interface circuit 801.
[0052]
On the other hand, the background control circuit 805 reads background screen data designated by the CPU 509 from the DRAM 507 via the RAM control circuit 802, performs display position control or scroll control on the data, and then performs RGB control. The data is output to the color difference data processing circuit 806.
[0053]
The RGB color difference data processing circuit 806 refers to the color look-up table in the color look-up table RAM 807, and thereby the object screen data designated from the object control circuit 803 and the background screen data designated from the background control circuit 805. Are generated, and are output to the video signal conversion circuit 505 (FIG. 5). In this case, the RGB color difference data processing circuit 806 also performs control for determining whether to display object screen data or background screen data for each display position. The RGB color difference data processing circuit 806 sets the logical value of the object screen data output signal YSOBJ (hereinafter referred to as the YSOBJ signal) to “1” and outputs the background screen data when outputting the object screen data. In this case, the logic value of the background screen data output in progress signal YSBG (hereinafter referred to as YSBG signal) is set to “1”. The YSOBJ signal and the YSBG signal are output to the image recognition circuit 508.
[0054]
Returning to FIG. 5, the image recognition circuit 508 uses the chroma key signal 523 for one frame input from the video signal conversion circuit 505 for the two internal chroma key signals for each frame period determined in synchronization with the synchronization signal 519. The YSOBJ signals for one screen map (described later) output from the RGB color difference data processing circuit 806 in the VDP 506 are alternately held in two internal YSOBJ signal buffers. At the same time, the image recognition circuit 508 uses the chroma key signal 523 for one frame held in one of the two chroma key signal buffers in the previous frame period to detect the bat 101 (FIG. 1) that the user shakes. Create a screen map showing the location. When the image recognition circuit 508 determines that the bat 101 exists at a block position (described later) on the screen map in the course of this process, the image recognition circuit 508 uses two YSOBJ signals for the previous frame period. In the YSOBJ signal for one screen map held in one of the buffers, it is determined whether or not the logical value of the YSOBJ signal corresponding to the block position is “1”, that is, the bat 101 exists. It is determined whether or not object screen data indicating the ball 105 (FIG. 1) exists at the current block position. In this way, the image recognition circuit 508 detects the presence or absence of a collision between the bat 101 and the ball 105. Further, the image recognition circuit 508 calculates the position of the center of gravity of the bat 101 on the screen map every time the creation of the screen map for one screen is completed, stores the calculation result in the DRAM 510 via the bus 526, and the collision state Is detected, a collision flag is set as an interrupt flag to the CPU 509.
[0055]
The CPU 509 operates in accordance with the operating system stored in the OS ROM 511. In particular, an application program is loaded from the application ROM 514 (either # 1 or # 2) in the application cartridge 513 inserted in a slot (not shown) into the program area on the DRAM 510. To load a video game such as the baseball game described in the first to fourth embodiments. In this case, the CPU 509 processes the key scan signal 527 input from a start switch and a stop switch (not shown) in particular, and displays the CG image 104 (FIG. 1) from the application ROM 514 in the application cartridge 513 as time passes. The object screen data and background screen data to be configured are sequentially read out, and these data are transferred from the bus 526 to the DRAM 507 via the VDP 506 within the vertical blanking period synchronized with the synchronization signal 519.
[0056]
At the same time, the CPU 509 sequentially designates the display position on the CG image 104 (FIG. 1) of each object screen data transferred to the DRAM 507 as time elapses.
[0057]
In addition, the CPU 509 executes the collision flag interrupt process at the timing when the collision flag indicating that the image recognition circuit 508 has detected the collision state is set. In this interrupt processing, the CPU 509 determines the position of the center of gravity of the bat 101 on the screen map calculated by the image recognition circuit 508 stored in the DRAM 510 and the currently displayed ball 105 (from the object control circuit 803 in the VDP 506). The positional relationship with the gravity center position of the object shown in FIG. Then, based on the determination result, the CPU 509 executes necessary image processing.
[0058]
Further, the CPU 509 causes the tone generator circuit 515 to generate a musical sound signal by sequentially transferring necessary data to the tone generator circuit 515 in the application cartridge 513. Further, the CPU 509 causes the tone generator circuit 516 in the main body to generate a musical tone signal as necessary. The musical tone signal generated by the tone generator circuit 515 is sent to the amplifier 517 via the CPU 509 and the tone generator circuit 516, amplified there, and then output as an audio output signal 528 to a speaker (not shown).
[0059]
In addition, the CPU 509 also performs an inspection process as to whether or not the application cartridge 513 is imitated.
Next, specific operations of the embodiment having the above-described configuration will be sequentially described below.
<Specific operation of the first embodiment>
First, the specific operation of the first embodiment will be described.
[0060]
FIG. 10 is an overall operation flowchart realized as an operation in which the image recognition circuit 508 executes a program stored in a memory (not shown).
The image recognition circuit 508 creates a screen map indicating the position of the bat 101 (FIG. 1) shaken by the user based on the chroma key signal 523 from the video signal conversion circuit 505, and supplies it as a YSOBJ signal from the VDP 506 based on the screen map. 1 is detected whether or not the object screen data indicating the ball 105 in FIG.
[0061]
Here, as shown in FIG. 26, a frame that is an image pickup unit for one screen in the CCD 501 in FIG. 5 has a configuration of 576 columns in the horizontal direction × 192 rows in the vertical direction. Therefore, the chroma key signal 523 output from the video signal conversion circuit 505 is a signal indicating a logic value for 576 × 192 pixels. In order to reduce the processing load, as shown in FIG. 26, the image recognition circuit 508 converts the logical values of a total of 12 pixels including 6 pixels in the horizontal direction and 2 pixels in the vertical direction in the chroma key signal 523 into one logical value. Process to compress to value. A unit in which this logical value is stored is called a block. As a result, as shown in FIG. 26, the logical value of 576 × 192 pixels in the chroma key signal 523 is compressed to the logical value of a block of 96 columns in the horizontal direction × 96 rows in the vertical direction. A screen map related to the chroma key is defined by a set of logical values of 96 × 96 blocks.
[0062]
On the other hand, the object screen data and the background screen data specified by the YSOBJ signal and the YSBG signal are expressed with a resolution of 96 columns in the horizontal direction and 96 rows in the vertical direction. Therefore, the VDP 506 generates digital data based on the screen data. When the RGB signal 524 is generated, these screen data are expanded in accordance with the display resolution of the display device 103 (FIG. 1).
[0063]
In FIG. 10, first, in step 1001, the contents of a RAM (not shown) in the image recognition circuit 508 (see FIG. 27 described later) are initialized.
Next, after the power is turned on, if it is determined in step 1002 that an initial screen map has not been created, an initial screen map creation process is executed in step 1003.
[0064]
The initial screen map is a screen map related to a chroma key for a scene in which a user with the bat 101 does not exist, which is captured by the camera 102 of FIG. The purpose of creating the initial screen map is that when a chroma key corresponding to the bat 101 is detected as a processing screen map, which will be described later, if an object having the same color as the bat 101 is present in the background, the background is an error of the bat 101. In order to prevent the detected position from being detected, the position of the background object having the same color as the bat 101 is detected in advance. In the processing screen map creation processing in step 1005 described later, a processing screen map is created for each frame period based on the result of the camera 102 in FIG. 1 capturing a scene where a user with the bat 101 is present. In this embodiment, when the position recognized as the portion related to the chroma key on the processing screen map is simultaneously recognized as the position where the background object having the same color as the bat 101 exists on the initial screen map. In this position, the bat 101 is processed as not existing.
[0065]
As a result of the initial screen map creation processing in step 1003, an initial screen map having a size of 96 × 96 blocks is created in the data format shown in FIG. 27 on a RAM (not shown) in the image recognition circuit 508. Is done. Since this RAM stores data with 16 bits as one word, the logical value for one row is stored as data of 6 words (= 96/16). Therefore, on the RAM, the initial screen map occupies a data area of 6 × 96 words.
[0066]
FIG. 11 shows a detailed operation flowchart of the initial screen map creation processing in step 1003.
In the following processing, in order to stably acquire the initial screen map, the processing is repeatedly executed for the chroma key signal 523 for a plurality of frames (for a plurality of screens), and is obtained in each repetition processing for each block position on the screen map. The final logical value for each block position is determined by calculating the logical sum (OR) of the logical values. For this reason, the number of times of sampling, which is the number of repetitions of the process, is set in step 1101, and the value of the register n reaches the set number of times each time processing of one frame is completed because the determination in step 1114 described later becomes YES. In step 1116, the value of the register n is incremented by +1, and the processing for each frame shown in steps 1102 to 1114 is executed.
[0067]
Here, although not particularly illustrated, as described above, the image recognition circuit 508 has two frames (two screens) of chroma key signal buffers each having the size shown in FIG. For each frame period determined in synchronization with the synchronization signal 519 (FIG. 5), the chroma key signal 523 for one frame shown in FIG. 26 (a) input from the video signal conversion circuit 505 is converted into the two chroma keys described above. Alternately held in the signal buffer. Then, the processing for each frame shown in steps 1102 to 1114 in FIG. 11 is performed on the chroma key signal 523 for one frame held in one of the two chroma key signal buffers in the previous frame period. Is done. At the same time, the chroma key signal 523 corresponding to the current frame period is sequentially input to the other chroma key signal buffer. Each time the determination in step 1114 is NO, the chroma key signal buffer to be processed is switched.
[0068]
Note that one chroma key signal buffer having the size shown in FIG. 26A stores 1-bit data for storing a logical value of “0” or “1” of the chroma key signal 523 corresponding to each pixel. As long as it is possible, the storage capacity is 1 bit × 576 × 192 = 110592 bits = 6912 words.
[0069]
Next, details of the processing for each frame shown in steps 1102 to 1114 will be described.
First, in step 1102, the values of the register X indicating the horizontal column position and the register Y indicating the vertical row position of the generated initial screen map are reset to 0, and then the value of the register X in step 1113. Is cleared and the value of the register Y is incremented by +1. Until it is determined in step 1114 that the value of the register Y has reached 96 (exceeded 95), step 1103 to step 1112 → step 1113 → step 1114 → Step 1103 is repeatedly executed. In this way, the process for 96 lines in the initial screen map is executed.
[0070]
Further, while the value of the register X is incremented by +1 at step 1111, the processing from step 1103 to step 1112 → step 1103 until it is determined at step 1112 that the value of the register X has reached 96 (exceeded 95). Is repeatedly executed. In this way, processing for 96 blocks in one line in the initial screen map is executed.
[0071]
Steps 1103 to 1110 executed for each current value of the registers X and Y are processing for one block in the initial screen map. In the following description, the current values of the registers X and Y are simply referred to as X and Y, and a block specified by the current values of X and Y is referred to as a processing target block.
[0072]
In step 1103, each logical value of the chroma key signal 523 at the column positions (6X + 1) to (6X + 6) in the horizontal direction and the row positions (2Y + 1) and (2Y + 2) in the vertical direction from the chroma key signal buffer to be processed. Is read out. For example, if X = 0 and Y = 0, the data at the column positions 1 to 6 in the horizontal direction and the row positions 1 and 2 in the vertical direction (block 1 in FIG. 26A) are read. If X = 1 and Y = 0, the data at the column positions 7 to 12 in the horizontal direction and the row positions 1 and 2 in the vertical direction (block 2 in FIG. 26A) are read. Further, if X = 0 and Y = 1, the data at the column positions 1 to 6 in the horizontal direction and the row positions 3 and 4 in the vertical direction (block 97 in FIG. 26A) are read.
[0073]
In step 1104, it is determined whether or not the logical value “1” of the chroma key signal 523 for 12 pixels in the processing target block read in step 1103 is 6 pixels or more.
[0074]
If the determination in step 1104 is YES, “1” is set as a logical value corresponding to the processing target block in a predetermined register in step 1105. If the determination in step 1104 is NO, “0” is set in the register as a logical value in step 1106. "Is set.
[0075]
If it is determined in step 1107 that the current process is the process in the first frame among the processes for a plurality of frames described above for creating the initial screen map, in step 1110, The logical value of the processing target block set in the predetermined register in step 1106 corresponds to the processing target block of the Xth column in the horizontal direction and the Yth row in the vertical direction in the initial screen map area in the RAM (FIG. 27). The address is written as it is.
[0076]
On the other hand, if it is determined in step 1107 that the current process is a process in the second and subsequent frames among the processes for the plurality of frames, the initial screen map area in the RAM (FIG. 27) is used. The logical value of the address corresponding to the processing target block of the Xth column in the horizontal direction and the Yth row in the vertical direction is read, and the processing target block set in the predetermined register in step 1105 or step 1106 A logical sum (OR) is calculated with the logical value of, and the contents of the predetermined register are rewritten with the calculation result. Thereafter, in step 1110, the contents of the address corresponding to the processing target block in the X-th column in the horizontal direction and the Y-th row in the vertical direction in the initial screen map area in the RAM (FIG. 27) are set in the logic set in the register. Rewritten to a value.
[0077]
The processes in steps 1103 to 1110 are repeated for 96 × 96 blocks of the initial screen map as described above to create an initial screen map for one frame, and there are a plurality of such initial screen maps. An initial screen map for one screen is finally obtained in the RAM (FIG. 27) by calculating the logical sum between the frames for each block position, and processing in step 1003 in FIG. Exit.
[0078]
The initial screen map creation process in step 1003 is configured to be automatically executed when it is determined in step 1002 that the initial screen map has not been created. For example, the user can use the camera 102 in FIG. The initial screen map creation process of step 1003 may be executed at a timing when a predetermined set button (not shown) is pressed at a position where the image is not picked up.
[0079]
Next, the processing from step 1004 to step 1015 in FIG. 10 is repeatedly executed in synchronization with the frame period determined by the synchronization signal 519 (FIG. 5). Here, mainly, a processing screen map showing the position of the bat 101 (FIG. 1) shaken by the user and a processing screen map creation processing for sequentially creating data necessary for the center-of-gravity calculation processing executed in step 1011 described later (step 1005). The collision coordinate detection process (step 1006) for determining whether or not the object screen data indicating the ball 105 (FIG. 1) exists at the block position where the presence of the bat 101 is detected by this process, the bat on the process screen map The center of gravity calculation process (step 1011) for calculating the center of gravity position of 101 and the process of setting a collision flag (step 1013) as an interrupt flag to the CPU 509 when it is determined that the bat 101 and the ball 105 collide with each other. Executed.
[0080]
In this case, although not particularly illustrated, as described above, the image recognition circuit 508 has two frames (two screens) of chroma key signal buffers each having the size shown in FIG. For each frame period determined in synchronization with the synchronization signal 519 (FIG. 5), the chroma key signal 523 for one frame shown in FIG. 26 (a) input from the video signal conversion circuit 505 is used for two chroma key signals. Hold alternately in the buffer. Although not shown in particular, as described above, the image recognition circuit 508 has YSOBJ signal buffers each having a size shown in FIG. 26B for two screen maps, and a synchronization signal 519 (FIG. For each frame period determined in synchronization with 5), the YSOBJ signals for one screen map output from the RGB color difference data processing circuit 806 in the VDP 506 are alternately held in the two YSOBJ signal buffers. Then, the processing for each frame shown in Step 1004 to Step 1015 in FIG. 10 includes the chroma key signal 523 for one frame held in one of the two chroma key signal buffers in the previous frame period, and the previous time. This is executed for the YSOBJ signals for one screen map held in one of the two YSOBJ signal buffers in the frame period. At the same time, the chroma key signal 523 and the YSOBJ signal corresponding to the current frame period are sequentially input to the other chroma key signal buffer and YSOBJ signal buffer, respectively. Each time the processing in step 1015 is completed, the chroma key signal buffer and the YSOBJ signal buffer to be processed are switched.
[0081]
In FIG. 10, the process screen map creation process in step 1005 and the collision coordinate detection process in step 1006 are executed for each block position (see FIG. 26).
Therefore, as in the case of the initial screen map creation process described with reference to FIG. 11, first, in step 1004, the register X indicating the horizontal column position and the register Y indicating the vertical row position of the generated processing screen map. After the value of the register Y is reset to 0, the value of the register X is cleared in step 1009 and the value of the register Y is incremented by +1, while the value of the register Y reaches 96 in step 1010 (over 95) Steps 1005 to 1008 → Step 1009 → Step 1010 → Step 1005 are repeatedly executed until it is determined. In this way, processing for 96 lines in the processing screen map is executed.
[0082]
In addition, while the value of the register X is incremented by +1 at step 1007, the process from step 1005 to step 1008 → step 1005 until it is determined at step 1008 that the value of the register X has reached 96 (exceeded 95). Is repeatedly executed. In this way, processing for 96 blocks in one line in the processing screen map is executed.
[0083]
Then, the processing screen map creation processing in step 1005 and the collision coordinate detection processing in step 1006 executed for each current value of the registers X and Y are processing for one block in the processing screen map.
[0084]
In step 1004, the values of the upper end coordinates and the left end coordinates stored in the RAM of FIG. 27 used in the processing screen map creation process in step 1005 described later are initialized to 97, and the lower end coordinates and the right end coordinates are similarly set. The values are initialized to 0, and the values of the centroid calculation processing data S_M, S_MxX, and S_MyY that are also used in the processing screen map creation processing are initialized to 0. These data are secured in a work area (not shown) in the same RAM as the RAM of FIG.
[0085]
In the following description, the current values of the registers X and Y are simply referred to as X and Y, and a block specified by the current values of X and Y is referred to as a processing target block.
Detailed operation flowcharts of the processing screen map creation processing in step 1005 are shown in FIGS. Here, the processing screen map stored in the RAM shown in FIG. 27, the upper end coordinates, the lower end coordinates, the left end coordinates indicating the existence range of the bat 101 stored in the RAM shown in FIG. A process for detecting the right end coordinate and a process for calculating data for obtaining the barycentric coordinate of the bat 101 are executed.
[0086]
First, in step 1201, each of the chroma key signals 523 at the column positions (6X + 1) to (6X + 6) in the horizontal direction and the row positions (2Y + 1) and (2Y + 2) in the vertical direction from the chroma key signal buffer to be processed. A logical value is read. As in the case of the initial screen map creation processing, for example, if X = 0 and Y = 1, the data at the column positions 1 to 6 in the horizontal direction and the row positions 3 and 4 in the vertical direction (block 97 in FIG. 26A). ) Is read out.
[0087]
In step 1202, it is determined whether or not the logical value “1” of the chroma key signal 523 for 12 pixels in the processing target block read in step 1201 is 6 pixels or more.
[0088]
If the determination in step 1202 is YES and a reject switch (not shown) is turned off in step 1203, “1” is set as a logical value corresponding to the processing target block in step 1206, and the determination in step 1202 is performed. If NO, “0” is set as a logical value in the register in step 1207.
[0089]
Here, the reject switch is operated by the user. If the position recognized as the portion related to the chroma key on the processing screen map is simultaneously recognized as the position where the background object having the same color as the bat 101 exists on the initial screen map, the position of the bat 101 If the user wishes to treat as nonexistent, the user turns on this switch.
[0090]
If the determination in step 1202 is YES, that is, if the processing target block is recognized as a portion related to the chroma key, and it is determined in step 1203 that a reject switch (not shown) is turned on, in step 1204, From the initial screen map area in the RAM (FIG. 27), the logical value at the same block position as the processing target block in the Xth column in the horizontal direction and the Yth row in the vertical direction is read.
[0091]
Subsequently, in step 1205, it is determined whether or not the logical value is “1”.
If the determination in step 1205 is YES, that is, the position of the processing target block recognized as the portion related to the chroma key on the processing screen map is simultaneously the position where the background object having the same color as the bat 101 exists on the initial screen map. If it is recognized, “0” is set as a logical value in the above-mentioned predetermined register in step 1207, so that the bat 101 does not exist at the block position.
[0092]
On the other hand, the determination in step 1205 is NO, that is, the processing target block position recognized as a portion related to the chroma key on the processing screen map is recognized as the position where the background target object having the same color as the bat 101 exists on the initial screen map. If not, in step 1206, “1” is set as the logical value in the predetermined register described above, so that the bat 101 is processed at the block position.
[0093]
Step 1219 of FIG. 13 described later is executed after the processing of step 1207, that is, for the processing target block recognized that the bat 101 does not exist on the processing screen map.
[0094]
On the other hand, after the processing of step 1206, that is, for the processing target block recognized as having the bat 101 on the processing screen map, steps 1208 to 1218 of FIG. 13 are further executed. Here, the process of updating the upper end coordinates, the lower end coordinates, the left end coordinates, and the right end coordinates stored in the RAM of FIG. 27 indicating the existence range of the bat 101 on the processing screen map, and the barycentric coordinates of the bat 101 are obtained. A process for calculating data for this is executed.
[0095]
That is, first, in step 1208, it is determined whether or not the value (Y + 1) is smaller than the value of the upper end coordinate stored in the RAM (FIG. 27). If this determination is YES, the upper end is determined in step 1209. The coordinate value is rewritten to the value (Y + 1).
[0096]
After step 1209 or when the determination in step 1208 is NO, it is determined in step 1210 whether the value (Y + 1) is larger than the value of the lower end coordinates stored in the RAM (FIG. 27). If this determination is YES, in step 1211, the value of the lower end coordinate is rewritten to a value (Y + 1).
[0097]
After step 1211 or when the determination in step 1210 is NO, it is determined in step 1212 whether the value (X + 1) is smaller than the value of the left end coordinate stored in the RAM (FIG. 27). If this determination is YES, in step 1213, the value of the left end coordinate is rewritten to the value (X + 1).
[0098]
After step 1213 or when the determination in step 1212 is NO, it is determined in step 1214 whether the value (X + 1) is larger than the value of the right end coordinate stored in the RAM (FIG. 27). If this determination is YES, in step 1215, the value of the right end coordinate is rewritten to the value (X + 1).
[0099]
As a result of the processing in steps 1208 to 1215 described above, in the block range having the logical value “1” on the processing screen map, for example, as shown in FIG. 28, the upper end coordinate, the lower end coordinate, the left end coordinate, The right end coordinates are obtained in the RAM of FIG. This value is simultaneously transferred to the DRAM 510 of FIG.
[0100]
After step 1215 or when the determination in step 1214 is NO, the value of data S_M is incremented by +1 in step 1216, and the value of data S_MxX is incremented by X in step 1217. Thus, the value of the data S_MyY is incremented by Y. The principle for obtaining the barycentric coordinates from these data will be described later.
[0101]
After the processing in step 1218 or after the processing in step 1207 (FIG. 12) described above, in step 1219, the Xth column in the horizontal direction and the Yth row in the vertical direction in the processing screen map area in the RAM shown in FIG. The content of the address corresponding to the target block to be processed is rewritten to the logical value set in the predetermined register in step 1206 or 1207 described above.
[0102]
The processing screen map creation process of step 1005 of FIG. 10 shown in the operation flowchart of FIG. 12 and FIG. 13 is executed as a part of the repetition process of step 1005 to step 1010, so that FIG. A processing screen map for one screen is created in the RAM shown in FIG. 27, and upper end coordinates, lower end coordinates, left end coordinates, and right end coordinates indicating the existence range of the bat 101 are obtained in the RAM shown in FIG. Data S_M, S_MxX, and S_MyY are obtained in an area (not shown) on the RAM shown in FIG.
[0103]
Next, FIG. 14 shows a detailed operation flowchart of the collision detection process in step 1006 of FIG.
First, in step 1401, the logical value of the processing target block in the Xth column in the horizontal direction and the Yth row in the vertical direction is read from the processing screen map area in the RAM (FIG. 27).
[0104]
In step 1402, it is determined whether or not the logical value is “1”, that is, whether or not the bat 101 exists at the position of the processing target block.
If the determination in step 1402 is NO, the collision detection process in FIG. 14 is terminated as it is, and the process returns to the operation flowchart in FIG. 10 to continue the process for the next block position.
[0105]
If the determination in step 1402 is YES, in step 1403, the YSOBJ signal corresponding to the processing target block in the Xth column in the horizontal direction and the Yth row in the vertical direction is extracted from the YSOBJ signal buffer to be processed. The logical value of (CG data) is read out.
[0106]
In step 1404, it is determined whether or not the logical value of the read YSOBJ signal is “1”, that is, whether or not the object screen data indicating the ball 105 (FIG. 1) exists in the processing target block. .
[0107]
If the determination in step 1404 is NO, the collision detection process of FIG. 14 is terminated as it is, and the process for the next block position is continued by returning to the operation flowchart of FIG.
[0108]
If the determination in step 1404 is YES, it is determined in step 1405 whether or not the value of the predetermined collision register is “0”, that is, whether or not a collision has not been detected so far and this time is the first collision detection. Is determined.
[0109]
If the determination in step 1405 is YES, in steps 1406 and 1407, the X and Y coordinates of the first collision coordinate held in the RAM of FIG. 27 are updated to the values in the registers X and Y, respectively. Subsequently, in step 1408, the value of the collision register is set to a value “1” indicating that a collision has occurred. Thereafter, the collision detection process of FIG. 14 is terminated, and the process returns to the operation flowchart of FIG. 10 to continue the process for the next block position.
[0110]
On the other hand, if the determination in step 1405 is NO, in steps 1409 and 1410, the X and Y coordinates of the last collision coordinate held in the RAM of FIG. 27 are updated to the values in the registers X and Y, respectively. The Thereafter, the collision detection process of FIG. 14 is terminated, and the process returns to the operation flowchart of FIG. 10 to continue the process for the next block position.
[0111]
The collision detection process of Step 1006 of FIG. 10 shown in the operation flowchart of FIG. 14 is executed over the entire range of the processing screen map based on the repetition of the processes of Step 1005 to Step 1010, so that the collision is detected. The block range on the processing screen map where the presence / absence and the collision occurred is detected.
[0112]
Next, the center-of-gravity calculation process in step 1011 in FIG. 10 is executed once per frame period, that is, every time the processing screen map for one screen is created and the determination in step 1010 is YES. In this process, the position of the center of gravity of the bat 101 on the process screen map stored in the RAM (FIG. 27) is calculated.
[0113]
In general, the x-coordinate XG and the y-coordinate YG of the center of gravity of a region existing on a two-dimensional coordinate can be calculated by the following equations (1) and (2).
[0114]
[Expression 1]
XG = Σ (mxi・ Xi) / Σmxi= Σ (mxi・ Xi) / M
[0115]
[Expression 2]
YG = Σ (myj・ Yj) / Σmyj= Σ (myj・ Yj) / M
Here, the suffixes i and j are positions in the centroid calculation area in the column direction (x direction) and the row direction (y direction), respectively.iAnd yjAre the x-coordinate value and the y-coordinate value at the column direction position i and the row direction position j, respectively.xiAnd myjAre sums of masses at the column direction position i and the row direction position j, respectively. M is the sum of the masses of the regions existing on the two-dimensional coordinates.
[0116]
Here, when the x-coordinate value and the y-coordinate value are values having the above-described block as a unit, mxiAnd myjAre equivalent to the total number of blocks in column direction block position i and row direction block position j, respectively. Then, in the processing screen map creation processing of FIG. 12 and FIG. 13 corresponding to step 1005 of FIG. 10 described above, the mass M, which is the denominator term in Equation 1 and Equation 2, is set as the area S_M in Step 1216 of FIG. And the term Σ (mxi・ Xi) Is calculated as data S_MxX by repeating step 1217 of FIG. 13, and the term Σ (myj・ Yj) Is calculated as data S_MyY by repeating step 1218 of FIG.
[0117]
FIG. 15 shows a more detailed operation flowchart of the center-of-gravity calculation process in step 1011 of FIG. 10 based on the above-described data S_M, S_MxX, S_MyY, and the calculation formulas of Formula 1 and Formula 2.
[0118]
That is, in step 1501, the center-of-gravity coordinates (XG, YG) of the bat 101 existing on the processing screen map are obtained by the following formulas 3 and 4 corresponding to the formulas 1 and 2.
[0119]
[Equation 3]
XG = S_MxX / S_M
[0120]
[Expression 4]
YG = S_MyY / S_M
For example, in the example shown in FIG. 28, the center-of-gravity coordinates (XG, YG) = (32.6, 16.1) are obtained by executing the calculation of the following equation.
[0121]
Figure 0003586880
After the gravity center calculation process in step 1011 of FIG. 10 shown in the operation flowchart of FIG. 15 described above, it is determined in step 1012 of FIG. 10 whether or not the value of the collision register is “1”. The value of this register is the YSOBJ signal indicating the presence of the ball 105 even if there is one block whose logical value indicating the presence of the bat 101 on the processing screen map is “1” in the collision coordinate detection process of step 1006 described above. Is set to “1” (see step 1408 in FIG. 14).
[0122]
If the determination in step 1012 is YES, a collision flag that is an interrupt flag to the CPU 509 in FIG. 5 is set to “1” in step 1013. As a result, a collision flag interruption process (FIG. 20), which will be described later, occurs in the CPU 509. In this interruption process, the CG image 104 displayed on the display device 103 in response to the bat 101 of FIG. The process which controls is performed. The image recognition circuit 508 transfers the center-of-gravity coordinates (XG, YG) calculated in step 1011 to the DRAM 507 in FIG. 5 together with the above-described collision flag setting process. Further, the image recognition circuit 508 stores the first and last collision coordinates stored in the RAM (FIG. 26) in the collision coordinate detection process in step 1006 and the above-described RAM in the process screen map creation process in step 1005. The upper end coordinates, lower end coordinates, left end coordinates, and right end coordinates are transferred to the DRAM 507 as necessary.
[0123]
After the processing in step 1013, it is determined in step 1014 whether or not the collision flag has returned to “0”. The value of this collision flag is returned to “0” when a later-described collision flag interrupt process executed by the CPU 509 ends. As a result, for example, the image recognition circuit 508 in FIG. 5 cannot advance the processing of the operation flowchart in FIG. It should be noted that while the collision flag interrupt processing is being executed, the processing of step 1004 to step 1015 is configured to proceed in synchronization with the frame period so that another interrupt can be applied to the CPU 509 according to the value of the collision register. It may be.
[0124]
If the value of the collision flag returns to “0” and the determination in step 1014 becomes YES, the value of the collision register is also returned to “0” in step 1015.
After the process of step 1015 or when the determination of step 1012 is NO, the process returns to the process of step 1004 in synchronization with the start time of the next frame period. In this case, as described above, the chroma key signal buffer and the YSOBJ signal buffer to be processed are changed.
[0125]
Next, FIGS. 16 and 17 are operation flowcharts of CPU processing executed by the CPU 509 of FIG.
The CPU 509 basically processes the key scan signal 527 input from a start switch and a stop switch (not shown), and the CG image 104 (FIG. 1) from the application ROM 514 in the application cartridge 513 as time passes. The object screen data, the object table data, and the background screen data that constitute the data are sequentially read out, and these data are transferred from the bus 526 to the VDP 506 within the vertical blanking period synchronized with the synchronization signal 519. The display position on the CG image 104 (FIG. 1) of each object screen data transferred to the DRAM 507 is sequentially designated to the VDP 506.
[0126]
In FIG. 16, first, in step 1601, the contents of the DRAM 507 in FIG. 5 are initialized.
In step 1602, various interrupt processes to be described later are permitted.
[0127]
In Step 1603, an application program is loaded into the program area on the DRAM 510 in FIG. 5 from the application ROM 514 (either # 1 or # 2) in the application cartridge 513 in FIG. . Thereafter, the CPU 509 executes the operations after step 1604 in accordance with this application program.
[0128]
In step 1604, the read start address and the number of read data on the application ROM 514 in the application cartridge 513 of the background screen data constituting the CG image 104 (FIG. 1) are set in the DMAC (direct memory access controller) in the CPU 509. Is done.
[0129]
In step 1605, the read start address and the number of read data of the first object screen data constituting the CG image 104 (FIG. 1) on the application ROM 514 are set in the DMAC.
[0130]
In step 1606, the read start address and the number of read data of the object table data on the application ROM 514 are set in the DMAC. As described above, this object table data is a table indicating a correspondence table between each object screen data stored in the DRAM 507 and an ID number corresponding to each object screen data.
[0131]
After the processing of steps 1604 to 1606, “1” is set in the register ACCF in step 1607. In step 1608, the process waits until the value of the register ACCF returns to “0”.
[0132]
Here, the CPU 509 interrupts the processing of step 1608 every time the vertical blanking period within each frame period determined based on the synchronization signal 519 is started, and the vertical flow shown in the operation flowchart of FIG. Perform blanking interrupt processing.
[0133]
If “1” is set in the register ACCF by the above-described CPU processing, the determination in step 1801 becomes YES at the timing when this interrupt processing is executed, so that the above-described step 1604 to step in FIG. Each data stored in the application ROM 514 in the application cartridge 513 is transferred to the VDP 506 based on each data set in the DMAC in the CPU 509 by the processing of 1606.
[0134]
That is, since the processing from step 1604 to step 1606 in FIG. 16 is executed immediately after the power is turned on, the determination in step 1802 in FIG. 18 is YES.
As a result, first, in step 1803, the DMAC transfers the background screen data in the application ROM 514 via the bus 526 based on the read start address and the number of read data of the background screen data set by the processing in step 1604. DMA transfer to the VDP 506. The VDP 506 transfers the background screen data from the CPU interface circuit 801 in FIG. 8 to the DRAM 507 in FIG. 5 via the DRAM control circuit 802.
[0135]
Next, in step 1804, the DMAC transfers the object screen data in the application ROM 514 to the VDP 506 via the bus 526 based on the read start address and the number of read data of the object screen data set by the processing in step 1605. Forward. The VDP 506 also transfers this object screen data from the CPU interface circuit 801 in FIG. 8 to the DRAM 507 in FIG. 5 via the DRAM control circuit 802.
[0136]
In step 1805, the DMAC DMA-transfers the object table data in the application ROM 514 to the VDP 506 via the bus 526 based on the read start address and the number of read data of the object table data set by the processing in step 1606. . The VDP 506 transfers this object table data from the CPU interface circuit 801 to the object table RAM 804 via the object control circuit 803.
[0137]
Thereafter, in step 1806, the value of the register ACCF is returned to “0”, and the vertical blanking interrupt process shown in FIG. 18 is terminated.
As a result, the process of step 1608 in FIG. 16 is resumed, and when the determination in this process is YES, the user first presses a start switch (not shown) and the corresponding key scan signal 527 (FIG. 5) is input. Until the determination is made, the processing loop in which the determination in step 1609 is NO → the determination in step 1612 is NO → the determination in step 1609 is NO is repeated to enter a standby state. Note that the contents of the register STF are initialized to “0” in step 1601 of FIG.
[0138]
When the start switch is pressed and the corresponding key scan signal 527 is input, the determination in step 1609 becomes YES.
As a result, first, in step 1610, time 0 is set in the register t. The register t is a register indicating the elapsed time from the time when the user starts the game by pressing the start switch. The value of the register t is a clock circuit 512 connected to the bus 526 (FIG. 5). ) Is incremented by +1 by the timer interrupt process shown as step 1901 in FIG. 19 which is executed based on the interrupt request input at regular intervals.
[0139]
In step 1611, “1” is set in the register STF.
As a result, the determination in step 1612 is YES, and thereafter, normally, the processing loop of step 1613 to step 1617 → step 1619 → step 1609 (FIG. 16) → step 1612 → step 1613 in FIG. 17 is repeated.
[0140]
In the processing loop described above, in step 1614, an ID number designated for the object table data corresponding to the object screen data to be displayed is calculated based on the value of the current register t indicating the passage of time. Then, the display position of the object screen data is calculated based on the current value of the register t. These data are set at predetermined addresses on the DRAM 507, and the read start address and the number of read data are set in the DMAC in the CPU 509. In step 1614 or step 1615, sound generation instruction data to be transferred to the sound source circuit 515 in the application cartridge 513 is also generated in a sound source interrupt process (see FIG. 22) described later, and is set in the DRAM 507 or the like.
[0141]
If the object screen data needs to be changed, in step 1614, the DMAC in the CPU 509 stores the read start address and the number of read data on the application ROM 514 of the object table data corresponding to the new object screen data. Set. In step 1615, the reading start address and the number of read data of the new object screen data on the application ROM 514 are set in the DMAC.
[0142]
In step 1616, “1” is set in the register ACCF.
Thereafter, until the above-described vertical blanking interrupt process is executed and the value of the register ACCF is returned to “0”, the determination of step 1617 is normally NO → the determination of step 1619 is NO → step 1609 (FIG. 16). The process loop is repeated in which the determination is NO, the determination in step 1612 is YES, the determination in step 1613 (FIG. 17) is NO, the determination in step 1617 is NO, and so on.
[0143]
As described above, the CPU 509 interrupts the processing of the processing loop described above every time the vertical blanking period is started, and executes the vertical blanking interrupt processing shown in the operation flowchart of FIG.
[0144]
As a result, when the determination at step 1801 is YES → the determination at step 1802 is NO, step 1804 is executed.
In step 1804, the DMAC in the CPU 509 DMA-transfers data indicating the display position of the object screen data to the VDP 506 via the bus 526 based on the setting by the processing in step 1615. In step 1805, the DMAC DMA-transfers the ID number of the object screen data to be displayed to the VDP 506 via the bus 526 based on the setting by the processing in step 1614. As a result, the object control circuit 803 in the VDP 506 reads the object screen data corresponding to the ID number from the DRAM 507 via the DRAM control circuit 802 by referring to the object table RAM 804 by the ID number specified by the CPU 509. After being expanded in the line buffer RAM 808 based on the display position information designated by the CPU 509, the contents are output to the RGB color difference data processing circuit 806.
[0145]
The processing in steps 1804 and 1805 when new object screen data and object table data are transferred is the same as that immediately after the execution of steps 1604 to 1606 in FIG.
[0146]
Thereafter, in step 1806, the value of the register ACCF is returned to “0”, and the vertical blanking interrupt process shown in FIG. 18 is terminated.
As a result, the processing loop described above in the CPU process is resumed, and the determination in step 1613 is YES, whereby the next screen control process is executed.
[0147]
When the user presses a stop switch (not shown) and a corresponding key scan signal 527 (FIG. 5) is input in the process of executing the processing loop described above, the determination in step 1617 is YES. As a result, in step 1618, “0” is set in the register STF. Accordingly, from this point onward, the determination in step 1609 (FIG. 16) is NO → the determination in step 1612 is NO → step until the user presses the start switch (not shown) again and the corresponding key scan signal 527 is input. A processing loop in which the determination of 1609 is NO is repeated, and a standby state is entered. Since the value of the register t is not cleared, the next time the start switch is pressed, the progress of the game is resumed from the point when the stop switch is pressed.
[0148]
In addition, when the value of the register t reaches a preset end time T in the process of executing the processing loop described above, the determination in step 1619 is YES. As a result, in step 1620, the value of the register t is reset to 0. Accordingly, after this point, the game is repeated from the beginning.
[0149]
Further, when the user presses a start switch (not shown) again and inputs a corresponding key scan signal 527 in the course of executing the above processing loop, the determination in step 1609 becomes YES. As a result, the value of the register t is forcibly reset to 0 in step 1610. Therefore, the game is repeated again from the beginning after this point.
[0150]
On the other hand, when the collision flag is set to 1 as described above by the image recognition circuit 508 in the process of executing the above processing loop (see step 1013 in FIG. 10), the CPU 509 interrupts the processing of the above processing loop. Then, the collision flag interrupt process shown in the operation flowchart of FIG. 20 is executed.
[0151]
First, in step 2001, the current time t indicated by the register t is set to a predetermined collision determination period T set in advance.1~ T2It is determined whether or not it is within the range. The reason for providing such a collision determination period is that the chroma key corresponding to the bat 101 overlaps the object screen data corresponding to the ball 105 at a time other than the time when the bat 101 of FIG. This is to prevent erroneous processing from being executed in the event of failure.
[0152]
In step 2002, the coordinates of the center of gravity of the chroma key indicating the bat 101 transferred from the image recognition circuit 508 to the DRAM 510 are taken into the CPU 509.
[0153]
In step 2003, the positional relationship between the above-described center coordinates of the chroma key indicating the bat 101 and the center coordinates of the object screen data indicating the currently displayed ball 105 acquired from the object control circuit 803 in the VDP 506 is determined. .
[0154]
As a result, as shown in FIG. 2, when the shift between the two barycentric coordinates is within a predetermined allowable range, the CG image 104 on the display device 103 in FIG. 1 is changed to an image corresponding to a home run, for example. Accordingly, in step 2004, the first image processing is executed. It should be noted that the center-of-gravity coordinates of the chroma key indicating the bat 101 and the center-of-gravity coordinates of the object screen data indicating the ball 105 on the processing screen map match when the user swings the bat 101 down to a position corresponding to the strike zone. Further, it is assumed that the direction of the camera 102 in FIG. 1 has been adjusted in advance.
[0155]
Further, as shown in FIG. 3, when the center of gravity coordinates of the object screen data indicating the ball 105 are shifted below the center coordinates of the chroma key indicating the bat 101, the CG image 104 on the display device 103 of FIG. In step 2005, the second image processing is executed so as to change the image to an image corresponding to, for example, Goro.
[0156]
Further, as shown in FIG. 4, when the center of gravity coordinates of the object screen data indicating the ball 105 are shifted above the center coordinates of the chroma key indicating the bat 101, the CG image 104 on the display device 103 in FIG. In step 2006, the third image processing is executed so as to change, for example, to an image corresponding to a fly.
[0157]
FIG. 21 is an operation flowchart of the n-th image processing that generally represents the first to third image processing shown in steps 2004 to 2006.
In step 2101, the display position of the object screen data is calculated based on whether the current process is the first, second, or third image process and based on the value of the current register t indicating the passage of time. The In step 2102, the object corresponding to the object screen data to be displayed depends on whether the current processing is the first, second, or third image processing, and based on the value of the current register t. An ID number designated for the table data is calculated. In step 2101 or step 2102, sound generation instruction data transferred to the sound source circuit 515 in the application cartridge 513 is also generated in a sound source interrupt process (see FIG. 22) described later, and set in the DRAM 507 or the like.
[0158]
In step 2103, “1” is set in the register ACCF.
Thereafter, until the above-described vertical blanking interrupt processing is executed and the value of the register ACCF is returned to “0”, the determination of step 2104 is normally NO → the determination of step 2105 is NO → the determination of step 2106 is NO → The processing loop in which the determination in step 2104 is NO is repeated to enter a standby state.
[0159]
As described above, the CPU 509 interrupts the processing of the processing loop described above every time the vertical blanking period is started, and executes the vertical blanking interrupt processing shown in the operation flowchart of FIG.
[0160]
As a result, when the determination at step 1801 is YES → the determination at step 1802 is NO, step 1804 is executed.
In step 1804, the DMAC in the CPU 509 DMA-transfers data indicating the display position of the object screen data to the VDP 506 via the bus 526 based on the setting by the processing in step 2101. In step 1805, the DMAC DMA-transfers the ID number of the object screen data to be displayed to the VDP 506 via the bus 526 based on the setting by the processing in step 2102. As a result, the object control circuit 803 in the VDP 506 reads the object screen data corresponding to the ID number from the DRAM 507 via the DRAM control circuit 802 by referring to the object table RAM 804 by the ID number specified by the CPU 509. After being expanded in the line buffer RAM 808 based on the display position information designated by the CPU 509, the contents are output to the RGB color difference data processing circuit 806.
[0161]
Thereafter, in step 1806, the value of the register ACCF is returned to “0”, and the vertical blanking interrupt process shown in FIG. 18 is terminated.
As a result, the processing loop described above in the n-th image processing is resumed, and the determination in step 2106 is YES, whereby the screen control processing corresponding to the value of the register t next to the n-th image processing is executed.
[0162]
If the user presses a stop switch (not shown) and the corresponding key scan signal 527 (FIG. 5) is input during the execution of the processing loop described above, the determination in step 2105 is YES. As a result, in step 2108, “0” is set in the register STF, and the n-th image processing in FIG. 21 ends. As a result, after executing step 2007 in FIG. 20 to be described later, the collision flag interrupt processing is also terminated, and the processing returns to the CPU 509 processing loop. Accordingly, from this point onward, the determination in step 1609 (FIG. 16) is NO → the determination in step 1612 is NO → step until the user presses the start switch (not shown) again and the corresponding key scan signal 527 is input. A processing loop in which the determination of 1609 is NO is repeated, and a standby state is entered.
[0163]
Further, when the value of the register t reaches the preset end time END of the n-th image processing in the execution process of the n-th image processing in FIG. As a result, the value of the register t is reset to 0 in step 2107, the n-th image processing in FIG. 21 is terminated, and further, after executing step 2007 in FIG. 20 described later, the collision flag interrupt processing is also terminated. Return to the processing loop. Accordingly, after this point, the game is repeated from the beginning.
[0164]
In step 2107, the display of the CG image 104 on the display device 103 is shifted to the next scene by forcibly setting the value of the register t to a predetermined value without resetting it to 0. It is also possible to make it.
[0165]
In step 2007 in the collision flag interrupt process of FIG. 20 executed after the completion of the n-th image process of FIG. 21, the collision flag is returned to “0”. As described above, this process is a process for advancing the process before step 1014 in the operation flowchart shown in FIG. 10 executed by the image recognition circuit 508.
[0166]
Next, FIG. 22 is an operation flowchart of a sound source interrupt process executed by the CPU 509. This interrupt processing is executed when the tone generator circuit 515 in the application cartridge 513 in FIG. 5 sets a tone generator interrupt request flag as an interrupt flag to the CPU 509 in the process of executing tone generator processing (FIG. 25) described later. The
[0167]
First, in step 2201, the monitoring timer is reset. The monitoring timer is used to prevent the use of the imitation application cartridge 513.
[0168]
The value of the monitoring timer described above is the monitoring timer count process shown in the operation flowchart of FIG. 23 that is executed based on an interrupt request that is input at regular intervals from the clock circuit 512 (FIG. 5) connected to the bus 526. In step 2301 of FIG. In step 2302, it is determined whether or not the value of the monitoring timer has overflowed.
[0169]
Here, when the application cartridge 513 is manufactured by an authorized manufacturer, the application cartridge 513 performs a sound source interrupt request which is an interrupt flag to the CPU 509 in the process of executing sound source processing (FIG. 25) described later. The operations for setting and resetting the flag are sequentially executed. On the other hand, the CPU 509 executes step 2201 of the sound source interrupt process in FIG. 22 every time the sound source interrupt request flag is set, so that the monitoring timer is reset at an appropriate time interval.
[0170]
Therefore, when the application cartridge 513 is manufactured by a regular manufacturer, the determination in step 2302 of the monitoring timer count process in FIG. 23 is always NO.
[0171]
On the other hand, when the application cartridge 513 is imitated, there is almost no case where an operation for setting and resetting a sound source interrupt request flag that is an interrupt flag to the CPU 509 is not provided for cost reasons. The sound source circuit 515 does not generate a sound source interrupt request to the CPU 509 at a reasonably short time interval, and as a result, the monitoring timer is not reset or reset at a reasonably short time interval. When the monitoring timer overflows, the determination in step 2302 of the monitoring timer count process in FIG. 23 becomes YES.
[0172]
In this case, in step 2303, the overflow flag OVF is set to 1 as the interrupt flag to the CPU 509 again.
As a result, the CPU 509 executes the overflow interrupt process shown in the operation flowchart of FIG. 24 as the interrupt process again, and stops (halts) the operation of the CPU 509 itself in step 2401.
[0173]
The use of the imitation application cartridge 513 is blocked by the control using the above monitoring timer.
Next, in the sound source interrupt process of FIG. 22, in step 2202, the sound generation instruction data created in advance on the DRAM 507 is transferred to the sound source circuit 515 in the application cartridge 513 via the bus 526. The sound generation instruction data is generated when the CPU 509 executes the control processing of the CG image 104 (FIG. 1) such as step 1614 or step 1615 of FIG. 17 or step 2101 or step 2102 of FIG. Is stored in the DRAM 507.
[0174]
Similar control may be executed not only on the sound source circuit 515 in the application cartridge 513 but also on the sound source circuit 516 provided on the main body side.
[0175]
Each process shown in the operation flowchart of FIGS. 16 to 24 described above is a process executed by the CPU 509.
Finally, FIG. 25 is an operation flowchart of the sound source processing executed by the sound source circuit 515 in the application cartridge 513.
[0176]
When the application cartridge 513 is mounted on a holder (not shown) in particular, the execution of the operation flowchart of FIG. 25 is started. First, in step 2501, the contents of the internal register of the tone generator circuit 515 and the work RAM are initialized.
[0177]
Thereafter, the processes in steps 2502 to 2507 are repeatedly executed.
First, the tone generator circuit 515 generates a tone signal that is an interrupt flag to the CPU 509 of FIG. 5 in step 2502 every time a tone signal for one tone generation unit is generated (for example, every time reading of tone waveform data for several seconds is completed). Set the interrupt request flag. On the other hand, the CPU 509 outputs the sound generation instruction data for the next sound generation unit to the sound source circuit 515 by executing the sound source interrupt process of FIG.
[0178]
In step 2503, the tone generator circuit 515 is in a standby state until a change occurs in the input data. When a change occurs in the input data, in step 2504, a standby state is entered until the input data is stabilized.
[0179]
When the input data is stable, after the sound source interrupt request flag is reset to 0 in step 2505, the input sound generation instruction data is interpreted in step 2506.
[0180]
In step 2507, a musical tone signal corresponding to the data is generated.
When the generation of the tone signal for one sounding unit is completed, the tone generator circuit 515 executes step 2502 again, and sets a tone generator interrupt request flag that is an interrupt flag to the CPU 509 in FIG.
[0181]
The musical tone signal generated by the tone generator circuit 515 as described above is sent to the amplifier 517 via the CPU 509 and the tone generator circuit 516, and after being amplified there, it is output as an audio output signal 528 to a speaker (not shown) in particular. Is output.
<Specific operation of the second embodiment>
Next, the specific operation of the second embodiment of the present invention will be described.
[0182]
In the second embodiment, before the game is started, the user can check which block position on the processing screen map is recognized as the portion related to the chroma key. As described above, when the bat 101 overlaps with a background object having the same color as the bat 101, it is processed that the bat 101 does not exist (see step 1203 to step 1205 in FIG. 12). As a result, the detection accuracy of the position of the bat 101 is lowered, which may affect the progress of the game. Therefore, the function of the second embodiment allows the user to be careful not to have the bat 101 at a position where a background object having the same color as the bat 101 exists.
[0183]
The second embodiment is different from the first embodiment described above in the CPU processing executed by the CPU 509 in FIG. FIG. 29 to FIG. 32 show operation flowcharts of CPU processing in the second embodiment. This operation flowchart corresponds to the CPU processing shown in FIG. 16 in the first embodiment.
[0184]
First, in FIG. 29, the functions of steps 2901 to 2903 are the same as the functions of steps 1601 to 1603 in FIG.
Next, in step 2904, a screen clear command is executed for the VDP 506 in FIG. As a result, the display screen of the display device 103 in FIG. 1 is cleared. In step 2904, the values of the register X indicating the horizontal column position and the register Y indicating the vertical row position of the processing screen map are reset to zero.
[0185]
Subsequently, while the value of the register X is cleared in step 2911 and the value of the register Y is incremented by +1, until it is determined in step 2912 that the value of the register Y has reached 96 (exceeded 95), Steps 2905 to 2907 → step 2911 → step 2912 → step 2905 are repeatedly executed. In this way, processing for 96 lines in the processing screen map is executed.
[0186]
In addition, while the value of the register X is incremented by +1 in step 2910, the process from step 2905 to step 2909 → step 2910 until it is determined in step 2909 that the value of the register X has reached 96 (exceeded 95). Is repeatedly executed. In this way, processing for 96 blocks in one line in the processing screen map is executed.
[0187]
Steps 2905 to 2908 executed for each current value of the registers X and Y are processing for one block in the processing screen map. In the following description, the current values of the registers X and Y are simply referred to as X and Y, and a block specified by the current values of X and Y is referred to as a processing target block.
[0188]
In step 2905, the position of the processing target block at the column position X in the horizontal direction and the row position Y in the vertical direction from the processing screen map area of the RAM shown in FIG. 26 in the image recognition circuit 508 of FIG. 5 via the bus 526. Is read out and it is determined whether or not the logical value is “1”.
[0189]
Here, in the processing screen map creation process of step 1005 of FIG. 10 shown in the operation flowchart of FIG. 12 executed by the image recognition circuit 508 of FIG. 5, until the user presses a start switch not specifically shown, In particular, a reject switch (not shown) is disabled. As a result, in the processing screen map creation process executed in the image recognition circuit 508 before the start switch is pressed, the determination in step 1203 is always NO, so that it is recognized as a portion related to the chroma key based on the chroma key signal 523. The logical value of the block position is always “1”.
[0190]
Note that the reject switch is enabled, and in step 2905, both the initial screen map area and the processing screen map area of the RAM shown in FIG. 26 in the image recognition circuit 508 of FIG. The logical value of the position of the processing target block of the column position X in the horizontal direction and the row position Y in the vertical direction is read, and it is determined whether any one of the logical values is “1”. May be.
[0191]
Returning to the description of FIG. 29, if the determination in step 2905 is NO, the process proceeds to step 2909, and the process for the next processing target block is started.
On the other hand, if the determination in step 2905 is YES, the bat 101 or the background object having the same color as the bat 101 exists at the current position of the processing target block.
[0192]
In this case, in step 2906, the values of X and Y are respectively multiplied by 6 and 2, whereby the coordinates x and y on the original frame are calculated from the position of the processing target block, and the calculation result is The data is stored in the DRAM 507 in FIG. 5 (see the description regarding FIG. 25 described above).
[0193]
In step 2907, the DMAC in the CPU 509 is set with a read start address of data indicating the display position (x, y) stored in the DRAM 507 and an object table data transfer instruction indicating the number of read data.
[0194]
In step 2908, the read start address and the number of read data on the application ROM 514 in the application cartridge 513 for predetermined object screen data (for example, a rectangular object) for performing chroma key display are set.
[0195]
Thereafter, the process proceeds to step 2909 and the process for the position of the next processing target block is started.
As a result of the above operation being performed for one screen of the processing screen map having a size of 96 × 96 blocks, when the determination in step 2912 is YES, the DMAC in the CPU 509 includes the bat 101 or bat A data group for displaying predetermined object screen data is set at a position in the frame where a background object having the same color as 101 exists.
[0196]
Thereafter, in step 2913, “1” is set in the register ACCF. In step 2914, the process waits until the value of the register ACCF returns to “0”.
[0197]
As described above, the CPU 509 interrupts the processing of step 2914 at each time when the vertical blanking period within each frame period determined based on the synchronization signal 519 is started, and is shown in the operation flowchart of FIG. Execute vertical blanking interrupt processing. As a result, the data group for displaying predetermined object screen data at the position in the frame where the background object having the same color as the bat 101 or the bat 101 set in the DMAC as described above is displayed in the VDP 506. Transferred. The VDP 506 displays the CG image 104 (FIG. 1) in which the designated object screen data is arranged at the designated position in the frame.
[0198]
When the transfer is completed, the value of the register ACCF is returned to “0” (see step 1806 in FIG. 18), and the determination of step 2914 in FIG. 29 resumed to end the vertical blanking interrupt process shown in FIG. Becomes YES.
[0199]
Therefore, the determination in step 2915 (FIG. 30) is NO until the user presses a start switch (not shown) and the corresponding key scan signal 527 (FIG. 5) is input, and step 2904 to step in FIG. The processing loop of 2914 → step 2915... In FIG. 30 is repeated to enter the start standby state. During this time, as described above, predetermined object screen data is placed at a position in the frame where the bat 101 or a background object having the same color as the bat 101 exists according to the contents of the processing screen map that sequentially changes every frame period. Data groups to be displayed are sequentially transferred to the VDP 506, and the CG image 104 in which the specified object screen data is arranged at the specified position in the frame is sequentially displayed in the VDP 506.
[0200]
As a result of the above operation, when the camera 102 in FIG. 1 is capturing a scene as shown in FIG. 32A, for example, the CG image as shown in FIG. 104 is displayed, and the user confirms on the display device 103 an image obtained by combining the CG image 104 and the actual image captured by the camera 102 as shown in FIG. Can do.
[0201]
The CG image 104 and the actual image captured by the camera 102 are combined by the selection circuit 707 (FIG. 7) in the video signal conversion circuit 505 by the image recognition circuit 508 in FIG. This is realized by outputting a superimpose signal 525.
[0202]
In this case, the portion corresponding to the bat 101 is constantly moving in accordance with the movement of the user, but the portion of the background object having the same color as the bat 101 is stationary. In this way, the user can confirm the bat 101 and the background object having the same color as the bat 101.
[0203]
When the start switch is pressed and the corresponding key scan signal 527 is input, the determination in step 2915 of FIG. 30 is YES.
The subsequent functions of step 2916 to step 2920, step 2921 to step 2923 in FIG. 30 and step 2924 to step 2931 in FIG. 31 are the same as those in step 1604 to step 1608 and step 1610 to step 1610 in FIG. 1612 and the function of Step 1613 to Step 1620 of FIG.
<Specific operation of the third embodiment>
Next, the specific operation of the third embodiment of the present invention will be described.
[0204]
In the third embodiment, when the initial screen map described in the first embodiment is created, the bat 101 held by the user is stored in the initial screen map as a background object having the same color as the bat 101. Can be prevented.
[0205]
The third embodiment differs from the first embodiment described above in the initial screen map creation process in step 1003 in FIG. 10 executed by the image recognition circuit 508 in FIG. FIG. 33 shows a detailed operation flowchart of the initial screen map creation process in step 1003 of FIG. 10 in the third embodiment. This operation flowchart corresponds to the operation flowchart shown in FIG. 11 in the first embodiment. In FIG. 33 and FIG. 11, steps to which the same step numbers are added have the same functions.
[0206]
The operation flowchart of FIG. 33 in the third embodiment is different from the operation flowchart of FIG. 11 in the first embodiment only in that step 1109 in FIG. 11 is changed to step 1109 ′ in FIG.
[0207]
As described above, in the initial screen map creation process shown in the operation flowchart of FIG. 11 relating to the first embodiment, the chroma key signal 523 for a plurality of frames (for a plurality of screens) is obtained in order to stably acquire the initial screen map. The processing was repeatedly executed for (FIG. 5), and in step 1109, the logical sum (OR) of the logical values obtained by each repetition processing was calculated for each block position on the screen map. As a result, all the chroma keys present in the scene imaged in the plurality of frames are stored in the initial screen map as background objects having the same color as the bat 101.
[0208]
On the other hand, in the initial screen map creation process shown in the operation flowchart of FIG. 33 relating to the third embodiment, the process is repeatedly executed for chroma key signals 523 (FIG. 5) for a plurality of frames (for a plurality of screens). In 1109 ′, a logical product (AND) of logical values obtained by each iteration is calculated for each block position on the screen map.
[0209]
As a result, even if the bat 101 possessed by the user is imaged in the plurality of frame periods, the chroma key corresponding to the bat 101 always moves between the frames, and therefore, between the frames for each block position. The result of calculating the logical product is “0”. In this way, it is possible to prevent the bat 101 held by the user from being stored in the initial screen map as a background object having the same color as the bat 101.
<Specific operation of the fourth embodiment>
Finally, the specific operation of the fourth embodiment of the present invention will be described.
[0210]
In the fourth embodiment, when the game is started, the game can be started only when it is detected that the background object having the same color as the bat 101 is completely removed from the captured scene. To work. As described above, when the bat 101 overlaps with a background object having the same color as the bat 101, it cannot be distinguished whether it is the bat 101 or the background object. As a result, the detection accuracy of the position of the bat 101 is lowered, which may affect the progress of the game. Therefore, the function of the fourth embodiment allows the user to start the game after confirming that the background object having the same color as the bat 101 has completely disappeared from the scene being imaged.
[0211]
The fourth embodiment is different from the first embodiment described above in the processing of the overall operation flowchart executed by the image recognition circuit 508 in FIG. 5 and the CPU processing executed by the CPU 509.
[0212]
First, FIGS. 34 and 35 show flowcharts of the entire operation executed by the image recognition circuit 508 in the fourth embodiment. This operation flowchart corresponds to the operation flowchart shown in FIG. 10 in the first embodiment.
[0213]
34, first, the functions of Step 3401 and Step 3402 are the same as the functions of Step 1001 and Step 1002 of FIG.
Next, in step 3403, every time an initial screen map is created, “0” is set in the register IF, and this value is always notified to the CPU 509 via the bus 526 in FIG.
[0214]
Further, the initial screen map creation process in step 3405 is the same as the process in step 1003 in FIG. 10, and is shown by the operation flowchart in FIG.
[0215]
Next, in step 3406, the values of the register X indicating the horizontal column position and the register Y indicating the vertical row position of the initial screen map generated in step 3405 are reset to 0, and then the register is registered in step 3410. While the value of X is cleared and the value of register Y is incremented by +1, step 3411 to step 3409 are performed until it is determined in step 3411 that the value of register Y has reached 96 (exceeded 95). The processing of 3410 → step 3411 → step 3407 is repeatedly executed. In this way, the process for 96 lines in the initial screen map is executed.
[0216]
Further, while the value of the register X is incremented by +1 at step 3408, until it is determined at step 3409 that the value of the register X has reached 96 (exceeded 95), step 3407 to step 3409 → step 3407,. The process of .. is repeatedly executed. In this way, processing for 96 blocks in one line in the initial screen map is executed.
[0217]
In step 3407, for each block position specified by the current values of the registers X and Y in the initial screen map, the logical value of the block position is read from the initial screen map area in the RAM of FIG. It is determined whether or not the value is “1”.
[0218]
If the determination in step 3407 is NO, the process proceeds to step 3408 to move to the process for the next block position.
If the determination in step 3407 is YES, the process returns to the initial screen map creation process in step 3405 again.
[0219]
As described above, in the fourth embodiment, even if there is one block in the generated initial screen map, the logical value is “1”, that is, there is a background object having the same color as the bat 101 even in one block. If it is determined that the background object having the same color as the bat 101 is not removed from the scene being imaged, or the background object having the same color as the bat 101 does not exist. Unless the screen is moved to the range, the initial screen map creation process is repeated endlessly.
[0220]
When the background object having the same color as the bat 101 does not exist in the imaged scene, the logical value of all blocks in the initial screen map becomes “0”, so the determination in step 3407 is NO for all blocks. Eventually, the determination at step 3411 becomes YES.
[0221]
As a result, in step 3412 of FIG. 35, the value of the register IF is reset to “0”, and this value is notified to the CPU 509 via the bus 526 of FIG.
The subsequent processing in steps 3413 to 3424 is the same as the processing in steps 1004 to 1015 in FIG. 10 in the first embodiment.
[0222]
In the fourth embodiment, the logical values of all blocks in the initial screen map finally obtained are “0”. Therefore, in the above-described operation flowchart of FIG. 12 corresponding to the processing screen map creation processing in step 3414 of FIG. 35, the logical value of each block position of the processing screen map is set to the logical value of the corresponding block position of the initial screen map. There is no need to compare. Therefore, when the determination in step 1202 is YES, it is not necessary to execute the processing in steps 1203 to 1205, and the operation is performed so that step 1206 is immediately executed.
[0223]
In contrast to the above-described operation of the image recognition circuit 508 in FIG. 5, the CPU 509 in FIG. 5 executes the processing of the operation flowcharts shown in FIGS. 36 to 38. The function of this operation flowchart is basically the same as the function of the operation flowchart of FIGS. 29 to 31 relating to the second embodiment described above.
[0224]
That is, in FIG. 36 to FIG. 38 and FIG. 29 to FIG. 31, steps to which the same step number is added have the same function. Specifically, in the fourth embodiment, as in the case of the second embodiment, before the game is started, which block position on the processing screen map is recognized as a portion related to the chroma key by the user. Can be confirmed. However, in the fourth embodiment, as described in the operation flowcharts of FIGS. 34 and 35, the logical values of all blocks on the initial screen map created by the image recognition circuit 508 of FIG. 5 are “0”. The process screen map creation process in step 3414 in FIG. 35 is not executed until later. For this reason, what the user confirms on the processing screen map before starting the game is not the background object but the block position where the bat 101 held by the user is present.
[0225]
The operation flowchart of FIGS. 36 to 38 in the fourth embodiment is different from the operation flowchart of FIGS. 29 to 31 in the second embodiment in that step 2915 in FIG. 30 is changed to step 2915 ′ in FIG. It is only a point.
[0226]
That is, in the second embodiment, if the user presses a start switch (not shown), the determination in step 2915 is YES, and the game is started. On the other hand, in the fourth embodiment, the game does not start until the value of the register IF notified to the CPU 509 from the image recognition circuit 508 of FIG. 5 via the bus 526 becomes “0”.
[0227]
The value of the register IF is set to “1” in step 3403 in FIG. 34 while the initial screen map creation process is repeated without removing the background object having the same color as the bat 101 from the imaged scene. It continues to be set. Then, when the background object having the same color as the bat 101 is removed from the imaged scene and the logical values of all the blocks on the initial screen map become “0”, “0” in step 3412 of FIG. To "".
[0228]
Therefore, in the fourth embodiment, the game can be started only when the background object having the same color as the bat 101 is removed from the imaged scene.
<Other embodiments>
In the embodiment described above, the CPU 509 displays the position of the center of gravity of the bat 101 on the processing screen map (see FIG. 26) transferred from the image recognition circuit 508 to the DRAM 510 and the current display acquired from the object control circuit 803 in the VDP 506. The CG image 104 displayed on the display device 103 of FIG. 1 is controlled based only on the positional relationship with the position of the center of gravity of the object indicating the ball 105 (FIG. 1). However, the present invention is not limited to this, and the image recognition circuit 508 stores the first and last collision coordinates stored in the RAM (FIG. 26) by the collision coordinate detection processing in step 1006 of FIG. The upper end coordinate, the lower end coordinate, the left end coordinate, and the right end coordinate indicating the existence range of the bat 101 stored in the above-described RAM by the processing screen map creation processing in step 1005 are configured to be transferred to the DRAM 507, and these various position data 1 may be configured to control the CG image 104 displayed on the display device 103 of FIG.
[0231]
【The invention's effect】
According to the present invention, after the predetermined color that is the same as the image area of the predetermined color is no longer detected in the first state, the first state is canceled and the second state is started, Since the image area is extracted,After the subject to be imaged has shifted to a stable state,That is, after the background object having the same predetermined color as the object such as the bat disappears from the imaging range,Show only objects such as batsPredetermined colorCan be extracted stably.
[0232]
Also,The bat etc. extracted from the screen obtained by imaging the real scene such as the user shaking the batPredetermined colorThe positional relationship between the position of the image area and the position of the object screen data on the display screen is determined, and a signal corresponding to the screen to be displayed next is generated based on the determination content. In such a case, the user can participate in a video game displayed by a CG image or the like by performing an operation of swinging the bat so as to actually play. . In this case, in particular, when a specific image area such as a bat is extracted from the imaged screen, it is possible to accurately grasp the user's action by extracting the image area as a predetermined color using a chroma key or the like.
[0233]
According to the present invention, it is possible to realize not only a video game that performs image control in response to a user's action, but also a device that performs various image controls based on the results of imaging various real scenes. It becomes.
[Brief description of the drawings]
FIG. 1 is an external view (first to fourth embodiments) of an operation of an embodiment.
FIG. 2 is an operation principle diagram of an embodiment (part 1) (first to fourth embodiments);
FIG. 3 is an operation principle diagram of the embodiment (part 2) (first to fourth embodiments);
FIG. 4 is an operation principle diagram of the embodiment (part 3) (first to fourth embodiments);
FIG. 5 is an overall configuration diagram (first to fourth embodiments) of an embodiment of the present invention.
FIG. 6 is a configuration diagram (first to fourth embodiments) of a video signal input / output circuit;
FIG. 7 is a configuration diagram (first to fourth embodiments) of a video signal conversion circuit;
FIG. 8 is a configuration diagram of VDP (first to fourth embodiments).
FIG. 9 is an explanatory diagram (first to fourth embodiments) of a clock circuit;
FIG. 10 is an overall operation flowchart of the image recognition circuit (first, second, and third embodiments).
FIG. 11 is an operation flowchart (first, second, and fourth embodiments) of initial screen map creation processing;
FIG. 12 is an operation flowchart (part 1) of processing screen map creation processing (first to fourth embodiments);
FIG. 13 is an operation flowchart (part 2) of the processing screen map creation process (first to fourth embodiments);
FIG. 14 is an operation flowchart (first to fourth embodiments) of collision detection processing;
FIG. 15 is an operation flowchart (first to fourth embodiments) of a center of gravity calculation process;
FIG. 16 is an operation flowchart (No. 1) of CPU processing (first and third embodiments);
FIG. 17 is an operation flowchart (No. 2) of CPU processing (first and third embodiments);
FIG. 18 is an operation flowchart (first to fourth embodiments) of vertical blanking interrupt processing;
FIG. 19 is an operation flowchart (first to fourth embodiments) of timer interrupt processing;
FIG. 20 is an operational flowchart (first to fourth embodiments) of a collision flag interrupt process.
FIG. 21 is an operation flowchart (first to fourth embodiments) of n-th image processing.
FIG. 22 is an operation flowchart (first to fourth embodiments) of a sound source interrupt process;
FIG. 23 is an operation flowchart (first to fourth embodiments) of a monitoring timer count process.
FIG. 24 is an operation flowchart (first to fourth embodiments) of overflow interrupt processing;
FIG. 25 is an operation flowchart of sound source processing (first to fourth embodiments);
FIG. 26 is a relationship diagram between a pixel configuration of a frame and a screen map (first to fourth embodiments).
FIG. 27 is a diagram (first to fourth embodiments) showing a RAM map of an image recognition circuit;
FIG. 28 is an explanatory diagram (first to fourth embodiments) of detection processing of upper / lower / left / right end coordinates;
FIG. 29 is an operation flowchart (No. 1) of CPU processing (second embodiment);
FIG. 30 is an operation flowchart of the CPU processing (part 2) (second embodiment);
FIG. 31 is an operation flowchart (No. 3) of CPU processing (second embodiment);
FIG. 32 is an explanatory diagram of the second embodiment.
FIG. 33 is an operational flowchart (third embodiment) of the initial screen map creation process;
FIG. 34 is an overall operation flowchart (No. 1) of the image recognition circuit (fourth embodiment);
FIG. 35 is an overall operation flowchart (part 2) of the image recognition circuit (fourth embodiment);
FIG. 36 is an operation flowchart (No. 1) of CPU processing (fourth embodiment);
FIG. 37 is an operational flowchart (part 2) of the CPU processing (fourth embodiment).
FIG. 38 is an operation flowchart (part 3) of the CPU processing (fourth embodiment);
[Explanation of symbols]
101 Bat
102 camera
103 Display device
104 CG image
105 balls
501 CCD
502 Clock driver
503 Video signal input / output circuit
504 Oscillator (OSC)
505 Video signal conversion circuit
506 VDP
507 DRAM
508 Image recognition circuit
509 CPU
510 DRAM
511 OS ROM
512 clock circuit
513 Application cartridge
514 Application ROM
515, 516 tone generator circuit
517 amplifier
518 CCD output signal
519 Sync signal
520 Digital composite video input signal
521 Digital composite video output signal
522 Analog composite video output signal
523 Chroma key signal
524 Digital RGB signal
525 Superimpose signal
526 bus
527 Key scan signal
528 Audio output signal 528

Claims (5)

予め抽出すべき所定色の画像領域を設定する設定手段と、撮像手段と、該撮像手段による撮像領域に含まれる所定色の画像領域を抽出する抽出手段とを備えた画像抽出装置において、
該撮像手段により撮像される撮像領域から前記設定手段によって設定された画像領域が有する所定色と同じ所定色が検知され続ける間、前記抽出手段による抽出動作を禁止すると共に、前記同じ所定色が検知されなくなると、前記抽出手段による抽出動作を開始させる制御手段を備えることを特徴とする画像抽出装置。
In an image extraction apparatus comprising: setting means for setting an image area of a predetermined color to be extracted in advance; imaging means; and extraction means for extracting an image area of a predetermined color included in the imaging area by the imaging means .
While the predetermined color that is the same as the predetermined color of the image area set by the setting unit is continuously detected from the imaging area captured by the imaging unit, the extraction operation by the extracting unit is prohibited and the same predetermined color is detected. An image extraction apparatus comprising control means for starting the extraction operation by the extraction means when it is not performed.
出力すべきオブジェクト画面データを記憶する画像記憶手段と、
該画像記憶手段に記憶されたオブジェクト画面データの表示画面に出力される位置を指定する表示位置指定手段と、
該表示位置指定手段により指定された位置に前記画像記憶手段に記憶されたオブジェクト画面データに対応する画像を出力するよう制御する出力制御手段と、
前記制御手段によって開始された前記抽出手段による抽出動作で抽出された所定色の画像領域の撮像された画面における位置と、前記オブジェクト画面データが表示される位置との位置関係を判断する判断手段と、
該判断手段による判断の内容に基づき、次に表示されるべき画面に対応する信号を生成する信号生成手段と、
を更に有することを特徴とする請求項1に記載の画像抽出装置。
Image storage means for storing object screen data to be output;
Display position designating means for designating a position to be output on the display screen of the object screen data stored in the image storage means;
Output control means for controlling to output an image corresponding to the object screen data stored in the image storage means at a position designated by the display position designation means;
Determining means for determining a positional relationship between a position on the imaged screen of an image area of a predetermined color extracted by the extracting operation by the extracting means started by the control means and a position at which the object screen data is displayed; ,
Signal generating means for generating a signal corresponding to a screen to be displayed next based on the content of the determination by the determining means;
The image extracting apparatus according to claim 1, further comprising:
撮像された画面の色信号に基づいてクロマキー信号を出力する信号出力手段を更に備え、前記制御手段によって開始される前記抽出手段による抽出動作とは、該信号出力手段によって出力されたクロマキー信号を認識することによる、前記所定色の画像領域の抽出である
ことを特徴とする請求項1又は2に記載の画像抽出装置。
The apparatus further comprises signal output means for outputting a chroma key signal based on the color signal of the imaged screen, and the extraction operation by the extraction means started by the control means recognizes the chroma key signal output by the signal output means. The image extracting apparatus according to claim 1, wherein the image area is an image area of the predetermined color.
予め抽出すべき所定色の画像領域を設定し、撮像部にて撮像される領域に含まれる所定色の画像領域を抽出する画像抽出方法であって、
前記撮像部にて撮像される撮像領域から予め設定された画像領域が有する所定色と同じ所定色が検知され続ける間、抽出動作を禁止すると共に、前記同じ所定色が検知されなくなると、抽出動作を開始させることを特徴とする画像抽出方法。
An image extraction method for setting an image area of a predetermined color to be extracted in advance and extracting an image area of a predetermined color included in an area captured by an imaging unit ,
During the same predetermined color and a predetermined color having a preset image area from the image area to be imaged by the imaging unit is sensed continuously, while prohibiting the extraction operation, when the same predetermined color is no longer detected, extracting operation The image extraction method characterized by starting .
撮像された画面の色信号に基づいてクロマキー信号を出力する信号出力ステップを更に含み、前記開始される抽出動作とは、該信号出力ステップにて出力されたクロマキー信号を認識することによる、前記所定色の画像領域の抽出である
ことを特徴とする請求項4に記載の画像抽出方法。
The method further includes a signal output step of outputting a chroma key signal based on the color signal of the imaged screen, and the extraction operation to be started is performed by recognizing the chroma key signal output in the signal output step. 5. The image extracting method according to claim 4, wherein the image extracting method is a color image region extraction.
JP04574294A 1994-03-16 1994-03-16 Image extraction apparatus and image extraction method Expired - Fee Related JP3586880B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04574294A JP3586880B2 (en) 1994-03-16 1994-03-16 Image extraction apparatus and image extraction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04574294A JP3586880B2 (en) 1994-03-16 1994-03-16 Image extraction apparatus and image extraction method

Publications (2)

Publication Number Publication Date
JPH07254064A JPH07254064A (en) 1995-10-03
JP3586880B2 true JP3586880B2 (en) 2004-11-10

Family

ID=12727779

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04574294A Expired - Fee Related JP3586880B2 (en) 1994-03-16 1994-03-16 Image extraction apparatus and image extraction method

Country Status (1)

Country Link
JP (1) JP3586880B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3904562B2 (en) 2004-02-18 2007-04-11 株式会社ソニー・コンピュータエンタテインメント Image display system, recording medium, and program
JP3851907B2 (en) * 2004-02-18 2006-11-29 株式会社ソニー・コンピュータエンタテインメント Image display system and video game system

Also Published As

Publication number Publication date
JPH07254064A (en) 1995-10-03

Similar Documents

Publication Publication Date Title
JP3725460B2 (en) Image processing apparatus, image processing method, recording medium, computer program, semiconductor device
US8764563B2 (en) Video game superimposing virtual characters on user supplied photo used as game screen background
JP2002298145A (en) Position detector and attitude detector
US20110305368A1 (en) Storage medium having image recognition program stored therein, image recognition apparatus, image recognition system, and image recognition method
JP4433948B2 (en) Background image acquisition program, video game apparatus, background image acquisition method, and computer-readable recording medium recording the program
JPH07281666A (en) Image controlling device
JP3451343B2 (en) Signal generation apparatus and signal generation method
JPH07155467A (en) Video game device having image input of game player
JP3586880B2 (en) Image extraction apparatus and image extraction method
JP3893743B2 (en) Pointed position detection method and apparatus
JP3371521B2 (en) Signal generation apparatus and signal generation method
JP4824409B2 (en) Information processing system, entertainment system, and information receiving method for information processing system
JPH07296149A (en) Image controller
JPH07253775A (en) Picture controlling device
JP2018089269A (en) Information processing program, information processing unit, and information processing method
JPH07253880A (en) Arithmetic processing system
JPH0850661A (en) Image controller
JP4878396B2 (en) Image recognition program, image recognition apparatus, image recognition system, and image recognition method
JP5647443B2 (en) Image recognition program, image recognition apparatus, image recognition system, and image recognition method
JP4615252B2 (en) Image processing apparatus, image processing method, recording medium, computer program, semiconductor device
JP3407394B2 (en) Image display control apparatus and image display control method
JPH0855212A (en) Image controller
JP3371535B2 (en) Image control apparatus and image control method
JPH07271982A (en) Image controller
JP2001243446A (en) Device and method for image input processing

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040115

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040120

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040322

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040420

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040618

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040802

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090820

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100820

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100820

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110820

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120820

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120820

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130820

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees