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

Recognition device for pieces on japanese chess board

Info

Publication number
JPH1015150A
JPH1015150A JP17046996A JP17046996A JPH1015150A JP H1015150 A JPH1015150 A JP H1015150A JP 17046996 A JP17046996 A JP 17046996A JP 17046996 A JP17046996 A JP 17046996A JP H1015150 A JPH1015150 A JP H1015150A
Authority
JP
Japan
Prior art keywords
value
histogram
piece
image
square
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
JP17046996A
Other languages
Japanese (ja)
Inventor
Eiichiro Hashimoto
栄一郎 橋本
Hitoshi Kihara
均 木原
Minoru Higashihara
稔 東原
Kozo Miyamoto
幸三 宮本
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 JP17046996A priority Critical patent/JPH1015150A/en
Publication of JPH1015150A publication Critical patent/JPH1015150A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To accurately identify the existence or non-existence of Japanese chess pieces by using a sum of picture elements having the first luminance values obtained for each square as a histogram value for each square, and setting a threshold value equal to or less than the preset histogram value in the case of the assumption that histogram values are arrayed in order from a small value to a large value. 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. A sum of picture elements having the first luminance value is calculated for each square on the basis of the edge extracted image, and used as a histogram value for each square. A threshold is set at a value equal to or larger than the smaller of the values of two adjacent histograms having a difference equal to or more than the preset value, and equal to or smaller than the larger histogram value, in case of the assumption that the histogram values are arrayed in order from a small value to a large value. Then, the threshold value is compared with the histogram values, and the existence or non-existence of Japanese chess pieces are thereby identified.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、将棋盤上の駒の
取込み画像に基づいて将棋盤上の駒有無を認識する将棋
盤上の駒有無認識装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for recognizing the presence or absence of a piece on a shogi board based on a captured image of the piece on the shogi board.

【0002】[0002]

【従来の技術】本出願人は、将棋盤上の駒の取込み画像
に基づいて、各升目ごとに駒有無を認識する駒有無認識
手段、駒有無認識手段による認識結果に基づいて、駒有
無状態が変化した領域を抽出する変化領域抽出手段、お
よび駒有無の状態が変化した領域が抽出されたときに、
変化した駒の種類と位置とを特定し、特定された駒の種
類と位置とに基づいて、一手毎に駒の変化内容を記憶装
置に記録する記録手段を備えた棋譜記録装置を開発し、
特許出願している。ただし、本願出願時には、未だ公開
されていない。
2. Description of the Related Art The present applicant has proposed a piece presence / absence recognizing means for recognizing the presence / absence of a piece for each square based on a captured image of a piece on a shogi board. A changed area extracting means for extracting a changed area, and when an area in which the state of the presence or absence of a piece is changed is extracted,
Identify the type and position of the changed piece, and, based on the type and position of the specified piece, develop a game record recording device including a recording unit that records the change content of the piece for each move in a storage device,
We have applied for a patent. However, at the time of filing the present application, it has not been published yet.

【0003】[0003]

【発明が解決しようとする課題】本出願人が開発した棋
譜記録装置における駒有無認識手段では、将棋盤上の駒
の取込み画像から、将棋盤上の升目を仕切る線および各
駒に描かれた文字の輝度値が第1輝度値であり、将棋盤
上の升目内部の地肌の輝度値が第2輝度値であるエッジ
抽出画像が生成される。エッジ抽出画像から各升目ごと
に、第1輝度値を持つ画素の総和(以下、各升目に対す
るヒストグラム値という)が算出される。そして、ヒス
トグラム値が予め定められたしきい値より大きい升目に
は駒が存在すると判定され、ヒストグラム値が予め定め
られたしきい値以下である升目には駒が存在しないと判
定される。
In the game record recording device developed by the present applicant, the piece presence / absence recognizing means uses, from a captured image of a piece on the shogi board, a line separating the squares on the shogi board and characters drawn on each piece. Is the first luminance value, and an edge-extracted image in which the luminance value of the background inside the square on the chessboard is the second luminance value is generated. A sum total of pixels having the first luminance value (hereinafter, referred to as a histogram value for each square) is calculated for each square from the edge extracted image. Then, it is determined that there is a piece in a cell whose histogram value is larger than a predetermined threshold value, and it is determined that there is no piece in a cell whose histogram value is equal to or less than the predetermined threshold value.

【0004】しかしながら、各升目に対するヒストグラ
ム値は、入力画像の大きさに依存するため、しきい値と
して固定された値を用いると、駒の有無判定を正確に行
なうことができないという問題がある。
However, since the histogram value for each cell depends on the size of the input image, if a fixed value is used as the threshold value, there is a problem that the presence or absence of a frame cannot be accurately determined.

【0005】この発明は、入力画像の大きさにかかわら
ず正確に駒有無の認識を行なえる将棋盤上の駒有無認識
装置を提供することを目的とする。
An object of the present invention is to provide a piece presence / absence recognition device on a shogi board capable of accurately recognizing the presence / absence of a piece regardless of the size of an input image.

【0006】[0006]

【課題を解決するための手段】この発明による将棋盤上
の駒有無認識装置は、将棋盤上の駒の取込み画像に基づ
いて、各升目ごとの駒の有無を認識する将棋盤上の駒有
無認識装置において、将棋盤上の駒の取込み画像から、
将棋盤上の升目を仕切る線および各駒に描かれた文字の
輝度値が第1輝度値であり、将棋盤上の升目内部の地肌
の輝度値が第1輝度値とは異なる第2輝度値であるエッ
ジ抽出画像を生成するエッジ抽出画像生成手段、エッジ
抽出画像から各升目ごとに、第1輝度値を持つ画素の総
和を算出する算出手段、各升目ごとに求められた第1輝
度値を持つ画素の総和を各升目に対するヒストグラム値
とし、ヒストグラム値を小さいものから順に並べたと仮
定した場合に、隣り合うヒストグラム値の差が所定値以
上である2つのヒストグラム値における小さい方のヒス
トグラム値以上で大きい方のヒストグラム値以下の値に
しきい値を設定するしきい値設定手段、および各升目に
対するヒストグラム値と上記しきい値とを比較すること
により、各升目に駒が存在するか否かを判定する判定手
段を備えていることを特徴とする。
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, calculating means for calculating the sum of pixels having a first luminance value for each square from the edge extraction image, and calculating the first luminance value obtained for each square Assuming that the sum of the pixels possessed is the histogram value for each cell, and that the histogram values are arranged in ascending order, the difference between adjacent histogram values is equal to or greater than the smaller of the two histogram values that are equal to or greater than the predetermined value. Threshold setting means for setting a threshold to a value equal to or less than the larger histogram value, and comparing the histogram value for each cell with the above threshold, There characterized in that it comprises determining means for determining whether present.

【0007】この発明による将棋盤上の駒有無認識装置
では、各升目ごとに求められた第1輝度値を持つ画素の
総和を各升目に対するヒストグラム値とし、ヒストグラ
ム値を小さいものから順に並べたと仮定した場合に、隣
り合うヒストグラム値の差が所定値以上である2つのヒ
ストグラム値における小さい方のヒストグラム値以上で
大きい方のヒストグラム値以下の値にしきい値を設定し
ているので、入力画像の大きさに係わらず、駒の有無を
正確に判定することができる。
In the apparatus for recognizing the presence or absence of a piece on a chess board according to the present invention, it is assumed that the sum of pixels having the first luminance value obtained for each cell is set as a histogram value for each cell, and the histogram values are arranged in ascending order. In this case, the threshold value is set to a value equal to or larger than the smaller histogram value and equal to or smaller than the larger histogram value in the two histogram values in which the difference between the adjacent histogram values is equal to or larger than the predetermined value. Regardless, the presence or absence of a piece can be accurately determined.

【0008】上記しきい値設定手段としては、具体的に
は、各升目ごとに求められた第1輝度値を持つ画素の総
和を各升目に対するヒストグラム値とし、画素数を横軸
にとり、ヒストグラム値が横軸の画素数以下である升目
の数の累積値を縦軸にとって、画素数に対する升目の数
の累積値の分布を作成し、升目の数の累積値が一定間隔
以上変化しない部分を探索し、探索された部分に対応す
る画素数の範囲内からしきい値を設定するものが用いら
れる。
Specifically, the threshold value setting means includes, as a histogram value for each cell, the sum of pixels having the first luminance value obtained for each cell, taking the number of pixels on the horizontal axis, The distribution of the cumulative value of the number of squares with respect to the number of pixels is created by taking the cumulative value of the number of squares whose number is equal to or less than the number of pixels on the horizontal axis, and searching for a portion where the cumulative value of the number of squares does not change over a certain interval. Then, a threshold value is set from the range of the number of pixels corresponding to the searched portion.

【0009】升目の数の累積値が一定間隔以上変化しな
い部分の探索を、升目の数の累積値が41個である点か
ら開始するようにしてもよい。この理由は、全升目数は
81個であり、全駒数は40個であるので、駒の存在し
ない升目が最低41個存在するからである。
The search for a portion where the cumulative value of the number of cells does not change over a certain interval may be started from the point where the cumulative value of the number of cells is 41. This is because the total number of squares is 81 and the total number of frames is 40, so that there are at least 41 squares with no frames.

【0010】[0010]

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

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

【0012】棋譜記録装置は、将棋盤を撮像する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.

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

【0014】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.

【0015】画像バス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.

【0016】フレームメモリ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.

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

【0018】画像メモリ13には、画像処理部11によ
る各種処理結果、テンプレートマッチングに用いられる
駒のテンプレートが記憶される。また、画像メモリ13
内には、割り込み処理によってCCDカメラ1によって
取り込まれた画像を記憶保持するための領域(以下、キ
ュー(queue)という)が設けられている。この例
では、キューは、10枚の取込み画像を記憶できる領域
を有している。画像メモリ13は、第2のメモリ制御部
14によって制御される。
The image memory 13 stores various processing results by the image processing section 11 and template of frames 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.

【0019】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.

【0020】EPROM18には、CPU16のプログ
ラム、すなわち画像処理ボード30の制御プログラムが
格納されている。ホストインタフェース17は、ホスト
19側のCPUバスと画像処理ボード30のCPUバス
15との間のデータの受渡しを行なう。
The program of the CPU 16, that is, the control program of the image processing board 30 is stored in the EPROM 18. 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.

【0021】ホスト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.

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

【0023】まず、対局が開始される前に初期化処理が
行なわれる(ステップ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.

【0024】対局開始時には、ホスト19側の記憶装置
23に、対局開始時の駒の配置に応じた各駒の種類と位
置に関する情報が記憶されており、ホスト19の内部モ
ニタ22に、対局開始時の駒の配置画像が表示される。
At the start of the game, information relating to the type and position of each frame according to the arrangement of the frames 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.

【0025】対局が開始されると(ステップ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.

【0026】次に、ステップ4〜9の駒移動検出および
移動駒特定処理が実行される。この駒移動検出および移
動駒特定処理においては、まず、取り込まれた画像に基
づいて、無効領域抽出処理が行なわれる(ステップ
4)。無効領域とは、取込み画像において、対局者の手
等の障害物が存在している領域をいう。無効領域抽出処
理の詳細については、後述する。
Next, frame movement detection and moving frame identification processing in 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.

【0027】この後、駒有無認識処理が行なわれる(ス
テップ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.

【0028】次に、駒有無状態の変化領域の抽出処理が
行なわれる(ステップ6)。つまり、将棋盤上の無効領
域を除く領域(有効領域)において、前回の棋譜に対し
て駒有無の状態が変化した領域が抽出される。
Next, a process of extracting a change area of the frame presence / absence 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.

【0029】駒有無の状態が変化した領域が抽出された
場合には(ステップ7でYES)、移動駒の特定処理が
行なわれる(ステップ8)。つまり、将棋のルールおよ
びパターンマッチングによって、移動した駒の種類が特
定されるとともに移動した駒の位置が特定される。
If an area in which the state of the presence or absence of a frame has been extracted 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.

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

【0031】上記ステップ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). .

【0032】そして、棋譜記録終了の入力がなければ
(ステップ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.

【0033】上記ステップ6において、駒有無の状態が
変化した領域が抽出されなかった場合には(ステップ7
でNO)、棋譜が変化していないと判断され、ステップ
12に移行する。
If it is determined in step 6 that the area in which the state of the presence or absence of the 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.

【0034】ステップ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.

【0035】チェックを行なわないと判定されたときに
は、ステップ11に移行する。チェックを行なうと判定
された場合には、ホスト19の記憶装置23に記憶され
ている最新の棋譜と、現在取り込まれている画像とに基
づいて、記憶装置23に記憶されている最新の棋譜が正
しいか否かがチェックされる(ステップ13)。このチ
ェック処理において、割り込み処理を開始させるための
タイマが起動される。チェック処理の詳細については、
後述する。
If it is determined that no check is performed, the process proceeds to step S11. 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.

【0036】チェック処理の結果、ホスト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.

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

【0038】リカバリ処理によって、正しい棋譜が認識
されると、ステップ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.

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

【0040】図5は、取込み画像の一例を示している。
この例では、取込み画像の将棋盤上に、対局者の手(障
害物)が現れている。取込み画像は、0〜255階調
(黒:0,白:255)で表されている。図5に示すよ
うに、将棋盤上の升目を仕切る線は黒であり、各駒に描
かれた文字も黒であるとする。また、取込み画像におい
て、対局者の手の輝度値は、将棋盤の地肌に対する輝度
値より低い(暗い)ものとする。
FIG. 5 shows an example of a captured image.
In this example, the player's hand (obstacle) appears on the shogi board of the captured image. The captured image is represented by 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.

【0041】以下、図5の取込み画像を例に取って、無
効領域抽出処理手順について説明する。まず、取込み画
像に対して、ローパスフィルタを用いてノイズ除去処理
が行なわれる(ステップ101)。ノイズ除去処理によ
ってノイズが除去された画像に対して、ハイパスフィル
タを用いてエッジ抽出処理が行なわれる(ステップ10
2)。そして、得られた画像に対して、2値化処理が行
なわれる(ステップ103)。これにより、図6に示す
ように、エッジ部、すなわち、将棋盤上の升目を仕切る
線、各駒に描かれた文字および手の輪郭が白”1”であ
り、エッジ部以外の部分、すなわち、将棋盤上の升目内
部および手の輪郭の内部が黒”0”である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 edge portion, that is, the line separating the squares on the shogi board, the character drawn on each piece and the outline of the hand are white “1”, and the portion other than the edge portion, that is, Then, a binarized image in which the inside of the square on the shogi board and the inside of the outline of the hand are black “0” is obtained.

【0042】次に、プロジェクション処理が行なわれる
(ステップ104)。升目を仕切る線は、10本の横線
と10本の縦線とから構成されている。升目を仕切る線
を構成する各横線および各縦線ごとに、その1本の直線
を含む細長矩形のプロジェクション計算領域が設定され
る。図7は、下から3本目の横線に対して設定されたプ
ロジェクション計算領域Sを示している。
Next, projection processing is performed (step 104). The line dividing the cell is composed of 10 horizontal lines and 10 vertical lines. An elongated rectangular projection calculation area including one straight line is set for each horizontal line and each vertical line that constitutes a line separating the cells. FIG. 7 shows a projection calculation area S set for the third horizontal line from the bottom.

【0043】そして、各プロジェクション計算領域ごと
に、その領域内の画像のプロジェクションが計算され
る。各横線に対して設定されたプロジェクション計算領
域に対しては縦射影が計算され、各縦線に対して設定さ
れたプロジェクション計算領域に対しては横射影が計算
される。図8は、図7に示すプロジェクション計算領域
S内の画像に対するプロジェクション結果を示してい
る。
Then, for each projection calculation area, the projection of the image in that area is calculated. A vertical projection is calculated for the projection calculation area set for each horizontal line, and a horizontal projection is calculated for the projection calculation area set for each vertical line. FIG. 8 shows a projection result for the image in the projection calculation area S shown in FIG.

【0044】このようにして、升目を仕切る線を構成す
る全ての直線(全ての横線および縦線)に対してプロジ
ェクションが計算されると、得られたプロジェクション
結果に基づいて、無効領域が抽出される(ステップ10
5)。
As described above, when the projections are calculated for all the straight lines (all the horizontal lines and the vertical lines) constituting the line dividing the cell, an invalid area is extracted based on the obtained projection result. (Step 10
5).

【0045】図8からわかるように、プロジェクション
計算領域S内に含まれている1本の直線上において、そ
の直線が手等の障害物によって覆われていない位置にお
いては、プロジェクション結果はHレベルとなる。一
方、プロジェクション計算領域S内に含まれている1本
の直線上において、その直線が手等の障害物によって覆
われている位置においては、プロジェクション結果はL
レベルとなる。
As can be seen from FIG. 8, on one straight line included in the projection calculation area S, at a position where the straight line is not covered by an obstacle such as a hand, the projection result is H level. Become. On the other hand, on one straight line included in the projection calculation area S, at a position where the straight line is covered by an obstacle such as a hand, the projection result is L
Level.

【0046】したがって、プロジェクション計算領域S
内に含まれている1本の直線上において、その直線が手
等の障害物によって覆われている部分が存在する場合に
は、プロジェクション結果には、所定長以上の不連続部
分が現れる。そこで、プロジェクション結果における所
定長以上の不連続部分に対応する升目には、障害物が存
在すると判定される。なお、プロジェクション結果にお
いて不連続部分が存在しても、その長さが所定値未満で
ある場合には、ノイズまたは駒によるものと判断し、そ
の不連続部分に対応する升目に障害物が存在するとは判
定されない。このような処理を障害物有無判定処理とい
うことにする。
Therefore, the projection calculation area S
If there is a portion of one straight line included in the area where the straight line is covered by an obstacle such as a hand, a discontinuous portion having a predetermined length or more appears in the projection result. Therefore, it is determined that an obstacle exists in a square corresponding to a discontinuous portion having a predetermined length or more in the projection result. In addition, even if a discontinuous portion exists in the projection result, if the length is less than a predetermined value, it is determined to be due to noise or a piece, and it is determined that there is an obstacle in a square corresponding to the discontinuous portion. Is not determined. Such a process is referred to as an obstacle presence / absence determination process.

【0047】このようにして、全てのプロジェクション
計算領域に対するプロジェクション結果ごとに、障害物
有無判定処理が行なわれる。そして、障害物有無判定に
よって、障害物有りと判定された領域が無効領域として
抽出される。このようにして抽出された無効領域を、図
9に網掛け領域で示す。なお、将棋盤上の無効領域以外
の領域を有効領域ということにする。
In this way, the obstacle presence / absence determination processing is performed for each projection result for all the projection calculation areas. Then, an area determined to have an obstacle by the obstacle presence / absence determination is extracted as an invalid area. The invalid area thus extracted is shown as a shaded area in FIG. An area other than the invalid area on the shogi board is referred to as an effective area.

【0048】上記の無効領域抽出処理によれば、升目の
線の情報を利用して障害物の有無を判定しているので、
障害部の大きさおよび形状にかかわらず障害物の存在す
る領域を抽出することができるとともに、照明の変動が
あっても障害物の存在する領域を正確に抽出できる。な
お、上記の無効領域抽出処理では、升目を仕切る線を構
成する各横線および各縦線に対してプロジェクション計
算領域が設定されているが、升目を仕切る線を構成する
各横線に対してのみまたは各縦線に対してのみプロジェ
クション計算領域を設定するようにしてもよい。
According to the above-described invalid area extraction processing, the presence / absence of an obstacle is determined using the information of the line of the cell.
An area where an obstacle exists can be extracted regardless of the size and shape of the obstacle, and an area where an obstacle exists can be accurately extracted even if there is a change in illumination. In the above-described invalid area extraction processing, a projection calculation area is set for each horizontal line and each vertical line that constitutes a line dividing a cell, but only for each horizontal line that constitutes a line dividing a cell or The projection calculation area may be set only for each vertical line.

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

【0050】駒有無認識処理は、無効領域抽出処理のス
テップ103によって得られた図6の2値化画像に基づ
いて行なわれる。
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.

【0051】駒有無認識処理では、まず、図11に示す
ように、各升目ごとの白画素の総和(ヒストグラム値)
を表すヒストグラムが作成される(ステップ111)。
2値化画像においては各駒に描かれた文字は白”1”で
あるため、駒が存在する升目においてはヒストグラム値
が大きくなる。
In the frame presence / absence recognition processing, first, as shown in FIG. 11, the sum of the white pixels for each cell (histogram value)
Is created (step 111).
In the binarized image, since the character drawn on each frame is white "1", the histogram value is large in the square where the frame exists.

【0052】したがって、白画素の総和があるしきい値
より大きい升目には駒が有ると判定し、白画素の総和が
あるしきい値以下である升目には駒が無いと判定するこ
とができる。しかしながら、各升目ごとの白画素の総和
は入力画像の大きさに依存するため、しきい値として固
定された値を用いると、駒の有無判定を正確に行なうこ
とができないという問題がある。そこで、この実施の形
態では、以下のようにして、しきい値が求められてい
る。
Therefore, it is possible to determine that there is a frame in a square where the sum of white pixels is larger than a certain threshold value, and that there is no frame in a square where the sum of white pixels is equal to or less than a certain threshold value. . However, since the sum of the white pixels for each cell depends on the size of the input image, using a fixed value as the threshold value has a problem in that the presence / absence of a frame cannot be accurately determined. Therefore, in this embodiment, the threshold value is obtained as follows.

【0053】つまり、図12に示すように、白画素数を
横軸にとり、ヒストグラム値が横軸の白画素数である升
目の数を縦軸にとって、白画素数に対する升目の数の頻
度分布が作成される(ステップ112)。
That is, as shown in FIG. 12, the horizontal axis represents the number of white pixels, and the vertical axis represents the number of squares whose histogram value is the number of white pixels on the horizontal axis. It is created (step 112).

【0054】次に、図13に示すように、白画素数を横
軸にとり、ヒストグラム値が横軸の白画素数以下である
升目の数の累積値を縦軸にとって、白画素数に対する升
目の数の累積値の分布が作成される(ステップ11
3)。
Next, as shown in FIG. 13, the horizontal axis represents the number of white pixels, and the vertical axis represents the cumulative value of the number of squares whose histogram value is equal to or less than the number of white pixels on the horizontal axis. A distribution of the cumulative value of the number is created (step 11).
3).

【0055】次に、得られた累積頻度分布に基づいて、
しきい値が探索される(ステップ114)。ところで、
駒が存在しない升目の白画素の総和の中の最大値と、駒
が存在する升目の白画素の総和の中の最小値との間に
は、一定以上の差があるはずである。このため、駒が存
在しない升目の白画素の総和の中の最大値と、駒が存在
する升目の白画素の総和の中の最小値との間の範囲にお
いては、升目内の白画素の総和がそのような値になる升
目は存在しない。したがって、上記の累積頻度分布を作
成した場合には、升目の数の累積値が変化しない部分が
現れる。そこで、得られた累積頻度分布における升目の
数の累積値が一定間隔以上変化しない部分が探索され、
探索された部分の開始点P1に対する白画素数THがし
きい値として決定される。
Next, based on the obtained cumulative frequency distribution,
A threshold is searched (step 114). by the way,
There must be a certain difference or more between the maximum value of the sum of the white pixels of the cell where the piece does not exist and the minimum value of the total of the white pixels of the cell where the piece exists. For this reason, in the range between the maximum value of the sum of the white pixels of the cell where the piece does not exist and the minimum value of the sum of the white pixels of the cell where the piece exists, the sum of the white pixels within the cell is No cell has such a value. Therefore, when the above-described cumulative frequency distribution is created, a portion where the cumulative value of the number of cells does not change appears. Therefore, a portion in which the cumulative value of the number of squares in the obtained cumulative frequency distribution does not change over a certain interval is searched,
The number TH of white pixels with respect to the start point P1 of the searched portion is determined as a threshold value.

【0056】つまり、ステップ111で求められた各ヒ
ストグラム値を小さいものから順に並べたと仮定した場
合に、隣り合うヒストグラム値の差が所定値以上である
2つのヒストグラム値のうちの、小さい方のヒストグラ
ム値が、しきい値Thとして決定される。なお、隣り合
うヒストグラム値の差が所定値以上である2つのヒスト
グラム値における小さい方のヒストグラム値以上で大き
い方のヒストグラム値以下の範囲内でしきい値を設定し
てもよい。つまり、図13において、升目の数の累積値
が変化しない部分の開始点に対する白画素数から、升目
の数の累積値が変化しない部分の終了点に対する白画素
数までの範囲内で、しきい値を設定してもよい。
That is, assuming that the histogram values obtained in step 111 are arranged in ascending order, the smaller one of the two histogram values in which the difference between adjacent histogram values is equal to or greater than a predetermined value. The value is determined as the threshold Th. Note that the threshold value may be set in a range between the smaller histogram value and the larger histogram value of two histogram values in which the difference between adjacent histogram values is equal to or larger than a predetermined value. That is, in FIG. 13, the threshold is within a range from the number of white pixels for the start point of the portion where the cumulative value of the number of squares does not change to the number of white pixels for the end point of the portion where the cumulative value of the number of squares does not change. A value may be set.

【0057】ところで、将棋の駒は40個であり、升目
の総和は81個である。したがって、駒が存在しない升
目の数は、最小41個となる。なお、図6の2値化画像
において、手等の障害物が存在する領域では、駒が存在
しない領域と同様に黒となるため、手等の障害物が存在
する領域内に駒が存在しない升目が含まれている場合に
おいても、駒が存在しない升目の数は、最小41個とな
る。そこで、升目の数の累積値が一定間隔以上変化しな
い部分の探索は、升目の数の累積値が41個である点P
oから開始される。
By the way, the number of pieces of shogi is 40 pieces, and the sum of squares is 81 pieces. Therefore, the number of squares in which no pieces exist is a minimum of 41. In the binarized image of FIG. 6, the area where an obstacle such as a hand exists is black as in the area where no piece exists, and therefore no piece exists in the area where an obstacle such as a hand exists. Even when a square is included, the number of squares without a piece is a minimum of 41. Therefore, a search for a portion in which the cumulative value of the number of cells does not change over a certain interval is performed at a point P where the cumulative value of the number of cells is 41.
It starts from o.

【0058】このようにして、しきい値Thが求められ
ると、上記ステップ111で求められた升目ごとのヒス
トグラム値に基づいて、無効領域を除く有効領域内に存
在する各升目ごとに駒の有無が判定される(ステップ1
15)。つまり、ヒストグラム値(升目内の白画素の総
和)がしきい値Thより大きい升目には駒が有ると判定
される。逆に、ヒストグラム値がしきい値Th以下の升
目には駒が無いと判定される。これにより、無効領域を
除く有効領域内に存在する各升目の駒有無状態が抽出さ
れる。
When the threshold value Th is obtained in this way, the presence or absence of a frame is determined for each cell existing in the effective area excluding the invalid area based on the histogram value for each cell obtained in step 111. Is determined (Step 1
15). That is, it is determined that there is a frame in a square whose histogram value (sum of white pixels in the square) is larger than the threshold Th. Conversely, it is determined that there is no piece in a square whose histogram value is equal to or smaller than the threshold Th. As a result, the frame presence / absence state of each cell existing in the valid area excluding the invalid area is extracted.

【0059】このように、この実施の形態では、ステッ
プ111で求められた各ヒストグラム値を小さいものか
ら順に並べたと仮定した場合に、隣り合うヒストグラム
値の差が所定値以上である2つのヒストグラムのうち
の、小さい方のヒストグラム値が、しきい値Thとして
決定されているので、入力画像の大きさにかかわらず、
駒の有無判定を正確に行なうことができる。
As described above, in this embodiment, when it is assumed that the histogram values obtained in step 111 are arranged in ascending order, the difference between the two histogram values in which the difference between the adjacent histogram values is equal to or larger than the predetermined value is obtained. Since the smaller of the histogram values is determined as the threshold value Th, regardless of the size of the input image,
The presence or absence of a piece can be accurately determined.

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

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

【0062】割り込み処理においては、まず、キュー内
の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).

【0063】図15(a)に示すように、下から5つ目
の領域までに入力画像が蓄積されている場合には、下か
ら6つ目の領域のキュー状態が”画像入力中状態”にさ
れる。
As shown in FIG. 15A, 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.

【0064】次に、CCDカメラ1から画像が取り込ま
れる(ステップ22)。そして、CCDカメラ1からの
画像取込みが終了すると(ステップ23)、図15
(b)に示すように、取り込まれた画像が、”画像入力
中状態”にされた領域に格納される(ステップ24)。
この後、画像が格納された領域のキュー状態が、図15
(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”.

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

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

【0067】次に、キュー内に、”画像有り状態”の領
域が存在しているか否かが判定される(ステップ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.

【0068】”画像有り状態”の領域が存在している場
合には、図17(b)に示すように、”画像有り状態”
の領域のうち最も古い画像が蓄積されている領域、すな
わち”画像有り状態”の領域のうち、最も下側の領域の
キュー状態が”処理中状態”とされた後、その領域から
画像が取り出される(ステップ34)。
When an area of “image presence state” exists, as shown in FIG. 17B, “image presence 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).

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

【0070】チェック処理においては、まず、キューの
内容がクリアされる(ステップ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).

【0071】駒配置のチェック処理においては、まず、
ホスト19によって作成されたチェックリストを受け取
る(ステップ51)。このチェックリストは、ホスト1
9によって次のようにして作成される。ホスト19は、
図19に示すように、最新に記録した棋譜からランダム
に任意の行または列を選択する。そして、選択した行ま
たは列上の各升目毎に、駒が有るかないかを示す情報、
駒がある場合にはその駒の種類を示す情報からなるチェ
ックリストを作成する。
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. 19, 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.

【0072】チェックリストを受けとると、図19に示
すように、最新の取込み画像におけるチェックリストに
対応する行または列の各升目ごとに、その内容がチェッ
クリストの内容と一致するか否かが判定される(ステッ
プ52)。この判定は、各升目ごとに、チェックリスト
の内容に応じたテンプレートを用いたテンプレートマッ
チングを取込み画像に対して行なうことにより、最新の
取込み画像とチェックリストの内容とが一致するか否か
が判定される。全ての升目において、最新の取込み画像
の内容と、チェックリストの内容とが一致した場合には
(ステップ53でYES、ステップ54でYES)、ホ
スト19の記憶装置23に記憶されている最新の棋譜は
正しい(OK)と判断される。
When the checklist is received, as shown in FIG. 19, 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).

【0073】最新の取込み画像の内容と、チェックリス
トの内容とが一致しない升目が存在する場合には(ステ
ップ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 determined. (NG).

【0074】駒配置のチェック処理が終了すると、駒配
置のチェック処理の結果(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).

【0075】なお、駒配置のチェック処理において、ホ
スト19の記憶装置23に記憶されている最新の棋譜は
正しい(OK)と判定された場合には、図3のステップ
14でYESとなり、ステップ11に移行する。駒の配
置のチェック処理において、ホスト19の記憶装置23
に記憶されている最新の棋譜は誤っている(NG)と判
定された場合には、図3のステップ14でNOとなり、
ステップ15のリカバリ処理に移行する。
When the latest game record stored in the storage device 23 of the host 19 is determined to be correct (OK) in the frame 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.

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

【0077】まず、現在取り込まれている画像に対し
て、図3のステップ4と同様に無効領域抽出処理が行な
われる(ステップ61)。無効領域とは、取込み画像に
おいて、対局者の手等の障害物が存在している領域をい
う。
First, an invalid area extraction 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.

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

【0079】無効領域抽出処理において、無効領域(障
害物)が存在すると判定された場合には(ステップ62
でNO)、図3のステップ3と同様に画像入力処理が行
なわれ新たな画像がCCDカメラ1またはキューから取
り込まれる(ステップ63)。そして、ステップ61に
戻る。したがって、障害物が存在しないと判定されるま
で、ステップ61、62、63の処理が繰り返される。
If it is determined in the invalid area extraction processing that an invalid area (obstacle) exists (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.

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

【0081】全駒配置の取得処理では、まず、ホスト1
9によって作成されたマップデータを受け取る(ステッ
プ71)。このマップデータは、ホスト19によって次
のようにして作成される。ホスト19は、図21に示す
ように、最新に記録した棋譜の各升目ごとに、駒が有る
かないかを示す情報、駒がある場合にはその駒の種類を
示す情報からなるマップデータを作成する。
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. 21, 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. .

【0082】マップデータを受けとると、図21に示す
ように、ステップ62で障害物が存在しないと判定され
た取込み画像の各升目ごとに、その内容がマップデータ
の内容と一致するか否かが判定される(ステップ7
2)。この判定は、各升目ごとに、マップデータの内容
に応じたテンプレートを用いたテンプレートマッチング
を取込み画像に対して行なうことにより、取込み画像と
マップデータの内容とが一致するかが判定される。
When the map data is received, as shown in FIG. 21, 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.

【0083】取込み画像の内容と、マップデータの内容
とが一致した場合には(ステップ73でYES)、その
駒の位置と種類とが記憶される(ステップ74)。そし
て、全ての升目について、ステップ72の処理が終了し
たか否かが判定される(ステップ75)。全ての升目に
ついて、ステップ72の処理が終了していない場合に
は、ステップ72に戻り、次の升目に対して、ステップ
72の処理が行なわれる。
If the contents of the captured image match the contents 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.

【0084】取込み画像の内容と、チェックリストの内
容とが一致しなかった場合には(ステップ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).

【0085】升目画像とテンプレート画像とが一致しな
かった場合には(ステップ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.

【0086】ステップ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.

【0087】全駒配置の取得処理が終了すると、ステッ
プ74で記憶された駒の位置および種類の情報がホスト
19に送信される(ステップ65)。この後、図3のス
テップ10に移行し、ホスト19に送信された駒の位置
および種類の情報が、ホスト19の記憶装置23に記録
される。
When the processing for acquiring the arrangement of all the frames is completed, the information on the positions and types 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.

【0088】[0088]

【発明の効果】この発明によれば、入力画像の大きさに
かかわらず正確に駒有無の認識を行なえる将棋盤上の駒
有無認識装置が実現する。
According to the present invention, an apparatus for recognizing the presence or absence of a piece on a shogi board capable of accurately recognizing the presence or absence of a piece regardless of the size of an input image 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 edge extraction image.

【図7】プロジェクション計算領域を示す模式図であ
る。
FIG. 7 is a schematic diagram showing a projection calculation area.

【図8】図7のプロジェクション計算領域内の画像に対
するプロジェクション結果を示すグラフである。
FIG. 8 is a graph showing a projection result for an image in the projection calculation area of FIG. 7;

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

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

【図11】図10のステップ111で得られたヒストグ
ラム結果を示すグラフである。
FIG. 11 is a graph showing a histogram result obtained in step 111 of FIG. 10;

【図12】図10のステップ112で得られた頻度分布
を示すグラフである。
FIG. 12 is a graph showing a frequency distribution obtained in step 112 of FIG.

【図13】図10のステップ113で得られた累積頻度
分布を示すグラフである。
FIG. 13 is a graph showing the cumulative frequency distribution obtained in step 113 of FIG.

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

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

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

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

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

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

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

【図21】リカバリ処理を説明するための模式図であ
る。
FIG. 21 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

───────────────────────────────────────────────────── フロントページの続き (72)発明者 宮本 幸三 大阪府守口市京阪本通2丁目5番5号 三 洋電機ソフトウエア株式会社内 ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Kozo Miyamoto 2-5-5 Keihanhondori, Moriguchi-shi, Osaka Sanyo Electric Software Co., Ltd.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 将棋盤上の駒の取込み画像に基づいて、
各升目ごとの駒の有無を認識する将棋盤上の駒有無認識
装置において、 将棋盤上の駒の取込み画像から、将棋盤上の升目を仕切
る線および各駒に描かれた文字の輝度値が第1輝度値で
あり、将棋盤上の升目内部の地肌の輝度値が第1輝度値
とは異なる第2輝度値であるエッジ抽出画像を生成する
エッジ抽出画像生成手段、 エッジ抽出画像から各升目ごとに、第1輝度値を持つ画
素の総和を算出する算出手段、 各升目ごとに求められた第1輝度値を持つ画素の総和を
各升目に対するヒストグラム値とし、ヒストグラム値を
小さいものから順に並べたと仮定した場合に、隣り合う
ヒストグラム値の差が所定値以上である2つのヒストグ
ラム値における小さい方のヒストグラム値以上で大きい
方のヒストグラム値以下の値にしきい値を設定するしき
い値設定手段、および各升目に対するヒストグラム値と
上記しきい値とを比較することにより、各升目に駒が存
在するか否かを判定する判定手段、 を備えていることを特徴とする将棋盤上の駒有無認識装
置。
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 a luminance value of a background inside the square on the chessboard is a second luminance value different from the first luminance value, for each square from the edge-extracted image Calculating means for calculating the sum of the pixels having the first luminance value, assuming that the sum of the pixels having the first luminance value obtained for each cell is a histogram value for each cell, and the histogram values are arranged in ascending order. In this case, the threshold is set to a value equal to or larger than the smaller histogram value and equal to or smaller than the larger histogram value of the two histogram values in which the difference between the adjacent histogram values is equal to or larger than the predetermined value. Shogi board comprising: a threshold value setting means; and a determination means for determining whether or not a piece exists in each square by comparing the histogram value for each square with the threshold value. Upper piece recognition device.
【請求項2】 上記しきい値設定手段は、各升目ごとに
求められた第1輝度値を持つ画素の総和を各升目に対す
るヒストグラム値とし、画素数を横軸にとり、ヒストグ
ラム値が横軸の画素数以下である升目の数の累積値を縦
軸にとって、画素数に対する升目の数の累積値の分布を
作成し、升目の数の累積値が一定間隔以上変化しない部
分を探索し、探索された部分に対応する画素数の範囲内
からしきい値を設定するものである請求項1に記載の将
棋盤上の駒有無認識装置。
2. The threshold value setting means according to claim 1, wherein the sum of pixels having the first luminance value obtained for each cell is set as a histogram value for each cell, the number of pixels is set on the horizontal axis, and the histogram value is set on the horizontal axis. With the cumulative value of the number of cells that are equal to or less than the number of pixels as the vertical axis, a distribution of the cumulative value of the number of cells with respect to the number of pixels is created, and a portion where the cumulative value of the number of cells does not change over a certain interval is searched for. 2. The apparatus for recognizing pieces on a shogi board according to claim 1, wherein the threshold value is set from within the range of the number of pixels corresponding to the part.
【請求項3】 升目の数の累積値が一定間隔以上変化し
ない部分の探索は、升目の数の累積値が41個である点
から開始される請求項2に記載の将棋盤上の駒有無認識
装置。
3. The presence or absence of a piece on a chess board according to claim 2, wherein the search for a portion where the cumulative value of the number of squares does not change over a certain interval starts from the point where the cumulative value of the number of squares is 41. Recognition device.
JP17046996A 1996-06-28 1996-06-28 Recognition device for pieces on japanese chess board Pending JPH1015150A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17046996A JPH1015150A (en) 1996-06-28 1996-06-28 Recognition device for pieces on japanese chess board

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17046996A JPH1015150A (en) 1996-06-28 1996-06-28 Recognition device for pieces on japanese chess board

Publications (1)

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

Family

ID=15905527

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17046996A Pending JPH1015150A (en) 1996-06-28 1996-06-28 Recognition device for pieces on japanese chess board

Country Status (1)

Country Link
JP (1) JPH1015150A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100472102B1 (en) * 2002-04-12 2005-03-08 (주)유라비젼 Method and Device for Creating Paduk Record of Go
US7562820B2 (en) 2002-12-17 2009-07-21 Sharp Kabushiki Kaisha Barcode recognition apparatus
CN102682308A (en) * 2011-03-17 2012-09-19 株式会社理光 Imaging processing method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100472102B1 (en) * 2002-04-12 2005-03-08 (주)유라비젼 Method and Device for Creating Paduk Record of Go
US7562820B2 (en) 2002-12-17 2009-07-21 Sharp Kabushiki Kaisha Barcode recognition apparatus
CN102682308A (en) * 2011-03-17 2012-09-19 株式会社理光 Imaging processing method and device

Similar Documents

Publication Publication Date Title
WO2020151489A1 (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
KR101514169B1 (en) Information processing device, information processing method, and recording medium
JP4380838B2 (en) Video image automatic road sign recognition method, road sign automatic recognition device, and road sign automatic recognition program
US8971585B2 (en) Image processing apparatus for retrieving object from moving image and method thereof
US6549644B1 (en) Face-image processing apparatus
WO2020134527A1 (en) Method and apparatus for face recognition
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
KR101050866B1 (en) Character recognition devices, character recognition programs, and character recognition methods
CN112287867B (en) Multi-camera human body action recognition method and device
JP2016031679A (en) Object identification device, object identification method, and program
JP4717445B2 (en) Image processing system, image processing device, game device, program, information storage medium, and image processing method
JPH1015150A (en) Recognition device for pieces on japanese chess board
CN109858464B (en) Bottom database data processing method, face recognition device and electronic equipment
JP2003178304A (en) Face image retrieving device, face image retrieving method and program for executing method on computer
CN106156774A (en) Image processing method and image processing system
JPH1015152A (en) Recognition device for pieces on japanese chess board
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
JP3963789B2 (en) Eye detection device, eye detection program, recording medium for recording the program, and eye detection method
JPH09285594A (en) Automatic status recognizing device of go, and go game progress recording device
JPH1015151A (en) Extraction device for invalid zone on japanese chess board and recognition device for pieces on the board
JP3096620B2 (en) Game record recorder
JP2006338368A (en) Image processor and image processing method