JP2016004331A - Medal identification device and medal identification method - Google Patents

Medal identification device and medal identification method Download PDF

Info

Publication number
JP2016004331A
JP2016004331A JP2014122846A JP2014122846A JP2016004331A JP 2016004331 A JP2016004331 A JP 2016004331A JP 2014122846 A JP2014122846 A JP 2014122846A JP 2014122846 A JP2014122846 A JP 2014122846A JP 2016004331 A JP2016004331 A JP 2016004331A
Authority
JP
Japan
Prior art keywords
medal
area
edge
model
image
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
JP2014122846A
Other languages
Japanese (ja)
Inventor
敏徳 佐藤
Toshinori Sato
敏徳 佐藤
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2014122846A priority Critical patent/JP2016004331A/en
Publication of JP2016004331A publication Critical patent/JP2016004331A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a medal identification device that can accurately identify a medal even when the medal has an individual difference.SOLUTION: A medal identification device 1 has: a medal region detection unit 61 for detecting, from an image generated by an image-capturing unit 4, a medal region in which the medal to be identified flowing down in a passage 6 is seen and the center of the medal region; an edge detection unit 62 for detecting an edge image in which the edge of the surface pattern of the medal to be identified is seen in the medal region; a similarity degree calculation unit 69 for selecting, for each partial region divided from the medal region, an edge image in which the ratio of the number of edge images to the area of the partial region is less than a prescribed ratio, aligning the center of a model region on a model image indicating the model of a prescribed medal and the center of the medal region, and calculating, on the basis of a match or mismatch of the selected edge image with the edge image in the model region, the similarity degree between the surface pattern of the model and the surface pattern of the medal to be identified; and a determination unit 70 for determining, in accordance with the similarity degree, whether or not the medal to be identified is a prescribed medal.

Description

本発明は、メダルを撮影して得られた画像を利用してメダルを識別するためのメダル識別装置及びメダル識別方法に関する。   The present invention relates to a medal identification device and a medal identification method for identifying a medal using an image obtained by photographing a medal.

従来より、回胴遊技機などの遊技機には、有価価値を持つメダル(コインとも呼ばれる)が投入されると、そのメダルに応じて遊技者が遊技できる回数などを決定するために、投入されたメダルを識別するメダル識別装置が搭載されている。このようなメダルが利用される店舗では、他店のメダルが不正に利用されることを防ぐために、店舗独自の模様を持つメダルが用いられる。そのため、メダル識別装置には、そのメダル識別装置が実装された遊技機が設置された店舗で利用されているメダルと、他の店舗で利用されているメダルとを識別できることが求められる。そこで、表面形状が微妙に異なる適正メダルを適正と判定できるコイン識別装置が提案されている(例えば、特許文献1を参照)。   Conventionally, when a medal (also called a coin) having a valuable value is inserted into a gaming machine such as a spinning machine, it is inserted to determine the number of times a player can play according to the medal. A medal identification device for identifying a medal is installed. In stores where such medals are used, medals having a store-specific pattern are used to prevent unauthorized use of medals from other stores. Therefore, the medal identification device is required to be able to identify a medal used in a store where a gaming machine equipped with the medal identification device is installed and a medal used in another store. In view of this, a coin identification device has been proposed that can determine that appropriate medals with slightly different surface shapes are appropriate (see, for example, Patent Document 1).

特許文献1に開示されたコイン識別装置は、識別対象コインの表面を撮像して得た撮像データに基づいて識別対象コインを識別する。その際、このコイン識別装置は、識別の基準となる第1の基準コインに関する撮像データから特徴部位を決定した後、その特徴部位に関する第1の特徴データを登録するとともに、第1の基準コインと同種の第2の基準コインに関する撮像データの特徴部位に相当する部位に関する第2の特徴データを登録し、識別対象コインに関する撮像データのうちの特徴部位に相当する部位に関する識別データと、第1及び第2の特徴データのそれぞれとを比較することにより、識別対象コインを識別する。   The coin identification device disclosed in Patent Document 1 identifies an identification target coin based on imaging data obtained by imaging the surface of the identification target coin. At this time, the coin identifying device determines the feature part from the imaging data related to the first reference coin serving as a reference for identification, and then registers the first feature data related to the feature part, and the first reference coin and Registration of second feature data relating to a part corresponding to a feature part of imaging data relating to the second reference coin of the same type, identification data relating to a part corresponding to a feature part among imaging data relating to a coin to be identified; By comparing each of the second feature data, the identification target coin is identified.

特開2010−160702号公報JP 2010-160702 A

特許文献1に開示されたコイン識別装置では、2種類の特徴データをメダルの識別に利用するので、識別対象のメダルがその2種類の特徴データの何れかに近い特徴を有していれば、そのコイン識別装置は、識別対象のメダルを適正か否かを正確に判断できる。
しかしながら、メダルの使用状況に応じて、メダルに生じる疵、摩耗または汚れの位置、形状及び大きさは様々であり、メダルごとの個体差が大きくなることがある。このような場合、2種類の特徴データでは、全てのメダルを適切に識別できないおそれがあった。
In the coin identifying device disclosed in Patent Document 1, two types of feature data are used for identifying medals. Therefore, if the identification target medal has a feature close to one of the two types of feature data, The coin identification device can accurately determine whether or not the identification target medal is appropriate.
However, the position, shape, and size of wrinkles, wear, or dirt generated on medals vary depending on the usage status of medals, and individual differences for each medal may increase. In such a case, there is a possibility that not all medals can be properly identified with the two types of feature data.

そこで、本発明は、メダルに個体差があってもメダルを正確に識別できるメダル識別装置及びメダル識別方法を提供することを目的とする。   Therefore, an object of the present invention is to provide a medal identification device and a medal identification method that can accurately identify medals even if medals have individual differences.

本発明の一つの形態として、メダル識別装置が提供される。このメダル識別装置は、メダルが通過する通路を形成する通路形成部と、通路の一部を撮影範囲とするように配置され、撮影範囲の画像を生成する撮像部と、所定のメダルのモデルを表し、そのモデルが写った領域であるモデル領域内のモデルの表面の模様のエッジに対応するエッジ画素を含むモデル画像を記憶する記憶部と、撮像部により生成された画像から、通路内を流下する識別対象メダルが写った領域であるメダル領域及びメダル領域の中心を検出するメダル領域検出部と、メダル領域内で、識別対象メダルの表面の模様のエッジが写っているエッジ画素を検出するエッジ検出部と、メダル領域を複数の部分領域に分割し、複数の部分領域のそれぞれについて、その部分領域の面積に対するその部分領域に含まれるエッジ画素の数の比が所定比率未満となるようにエッジ画素を選択し、モデル領域の中心とメダル領域の中心とを位置合わせして、選択されたエッジ画素のうちモデル領域内のエッジ画素の何れかと一致するエッジ画素の数が、モデル領域内の何れのエッジ画素とも一致しないエッジ画素の数より多いほど、モデルの表面の模様と識別対象メダルの表面の模様間の類似度が高くなるようにその類似度を算出する類似度算出部と、類似度に応じて識別対象メダルが所定のメダルか否か判定する判定部とを有する。   As one aspect of the present invention, a medal identification device is provided. The medal identification device includes a passage forming unit that forms a passage through which a medal passes, an imaging unit that generates a part of the passage as a shooting range, and generates an image of the shooting range, and a model of a predetermined medal. The storage unit stores a model image including edge pixels corresponding to the pattern edges on the surface of the model in the model region, which is the region in which the model is shown, and the image generated by the imaging unit flows down in the passage A medal area that is an area in which the identification target medal is shown and a medal area detection unit that detects the center of the medal area, and an edge that detects an edge pixel in the medal area where the edge of the pattern of the identification target medal is reflected The detection unit and the medal area are divided into a plurality of partial areas, and for each of the partial areas, the number of edge pixels included in the partial area with respect to the area of the partial area Edge pixels are selected so that is less than a predetermined ratio, the center of the model area and the center of the medal area are aligned, and the selected edge pixels match one of the edge pixels in the model area The degree of similarity is calculated so that the similarity between the pattern on the surface of the model and the pattern on the surface of the identification medal increases as the number of is larger than the number of edge pixels that do not match any edge pixel in the model area And a determination unit that determines whether or not the identification target medal is a predetermined medal according to the similarity.

このメダル識別装置において、類似度算出部は、メダル領域を、互いに異なる複数の分割方法のそれぞれごとに複数の部分領域に分割し、分割方法ごとに各部分領域の面積に占めるエッジ画素の数が所定比率未満となるようにエッジ画素を選択して類似度を算出し、分割方法ごとの類似度の平均値を算出し、判定部は、類似度の平均値に応じて識別対象メダルが所定のメダルか否か判定することが好ましい。   In this medal identification device, the similarity calculation unit divides the medal region into a plurality of partial regions for each of a plurality of different division methods, and the number of edge pixels occupying the area of each partial region for each of the division methods. Edge pixels are selected so as to be less than a predetermined ratio, the similarity is calculated, the average value of the similarity for each division method is calculated, and the determination unit determines whether the identification target medal is a predetermined value according to the average value of the similarity It is preferable to determine whether or not it is a medal.

この場合において、類似度算出部は、複数の分割方法のうちの一つとして、メダル領域を、メダル領域の中心から放射方向に沿って複数の部分領域に分割し、複数の分割方法のうちの他の一つとして、メダル領域を、メダル領域の中心についての円周方向に沿って複数の部分領域に分割することが好ましい。   In this case, the similarity calculation unit divides the medal area into a plurality of partial areas along the radial direction from the center of the medal area as one of a plurality of division methods, As another one, it is preferable to divide the medal area into a plurality of partial areas along the circumferential direction about the center of the medal area.

また本発明の他の形態によれば、メダルが通過する通路を形成する通路形成部と、通路の一部を撮影範囲とするように配置され、その撮影範囲の画像を生成する撮像部とを有するメダル識別装置における、メダル識別方法が提供される。このメダル識別方法は、画像から、通路内を流下する識別対象メダルが写った領域であるメダル領域及びメダル領域の中心を検出するステップと、メダル領域内で、識別対象メダルの表面の模様のエッジが写っているエッジ画素を検出するステップと、メダル領域を複数の部分領域に分割し、複数の部分領域のそれぞれについて、その部分領域の面積に対するその部分領域に含まれるエッジ画素の数の比が所定比率未満となるようにエッジ画素を選択し、記憶部に記憶された、所定のメダルのモデルを表すモデル画像上でのそのモデルが写った領域であるモデル領域の中心とメダル領域の中心とを位置合わせして、選択されたエッジ画素のうちモデル領域内のエッジ画素の何れかと一致するエッジ画素の数が、モデル領域内の何れのエッジ画素とも一致しないエッジ画素の数より多いほど、モデルの表面の模様と識別対象メダルの表面の模様間の類似度が高くなるようにその類似度を算出するステップと、類似度に応じて識別対象メダルが所定のメダルか否か判定するステップとを含む。   According to another aspect of the present invention, there is provided a passage forming unit that forms a passage through which medals pass, and an imaging unit that is arranged so that a part of the passage is a shooting range and generates an image of the shooting range. A medal identification method in a medal identification device is provided. The medal identification method includes a step of detecting from the image a medal area that is an area where an identification target medal flowing down in a passage and a center of the medal area, and an edge of a pattern on the surface of the identification target medal in the medal area Detecting the edge pixel in which the image is shown, and dividing the medal area into a plurality of partial areas, and for each of the plurality of partial areas, the ratio of the number of edge pixels included in the partial area to the area of the partial area is The edge pixel is selected to be less than the predetermined ratio, and the center of the model area and the center of the medal area, which are the areas on the model image representing the model of the predetermined medal stored in the storage unit. , And the number of edge pixels that match one of the selected edge pixels in the model area is equal to any edge image in the model area. Calculating the similarity so that the similarity between the pattern on the surface of the model and the pattern on the surface of the identification target medal increases as the number of edge pixels that do not match each other increases, and the identification target medal according to the similarity Determining whether or not is a predetermined medal.

本発明に係るメダル識別装置及びメダル識別方法は、メダルに個体差があってもメダルを正確に識別できるという効果を奏する。   The medal identification device and medal identification method according to the present invention have an effect of accurately identifying medals even if medals have individual differences.

本発明の一つの実施形態によるメダル識別装置の概略上面図である。1 is a schematic top view of a medal identification device according to one embodiment of the present invention. メダル識別装置の概略背面図である。It is a schematic rear view of a medal identification device. 図1のAA’で示された断面を矢印の方向から見た、メダル識別装置の概略断面図である。FIG. 2 is a schematic cross-sectional view of the medal identification device when a cross section indicated by AA ′ in FIG. 1 is viewed from the direction of an arrow. 図2のBB’で示された断面を矢印の方向から見た、メダル識別装置の概略断面図である。FIG. 3 is a schematic cross-sectional view of the medal identification device when a cross-section indicated by BB ′ in FIG. 2 is viewed from the direction of an arrow. メダル識別装置の回路ブロック図である。It is a circuit block diagram of a medal identification device. メダル識別装置の制御回路の機能ブロック図である。It is a functional block diagram of the control circuit of a medal identification device. サンプル用メダルの模式図である。It is a schematic diagram of a medal for samples. エッジ分布情報の一例を示す図である。It is a figure which shows an example of edge distribution information. 回転角度と一致度の関係の一例を示す図である。It is a figure which shows an example of the relationship between a rotation angle and a coincidence degree. 仮モデルのエッジ分布情報と着目するサンプル画像上のメダルのエッジ分布情報の一例を示す図である。It is a figure which shows an example of edge distribution information of a temporary model, and edge distribution information of the medal on the sample image to which attention is paid. 回転角算出処理の動作フローチャートである。It is an operation | movement flowchart of a rotation angle calculation process. モデル画像の一例を示す図である。It is a figure which shows an example of a model image. (a)及び(b)は、それぞれ、モデル画像上のメダル領域に設定される部分領域の一例を示す図である。(A) And (b) is a figure which shows an example of the partial area | region respectively set to the medal area on a model image. モデル登録処理の動作フローチャートである。It is an operation | movement flowchart of a model registration process. 模様の位置が正しいメダルと模様の位置がずれたメダルの一例を示す図である。It is a figure which shows an example of the medal from which the position of the pattern was correct, and the medal from which the position of the pattern shifted | deviated. 位置補正されたエッジ画像の一例を示す図である。It is a figure which shows an example of the edge image by which the position correction was carried out. メダル識別処理の動作フローチャートである。It is an operation | movement flowchart of a medal identification process. メダル識別処理の動作フローチャートである。It is an operation | movement flowchart of a medal identification process. 本発明の一つの実施形態に係るメダル識別装置を備えた回胴遊技機の概略斜視図である。1 is a schematic perspective view of a spinning machine including a medal identification device according to an embodiment of the present invention. 前面パネルを開いた状態における、本発明の一つの実施形態に係るメダル識別装置を備えた回胴遊技機の概略斜視図である。1 is a schematic perspective view of a spinning game machine including a medal identification device according to an embodiment of the present invention in a state where a front panel is opened. FIG. 回胴遊技機の回路ブロック図である。It is a circuit block diagram of a spinning machine. メダル識別装置の他の形態であるメダル計数装置の外観斜視図である。It is an external appearance perspective view of the medal counting device which is another form of a medal identification device. メダル計数装置の上面カバーを外した状態の斜視図である。It is a perspective view of the state which removed the upper surface cover of the medal counting device. 搬送部の立体図である。It is a three-dimensional view of a conveyance part. 搬送部の平面図である。It is a top view of a conveyance part. ガイド近傍におけるメダルを搬送する際の動作を説明する図である。It is a figure explaining the operation | movement at the time of conveying the medal in the guide vicinity. 搬送部の分解図である。It is an exploded view of a conveyance part. ストッパピンの説明図である。It is explanatory drawing of a stopper pin. メダル計数装置の回路ブロック図である。It is a circuit block diagram of a medal counting device.

以下、図を参照しつつ、本発明の一つの実施形態によるメダル識別装置について説明する。このメダル識別装置は、メダル識別装置内の通路を流下するメダルを撮影する撮像部により得られた、識別対象のメダルが写った画像を利用して、そのメダルが、使用が認められている適正なメダルか否かを判定する。すなわち、このメダル識別装置は、画像上でメダルが写っている領域(以下、メダル領域と呼ぶ)内のエッジ分布と、予め登録された、適正なメダルのモデルを表すモデル画像上のメダル領域(以下では、モデル領域とも呼ぶ)内のエッジ分布とから、識別対象のメダルの表面の模様とモデルの表面の模様の類似度を算出し、その類似度に応じて識別対象のメダルが適正なメダルか否かを判定する。その際、このメダル識別装置は、識別対象画像のメダル領域を分割した複数の部分領域ごとに、模様のエッジに相当するエッジ画素の数を調整してメダル領域内でエッジ画素の数を均等化してから、類似度を算出する。これにより、このメダル識別装置は、識別対象のメダルの表面の一部の疵または汚れなどをエッジ画素として検出したとしても、その疵または汚れといった、メダルの個体差による類似度への影響を抑制できる。   Hereinafter, a medal identification device according to an embodiment of the present invention will be described with reference to the drawings. This medal identification device uses an image of a medal to be identified obtained by an imaging unit that captures a medal flowing down a passage in the medal identification device, and the medal is approved for use. It is determined whether the medal is a good medal. In other words, the medal identification device includes an edge distribution in an area where a medal is shown in an image (hereinafter referred to as a medal area) and a medal area (a medal area on a model image that represents a model of an appropriate medal registered in advance). In the following, the similarity between the pattern on the surface of the identification target medal and the pattern on the surface of the model is calculated from the edge distribution in the model area), and the identification target medal is an appropriate medal according to the similarity. It is determined whether or not. At this time, this medal identification device equalizes the number of edge pixels in the medal area by adjusting the number of edge pixels corresponding to the edge of the pattern for each of the plurality of partial areas obtained by dividing the medal area of the identification target image. After that, the similarity is calculated. As a result, even if a part of the surface of the identification target medal is detected as an edge pixel, this medal identification device suppresses the influence on the similarity due to individual differences of the medal such as the wrinkle or dirt. it can.

なお、本実施形態では、メダルの外形形状は、略円形であるとする。また、本明細書では、メダル識別装置が実装された装置において使用が認められているメダルを適正メダルと呼ぶ。一方、メダル識別装置が実装された装置において使用されることが認められていないメダルを不適正メダルと呼ぶ。さらに、本明細書では、特に断りが無い限り、メダルの両側の面を特に区別せず、何れも表面と呼ぶ。   In the present embodiment, the outer shape of the medal is assumed to be substantially circular. Further, in this specification, a medal that is permitted to be used in a device in which the medal identification device is mounted is referred to as a proper medal. On the other hand, a medal that is not allowed to be used in a device on which the medal identification device is mounted is called an inappropriate medal. Further, in this specification, unless otherwise specified, the sides on both sides of the medal are not particularly distinguished and both are referred to as surfaces.

図1は、本発明の一つの実施形態によるメダル識別装置1の概略平面図であり、図2は、メダル識別装置1の概略背面図である。図3は、図1のAA’で示された断面を矢印の方向から見た、メダル識別装置1の概略断面図である。図4は、図2のBB’で示された断面を矢印の方向から見た、メダル識別装置1の概略断面図である。また図5は、メダル識別装置1の回路ブロック図である。
メダル識別装置1は、筐体2と、光源3と、撮像部4と、制御基板5とを有する。光源3及び撮像部4は、筐体2内に収容されており、筐体2の外部に設けられた基板(図示せず)上に配置された制御基板5と信号線を介して接続されている。なお、制御基板5も、筐体2の内部に収容されていてもよい。さらに制御基板5は、メダル識別装置1が搭載される遊技機の主制御回路といった上位制御装置(図示せず)と信号線を介して接続され、その上位制御装置へ、メダルが適正メダルか否かの判定結果を表す通知信号を出力する。
FIG. 1 is a schematic plan view of a medal identification device 1 according to one embodiment of the present invention, and FIG. 2 is a schematic rear view of the medal identification device 1. FIG. 3 is a schematic cross-sectional view of the medal identification device 1 when the cross section indicated by AA ′ in FIG. 1 is viewed from the direction of the arrow. FIG. 4 is a schematic cross-sectional view of the medal identification device 1 when the cross-section indicated by BB ′ in FIG. 2 is viewed from the direction of the arrow. FIG. 5 is a circuit block diagram of the medal identification device 1.
The medal identification device 1 includes a housing 2, a light source 3, an imaging unit 4, and a control board 5. The light source 3 and the imaging unit 4 are accommodated in the housing 2 and are connected to a control substrate 5 disposed on a substrate (not shown) provided outside the housing 2 via a signal line. Yes. Note that the control board 5 may also be housed inside the housing 2. Further, the control board 5 is connected via a signal line to a host control device (not shown) such as a main control circuit of a gaming machine on which the medal identification device 1 is mounted, and whether or not the medal is a proper medal is connected to the host control device. A notification signal representing the determination result is output.

筐体2は、例えば、図1に示されたu軸の方向が、回胴遊技機の前面と略平行となり、かつ図2に示されたw軸の方向が、回胴遊技機の縦方向と略平行となるように、回胴遊技機に取り付けられる。そこで、以下では、便宜上、u方向を幅方向と呼び、w方向を高さ方向と呼ぶ。また、図1に示されたv軸の方向を奥行き方向と呼ぶ。   The housing 2 has, for example, the direction of the u-axis shown in FIG. 1 substantially parallel to the front surface of the spinning machine, and the direction of the w-axis shown in FIG. It is attached to the spinning cylinder game machine so that it is substantially parallel to. Therefore, in the following, for convenience, the u direction is referred to as the width direction and the w direction is referred to as the height direction. Further, the v-axis direction shown in FIG. 1 is referred to as a depth direction.

図1に示されるように、筐体2の上面には、メダル投入口2aが形成されている。メダル投入口2aは、筐体2の幅方向に沿って、メダルの直径に所定のオフセット(例えば、1mm〜2mm)を加えた長さを持ち、筐体2の奥行き方向に、メダルの厚さに所定のオフセット(例えば、0.5mm〜1mm)を加えた長さを持つ。   As shown in FIG. 1, a medal slot 2 a is formed on the top surface of the housing 2. The medal slot 2a has a length along the width direction of the housing 2 plus a predetermined offset (for example, 1 mm to 2 mm) to the diameter of the medal, and the thickness of the medal in the depth direction of the housing 2 And a predetermined offset (for example, 0.5 mm to 1 mm).

図3に示されるように、筐体2は、通路形成部の一例であり、メダルが流下する通路6をその内部に形成するとともに、光源3及び撮像部4を収容する。そのために、筐体2は、例えば、樹脂を成型することにより所望の形状となるように形成された複数の部品を組み合わせることにより構成される。あるいは、筐体2は、鉄、アルミニウム、銅などの金属により形成されてもよく、あるいは、金属により形成された部品と樹脂により形成された部品とが組み合わされていてもよい。   As illustrated in FIG. 3, the housing 2 is an example of a passage forming unit, and a passage 6 through which medals flow down is formed therein, and the light source 3 and the imaging unit 4 are accommodated. Therefore, the housing | casing 2 is comprised by combining the some components formed so that it might become a desired shape by shape | molding resin, for example. Or the housing | casing 2 may be formed with metals, such as iron, aluminum, copper, or the components formed with the metal and the components formed with resin may be combined.

筐体2内に形成された通路6は、筐体2の上端側では高さ方向に沿って形成され、途中で筐体2の幅方向に沿って湾曲した後、右下方へ向けて斜めに形成されている。そして通路6の上端はメダル投入口2aと直結し、一方通路6の下端は、筐体2の右端に形成されたメダル排出口2bと直結されている。そのため、メダル投入口2aから投入されたメダルは、矢印で示されるように、通路6に沿って筐体2内を流下した後、筐体2の右側のメダル排出口2bからメダル識別装置1の外に排出される。なお、この矢印で示される、メダルの流下方向を、以下では便宜上、順方向と呼び、逆にメダル排出口2bからメダル投入口2aへ向かう方向を、逆方向と呼ぶ。   The passage 6 formed in the housing 2 is formed along the height direction on the upper end side of the housing 2, and is curved along the width direction of the housing 2 in the middle, and then obliquely toward the lower right. Is formed. The upper end of the passage 6 is directly connected to the medal slot 2 a, while the lower end of the passage 6 is directly connected to the medal outlet 2 b formed at the right end of the housing 2. Therefore, medals inserted from the medal insertion slot 2a flow down in the casing 2 along the passage 6 as indicated by an arrow, and then the medal identification apparatus 1 of the medal identification apparatus 1 from the medal discharge outlet 2b on the right side of the casing 2. Discharged outside. The flow direction of the medals indicated by the arrows is hereinafter referred to as the forward direction for convenience, and the direction from the medal discharge port 2b toward the medal insertion port 2a is referred to as the reverse direction.

通路6は、メダルがスムーズに流下可能なように、筐体2の幅方向及び高さ方向に沿って、メダルの直径に所定のオフセット(例えば、1mm〜2mm)を加えた長さを持ち、筐体2の奥行き方向に沿って、メダルの厚さに所定のオフセット(例えば、0.5mm〜1mm)を加えた長さを持つ。   The passage 6 has a length obtained by adding a predetermined offset (for example, 1 mm to 2 mm) to the diameter of the medal along the width direction and the height direction of the housing 2 so that the medal can flow smoothly. A length obtained by adding a predetermined offset (for example, 0.5 mm to 1 mm) to the thickness of the medal along the depth direction of the housing 2.

なお、通路6の側面には、メダルとの接触面積を減らすために、メダルの流下方向の沿って複数の溝が形成されていてもよい。また通路6の側壁を形成する部材は、撮像部4により得られた画像上でメダルとの識別が容易となるように、メダルと異なる色または異なる反射率を持つ材料により形成されることが好ましい。一般に、メダルは金属製であり、光の反射率が高いので、画像上ではメダルが写っているメダル領域に含まれる画素の輝度値は、メダルが写っていない背景領域に含まれる画素の輝度値よりも高くなる。そこで、メダル領域に含まれる画素の輝度値と背景領域に含まれる画素の輝度値との差が大きくなるように、通路6の側壁を形成する部材には、光源3が発する波長の光に対して吸収性を持つ塗料が塗布されることが好ましい。   In addition, in order to reduce the contact area with the medal, a plurality of grooves may be formed on the side surface of the passage 6 along the flow direction of the medal. In addition, the member forming the side wall of the passage 6 is preferably formed of a material having a color different from the medal or having a different reflectance so that it can be easily distinguished from the medal on the image obtained by the imaging unit 4. . In general, since the medal is made of metal and has high light reflectance, the luminance value of the pixel included in the medal area where the medal is shown on the image is the luminance value of the pixel included in the background area where the medal is not shown. Higher than. Therefore, the member that forms the side wall of the passage 6 is configured to reduce the wavelength of light emitted from the light source 3 so that the difference between the luminance value of the pixel included in the medal area and the luminance value of the pixel included in the background area becomes large. It is preferable that a paint having absorbency is applied.

図3及び図4に示されるように、通路6の湾曲部の下方には、後述するように、撮像部4が通路6を通過するメダルMを撮影できるように、通路6よりも筐体2の背面側に空隙が生じている。そこで、この空隙においてメダルMが通路6から逸脱することを防止するために、通路6の湾曲部の下方において、通路6の上端と下端には、それぞれ、通路6よりも筐体2の背面側に、奥行き方向へのメダルの動きを規制するガイド部材7a、7bが配置されている。そしてガイド部材7aの下端とガイド部材7bの上端間の間隔は、撮像部4がメダルMの大部分を撮影できるように、例えば、メダルMの直径よりも僅かに小さく、例えば、メダルMの直径から1mm〜2mmを引いた値となっている。   As shown in FIGS. 3 and 4, below the curved portion of the passage 6, as will be described later, the housing 2 is more than the passage 6 so that the imaging unit 4 can photograph the medal M passing through the passage 6. There is a gap on the back side of the. Therefore, in order to prevent the medal M from deviating from the passage 6 in this gap, below the curved portion of the passage 6, the upper end and the lower end of the passage 6 are respectively closer to the rear side of the housing 2 than the passage 6. Further, guide members 7a and 7b for restricting the movement of medals in the depth direction are arranged. The distance between the lower end of the guide member 7a and the upper end of the guide member 7b is slightly smaller than the diameter of the medal M, for example, so that the imaging unit 4 can photograph most of the medal M. It is the value which subtracted 1mm-2mm from.

なお、ガイド部材7a、7bは、撮像部4がメダルM全体を撮影できるように、光源3からの光に対して透明な部材、例えば、光学樹脂またはガラスで形成されてもよい。   The guide members 7a and 7b may be formed of a member that is transparent to the light from the light source 3, such as an optical resin or glass, so that the imaging unit 4 can capture the entire medal M.

図4に示されるように、光源3は、通路6のガイド部材7aと7bとの間に挟まれた区間に設定された、撮像部4の撮影範囲4aを通過するメダルMを照明し、かつ撮像部4がメダルMの模様を撮影できるよう、その区間の近傍において、通路6に対して撮像部4と同じ側に配置される。さらに光源3は、撮影範囲4aを一様に照明可能なように、例えば、撮像部4の周囲に配置された一つまたは複数の発光ダイオードといった発光素子を有する。さらに、発光素子の前面に、発光素子からの光を通路6側へ拡散させて出射させる、板状の拡散シートが設けられてもよい。
光源3は、メダル識別装置1が動作している間、通路6を照明する。あるいは、光源3は、撮像部4が撮影するタイミングだけ発光するように、制御基板5によって制御されていてもよい。
As shown in FIG. 4, the light source 3 illuminates the medal M passing through the shooting range 4 a of the imaging unit 4 set in a section sandwiched between the guide members 7 a and 7 b of the passage 6, and It is arranged on the same side as the imaging unit 4 with respect to the passage 6 in the vicinity of the section so that the imaging unit 4 can capture the pattern of the medal M. Furthermore, the light source 3 includes, for example, a light emitting element such as one or a plurality of light emitting diodes arranged around the imaging unit 4 so that the photographing range 4a can be illuminated uniformly. Furthermore, a plate-like diffusion sheet that diffuses and emits light from the light emitting element toward the passage 6 may be provided on the front surface of the light emitting element.
The light source 3 illuminates the passage 6 while the medal identification device 1 is operating. Alternatively, the light source 3 may be controlled by the control board 5 so as to emit light only at the timing when the imaging unit 4 captures an image.

撮像部4は、通路6の一部に設定された撮影範囲4aを通過するメダルMを撮影し、そのメダルMの像が写った画像を生成する。そのために、撮像部4は、通路6の湾曲部の下方において、通路6に対して光源3と同じ側に位置するように、筐体2内の通路6の背面側に配置される。そして撮像部4は、例えば、2次元状に配列されたCCDイメージセンサまたはC-MOSイメージセンサといったイメージセンサと、そのイメージセンサ上に撮影範囲4aに含まれる通路6の一部区間及びその区間を通過するメダルMの像を結像する撮像光学系とを有する。また撮像部4は、画像上でメダルMの表面の模様を識別できるように、例えば、横320×縦240画素を有する。各画素の輝度値は、例えば、0〜255で表され、輝度値が大きいほど、輝度が高いことを表す。   The imaging unit 4 shoots a medal M passing through the shooting range 4a set in a part of the passage 6, and generates an image in which the image of the medal M is reflected. Therefore, the imaging unit 4 is disposed on the back side of the passage 6 in the housing 2 so as to be positioned on the same side as the light source 3 with respect to the passage 6 below the curved portion of the passage 6. The imaging unit 4 includes, for example, an image sensor such as a CCD image sensor or a C-MOS image sensor arranged in a two-dimensional manner, a partial section of the passage 6 included in the photographing range 4a on the image sensor, and the section thereof. An imaging optical system that forms an image of the passing medal M. In addition, the imaging unit 4 has, for example, horizontal 320 × vertical 240 pixels so that the pattern of the surface of the medal M can be identified on the image. The luminance value of each pixel is represented by, for example, 0 to 255, and the larger the luminance value, the higher the luminance.

撮像部4は、メダル識別装置1が動作している間、所定の時間間隔で撮影範囲4aを連続的に撮影する。所定の時間間隔は、例えば、メダル識別装置1に投入されたメダルが撮影範囲4aを通過している間に少なくとも1枚の画像が生成されるように、例えば、50msec〜100msec間隔に設定される。撮像部4は、撮影する度に、生成した画像を制御基板5へ出力する。   The imaging unit 4 continuously photographs the imaging range 4a at predetermined time intervals while the medal identification device 1 is operating. The predetermined time interval is set to, for example, an interval of 50 msec to 100 msec so that at least one image is generated while the medal inserted into the medal identification device 1 passes through the shooting range 4a. . The imaging unit 4 outputs the generated image to the control board 5 every time it captures an image.

また撮影範囲4aよりもよりもメダル投入口側に、メダルの通過を検知するセンサが設けられていてもよい。このセンサは、例えば、通路を挟んで対向するように配置された光源と受光素子とを有する光学センサ、あるいは、マグネット式の近接センサとすることができる。そして制御基板5は、このセンサからの検知信号を受信してから所定期間経過した時点で撮像部4に撮影を実行させることで、一枚の画像上に、確実にメダルM全体が表されるようにしてもよい。   Further, a sensor for detecting the passage of medals may be provided closer to the medal slot than the shooting range 4a. This sensor can be, for example, an optical sensor having a light source and a light receiving element arranged so as to face each other across a passage, or a magnet type proximity sensor. Then, the control board 5 causes the imaging unit 4 to perform shooting when a predetermined period has elapsed after receiving the detection signal from the sensor, so that the entire medal M is surely represented on one image. You may do it.

図5に示されるように、制御基板5は、制御回路51と、メモリ52と、通信インターフェース53とを有する。制御回路51は、例えば、プロセッサとその周辺回路とを有する。そして制御回路51は、撮像部4から受け取った画像を解析することにより、通路6を通過する識別対象のメダルが適正なメダルか否かを判定する。   As shown in FIG. 5, the control board 5 includes a control circuit 51, a memory 52, and a communication interface 53. The control circuit 51 includes, for example, a processor and its peripheral circuits. Then, the control circuit 51 analyzes the image received from the imaging unit 4 to determine whether or not the identification target medal passing through the passage 6 is an appropriate medal.

メモリ52は、記憶部の一例であり、例えば、不揮発性の読み出し専用の半導体メモリと、揮発性の読み書き可能な半導体メモリとを有する。そしてメモリ52は、制御回路51で実行されるメダル識別処理のプログラム、及び、メダル識別処理で用いられるパラメータ及びメダル識別処理の途中で算出される様々な中間計算値などを記憶する。さらに、メモリ52は、適正メダルのモデルを表すモデル画像を記憶する。なお、モデル画像の詳細については後述する。またメモリ52は、撮像部4から受け取った画像のうち、最新の複数枚の画像を記憶してもよい。   The memory 52 is an example of a storage unit, and includes, for example, a nonvolatile read-only semiconductor memory and a volatile read / write semiconductor memory. The memory 52 stores a medal identification process program executed by the control circuit 51, parameters used in the medal identification process, various intermediate calculation values calculated during the medal identification process, and the like. Furthermore, the memory 52 stores a model image representing a model of a proper medal. Details of the model image will be described later. The memory 52 may store the latest plurality of images among the images received from the imaging unit 4.

通信インターフェース53は、上位の制御装置(図示せず)、光源3及び撮像部4と接続するためのインターフェースであり、光源3または撮像部4への制御信号を制御回路51から受け取って、光源3または撮像部4に出力する。また通信インターフェース53は、上位の制御装置からの各種の制御信号を、信号線を介して受け取って、制御回路51へ渡す。さらに、通信インターフェース53は、制御回路51からメダルの識別結果を表す通知信号を受け取って、その通知信号を上位の制御装置へ出力する。   The communication interface 53 is an interface for connecting to a host control device (not shown), the light source 3 and the imaging unit 4, receives a control signal to the light source 3 or the imaging unit 4 from the control circuit 51, and receives the light source 3. Alternatively, the image is output to the imaging unit 4. The communication interface 53 receives various control signals from the host control device via the signal line and passes them to the control circuit 51. Further, the communication interface 53 receives a notification signal representing the medal identification result from the control circuit 51 and outputs the notification signal to the host control device.

図6は、制御回路51の機能ブロック図である。制御回路51は、メダル領域検出部61と、エッジ検出部62と、回転角算出部63と、モデル生成部64と、モデルエッジ数調整部65と、形状補正部66と、エッジ位置補正部67と、向き一致度算出部68と、類似度算出部69と、判定部70とを有する。制御回路51が有するこれらの各部は、例えば、制御回路51上で実行されるコンピュータプログラムにより実現される機能モジュールである。   FIG. 6 is a functional block diagram of the control circuit 51. The control circuit 51 includes a medal area detection unit 61, an edge detection unit 62, a rotation angle calculation unit 63, a model generation unit 64, a model edge number adjustment unit 65, a shape correction unit 66, and an edge position correction unit 67. A direction coincidence calculation unit 68, a similarity calculation unit 69, and a determination unit 70. Each of these units included in the control circuit 51 is, for example, a functional module realized by a computer program executed on the control circuit 51.

また、制御回路51が有するこれらの各部のうち、メダル領域検出部61及びエッジ検出部62は、識別対象のメダルが適正メダルか否かを判定するメダル識別処理と、メダル識別処理において利用される適正メダルのモデルが表されたモデル画像を生成するためのモデル登録処理の両方で利用される。一方、回転角算出部63、モデル生成部64及びモデルエッジ数調整部65は、モデル登録処理に利用される。そして、形状補正部66、エッジ位置補正部67、向き一致度算出部68、類似度算出部69及び判定部70は、メダル識別処理で利用される。   Among these units included in the control circuit 51, the medal area detection unit 61 and the edge detection unit 62 are used in the medal identification process for determining whether or not the identification target medal is an appropriate medal and the medal identification process. It is used in both model registration processes for generating a model image in which a model of a proper medal is represented. On the other hand, the rotation angle calculation unit 63, the model generation unit 64, and the model edge number adjustment unit 65 are used for model registration processing. The shape correction unit 66, the edge position correction unit 67, the orientation coincidence calculation unit 68, the similarity calculation unit 69, and the determination unit 70 are used in the medal identification process.

以下、モデル登録処理とメダル識別処理とに分けて、制御回路51が有する各部の処理を説明する。   Hereinafter, the process of each unit included in the control circuit 51 will be described separately for the model registration process and the medal identification process.

(モデル登録処理)
モデル登録処理では、モデル画像を生成するために、複数のサンプル用メダルが利用される。なお、メダル識別装置1が実装された遊技機が設置された店舗において、その店舗が使用するメダルを適正メダルとする場合、店舗において実際に用いられているメダルがサンプル用メダルとしてモデル登録処理で利用される。その際、サンプル用メダルの枚数が多いと、自店舗では使用されない不適正メダル、例えば、他店舗で使用されるメダルがサンプル用メダルに紛れ込む可能性がある。そこで、本実施形態では、メダル識別装置1は、以下の手順に従ってモデル画像を生成することで、モデル画像を生成するために利用される複数のサンプル用メダルのうちに、少数の不適正メダルが紛れ込んでいても、適切なモデル画像を生成できるようにする。
(Model registration process)
In the model registration process, a plurality of sample medals are used to generate a model image. In addition, in a store where a gaming machine equipped with the medal identification device 1 is installed, when a medal used by the store is an appropriate medal, a medal actually used in the store is used as a sample medal in the model registration process. Used. At this time, if the number of sample medals is large, improper medals that are not used in the own store, for example, medals used in other stores may be mixed into the sample medals. Therefore, in this embodiment, the medal identification device 1 generates a model image according to the following procedure, so that a small number of inappropriate medals are included among a plurality of sample medals used for generating a model image. An appropriate model image can be generated even if mixed.

モデル登録処理を開始する場合には、例えば、制御回路51は、上位の制御装置(図示せず)から、モデル登録用の画像撮影を行う旨の制御信号を受信することで、モデル登録用の画像撮影の待機状態となる。そしてこの状態においてメダル識別装置1にメダルが投入されると、制御回路51は、撮像部4により得られた画像をモデル登録処理用のサンプル画像としてメモリ52に記憶する。その後、制御回路51は、上位の制御装置から、モデル登録処理を開始する旨の制御信号を受信すると、モデル登録処理を開始する。   When starting the model registration process, for example, the control circuit 51 receives a control signal indicating that an image for model registration is to be captured from a higher-level control device (not shown). The camera enters a standby state for taking an image. When a medal is inserted into the medal identification device 1 in this state, the control circuit 51 stores the image obtained by the imaging unit 4 in the memory 52 as a sample image for model registration processing. Thereafter, when the control circuit 51 receives a control signal for starting the model registration process from the host control device, the control circuit 51 starts the model registration process.

同一のメダルであっても、光源3及び撮像部4に対するメダルの表面の模様の向きが異なれば、その模様に対する照明方向が異なるので、メダル表面の模様により生じる陰影も異なる。そのため、画像上に表されたメダルの見え方も異なる。そこで本実施形態では、複数のサンプル用メダルのそれぞれについて、複数回メダル識別装置1に投入される。これにより、個々のサンプル用メダルについて、光源3及び撮像部4に対する表面の模様の向きが異なる状態で撮影された複数の画像が得られ得る。
本実施形態では、例えば、数百枚〜数万枚のサンプル用メダルのそれぞれについて、数回〜30回程度メダル識別装置1に投入される。したがって、サンプル用メダルの枚数に、個々のメダルの投入回数を乗じた数のサンプル画像が得られる。制御回路51は、これらのサンプル画像を利用して、モデル登録処理を実行する。
Even with the same medal, if the orientation of the pattern on the surface of the medal with respect to the light source 3 and the imaging unit 4 is different, the illumination direction with respect to the pattern is different, so that the shading caused by the pattern on the surface of the medal is also different. For this reason, the appearance of medals displayed on the image is also different. Therefore, in this embodiment, each of the plurality of sample medals is inserted into the medal identification device 1 a plurality of times. Thereby, about each sample medal, the some image image | photographed in the state from which the direction of the pattern of the surface with respect to the light source 3 and the imaging part 4 differs can be obtained.
In the present embodiment, for example, each of hundreds to tens of thousands of sample medals is inserted into the medal identification device 1 about several to thirty times. Accordingly, the number of sample images obtained by multiplying the number of sample medals by the number of insertions of individual medals is obtained. The control circuit 51 executes a model registration process using these sample images.

図7は、サンプル用メダルの模式図である。メダル700では、その表面に模様701が刻印されている。したがって、画像上でこの模様701に応じた陰影を利用して、メダルを識別するための特徴が得られる。本実施形態では、制御回路51は、メダル表面の模様に応じた陰影のエッジに相当するエッジ画素を検出してエッジの分布をメダルを識別するための特徴とする。   FIG. 7 is a schematic diagram of a sample medal. In the medal 700, a pattern 701 is engraved on the surface thereof. Therefore, a feature for identifying a medal is obtained using a shadow corresponding to the pattern 701 on the image. In the present embodiment, the control circuit 51 is characterized in that it detects edge pixels corresponding to shaded edges corresponding to the pattern on the medal surface and identifies the medal with the edge distribution.

メダル領域検出部61は、各サンプル画像から、メダルが写っているメダル領域を抽出し、メダル領域の中心の座標及び半径を求める。
例えば、メダル領域検出部61は、着目するサンプル画像について、画像上の水平方向及び垂直方向に沿って、それぞれ、複数の走査線を設定する。そしてメダル領域検出部61は、各走査線上で、画像端から画像中心へ向けて順番に、着目する画素の輝度値から、その着目する画素に対して画像端側に隣接する画素の輝度値を減じて、輝度差分値を求める。そしてメダル領域検出部61は、輝度差分値が最初に所定の閾値を超えたときの着目する画素を、メダルの外周に相当する画素の候補(以下、外周候補画素と呼ぶ)とする。なお、走査線上で何れの画素についても輝度差分値が所定の閾値を超えない走査線については、メダル領域検出部61は、その走査線上では外周候補画素を求めなくてもよい。
The medal area detection unit 61 extracts a medal area where a medal is shown from each sample image, and obtains the coordinates and radius of the center of the medal area.
For example, the medal area detection unit 61 sets a plurality of scanning lines for the sample image of interest along the horizontal direction and the vertical direction on the image, respectively. Then, the medal area detection unit 61 calculates the luminance value of the pixel adjacent to the image end side with respect to the pixel of interest from the luminance value of the pixel of interest in order from the image end to the image center on each scanning line. Subtract the luminance difference value. The medal area detection unit 61 sets a pixel of interest when the luminance difference value first exceeds a predetermined threshold as a pixel candidate corresponding to the outer periphery of the medal (hereinafter referred to as an outer peripheral candidate pixel). It should be noted that the medal area detection unit 61 does not have to obtain the outer peripheral candidate pixels on a scanning line whose luminance difference value does not exceed a predetermined threshold value for any pixel on the scanning line.

メダル領域検出部61は、各走査線について、外周候補画素を求めると、それら複数の外周候補画素から任意の3個の外周候補画素を選択して外周候補画素の組とする。メダル領域検出部61は、選択する外周候補画素を異ならせて、所定数の外周候補画素の組を求める。なお、所定数は、2以上の整数、例えば、12に設定される。メダル領域検出部61は、外周候補画素の組ごとに、その組に含まれる3個の外周候補画素を通る円の方程式を求め、その円の方程式で表される円の中心を求める。メダル領域検出部61は、各組の円の中心のうち、最も一致する数が多い中心を、メダル中心候補として求める。なお、着目する二つの中心間の距離が1画素未満であれば、メダル領域検出部61は、その二つの中心は一致すると判定する。メダル領域検出部61は、メダル中心候補における一致した円の中心の数と、そのメダル中心候補を中心とし、かつ、メダル中心候補と一致した円の半径の平均値から求められるメダル候補の外周上に位置する外周候補画素の数を計数する。そしてメダル領域検出部61は、メダル中心候補の座標、メダル中心候補における一致した円の中心の数、そのメダル中心候補について計数されたメダル候補の外周上の外周候補画素の数をメモリ52に記憶する。   When the medal area detection unit 61 obtains outer periphery candidate pixels for each scanning line, the medal region detection unit 61 selects any three outer periphery candidate pixels from the plurality of outer periphery candidate pixels and sets them as a set of outer periphery candidate pixels. The medal area detection unit 61 obtains a predetermined number of sets of outer periphery candidate pixels by changing the outer periphery candidate pixels to be selected. The predetermined number is set to an integer of 2 or more, for example, 12. For each set of outer periphery candidate pixels, the medal area detection unit 61 calculates an equation of a circle that passes through the three outer periphery candidate pixels included in the set, and determines the center of the circle represented by the circle equation. The medal area detection unit 61 obtains the center having the largest number of matches among the circle centers of each group as a medal center candidate. If the distance between the two centers of interest is less than one pixel, the medal area detection unit 61 determines that the two centers match. The medal area detection unit 61 determines the number of coincident circle centers in the medal center candidates and the outer circumference of the medal candidates obtained from the average value of the circle radii centered on the medal center candidates and coincident with the medal center candidates. The number of outer peripheral candidate pixels located at is counted. The medal area detection unit 61 stores in the memory 52 the coordinates of the medal center candidate, the number of coincident circle centers in the medal center candidate, and the number of outer peripheral candidate pixels on the outer periphery of the medal candidate counted for the medal center candidate. To do.

メダル領域検出部61は、外周候補画素を検出するための所定の閾値の値を変更して上記と同様の処理を実行することを、複数回繰り返す。例えば、所定の閾値を、最初に、50に設定し、以後、閾値の値を5ずつ加算する。そしてメダル領域検出部61は、一致した円の中心の数が一定値(例えば、外周候補画素の組の半数)以上となるメダル中心候補のうちで、外周候補画素の総数に対するメダル候補の外周上に位置する外周候補画素の数の比率が最大となるメダル中心候補を、メダル領域の中心とし、そのメダル中心候補について求められた半径を、メダル領域の半径とする。   The medal region detection unit 61 repeats a plurality of times by changing the value of the predetermined threshold for detecting the outer periphery candidate pixels and executing the same processing as described above. For example, the predetermined threshold value is first set to 50, and thereafter, the threshold value is incremented by five. The medal area detection unit 61 then sets the number of coincidence circle centers on the outer circumference of the medal candidates with respect to the total number of outer peripheral candidate pixels among medal center candidates whose number is equal to or greater than a predetermined value (for example, half of the set of outer peripheral candidate pixels). The medal center candidate having the largest ratio of the number of outer peripheral candidate pixels located at is set as the center of the medal area, and the radius obtained for the medal center candidate is set as the radius of the medal area.

なお、メダル領域検出部61は、上記の例に限られず、画像上に写っている所定の物体をその画像から抽出する様々な処理の何れかを利用して、サンプル画像からメダル領域を抽出してもよい。例えば、サンプル画像上で、メダルが写っている領域の輝度とメダルが写っていない背景領域の輝度の差が大きい場合には、メダル領域検出部61は、サンプル画像の各画素の輝度値を所定の閾値と比較して、その所定の閾値よりも大きい画素の集合をメダル領域として検出してもよい。そしてメダル領域検出部61は、検出したメダル領域の重心をメダル領域の中心とし、メダル領域の中心からメダル領域の外周までの距離の平均値をメダル領域の半径としてもよい。   The medal area detection unit 61 is not limited to the above example, and extracts the medal area from the sample image by using any of various processes for extracting a predetermined object shown on the image from the image. May be. For example, on the sample image, when the difference between the brightness of the area where the medal is shown and the brightness of the background area where the medal is not shown is large, the medal area detection unit 61 determines the brightness value of each pixel of the sample image as a predetermined value. A set of pixels larger than the predetermined threshold may be detected as a medal area. Then, the medal area detection unit 61 may use the center of gravity of the detected medal area as the center of the medal area and the average value of the distance from the center of the medal area to the outer periphery of the medal area as the radius of the medal area.

メダル領域検出部61は、サンプル画像ごとに求めたメダル領域の中心の座標及びメダル領域の半径を、そのサンプル画像と対応付けてメモリ52に保存する。   The medal area detection unit 61 stores the coordinates of the center of the medal area and the radius of the medal area obtained for each sample image in the memory 52 in association with the sample image.

エッジ検出部62は、各サンプル画像について、メダル表面の模様により生じる陰影のエッジを表す、メダル領域内のエッジ画素を検出する。   The edge detection unit 62 detects, for each sample image, an edge pixel in the medal area that represents a shadowed edge caused by the pattern on the medal surface.

本実施形態では、エッジ検出部62は、メダル領域内の各画素に対してエッジ検出フィルタを適用することでエッジ強度を算出し、エッジ強度が所定のエッジ閾値以上となる画素をエッジ画素として検出する。エッジ検出部62は、エッジ検出フィルタとして、ラプラシアンフィルタといった2次微分フィルタを用いることが好ましい。この場合、エッジ閾値は、例えば、200に設定される。これにより、メダル表面の模様がなだらかに変化することで輝度変化が複数の画素にわたる場合でも、エッジ検出部62は、その複数の画素のうちの近傍画素間での輝度変化の差分が大きい画素をエッジ画素として検出できる。   In the present embodiment, the edge detection unit 62 calculates an edge strength by applying an edge detection filter to each pixel in the medal area, and detects a pixel whose edge strength is equal to or greater than a predetermined edge threshold as an edge pixel. To do. The edge detection unit 62 preferably uses a second-order differential filter such as a Laplacian filter as the edge detection filter. In this case, the edge threshold is set to 200, for example. As a result, even when the luminance change changes across a plurality of pixels due to a gentle change in the pattern on the surface of the medal, the edge detection unit 62 selects pixels having a large difference in luminance change between neighboring pixels among the plurality of pixels. It can be detected as an edge pixel.

エッジ検出部62は、各サンプル画像について、エッジ画素の値を'1'、エッジ画素以外の画素の値を'0'として、メダル領域の中心を原点とし、時計回り方向を正とする極座標で各エッジ画素を表したエッジ分布情報を生成する。そしてエッジ検出部62は、生成したエッジ分布情報を、元のサンプル画像と対応付けてメモリ52に記憶する。   For each sample image, the edge detector 62 sets the edge pixel value to '1', the pixel values other than the edge pixel to '0', polar coordinates with the center of the medal area as the origin, and the clockwise direction as positive. Edge distribution information representing each edge pixel is generated. Then, the edge detection unit 62 stores the generated edge distribution information in the memory 52 in association with the original sample image.

図8は、エッジ分布情報の一例を示す図である。エッジ分布情報800では、各画素の座標は、基準となる方向に対する角度θとメダル領域の中心からの距離Lにより表される。そしてエッジ画素に対応する座標では、値が'1'となり、それ以外の画素に対応する座標では、値が'0'となっている。なお、基準となる方向は、任意に定められればよく、例えば、サンプル画像の水平方向あるいは垂直方向とすることができる。   FIG. 8 is a diagram illustrating an example of edge distribution information. In the edge distribution information 800, the coordinates of each pixel are represented by an angle θ with respect to a reference direction and a distance L from the center of the medal area. The value corresponding to the edge pixel is “1”, and the coordinates corresponding to the other pixels are “0”. Note that the reference direction may be arbitrarily determined, and may be, for example, the horizontal direction or the vertical direction of the sample image.

回転角算出部63は、各サンプル画像のエッジ分布情報に基づいて、サンプル画像ごとに、メダルの仮モデルにおける、表面の模様の向きに対するそのサンプル画像に写っているメダルの表面の模様の向きの回転角を算出する。なお、回転角は、各サンプル画像をメダル領域の中心を回転中心とした回転方向について位置合わせするために利用される。   Based on the edge distribution information of each sample image, the rotation angle calculation unit 63 determines, for each sample image, the orientation of the pattern on the surface of the medal shown in the sample image with respect to the orientation of the surface pattern in the temporary model of the medal. Calculate the rotation angle. The rotation angle is used to align each sample image in the rotation direction with the center of the medal area as the rotation center.

本実施形態では、回転角算出部63は、複数のサンプル画像のうちの一つに写っているメダルを仮モデルとする。そして回転角算出部63は、他のサンプル画像を一つずつ、順番に、着目するサンプル画像とする。回転角算出部63は、仮モデルに対応するサンプル画像から得られたエッジ分布情報に対して、着目するサンプル画像のメダル領域の中心を回転中心としてエッジ分布情報の相対的な回転角を所定角度(例えば、1度)ずつ変えながら、エッジ分布の一致度合を表す一致度を算出する。本実施形態では、回転角算出部63は、次式に従って、回転角θのときの一致度C(θ)を算出する。

Figure 2016004331
ここで、NumCは、回転角θだけ着目するサンプル画像のエッジ分布情報を回転させたときの、サンプル画像のエッジ画素のうち、仮モデルのエッジ画素と一致するエッジ画素の数であり、NumEは、着目するサンプル画像のエッジ画素の総数である。すなわち、NumEは、着目するサンプル画像のエッジ画素のうちで仮モデルの何れのエッジ画素とも一致しないエッジ画素の総数NumDとNumCの和である。エッジ分布情報に含まれる各エッジ画素の座標が極座標系で表されているので、サンプル画像に表されたメダルの各エッジ画素を回転角θだけ回転させるには、回転角算出部63は、そのサンプル画像についてのエッジ分布情報に含まれる各エッジ画素の座標の角度値を回転角θだけずらせばよい。 In the present embodiment, the rotation angle calculation unit 63 uses a medal shown in one of a plurality of sample images as a temporary model. Then, the rotation angle calculation unit 63 sets the other sample images one by one as the sample image of interest. The rotation angle calculation unit 63 sets the relative rotation angle of the edge distribution information to a predetermined angle with respect to the edge distribution information obtained from the sample image corresponding to the temporary model, with the center of the medal region of the sample image of interest as the rotation center. The degree of coincidence representing the degree of coincidence of the edge distribution is calculated while being changed (for example, once). In the present embodiment, the rotation angle calculation unit 63 calculates the degree of coincidence C (θ) at the rotation angle θ according to the following equation.
Figure 2016004331
Here, NumC is the number of edge pixels that match the edge pixels of the temporary model among the edge pixels of the sample image when the edge distribution information of the sample image of interest is rotated by the rotation angle θ, and NumE is , The total number of edge pixels of the sample image of interest. That is, NumE is the sum of the total number of edge pixels NumD and NumC that do not match any of the edge pixels of the temporary model among the edge pixels of the sample image of interest. Since the coordinates of each edge pixel included in the edge distribution information are expressed in the polar coordinate system, the rotation angle calculation unit 63 is used to rotate each edge pixel of the medal represented in the sample image by the rotation angle θ. The angle value of the coordinates of each edge pixel included in the edge distribution information for the sample image may be shifted by the rotation angle θ.

図9は、回転角度と一致度の関係の一例を示す図である。図9において、横軸は回転角を表し、縦軸は一致度を表す。そして上側に示されたグラフ901は、着目するサンプル画像に表されたメダルの模様と仮モデルが表すメダルの模様が同一の場合における、回転角と一致度の関係を表す。一方、グラフ902は、着目するサンプル画像に表されたメダルの模様と仮モデルが表すメダルの模様が異なる場合における、回転角と一致度の関係を表す。   FIG. 9 is a diagram illustrating an example of the relationship between the rotation angle and the degree of coincidence. In FIG. 9, the horizontal axis represents the rotation angle, and the vertical axis represents the degree of coincidence. A graph 901 shown on the upper side represents the relationship between the rotation angle and the degree of coincidence when the medal pattern shown in the sample image of interest and the medal pattern represented by the temporary model are the same. On the other hand, the graph 902 represents the relationship between the rotation angle and the degree of coincidence when the medal pattern shown in the sample image of interest differs from the medal pattern represented by the temporary model.

着目するサンプル画像に写っているメダルの模様と、仮モデルが表すメダルの模様が同一であれば、メダルに表された模様の向きが一致する回転角において、サンプル画像上の各エッジ画素の位置と仮モデルにおける各エッジ画素の位置はほぼ一致する。そのため、一致度C(θ)は高い値となる。一方、それ以外の回転角では、メダルに表された模様が回転対称な模様でない限り、サンプル画像上の各エッジ画素のうち、仮モデルにおける何れかのエッジ画素と同じ位置となるエッジ画素は少ないので、一致度C(θ)は、回転角θによらず一様に低い値となる。一方、着目するサンプル画像に写っているメダルの模様と、仮モデルが表すメダルの模様が異なっていれば、どの回転角でも、サンプル画像上の各エッジ画素のうち、仮モデルにおける何れかのエッジ画素と同じ位置となるエッジ画素は少ないので、一致度C(θ)は回転角θによらず一様に低い値となる。   If the medal pattern shown in the sample image of interest and the medal pattern represented by the temporary model are the same, the position of each edge pixel on the sample image at the rotation angle where the orientation of the pattern represented by the medal matches And the position of each edge pixel in the provisional model almost coincide. Therefore, the degree of coincidence C (θ) is a high value. On the other hand, at other rotation angles, as long as the pattern shown on the medal is not rotationally symmetric, there are few edge pixels on the sample image at the same position as any edge pixel in the temporary model. Therefore, the degree of coincidence C (θ) is uniformly low regardless of the rotation angle θ. On the other hand, if the medal pattern shown in the sample image of interest differs from the medal pattern represented by the temporary model, any edge in the temporary model among the edge pixels on the sample image at any rotation angle. Since there are few edge pixels at the same position as the pixels, the degree of coincidence C (θ) is uniformly low regardless of the rotation angle θ.

したがって、グラフ901に示されるように、着目するサンプル画像に写っているメダルの模様と、仮モデルが表すメダルの模様が同一であれば、一致度の最大値C1と2番目に大きい一致度の極大値C2の差は大きくなる。このような場合、一致度C1に対応する回転角θ1が、仮モデルが表すメダルの表面の模様の向きに対する、着目するサンプル画像に表されたメダルの表面の模様の向きの方向差に相当すると推定される。   Therefore, as shown in the graph 901, if the medal pattern shown in the sample image of interest and the medal pattern represented by the temporary model are the same, the maximum matching value C1 and the second largest matching score are obtained. The difference between the maximum values C2 becomes large. In such a case, the rotation angle θ1 corresponding to the degree of coincidence C1 corresponds to the direction difference of the pattern orientation on the surface of the medal represented in the sample image of interest with respect to the orientation of the pattern on the medal surface represented by the temporary model. Presumed.

一方、グラフ902に示されるように、着目するサンプル画像に写っているメダルの模様と、仮モデルが表すメダルの模様が異なっていれば、一致度の最大値C1と2番目に大きい一致度の極大値C2の差が小さく、C1/C2は1に近い。そのため、着目するサンプル画像に表されたメダルの表面の模様の向きと仮モデルが表すメダルの表面の模様の向きとの方向差がどの回転角に対応しているかがはっきりしない。   On the other hand, as shown in the graph 902, if the medal pattern shown in the sample image of interest is different from the medal pattern represented by the temporary model, the maximum matching value C1 and the second largest matching score are obtained. The difference between the maximum values C2 is small, and C1 / C2 is close to 1. For this reason, it is unclear which rotation angle corresponds to the direction difference between the orientation of the pattern on the surface of the medal represented in the sample image of interest and the orientation of the pattern on the surface of the medal represented by the temporary model.

そこで、回転角算出部63は、回転角θに対する一致度C(θ)の関数における一致度C(θ)の極大値のうち、一致度の最大値C1に対応する回転角θ1と、2番目に大きい一致度の極大値C2に対応する回転角θ2とを求める。そして回転角算出部63は、2番目に大きい一致度の極大値に対する一致度の最大値の比C1/C2を、所定の一致度比閾値と比較する。そしてその比C1/C2が一致度比閾値以上であれば、回転角算出部63は、そのサンプル画像についての一致度の最大値C1に対応する回転角θ1を、仮モデルの表面の模様の向きに対するサンプル画像上のメダルの表面の模様の向きの回転角として、そのサンプル画像と対応付けてメモリ52に記憶する。さらに、回転角算出部63は、回転角が算出されたことを表すフラグを、そのサンプル画像と対応付けてメモリ52に記憶する。
また回転角算出部63は、そのサンプル画像についてのエッジ分布情報を回転角θ1だけ回転させ、回転されたエッジ分布情報に含まれる各エッジ画素の値'1'を、仮モデルの対応する画素の値に加算する。
Therefore, the rotation angle calculation unit 63 calculates the second rotation angle θ1 corresponding to the maximum value C1 of the coincidence among the maximum values of the coincidence C (θ) in the function of the coincidence C (θ) with respect to the rotation angle θ. And a rotation angle θ2 corresponding to the maximum value C2 of the degree of coincidence greater than. Then, the rotation angle calculation unit 63 compares the ratio C1 / C2 of the maximum coincidence value to the maximum value of the second largest coincidence degree with a predetermined coincidence ratio threshold value. If the ratio C1 / C2 is equal to or greater than the coincidence ratio threshold, the rotation angle calculation unit 63 sets the rotation angle θ1 corresponding to the maximum coincidence value C1 for the sample image to the pattern orientation on the surface of the temporary model. Is stored in the memory 52 in association with the sample image as the rotation angle of the pattern orientation of the surface of the medal on the sample image. Further, the rotation angle calculation unit 63 stores a flag indicating that the rotation angle has been calculated in the memory 52 in association with the sample image.
Further, the rotation angle calculation unit 63 rotates the edge distribution information about the sample image by the rotation angle θ1, and sets the value “1” of each edge pixel included in the rotated edge distribution information to the corresponding pixel of the temporary model. Add to the value.

図10は、仮モデルのエッジ分布情報と着目するサンプル画像上のメダルのエッジ分布情報の一例を示す図である。上述したように、エッジ分布情報では、各エッジ画素は極座標系で表示されているが、ここでは、理解を容易にするために、各エッジ画素を直交座標系で表している。
この例では、着目するサンプル画像を回転させないときと、90度、180度、270度回転させたときの画素単位のエッジ分布1001〜1004が示されている。なお、各エッジ分布において、0でない画素がエッジ画素である。この例では、着目するサンプル画像を90度回転させたとき、そのエッジ分布と仮モデルのエッジ分布1000とが最も一致する。そこで回転角算出部63は、仮モデルのエッジ分布1000において、着目するサンプル画像を90度回転させたときの各エッジ画素に対応する画素に'1'を加算する。
FIG. 10 is a diagram illustrating an example of edge distribution information of a temporary model and edge distribution information of medals on a sample image of interest. As described above, in the edge distribution information, each edge pixel is displayed in a polar coordinate system, but here, in order to facilitate understanding, each edge pixel is represented in an orthogonal coordinate system.
In this example, edge distributions 1001 to 1004 in units of pixels when the sample image of interest is not rotated and when rotated by 90 degrees, 180 degrees, and 270 degrees are shown. In each edge distribution, pixels that are not 0 are edge pixels. In this example, when the sample image of interest is rotated by 90 degrees, the edge distribution and the edge distribution 1000 of the temporary model most closely match. Therefore, the rotation angle calculation unit 63 adds “1” to the pixel corresponding to each edge pixel when the sample image of interest is rotated 90 degrees in the edge distribution 1000 of the temporary model.

一方、着目するサンプル画像についての比C1/C2が一致度比閾値未満であれば、回転角算出部63は、一致度の最大値C1と、仮モデルに加算されていないことを表すフラグを、そのサンプル画像と対応付けてメモリ52に記憶する。   On the other hand, if the ratio C1 / C2 for the sample image of interest is less than the coincidence ratio threshold, the rotation angle calculation unit 63 sets the coincidence maximum value C1 and a flag indicating that it has not been added to the provisional model, The sample image is stored in the memory 52 in association with the sample image.

回転角算出部63は、全てのサンプル画像について、上記の処理を繰り返す。これにより、仮モデルに表されたメダルと同種のメダルが写っているサンプル画像のエッジ画素が仮モデルに順次加算されるので、仮モデルでは、エッジが存在する可能性が高い画素ほど大きな値となる。   The rotation angle calculation unit 63 repeats the above processing for all sample images. As a result, the edge pixels of the sample image in which medals of the same type as the medals represented in the temporary model are sequentially added to the temporary model. Therefore, in the temporary model, a pixel having a higher possibility of having an edge has a larger value. Become.

しかし、一般的に、照明条件あるいは撮影時のメダルの向き、もしくはメダル自体の傷などにより、各サンプル画像について、エッジ分布情報を回転角θ1だけ回転させて仮モデルと位置合わせしたとしても、サンプル画像上の全てのエッジ画素が仮モデルに含まれるエッジ画素と一致するわけではない。その結果、仮モデルに加算されるサンプル画像の数が増えるほど、仮モデルにおいて'0'でない値を持つ画素、すなわちエッジ画素の割合が増える。例えば、再度図10を参照すると、仮モデルのエッジ分布1000において、着目するサンプル画像を90度回転させたときの各エッジ画素に対応する画素に'1'を加算すると、画素1010のように、画素値が'0'から'1'となり、新たにエッジ画素となる画素がある。そして仮モデルに含まれるエッジ画素の数が多過ぎると、一致度が正確に算出されなくなる。   However, in general, even if the edge distribution information is rotated by the rotation angle θ1 and aligned with the temporary model for each sample image due to lighting conditions, the orientation of the medal at the time of shooting, or the scratch on the medal itself, the sample Not all edge pixels on the image match the edge pixels included in the temporary model. As a result, as the number of sample images added to the temporary model increases, the proportion of pixels having values other than “0” in the temporary model, that is, edge pixels increases. For example, referring to FIG. 10 again, when “1” is added to the pixel corresponding to each edge pixel when the sample image of interest is rotated 90 degrees in the edge distribution 1000 of the temporary model, The pixel value changes from “0” to “1”, and there is a pixel that becomes a new edge pixel. If the number of edge pixels included in the temporary model is too large, the degree of coincidence cannot be calculated accurately.

そこで、仮モデルのメダル領域に含まれる画素のうちのエッジ画素の割合が高くなり過ぎないように、回転角算出部63は、仮モデルに所定枚数(例えば、10〜100枚)のサンプル画像のエッジ画素が加算される度に、仮モデルの各画素から一定の値を減じる。その際、回転角算出部63は、その減算によって負の値となった画素については、その画素の値を'0'とする。なお、一定の値は、例えば、所定枚数の半分とすることができる。   Therefore, the rotation angle calculation unit 63 adds a predetermined number (for example, 10 to 100) of sample images to the temporary model so that the ratio of the edge pixels among the pixels included in the medal area of the temporary model does not become too high. Each time an edge pixel is added, a certain value is subtracted from each pixel of the temporary model. At this time, the rotation angle calculation unit 63 sets the pixel value to “0” for a pixel that has become a negative value due to the subtraction. Note that the fixed value can be, for example, half of the predetermined number.

あるいは、回転角算出部63は、仮モデルについてのメダル領域に占めるエッジ画素の比率が所定値(例えば、0.4)以下となるように閾値を調整し、その閾値で仮モデルのメダル領域内の各画素の値を2値化してもよい。2値化の際、回転角算出部63は、画素の値が閾値以上である画素について、エッジ画素であることを表す値、例えば'1'とし、一方、回転角算出部63は、画素の値が閾値未満である画素について、エッジ画素でないことを表す'0'とする。   Alternatively, the rotation angle calculation unit 63 adjusts the threshold value so that the ratio of the edge pixels in the medal area of the temporary model is equal to or less than a predetermined value (for example, 0.4), and each threshold value in the medal area of the temporary model is adjusted with the threshold value. The pixel value may be binarized. At the time of binarization, the rotation angle calculation unit 63 sets a value representing an edge pixel, for example, “1” for a pixel having a pixel value equal to or greater than a threshold value. A pixel whose value is less than the threshold is set to “0” indicating that it is not an edge pixel.

上記の処理を全てのサンプル画像について実行した後に、回転角算出部63は、フラグを参照して、エッジ画素が仮モデルに加算されなかったサンプル画像について、一致度の最大値C1が高い方から順に並び替える。そして回転角算出部63は、それらのサンプル画像について上記の処理を繰り返す。これにより、2回目以降の処理では、仮モデルが適正メダルのエッジ分布をより正確に表せるようになっている可能性が高いので、前回の処理では、仮モデルに対する回転角が決定されなかったサンプル画像についても、仮モデルに対する回転角が決定される可能性が高くなる。その際、一致度比閾値を所定量(例えば、0.02)だけ小さくしてもよい。そして回転角算出部63は、全てのサンプル画像についてエッジ画素が仮モデルに加算されるか、あるいは、一致度比閾値が下限値まで低下すると、処理を終了する。   After executing the above processing for all the sample images, the rotation angle calculation unit 63 refers to the flag, and for the sample images in which the edge pixels are not added to the temporary model, from the one with the highest matching value C1 Sort in order. Then, the rotation angle calculation unit 63 repeats the above processing for those sample images. As a result, in the second and subsequent processes, there is a high possibility that the temporary model can more accurately represent the edge distribution of the appropriate medals. Therefore, in the previous process, the rotation angle for the temporary model was not determined. The possibility that the rotation angle with respect to the temporary model is determined for the image is also increased. At this time, the coincidence ratio threshold value may be reduced by a predetermined amount (for example, 0.02). Then, the rotation angle calculation unit 63 ends the process when the edge pixels are added to the temporary model for all the sample images or when the coincidence ratio threshold value decreases to the lower limit value.

なお、仮モデルとして最初に採用されたサンプル画像が、不適正メダルが写った画像である場合、(C1/C2)が一致度比閾値以上となるサンプル画像の数が非常に少なくなる。そこで、全てのサンプル画像について1回目の回転角の算出を行った際に、回転角が決定されたサンプル画像の数が一定数(例えば、サンプル画像の総数の1/100)以下である場合、回転角算出部63は、最初に仮モデルとするサンプル画像を入れ替えて、上記の一連の処理を再度実行してもよい。   Note that when the sample image initially adopted as the temporary model is an image in which an inappropriate medal is captured, the number of sample images in which (C1 / C2) is equal to or greater than the coincidence ratio threshold is very small. Therefore, when the first rotation angle is calculated for all the sample images, the number of sample images for which the rotation angles are determined is equal to or less than a certain number (for example, 1/100 of the total number of sample images). The rotation angle calculation unit 63 may replace the sample image as the temporary model first and execute the series of processes again.

なお、C1/C2は、その定義から、最小値が1なので、一致度比閾値の下限値を1よりもある程度大きな値、例えば、1.5〜2.0に設定することで、回転角算出部63は、サンプル用メダルに、不適正メダル、または、疵または摩耗の度合いが激しい適正メダルが含まれる場合に、その不適正メダルあるいは疵または摩耗の度合いが激しい適正メダルが写ったサンプル画像をモデルの作成から除外できる。
一方、回転角算出部63は、一致度比閾値の下限値を1または1に近い値、例えば、1.0〜1.1に設定することで、ほぼすべてのサンプル画像をモデルの作成に利用できる。あるいは、回転角算出部63は、一致度比閾値をその下限値まで低下させても、(C1/C2)が一致度比閾値未満となるサンプル画像についても、回転角算出部63は、s一致度の最大値C1に対応する回転角θ1を、仮モデルの表面の模様の向きに対するサンプル画像上のメダルの表面の模様の向きの回転角として、そのサンプル画像と対応付けてメモリ52に記憶してもよい。
Since C1 / C2 has a minimum value of 1 from its definition, by setting the lower limit value of the coincidence ratio threshold value to a value somewhat larger than 1, for example, 1.5 to 2.0, the rotation angle calculation unit 63 If the sample medal includes an improper medal, or an appropriate medal with a high degree of wrinkle or wear, a sample image showing the improper medal or the appropriate medal with a high degree of wrinkle or wear is created from the model creation. Can be excluded.
On the other hand, the rotation angle calculation unit 63 can use almost all sample images for model creation by setting the lower limit of the coincidence ratio threshold to 1 or a value close to 1, for example, 1.0 to 1.1. Alternatively, even if the rotation angle calculation unit 63 reduces the coincidence ratio threshold to the lower limit value, the rotation angle calculation unit 63 also performs s coincidence for the sample image in which (C1 / C2) is less than the coincidence ratio threshold. The rotation angle θ1 corresponding to the maximum degree C1 is stored in the memory 52 in association with the sample image as the rotation angle of the pattern orientation of the surface of the medal on the sample image with respect to the pattern orientation of the surface of the temporary model. May be.

図11は、回転角算出処理の動作フローチャートである。
回転角算出部63は、仮モデルの表面の模様の向きに対する着目するサンプル画像上のメダルの表面の模様の向きの回転角を変えつつ、エッジ分布の一致度の最大値C1と2番目の極大値C2を算出する(ステップS101)。
FIG. 11 is an operation flowchart of the rotation angle calculation process.
The rotation angle calculation unit 63 changes the rotation angle of the pattern orientation on the surface of the medal on the sample image to be focused with respect to the pattern orientation on the surface of the temporary model, and the maximum value C1 of the edge distribution coincidence and the second maximum. A value C2 is calculated (step S101).

回転角算出部63は、2番目の極大値C2に対する一致度の最大値C1の比(C1/C2)が一致度比閾値Th以上か否か判定する(ステップS102)。比(C1/C2)が一致度比閾値Th以上である場合(ステップS102−Yes)、回転角算出部63は、仮モデルの表面の模様の向きに対するサンプル画像上のメダルの表面の模様の向きの回転角を、C1に対応する回転角θ1とし、その回転角θ1だけサンプル画像上の各エッジ画素を回転させて、サンプル画像上の各エッジ画素に対応する仮モデルを表す画像上の画素に'1'を加算する(ステップS103)。さらに回転角算出部63は、仮モデルに含まれるエッジ画素の数を調整してもよい。   The rotation angle calculation unit 63 determines whether the ratio (C1 / C2) of the matching degree maximum value C1 to the second maximum value C2 is equal to or greater than the matching degree ratio threshold Th (step S102). When the ratio (C1 / C2) is equal to or greater than the coincidence ratio threshold Th (step S102—Yes), the rotation angle calculation unit 63 determines the orientation of the pattern on the surface of the medal on the sample image with respect to the orientation of the pattern on the surface of the temporary model. Is set to a rotation angle θ1 corresponding to C1, and each edge pixel on the sample image is rotated by the rotation angle θ1 to obtain a temporary model corresponding to each edge pixel on the sample image. '1' is added (step S103). Further, the rotation angle calculation unit 63 may adjust the number of edge pixels included in the temporary model.

ステップS103の後、あるいは、ステップS102にて比(C1/C2)が一致度比閾値Th未満である場合(ステップS102−No)、回転角算出部63は、未着目のサンプル画像が残っているか否か判定する(ステップS104)。未着目のサンプル画像が残っていれば(ステップS104−Yes)、回転角算出部63は、次の順序の未着目のサンプル画像を着目するサンプル画像に設定する(ステップS105)。そして回転角算出部63は、ステップS101以降の処理を繰り返す。   After step S103 or when the ratio (C1 / C2) is less than the coincidence ratio threshold value Th in step S102 (step S102-No), the rotation angle calculation unit 63 determines whether a sample image that has not been observed remains. It is determined whether or not (step S104). If an unfocused sample image remains (step S104-Yes), the rotation angle calculation unit 63 sets the unordered sample image in the next order as the focused sample image (step S105). And the rotation angle calculation part 63 repeats the process after step S101.

一方、未着目のサンプル画像が残っていなければ(ステップS104−No)、回転角算出部63は、一致度比閾値Thが下限値Thminに達しているか否か判定する(ステップS106)。一致度比閾値Thが下限値Thminに達していれば(ステップS106−Yes)、回転角算出部63は、仮モデルに未加算のサンプル画像が残っていても、回転角算出処理を終了する。   On the other hand, if there is no unfocused sample image remaining (step S104-No), the rotation angle calculation unit 63 determines whether or not the coincidence ratio threshold value Th has reached the lower limit value Thmin (step S106). If the coincidence ratio threshold value Th has reached the lower limit value Thmin (step S106—Yes), the rotation angle calculation unit 63 ends the rotation angle calculation process even if an unadded sample image remains in the temporary model.

一方、一致度比閾値Thが下限値Thminに達していなければ(ステップS106−No)、回転角算出部63は、一致度比閾値を所定量δだけ小さくする(ステップS107)。そして回転角算出部63は、仮モデルに未加算のサンプル画像が残っているか否か判定する(ステップS108)。   On the other hand, if the coincidence ratio threshold value Th has not reached the lower limit value Thmin (No in step S106), the rotation angle calculation unit 63 decreases the coincidence degree ratio threshold value by a predetermined amount δ (step S107). Then, the rotation angle calculation unit 63 determines whether or not an unadded sample image remains in the temporary model (step S108).

未加算のサンプル画像が残っていれば(ステップS108−Yes)、回転角算出部63は、それら未加算のサンプル画像をC1が大きい方から順に並び替える(ステップS109)。そして回転角算出部63は、それら未加算のサンプル画像のうち、C1最大のサンプル画像を着目するサンプル画像とし、残りを未着目のサンプル画像として、ステップS101以降の処理を繰り返す。   If unadded sample images remain (step S108—Yes), the rotation angle calculation unit 63 rearranges the unadded sample images in descending order of C1 (step S109). Then, the rotation angle calculation unit 63 repeats the processing from step S101 onwards, taking the sample image with the largest C1 among the sample images that have not been added as the sample image to which attention is paid and the rest as the sample images that have not been noticed.

一方、未加算のサンプル画像が残っていなければ(ステップS108−No)、回転角算出部63は、回転角算出処理を終了する。   On the other hand, if no unadded sample image remains (step S108-No), the rotation angle calculation unit 63 ends the rotation angle calculation process.

モデル生成部64は、回転角θ1が算出された各サンプル画像のメダル領域内のエッジ画素を累積加算することで、メダル識別処理に用いられるメダルのモデルが表されたモデル画像を生成する。   The model generation unit 64 generates a model image representing a medal model used for medal identification processing by cumulatively adding edge pixels in the medal area of each sample image for which the rotation angle θ1 is calculated.

モデル生成部64は、回転角θ1が算出された各サンプル画像について、エッジ検出部62と同様に、エッジ検出フィルタ処理を実行して、メダル領域内の各画素のエッジ強度を算出する。そしてモデル生成部64は、エッジ強度に対する2値化閾値を変えつつ、メダル領域内の各画素に対して2値化閾値以上のエッジ強度を持つ画素をエッジ画素とする2値化処理を行って、メダル領域内に含まれるエッジ画素の比率が所定値(例えば、0,4)未満となるようにする。この2値化処理により、回転角θ1が算出された各サンプル画像について、メダル領域内のエッジ画素の値を'1'とし、メダル領域外、あるいは、メダル領域内でエッジ画素でない画素の値を'0'とする2値画像が得られる。
モデル生成部64は、各2値画像を、それぞれ、メダル領域の中心を回転中心として、対応するサンプル画像について求められた回転角θ1だけ回転した後、メダル領域の中心で位置合わせして、各画素の値を加算することで、適正メダルのモデルを表すモデル画像を生成する。したがって、モデル画像上では、エッジ画素と判定されたサンプル画像が多い画素ほど、大きな値を持つ。
The model generation unit 64 performs edge detection filter processing on each sample image for which the rotation angle θ1 is calculated, similarly to the edge detection unit 62, and calculates the edge intensity of each pixel in the medal area. Then, the model generation unit 64 performs binarization processing in which each pixel in the medal area has a pixel having an edge strength equal to or higher than the binarization threshold while changing the binarization threshold for the edge strength. The ratio of edge pixels included in the medal area is set to be less than a predetermined value (for example, 0, 4). For each sample image for which the rotation angle θ1 has been calculated by this binarization processing, the value of the edge pixel in the medal area is set to “1”, and the value of the pixel that is outside the medal area or is not an edge pixel in the medal area. A binary image with “0” is obtained.
The model generation unit 64 rotates each binary image by the rotation angle θ1 obtained for the corresponding sample image with the center of the medal area as the rotation center, and then aligns each binary image at the center of the medal area. By adding the pixel values, a model image representing a model of a proper medal is generated. Therefore, on the model image, the larger the number of sample images determined as edge pixels, the larger the value.

モデル生成部64は、最後に、モデル画像上で画素値の最大値Pmaxを検出し、各画素の値に対して(255/Pmax)を乗じることで、画素値の最大値が255となるように、モデル画像上の各画素の値を正規化する。   Finally, the model generation unit 64 detects the maximum pixel value Pmax on the model image and multiplies the value of each pixel by (255 / Pmax) so that the maximum pixel value becomes 255. Then, the value of each pixel on the model image is normalized.

図12は、得られたモデル画像の一例を示す図である。モデル画像1200では、多数のサンプル画像においてエッジ画素と判定された画素ほど大きな値を持つ。したがって、個々のサンプル画像に写っているサンプル用のメダルの個体の特性、例えば、疵によるエッジは、モデル画像1200上に表された適正メダルのモデルには反映されず、適正メダルのモデルでは、各メダルで共通の模様によるエッジが強調される。また一部のサンプル用メダルに汚れが付着して模様の一部が見えなくなっていたとしても、他のサンプル用メダルにおいてその模様の一部に相当するエッジが検出されていれば、モデル画像1200上でも、そのエッジが表現される。   FIG. 12 is a diagram illustrating an example of the obtained model image. In the model image 1200, a pixel determined as an edge pixel in many sample images has a larger value. Therefore, the individual characteristics of the medal for the sample shown in each sample image, for example, the edge due to the eyelid is not reflected in the model of the appropriate medal represented on the model image 1200. Edges with patterns common to each medal are emphasized. Further, even if some sample medals are contaminated and a part of the pattern is not visible, the model image 1200 can be used if an edge corresponding to a part of the pattern is detected in another sample medal. The edge is also expressed above.

モデル生成部64は、最初に位置合わせされた2枚のサンプル画像のうちの基準とした方のサンプル画像におけるメダル領域の中心を、モデル画像におけるメダル領域の中心とする。そしてモデル生成部64は、モデル画像の生成に利用された各サンプル画像におけるメダル領域の半径の平均値を、モデル画像におけるメダル領域の半径とする。
モデル生成部64は、モデル画像と、モデル画像上のメダル領域の中心の座標及びメダル領域の半径をメモリ52に記憶する。
The model generation unit 64 sets the center of the medal region in the sample image that is the reference of the two sample images that are initially aligned as the center of the medal region in the model image. Then, the model generation unit 64 sets the average value of the radius of the medal area in each sample image used for generating the model image as the radius of the medal area in the model image.
The model generation unit 64 stores the model image, the coordinates of the center of the medal area on the model image, and the radius of the medal area in the memory 52.

モデルエッジ数調整部65は、モデル画像に表された適正モデルのメダル領域に占める、1以上の画素値を持つエッジ画素の数の比率が所定値以下となるように、エッジ画素の数を調整する。   The model edge number adjustment unit 65 adjusts the number of edge pixels so that the ratio of the number of edge pixels having one or more pixel values in the medal area of the appropriate model represented in the model image is equal to or less than a predetermined value. To do.

本実施形態では、モデルエッジ数調整部65は、メダル領域中の局所ごとのエッジ画素の数が均等化されるように、モデル画像上のメダル領域の中心を基準点として、メダル領域を、円周方向に沿って所定数の部分領域に分割する。図13(a)に示されるように、メダル領域1300に設定される各部分領域1301は、扇状の領域となる。所定数は、例えば、36とする(すなわち、各部分領域の中心角は10度となる)。そしてモデルエッジ数調整部65は、部分領域ごとに、その部分領域の面積に占めるエッジ画素の数の比率を算出する。モデルエッジ数調整部65は、その比率が0.8以上である場合、各エッジ画素の値から1を減じる。なお、画素値が0となった画素については、モデルエッジ数調整部65は、その画素をエッジ画素から除外する。モデルエッジ数調整部65は、各部分領域について、部分領域の面積に占めるエッジ画素の数の比率が0.8未満となるまで、上記の処理を繰り返す。   In the present embodiment, the model edge number adjustment unit 65 converts the medal area into a circle using the center of the medal area on the model image as a reference point so that the number of edge pixels for each local area in the medal area is equalized. A predetermined number of partial areas are divided along the circumferential direction. As shown in FIG. 13A, each partial area 1301 set in the medal area 1300 is a fan-shaped area. The predetermined number is, for example, 36 (that is, the central angle of each partial region is 10 degrees). Then, the model edge number adjustment unit 65 calculates, for each partial region, the ratio of the number of edge pixels in the area of the partial region. When the ratio is 0.8 or more, the model edge number adjustment unit 65 subtracts 1 from the value of each edge pixel. Note that for a pixel having a pixel value of 0, the model edge number adjustment unit 65 excludes the pixel from the edge pixel. The model edge number adjustment unit 65 repeats the above processing for each partial region until the ratio of the number of edge pixels to the area of the partial region is less than 0.8.

円周方向に分割された全ての部分領域について、上記の処理が終了すると、モデルエッジ数調整部65は、メダル領域を、モデル画像上のメダル領域の中心から放射方向に沿って複数の部分領域に分割する。すなわち、図13(b)に示されるように、メダル領域1300に設定される各部分領域1302は、最も中心の円状の部分領域を除いて、リング状の領域となる。また、各部分領域の放射方向に沿った幅は、例えば、2画素に設定される。
モデルエッジ数調整部65は、扇状の部分領域について行った処理と同様の処理を、各部分領域について実行する。その際、モデルエッジ数調整部65は、部分領域に占めるエッジ画素の数の比率が0.5未満となるまで、エッジ画素の値を小さくする。
これにより、モデル画像上のメダル領域ではエッジ画素が全体的に略均等に分布するようになる。また、メダル領域の面積に占めるエッジ画素の数の比率は、0.4(=0.8x0.5)未満となる。
When the above processing is completed for all the partial areas divided in the circumferential direction, the model edge number adjustment unit 65 converts the medal area into a plurality of partial areas along the radial direction from the center of the medal area on the model image. Divide into That is, as shown in FIG. 13B, each partial area 1302 set in the medal area 1300 is a ring-shaped area except for the most central circular partial area. Moreover, the width along the radial direction of each partial region is set to 2 pixels, for example.
The model edge number adjusting unit 65 performs the same process as that performed on the fan-shaped partial area for each partial area. At that time, the model edge number adjustment unit 65 reduces the value of the edge pixel until the ratio of the number of edge pixels in the partial region becomes less than 0.5.
As a result, the edge pixels are distributed almost uniformly throughout the medal area on the model image. Further, the ratio of the number of edge pixels to the area of the medal area is less than 0.4 (= 0.8 × 0.5).

なお、モデルエッジ数調整部65は、上記のエッジ画素数の調整処理を、リング状の各部分領域について行った後に、扇状の各部分領域について実行してもよい。また、モデルエッジ数調整部65は、各部分領域に占めるエッジ画素の数の比率の上限値を0.5または0.8以外に設定してもよい。ただし、後述するメダル識別処理において、識別対象のメダルが写った画像とモデル画像の比較を適切に行えるようにするために、最終的に得られるモデル画像において、メダル領域の面積に占めるエッジ画素の数の比率が0.3〜0.5程度になるように、エッジ画素の数が調整されることが好ましい。   Note that the model edge number adjusting unit 65 may perform the adjustment processing of the number of edge pixels on each of the ring-shaped partial areas and then execute the process on each of the fan-shaped partial areas. In addition, the model edge number adjusting unit 65 may set the upper limit value of the ratio of the number of edge pixels in each partial region to a value other than 0.5 or 0.8. However, in the medal identification process described later, in order to appropriately compare the image showing the identification target medal with the model image, the edge pixel occupying the area of the medal region in the finally obtained model image. The number of edge pixels is preferably adjusted so that the ratio of the numbers is about 0.3 to 0.5.

モデルエッジ数調整部65は、エッジ画素の数が調整されたモデル画像を、メダル識別処理で使用するモデル画像としてメモリ52に記憶する。さらに、モデルエッジ数調整部65は、各エッジ画素の位置をメダル領域の中心を原点とする極座標系で表した、モデル画像のエッジ分布情報を生成し、そのエッジ分布情報もメモリ52に記憶する。   The model edge number adjustment unit 65 stores the model image in which the number of edge pixels is adjusted in the memory 52 as a model image used in the medal identification process. Further, the model edge number adjusting unit 65 generates edge distribution information of the model image in which the position of each edge pixel is expressed in a polar coordinate system with the center of the medal area as the origin, and stores the edge distribution information in the memory 52 as well. .

図14は、モデル登録処理の動作フローチャートである。
メダル領域検出部61は、各サンプル画像からメダル領域を検出する(ステップS201)。そしてエッジ検出部62は、各サンプル画像のメダル領域内のエッジ画素を検出する(ステップS202)。
FIG. 14 is an operation flowchart of the model registration process.
The medal area detection unit 61 detects a medal area from each sample image (step S201). Then, the edge detection unit 62 detects edge pixels in the medal area of each sample image (step S202).

回転角算出部63は、各サンプル画像について、適正メダルの仮モデルに対するサンプル画像上のメダルの回転角を求める(ステップS203)。そしてモデル生成部64は、各サンプル画像について、そのサンプル画像上の各エッジ画素を対応する回転角だけ回転させ、メダル領域の中心で位置合わせして、エッジ画素となる画素ごとに'1'を加算し、画素値の最大値が所定値となるよう各画素の値を正規化することで適正メダルのモデルを表すモデル画像を生成する(ステップS204)。   The rotation angle calculation unit 63 obtains the rotation angle of the medal on the sample image with respect to the temporary model of the appropriate medal for each sample image (step S203). Then, the model generation unit 64 rotates each edge pixel on the sample image by the corresponding rotation angle, aligns it at the center of the medal area, and sets “1” for each pixel that becomes the edge pixel. A model image representing a model of a proper medal is generated by adding and normalizing the value of each pixel so that the maximum pixel value becomes a predetermined value (step S204).

モデル画像が生成された後、モデルエッジ数調整部65は、モデル画像上のメダル領域を、その中心を基準点として円周方向に沿って複数の部分領域に分割し、各部分領域に含まれるエッジ画素の数を、部分領域の面積に占めるエッジ画素の数の比率が所定比率未満となるように調整する(ステップS205)。さらに、モデルエッジ数調整部65は、モデル画像上のメダル領域を、その中心から放射方向に沿って複数の部分領域に分割し、各部分領域に含まれるエッジ画素の数を、部分領域の面積に占めるエッジ画素の数の比率が所定比率未満となるように調整する(ステップS206)。そしてモデルエッジ数調整部65は、エッジ画素の数が調整されたモデル画像をメモリ52に保存して、モデル登録処理を終了する。   After the model image is generated, the model edge number adjustment unit 65 divides the medal area on the model image into a plurality of partial areas along the circumferential direction with the center as a reference point, and is included in each partial area. The number of edge pixels is adjusted so that the ratio of the number of edge pixels to the area of the partial region is less than a predetermined ratio (step S205). Further, the model edge number adjustment unit 65 divides the medal region on the model image into a plurality of partial regions along the radial direction from the center, and determines the number of edge pixels included in each partial region as the area of the partial region. The ratio of the number of edge pixels occupying is adjusted to be less than a predetermined ratio (step S206). Then, the model edge number adjusting unit 65 stores the model image in which the number of edge pixels is adjusted in the memory 52, and ends the model registration process.

(メダル識別処理)
次に、識別対象のメダルが適正メダルか否かを判定するメダル識別処理について説明する。メダル識別装置1の制御回路51は、例えば、メダル識別装置1が実装された遊技機が動作している場合において、メダル識別装置1にメダルが投入される度に、その投入されたメダルを識別対象メダルとして、メダル識別処理を実行する。その際、制御回路51は、投入されたメダルが撮像部4の撮影範囲にいる間に撮像部4がそのメダルを撮影して得られる画像(以下、識別対象画像と呼ぶ)を用いてメダル識別処理を実行する。
(Medal identification process)
Next, a medal identification process for determining whether or not an identification target medal is a proper medal will be described. The control circuit 51 of the medal identification device 1 identifies the inserted medal every time a medal is inserted into the medal identification device 1, for example, when a gaming machine equipped with the medal identification device 1 is operating. The medal identification process is executed as the target medal. At that time, the control circuit 51 identifies a medal using an image (hereinafter referred to as an identification target image) obtained by the imaging unit 4 shooting the medal while the inserted medal is in the shooting range of the imaging unit 4. Execute the process.

メダル領域検出部61は、サンプル画像に対して行った処理と同様の処理を識別対象画像に対して実行して、識別対象画像上で識別対象メダルが写っているメダル領域を検出する。そしてメダル領域検出部61は、検出されたメダル領域の中心の座標、及び、その中心の座標を求める際に利用された、各外周候補画素の座標を形状補正部66へ渡す。   The medal area detection unit 61 performs a process similar to the process performed on the sample image for the identification target image, and detects a medal area where the identification target medal is shown on the identification target image. Then, the medal area detection unit 61 passes the coordinates of the center of the detected medal area and the coordinates of each outer peripheral candidate pixel used when obtaining the coordinates of the center to the shape correction unit 66.

メダルが通路6を通過する際のメダルの姿勢によっては、メダルの表面が撮像部4の光軸に対して直交せず、傾くことがある。また、通路6の幅によっては、撮像部4からメダルまでの距離が一定とならないことがある。このような場合、識別対象画像上で、メダルが楕円形状となったり、あるいは、メダル領域のサイズがモデル画像上のメダル領域のサイズと異なることがある。そこで形状補正部66は、識別対象画像上でのメダル領域の形状の歪みを補正する。さらに、形状補正部66は、モデル画像上のメダル領域のサイズと識別対象画像上でのメダル領域のサイズとを一致させる。   Depending on the posture of the medal when the medal passes through the passage 6, the surface of the medal may be inclined without being orthogonal to the optical axis of the imaging unit 4. Further, depending on the width of the passage 6, the distance from the imaging unit 4 to the medal may not be constant. In such a case, the medal may be elliptical on the identification target image, or the size of the medal area may be different from the size of the medal area on the model image. Therefore, the shape correcting unit 66 corrects the distortion of the shape of the medal area on the identification target image. Further, the shape correcting unit 66 matches the size of the medal area on the model image with the size of the medal area on the identification target image.

そのために、形状補正部66は、識別対象画像上に、様々な方向を向いた、メダル領域の中心を通る任意の直線を設定し、その直線上でメダル領域の中心を挟んで対向する二つの外周候補画素を特定する。そして形状補正部66は、その二つの外周候補画素間の距離を、その方向におけるメダル領域の直径とする。形状補正部66は、このようにして、各方向の直線に沿ったメダル領域の直径を求める。そして形状補正部66は、各方向の直径のうち、最も長い直径を長径として求める。形状補正部66は、長径に対応する方向に直交し、かつ、メダル領域の中心を通る直線上で、メダル領域の中心を挟んで対向する二つの外周候補画素を特定し、その二つの外周候補画素間の距離をメダル領域の短径とする。形状補正部66は、長径に対する短径の比が所定の閾値(例えば、0.95)以下である場合、あるいは、長径と短径の差が所定の閾値(例えば、3画素)以上である場合、短径が長径と等しくなるように、メダル領域の中心を原点として、識別対象画像のメダル領域内の各画素に対して短径方向に沿って補間処理を行う。これにより、メダル領域の形状が略円形となる。   For this purpose, the shape correcting unit 66 sets an arbitrary straight line that passes through the center of the medal area and faces in various directions on the identification target image, and two opposing faces across the center of the medal area on the straight line. A peripheral candidate pixel is specified. Then, the shape correcting unit 66 sets the distance between the two outer peripheral candidate pixels as the diameter of the medal area in that direction. In this way, the shape correcting unit 66 obtains the diameter of the medal area along the straight line in each direction. Then, the shape correcting unit 66 obtains the longest diameter among the diameters in the respective directions as the major axis. The shape correcting unit 66 identifies two outer peripheral candidate pixels that are orthogonal to the direction corresponding to the major axis and that are opposed to each other across the center of the medal area on a straight line passing through the center of the medal area, and the two outer peripheral candidates. The distance between the pixels is the minor axis of the medal area. When the ratio of the minor axis to the major axis is a predetermined threshold (for example, 0.95) or less, or the difference between the major axis and the minor axis is a predetermined threshold (for example, three pixels) or more, the shape correcting unit 66 Interpolation processing is performed along the minor axis direction for each pixel in the medal area of the identification target image with the center of the medal area as the origin so that the diameter becomes equal to the major axis. Thereby, the shape of the medal area becomes substantially circular.

さらに、形状補正部66は、モデル画像上でのメダル領域の半径に対する、識別対象画像上でのメダル領域の長径の比を算出する。その比が、1.0よりも所定量大きい第1の閾値(例えば、1.05〜1.1)よりも大きければ、形状補正部66は、識別対象画像上でのメダル領域の長径がモデル画像上でのメダル領域の半径と等しくなるように、メダル領域の中心を原点として、識別対象画像のメダル領域内の各画素に対して水平方向及び垂直方向に沿って補間処理を行う。また、モデル画像上でのメダル領域の半径に対する、識別対象画像上でのメダル領域の長径の比が1.0よりも所定量小さい第2の閾値(例えば、0.95〜0.9)よりも小さい場合も、形状補正部66は、識別対象画像上でのメダル領域の長径がモデル画像上でのメダル領域の半径と等しくなるように、メダル領域の中心を原点として、識別対象画像のメダル領域内の各画素に対して水平方向及び垂直方向に沿って補間処理を行う。   Further, the shape correction unit 66 calculates the ratio of the major axis of the medal area on the identification target image to the radius of the medal area on the model image. If the ratio is larger than a first threshold value (for example, 1.05 to 1.1) that is larger than 1.0 by a predetermined amount, the shape correcting unit 66 determines that the medal area on the identification target image has a major axis of the medal area on the model image. Interpolation processing is performed along the horizontal and vertical directions for each pixel in the medal area of the identification target image with the center of the medal area as the origin so as to be equal to the radius of. The shape of the medal area on the identification target image with respect to the radius of the medal area on the model image is smaller than a second threshold (for example, 0.95 to 0.9) smaller than 1.0 by a predetermined amount. The correction unit 66 sets the center of the medal area as the origin and sets each pixel in the medal area of the identification target image so that the major axis of the medal area on the identification target image becomes equal to the radius of the medal area on the model image. Interpolation processing is performed along the horizontal and vertical directions.

形状補正部66は、形状補正された識別対象画像を改めて識別対象画像としてメモリ52に保存する。   The shape correction unit 66 stores the shape-corrected identification target image in the memory 52 as an identification target image again.

エッジ検出部62は、識別対象画像について、サンプル画像からエッジ画素を検出する処理と同様のエッジ検出フィルタ処理を実行して、メダル表面の模様により生じる陰影のエッジを表す、メダル領域内のエッジ画素を検出する。ただし、エッジ検出部62は、各エッジ画素の値を2値化せず、メダル領域の各画素についてエッジ検出フィルタ処理を行うことにより得られたエッジ強度そのものを、そのエッジ画素の値とする。また、エッジ検出部62は、画素値が'0'でない画素をエッジ画素とする。エッジ検出部62は、メダル領域内の各画素のエッジ強度を表すエッジ画像をメモリ52に保存する。   The edge detection unit 62 performs an edge detection filter process similar to the process of detecting edge pixels from the sample image for the identification target image, and represents an edge pixel in the medal area that represents a shadow edge caused by the pattern on the medal surface. Is detected. However, the edge detection unit 62 does not binarize the value of each edge pixel, and uses the edge intensity itself obtained by performing the edge detection filter processing for each pixel in the medal area as the value of the edge pixel. Further, the edge detection unit 62 sets pixels whose pixel values are not “0” as edge pixels. The edge detection unit 62 stores an edge image representing the edge strength of each pixel in the medal area in the memory 52.

なお、エッジ検出部62は、検出されるエッジ画素の数が過剰にならないように、エッジ検出フィルタ処理を実行する前に、識別対象画像について、ガウシアンフィルタといった平滑化フィルタ処理を実行してもよい。   Note that the edge detection unit 62 may execute a smoothing filter process such as a Gaussian filter on the identification target image before executing the edge detection filter process so that the number of detected edge pixels does not become excessive. .

メダルによっては、製造時の工程の影響などによって、メダル表面に表された模様の位置がずれることがある。図15は、模様の位置が正しいメダルと模様の位置がずれたメダルの一例を示す図である。メダル1500では、その表面の模様1510がメダル1500の中心に刻印されている。一方、メダル1501では、その表面の模様1511の位置がメダル1501の中心から左上方へずれている。このような模様の位置ずれがあるメダルが識別対象メダルである場合、エッジ検出部62により検出されたエッジ画素の座標をそのままモデル画像との比較に利用すると、その位置ずれの影響により、本来、メダル表面の模様についての同じ部分を示す識別対象画像上のエッジ画素の位置とモデル画像上のエッジ画素の位置がずれてしまい、一致度の算出精度が低下する。そこでエッジ位置補正部67は、識別対象画像上のメダル領域とモデル画像上のメダル領域とで最も一致する位置を求めることで、識別対象画像に写った識別対象メダルの表面の模様の位置ずれを補正する。   Depending on the medal, the position of the pattern shown on the medal surface may shift due to the influence of the manufacturing process. FIG. 15 is a diagram illustrating an example of a medal with a correct pattern position and a medal with a shifted pattern position. In the medal 1500, a pattern 1510 on the surface is stamped at the center of the medal 1500. On the other hand, the position of the pattern 1511 on the surface of the medal 1501 is shifted from the center of the medal 1501 to the upper left. When a medal with such a pattern misalignment is an identification target medal, if the coordinates of the edge pixel detected by the edge detection unit 62 are used as they are for comparison with the model image, The position of the edge pixel on the identification target image indicating the same portion of the pattern on the medal surface is shifted from the position of the edge pixel on the model image, and the accuracy of calculating the coincidence is lowered. Therefore, the edge position correction unit 67 obtains the position where the medal area on the identification target image and the medal area on the model image most closely match, thereby correcting the positional deviation of the pattern on the surface of the identification target medal shown in the identification target image. to correct.

本実施形態では、エッジ位置補正部67は、最初に、エッジ画像のメダル領域の中心と、モデル画像のメダル領域の中心とを位置合わせする。エッジ位置補正部67は、その位置合わせされた状態から、モデル画像のメダル領域の中心に対して、エッジ画像のメダル領域の中心の位置を水平方向または垂直方向に対して所定の探索範囲(例えば、±2画素)で相対的に平行にずらしつつ、エッジ画像のメダル領域内の各エッジ画素とモデル画像のメダル領域内の各エッジ画素間の一致度を算出する。なお、一致度は、例えば、上記の(1)式に従って算出される。そしてエッジ位置補正部67は、一致度が最大となるときの、モデル画像のメダル領域の中心に対する、エッジ画像のメダル領域の中心の位置ずれ量を求める。   In the present embodiment, the edge position correction unit 67 first aligns the center of the medal area of the edge image with the center of the medal area of the model image. From the aligned state, the edge position correction unit 67 determines the position of the center of the medal area of the edge image with respect to the center of the medal area of the model image by a predetermined search range (for example, the horizontal direction or the vertical direction). , ± 2 pixels), and the degree of coincidence between each edge pixel in the medal area of the edge image and each edge pixel in the medal area of the model image is calculated. Note that the degree of coincidence is calculated, for example, according to the above equation (1). Then, the edge position correcting unit 67 obtains the amount of positional deviation of the center of the medal area of the edge image with respect to the center of the medal area of the model image when the degree of coincidence is maximized.

エッジ位置補正部67は、エッジ画像を、メダル領域の中心を回転中心として、所定角度(例えば、1度)ずつ回転させつつ、上記の処理を繰り返す。そしてエッジ位置補正部67は、一致度が最大となるときの回転角度及び中心の位置ずれ量を特定する。エッジ位置補正部67は、エッジ画像上の各エッジ画素を、メダル領域の中心を回転中心としてその特定された回転角度だけ回転し、さらに、特定された位置ずれ量を打ち消すように、各エッジ画素を平行移動する。そしてエッジ位置補正部67は、エッジ画素の位置が補正されたエッジ画像をメモリ52に保存する。さらに、エッジ位置補正部67は、各エッジ画素の座標を、メダル領域の中心を原点とし、時計回りを正とする極座標に変換して、その極座標表示された各エッジ画素の座標を、識別対象画像の識別対象メダルのエッジ分布情報としてメモリ52に保存する。   The edge position correction unit 67 repeats the above processing while rotating the edge image by a predetermined angle (for example, 1 degree) with the center of the medal area as the rotation center. Then, the edge position correction unit 67 specifies the rotation angle and the center position shift amount when the degree of coincidence becomes maximum. The edge position correction unit 67 rotates each edge pixel on the edge image by the specified rotation angle with the center of the medal area as the rotation center, and further cancels the specified positional deviation amount. Is translated. Then, the edge position correcting unit 67 stores the edge image in which the position of the edge pixel is corrected in the memory 52. Further, the edge position correction unit 67 converts the coordinates of each edge pixel into polar coordinates with the center of the medal area as the origin and positive in the clockwise direction, and the coordinates of each edge pixel displayed in the polar coordinates are identified. The information is stored in the memory 52 as edge distribution information of the identification target medal of the image.

図16は、位置補正されたエッジ画像の一例を示す図である。エッジ画像1600では、表面の模様に相当するエッジ1601が、メダル領域1602の略中心に位置していることが分かる。   FIG. 16 is a diagram illustrating an example of a position-corrected edge image. In the edge image 1600, it can be seen that the edge 1601 corresponding to the pattern on the surface is located at the approximate center of the medal area 1602.

なお、変形例によれば、エッジ位置補正部67は、識別対象画像を、メダル領域の中心を回転中心として、所定角度(例えば、1度)ずつ回転させつつ、識別対象画像のメダル領域の中心とモデル画像のメダル領域の中心を位置合わせして、一致度を算出し、その一致度が最大となる回転角度を求めてもよい。そしてエッジ位置補正部67は、識別対象画像の各画素を、メダル領域の中心を回転中心としてその回転角度だけ回転させてから、上記の探索範囲内で識別対象画像のメダル領域の中心の位置をモデル画像のメダル領域の中心の位置に対して平行にずらしつつ、一致度を算出し、その一致度の最大値をもとめてもよい。そしてエッジ位置補正部67は、その一致度の最大値に対応する、モデル画像のメダル領域の中心に対する識別対象画像のメダル領域の中心の位置ずれ量を打ち消すように、各エッジ画素の位置を平行移動させてもよい。   Note that, according to the modification, the edge position correction unit 67 rotates the identification target image by a predetermined angle (for example, 1 degree) around the center of the medal area as the rotation center, and the center of the medal area of the identification target image. And the center of the medal region of the model image may be aligned to calculate the degree of coincidence, and the rotation angle that maximizes the degree of coincidence may be obtained. Then, the edge position correcting unit 67 rotates each pixel of the identification target image by the rotation angle about the center of the medal area, and then determines the position of the center of the medal area of the identification target image within the search range. The degree of coincidence may be calculated while shifting in parallel with the center position of the medal area of the model image, and the maximum value of the degree of coincidence may be obtained. Then, the edge position correction unit 67 parallelizes the position of each edge pixel so as to cancel out the amount of positional deviation of the center of the medal area of the identification target image with respect to the center of the medal area of the model image corresponding to the maximum value of the matching degree. It may be moved.

向き一致度算出部68は、補正回転角算出部の一例であり、モデル画像上の適正メダルのモデルにおける模様の向きと、識別対象画像に写っている識別対象メダルの模様の向きとを一致させるための補正回転角を算出するとともに、回転方向に関して、識別対象メダルと適正メダルのモデルを位置合わせしたときの一致度と位置合わせしない場合の一致度の差を表す指標である向き一致度を算出する。   The orientation coincidence calculation unit 68 is an example of a correction rotation angle calculation unit, and matches the pattern direction in the model of the appropriate medal on the model image with the pattern direction of the identification target medal shown in the identification target image. In addition to calculating the correct rotation angle for calculating the orientation, the orientation coincidence, which is an index representing the difference between the coincidence when the identification target medal and the appropriate medal model are aligned with each other and the alignment when the alignment is not performed, is calculated. To do.

向き一致度算出部68は、回転角算出部63により実行される、仮モデルに対するサンプル画像上のメダルの回転角及び一致度を算出する処理と同様の処理を、モデル画像上の適正メダルのモデルと識別対象画像の識別メダルについて行うことで、モデル画像上の適正メダルのモデルの表面の模様の向きに対する、識別対象メダルの表面の模様の向きの回転角を算出する。すなわち、向き一致度算出部68は、モデル画像及び識別対象画像のエッジ分布情報を利用して、識別対象画像上の各エッジ画素を、メダル領域の中心を回転中心として回転角を所定角度(例えば、1度)ずつ変えながら、モデルのエッジ分布と識別対象メダルのエッジ分布の一致度を算出する。なお、この例でも、一致度は、(1)式により算出される。なお、向き一致度算出部68は、識別対象画像上の各エッジ画素を回転させる代わりに、モデル画像上の各エッジ画素を回転させて一致度を算出してもよい。   The orientation coincidence calculation unit 68 performs a process similar to the process executed by the rotation angle calculation unit 63 to calculate the rotation angle and coincidence of medals on the sample image with respect to the temporary model, and the model of the appropriate medals on the model image. Then, the rotation angle of the orientation of the pattern on the surface of the identification medal is calculated with respect to the orientation of the pattern on the surface of the model of the appropriate medal on the model image. That is, the orientation coincidence calculation unit 68 uses the edge distribution information of the model image and the identification target image to set each edge pixel on the identification target image to a predetermined angle (for example, the rotation angle about the center of the medal area). The degree of coincidence between the edge distribution of the model and the edge distribution of the identification target medal is calculated while changing each time. In this example as well, the degree of coincidence is calculated by equation (1). Note that the orientation coincidence calculation unit 68 may calculate the degree of coincidence by rotating each edge pixel on the model image instead of rotating each edge pixel on the identification target image.

向き一致度算出部68は、一致度が最大となる回転角を、モデル画像上の適正メダルのモデルの表面の模様の向きと、識別対象画像に写っている識別対象メダルの表面の模様の向きとを一致させるための補正回転角とする。さらに、向き一致度算出部68は、回転角ごとの一致度から、全ての回転角についての一致度の平均値と、その平均値及び一致度の最大値についての偏差値を算出する。そして向き一致度算出部68は、一致度の平均値の偏差値に対する、一致度の最大値の偏差値の比を、向き一致度とする。したがって、向き一致度は、モデル画像上の適正メダルのモデルの表面の模様の向きと、識別対象画像に写っている識別対象メダルの表面の模様の向きとが一致している場合に限り、一致するエッジ画素の数が多く、逆に、モデル画像上の適正メダルのモデルの表面の模様の向きと、識別対象画像に写っている識別対象メダルの表面の模様の向きがずれると一致するエッジ画素の数が少ないほど、大きな値となる。すなわち、適正メダルに表された模様の回転対称性が低いほど、向き一致度は大きくなる。
この向き一致度は、個々のメダルの個体差から受ける影響が小さいので、識別対象メダルに傷、摩耗または汚れなどがあっても、識別対象メダルと適正メダルのモデルとの一致度合を正確に表すことができる。
The orientation coincidence calculation unit 68 determines the rotation angle at which the degree of coincidence is maximum, the orientation of the pattern on the surface of the model of the appropriate medal on the model image, and the orientation of the pattern on the surface of the identification target medal shown in the identification target image. And a correction rotation angle for making them coincide with each other. Furthermore, the orientation coincidence calculation unit 68 calculates the average value of the coincidence degree for all rotation angles and the deviation value for the average value and the maximum value of the coincidence degree from the coincidence degree for each rotation angle. Then, the orientation coincidence calculation unit 68 sets the ratio of the deviation value of the maximum coincidence value to the deviation value of the average coincidence value as the orientation coincidence. Therefore, the degree of orientation matching is the same only when the orientation of the pattern on the surface of the model of the appropriate medal on the model image matches the orientation of the pattern on the surface of the identification medal that appears in the identification target image. Edge pixels that match when the orientation of the pattern on the surface of the model of the appropriate medal on the model image deviates from the orientation of the pattern on the surface of the identification medal that appears in the identification target image The smaller the number, the larger the value. That is, the lower the rotational symmetry of the pattern represented by the appropriate medal, the greater the degree of orientation matching.
This degree of orientation coincidence is less affected by individual differences between individual medals, and therefore accurately represents the degree of coincidence between the identification medal and the appropriate medal model even if the identification medal is scratched, worn, or dirty. be able to.

なお、変形例によれば、向き一致度算出部68は、回転角ごとに求めた一致度のうち、一致度の最大値(すなわち、一致度の極大値のうちで1番大きい極大値)C1と一致度の極大値のうちの2番目に大きい極大値C2の差(C1-C2)、あるいは、その差をC1で正規化した値(C1-C2)/C1を、向き一致度として算出してもよい。あるいはまた、向き一致度算出部68は、2番目に大きい一致度の極大値C2に対する一致度の最大値C1の比(C1/C2)を、向き一致度として算出してもよい。
向き一致度算出部68は、補正回転角及び向き一致度をメモリ52に記憶する。
Note that, according to the modification, the direction coincidence degree calculation unit 68 has the maximum value of the coincidence degree (that is, the largest maximum value among the maximum values of the coincidence degree) out of the coincidence degrees obtained for each rotation angle C1. The difference between C2 and C2 (C1-C2), or the value obtained by normalizing the difference with C1 (C1-C2) / C1, is calculated as the degree of orientation coincidence. May be. Alternatively, the direction coincidence calculating unit 68 may calculate the ratio (C1 / C2) of the maximum value C1 of the coincidence to the maximum value C2 of the second largest coincidence as the direction coincidence.
The direction coincidence calculation unit 68 stores the corrected rotation angle and the direction coincidence in the memory 52.

類似度算出部69は、モデル画像上の適正メダルのモデルの中心及び模様の向きと識別対象画像上の識別対象メダルの中心及び模様の向きを一致させた上で、適正メダルのモデルの表面の模様と識別対象メダルの表面の模様の類似度合いを表す類似度を算出する。   The similarity calculation unit 69 matches the center and pattern orientation of the appropriate medal model on the model image with the center and pattern orientation of the identification medal on the identification target image, and then the surface of the model of the appropriate medal model A similarity indicating the degree of similarity between the pattern and the pattern on the surface of the identification target medal is calculated.

本実施形態では、類似度算出部69は、類似度を正確に評価できるようにするために、互いに異なる複数の分割方法のそれぞれについて、分割方法ごとにメダル領域を複数の部分領域に分割し、各部分領域について、その部分領域の面積に対するエッジ画素の数の比が所定比率未満となるようにエッジ画素を選択する。そして類似度算出部69は、選択したエッジ画素とモデル画像上のエッジ画素との一致不一致に基づいて類似度を算出する。   In the present embodiment, the similarity calculation unit 69 divides the medal area into a plurality of partial areas for each of the plurality of different division methods so that the similarity can be accurately evaluated, For each partial region, the edge pixels are selected so that the ratio of the number of edge pixels to the area of the partial region is less than a predetermined ratio. Then, the similarity calculation unit 69 calculates the similarity based on the coincidence / mismatch between the selected edge pixel and the edge pixel on the model image.

本実施形態では、類似度算出部69は、エッジ画素を選択するために、モデルエッジ数調整部65と同様の処理を識別対象画像から得たエッジ画像のメダル領域に適用して、エッジ画素の数を調節する。すなわち、類似度算出部69は、エッジ画像のメダル領域の中心を基準点として、メダル領域を、円周方向に沿って所定数の扇形の部分領域に分割する。なお、類似度算出部69は、個々の分割領域を、モデルエッジ数調整部65における扇形の部分領域よりも大きくすることが好ましい。そこで、例えば、所定数は18に設定される(すなわち、各部分領域の中心角は20度となる)。これにより、何れかの部分領域全体に、メダル表面の模様が細かく変化する部分が含まれて、その部分領域の面積に占めるエッジ画素数の比率が非常に高くなってしまい、その部分領域に含まれるエッジ画素数を減らさざるを得なくなって模様の特徴が正確に表されなくなることが抑制される。   In the present embodiment, the similarity calculation unit 69 applies the same processing as that of the model edge number adjustment unit 65 to the medal region of the edge image obtained from the identification target image in order to select the edge pixel. Adjust the number. That is, the similarity calculation unit 69 divides the medal area into a predetermined number of fan-shaped partial areas along the circumferential direction with the center of the medal area of the edge image as a reference point. Note that the similarity calculation unit 69 preferably makes each divided region larger than the sector-shaped partial region in the model edge number adjustment unit 65. Therefore, for example, the predetermined number is set to 18 (that is, the central angle of each partial region is 20 degrees). As a result, a portion where the pattern on the medal surface changes minutely is included in any of the partial regions, and the ratio of the number of edge pixels to the area of the partial region becomes very high. It is suppressed that the number of edge pixels to be reduced has to be reduced and the feature of the pattern is not accurately expressed.

類似度算出部69は、部分領域ごとに、その部分領域の面積に占めるエッジ画素の数の比率を算出する。類似度算出部69は、その比率が所定比率(例えば、0.4)以上である場合、各エッジ画素の値から1を減じる。そして画素値がエッジ画素か否かの判定に用いるエッジ閾値未満となった画素については、類似度算出部69は、その画素をエッジ画素から除外する。エッジ閾値の値は、モデル登録処理においてエッジ検出部62が利用するエッジ閾値と同じ値とすることができる。類似度算出部69は、各部分領域について、部分領域の面積に占めるエッジ画素の数の比率が所定比率未満となるまで、上記の処理を繰り返す。逆に、類似度算出部69は、部分領域の面積に占めるエッジ画素の数の比率が所定比率未満となるまで、エッジ閾値を増加させてもよい。
なお、類似度算出部69は、部分領域の面積に占めるエッジ画素の数の比率が最初から所定比率未満である場合、その比率が所定比率に達するまで、部分領域内の各画素の値に1を加算してもよい。この場合、類似度算出部69は、画素値がエッジ閾値以上となると、その画素をエッジ画素に加える。
The similarity calculation unit 69 calculates, for each partial region, the ratio of the number of edge pixels in the area of the partial region. When the ratio is equal to or greater than a predetermined ratio (for example, 0.4), the similarity calculation unit 69 subtracts 1 from the value of each edge pixel. For a pixel whose pixel value is less than the edge threshold used for determining whether or not the pixel is an edge pixel, the similarity calculation unit 69 excludes the pixel from the edge pixel. The value of the edge threshold value can be the same value as the edge threshold value used by the edge detection unit 62 in the model registration process. The similarity calculation unit 69 repeats the above processing for each partial region until the ratio of the number of edge pixels in the area of the partial region becomes less than a predetermined ratio. Conversely, the similarity calculation unit 69 may increase the edge threshold until the ratio of the number of edge pixels in the area of the partial region becomes less than a predetermined ratio.
Note that, when the ratio of the number of edge pixels in the area of the partial region is less than the predetermined ratio from the beginning, the similarity calculation unit 69 sets 1 to the value of each pixel in the partial area until the ratio reaches the predetermined ratio. May be added. In this case, the similarity calculation unit 69 adds the pixel to the edge pixel when the pixel value is equal to or greater than the edge threshold value.

類似度算出部69は、各部分領域のエッジ画素の数の調整が終了すると、モデル画像上のメダル領域の中心とエッジ画像上のメダル領域の中心とを位置合わせする。そして類似度算出部69は、エッジ画像上の各エッジ画素を、メダル領域の中心を回転中心として、補正回転角だけ回転させる。そして類似度算出部69は、次式に従って、適正メダルのモデルの表面の模様と識別対象メダルの表面の模様間の第1の類似度S1を算出する。

Figure 2016004331
ここで、NumCは、エッジ画像のエッジ画素のうち、モデル画像のエッジ画素と一致するエッジ画素の数である。NumD1は、エッジ画像のエッジ画素のうちでモデル画像の何れのエッジ画素とも一致しないエッジ画素の数である。そしてNumD2は、モデル画像のエッジ画素のうちでエッジ画像の何れのエッジ画素とも一致しないエッジ画素の数である。すなわち、第1の類似度S1は、識別対象画像のメダル領域内のエッジ画素のうち、モデル画像上のメダル領域内の何れかのエッジ画素と一致するものの数が、モデル画像上のメダル領域内の何れのエッジ画素とも一致しないものの数より多いほど高くなる。 When the adjustment of the number of edge pixels in each partial area is completed, the similarity calculation unit 69 aligns the center of the medal area on the model image and the center of the medal area on the edge image. Then, the similarity calculation unit 69 rotates each edge pixel on the edge image by the correction rotation angle with the center of the medal area as the rotation center. Then, the similarity calculation unit 69 calculates a first similarity S1 between the pattern on the surface of the model of the appropriate medal and the pattern on the surface of the identification target medal according to the following equation.
Figure 2016004331
Here, NumC is the number of edge pixels that match the edge pixels of the model image among the edge pixels of the edge image. NumD1 is the number of edge pixels that do not match any edge pixel of the model image among the edge pixels of the edge image. NumD2 is the number of edge pixels that do not match any edge pixel of the edge image among the edge pixels of the model image. That is, the first similarity S1 is the number of edge pixels in the medal area of the identification target image that match any one of the edge pixels in the medal area on the model image. The higher the number of pixels that do not match any of the edge pixels, the higher.

さらに、類似度算出部69は、エッジ画像のメダル領域を、そのメダル領域の中心から放射方向に沿って所定数のリング状の部分領域に分割する。この場合も、類似度算出部69は、個々の分割領域を、モデルエッジ数調整部65におけるリング状の部分領域よりも大きくすることが好ましい。そこで、例えば、類似度算出部69は、個々の部分領域の放射方向の幅を10画素に設定する。そして類似度算出部69は、個々の部分領域について上記と同様の処理を行って各部分領域の面積に占めるエッジ画素の数の比率が所定比率(例えば、0.4)未満となるように、エッジ画素の数を調整する。ただし、エッジ画素の数の調整対象となるのは、円周方向の部分領域ごとのエッジ画素の数が調整される前のエッジ画像である。   Furthermore, the similarity calculation unit 69 divides the medal area of the edge image into a predetermined number of ring-shaped partial areas along the radial direction from the center of the medal area. Also in this case, the similarity calculation unit 69 preferably makes each divided region larger than the ring-shaped partial region in the model edge number adjustment unit 65. Therefore, for example, the similarity calculation unit 69 sets the radial width of each partial region to 10 pixels. Then, the similarity calculation unit 69 performs the same processing as described above for each partial region, so that the ratio of the number of edge pixels to the area of each partial region is less than a predetermined ratio (for example, 0.4). Adjust the number of. However, the adjustment target of the number of edge pixels is an edge image before the number of edge pixels for each partial region in the circumferential direction is adjusted.

類似度算出部69は、各部分領域のエッジ画素の数の調整が終了すると、モデル画像上のメダル領域の中心とエッジ画像上のメダル領域の中心とを位置合わせする。そして類似度算出部69は、エッジ画像上の各エッジ画素を、メダル領域の中心を回転中心として、補正回転角だけ回転させる。そして類似度算出部69は、次式に従って、適正メダルのモデルの表面の模様と識別対象メダルの表面の模様間の第2の類似度S2を算出する。なお、第2の類似度S2も、(2)式に従って算出される。
なお、類似度算出部69は、(2)式の代わりに(1)式を用いて第1の類似度S1及び第2の類似度S2を算出してもよい。
When the adjustment of the number of edge pixels in each partial area is completed, the similarity calculation unit 69 aligns the center of the medal area on the model image and the center of the medal area on the edge image. Then, the similarity calculation unit 69 rotates each edge pixel on the edge image by the correction rotation angle with the center of the medal area as the rotation center. Then, the similarity calculation unit 69 calculates a second similarity S2 between the pattern on the surface of the appropriate medal model and the pattern on the surface of the identification target medal according to the following equation. The second similarity S2 is also calculated according to the equation (2).
The similarity calculation unit 69 may calculate the first similarity S1 and the second similarity S2 using the expression (1) instead of the expression (2).

類似度算出部69は、第1の類似度S1と第2の類似度S2の平均値S(=(S1+S2)/2)を、最終的に得られる適正メダルのモデルの表面の模様と識別対象メダルの表面の模様の類似度とする。あるいは、類似度算出部69は、第1の類似度S1と第2の類似度S2の内の大きい方の値を、最終的に得られる適正メダルのモデルの表面の模様と識別対象メダルの表面の模様の類似度としてもよい。このようにして得られる類似度は、識別対象メダルの個体差に影響を受けるものの、適正メダル及び識別対象メダルの表面の模様が回転対称な模様であっても、両者の類似度合いを表すことができる。
類似度算出部69は、算出した類似度をメモリ52に記憶する。
The similarity calculation unit 69 uses the average value S (= (S1 + S2) / 2) of the first similarity S1 and the second similarity S2 as the surface pattern of the model of the appropriate medal finally obtained. The similarity of the pattern on the surface of the identification target medal. Alternatively, the similarity calculation unit 69 uses the larger one of the first similarity S1 and the second similarity S2 as the surface pattern of the model of the appropriate medal finally obtained and the surface of the identification target medal. It is good also as the similarity of a pattern. Although the degree of similarity obtained in this way is affected by the individual difference of the identification medals, even if the surface pattern of the appropriate medals and the identification medals is a rotationally symmetric pattern, it can represent the degree of similarity between them. it can.
The similarity calculation unit 69 stores the calculated similarity in the memory 52.

判定部70は、向き一致度と類似度に基づいて、識別対象メダルが適正メダルか否かを判定する。本実施形態では、判定部70は、向き一致度に類似度を乗じて得られる値を総合評価点とし、その総合評価点が予め設定された判定閾値以上である場合、識別対象メダルを適正メダルと判定し、一方、その総合評価点が判定閾値未満である場合、識別対象メダルを適正メダルでないと判定する。なお、判定閾値は、例えば、1.0に設定され、予めメモリ52に記憶される。   The determination unit 70 determines whether or not the identification target medal is a proper medal based on the orientation coincidence and the similarity. In the present embodiment, the determination unit 70 uses a value obtained by multiplying the orientation coincidence by the similarity as a total evaluation score, and when the total evaluation score is equal to or higher than a predetermined determination threshold, the identification target medal is determined as a proper medal. On the other hand, if the overall evaluation score is less than the determination threshold, it is determined that the identification target medal is not a proper medal. The determination threshold is set to 1.0, for example, and is stored in the memory 52 in advance.

制御回路51は、メダルが適正メダルか否かの判定結果を、上位の制御装置(図示せず)へ出力する。   The control circuit 51 outputs a determination result as to whether or not the medal is an appropriate medal to a higher-level control device (not shown).

図17及び図18は、制御回路51により実行されるメダル識別処理の動作フローチャートである。制御回路51は、撮像部4から画像を受け取る度に、このメダル識別処理を実行する。   17 and 18 are operation flowcharts of the medal identification process executed by the control circuit 51. FIG. The control circuit 51 executes this medal identification process every time an image is received from the imaging unit 4.

メダル領域検出部61は、識別対象画像からメダル領域を検出する(ステップS301)。形状補正部66は、メダル領域の形状が略円形となり、かつ、メダル領域のサイズがモデル画像上のメダル領域のサイズと略一致するように識別対象画像を補正する(ステップS302)。そしてエッジ検出部62は、識別対象画像のメダル領域内のエッジ画素を検出する(ステップS303)。   The medal area detection unit 61 detects a medal area from the identification target image (step S301). The shape correcting unit 66 corrects the identification target image so that the shape of the medal area is substantially circular and the size of the medal area substantially matches the size of the medal area on the model image (step S302). Then, the edge detection unit 62 detects edge pixels in the medal area of the identification target image (step S303).

エッジ位置補正部67は、識別対象画像のメダル領域の中心と、モデル画像のメダル領域の中心とを位置合わせした状態で、識別対象画像を、メダル領域の中心を回転中心として、所定角度(例えば、1度)ずつ回転させつつ、識別対象画像のメダル領域内のエッジ分布とモデル画像のメダル領域内のエッジ分布が最も一致する識別対象画像の平行移動量を算出する(ステップS304)。そしてエッジ位置補正部67は、識別対象画像のメダル領域内のエッジ分布とモデル画像のメダル領域内のエッジ分布が最も一致するときの回転角度だけ識別対象画像を回転させた上で、その回転角における平行移動量だけ識別対象画像上のメダル領域内の各エッジ画素を平行移動する(ステップS305)。そしてエッジ位置補正部67は、補正後のエッジ画素の位置を極座標で表すエッジ分布情報をメモリ52に記憶する。   The edge position correction unit 67 aligns the center of the medal area of the identification target image and the center of the medal area of the model image with a predetermined angle (for example, with the center of the medal area as the rotation center). , By 1 degree), the parallel movement amount of the identification target image in which the edge distribution in the medal area of the identification target image and the edge distribution in the medal area of the model image most closely match is calculated (step S304). Then, the edge position correcting unit 67 rotates the identification target image by the rotation angle when the edge distribution in the medal area of the identification target image and the edge distribution in the medal area of the model image most closely match, and then rotates the rotation angle. Each edge pixel in the medal area on the identification target image is translated by the translation amount at (step S305). Then, the edge position correction unit 67 stores edge distribution information that represents the corrected position of the edge pixel in polar coordinates in the memory 52.

向き一致度算出部68は、モデル画像上のメダル領域内のエッジ分布と識別対象画像のメダル領域内のエッジ分布とが最も一致するときの識別対象画像の回転角から補正回転角を算出する(ステップS306)。さらに、向き一致度算出部68は、適正メダルのモデルにおける模様の向きと識別対象メダルの模様の向きを一致させたときの一致度と、向きを一致させない時の一致度に基づいて識別対象メダルの向き一致度DMを算出する(ステップS307)。   The orientation coincidence calculation unit 68 calculates a corrected rotation angle from the rotation angle of the identification target image when the edge distribution in the medal region on the model image and the edge distribution in the medal region of the identification target image most closely match ( Step S306). Further, the orientation coincidence calculation unit 68 determines the identification target medal based on the coincidence when the pattern orientation in the appropriate medal model matches the pattern orientation of the identification medal and the coincidence when the orientation does not match. Is calculated (step S307).

図18に示されるように、類似度算出部69は、モデル画像上のメダル領域の中心と識別対象画像上のメダル領域の中心とを位置合わせした上で、得られた回転角だけ識別対象画像を回転させることで、適正メダルのモデルの中心及び向きと識別対象メダルの中心及び向きを一致させる(ステップS308)。そして類似度算出部69は、円周方向に沿って識別対象画像上のメダル領域を複数の部分領域に分割し、各部分領域に含まれるエッジ画素の比率が所定比率未満となるように、部分領域ごとに、エッジ強度の高い画素から順にエッジ画素を選択することで、エッジ画素の数を調整する(ステップS309)。その後、類似度算出部69は、モデル画像上のエッジ画素と識別対象画像上のエッジ画素間で一致するエッジ画素の数と一致しないエッジ画素の数を求めることで第1の類似度S1を算出する(ステップS310)。   As shown in FIG. 18, the similarity calculation unit 69 aligns the center of the medal area on the model image with the center of the medal area on the identification target image, and then identifies the identification target image by the obtained rotation angle. Is rotated to match the center and orientation of the model of the appropriate medal with the center and orientation of the identification target medal (step S308). Then, the similarity calculation unit 69 divides the medal area on the identification target image into a plurality of partial areas along the circumferential direction, so that the ratio of the edge pixels included in each partial area is less than a predetermined ratio. For each region, the number of edge pixels is adjusted by selecting edge pixels in order from the pixel with the highest edge strength (step S309). Thereafter, the similarity calculation unit 69 calculates the first similarity S1 by calculating the number of edge pixels that do not match the number of edge pixels that match between the edge pixels on the model image and the edge pixels on the identification target image. (Step S310).

また、類似度算出部69は、メダル領域の中心からの放射方向に沿って識別対象画像上のメダル領域を複数の部分領域に分割し、各部分領域に含まれるエッジ画素の比率が所定比率未満となるように、部分領域ごとに、エッジ強度の高い画素から順にエッジ画素を選択することで、エッジ画素の数を調整する(ステップS311)。その後、類似度算出部69は、モデル画像上のエッジ画素と識別対象画像上のエッジ画素間で一致するエッジ画素の数と一致しないエッジ画素の数を求めることで第2の類似度S2を算出する(ステップS312)。類似度算出部69は、第1の類似度S1と第2の類似度S2の平均値を類似度Sとして算出する(ステップS313)。   The similarity calculation unit 69 divides the medal area on the identification target image into a plurality of partial areas along the radial direction from the center of the medal area, and the ratio of the edge pixels included in each partial area is less than a predetermined ratio. For each partial region, the number of edge pixels is adjusted by selecting edge pixels in order from the pixel with the highest edge strength (step S311). Thereafter, the similarity calculation unit 69 calculates the second similarity S2 by obtaining the number of edge pixels that do not match the number of edge pixels that match between the edge pixels on the model image and the edge pixels on the identification target image. (Step S312). The similarity calculation unit 69 calculates the average value of the first similarity S1 and the second similarity S2 as the similarity S (step S313).

判定部70は、向き一致度DMに類似度Sを乗じた値を総合評価点Tとして算出する(ステップS314)。そして判定部70は、総合評価点Tが判定閾値ThD以上か否か判定する(ステップS315)。総合評価点Tが判定閾値ThD以上である場合(ステップS315−Yes)、判定部70は、識別対象メダルを適正メダルと判定し、その旨を表す通知信号を上位制御装置へ出力する(ステップS316)。一方、総合評価点Tが判定閾値ThD未満である場合(ステップS315−No)、判定部70は、識別対象メダルを適正メダルでないと判定し、その旨を表す通知信号を上位制御装置へ出力する(ステップS317)。
ステップS316またはS317の後、制御回路51は、メダル識別処理を終了する。
The determination unit 70 calculates a value obtained by multiplying the degree of coincidence DM by the similarity S as the overall evaluation score T (step S314). Then, the determination unit 70 determines whether or not the overall evaluation score T is equal to or greater than a determination threshold ThD (step S315). When the total evaluation score T is equal to or greater than the determination threshold ThD (step S315—Yes), the determination unit 70 determines that the identification target medal is an appropriate medal and outputs a notification signal indicating that to the upper control device (step S316). ). On the other hand, when the comprehensive evaluation score T is less than the determination threshold ThD (step S315-No), the determination unit 70 determines that the identification target medal is not an appropriate medal, and outputs a notification signal indicating that fact to the host controller. (Step S317).
After step S316 or S317, the control circuit 51 ends the medal identification process.

以上に説明してきたように、このメダル識別装置は、メダル識別装置に投入された識別対象メダルを撮影して得られる画像から検出したそのメダルの表面の模様と予め作成された適正メダルのモデルの表面の模様との類似度を算出し、その類似度に基づいて識別対象メダルが適正メダルか否かを判定する。その際、このメダル識別装置は、識別対象画像のメダル領域を分割した複数の部分領域ごとに、模様のエッジに相当するエッジ画素の数を調整してメダル領域内でエッジ画素の数を均等化してから、エッジ画素の一致不一致により類似度を算出する。これにより、識別対象のメダルの表面の一部の疵などがエッジ画素として検出されたとしても、疵が無い部分に影響しないので、その疵などによる類似度への影響が抑制される。そのため、このメダル識別装置は、疵などによるメダルの個体差があっても、正確に識別対象メダルが適正メダルか否かを判定できる。さらに、このメダル識別装置は、互いに異なる複数の分割方法のそれぞれに従って部分領域を設定し、分割方法ごとにエッジ画素の数の調整と類似度の算出を行うので、疵などに影響される部分領域の数が比較的少ない分割方法に基づいて得られた類似度を利用してメダルの識別を行うことができるので、疵などによるメダルの個体差による識別精度の低下を抑制できる。   As described above, this medal identification device has a pattern of the surface of the medal detected from an image obtained by photographing an identification target medal inserted in the medal identification device and a model of a proper medal created in advance. The similarity with the surface pattern is calculated, and it is determined whether or not the identification target medal is an appropriate medal based on the similarity. At this time, this medal identification device equalizes the number of edge pixels in the medal area by adjusting the number of edge pixels corresponding to the edge of the pattern for each of the plurality of partial areas obtained by dividing the medal area of the identification target image. After that, the similarity is calculated based on the coincidence / non-coincidence of the edge pixels. Thus, even if a part of the surface of the identification target medal is detected as an edge pixel, it does not affect the part without the surface, so that the influence on the similarity due to the surface of the medal is suppressed. Therefore, this medal identification device can accurately determine whether or not the identification target medal is an appropriate medal even if there is an individual difference of medals due to a spear or the like. Furthermore, since this medal identification device sets partial areas according to each of a plurality of different division methods and adjusts the number of edge pixels and calculates the similarity for each division method, the partial areas affected by wrinkles and the like Since the medal can be identified by using the similarity obtained based on the division method having a relatively small number, the degradation of the identification accuracy due to individual differences of medals due to a bag or the like can be suppressed.

なお、本発明は、上記の実施形態に限定されない。例えば、適正メダルの一方の面の模様と他方の面の模様が異なることがある。このような場合、メダル識別装置は、メダルの面ごとに、上記のモデル登録処理を実行することで、メダルの面ごとにモデル画像を生成し、メモリに記憶させてもよい。そしてメダル識別装置は、モデル画像ごとに、上記のメダル識別処理を実行し、何れか一方のモデル画像について識別対象メダルが適正メダルとの判定結果が得られれば、識別対象メダルが適正メダルであると判定してもよい。   In addition, this invention is not limited to said embodiment. For example, the pattern on one side of the appropriate medal may be different from the pattern on the other side. In such a case, the medal identification device may generate the model image for each face of the medal and store it in the memory by executing the above model registration process for each face of the medal. Then, the medal identification device executes the above-described medal identification processing for each model image, and if the determination result that the identification target medal is a proper medal is obtained for any one of the model images, the identification target medal is a proper medal. May be determined.

同様に、異なる種別の複数のメダルが利用されることがある。このような場合、メダル識別装置は、メダルの種別ごとに、上記のモデル登録処理を実行することで、メダルの種別ごとにモデル画像を生成し、メモリに記憶させてもよい。そしてメダル識別装置は、モデル画像ごとに、上記のメダル識別処理を実行し、何れか一つのモデル画像について識別対象メダルが適正メダルとの判定結果が得られれば、識別対象メダルは、そのモデル画像に表された種別のメダルであると判定し、上位制御装置へ、そのメダルの種別を表す通知信号を出力してもよい。一方、このメダル識別装置は、何れのモデル画像についても、識別対象メダルが適正メダルでないと判定されれば、識別対象メダルは適正メダルでないとの判定結果を表す通知信号を上位制御装置へ出力すればよい。   Similarly, a plurality of medals of different types may be used. In such a case, the medal identification device may generate a model image for each medal type and store the model image in the memory by executing the model registration process for each medal type. Then, the medal identification device performs the above-described medal identification process for each model image, and if the identification target medal is determined to be an appropriate medal for any one model image, the identification target medal is the model image. It may be determined that the medal is of the type shown in the above, and a notification signal indicating the type of the medal may be output to the host control device. On the other hand, if it is determined that the identification target medal is not a proper medal for any model image, this medal identification device outputs a notification signal indicating the determination result that the identification target medal is not a proper medal to the host controller. That's fine.

また他の変形例によれば、各サンプル画像に対して形状補正部66の処理が行われてもよい。あるいは、通路内でのメダルの傾き及び撮像部4からメダルまでの距離のバラツキが無視できる程度であれば、形状補正部66の処理は省略されてもよい。   According to another modification, the processing of the shape correction unit 66 may be performed on each sample image. Alternatively, the processing of the shape correction unit 66 may be omitted as long as the inclination of the medal in the passage and the variation in the distance from the imaging unit 4 to the medal are negligible.

さらに他の変形例によれば、適正メダルの表面の模様が回転対称である場合には、判定部は、類似度そのものを、総合評価値としてもよい。この場合には、向き一致度を算出する必要が無く、また、類似度の算出の際も、識別対象画像のメダル領域の中心とモデル画像のメダル領域の中心との位置合わせだけができればよく、模様の向きを合わせる必要が無いので、向き一致度算出部68の処理は省略されてもよい。   According to still another modified example, when the pattern on the surface of the appropriate medal is rotationally symmetric, the determination unit may use the similarity itself as the comprehensive evaluation value. In this case, it is not necessary to calculate the orientation coincidence, and it is only necessary to align the center of the medal area of the identification target image and the center of the medal area of the model image when calculating the similarity, Since there is no need to match the orientation of the pattern, the processing of the orientation coincidence calculation unit 68 may be omitted.

さらに他の変形例によれば、類似度算出部69は、何れか一つの分割方法に従って、識別対象画像に対応するエッジ画像のメダル領域を複数の部分領域に分割して、各部分領域のエッジ画素を、上記の例のように選択した上で類似度を算出してもよい。また類似度算出部69は、上記の分割方法とは異なる分割方法にしたがって、エッジ画像のメダル領域を複数の部分領域に分割してもよい。例えば、類似度算出部69は、エッジ画像のメダル領域を、碁盤目状、あるいは、短冊状の複数の部分領域に分割してもよい。   According to another modification, the similarity calculation unit 69 divides the medal area of the edge image corresponding to the identification target image into a plurality of partial areas according to any one of the division methods, and the edge of each partial area. The similarity may be calculated after selecting the pixels as in the above example. The similarity calculation unit 69 may divide the medal area of the edge image into a plurality of partial areas according to a division method different from the above division method. For example, the similarity calculation unit 69 may divide the medal area of the edge image into a plurality of partial areas having a grid shape or a strip shape.

さらに他の変形例によれば、モデル登録処理は、メダル識別装置と異なる装置において実行され、最終的に得られたモデル画像がメダル識別装置のメモリに保存されてもよい。この場合、例えば、制御回路51は、撮像部4によりサンプル画像が生成される度に、そのサンプル画像を通信インターフェース53を介してモデル登録処理を実行する装置へ出力する。   According to still another modification, the model registration process may be executed in a device different from the medal identification device, and the finally obtained model image may be stored in the memory of the medal identification device. In this case, for example, every time a sample image is generated by the imaging unit 4, the control circuit 51 outputs the sample image to a device that executes a model registration process via the communication interface 53.

モデル登録処理を実行する装置は、例えば、コンピュータのように、プロセッサと、メモリ回路と、メダル識別装置と接続するための通信インターフェースとを有する。そしてその装置のプロセッサは、制御回路51が有する各部のうち、モデル登録処理で利用される各部の処理を実行する。そしてその装置がモデル登録処理を実行してモデル画像を生成すると、メダル識別装置の制御回路51は、通信インターフェース53を介してその装置からモデル画像を受け取って、メモリ52にそのモデル画像を保存する。
この変形例では、メモリ52に多数のサンプル画像を記憶しなくてよいので、メモリ52のメモリ容量を削減できる。
A device that executes the model registration process includes a processor, a memory circuit, and a communication interface for connecting to a medal identification device, for example, like a computer. And the processor of the apparatus performs the process of each part utilized by the model registration process among each part which the control circuit 51 has. When the device executes model registration processing to generate a model image, the control circuit 51 of the medal identification device receives the model image from the device via the communication interface 53 and stores the model image in the memory 52. .
In this modification, since it is not necessary to store many sample images in the memory 52, the memory capacity of the memory 52 can be reduced.

図19は、本発明の実施形態または変形例によるメダル識別装置を備えた回胴遊技機100の概略斜視図である。また図20は、前面パネルを開いた状態における、回胴遊技機100の概略斜視図である。そして図21は、回胴遊技機100の回路ブロック図である。図19及び図20に示すように、回胴遊技機100は、遊技機本体である本体筐体101と、ドラム102a〜102cと、スタートレバー103と、ストップボタン104a〜104cと、前面パネル105とを有する。
また回胴遊技機100は、本体筐体101内に、前面パネル105の背面側に取り付けられたメダル識別装置106と、各種の制御回路などが収容された制御ボックス107と、主制御回路110からの制御信号に応じてメダルを一時貯留し、かつメダルを排出するためのメダル貯留・排出機構108を有する。
そして図21に示されるように、制御ボックス107内には、例えば、回胴遊技機100全体を制御する主制御回路110と、遊技の演出に関連する各部を制御する演出用制御回路111と、回胴遊技機100の各部に電力を供給する電源回路112などが収容されている。
FIG. 19 is a schematic perspective view of a spinning game machine 100 including a medal identification device according to an embodiment or a modification of the present invention. FIG. 20 is a schematic perspective view of the spinning machine 100 with the front panel opened. FIG. 21 is a circuit block diagram of the spinning cylinder game machine 100. As shown in FIGS. 19 and 20, the spinning machine 100 includes a main body housing 101 that is a gaming machine body, drums 102 a to 102 c, a start lever 103, stop buttons 104 a to 104 c, and a front panel 105. Have
The spinning machine 100 includes a medal identification device 106 attached to the back side of the front panel 105, a control box 107 in which various control circuits are accommodated, and a main control circuit 110. In response to the control signal, a medal storage / discharge mechanism 108 is provided for temporarily storing medals and discharging medals.
As shown in FIG. 21, in the control box 107, for example, a main control circuit 110 that controls the entire spinning game machine 100, an effect control circuit 111 that controls each part related to the effect of the game, A power supply circuit 112 that supplies power to each part of the spinning machine 100 is accommodated.

前面パネル105の前面の中央上部には開口105aが形成されており、その開口105aを通じて、ドラム102a〜102cが視認可能になっている。また開口105aの下側の枠105bの上面には、メダルを投入するための開口105cが形成されており、この開口105cとメダル識別装置106の上面に設けられたメダル投入口とが一致するように、メダル識別装置106が配置されている。なお、メダル識別装置106のメダル排出口は、メダル貯留・排出機構108と接続されており、メダル識別装置106から排出されたメダルは、メダル貯留・排出機構108に回収される。   An opening 105a is formed at the upper center of the front surface of the front panel 105, and the drums 102a to 102c are visible through the opening 105a. An opening 105c for inserting medals is formed on the upper surface of the frame 105b on the lower side of the opening 105a. The opening 105c and the medal insertion slot provided on the upper surface of the medal identification device 106 coincide with each other. In addition, a medal identification device 106 is arranged. The medal discharge port of the medal identification device 106 is connected to the medal storage / discharge mechanism 108, and medals discharged from the medal identification device 106 are collected by the medal storage / discharge mechanism 108.

前面パネル105の下部には、下パネルとして、複数の発光ダイオードを含む装飾装置が設けられていてもよい。さらに、装飾装置の下方において、前面パネル105には、メダルを排出するためのメダル排出口105dが形成されている。そしてメダル排出口105dの下方には、排出されたメダルが落下することを防止するためのメダル受け皿105eが取り付けられている。また前面パネル105の左上端近傍及び右上端近傍にはスピーカ(図示せず)が取り付けられてもよい。   A decoration device including a plurality of light emitting diodes may be provided as a lower panel below the front panel 105. Further, a medal discharge port 105d for discharging medals is formed in the front panel 105 below the decoration device. A medal tray 105e for preventing the discharged medal from falling is attached below the medal discharge port 105d. A speaker (not shown) may be attached near the upper left end and near the upper right end of the front panel 105.

ドラム102a〜102cは、演出用制御回路111からの制御信号に応じて、本体筐体101の前面に対して略平行かつ略水平な回転軸(図示せず)を回転中心として、それぞれ、別個に回転可能となっている。各ドラム102a〜102cの表面は、それぞれ、回転方向に沿って複数の略同一幅を持つ領域に区切られ、領域ごとに様々な図柄が描かれている。なお、ドラム102a〜102cの代わりに、液晶ディスプレイなどの表示装置が、その表示画面が開口105aを介して視認可能なように設けられてもよい。この場合、表示装置は、演出用制御回路111からの制御信号に応じて、複数のドラムを模擬的に示した画像を表示画面に表示させる。
スタートレバー103は、前面パネル105の枠105bの前面に向かって左側に設けられている。また、枠105bの前面略中央には、ストップボタン104a〜104cが設けられている。ストップボタン104a〜104cは、それぞれ、ドラム102a〜102cに対応する。
The drums 102a to 102c are individually separated around a rotation axis (not shown) that is substantially parallel and substantially horizontal to the front surface of the main body housing 101 in accordance with a control signal from the effect control circuit 111. It can be rotated. The surfaces of the drums 102a to 102c are each divided into a plurality of regions having substantially the same width along the rotation direction, and various designs are drawn for each region. Instead of the drums 102a to 102c, a display device such as a liquid crystal display may be provided so that the display screen can be viewed through the opening 105a. In this case, the display device displays an image showing a plurality of drums on the display screen in response to the control signal from the effect control circuit 111.
The start lever 103 is provided on the left side toward the front surface of the frame 105 b of the front panel 105. Further, stop buttons 104a to 104c are provided substantially at the front center of the frame 105b. The stop buttons 104a to 104c correspond to the drums 102a to 102c, respectively.

メダル識別装置106は、上記の実施形態または変形例によるメダル識別装置である。そしてメダルが開口105cを通じてメダル識別装置106のメダル投入口に投入されると、メダル識別装置106は、投入されたメダルが適正メダルか否か判定し、その判定結果を表す通知信号を主制御回路110へ出力する。そして主制御回路110は、投入されたメダルが適正メダルであれば、そのメダルに応じて遊技の回数などを決定し、回胴遊技機100が遊技を開始することを許可する。その後に、スタートレバー103が操作されると、スタートレバー103が操作されたことを示す信号が主制御回路110へ伝達される。そして主制御回路110は、演出用制御回路111に、ドラム102a〜102cの回転を開始させる。また演出用制御回路111は、ドラム102a〜102cの回転中、遊技者の興趣を高めるために、ドラム102a〜102cが停止しているときとは異なる効果音をスピーカを通じて出力させたり、装飾装置の発光ダイオードを明滅させたりしてもよい。   The medal identification device 106 is a medal identification device according to the above-described embodiment or modification. When the medal is inserted into the medal insertion slot of the medal identification device 106 through the opening 105c, the medal identification device 106 determines whether the inserted medal is an appropriate medal and sends a notification signal indicating the determination result to the main control circuit. To 110. Then, if the inserted medal is an appropriate medal, the main control circuit 110 determines the number of games according to the medal and permits the spinning machine 100 to start the game. Thereafter, when the start lever 103 is operated, a signal indicating that the start lever 103 has been operated is transmitted to the main control circuit 110. Then, the main control circuit 110 causes the effect control circuit 111 to start rotating the drums 102a to 102c. Further, the production control circuit 111 outputs a sound effect different from that when the drums 102a to 102c are stopped through the speaker in order to enhance the player's interest during the rotation of the drums 102a to 102c. The light emitting diode may be blinked.

その後、ストップボタン104a〜104cの何れかが押下されると、主制御回路110は、その押下されたスイッチから押下されたことを示す信号を受信し、その押下されたスイッチに対応するドラムの回転を演出用制御回路111を介して停止させる。あるいは、主制御回路110は、ドラム102a〜102cのうち、回転を開始してから所定期間が経過するまでに、対応するストップボタンが押下されなかったドラムを、その所定期間経過後に、演出用制御回路111を介して停止させる。
そして全てのドラムが停止した時点で、同一の図柄が全てのドラムにわたって一列に並んでいると、主制御回路110は、その図柄に応じた所定枚数のメダルをメダル排出口を通じて排出する。またこの場合、演出用制御回路111は、ドラムの回転時及び同一の図柄が全てのドラムにわたって一列に並ばなかったときとは異なる効果音をスピーカを介して出力し、装飾装置の発光ダイオードをその最大輝度で点灯させてもよい。
Thereafter, when any one of the stop buttons 104a to 104c is pressed, the main control circuit 110 receives a signal indicating that the button is pressed from the pressed switch, and rotates the drum corresponding to the pressed switch. Is stopped via the production control circuit 111. Alternatively, the main control circuit 110 controls the drum 102a to 102c for which the corresponding stop button has not been pressed until the predetermined period elapses after the rotation starts, after the predetermined period elapses. Stop via the circuit 111.
When all the drums are stopped and the same symbols are arranged in a line across all the drums, the main control circuit 110 discharges a predetermined number of medals corresponding to the symbols through the medal discharge port. Further, in this case, the production control circuit 111 outputs a sound effect different from that when the drum is rotated and when the same design is not aligned in a line across all the drums, and the light emitting diode of the decoration device is output from the speaker. It may be lit at maximum brightness.

一方、メダル識別装置106から通知された判定結果が、投入されたメダルが不適正メダルであることを示していれば、主制御回路110は、例えば、回胴遊技機100が設置されたホールの管理システムへ、回胴遊技機100の識別番号とともに、その旨を通知する。また主制御回路110は、不適正メダルと判定されたメダルを、メダル貯留・排出機構108を介して排出してもよい。   On the other hand, if the determination result notified from the medal identification device 106 indicates that the inserted medal is an improper medal, the main control circuit 110, for example, in the hall where the spinning machine 100 is installed. This is notified to the management system together with the identification number of the spinning machine 100. Further, the main control circuit 110 may discharge medals determined to be inappropriate medals via the medal storage / discharge mechanism 108.

また、本発明によるメダル識別装置は、投入されたメダルを識別することが求められる様々な装置に適用できる。例えば、本発明によるメダル識別装置は、メダルの獲得数を計数するために用いられるメダル計数装置として実装されてもよい。   The medal identification device according to the present invention can be applied to various devices that are required to identify inserted medals. For example, the medal identification device according to the present invention may be implemented as a medal counting device used for counting the number of acquired medals.

図22は、メダル計数装置200の外観斜視図であり、図23は、メダル計数装置200の上面カバーを外した状態の斜視図である。図24は、搬送部201の立体図であり、図25は、搬送部201の平面図であり、図26は、ガイド近傍におけるメダルを搬送する際の動作を説明する図であり、図27は、搬送部201の分解図である。   22 is an external perspective view of the medal counting device 200, and FIG. 23 is a perspective view of the medal counting device 200 with the top cover removed. FIG. 24 is a three-dimensional view of the transport unit 201, FIG. 25 is a plan view of the transport unit 201, FIG. 26 is a diagram illustrating an operation when a medal is transported in the vicinity of the guide, and FIG. FIG. 4 is an exploded view of a transport unit 201.

メダル計数装置200は、正面左側に、開口部202が設けられており、開口部202からメダルが投入可能となっている。開口部202の底面部には、搬送部201が設けられている。搬送部201は、通路形成部の一例であり、投入されたメダルを物理的に計数するために、ガイド部224及び排出部222等から構成されるメダルの通路に沿って、投入されたメダルを撮像部226の撮影範囲を通るように流下させる。   The medal counting device 200 is provided with an opening 202 on the left side of the front, and a medal can be inserted through the opening 202. A transport unit 201 is provided on the bottom surface of the opening 202. The transport unit 201 is an example of a passage forming unit, and in order to physically count inserted medals, the inserted medals are arranged along a medal path including a guide unit 224, a discharge unit 222, and the like. It flows down through the imaging range of the imaging unit 226.

表示部203は、例えば、液晶ディスプレイを有し、メダルの計数結果などを表示する。印字部204は、メダルの計数結果をレシートなどの紙に印刷し、その係数結果が印刷された紙を出力する。操作部205は、ボタンなどを有し、メダルの計数を開始するとき、または計数を終了するときなどに操作され、操作内容に対応した操作信号を生成して、制御部へ供給する。   The display unit 203 includes, for example, a liquid crystal display and displays a medal counting result. The printing unit 204 prints the medal counting result on a paper such as a receipt, and outputs the paper on which the coefficient result is printed. The operation unit 205 has buttons and the like, and is operated when counting of medals is started or when counting is ended. The operation unit 205 generates an operation signal corresponding to the operation content and supplies the operation signal to the control unit.

搬送部201の分離部211は、円筒状の淵211a内に設けられた円盤上の底部が、図25で示される矢印方向に回転することにより、投入された複数のメダル221を遠心力で外周部に移動させ、淵211aに引き付けられるように挙動させる。この動作により、メダル231は、ある程度固まった状態、すなわち、集合状態であっても、個々に別れて淵211aに引き付けられるように挙動することから、個別に分離されていく。また、投入されたメダル231は、淵211aに引き付けられ当接されると、分離部211の回転により図25で示される矢印方向に淵211a上を移動する。さらに、淵211a上を移動するメダル231は、図25の下部で示されるように分離部211の円盤の接線方向に設けられた開口部より、誘導部212を経てガイド部224に搬送される。   The separation unit 211 of the transport unit 201 is configured such that the bottom of the disk provided in the cylindrical basket 211a rotates in the direction of the arrow shown in FIG. To be moved so as to be attracted to the basket 211a. By this operation, even if the medals 231 are solidified to some extent, that is, in a collective state, the medals 231 behave individually so as to be attracted to the basket 211a, and thus are separated individually. In addition, when the inserted medal 231 is attracted to and brought into contact with the basket 211a, it moves on the basket 211a in the arrow direction shown in FIG. Further, the medal 231 moving on the basket 211a is conveyed to the guide part 224 through the guide part 212 from the opening provided in the tangential direction of the disk of the separation part 211 as shown in the lower part of FIG.

図26に示されるように、搬送プレート221上に設けられたガイド部224は、U字型のプレート状に形成されており、U字の開口部から穴部223までのメダルの通路を形成する。ガイド部224の開口部の幅は、メダル231の直径とほぼ等しく、ガイド部224は、メダル231を穴部223に誘導する。誘導部212を経て誘導されてきたメダル231は、図26に示されるように、ガイド部224を経て、メダル231の直径と略同径の穴部223より蓄積ディスク251(図27)に供給される。   As shown in FIG. 26, the guide portion 224 provided on the transport plate 221 is formed in a U-shaped plate shape, and forms a medal passage from the U-shaped opening to the hole 223. . The width of the opening of the guide part 224 is substantially equal to the diameter of the medal 231, and the guide part 224 guides the medal 231 to the hole part 223. As shown in FIG. 26, the medal 231 guided through the guiding portion 212 is supplied to the storage disk 251 (FIG. 27) through the guide portion 224 and the hole portion 223 having a diameter substantially equal to the diameter of the medal 231. The

図27に示されるように、蓄積ディスク251には、メダル231と略同形の複数の穴部251e〜251hが形成されている。蓄積ディスク251は、4枚のメダル231をそれぞれの穴部に蓄積した後、各メダル231を排出ディスク253のくぼみ253eから253hに装填する。排出ディスク253は、装填された4枚のメダル231を所定の間隔で排出部222から排出する。排出部222には、近接センサであるセンサ225と、撮像部226と、光源227とが設けられている。センサ225がメダル231の通過を検出すると、対応する検出信号を発生して後述する制御部261(図29)へ出力する。制御部261は、センサ225よりもメダルの通路の下流側をその撮影範囲とする撮像部226に、光源227により照明されたメダル231を撮影させる。そして撮像部226は、メダル231が写った画像を制御部261へ出力する。   As shown in FIG. 27, the storage disk 251 has a plurality of holes 251 e to 251 h that are substantially the same shape as the medal 231. The storage disk 251 stores the four medals 231 in the respective holes, and then loads the medals 231 into the recesses 253e to 253h of the discharge disk 253. The discharge disk 253 discharges the loaded four medals 231 from the discharge unit 222 at a predetermined interval. The discharge unit 222 is provided with a sensor 225 that is a proximity sensor, an imaging unit 226, and a light source 227. When the sensor 225 detects the passage of the medal 231, a corresponding detection signal is generated and output to the control unit 261 (FIG. 29) described later. The control unit 261 causes the image pickup unit 226 whose shooting range is the downstream side of the medal path from the sensor 225 to photograph the medal 231 illuminated by the light source 227. Then, the imaging unit 226 outputs an image showing the medal 231 to the control unit 261.

搬送プレート221の穴部221a、蓄積ディスク251の中心に形成された穴部251i、および排出ディスク253の中心に形成された穴部253iは、同軸であり、シャフト259が貫通している。シャフト259は、ベルト260を介してモータ257のトルクを排出ディスク253に伝達する。そのため、シャフト259より伝達されるトルクにより排出ディスク253は、図27の矢印方向に所定の回転速度で回転する。   The hole 221 a of the transport plate 221, the hole 251 i formed at the center of the storage disk 251, and the hole 253 i formed at the center of the discharge disk 253 are coaxial, and the shaft 259 passes therethrough. The shaft 259 transmits the torque of the motor 257 to the discharge disk 253 via the belt 260. Therefore, the discharge disk 253 rotates at a predetermined rotational speed in the direction of the arrow in FIG. 27 by the torque transmitted from the shaft 259.

このとき、蓄積ディスク251にメダル231が4枚全てが蓄積されていない場合、蓄積ディスク251と排出ディスク253とは、相互に重なり合った状態で排出ストッパピン258により係合されているため、排出ディスク253の回転に伴って蓄積ディスク251も回転する。   At this time, if all four medals 231 are not accumulated on the accumulation disk 251, the accumulation disk 251 and the ejection disk 253 are engaged with each other by the ejection stopper pin 258 in a state of being overlapped with each other. With the rotation of 253, the storage disk 251 also rotates.

上述したように、蓄積ディスク251には、メダル231と略同形の穴部251e〜251hが等間隔に形成されている。さらに、排出ディスク253には、メダル231を装填可能な、くぼみ253e〜253hが等間隔に形成されている。そしてストッパピン252−1〜252−4により蓄積ディスク251および排出ディスク253が係合されている状態において、この穴部251e〜251hと、くぼみ253e〜253hとは、位相の異なる状態で係合された状態となっている。したがって、穴部223よりメダル231が投入されると、メダル231は、排出ディスク253により落下が停止され、蓄積ディスク251の穴部251e〜251hにより固定され、穴部251e〜251hに蓄積されることになる。   As described above, the storage disk 251 has the holes 251e to 251h that are substantially the same shape as the medal 231 at equal intervals. In addition, the discharge disc 253 is formed with indentations 253e to 253h at equal intervals in which medals 231 can be loaded. When the storage disk 251 and the discharge disk 253 are engaged by the stopper pins 252-1 to 252-4, the holes 251e to 251h and the recesses 253e to 253h are engaged with each other in different phases. It is in the state. Accordingly, when the medal 231 is inserted from the hole 223, the medal 231 is stopped by the discharge disk 253, fixed by the holes 251e to 251h of the storage disk 251, and accumulated in the holes 251e to 251h. become.

また、ストッパピン252−1〜252−4は、蓄積ディスク251側および排出ディスク253側のそれぞれに分割可能な構成とされている。より詳細には、図28で示されるように、ストッパピン252は、上部ストッパピン252aおよび下部ストッパピン252bから構成される。また、上部ストッパピン252aおよび下部ストッパピン252bが収納される穴部253a〜253dの底部253a’〜253d’には、バネまたはスプリングなどの弾性体(図示せず)が設けられ、上方向に反発力を与えるようになっている。底部253a’は(図28では、底部253a’について示されているが、底部253b’〜253d’についても同様)、上部よりメダル231が落下してくると、メダル231の重みにより、弾性体の反発力が打ち負かされて上部ストッパピン252aおよび下部ストッパピン252bが、底部253a’を押圧することにより、図中の右部の底部253a’’で示されるように下方向にスライドし、それぞれ穴部251a〜251dおよび穴部253a〜253dに内挿される。   Further, the stopper pins 252-1 to 252-4 can be divided into the storage disk 251 side and the discharge disk 253 side, respectively. More specifically, as shown in FIG. 28, the stopper pin 252 includes an upper stopper pin 252a and a lower stopper pin 252b. The bottom portions 253a ′ to 253d ′ of the holes 253a to 253d in which the upper stopper pin 252a and the lower stopper pin 252b are accommodated are provided with an elastic body (not shown) such as a spring or a spring so as to repel upward. It comes to give power. The bottom portion 253a ′ (shown for the bottom portion 253a ′ in FIG. 28 is the same for the bottom portions 253b ′ to 253d ′). When the medal 231 falls from the top, the weight of the medal 231 causes the elastic body When the repulsive force is defeated, the upper stopper pin 252a and the lower stopper pin 252b slide downward as shown by the right bottom 253a '' in the drawing by pressing the bottom 253a ′, The holes 251a to 251d and the holes 253a to 253d are inserted.

このとき、上部ストッパピン252aおよび下部ストッパピン252bは、それぞれ長さが蓄積ディスク251および排出ディスク253の厚さと略同一であるため、搬送プレート221、蓄積ディスク251および排出ディスク253が順次積み重ねられた状態では、それぞれ蓄積ディスク251および排出ディスク253の穴部251a〜251dおよび穴部253a〜253dに収納された状態となる。結果として、蓄積ディスク251および排出ディスク253の係合状態が解除される。   At this time, the lengths of the upper stopper pin 252a and the lower stopper pin 252b are substantially the same as the thicknesses of the storage disk 251 and the discharge disk 253, respectively, so that the transport plate 221, the storage disk 251 and the discharge disk 253 are sequentially stacked. In the state, the storage disk 251 and the discharge disk 253 are respectively housed in the holes 251a to 251d and the holes 253a to 253d. As a result, the engagement state of the storage disk 251 and the discharge disk 253 is released.

すなわち、ストッパピン252は、蓄積ディスク251および排出ディスク253が回転し、穴部223の範囲内に移動してくると、図28の左部で示されるように、搬送プレート221および排出ディスク253により上下から付勢された状態より開放されることにより、凸部252a’が、穴部223内で飛び出した状態となるため、搬送プレート221と蓄積ディスク251とを係止させる。さらに、このとき、下部ストッパピン252bが蓄積ディスク251および排出ディスク253を係止し、蓄積ディスク251および排出ディスク253の回転が停止される。   That is, when the storage disk 251 and the discharge disk 253 rotate and move into the range of the hole 223, the stopper pin 252 is moved by the transport plate 221 and the discharge disk 253 as shown in the left part of FIG. By releasing from the state of being biased from above and below, the convex portion 252a ′ protrudes out of the hole portion 223, so that the transport plate 221 and the storage disk 251 are locked. Further, at this time, the lower stopper pin 252b locks the storage disk 251 and the discharge disk 253, and the rotation of the storage disk 251 and the discharge disk 253 is stopped.

また、この状態で、メダル231が、穴部223に挿入されると、図28の右部で示されるように、メダル231によりストッパピン252が上部より押圧されることにより、上部ストッパピン252aおよび下部ストッパピン252bが底部253a’を押圧し、底部253a’’で示されるように下方向にスライドされることにより、それぞれ穴部251a〜251dおよび穴部253a〜253dに収納される。   Further, in this state, when the medal 231 is inserted into the hole 223, the stopper pin 252 is pressed from above by the medal 231 as shown in the right part of FIG. The lower stopper pin 252b presses the bottom 253a ′ and is slid downward as indicated by the bottom 253a ″, so that it is accommodated in the holes 251a to 251d and the holes 253a to 253d, respectively.

したがって、ガイド部224によりメダル231が誘導されて、順次穴部223に挿入されると、例えば、蓄積ディスク251の穴部251eに蓄積される。このときストッパピン252が搬送プレート221に係止された状態から開放されることになるので、蓄積ディスク251は排出プレート253と供に回転を始める。そして、略45°の角度で回転したところで、メダル231が蓄積されていない、穴部251eの隣に配置されている穴部251fが穴部223と重なる位置で、再びストッパピン252により回転が停止する。   Therefore, when the medal 231 is guided by the guide portion 224 and sequentially inserted into the hole portion 223, for example, it is accumulated in the hole portion 251e of the accumulation disk 251. At this time, the stopper pin 252 is released from the state where it is locked to the transport plate 221, so that the storage disk 251 starts rotating together with the discharge plate 253. Then, when rotated at an angle of approximately 45 °, the rotation is stopped again by the stopper pin 252 at the position where the hole 251f arranged next to the hole 251e where the medal 231 is not accumulated overlaps the hole 223. To do.

さらに、次のメダル231が穴部223より挿入されると、穴部251fに蓄積されることになり、蓄積ディスク251および排出ディスク253は、回転を開始する。以上のような動作が、メダル231が穴部223に挿入される度に連続して4回繰り返される。   Further, when the next medal 231 is inserted from the hole 223, it is accumulated in the hole 251f, and the accumulation disk 251 and the discharge disk 253 start rotating. The above operation is repeated four times continuously every time the medal 231 is inserted into the hole 223.

排出ディスク253には、排出ストッパピン258が設けられている。排出ストッパピン258は、4枚目のメダル231が蓄積される蓄積ディスク251の穴部251hを係止する凸部258bと、排出ディスク253のくぼみ253hとを係止する凸部258aからなるコの字型のピンであり、それぞれを係止することで蓄積ディスク251と排出ディスク253とを係合している。この排出ストッパピン258は、4枚目のメダル231が蓄積ディスク251の穴部251hに蓄積されると、メダル231の重さにより下方向にスライドし、蓄積ディスク251と排出ディスク253との係合を解除し、それぞれ独立して回転できるようにする。   A discharge stopper pin 258 is provided on the discharge disk 253. The discharge stopper pin 258 includes a convex portion 258b for locking the hole portion 251h of the storage disk 251 in which the fourth medal 231 is stored, and a convex portion 258a for locking the recess 253h of the discharge disk 253. It is a letter-shaped pin, and the storage disk 251 and the discharge disk 253 are engaged by locking each. When the fourth medal 231 is stored in the hole 251h of the storage disk 251, the discharge stopper pin 258 slides downward due to the weight of the medal 231, and the storage disk 251 engages with the discharge disk 253. To be able to rotate independently.

この結果、排出ディスク253が、蓄積ディスク241と位相が一致するタイミング、すなわち、蓄積ディスク251の穴部251e〜251hと、排出ディスク253のくぼみ253e〜253hとが同位置に移動するタイミングで、それまで蓄積ディスク251の穴部251e〜251hに蓄積されていた4枚のメダル231は、ほぼ同一のタイミングで対応するくぼみ253e〜253hに装填される。   As a result, when the ejection disk 253 is in phase with the storage disk 241, that is, when the holes 251 e to 251 h of the storage disk 251 and the recesses 253 e to 253 h of the discharge disk 253 move to the same position, The four medals 231 stored in the holes 251e to 251h of the storage disk 251 are loaded in the corresponding recesses 253e to 253h at almost the same timing.

さらに、この状態で排出ディスク253は、所定の回転速度で回転を続けることにより、くぼみ253e〜253hに装填されたメダル231は、ディスクガイド256に沿って移動し、排出ガイド254、255より排出部222に送出され、排出される。   Further, in this state, the discharge disk 253 continues to rotate at a predetermined rotation speed, so that the medals 231 loaded in the recesses 253e to 253h move along the disk guide 256 and are discharged from the discharge guides 254 and 255. It is sent to 222 and discharged.

また、蓄積ディスク251には、4枚のメダル231が蓄積可能であるが、端数などにより4枚のメダル231が蓄積できない場合、強制排出部241は、ストッパピン2521を直接押圧してメダル231が穴部223より蓄積されていない状態でも蓄積ディスク251および排出ディスク253の回転を進め、最終的に、排出ストッパピン258を押圧して、端数となったメダル231を排出ディスク253より排出させる。   In addition, four medals 231 can be stored in the storage disk 251, but when the four medals 231 cannot be stored due to a fraction or the like, the forcible discharge unit 241 directly presses the stopper pin 2521 so that the medals 231 can be stored. The accumulation disk 251 and the discharge disk 253 are rotated even when the holes 223 are not accumulated, and finally the discharge stopper pin 258 is pressed to discharge the fractional medal 231 from the discharge disk 253.

図29は、メダル計数装置200の回路ブロック図である。メダル計数装置200は、制御部261と、記憶部262と、通信インターフェース263とを有する。これらの各部は、メダル計数装置200の内部に設けられた回路基板上に、それぞれ、別個の回路として設けられる。   FIG. 29 is a circuit block diagram of the medal counting device 200. The medal counting device 200 includes a control unit 261, a storage unit 262, and a communication interface 263. Each of these units is provided as a separate circuit on a circuit board provided in the medal counting device 200.

制御部261は、例えば、1個若しくは複数のプロセッサを有し、メダル計数装置200の各部を制御する。また制御部261は、撮像部226から得られた画像に対して上記の実施形態または変形例によるメダル識別装置の制御回路が有する各部の機能を実行することで、搬送されたメダル231が適正なメダルか否かを判定する。そして制御部261は、搬送されたメダル231が適正なメダルである場合、メダルのカウント数を1だけ増やす。そして制御部261は、投入されたメダルの計数が終了すると、その計数結果を表示部203に表示させる。さらに、制御部261は、計数結果を印字部204に伝えて、その計数結果を紙などに印刷させる。   The control unit 261 includes, for example, one or a plurality of processors, and controls each unit of the medal counting device 200. In addition, the control unit 261 executes the function of each unit included in the control circuit of the medal identification device according to the above-described embodiment or modification on the image obtained from the imaging unit 226 so that the conveyed medal 231 is appropriate. It is determined whether or not it is a medal. Then, the control unit 261 increases the medal count by 1 when the transported medal 231 is an appropriate medal. When the counting of inserted medals is completed, the control unit 261 causes the display unit 203 to display the counting result. Further, the control unit 261 transmits the counting result to the printing unit 204 and prints the counting result on paper or the like.

記憶部262は、上記の実施形態または変形例によるメダル識別装置のメモリに対応し、揮発性又は不揮発性の読み書き可能な半導体メモリを有し、制御部261の動作に必要な様々なデータを記憶する。例えば、記憶部262は、モデル登録処理またはメダル識別処理で生じる、エッジ画像といった様々な中間データ、モデル画像、撮像部226から受け取った画像などを記憶する。   The storage unit 262 corresponds to the memory of the medal identification device according to the above-described embodiment or modification, has a volatile or nonvolatile readable / writable semiconductor memory, and stores various data necessary for the operation of the control unit 261. To do. For example, the storage unit 262 stores various intermediate data such as edge images, model images, images received from the imaging unit 226, and the like generated in the model registration process or the medal identification process.

通信インターフェース263は、上記の実施形態または変形例によるメダル識別装置の通信インターフェースに対応し、センサ225、撮像部226、光源227、及び、ホールコンピュータといった上位の制御装置(図示せず)と接続するためのインターフェースであり、センサ225、撮像部226または光源227への制御信号を制御部261から受け取って、センサ225、撮像部226または光源227に出力する。また通信インターフェース263は、上位の制御装置からの各種の制御信号、センサ225からの信号、または撮像部226からの画像を、信号線を介して受け取って、制御部261へ渡す。   The communication interface 263 corresponds to the communication interface of the medal identification device according to the above-described embodiment or modification, and is connected to a higher-level control device (not shown) such as the sensor 225, the imaging unit 226, the light source 227, and the hall computer. For receiving a control signal to the sensor 225, the imaging unit 226, or the light source 227 from the control unit 261 and outputting the control signal to the sensor 225, the imaging unit 226, or the light source 227. The communication interface 263 receives various control signals from the host control device, signals from the sensor 225, or images from the imaging unit 226 via a signal line, and passes them to the control unit 261.

このように、当業者は、本発明の範囲内で、実施される形態に合わせて様々な変更を行うことができる。   As described above, those skilled in the art can make various modifications in accordance with the embodiment to be implemented within the scope of the present invention.

1 メダル識別装置
2 筐体
2a メダル投入口
2b メダル排出口
3 光源
4 撮像部
5 制御基板
51 制御回路
52 メモリ
53 通信インターフェース
61 メダル領域検出部
62 エッジ検出部
63 回転角算出部
64 モデル生成部
65 モデルエッジ数調整部
66 形状補正部
67 エッジ位置補正部
68 向き一致度算出部
69 類似度算出部
70 判定部
6 通路
7a、7b ガイド部材
100 回胴遊技機
101 本体筐体
102a〜102c ドラム
103 スタートレバー
104a〜104c ストップボタン
105 前面パネル
106 メダル識別装置
107 制御ボックス
108 メダル貯留・排出機構
110 主制御回路
111 演出用制御回路
112 電源回路
200 メダル計数装置
201 搬送部
202 開口部
203 表示部
204 印字部
205 操作部
211 分離部
212 誘導部
221 搬送プレート
222 排出部
224 ガイド部
226 撮像部
227 光源
241 強制排出部
251 蓄積ディスク
252−1〜252−4 ストッパピン
253 排出ディスク
254、255 排出ガイド
256 ディスクガイド
257 モータ
258 排出ストッパピン
259 シャフト
260 ベルト
261 制御部
262 記憶部
263 通信インターフェース
DESCRIPTION OF SYMBOLS 1 Medal identification device 2 Case 2a Medal insertion slot 2b Medal ejection slot 3 Light source 4 Imaging unit 5 Control board 51 Control circuit 52 Memory 53 Communication interface 61 Medal region detection unit 62 Edge detection unit 63 Rotation angle calculation unit 64 Model generation unit 65 Model edge number adjustment unit 66 Shape correction unit 67 Edge position correction unit 68 Orientation coincidence calculation unit 69 Similarity calculation unit 70 Judgment unit 6 Passage 7a, 7b Guide member 100 Cylinder machine 101 Main body case 102a-102c Drum 103 Start Lever 104a-104c Stop button 105 Front panel 106 Medal identification device 107 Control box 108 Medal storage / discharge mechanism 110 Main control circuit 111 Production control circuit 112 Power supply circuit 200 Medal counting device 201 Conveying unit 202 Opening unit 203 Display unit 2 04 Printing section 205 Operation section 211 Separating section 212 Guide section 221 Conveying plate 222 Discharge section 224 Guide section 226 Imaging section 227 Light source 241 Forced discharge section 251 Storage disk 252-1 to 252-4 Stopper pin 253 Discharge disk 254, 255 Discharge guide 256 Disc guide 257 Motor 258 Discharge stopper pin 259 Shaft 260 Belt 261 Control unit 262 Storage unit 263 Communication interface

Claims (4)

メダルが通過する通路を形成する通路形成部と、
前記通路の一部を撮影範囲とするように配置され、当該撮影範囲の画像を生成する撮像部と、
所定のメダルのモデルを表し、当該モデルが写った領域であるモデル領域内の前記モデルの表面の模様のエッジに対応するエッジ画素を含むモデル画像を記憶する記憶部と、
前記画像から、前記通路内を流下する識別対象メダルが写った領域であるメダル領域及び当該メダル領域の中心を検出するメダル領域検出部と、
前記メダル領域内で、前記識別対象メダルの表面の模様のエッジが写っているエッジ画素を検出するエッジ検出部と、
前記メダル領域を複数の部分領域に分割し、前記複数の部分領域のそれぞれについて、当該部分領域の面積に対する当該部分領域に含まれる前記エッジ画素の数の比が所定比率未満となるように前記エッジ画素を選択し、前記モデル領域の中心と前記メダル領域の中心とを位置合わせして、該選択されたエッジ画素のうち前記モデル領域内のエッジ画素の何れかと一致するエッジ画素の数が、前記モデル領域内の何れのエッジ画素とも一致しないエッジ画素の数より多いほど、前記モデルの表面の模様と前記識別対象メダルの表面の模様間の類似度が高くなるように該類似度を算出する類似度算出部と、
前記類似度に応じて前記識別対象メダルが前記所定のメダルか否か判定する判定部と、
を有するメダル識別装置。
A passage forming portion that forms a passage through which medals pass;
An imaging unit that is arranged so that a part of the passage is an imaging range, and generates an image of the imaging range;
A storage unit for storing a model image including an edge pixel corresponding to an edge of a pattern on the surface of the model in a model region representing a model of a predetermined medal and in which the model is captured;
From the image, a medal area that is an area in which an identification target medal that flows down in the passage is shown, and a medal area detection unit that detects the center of the medal area;
An edge detection unit for detecting an edge pixel in which an edge of a pattern of the surface of the identification target medal is reflected in the medal area;
The medal area is divided into a plurality of partial areas, and for each of the plurality of partial areas, the edge so that the ratio of the number of edge pixels included in the partial area to the area of the partial area is less than a predetermined ratio. Select a pixel, align the center of the model area and the center of the medal area, and the number of edge pixels that match one of the edge pixels in the model area among the selected edge pixels is Similarity in which the similarity is calculated so that the similarity between the pattern on the surface of the model and the pattern on the surface of the identification medal increases as the number of edge pixels that do not match any edge pixel in the model region increases. A degree calculator,
A determination unit that determines whether the identification target medal is the predetermined medal according to the similarity;
A medal identification device.
前記類似度算出部は、前記メダル領域を、互いに異なる複数の分割方法のそれぞれごとに前記複数の部分領域に分割し、前記分割方法ごとに各部分領域の面積に占めるエッジ画素の数が前記所定比率未満となるように前記エッジ画素を選択して前記類似度を算出し、前記分割方法ごとの前記類似度の平均値または最大値を算出し、
前記判定部は、前記類似度の平均値または最大値に応じて前記識別対象メダルが前記所定のメダルか否か判定する、請求項1に記載のメダル識別装置。
The similarity calculation unit divides the medal area into the plurality of partial areas for each of a plurality of different division methods, and the number of edge pixels occupying the area of each partial area for each of the division methods is the predetermined number. Select the edge pixel to be less than a ratio, calculate the similarity, calculate an average value or a maximum value of the similarity for each of the division methods,
The medal identification device according to claim 1, wherein the determination unit determines whether the identification target medal is the predetermined medal according to an average value or a maximum value of the similarity.
前記類似度算出部は、前記複数の分割方法のうちの一つとして、前記メダル領域を、前記メダル領域の中心から放射方向に沿って前記複数の部分領域に分割し、前記複数の分割方法のうちの他の一つとして、前記メダル領域を、前記メダル領域の中心についての円周方向に沿って前記複数の部分領域に分割する、請求項2に記載のメダル識別装置。   The similarity calculation unit, as one of the plurality of division methods, divides the medal area into the plurality of partial areas along a radial direction from the center of the medal area. The medal identification device according to claim 2, wherein the medal area is divided into the plurality of partial areas along a circumferential direction with respect to a center of the medal area as another one. メダルが通過する通路を形成する通路形成部と、前記通路の一部を撮影範囲とするように配置され、当該撮影範囲の画像を生成する撮像部とを有するメダル識別装置における、メダル識別方法であって、
前記画像から、前記通路内を流下する識別対象メダルが写った領域であるメダル領域及び当該メダル領域の中心を検出するステップと、
前記メダル領域内で、前記識別対象メダルの表面の模様のエッジが写っているエッジ画素を検出するステップと、
前記メダル領域を複数の部分領域に分割し、前記複数の部分領域のそれぞれについて、当該部分領域の面積に対する当該部分領域に含まれる前記エッジ画素の数の比が所定比率未満となるように前記エッジ画素を選択し、記憶部に記憶された、所定のメダルのモデルを表すモデル画像上での当該モデルが写った領域であるモデル領域の中心と前記メダル領域の中心とを位置合わせして、該選択されたエッジ画素のうち前記モデル領域内のエッジ画素の何れかと一致するエッジ画素の数が、前記モデル領域内の何れのエッジ画素とも一致しないエッジ画素の数より多いほど、前記モデルの表面の模様と前記識別対象メダルの表面の模様間の類似度が高くなるように該類似度を算出するステップと、
前記類似度に応じて前記識別対象メダルが前記所定のメダルか否か判定するステップと、
を含むメダル識別方法。
A medal identification method in a medal identification device, comprising: a passage forming unit that forms a passage through which a medal passes; and an imaging unit that is arranged so that a part of the passage is set as a shooting range and generates an image of the shooting range. There,
Detecting, from the image, a medal area that is an area where an identification target medal flowing down in the passage is shown, and a center of the medal area;
Detecting an edge pixel in which an edge of a pattern of the surface of the identification target medal is shown in the medal area;
The medal area is divided into a plurality of partial areas, and for each of the plurality of partial areas, the edge so that the ratio of the number of edge pixels included in the partial area to the area of the partial area is less than a predetermined ratio. A pixel is selected, and the center of the model area that is an area in which the model is captured on the model image representing the model of the predetermined medal stored in the storage unit is aligned with the center of the medal area, Of the selected edge pixels, the number of edge pixels that match any one of the edge pixels in the model area is larger than the number of edge pixels that do not match any edge pixel in the model area. Calculating the similarity so that the similarity between the pattern and the pattern on the surface of the identification medal is high;
Determining whether the identification target medal is the predetermined medal according to the similarity;
Medal identification method including
JP2014122846A 2014-06-13 2014-06-13 Medal identification device and medal identification method Pending JP2016004331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014122846A JP2016004331A (en) 2014-06-13 2014-06-13 Medal identification device and medal identification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014122846A JP2016004331A (en) 2014-06-13 2014-06-13 Medal identification device and medal identification method

Publications (1)

Publication Number Publication Date
JP2016004331A true JP2016004331A (en) 2016-01-12

Family

ID=55223588

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014122846A Pending JP2016004331A (en) 2014-06-13 2014-06-13 Medal identification device and medal identification method

Country Status (1)

Country Link
JP (1) JP2016004331A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017225664A (en) * 2016-06-23 2017-12-28 株式会社ユニバーサルエンターテインメント Game machine
JP2018015409A (en) * 2016-07-29 2018-02-01 株式会社オーイズミ Game medium dispenser
US10380796B2 (en) * 2016-07-19 2019-08-13 Usens, Inc. Methods and systems for 3D contour recognition and 3D mesh generation

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000163628A (en) * 1998-11-25 2000-06-16 Toshiba Corp Device and system for processing coin
JP2002183722A (en) * 2000-12-12 2002-06-28 Nippon Conlux Co Ltd Method and device for distinguishing coin
JP2004220205A (en) * 2003-01-10 2004-08-05 Sankyo Seiki Mfg Co Ltd Identification method and identification device for circular matter
JP2005316554A (en) * 2004-04-27 2005-11-10 Matsushita Electric Ind Co Ltd Pattern identifying device
WO2010035314A1 (en) * 2008-09-24 2010-04-01 グローリー株式会社 Usable coin judgment device and method
JP2012084175A (en) * 2012-01-18 2012-04-26 Glory Ltd Coin classification device and coin classification method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000163628A (en) * 1998-11-25 2000-06-16 Toshiba Corp Device and system for processing coin
JP2002183722A (en) * 2000-12-12 2002-06-28 Nippon Conlux Co Ltd Method and device for distinguishing coin
JP2004220205A (en) * 2003-01-10 2004-08-05 Sankyo Seiki Mfg Co Ltd Identification method and identification device for circular matter
JP2005316554A (en) * 2004-04-27 2005-11-10 Matsushita Electric Ind Co Ltd Pattern identifying device
WO2010035314A1 (en) * 2008-09-24 2010-04-01 グローリー株式会社 Usable coin judgment device and method
JP2012084175A (en) * 2012-01-18 2012-04-26 Glory Ltd Coin classification device and coin classification method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017225664A (en) * 2016-06-23 2017-12-28 株式会社ユニバーサルエンターテインメント Game machine
US10380796B2 (en) * 2016-07-19 2019-08-13 Usens, Inc. Methods and systems for 3D contour recognition and 3D mesh generation
JP2018015409A (en) * 2016-07-29 2018-02-01 株式会社オーイズミ Game medium dispenser

Similar Documents

Publication Publication Date Title
JP6357897B2 (en) Medal identification device and medal identification method
JP5817401B2 (en) Game machine
JP5838469B2 (en) Disc discrimination method, disc discrimination device, and disc sorting device
JP2016004333A (en) Model image generation device and model image generation method
JP6361305B2 (en) Model image generating apparatus and model image generating method
JP2013080360A5 (en)
JP2016004331A (en) Medal identification device and medal identification method
JP5140510B2 (en) Disk-like object appearance inspection device
JP6162518B2 (en) Disc pattern recognition device and disc sorting device
JPWO2010035314A1 (en) Coin damage determination apparatus and damage determination method
JP6299459B2 (en) Medal identification device and medal identification method
WO2019202868A1 (en) Coin wear or deformation detection device, coin handling machine, and coin wear or deformation detection method
JP6104294B2 (en) Game machine
JP2013094590A (en) Device and method for identifying token
JP7293081B2 (en) coin identification unit
JP7224846B2 (en) Optical coin identification device, coin processing machine and coin identification method
JP5953553B2 (en) Disc discrimination method, disc discrimination device, and disc sorting device
CN104167042B (en) Dish image acquiring device and riddle screening device
JP6481126B2 (en) Disc color discrimination device and color discrimination method
EP2804154B1 (en) Disk image acquiring device and disk sorting device
US9947161B2 (en) Disk image acquiring device and disk sorting device
JP6104291B2 (en) Game machine
JP6401064B2 (en) Game machine
JP6104290B2 (en) Game machine
JP5953614B2 (en) Disc discrimination method, disc discrimination device, and disc sorting device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180109

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20180710