JPH1015152A - Recognition device for pieces on japanese chess board - Google Patents

Recognition device for pieces on japanese chess board

Info

Publication number
JPH1015152A
JPH1015152A JP8178343A JP17834396A JPH1015152A JP H1015152 A JPH1015152 A JP H1015152A JP 8178343 A JP8178343 A JP 8178343A JP 17834396 A JP17834396 A JP 17834396A JP H1015152 A JPH1015152 A JP H1015152A
Authority
JP
Japan
Prior art keywords
image
luminance value
label
value
piece
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.)
Pending
Application number
JP8178343A
Other languages
Japanese (ja)
Inventor
Keiichi Umagami
恵一 馬上
Takuji Sugata
拓児 菅田
Eiichiro Hashimoto
栄一郎 橋本
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric 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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP8178343A priority Critical patent/JPH1015152A/en
Publication of JPH1015152A publication Critical patent/JPH1015152A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To easily recognize the existence or non-existence of Japanese chess pieces and raise a judgement treatment rate for the existence or non-existence of the pieces by preparing a histogram on the basis of an inter-image computation result between a label image and an edge extracted image, and applying a threshold value to the histogram. SOLUTION: An edge extracted image is generated from the images of pieces on a Japanese chess board picked up via a CCD camera 1, using the first luminance value of square lines on the board and characters on each piece, and the second luminance value of the bare surface of the board. The preset inter-image calculation is then made between a label image at a position corresponding to the inside of each square on the board in the edge extracted image, and the edge extracted image for obtaining the image where only a picture element having the first luminance value among picture elements having the first and the second luminance values becomes a luminance value for a corresponding label in zones corresponding to each label on the edge extracted image. At the same time, a histogram is prepared to show the frequency of picture elements for the luminance value, based on the image so obtained, and a frequency for each luminance value is compared with a threshold value to judge the existence or non-existence of pieces.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、将棋盤上の駒の
取込み画像に基づいて将棋盤上に手などの障害物がある
領域を抽出する無効領域抽出装置および将棋盤上の駒の
取込み画像に基づいて将棋盤上の駒有無を認識する将棋
盤上の駒有無認識装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an invalid area extracting apparatus for extracting an area where obstacles such as hands are present on a shogi board based on the captured image of the pieces on the shogi board, and to an invalid area extracting apparatus for extracting the area on the shogi board. And an apparatus for recognizing the presence or absence of a piece on a shogi board.

【0002】[0002]

【従来の技術】本出願人は、将棋盤上の駒の取込み画像
に基づいて、障害物によって将棋盤が隠された無効領域
を抽出する無効領域抽出手段、無効領域以外の領域内に
存在する各升目ごとに駒有無を認識する駒有無認識手
段、駒有無認識手段による認識結果に基づいて、駒有無
状態が変化した領域を抽出する変化領域抽出手段、およ
び駒有無の状態が変化した領域が抽出されたときに、変
化した駒の種類と位置とを特定し、特定された駒の種類
と位置とに基づいて、一手毎に駒の変化内容を記憶装置
に記録する記録手段を備えた棋譜記録装置を開発し、特
許出願している。ただし、本願出願時には、未だ公開さ
れていない。
2. Description of the Related Art The applicant of the present invention employs an invalid area extracting means for extracting an invalid area in which a shogi board is hidden by an obstacle based on a captured image of a piece on the shogi board. A piece presence / absence recognition means for recognizing the presence or absence of a piece for each cell, a change area extraction means for extracting an area in which the piece presence / absence state has been changed based on the recognition result by the piece presence / absence recognition means, and an area where the piece presence / absence state has been changed are extracted. Developed a game record recording device equipped with a recording means for recording the type and position of a changed piece when it was done and recording the details of the change of the piece in a storage device for each move based on the type and position of the specified piece. And filed a patent application. However, at the time of filing the present application, it has not been published yet.

【0003】本出願人が開発した棋譜記録装置における
駒有無認識手段では、上記エッジ抽出画像上において、
各升目ごとに白画素の総和(以下、各升目に対するヒス
トグラム値という)が算出される。そして、各升目に対
するヒストグラム値としきい値とが比較されることによ
り、各升目に駒が存在するか否かが判定される。
The piece presence / absence recognizing means in the game record recording apparatus developed by the present applicant uses the
A total sum of white pixels (hereinafter, referred to as a histogram value for each square) is calculated for each square. Then, by comparing the histogram value for each cell with the threshold value, it is determined whether or not a piece exists in each cell.

【0004】[0004]

【発明が解決しようとする課題】この発明は、処理速度
の向上が図れる将棋盤上の駒有無認識装置装置を提供す
ることを目的とする。
SUMMARY OF THE INVENTION An object of the present invention is to provide an apparatus for recognizing the presence / absence of a piece on a shogi board which can improve the processing speed.

【0005】[0005]

【課題を解決するための手段】この発明による将棋盤上
の駒有無認識装置は、将棋盤上の駒の取込み画像に基づ
いて、各升目ごとの駒の有無を認識する将棋盤上の駒有
無認識装置において、将棋盤上の駒の取込み画像から、
将棋盤上の升目を仕切る線および各駒に描かれた文字の
輝度値が第1輝度値であり、将棋盤上の升目内部の地肌
の輝度値が第1輝度値とは異なる第2輝度値であるエッ
ジ抽出画像を生成するエッジ抽出画像生成手段、エッジ
抽出画像上における将棋盤上の各升目の内部に相当する
位置にそれぞれラベルを有し、ラベル以外の部分の輝度
値が第3輝度値であり、各ラベル内の輝度値が第2輝度
値および第3輝度値と異なる輝度値であってかつラベル
毎に異なる輝度値であるラベル画像と、エッジ抽出画像
との間で所定の画像間演算を行なって、エッジ抽出画像
上の各ラベルに対応する領域において、第1輝度値の画
素および第2輝度値の画素のうち、第1輝度値の画素の
み、その輝度値が、が対応するラベルの輝度値となる画
像を得る画像間演算手段、画像間演算手段によって得ら
れた画像に基づいて、輝度値に対する画素の度数を表す
ヒストグラムを作成する手段、ならびに得られた各輝度
値に対する度数をしきい値と比較し、度数がしきい値以
上の輝度値に対応するラベルが存在する升目に駒が有る
と判定し、度数がしきい値より小さい輝度値に対応する
ラベルが存在する升目に駒が無いと判定するしきい値処
理手段を備えていることを特徴とする。
SUMMARY OF THE INVENTION A piece presence / absence recognition device on a shogi board according to the present invention recognizes the presence / absence of a piece for each square based on a captured image of the pieces on the shogi board. In, from the captured image of the pieces on the shogi board,
The luminance value of the line separating the squares on the shogi board and the character drawn on each piece is the first luminance value, and the luminance value of the background inside the squares on the shogi board is different from the first luminance value. Edge extraction image generating means for generating an edge extraction image which has a label at a position corresponding to the inside of each square on the shogi board on the edge extraction image, and a luminance value of a portion other than the label is a third luminance value A predetermined image between the label image whose luminance value in each label is different from the second luminance value and the third luminance value and which is different for each label, and the edge extracted image. By performing the operation, in the region corresponding to each label on the edge extraction image, only the pixel of the first luminance value corresponds to the luminance value of the pixel of the first luminance value and the pixel of the second luminance value. Inter-image rendering to obtain an image that is the luminance value of the label Means, means for creating a histogram representing the frequency of pixels with respect to the luminance value based on the image obtained by the inter-image calculation means, and comparing the frequency for each of the obtained luminance values with a threshold value, wherein the frequency is determined. Threshold value processing means for determining that there is a piece in a cell in which a label corresponding to a luminance value equal to or greater than the value is present, and determining that there is no piece in a cell in which a label corresponding to a luminance value whose frequency is smaller than the threshold value is present; It is characterized by having.

【0006】第1輝度値、第2輝度値、第3輝度値およ
び各ラベルの輝度値は、たとえば、予め定められたビッ
ト数の2進数値で表される。たとえば、第1輝度値は、
全てのビットが1で表される2進数値に設定され、第2
輝度値および第3輝度値は全てのビットが0で表される
2進数値に設定され、各ラベルの輝度値は、全てのビッ
トが0の2進数より大きくかつ全てのビットが1である
2進数以下の範囲で互いに異なる2進数値に設定され
る。このように各輝度値が設定された場合には、画像間
演算手段では、ラベル画像とエッジ抽出画像との間でA
ND演算が行われる。
[0006] The first luminance value, the second luminance value, the third luminance value, and the luminance value of each label are represented by, for example, a binary value of a predetermined number of bits. For example, the first luminance value is
All bits are set to a binary value represented by one,
The luminance value and the third luminance value are set to a binary value in which all bits are represented by 0, and the luminance value of each label is 2 in which all bits are larger than a binary number of 0 and all bits are 1 Binary values that are different from each other are set within a range of a decimal number or less. When each luminance value is set in this way, the inter-image calculation means sets the A between the label image and the edge-extracted image.
An ND operation is performed.

【0007】この発明による将棋盤上の駒有無認識装置
によれば、ラベル画像とエッジ抽出画像との間の画像間
演算結果に基づいて、ヒストグラムを作成し、ヒストグ
ラムに対してしきい値処理を行なうだけで、駒有無が認
識されるので、処理速度が向上する。
According to the apparatus for recognizing pieces on a shogi board according to the present invention, a histogram is created based on an inter-image operation result between a label image and an edge extracted image, and threshold processing is performed on the histogram. By simply performing the operation, the presence or absence of a frame is recognized, so that the processing speed is improved.

【0008】[0008]

【発明の実施の形態】以下、図面を参照して、この発明
の実施の形態について説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0009】図1は、棋譜記録装置の外観を示してい
る。
FIG. 1 shows the appearance of a game record recording apparatus.

【0010】棋譜記録装置は、将棋盤を撮像するCCD
カメラ1と、パーソナルコンピュータ(以下、ホストと
いう)19とを備えている。ホスト19は、棋譜画像を
表示するための内部モニタ22を備えている。また、ホ
スト19には、CCDカメラ1で撮像された画像を画像
処理するための画像処理ボード30が搭載されている。
画像処理ボード30には、外部モニタ5が接続されてい
る。
The game record recording device is a CCD for imaging a shogi board.
The camera includes a camera 1 and a personal computer (hereinafter, referred to as a host) 19. The host 19 has an internal monitor 22 for displaying a game record image. Further, the host 19 is equipped with an image processing board 30 for performing image processing on an image captured by the CCD camera 1.
The external monitor 5 is connected to the image processing board 30.

【0011】図2は、棋譜記録装置の電気的構成を示
し、特にホスト19に搭載されている画像処理ボード3
0の詳細な構成を示している。
FIG. 2 shows an electric configuration of the game record recording apparatus, and in particular, an image processing board 3 mounted on the host 19.
0 shows a detailed configuration.

【0012】1は、将棋盤の画像を取込むためのCCD
カメラである。CCDカメラ1で撮像されたアナログの
画像信号は、A/D変換器2によってディジタルの画像
信号に変換される。
1 is a CCD for taking in an image of a shogi board
Camera. An analog image signal captured by the CCD camera 1 is converted by the A / D converter 2 into a digital image signal.

【0013】画像バス6には、フレームメモリ7、画像
処理部11および画像メモリ13が接続されている。
The image bus 6 is connected to a frame memory 7, an image processing unit 11, and an image memory 13.

【0014】フレームメモリ7には、A/D変換器2に
よって得られたディジタル画像が格納される。第1のメ
モリ制御部8およびビデオ制御部9は、フレームメモリ
7への画像の書き込みを、CCDカメラ1の出力との同
期をとって制御する。フレームメモリ7に格納された画
像(以下、取込み画像という)は、D/A変換器4を介
して外部モニタ5に表示される。
A digital image obtained by the A / D converter 2 is stored in the frame memory 7. The first memory control unit 8 and the video control unit 9 control writing of an image to the frame memory 7 in synchronization with the output of the CCD camera 1. The image stored in the frame memory 7 (hereinafter, referred to as a captured image) is displayed on the external monitor 5 via the D / A converter 4.

【0015】画像処理部11は、フィルタ処理、2値化
処理、ヒストグラム処理、テンプレートマッチング等の
画像処理を行なう。
The image processing section 11 performs image processing such as filter processing, binarization processing, histogram processing, and template matching.

【0016】画像メモリ13には、画像処理部11によ
る各種処理結果、テンプレートマッチングに用いられる
駒のテンプレートが記憶される。また、画像メモリ13
内には、割り込み処理によってCCDカメラ1によって
取り込まれた画像を記憶保持するための領域(以下、キ
ュー(queue)という)が設けられている。この例
では、キューは、10枚の取込み画像を記憶できる領域
を有している。画像メモリ13は、第2のメモリ制御部
14によって制御される。
The image memory 13 stores the results of various processes by the image processing section 11 and the template of the frame used for template matching. The image memory 13
An area (hereinafter, referred to as a queue) for storing and holding an image captured by the CCD camera 1 by the interrupt processing is provided in the area. In this example, the queue has an area in which ten captured images can be stored. The image memory 13 is controlled by the second memory control unit 14.

【0017】CPU16は、画像処理ボード30に搭載
されている中央処理装置である。CPUバス15には、
CPU16、上述した第1および第2のメモリ制御部
8、14、フレームメモリ7、画像メモリ13および画
像処理部11の他、プロセッサEPROM18およびホ
ストインタフェース17が接続されている。
The CPU 16 is a central processing unit mounted on the image processing board 30. In the CPU bus 15,
In addition to the CPU 16, the first and second memory control units 8 and 14, the frame memory 7, the image memory 13, and the image processing unit 11, a processor EPROM 18 and a host interface 17 are connected.

【0018】EPROM18には、CPU16のプログ
ラム、すなわち画像処理ボード30の制御プログラムが
格納されている。ホストインタフェース17は、ホスト
19側のCPUバスと画像処理ボード30のCPUバス
15との間のデータの受渡しを行なう。
The EPROM 18 stores a program for the CPU 16, that is, a control program for the image processing board 30. The host interface 17 exchanges data between the CPU bus of the host 19 and the CPU bus 15 of the image processing board 30.

【0019】ホスト19は、そのプログラム、棋譜、そ
の他必要なデータを記憶する記憶装置23を備えてい
る。ホスト19は、画像処理ボード30に命令を出す
他、ユーザインタフェース等に関する様々な処理を行な
う。
The host 19 has a storage device 23 for storing the program, the game record, and other necessary data. The host 19 issues commands to the image processing board 30 and performs various processes related to a user interface and the like.

【0020】図3は、棋譜記録装置のメイン処理の手順
を示している。
FIG. 3 shows the procedure of the main processing of the game record recording apparatus.

【0021】まず、対局が開始される前に初期化処理が
行なわれる(ステップ1)。初期化処理においては、将
棋盤のエリア設定、各駒のテンプレートの作成等が行な
われる。
First, before a game is started, an initialization process is performed (step 1). In the initialization processing, area setting of the shogi board, creation of a template for each piece, and the like are performed.

【0022】対局開始時には、ホスト19側の記憶装置
23に、対局開始時の駒の配置に応じた各駒の種類と位
置に関する情報が記憶されており、ホスト19の内部モ
ニタ22に、対局開始時の駒の配置画像が表示される。
At the start of the game, information on the type and position of each frame corresponding to the arrangement of the frame at the start of the game is stored in the storage device 23 of the host 19, and the internal monitor 22 of the host 19 stores the information at the time of the start of the game. The arrangement image of the pieces is displayed.

【0023】対局が開始されると(ステップ2)、画像
入力処理が実行される(ステップ3)。この画像入力処
理では、キューに取込み画像が蓄積されていない場合に
は、CCDカメラ1から棋譜画像が取り込まれる。キュ
ーに取込み画像が蓄積されている場合には、キューから
棋譜画像が取り込まれる。この画像入力処理の詳細につ
いては、後述する。
When the game starts (step 2), an image input process is executed (step 3). In this image input processing, when no captured image is stored in the queue, a game image is captured from the CCD camera 1. When captured images are stored in the queue, the game image is captured from the queue. The details of this image input processing will be described later.

【0024】次に、ステップ4〜9の駒移動検出および
移動駒特定処理が実行される。この駒移動検出および移
動駒特定処理においては、まず、取り込まれた画像に基
づいて、無効領域抽出処理が行なわれる(ステップ
4)。無効領域とは、取込み画像において、対局者の手
等の障害物が存在している領域をいう。無効領域抽出処
理の詳細については、後述する。
Next, the frame movement detection and moving frame identification processing of steps 4 to 9 are executed. In the frame movement detection and moving frame identification processing, first, an invalid area extraction processing is performed based on the captured image (step 4). The invalid area is an area where an obstacle such as a player's hand exists in the captured image. Details of the invalid area extraction processing will be described later.

【0025】この後、駒有無認識処理が行なわれる(ス
テップ5)。つまり、将棋盤上の無効領域を除く領域
(有効領域)内の各升目毎に、駒の有無が判別される。
駒有無認識処理の詳細については、後述する。
Thereafter, a frame presence / absence recognition process is performed (step 5). That is, the presence or absence of a piece is determined for each square in an area (effective area) excluding the invalid area on the chess board.
The details of the frame presence / absence recognition processing will be described later.

【0026】次に、駒有無状態の変化領域の抽出処理が
行なわれる(ステップ6)。つまり、将棋盤上の無効領
域を除く領域(有効領域)において、前回の棋譜に対し
て駒有無の状態が変化した領域が抽出される。
Next, a process of extracting a change area of the frame presence state is performed (step 6). That is, in the area (effective area) excluding the invalid area on the shogi board, an area where the state of the presence or absence of the piece has changed from the previous game record is extracted.

【0027】駒有無の状態が変化した領域が抽出された
場合には(ステップ7でYES)、移動駒の特定処理が
行なわれる(ステップ8)。つまり、将棋のルールおよ
びパターンマッチングによって、移動した駒の種類が特
定されるとともに移動した駒の位置が特定される。
If an area in which the state of the presence or absence of a frame has been changed is extracted (YES in step 7), a process of specifying a moving frame is performed (step 8). In other words, the type of the moved piece and the position of the moved piece are specified by the shogi rule and the pattern matching.

【0028】上記ステップ8の移動駒の特定処理におい
て、移動した駒の種類および位置を特定できなかった場
合(駒の移動が正当でない(ルール違反)と判定された
場合を含む)には(ステップ9でNO)、ステップ3に
戻って、画像入力処理が行なわれる。
If the type and position of the moved piece could not be specified in the moving piece specifying process in step 8 (including the case where the movement of the piece was determined to be invalid (rule violation)) (NO in step 9) ), Returning to step 3 to perform image input processing.

【0029】上記ステップ8の移動駒の特定処理におい
て、移動した駒の種類と位置が特定できた場合には(ス
テップ9でYES)、ホスト19内の記憶装置23に棋
譜が記録される(ステップ10)。
If the type and position of the moved piece can be specified in the moving piece specifying process in step 8 (YES in step 9), the game record is recorded in the storage device 23 in the host 19 (step 10). .

【0030】そして、棋譜記録終了の入力がなければ
(ステップ11でNO)、ステップ3に戻って、画像入
力処理が行なわれる。棋譜記録終了の入力があれば(ス
テップ11でYES)、棋譜記録処理は終了する。
If there is no input for ending the record of the game record (NO in step 11), the process returns to step 3 to perform the image input processing. If there is an input to end the game record recording (YES in step 11), the game record recording process ends.

【0031】上記ステップ6において、駒有無の状態が
変化した領域が抽出されなかった場合には(ステップ7
でNO)、棋譜が変化していないと判断され、ステップ
12に移行する。
If it is determined in step 6 that an area in which the presence or absence of a frame has changed is not extracted (step 7).
NO), it is determined that the game record has not changed, and the routine proceeds to step 12.

【0032】ステップ12では、ホスト19の記憶装置
23に記憶されている最新の棋譜が正しいかどうかチェ
ックするか否かが判定される。この例では、ステップ1
2に移行した回数がカウントされており、カウント数が
所定値に達した場合にはチェックを行なうと判定される
とともにカウント値が0にされる。
In step 12, it is determined whether or not to check whether the latest game record stored in the storage device 23 of the host 19 is correct. In this example, step 1
The number of transitions to 2 is counted, and when the counted number reaches a predetermined value, it is determined that a check is to be performed, and the count value is set to 0.

【0033】チェックを行なわないと判定されたときに
は、ステップ11に移行する。チェックを行なうと判定
された場合には、ホスト19の記憶装置23に記憶され
ている最新の棋譜と、現在取り込まれている画像とに基
づいて、記憶装置23に記憶されている最新の棋譜が正
しいか否かがチェックされる(ステップ13)。このチ
ェック処理において、割り込み処理を開始させるための
タイマが起動される。チェック処理の詳細については、
後述する。
When it is determined that no check is performed, the process proceeds to step 11. If it is determined that the check is to be performed, the latest game record stored in the storage device 23 is stored based on the latest game record stored in the storage device 23 of the host 19 and the currently captured image. It is checked whether it is correct (step 13). In this check processing, a timer for starting the interrupt processing is started. For more information about the check process,
It will be described later.

【0034】チェック処理の結果、ホスト19の記憶装
置23に記憶されている最新の棋譜が正しいと判定され
た場合には(ステップ14でYES)、ステップ11に
移行する。
As a result of the check processing, when it is determined that the latest game record stored in the storage device 23 of the host 19 is correct (YES in step 14), the process proceeds to step 11.

【0035】チェック処理の結果、ホスト19の記憶装
置23に記憶されている最新の棋譜が誤っていると判定
された場合には(ステップ14でNO)、正しい棋譜を
認識するためのリカバリ処理が実行される(ステップ1
5)。このリカバリ処理の詳細については、後述する。
As a result of the check processing, when it is determined that the latest game record stored in the storage device 23 of the host 19 is incorrect (NO in step 14), a recovery process for recognizing a correct game record is performed. Executed (step 1
5). The details of the recovery process will be described later.

【0036】リカバリ処理によって、正しい棋譜が認識
されると、ステップ10に移行し、認識された正しい棋
譜がホスト19の記憶装置23に記憶される。
When the correct game record is recognized by the recovery process, the process proceeds to step 10 and the recognized correct game record is stored in the storage device 23 of the host 19.

【0037】図4は、図3のステップ4の無効領域抽出
処理の詳細な手順を示している。
FIG. 4 shows a detailed procedure of the invalid area extraction processing in step 4 of FIG.

【0038】図5は、取込み画像の一例を示している。
取込み画像の将棋盤上には、対局者の手(障害物)が現
れている。取込み画像は、0〜255階調(黒:0,
白:255)で表されている。図5に示すように、将棋
盤上の升目を仕切る線は黒であり、各駒に描かれた文字
も黒であるとする。また、取込み画像において、対局者
の手の輝度値は、将棋盤の地肌に対する輝度値より低い
(暗い)ものとする。
FIG. 5 shows an example of a captured image.
The player's hand (obstacle) appears on the shogi board of the captured image. The captured image has 0 to 255 gradations (black: 0,
White: 255). As shown in FIG. 5, it is assumed that the lines dividing the squares on the chess board are black, and the characters drawn on each piece are also black. In the captured image, the luminance value of the player's hand is lower (darker) than the luminance value of the shogi board against the background.

【0039】以下、図5の取込み画像を例に取って、無
効領域抽出処理手順について説明する。まず、取込み画
像に対して、ローパスフィルタを用いてノイズ除去処理
が行なわれる(ステップ101)。ノイズ除去処理によ
ってノイズが除去された画像に対して、ハイパスフィル
タを用いてエッジ抽出処理が行なわれる(ステップ10
2)。そして、得られた画像に対して、2値化処理が行
なわれる(ステップ103)。これにより、図6に示す
ように、エッジ部、すなわち、将棋盤上の升目を仕切る
線、各駒に描かれた文字および手の輪郭が白(10進数
の255を表す8ビットの2進数値”1111111
1”)であり、エッジ部以外の部分、すなわち、将棋盤
上の升目内部および手の輪郭の内部が黒(10進数の0
を表す8ビットの2進数値”00000000”)であ
る2値化画像(以下、エッジ抽出画像という)が得られ
る。
Hereinafter, the invalid area extraction processing procedure will be described with reference to the captured image of FIG. 5 as an example. First, a noise removal process is performed on a captured image using a low-pass filter (step 101). An edge extraction process is performed on the image from which noise has been removed by the noise removal process using a high-pass filter (step 10).
2). Then, a binarization process is performed on the obtained image (step 103). As a result, as shown in FIG. 6, the edges, that is, the lines dividing the squares on the shogi board, the characters drawn on each piece and the outline of the hand are white (8-bit binary value representing 255 in decimal). "1111111
1 "), and the portion other than the edge portion, that is, the inside of the square on the shogi board and the inside of the outline of the hand are black (0 in decimal number).
Is obtained (hereinafter, referred to as an edge-extracted image) which is an 8-bit binary value “00000000”).

【0040】次に、第1のラベル画像と上記エッジ抽出
画像との間でAND演算が行なわれる(ステップ10
4)。図7は、第1のラベル画像を示している。第1の
ラベル画像は、将棋盤の升目を仕切る線を構成する横線
と縦線との各交点位置に矩形のラベルA1〜A100を
有する画像である。
Next, an AND operation is performed between the first label image and the edge extracted image (step 10).
4). FIG. 7 shows a first label image. The first label image is an image having rectangular labels A1 to A100 at the respective intersections of the horizontal and vertical lines that form the lines dividing the cells of the chess board.

【0041】第1のラベル画像において、ラベルA1〜
A100以外の部分は黒(10進数の0を表す8ビット
の2進数値”00000000”)である。各ラベルA
1〜A100内の輝度値は、10進数の1〜100を表
す互いに異なる8ビットの2進数値である。つまり、ラ
ベルA1の輝度値は10進数の1を表す8ビットの2進
数値であり、ラベルA2の輝度値は10進数の2を表す
8ビットの2進数値であり、ラベルA100の輝度値は
10進数の100を表す8ビットの2進数値である。
In the first label image, the labels A1 to A1
Portions other than A100 are black (8-bit binary value “00000000” representing decimal 0). Each label A
The luminance values in 1 to A100 are different 8-bit binary values representing decimal numbers 1 to 100. That is, the luminance value of the label A1 is an 8-bit binary value representing a decimal number 1, the luminance value of the label A2 is an 8-bit binary value representing a decimal number 2, and the luminance value of the label A100 is It is an 8-bit binary value representing 100 in decimal.

【0042】このような第1ラベル画像とエッジ抽出画
像との間でAND演算を行なうと、エッジ抽出画像にお
けるラベルA1〜A100以外の領域においては、輝度
値が0となる。また、エッジ抽出画像における各ラベル
A1〜A100に対応する領域のうち、図8(a)に示
すように、手等の障害物が存在していない領域において
は、その領域内の升目を仕切る線の部分の輝度値は対応
するラベルAiの輝度値となり、その領域内の升目を仕
切る線以外の部分の輝度値は0となる。したがって、A
ND演算後の画像において、エッジ抽出画像における各
ラベルA1〜A100に対応する領域のうち、手等の障
害物が存在してない領域では、対応するラベルAiの輝
度値の画素が比較的多く存在することになる。
When an AND operation is performed between such a first label image and an edge-extracted image, the luminance value becomes 0 in areas other than the labels A1 to A100 in the edge-extracted image. In addition, as shown in FIG. 8A, among the areas corresponding to the labels A1 to A100 in the edge extraction image, as shown in FIG. Is the brightness value of the corresponding label Ai, and the brightness value of the portion other than the line dividing the cells in the area is 0. Therefore, A
In the image after the ND operation, among the areas corresponding to the labels A1 to A100 in the edge extracted image, in the area where no obstacle such as the hand is present, there are relatively many pixels of the luminance value of the corresponding label Ai. Will do.

【0043】一方、エッジ抽出画像における各ラベルA
1〜A100に対応する領域のうち、図8(b)に示す
ように、手等の障害物Fによって升目を仕切る線が全て
覆われている領域においては、その領域内の輝度値が全
て0となる。したがって、AND演算後の画像において
は、エッジ抽出画像における各ラベルA1〜A100に
対応する領域のうち、手等の障害物Fによって升目を仕
切る線が全て覆われている領域では、対応するラベルA
iの輝度値の画素は全く存在しなくなる。
On the other hand, each label A in the edge extracted image
As shown in FIG. 8B, among the areas corresponding to 1 to A100, in the area in which all the lines dividing the squares by obstacles F such as hands are covered, the brightness values in the area are all 0. Becomes Therefore, in the image after the AND operation, in the area corresponding to each of the labels A1 to A100 in the edge extraction image, in the area where all the lines separating the squares by the obstacle F such as the hand are covered by the corresponding label A
The pixel having the luminance value of i does not exist at all.

【0044】また、エッジ抽出画像における各ラベルA
1〜A100に対応する領域のうち、図8(c)に示す
ように、その領域内の升目を仕切る線の一部が手等の障
害物Fによって覆われている領域においては、その領域
内の升目を仕切る線のうち、障害物Fによって覆われて
いない部分の輝度値は対応するラベルAiの輝度値とな
り、それ以外の部分の輝度値は0となる。したがって、
AND演算後の画像において、エッジ抽出画像における
各ラベルA1〜A100に対応する領域のうち、その領
域内の升目を仕切る線の一部が手等の障害物によって覆
われている領域では、対応するラベルAiの輝度値の画
素が少し存在することになる。
Each label A in the edge extracted image
As shown in FIG. 8C, among the areas corresponding to 1 to A100, in the area where a part of the line dividing the cell in the area is covered by an obstacle F such as a hand, Among the lines dividing the squares, the luminance value of the portion not covered by the obstacle F is the luminance value of the corresponding label Ai, and the luminance value of the other portions is 0. Therefore,
In the image after the AND operation, of the regions corresponding to the labels A1 to A100 in the edge extracted image, in the region where a part of the line dividing the cell in the region is covered by an obstacle such as a hand, the corresponding region is used. There will be a few pixels with the luminance value of the label Ai.

【0045】このようにして、第1ラベル画像とエッジ
抽出画像との間のAND演算が行なわれると、得られた
画像に基づいて、図9に示すように、輝度値に対する画
素の度数を表すヒストグラムが作成される(ステップ1
05)。
When the AND operation is performed between the first label image and the edge-extracted image, the frequency of the pixel with respect to the luminance value is represented based on the obtained image as shown in FIG. A histogram is created (step 1
05).

【0046】そして、作成されたヒストグラムに基づい
て、第1のしきい値処理が行なわれる(ステップ10
6)。つまり、第1しきい値αよりヒストグラム値(度
数)が小さい輝度値に対応するラベル位置が抽出され
る。そして、抽出された各ラベル位置の周囲の4つの升
目が無効領域と判定される。
Then, first threshold processing is performed based on the created histogram (step 10).
6). That is, a label position corresponding to a luminance value whose histogram value (frequency) is smaller than the first threshold value α is extracted. Then, four squares around each extracted label position are determined to be invalid areas.

【0047】次に、第2のラベル画像と上記エッジ抽出
画像との間でAND演算が行なわれる(ステップ10
7)。図10は、第2のラベル画像を示している。升目
を仕切る線は、10本の横線と10本の縦線とから構成
されている。第2のラベル画像は、各横線における隣り
合う縦線の間の各線分の中央部および各縦線における隣
り合う横線の間の各線分の中央部に、線分と交差するよ
うに配された矩形のラベルB1〜B180を有する画像
である。
Next, an AND operation is performed between the second label image and the edge extracted image (step 10).
7). FIG. 10 shows a second label image. The line dividing the cell is composed of 10 horizontal lines and 10 vertical lines. The second label image is arranged at the center of each line between adjacent vertical lines in each horizontal line and at the center of each line between adjacent horizontal lines in each vertical line so as to intersect the line. It is an image having rectangular labels B1 to B180.

【0048】第2のラベル画像において、ラベルB1〜
B180以外の部分は黒(10進数の0を表す8ビット
の2進数値”00000000”)である。各ラベルB
1〜B180内の輝度値は、10進数の1〜180を表
す互いに異なる8ビットの2進数値である。つまり、ラ
ベルB1の輝度値は10進数の1を表す8ビットの2進
数値であり、ラベルB2の輝度値は10進数の2を表す
8ビットの2進数値であり、ラベルB180の輝度値は
10進数の180を表す8ビットの2進数値である。
In the second label image, the labels B1 to B1
Portions other than B180 are black (8-bit binary value “00000000” representing decimal 0). Each label B
The luminance values in 1 to B180 are different 8-bit binary values representing decimal numbers 1 to 180. That is, the luminance value of the label B1 is an 8-bit binary value representing a decimal number 1, the luminance value of the label B2 is an 8-bit binary value representing a decimal number 2, and the luminance value of the label B180 is It is an 8-bit binary value representing the decimal number 180.

【0049】このような第2ラベル画像とエッジ抽出画
像との間でAND演算を行なうと、エッジ抽出画像にお
けるラベルB1〜B180以外の領域においては、輝度
値が0となる。また、エッジ抽出画像における各ラベル
B1〜B180に対応する領域のうち、手等の障害物が
存在していない領域においては、その領域内の升目を仕
切る線の部分の輝度値は対応するラベルの輝度値とな
り、その領域内の升目を仕切る線以外の部分の輝度値は
0となる。
When an AND operation is performed between such a second label image and an edge-extracted image, the luminance value becomes 0 in regions other than the labels B1 to B180 in the edge-extracted image. In the area corresponding to each of the labels B1 to B180 in the edge extracted image, in an area where no obstacle such as a hand is present, the luminance value of the line dividing the squares in the area is the brightness value of the corresponding label. The brightness value becomes 0, and the brightness value of a portion other than the line dividing the cells in the area becomes 0.

【0050】一方、エッジ抽出画像における各ラベルB
1〜B180に対応する領域のうち、手等の障害物によ
って升目を仕切る線が全て覆われている領域において
は、その領域内の輝度値が全て0となる。
On the other hand, each label B in the edge extracted image
In the region corresponding to 1 to B180, in the region in which all the lines dividing the cell by the obstacle such as the hand are covered, the luminance values in the region are all 0.

【0051】また、エッジ抽出画像における各ラベルB
1〜B180に対応する領域のうち、その領域内の升目
を仕切る線の一部が手等の障害物によって覆われている
領域においては、その領域内の升目を仕切る線のうち、
障害物によって覆われていない部分の輝度値は対応する
ラベルの輝度値となり、それ以外の部分の輝度値は0と
なる。
Each label B in the edge extracted image
In the area corresponding to 1 to B180, in the area where a part of the line dividing the cell in the area is covered by an obstacle such as a hand, among the lines dividing the cell in the area,
The luminance value of the part not covered by the obstacle is the luminance value of the corresponding label, and the luminance value of the other parts is zero.

【0052】第2ラベル画像とエッジ抽出画像との間で
AND演算が行なわれると、上記ステップ105と同様
に、上記ステップ106で得られた画像に基づいて、輝
度値に対する画数の度数を表すヒストグラムが作成され
る(ステップ108)。そして、作成されたヒストグラ
ムと第2しきい値とに基づいて、第2のしきい値処理が
行なわれる(ステップ109)。つまり、第2しきい値
よりヒストグラム値(度数)が小さい輝度値に対応する
ラベル位置が抽出される。そして、抽出された各ラベル
位置に存在する升目が無効領域とされる。
When an AND operation is performed between the second label image and the edge-extracted image, a histogram representing the frequency of the number of strokes with respect to the luminance value is obtained based on the image obtained in step 106, as in step 105. Is created (step 108). Then, second threshold processing is performed based on the created histogram and the second threshold (step 109). That is, a label position corresponding to a luminance value whose histogram value (frequency) is smaller than the second threshold value is extracted. Then, the cell existing at each extracted label position is set as an invalid area.

【0053】つまり、ステップ106で抽出された無効
領域と、ステップ109で抽出された無効領域との両方
が、無効領域として抽出される。
That is, both the invalid area extracted in step 106 and the invalid area extracted in step 109 are extracted as invalid areas.

【0054】以上のようにして抽出された無効領域を、
図11に網掛け領域で示す。なお、将棋盤上の無効領域
以外の領域を有効領域ということにする。
The invalid area extracted as described above is
FIG. 11 shows a shaded area. An area other than the invalid area on the shogi board is referred to as an effective area.

【0055】上記の無効領域抽出処理によれば、ラベル
画像とエッジ抽出画像との間のAND演算結果に基づい
て、ヒストグラムを作成し、ヒストグラムに対してしき
い値処理を行なうだけで、無効領域が抽出されるので、
処理速度が向上する。
According to the above-described invalid area extraction processing, a histogram is created based on the result of the AND operation between the label image and the edge extracted image, and the threshold processing is performed on the histogram. Is extracted,
Processing speed is improved.

【0056】なお、第1ラベル画像と第2ラベル画像と
が合成された1つのラベル画像を用いて1回のAND演
算、1回のヒストグラム作成処理、1回のしきい値処理
によって、無効領域を抽出するようにしてもよい。
It is to be noted that, by using one label image obtained by synthesizing the first label image and the second label image, one AND operation, one histogram creation process, and one threshold process are performed to obtain an invalid area. May be extracted.

【0057】また、升目を仕切る線を構成する縦線と横
線との各交点に相当する位置にラベルが設定されたラベ
ル画像(第1ラベル画像)のみに基づいて、無効領域を
抽出してもよい。
Further, even if an invalid area is extracted based on only a label image (first label image) in which a label is set at a position corresponding to each intersection of a vertical line and a horizontal line constituting a line separating the cells, Good.

【0058】また、各横線における隣り合う縦線の間の
各線分の中央に相当する位置にラベルが設定された第2
Aのラベル画像(第2ラベル画像のうち、縦長のラベル
のみ設定されている画像)のみに基づいて、無効領域を
抽出してもよい。
A label is set at a position corresponding to the center of each line segment between adjacent vertical lines in each horizontal line.
The invalid area may be extracted based only on the label image of A (the image in which only the vertical label is set among the second label images).

【0059】また、各縦線における隣合う横線の間の各
線分の中央に相当する位置にラベルが設定された第2B
のラベル画像(第2ラベル画像のうち、横長のラベルの
み設定されている画像)のみに基づいて、無効領域を抽
出してもよい。
A second B label having a label set at a position corresponding to the center of each line segment between adjacent horizontal lines in each vertical line.
(In the second label image, only the horizontally long label is set), the invalid area may be extracted.

【0060】さらに、第1ラベル画像、第2Aのラベル
画像および第2Bのラベル画像の3種のラベル画像のう
ちから、任意の2種類のラベル画像が合成された画像を
ラベル画像として用いてもよい。
Further, an image obtained by combining any two types of label images among the three types of label images of the first label image, the second A label image, and the second B label image may be used as the label image. Good.

【0061】図12は、図3のステップ5の駒有無認識
処理の詳細な手順を示している。
FIG. 12 shows a detailed procedure of the frame presence / absence recognition process in step 5 of FIG.

【0062】駒有無認識処理は、無効領域抽出処理のス
テップ103によって得られた図6の2値化画像に基づ
いて行なわれる。つまり、エッジ部、すなわち、将棋盤
上の升目を仕切る線、各駒に描かれた文字および手の輪
郭が白(10進数の255を表す8ビットの2進数値”
11111111”)であり、エッジ部以外の部分、す
なわち、将棋盤上の升目内部および手の輪郭の内部が黒
(10進数の0を表す8ビットの2進数値”00000
000”)であるエッジ抽出画像に基づいて駒有無認識
処理が行なわれる。
The frame presence / absence recognition processing is performed based on the binarized image of FIG. 6 obtained in step 103 of the invalid area extraction processing. In other words, the edges, ie, the lines dividing the squares on the chess board, the characters drawn on each piece and the outline of the hand are white (8-bit binary value representing 255 in decimal)
11111111 "), and the portion other than the edge portion, that is, the inside of the square on the shogi board and the inside of the outline of the hand are black (8-bit binary value" 00000 representing decimal 0 ").
000 ") is performed based on the edge extracted image.

【0063】まず、第3のラベル画像と上記エッジ抽出
画像との間でAND演算が行なわれる(ステップ11
1)。図13は、第3のラベル画像を示している。第3
のラベル画像は、将棋盤の各升目の中央部に対応する位
置に円形のラベルC1〜C81を有する画像である。
First, an AND operation is performed between the third label image and the edge extracted image (step 11).
1). FIG. 13 shows a third label image. Third
Is an image having circular labels C1 to C81 at positions corresponding to the center of each square of the shogi board.

【0064】第3のラベル画像において、ラベルC1〜
C81以外の部分は黒(10進数の0を表す8ビットの
2進数値”00000000”)である。各ラベルC1
〜C81内の輝度値は、10進数の1〜81を表す互い
に異なる8ビットの2進数値である。つまり、ラベルC
1の輝度値は10進数の1を表す8ビットの2進数値で
あり、ラベルC2の輝度値は10進数の2を表す8ビッ
トの2進数値であり、ラベルC81の輝度値は10進数
の81を表す8ビットの2進数値である。なお、図14
は、第3ラベル画像のうちのラベルC1付近の拡大図で
ある。
In the third label image, the labels C1 to C1
Portions other than C81 are black (8-bit binary value “00000000” representing decimal 0). Each label C1
Luminance values in C81 are 8-bit binary values different from each other and represent decimal numbers 1 to 81. That is, the label C
The luminance value of 1 is an 8-bit binary value representing a decimal number 1, the luminance value of label C2 is an 8-bit binary value of a decimal number 2, and the luminance value of label C81 is a decimal value. It is an 8-bit binary value representing 81. FIG.
Is an enlarged view of the vicinity of the label C1 in the third label image.

【0065】このような第3ラベル画像とエッジ抽出画
像との間でAND演算を行なうと、エッジ抽出画像にお
けるラベルC1〜C81以外の領域においては、輝度値
が0となる。また、エッジ抽出画像における各ラベルC
1〜C81に対応する領域のうち、駒が存在していない
領域においては、その輝度値は0となる。したがって、
AND演算後の画像においては、エッジ抽出画像におけ
る各ラベルC1〜C81に対応する領域のうち、駒が存
在していない領域に対応するラベルの輝度値を持つ画素
は存在しなくなる。
When an AND operation is performed between the third label image and the edge extracted image, the luminance value becomes 0 in the area other than the labels C1 to C81 in the edge extracted image. Also, each label C in the edge extraction image
Among the areas corresponding to 1 to C81, the area where no piece exists does not have a luminance value of 0. Therefore,
In the image after the AND operation, among the regions corresponding to the labels C1 to C81 in the edge extracted image, there is no pixel having the luminance value of the label corresponding to the region where no frame exists.

【0066】一方、エッジ抽出画像における各ラベルC
1〜C81に対応する領域のうち、図15に示すよう
に、駒Kが存在している領域においては、その領域のう
ちの駒Kの文字部分の輝度値が対応するラベルCiの輝
度値となり、その他の部分の輝度値は0となる。したが
って、AND演算後の画像において、エッジ抽出画像に
おける各ラベルC1〜C81に対応する領域のうち、駒
が存在している領域においては、対応するラベルCiの
輝度値を持つ画素が存在することになる。
On the other hand, each label C in the edge extracted image
As shown in FIG. 15, in the area corresponding to 1 to C81, in the area where the piece K exists, the brightness value of the character portion of the piece K in the area becomes the brightness value of the corresponding label Ci. , The luminance values of the other parts are 0. Therefore, in the image after the AND operation, among the areas corresponding to the labels C1 to C81 in the edge extracted image, in the area where the piece exists, there is a pixel having the luminance value of the corresponding label Ci. Become.

【0067】このようにして、第3ラベル画像とエッジ
抽出画像との間のAND演算が行なわれると、得られた
画像に基づいて、図9に示すように、輝度値に対する画
素の度数を表すヒストグラムが作成される(ステップ1
12)。
When the AND operation is performed between the third label image and the edge extracted image in this manner, the frequency of the pixel with respect to the luminance value is represented based on the obtained image as shown in FIG. A histogram is created (step 1
12).

【0068】そして、作成されたヒストグラムに基づい
て、しきい値処理が行なわれる(ステップ113)。つ
まり、ヒストグラム値(度数)がしきい値β以上である
輝度値に対応するラベルが存在する升目には駒が存在す
ると判定され、ヒストグラム値がしきい値βより小さい
輝度値に対応するラベルが存在する升目には駒が存在し
ないと判定される。なお、有効領域内における駒有無判
定結果のみが駒有無認識結果とされる。
Then, threshold processing is performed based on the created histogram (step 113). That is, it is determined that there is a piece in a square where a label corresponding to a luminance value whose histogram value (frequency) is equal to or larger than the threshold value β is present, and a label corresponding to a luminance value whose histogram value is smaller than the threshold value β is determined. It is determined that there is no piece in the existing square. It should be noted that only the frame presence / absence determination result within the effective area is regarded as the frame presence / absence recognition result.

【0069】上記の駒有無認識処理によれば、ラベル画
像とエッジ抽出画像との間のAND演算結果に基づい
て、ヒストグラムを作成し、ヒストグラムに対してしき
い値処理を行なうだけで、駒有無が認識されるので、処
理速度が向上する。
According to the above-described frame presence / absence recognition processing, a histogram is created based on the result of the AND operation between the label image and the edge extracted image, and threshold value processing is performed on the histogram. Is recognized, so that the processing speed is improved.

【0070】図17は、割り込み処理の手順を示してい
る。また、図18は、割り込み処理において、キューの
状態が変化する様子を示している。
FIG. 17 shows the procedure of the interrupt processing. FIG. 18 shows how the state of the queue changes in the interrupt processing.

【0071】この割り込み処理は、チェック処理(ステ
ップ13)において起動されたタイマに基づいて、周期
的に実行される。
This interrupt processing is periodically executed based on the timer started in the check processing (step 13).

【0072】割り込み処理においては、まず、キュー内
の10個の領域のうち、入力画像を格納すべきキューの
状態が”画像入力中状態”とされる(ステップ21)。
ここでは、キュー内の10個の領域には、下の領域から
入力画像が蓄積されていくものとする。キュー内の各領
域のキュー状態には、画像が蓄積されている状態(画像
有り状態)、画像が蓄積されていない状態(画像無し状
態)、画像が入力されている状態(画像入力中状態)お
よび画像が読み出されて処理されている状態(処理中状
態)の4つの状態がある。
In the interrupt processing, first, among the ten areas in the queue, the state of the queue in which the input image is to be stored is set to the "image input state" (step 21).
Here, it is assumed that the input images are accumulated in the ten regions in the queue from the lower region. The queue state of each area in the queue includes a state where an image is stored (state with image), a state where no image is stored (state without image), and a state where an image is input (state during image input). And a state in which the image is read and processed (processing state).

【0073】図18(a)に示すように、下から5つ目
の領域までに入力画像が蓄積されている場合には、下か
ら6つ目の領域のキュー状態が”画像入力中状態”にさ
れる。
As shown in FIG. 18A, when the input image is accumulated in the fifth area from the bottom, the queue state of the sixth area from the bottom is “image input state”. To be.

【0074】次に、CCDカメラ1から画像が取り込ま
れる(ステップ22)。そして、CCDカメラ1からの
画像取込みが終了すると(ステップ23)、図18
(b)に示すように、取り込まれた画像が、”画像入力
中状態”にされた領域に格納される(ステップ24)。
この後、画像が格納された領域のキュー状態が、図18
(c)に示すように、”画像有り状態”とされる。
Next, an image is captured from the CCD camera 1 (step 22). Then, when the image capture from the CCD camera 1 is completed (step 23), FIG.
As shown in (b), the captured image is stored in the area set to the “image input state” (step 24).
Thereafter, the queue state of the area where the image is stored is shown in FIG.
As shown in (c), the state is “image present state”.

【0075】図19は、図3のステップ3の画像入力処
理の手順を示している。また、図20は、画像入力処理
において、キューの状態が変化する様子を示している。
FIG. 19 shows the procedure of the image input process in step 3 of FIG. FIG. 20 shows how the state of the queue changes in the image input processing.

【0076】画像入力処理においては、図20(a)に
示すように、まず、現在”処理中状態”となっている領
域のキュー状態が、”画像無し状態”に変更される(ス
テップ31)。
In the image input processing, as shown in FIG. 20A, first, the queue state of the area currently in the “processing state” is changed to the “no image state” (step 31). .

【0077】次に、キュー内に、”画像有り状態”の領
域が存在しているか否かが判定される(ステップ3
2)。”画像有り状態”の領域が存在していない場合に
は、CCDカメラ1から画像が取り込まれる(ステップ
33)。また、チェック処理によって割り込み処理のた
めのタイマが駆動されている場合には、タイマの駆動が
停止される。
Next, it is determined whether or not an area of "image present state" exists in the queue (step 3).
2). If there is no “image present state” area, an image is captured from the CCD camera 1 (step 33). When the timer for interrupt processing is driven by the check processing, the driving of the timer is stopped.

【0078】”画像有り状態”の領域が存在している場
合には、図20(b)に示すように、”画像有り状態”
の領域のうち最も古い画像が蓄積されている領域、すな
わち”画像有り状態”の領域のうち、最も下側の領域の
キュー状態が”処理中状態”とされた後、その領域から
画像が取り出される(ステップ34)。
If an area of “image present state” exists, as shown in FIG. 20B, “image present state”
Of the regions where the oldest image is stored, that is, the region with the “image present state”, the queue state of the lowermost region is set to the “processing state”, and then the image is extracted from that region. (Step 34).

【0079】図21は、図3のステップ13のチェック
処理の手順を示している。図21は、画像処理ボード3
0による処理を示している。
FIG. 21 shows the procedure of the check process in step 13 of FIG. FIG. 21 shows the image processing board 3
0 indicates a process.

【0080】チェック処理においては、まず、キューの
内容がクリアされる(ステップ41)。次に、割り込み
処理を開始させるためのタイマが起動される(ステップ
42)。次に、駒配置のチェック処理が行なわれる(ス
テップ43)。
In the checking process, first, the contents of the queue are cleared (step 41). Next, a timer for starting interrupt processing is started (step 42). Next, a frame arrangement check process is performed (step 43).

【0081】駒配置のチェック処理においては、まず、
ホスト19によって作成されたチェックリストを受け取
る(ステップ51)。このチェックリストは、ホスト1
9によって次のようにして作成される。ホスト19は、
図22に示すように、最新に記録した棋譜からランダム
に任意の行または列を選択する。そして、選択した行ま
たは列上の各升目毎に、駒が有るかないかを示す情報、
駒がある場合にはその駒の種類を示す情報からなるチェ
ックリストを作成する。
In the frame arrangement check processing, first,
The check list created by the host 19 is received (step 51). Checklist for host 1
9 is created as follows. The host 19
As shown in FIG. 22, an arbitrary row or column is randomly selected from the latest recorded game record. And information indicating whether or not there is a piece for each cell on the selected row or column,
If there is a piece, a check list including information indicating the type of the piece is created.

【0082】チェックリストを受けとると、図22に示
すように、最新の取込み画像におけるチェックリストに
対応する行または列の各升目ごとに、その内容がチェッ
クリストの内容と一致するか否かが判定される(ステッ
プ52)。この判定は、各升目ごとに、チェックリスト
の内容に応じたテンプレートを用いたテンプレートマッ
チングを取込み画像に対して行なうことにより、最新の
取込み画像とチェックリストの内容とが一致するか否か
が判定される。全ての升目において、最新の取込み画像
の内容と、チェックリストの内容とが一致した場合には
(ステップ53でYES、ステップ54でYES)、ホ
スト19の記憶装置23に記憶されている最新の棋譜は
正しい(OK)と判断される。
When the checklist is received, as shown in FIG. 22, it is determined whether or not the content of each cell in the row or column corresponding to the checklist in the latest captured image matches the content of the checklist. Is performed (step 52). This determination is performed for each square by performing template matching using a template corresponding to the content of the checklist on the captured image, thereby determining whether the latest captured image matches the content of the checklist. Is done. If the contents of the latest captured image match the contents of the checklist in all the cells (YES in step 53 and YES in step 54), the latest game record stored in the storage device 23 of the host 19 is obtained. Is determined to be correct (OK).

【0083】最新の取込み画像の内容と、チェックリス
トの内容とが一致しない升目が存在する場合には(ステ
ップ53でNO)、ホスト19の記憶装置23に記憶さ
れている最新の棋譜は誤っている(NG)と判断され
る。
If there is a cell in which the contents of the latest captured image do not match the contents of the checklist (NO in step 53), the latest game record stored in the storage device 23 of the host 19 is erroneously detected. (NG).

【0084】駒配置のチェック処理が終了すると、駒配
置のチェック処理の結果(OKorNG)をホスト19
に通知される(ステップ44)。
When the frame arrangement check processing is completed, the result of the frame arrangement check processing (OKorNG) is transmitted to the host 19.
(Step 44).

【0085】なお、駒配置のチェック処理において、ホ
スト19の記憶装置23に記憶されている最新の棋譜は
正しい(OK)と判定された場合には、図3のステップ
14でYESとなり、ステップ11に移行する。駒の配
置のチェック処理において、ホスト19の記憶装置23
に記憶されている最新の棋譜は誤っている(NG)と判
定された場合には、図3のステップ14でNOとなり、
ステップ15のリカバリ処理に移行する。
If the latest game record stored in the storage device 23 of the host 19 is determined to be correct (OK) in the piece arrangement check processing, the result of step 14 in FIG. Move to In the process of checking the arrangement of the pieces, the storage device 23 of the host 19
Is determined to be incorrect (NG), the latest game record stored in is determined to be NO in step 14 of FIG.
The process proceeds to the recovery process in step S15.

【0086】図23は、図3のステップ15のリカバリ
処理の手順を示している。図23は、画像処理ボード3
0による処理を示している。
FIG. 23 shows the procedure of the recovery process in step 15 of FIG. FIG. 23 shows the image processing board 3
0 indicates a process.

【0087】まず、現在取り込まれている画像に対し
て、図3のステップ4と同様に無効領域抽出処理が行な
われる(ステップ61)。無効領域とは、取込み画像に
おいて、対局者の手等の障害物が存在している領域をい
う。
First, an invalid area extracting process is performed on the currently captured image in the same manner as in step 4 of FIG. 3 (step 61). The invalid area is an area where an obstacle such as a player's hand exists in the captured image.

【0088】無効領域抽出処理において、無効領域(障
害物)が存在しないと判定された場合には、ステップ6
4に進む。
If it is determined in the invalid area extraction processing that there is no invalid area (obstacle), step 6
Proceed to 4.

【0089】無効領域抽出処理において、無効領域(障
害物)が存在すると判定された場合には(ステップ62
でNO)、図3のステップ3と同様に画像入力処理が行
なわれ新たな画像がCCDカメラ1またはキューから取
り込まれる(ステップ63)。そして、ステップ61に
戻る。したがって、障害物が存在しないと判定されるま
で、ステップ61、62、63の処理が繰り返される。
In the invalid area extraction processing, when it is determined that there is an invalid area (obstacle) (step 62)
NO), image input processing is performed in the same manner as in step 3 of FIG. 3, and a new image is fetched from the CCD camera 1 or the queue (step 63). Then, the process returns to step 61. Therefore, the processes of steps 61, 62 and 63 are repeated until it is determined that no obstacle exists.

【0090】ステップ64では、ステップ62で障害物
が存在しないと判定された取込み画像に対して、全駒配
置の取得処理が行なわれる。
In step 64, the process of acquiring the arrangement of all frames is performed on the captured image determined in step 62 that no obstacle exists.

【0091】全駒配置の取得処理では、まず、ホスト1
9によって作成されたマップデータを受け取る(ステッ
プ71)。このマップデータは、ホスト19によって次
のようにして作成される。ホスト19は、図24に示す
ように、最新に記録した棋譜の各升目ごとに、駒が有る
かないかを示す情報、駒がある場合にはその駒の種類を
示す情報からなるマップデータを作成する。
In the process of acquiring the arrangement of all frames, first, the host 1
9 is received (step 71). This map data is created by the host 19 as follows. As shown in FIG. 24, the host 19 creates map data including information indicating whether there is a piece or not and, if there is a piece, information indicating the type of the piece for each square of the latest recorded game record. .

【0092】マップデータを受けとると、図24に示す
ように、ステップ62で障害物が存在しないと判定され
た取込み画像の各升目ごとに、その内容がマップデータ
の内容と一致するか否かが判定される(ステップ7
2)。この判定は、各升目ごとに、マップデータの内容
に応じたテンプレートを用いたテンプレートマッチング
を取込み画像に対して行なうことにより、取込み画像と
マップデータの内容とが一致するかが判定される。
When the map data is received, as shown in FIG. 24, it is determined whether or not the content of each square of the captured image determined as having no obstacle in step 62 matches the content of the map data. Is determined (Step 7
2). This determination is made for each square by performing template matching using a template corresponding to the content of the map data on the captured image, thereby determining whether the content of the captured image matches the content of the map data.

【0093】取込み画像の内容と、マップデータの内容
とが一致した場合には(ステップ73でYES)、その
駒の位置と種類とが記憶される(ステップ74)。そし
て、全ての升目について、ステップ72の処理が終了し
たか否かが判定される(ステップ75)。全ての升目に
ついて、ステップ72の処理が終了していない場合に
は、ステップ72に戻り、次の升目に対して、ステップ
72の処理が行なわれる。
If the content of the captured image matches the content of the map data (YES in step 73), the position and type of the frame are stored (step 74). Then, it is determined whether or not the processing of step 72 has been completed for all the cells (step 75). If the processing in step 72 has not been completed for all cells, the process returns to step 72, and the processing in step 72 is performed for the next cell.

【0094】取込み画像の内容と、チェックリストの内
容とが一致しなかった場合には(ステップ73でN
O)、取込み画像における当該升目画像に対して、各駒
のテンプレートを用いて、順次テンプレートマッチング
が行なわれる(ステップ76)。升目画像とテンプレー
ト画像とが一致すると(ステップ77でYES)、駒の
位置と駒の種類とが記憶される(ステップ74)。
If the content of the captured image does not match the content of the check list (N in step 73)
O), template matching is sequentially performed on the square image in the captured image using the template of each frame (step 76). If the grid image matches the template image (YES in step 77), the position of the piece and the type of the piece are stored (step 74).

【0095】升目画像とテンプレート画像とが一致しな
かった場合には(ステップ77でNO)、全種類の駒と
の照合が終了したか否かが判定される(ステップ7
8)。全種類の駒との照合が終了していなければ、ステ
ップ76に戻り、次のテンプレートを用いたテンプレー
トマッチングが行なわれる。
If the cell image does not match the template image (NO in step 77), it is determined whether or not the collation with all types of frames has been completed (step 7).
8). If the collation with all types of pieces has not been completed, the flow returns to step 76, and template matching using the next template is performed.

【0096】ステップ78において、全種類の駒との照
合が終了したと判定された場合には、相関値が最も高か
ったテンプレートに対応する駒が、当該升目に存在する
駒であると特定される(ステップ79)。そして、ステ
ップ74に進み、その駒の位置と駒の種類とが記憶され
る。
If it is determined in step 78 that the matching with all types of pieces has been completed, the piece corresponding to the template having the highest correlation value is specified as the piece existing in the corresponding cell. (Step 79). Then, the process proceeds to a step 74, wherein the position of the piece and the type of the piece are stored.

【0097】全駒配置の取得処理が終了すると、ステッ
プ74で記憶された駒の位置および種類の情報がホスト
19に送信される(ステップ65)。この後、図3のス
テップ10に移行し、ホスト19に送信された駒の位置
および種類の情報が、ホスト19の記憶装置23に記録
される。
When the processing for acquiring the arrangement of all frames is completed, the information on the position and type of the frames stored in step 74 is transmitted to the host 19 (step 65). Thereafter, the process proceeds to step 10 in FIG. 3, and information on the position and type of the frame transmitted to the host 19 is recorded in the storage device 23 of the host 19.

【0098】[0098]

【発明の効果】この発明によれば、処理速度の向上が図
れる将棋盤上の駒有無認識装置装置が実現する。
According to the present invention, an apparatus for recognizing the presence or absence of a piece on a shogi board which can improve the processing speed is realized.

【図面の簡単な説明】[Brief description of the drawings]

【図1】棋譜記録装置の外観を示す模式図である。FIG. 1 is a schematic diagram showing the appearance of a game record recording device.

【図2】棋譜記録装置の電気的構成を示すブロック図で
ある。
FIG. 2 is a block diagram showing an electrical configuration of the game record recording device.

【図3】棋譜記録装置のメイン処理の手順を示すフロー
チャートである。
FIG. 3 is a flowchart showing a procedure of a main process of the game record apparatus.

【図4】図3のステップ4の無効領域抽出処理の詳細な
手順を示すフローチャートである。
FIG. 4 is a flowchart showing a detailed procedure of an invalid area extraction process in step 4 of FIG. 3;

【図5】取込み画像の一例を示す模式図である。FIG. 5 is a schematic diagram illustrating an example of a captured image.

【図6】エッジ抽出処理によって得られた画像の2値化
画像を示す模式図である。
FIG. 6 is a schematic diagram showing a binarized image of an image obtained by the edge extraction processing.

【図7】第1ラベル画像を示す模式図である。FIG. 7 is a schematic diagram showing a first label image.

【図8】第1ラベル画像とエッジ抽出画像との間のAN
D演算によって得られる画像を説明するための模式図で
ある。
FIG. 8 shows an AN between a first label image and an edge extracted image.
FIG. 9 is a schematic diagram for explaining an image obtained by a D operation.

【図9】第1ラベル画像とエッジ抽出画像との間のAN
D演算によって得られた画像に基づいて作成されたヒス
トグラムを示すグラフである。
FIG. 9 shows an AN between a first label image and an edge extracted image.
9 is a graph showing a histogram created based on an image obtained by a D operation.

【図10】第2ラベル画像を示す模式図である。FIG. 10 is a schematic diagram showing a second label image.

【図11】無効領域抽出処理によって抽出された無効領
域を示す模式図である。
FIG. 11 is a schematic diagram illustrating an invalid area extracted by an invalid area extraction process.

【図12】図3のステップ5の駒有無認識処理の詳細な
手順を示すフローチャートである。
FIG. 12 is a flowchart showing a detailed procedure of a frame presence / absence recognition process in step 5 of FIG. 3;

【図13】第3ラベル画像を示す模式図である。FIG. 13 is a schematic diagram showing a third label image.

【図14】ラベルC1付近の第3ラベル画像の部分拡大
図である。
FIG. 14 is a partially enlarged view of a third label image near a label C1.

【図15】第3ラベル画像とエッジ抽出画像との間のA
ND演算によって得られる画像を説明するための模式図
である。
FIG. 15 is a diagram showing A between a third label image and an edge extracted image;
It is a schematic diagram for explaining the image obtained by ND operation.

【図16】第3ラベル画像とエッジ抽出画像との間のA
ND演算によって得られた画像に基づいて作成されたヒ
ストグラムを示すグラフである。
FIG. 16 is a diagram showing A between a third label image and an edge extracted image;
It is a graph which shows the histogram created based on the image obtained by ND operation.

【図17】割り込み処理を示すフローチャートである。FIG. 17 is a flowchart showing an interrupt process.

【図18】割り込み処理において、キューの状態が変化
する様子を示す模式図である。
FIG. 18 is a schematic diagram illustrating a state in which the state of a queue changes in interrupt processing.

【図19】図3のステップ3の画像入力処理の詳細な手
順を示すフローチャートである。
FIG. 19 is a flowchart illustrating a detailed procedure of an image input process in step 3 of FIG. 3;

【図20】画像入力処理において、キューの状態が変化
する様子を示す模式図である。
FIG. 20 is a schematic diagram showing a state in which the state of a queue changes in the image input processing.

【図21】図3のステップ13のチェック処理の詳細な
手順を示すフローチャートである。
FIG. 21 is a flowchart showing a detailed procedure of a check process in step 13 of FIG. 3;

【図22】チェック処理を説明するための模式図であ
る。
FIG. 22 is a schematic diagram for explaining a check process.

【図23】図3のステップ15のリカバリ処理の詳細な
手順を示すフローチャートである。
FIG. 23 is a flowchart showing a detailed procedure of a recovery process in step 15 of FIG. 3;

【図24】リカバリ処理を説明するための模式図であ
る。
FIG. 24 is a schematic diagram for explaining a recovery process.

【符号の説明】[Explanation of symbols]

1 CCDカメラ 11 画像処理部 13 画像メモリ 16 CPU 19 ホスト 23 記憶装置 30 画像処理ボード DESCRIPTION OF SYMBOLS 1 CCD camera 11 Image processing part 13 Image memory 16 CPU 19 Host 23 Storage device 30 Image processing board

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 将棋盤上の駒の取込み画像に基づいて、
各升目ごとの駒の有無を認識する将棋盤上の駒有無認識
装置において、 将棋盤上の駒の取込み画像から、将棋盤上の升目を仕切
る線および各駒に描かれた文字の輝度値が第1輝度値で
あり、将棋盤上の升目内部の地肌の輝度値が第1輝度値
とは異なる第2輝度値であるエッジ抽出画像を生成する
エッジ抽出画像生成手段、 エッジ抽出画像上における将棋盤上の各升目の内部に相
当する位置にそれぞれラベルを有し、ラベル以外の部分
の輝度値が第3輝度値であり、各ラベル内の輝度値が第
2輝度値および第3輝度値と異なる輝度値であってかつ
ラベル毎に異なる輝度値であるラベル画像と、エッジ抽
出画像との間で所定の画像間演算を行なって、エッジ抽
出画像上の各ラベルに対応する領域において、第1輝度
値の画素および第2輝度値の画素のうち、第1輝度値の
画素のみ、その輝度値が、が対応するラベルの輝度値と
なる画像を得る画像間演算手段、 画像間演算手段によって得られた画像に基づいて、輝度
値に対する画素の度数を表すヒストグラムを作成する手
段、ならびに得られた各輝度値に対する度数をしきい値
と比較し、度数がしきい値以上の輝度値に対応するラベ
ルが存在する升目に駒が有ると判定し、度数がしきい値
より小さい輝度値に対応するラベルが存在する升目に駒
が無いと判定するしきい値処理手段、 を備えていることを特徴とする将棋盤上の無効領域抽出
装置。
1. Based on a captured image of a piece on a shogi board,
In a piece presence / absence recognition device on a shogi board for recognizing the presence / absence of a piece for each square, a luminance value of a line separating the squares on the shogi board and a luminance value of a character drawn on each piece from a captured image of the piece on the shogi board are first. An edge-extracted image generating means for generating an edge-extracted image which is a luminance value and whose second luminance value is different from the first luminance value of the background inside the squares on the shogi board; Has a label at a position corresponding to the inside of each cell, and a luminance value of a portion other than the label is a third luminance value, and a luminance value in each label is different from the second luminance value and the third luminance value. A predetermined inter-image operation is performed between a label image that is a value and a luminance value that differs for each label, and an edge extraction image, and a first luminance value is calculated in an area corresponding to each label on the edge extraction image. Pixel and the second luminance value Of the pixels, only the pixel of the first luminance value has an image whose luminance value is the luminance value of the corresponding label. Means for creating a histogram representing the frequency of the pixel, and compare the frequency for each obtained luminance value with a threshold value, and if there is a piece in the square where the frequency has a label corresponding to the luminance value equal to or greater than the threshold value A threshold processing means for determining that there is no piece in a cell in which a label corresponding to a luminance value whose frequency is smaller than the threshold value is present, and an invalid area extraction device on a shogi board. .
【請求項2】 第1輝度値、第2輝度値、第3輝度値お
よび各ラベルの輝度値は、予め定められたビット数の2
進数値で表され、第1輝度値は、全てのビットが1で表
される2進数値であり、第2輝度値および第3輝度値は
全てのビットが0で表される2進数値であり、各ラベル
の輝度値は、全てのビットが0の2進数より大きくかつ
全てのビットが1である2進数以下の範囲で互いに異な
る2進数値に設定されており、画像間演算手段は、ラベ
ル画像とエッジ抽出画像との間でAND演算を行うもの
である請求項1に記載の将棋盤上の無効領域抽出装置。
2. The first luminance value, the second luminance value, the third luminance value, and the luminance value of each label are a predetermined number of bits of 2 bits.
The first luminance value is a binary value in which all bits are represented by 1, and the second luminance value and the third luminance value are binary values in which all bits are represented by 0. The luminance value of each label is set to a different binary value within a range of not more than a binary number in which all bits are 0 and all bits are 1 and all bits are 1. 2. The apparatus according to claim 1, wherein an AND operation is performed between the label image and the edge extracted image.
JP8178343A 1996-07-08 1996-07-08 Recognition device for pieces on japanese chess board Pending JPH1015152A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8178343A JPH1015152A (en) 1996-07-08 1996-07-08 Recognition device for pieces on japanese chess board

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8178343A JPH1015152A (en) 1996-07-08 1996-07-08 Recognition device for pieces on japanese chess board

Publications (1)

Publication Number Publication Date
JPH1015152A true JPH1015152A (en) 1998-01-20

Family

ID=16046845

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8178343A Pending JPH1015152A (en) 1996-07-08 1996-07-08 Recognition device for pieces on japanese chess board

Country Status (1)

Country Link
JP (1) JPH1015152A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7562820B2 (en) 2002-12-17 2009-07-21 Sharp Kabushiki Kaisha Barcode recognition apparatus
US7690975B2 (en) 2004-02-18 2010-04-06 Sony Computer Entertainment Inc. Image display system, image processing system, and video game system
US8152637B2 (en) 2004-02-18 2012-04-10 Sony Computer Entertainment Inc. Image display system, information processing system, image processing system, and video game system
EP3126023A4 (en) * 2014-04-03 2017-11-15 Chess Vision Ltd. Vision system for monitoring board games and method thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7562820B2 (en) 2002-12-17 2009-07-21 Sharp Kabushiki Kaisha Barcode recognition apparatus
US7690975B2 (en) 2004-02-18 2010-04-06 Sony Computer Entertainment Inc. Image display system, image processing system, and video game system
US8152637B2 (en) 2004-02-18 2012-04-10 Sony Computer Entertainment Inc. Image display system, information processing system, image processing system, and video game system
EP3126023A4 (en) * 2014-04-03 2017-11-15 Chess Vision Ltd. Vision system for monitoring board games and method thereof

Similar Documents

Publication Publication Date Title
CN110232311B (en) Method and device for segmenting hand image and computer equipment
EP3916627A1 (en) Living body detection method based on facial recognition, and electronic device and storage medium
KR100480781B1 (en) Method of extracting teeth area from teeth image and personal identification method and apparatus using teeth image
US20050196044A1 (en) Method of extracting candidate human region within image, system for extracting candidate human region, program for extracting candidate human region, method of discerning top and bottom of human image, system for discerning top and bottom, and program for discerning top and bottom
KR100826878B1 (en) Hand shafe recognition method and apparatus for thereof
US20060245649A1 (en) Method and system for recognizing objects in an image based on characteristics of the objects
CN112287868B (en) Human body action recognition method and device
CN110582783B (en) Training device, image recognition device, training method, and computer-readable information storage medium
CN112287867B (en) Multi-camera human body action recognition method and device
WO2005055143A1 (en) Person head top detection method, head top detection system, and head top detection program
KR101700120B1 (en) Apparatus and method for object recognition, and system inculding the same
JP4717445B2 (en) Image processing system, image processing device, game device, program, information storage medium, and image processing method
JPH1015152A (en) Recognition device for pieces on japanese chess board
CN106156774A (en) Image processing method and image processing system
CN108491820B (en) Method, device and equipment for identifying limb representation information in image and storage medium
JPH1015153A (en) Extraction device for invalid zone on japanese chess board
WO2005055144A1 (en) Person face jaw detection method, jaw detection system, and jaw detection program
JPH1015150A (en) Recognition device for pieces on japanese chess board
CN108121963B (en) Video data processing method and device and computing equipment
JP3963789B2 (en) Eye detection device, eye detection program, recording medium for recording the program, and eye detection method
CN112348112A (en) Training method and device for image recognition model and terminal equipment
JP3096620B2 (en) Game record recorder
JPH1015151A (en) Extraction device for invalid zone on japanese chess board and recognition device for pieces on the board
JPH09285594A (en) Automatic status recognizing device of go, and go game progress recording device
JP2003030660A (en) Fingerprint collation device and fingerprint collation method