JP5163985B2 - Granular product type inspection device - Google Patents

Granular product type inspection device Download PDF

Info

Publication number
JP5163985B2
JP5163985B2 JP2008292824A JP2008292824A JP5163985B2 JP 5163985 B2 JP5163985 B2 JP 5163985B2 JP 2008292824 A JP2008292824 A JP 2008292824A JP 2008292824 A JP2008292824 A JP 2008292824A JP 5163985 B2 JP5163985 B2 JP 5163985B2
Authority
JP
Japan
Prior art keywords
image
candidate
template
distance
common
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008292824A
Other languages
Japanese (ja)
Other versions
JP2010117331A (en
Inventor
清一郎 鎌田
義博 八津川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Waseda University
Original Assignee
Waseda University
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 Waseda University filed Critical Waseda University
Priority to JP2008292824A priority Critical patent/JP5163985B2/en
Publication of JP2010117331A publication Critical patent/JP2010117331A/en
Application granted granted Critical
Publication of JP5163985B2 publication Critical patent/JP5163985B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、粒状物品の種類を自動判別する粒状物品種検査装置に関し、特に、分包されたカプセルや錠剤等の種類を自動判別するのに適した粒状物品種検査装置に関する。   The present invention relates to a granular material type inspection apparatus that automatically determines the type of granular article, and more particularly to a granular material type inspection apparatus that is suitable for automatically determining the type of capsules, tablets, and the like that are packaged.

薬局や病院においては、一般に、患者に対して処方された薬剤を1回の服用分毎に分包し、患者に提供する。この際、薬剤の分包は、処方箋に従って薬剤師が薬剤を選択し、手作業や分包機によって袋詰めを行う。ところで、人手による作業では、必然的に人為的ミスがリスクとして発生するが、薬剤の分包作業においては、分包された薬剤を患者が服用するため、人為的ミスが許されない。従って、分包後に、分包された薬剤の種類を検査する必要がある。   In pharmacies and hospitals, in general, medicine prescribed to a patient is packaged for each dose and provided to the patient. At this time, the medicine is packaged by a pharmacist selecting a medicine according to a prescription, and filling the bag by a manual operation or a packaging machine. By the way, human work inevitably causes a human error as a risk. However, in the medicine packaging work, since the patient takes the medicine, the human error is not allowed. Therefore, after the packaging, it is necessary to inspect the type of medicine packaged.

分包薬剤の種類を検査する検査装置としては、特許文献1のものが公知である。図6に、特許文献1に記載の分包薬剤の検薬装置を示す(特許文献1,実施例2参照)。検薬装置は、透明な袋101に分包された薬剤(錠剤又はカプセル)の検薬を行う装置である。   As an inspection apparatus for inspecting the type of packaged medicine, one disclosed in Patent Document 1 is known. FIG. 6 shows a drug dispensing device for packaged medicine described in Patent Document 1 (see Patent Document 1 and Example 2). The drug inspection device is a device that performs drug inspection of a medicine (tablet or capsule) packaged in a transparent bag 101.

この検薬装置の撮影ユニット100は、分包した薬剤の入った袋101を挟んで、上方に設置されるデジタルカメラ102と、下方に設置されるデジタルカメラ103と、上方に設置される平行光源を下向きに照射する照明器104とを備えている。   The imaging unit 100 of this drug testing device includes a digital camera 102 installed above, a digital camera 103 installed below, and a parallel light source installed above, with a bag 101 containing a packaged medicine in between. And an illuminator 104 that irradiates the light downward.

上方のデジタルカメラ102は、透明な袋101に分包された薬剤をカラー撮影た画像を出力する。また、下方に設置されるデジタルカメラ103は、照明器104による平行光線の照明下で、各薬剤が灰色若しくは黒色のシルエット画像として撮像されたシルエット画像を出力する。   The upper digital camera 102 outputs an image obtained by color photographing the medicine packaged in the transparent bag 101. In addition, the digital camera 103 installed below outputs a silhouette image in which each medicine is captured as a gray or black silhouette image under illumination of parallel rays by the illuminator 104.

薬剤の照合を行う場合、撮影した画像から各薬剤画像を切り出す必要がある。この検薬装置では、薬剤画像の切り出し処理を、シルエット画像を用いて行う。まず、シルエット画像に対して2値化処理を行う。次いで、2値化されたシルエット画像に対して、8近傍収縮処理を行う。これにより、接触した薬剤同士が分離するため、各薬剤画像を分離して切り出すことができる。   When collating medicines, it is necessary to cut out each medicine image from the captured image. In this drug testing device, a medicine image is cut out using a silhouette image. First, binarization processing is performed on the silhouette image. Next, 8-neighbor contraction processing is performed on the binarized silhouette image. Thereby, since the medicine which contacted isolate | separates, each medicine image can be isolate | separated and cut out.

各薬剤の照合は、上方のデジタルカメラ102により撮影されたカラー画像を用いて行われる。まず、先にシルエット画像によって切り出された領域に従って、デジタルカメラ102により撮影されたカラー画像から各薬剤画像を切り出す。そして、個々の薬剤画像について、RGB濃度値を検出し、色彩テンプレートを作成する。また、各薬剤のカラー画像を2値化して、長軸L、短軸Sの長さを画素数で算出する。さらに、各薬剤毎に、画像の面積Σを全画素数で算出する。   Each medicine is collated using a color image taken by the upper digital camera 102. First, each medicine image is cut out from the color image photographed by the digital camera 102 according to the area cut out by the silhouette image first. Then, an RGB density value is detected for each drug image, and a color template is created. Further, the color image of each medicine is binarized, and the length of the long axis L and the short axis S is calculated by the number of pixels. Further, for each medicine, the area Σ of the image is calculated by the total number of pixels.

最後に、得られたこれらのパラメータを用いて、次式(1)により照合判定値vを算出する。   Finally, using these obtained parameters, a collation determination value v is calculated by the following equation (1).

基準データと検査薬剤とが一致すればvは小さい値となり、一致しなければvは大きい値となるので、このvを閾値判定することで薬剤の照合が可能となる。
特開2008−18230号公報
If the reference data and the test drug match, v becomes a small value, and if they do not match, v becomes a large value. Therefore, the drug can be verified by determining this v as a threshold value.
JP 2008-18230 A

しかしながら、実際の調剤現場において扱う薬剤は極めて多種類に及び、それら多種類の薬剤の中には形状や色彩、模様が類似するものが多い。従って、上記従来の分包薬剤の検薬装置のように、RGB値、長軸、短軸、平面面積のみを基準に薬剤の判別を行うのでは、十分な精度で薬剤の判別を行うことができず、誤判定を生じる。特に、調剤現場では患者に薬剤を誤って投与する事故を完全に防止することが要請されるため、判別精度はさらに高度なものが求められている。   However, there are a great variety of drugs handled at actual dispensing sites, and many of these drugs are similar in shape, color, and pattern. Therefore, as in the above-described conventional packaged drug inspection device, when the drug is determined based on only the RGB value, the long axis, the short axis, and the plane area, the drug can be determined with sufficient accuracy. It is not possible to cause a false determination. In particular, since it is required to completely prevent accidents in which a drug is mistakenly administered to a patient at a pharmacy site, higher discrimination accuracy is required.

一方、調剤現場では、多数の患者に短時間で薬剤を処方する必要があり、迅速に薬剤の分包と検査を行う必要がある。従って、薬剤種の判別検査も簡便に行うことができるものである必要がある。   On the other hand, in a dispensing site, it is necessary to prescribe a drug to a large number of patients in a short time, and it is necessary to quickly package and inspect the drug. Therefore, it is necessary that the drug type discrimination test can be easily performed.

そこで、本発明の目的は、粒状物品の種類を判別し検査する際に高度な判別精度を実現することが可能であり、且つ簡便に物品種の判別検査を行うことが可能な粒状物品種検査装置を提供することにある。   Accordingly, an object of the present invention is to provide a granular material type inspection capable of realizing a high degree of accuracy in determining and inspecting the type of granular article and easily performing a product type identification inspection. To provide an apparatus.

(I)記号の規約
最初に、本明細書において使用する記号について、次のように定めておく。
N:載置板上に置かれる被検査物品の個数(N≧1);
(n):第n番目の撮像装置(カメラ)により撮影された画像(n=1,2,3);
(n):画像G(n)から切り出されたi番目(i=1,…,N)の物品の切出画像;
:切出画像G (1),G (2),G (3)の何れか(i=1,…,N);
:切出画像G (1),G (2)から生成されるステレオ画像
(p):物品pのテンプレート二次元画像;
(p):物品pのテンプレート・ステレオ画像;
(p):物品pのテンプレート印字画像;
(p):物品pのテンプレート刻印画像;
:切出画像G(i=1,…,N)から抽出された模様画像(印字画像又は刻印画像);
={pik (A)}:切出画像G(i=1,…,N)に対する第一の候補物品種集合;
={pik (B)}:切出画像G(i=1,…,N)に対する第二の候補物品種集合;
={pik (C)}:切出画像G(i=1,…,N)に対する第三の候補物品種集合;
={pik (E)}:切出画像G(i=1,…,N)に対する第四の候補物品種集合;
={pik}:切出画像G(i=1,…,N)に対する共通候補物品種集合;
(p1α1,…,pNαN):共通候補の順列(順列);
(G (n),T(p)):切出画像G(i=1,…,N)とテンプレート二次元画像T(p)との間の二次元画像距離;
(S,T(p)):ステレオ画像S(i=1,…,N)とテンプレート二次元画像T(p)との間のステレオ画像距離;
(Q,T(piαi)):印字画像ととの間の印字画像距離;
(Q,T(piαi)):刻印画像ととの間の刻印画像距離;
:第一の距離和(=Σ(G,T(p));
:第二の距離和(=Σ(S,T(p));
:第三の距離和(=Σ(Q,T(piαi)));
:第四の距離和(=Σ(Q,T(piαi)));
,c,c,c:加重和の重み係数.
(I) Rules for Symbols First, symbols used in this specification are defined as follows.
N: the number of articles to be inspected placed on the mounting plate (N ≧ 1);
G (n) : Images taken by the nth imaging device (camera) (n = 1, 2, 3);
G i (n) : a cut-out image of the i-th (i = 1,..., N) article cut out from the image G (n) ;
G i : any one of the cropped images G i (1) , G i (2) and G i (3) (i = 1,..., N);
S i : Stereo image generated from the cut-out images G i (1) and G i (2) T 1 (p): Template two-dimensional image of the article p;
T 2 (p): template stereo image of article p;
T 3 (p): template print image of article p;
T 4 (p): template stamp image of article p;
Q i : a pattern image (printed image or stamped image) extracted from the cut image G i (i = 1,..., N);
A i = {p ik (A) }: a first candidate variety set for the cut image G i (i = 1,..., N);
B i = {p ik (B) }: second candidate variety set for the cut image G i (i = 1,..., N);
C i = {p ik (C) }: a third candidate variety set for the cut image G i (i = 1,..., N);
E i = {p ik (E) }: a fourth candidate variety set for the cut image G i (i = 1,..., N);
P i = {p ik }: a set of common candidate varieties for the cut image G i (i = 1,..., N);
(P 1α1 ,..., P NαN ): permutation of common candidates (permutation);
L 1 (G i (n) , T 1 (p)): a two-dimensional image distance between the cut-out image G i (i = 1,..., N) and the template two-dimensional image T 1 (p);
L 2 (S i , T 2 (p)): stereo image distance between the stereo image S i (i = 1,..., N) and the template two-dimensional image T 1 (p);
L 3 (Q i , T 3 (p iαi )): Print image distance from print image;
L 4 (Q i , T 4 (p iαi )): engraved image distance from the engraved image;
D 1 : first distance sum (= Σ i L 1 (G i , T 1 (p));
D 2 : second distance sum (= Σ i L 2 (S i , T 2 (p));
D 3 : third distance sum (= Σ i L 3 (Q i , T 3 (p iαi )));
D 4 : fourth distance sum (= Σ i L 4 (Q i , T 4 (p iαi )));
c 1 , c 2 , c 3 , c 4 : weighting factors of the weighted sum.

(II)本発明の構成
本発明の粒状物品種検査装置の第1の構成は、被検査物品を載置する載置板と、
前記載置板上に載置される被検査物品を斜め上方から撮像する第一の撮像装置と、
前記載置板上に載置される被検査物品を前記第一の撮像装置とは異なる方角の斜め上方から撮像する第二の撮像装置と、
前記載置板上に載置された被検査物品の総重量Mを検出する計重器と、
前記第一及び第二の撮像装置で撮像されたそれぞれの画像から、前記載置板上に載置されたN個(N≧1)の被検査物品の画像を切り出して切出画像{G (n),…,G (n)}(n=1,2:nは撮像装置の番号)を生成する領域分離手段と、
検査対象となる複数種の物品を、各物品種ごとに、その物品種pの物品を撮影したテンプレート二次元画像{T(p)}、その物品種の物品のステレオ・画像であるテンプレート・ステレオ画像{T(p)}、並びにその物品種の物品1個当たりの重量{m(p)}を当該物品種pと関連づけて記憶するテンプレート記憶手段と、
前記テンプレート記憶手段に記憶された各テンプレート二次元画像T(p)と前記第一又は第二の撮像装置により撮像された前記各切出画像G (n)(i=1,…,N)との二次元画像マッチングを実行し、前記テンプレート二次元画像と前記切出画像との距離(以下「二次元画像距離」)L(G (n),T(p))が所定の閾値以下である候補となる物品種の集合(以下「第一の候補物品種集合」)A(i=1,…,N)を抽出する二次元画像マッチング手段と、
前記第一及び第二の撮像装置により撮像されるN組の前記切出画像の対{(G (1),G (2)),…,(G (1),G (2))}から、N個の被検査物品のステレオ画像{S,…,S}を合成するステレオ画像合成手段と、
前記テンプレート記憶手段に記憶された前記各テンプレート・ステレオ画像T(p)と、前記ステレオ画像合成手段により合成された前記各ステレオ画像S(i=1,…,N)とのステレオ・マッチングを実行し、前記テンプレート・ステレオ画像と前記ステレオ画像との距離(以下「ステレオ画像距離」)L(S,T(p))が所定の閾値以下である候補となる物品種の集合(以下「第二の候補物品種集合」)B(i=1,…,N)を抽出するステレオ・マッチング手段と、
N個の前記各切出画像G(i=1,…,N)のそれぞれに対し、前記第一の候補物品種集合Aと前記第二の候補物品種集合Bとに共通して含まれる物品種の集合(以下「共通候補物品種集合」)P=A∩B={pik}を抽出する共通候補抽出手段と、
N個の前記共通候補物品種集合P,…,Pのそれぞれから1つずつ物品種を取り出して集めた共通候補の順列(p1α1,…,pNαN)の中から、前記テンプレート記憶手段に記憶された物品種の物品1個当たりの重量を前記共通候補の順列(p1α1,…,pNαN)について足し合わせた総重量Mと、前記計重器が検出する総重量Mとの差|M−M|が所定の閾値ε以下となる共通候補の順列を抽出する重量判定手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート二次元画像T(piαi)とそれに対応する切出画像G (n)との距離をその共通候補の順列について足し合わせた第一の距離和D=Σ(G (n),T(piαi))を算出する第一の距離和演算手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート・ステレオ画像T(piαi)とそれに対応するステレオ画像Sとの距離をその共通候補の順列について足し合わせた第二の距離和D=Σ(S,T(piαi))を算出する第二の距離和演算手段と、
前記重量判定手段により抽出された各共通候補の順列{(p1α1,…,pNαN)}のうち、前記第一の距離和Dと前記第二の距離和Dとの加重和c+cが最小となる共通候補の順列を抽出し、前記載置板に載置された被検査物品の集合として出力する総合判定手段と、
を備えたことを特徴とする。
(II) Configuration of the Present Invention The first configuration of the granular material type inspection apparatus of the present invention is a mounting plate for mounting an article to be inspected,
A first imaging device for imaging the article to be inspected placed on the placing plate from above obliquely;
A second imaging device for imaging an article to be inspected placed on the mounting plate from an obliquely upward direction in a direction different from that of the first imaging device;
A weigher for detecting the total weight M of the article to be inspected placed on the placing plate;
N images (N ≧ 1) of articles to be inspected placed on the mounting plate are cut out from the images picked up by the first and second image pickup devices, and cut out images {G 1 (N) ,..., G N (n) } (n = 1, 2: n is the number of the imaging device);
A template two-dimensional image {T 1 (p)} obtained by photographing a plurality of types of articles to be inspected for each type of product, and a product of the product type p. Template storage means for storing the stereo image {T 2 (p)} and the weight {m (p)} per article of the product type in association with the product type p;
Each template two-dimensional image T 1 (p) stored in the template storage means and each cut-out image G i (n) (i = 1,..., N ) captured by the first or second imaging device ) And a distance between the template two-dimensional image and the cut-out image (hereinafter referred to as “two-dimensional image distance”) L 1 (G i (n) , T 1 (p)) is predetermined. A two-dimensional image matching means for extracting a set of candidate product types that are equal to or less than a threshold value (hereinafter, “first candidate product type set”) A i (i = 1,..., N);
N pairs of the cutout images {(G 1 (1) , G 1 (2) ),..., (G N (1) , G N (2 ) captured by the first and second imaging devices] ) )}, A stereo image synthesizing means for synthesizing stereo images {S 1 ,..., S N } of N inspected articles;
Stereo matching between each template stereo image T 2 (p) stored in the template storage means and each stereo image S i (i = 1,..., N) synthesized by the stereo image synthesis means. And a set of candidate product types whose distance between the template stereo image and the stereo image (hereinafter “stereo image distance”) L 2 (S i , T 2 (p)) is equal to or less than a predetermined threshold (Hereinafter “second candidate product set”) stereo matching means for extracting B i (i = 1,..., N);
For each of the N cutout images G i (i = 1,..., N), the first candidate variety set A i and the second candidate variety set B i are commonly used. A common candidate extraction means for extracting a set of contained product types (hereinafter, “common candidate product type set”) P i = A i ∩B i = {p ik };
From the permutations (p 1α1 ,..., P NαN ) of common candidates obtained by collecting one product type from each of the N common candidate product types sets P 1 ,. , The total weight M j obtained by adding the weights per article of the product types stored for the common candidate permutation (p 1α1 ,..., P NαN ), and the total weight M detected by the weigher Weight determination means for extracting a permutation of common candidates for which the difference | M j −M | is equal to or less than a predetermined threshold value ε M ;
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template two-dimensional image T 1 (p iαi ) corresponding to each product type p iαi and a corresponding cut-out. The first distance sum D 1 = Σ i L 1 (G i (n) , T 1 (p iαi )) is calculated by adding the distance to the image G i (n) with respect to the permutations of the common candidates. A distance sum calculation means,
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template stereo image T 2 (p iαi ) corresponding to each product type p iαi and a stereo image corresponding thereto. A second distance sum calculation means for calculating a second distance sum D 2 = Σ i L 2 (S i , T 2 (p iαi )) obtained by adding the distance to S i for the permutation of the common candidates;
Of the permutations {(p 1α1 ,..., P NαN )} of the common candidates extracted by the weight determination means, the weighted sum c 1 of the first distance sum D 1 and the second distance sum D 2 D 1 + c 2 Comprehensive determination means for extracting a permutation of common candidates that minimizes D 2 , and outputting as a set of inspected articles placed on the mounting plate,
It is provided with.

この構成によれば、二次元画像マッチングに加えて、ステレオ・マッチングにより薬剤の判別を行うことによって、物品の高さのマッチングも行われ、判別精度を向上させることができる。更に、各被検査物品の重量和によって候補の絞り込みを行うため、画像による判別のみの場合に比べ、更に判別誤差を低減させることができる。また、検査に当たっては、被検査物品を載置台上に載せて撮影を行うのみであるため、きわめて簡便に検査を行うことができる。   According to this configuration, in addition to the two-dimensional image matching, by determining the drug by stereo matching, the height of the article is also matched, and the determination accuracy can be improved. Further, since the candidates are narrowed down by the sum of the weights of the inspected articles, the discrimination error can be further reduced as compared with the case of only discrimination based on the image. Further, in the inspection, since the article to be inspected is simply placed on the mounting table and photographed, the inspection can be performed very simply.

本発明の粒状物品種検査装置の第2の構成は、前記第1の構成において、前記テンプレート記憶手段には、各物品種ごとに、その物品種の物品の表面に印字がある場合には、その印字を撮影した画像(以下「印字画像」)をテンプレート印字画像{T(p)}として、当該物品種pと関連づけて記憶され、その物品種の物品の表面に刻印がある場合には、その刻印を撮影した画像(以下「刻印画像」)をテンプレート刻印画像{T(p)}として、当該物品種pと関連づけて記憶されており、
N個の前記各切出画像G (n)(i=1,…,N)のそれぞれについて、前記切出画像G (n)内の物品の表面に前記印字画像又は前記刻印画像(以下「模様画像」)が存在するか否かを判定し、前記模様画像が存在する場合にはその模様画像Qを抽出する模様画像抽出手段と、
前記模様画像抽出手段により抽出された前記模様画像Qが、印字画像であるか刻印画像であるかを判別する印字・刻印判別手段と、
前記印字・刻印判別手段により前記模様画像Qが前記印字画像と判別された場合、前記テンプレート記憶手段に記憶された前記各テンプレート印字画像T(p)と前記印字画像Qとの画像マッチングを実行し、前記テンプレート印字画像と前記印字画像との距離である印字画像距離L(Q,T(p))が所定の閾値以下である候補となる物品種の集合を第三の候補物品種集合C(i=1,…,N)として抽出する印字画像マッチング手段と、
前記印字・刻印判別手段により前記模様画像Qが前記刻印画像と判別された場合、前記テンプレート記憶手段に記憶された前記各テンプレート刻印画像T(p)と前記刻印画像Qとの画像マッチングを実行し、前記テンプレート刻印画像と前記刻印画像との距離である刻印画像距離L(Q,T(p))が所定の閾値以下である候補となる物品種の集合を前記第四の候補物品種集合E(i=1,…,N)として抽出する刻印画像マッチング手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート印字画像T(piαi)とそれに対応する印字画像Qとの距離をその共通候補の順列について足し合わせた第三の距離和D=Σ(Q,T(piαi))を算出する第三の距離和演算手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート刻印画像T(piαi)とそれに対応する刻印画像Qとの距離をその共通候補の順列について足し合わせた第四の距離和D=Σ(Q,T(piαi))を算出する第四の距離和演算手段と、
を備え、
前記総合判定手段は、前記重量判定手段により抽出された各共通候補の順列{(p1α1,…,pNαN)}のうち、前記第一の距離和D、前記第二の距離和D、前記第三の距離和D、及び前記第四の距離和Dの加重和c+c+c+c(c、c,c,cは重み定数)が最小となる共通候補の順列を抽出し、前記載置板に載置された被検査物品の集合として出力すること
を特徴とする。
In the second configuration of the granular material type inspection apparatus of the present invention, in the first configuration, when the template storage means has a print on the surface of an article of the product type for each product type, When an image obtained by photographing the print (hereinafter referred to as “print image”) is stored as a template print image {T 3 (p)} in association with the product type p, and there is a stamp on the surface of the product of the product type , An image (hereinafter referred to as “engraved image”) obtained by photographing the engraving is stored as a template engraved image {T 4 (p)} in association with the product type p,
For each of the N cutout images G i (n) (i = 1,..., N), the printed image or the stamped image (hereinafter referred to as “printed image” ) on the surface of the article in the cut out image G i (n) . Pattern image extracting means for determining whether or not the “pattern image” exists, and extracting the pattern image Q i if the pattern image exists;
Printing / stamping discriminating means for discriminating whether the pattern image Q i extracted by the pattern image extracting means is a printed image or a stamped image;
When the pattern image Q i is discriminated as the print image by the print / engraving discrimination means, image matching between the template print images T 3 (p) stored in the template storage means and the print images Q i is performed. And a set of candidate product types whose print image distance L 4 (Q i , T 3 (p)), which is the distance between the template print image and the print image, is equal to or less than a predetermined threshold is Print image matching means for extracting as candidate variety set C i (i = 1,..., N);
When the pattern image Q i is discriminated as the imprinted image by the printing / engraving discriminating means, image matching between the template imprinted image T 4 (p) stored in the template storage means and the imprinted image Q i is performed. And a set of candidate product types for which a stamped image distance L 4 (Q i , T 4 (p)), which is a distance between the template stamped image and the stamped image, is equal to or smaller than a predetermined threshold is set to the fourth Engraving image matching means for extracting as a candidate set E i (i = 1,..., N) of
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template print image T 3 (p iαi ) corresponding to each product type p iαi and a print image Q corresponding thereto. a third distance sum calculating means for calculating a third distance sum D 3 = Σ i L 3 (Q i , T 3 (p iαi )) obtained by adding the distance to i for the common candidate permutation;
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template stamp image T 4 (p iαi ) corresponding to each product type p iαi and a stamp image Q corresponding thereto. a fourth distance sum calculation means for calculating a fourth distance sum D 4 = Σ i L 4 (Q i , T 4 (p iαi )) obtained by adding the distance to i with respect to the permutations of the common candidates;
With
The comprehensive determination unit includes the first distance sum D 1 and the second distance sum D 2 among the permutations {(p 1α1 ,..., P NαN )} of the common candidates extracted by the weight determination unit. , The third distance sum D 3 , and the weighted sum of the fourth distance sum D 4 c 1 D 1 + c 2 D 2 + c 3 D 3 + c 4 D 4 (c 1 , c 2 , c 3 , c 4 Is a common candidate permutation having the smallest weight constant), and outputs it as a set of articles to be inspected placed on the mounting plate.

この構成によれば、印字や刻印の画像マッチングを併用することで、更に判別精度を高めることができる。   According to this configuration, the discrimination accuracy can be further increased by using the image matching of printing and engraving together.

本発明の粒状物品種検査装置の第3の構成は、前記第2の構成において、前記載置板は、透光性の板材からなり、
前記載置板上に載置される被検査物品を前記載置板の下方乃至斜め下方から前記載置板を透して撮像する第三の撮像装置を備え、
前記領域分離手段は、前記第一、第二、及び第三の撮像装置で撮像されたそれぞれの画像から、前記切出画像{G (n),…,G (n)}(n=1,2,3:nは撮像装置の番号)を生成し、
前記二次元画像マッチング手段は、前記各テンプレート二次元画像T1k(k=1,2,…)と前記第一、第二、又は第三の撮像装置の何れかにより撮像された前記各切出画像G (n)(i=1,…,N)との二次元画像マッチングを実行し、前記二次元画像距離L(G (n),T1k)が小さい順に、前記第一の候補物品種集合A(i=1,…,N)を抽出するものであることを特徴とする。
In the third configuration of the granular material type inspection device of the present invention, in the second configuration, the mounting plate is made of a translucent plate material,
A third imaging device that images the article to be inspected placed on the placement plate from below or obliquely below the placement plate through the placement plate;
The region separating means extracts the cut image {G 1 (n) ,..., G N (n) } (n = n) from the images picked up by the first, second, and third image pickup devices. 1, 2, 3: n is the number of the imaging device)
The two-dimensional image matching means is configured to extract each of the template two-dimensional images T 1k (k = 1, 2,...) And the first, second, or third imaging device. The two-dimensional image matching with the image G i (n) (i = 1,..., N) is executed, and the first two-dimensional image distance L 1 (G i (n) , T 1k ) is increased in ascending order. A candidate product set A i (i = 1,..., N) is extracted.

この構成によれば、第三の撮像装置によって下面から薬剤を撮影した画像を併用することで、印字面又は刻印面が下向きになっている場合にも、正しく印字や刻印の画像マッチングを行うことが可能となり、更に判別精度を高めることができる。   According to this configuration, an image obtained by photographing the medicine from the lower surface by the third imaging device is used in combination, so that even when the printing surface or the marking surface is facing downward, the image matching of the printing or the marking is performed correctly. And the discrimination accuracy can be further improved.

本発明の粒状物品種検査装置の第4の構成は、前記第2又は3の構成において、前記共通候補抽出手段は、N個の前記各切出画像G(i=1,…,N)のそれぞれに対し、
当該切出画像Gに模様画像Qとして印字画像が含まれる場合には、前記第1の候補物品種集合Aと前記第2の候補物品種集合Bと前記第3の候補物品種集合Cとに共通して含まれる物品種の集合を前記共通候補物品種集合P=A∩B∩Cとして抽出し、
当該切出画像Gに模様画像Qとして刻印画像が含まれる場合には、前記第1の候補物品種集合Aと前記第2の候補物品種集合Bと前記第四の候補物品種集合Eとに共通して含まれる物品種の集合を前記共通候補物品種集合P=A∩B∩Eとして抽出し、
当該切出画像Gに模様画像Qが含まれない場合には、前記第1の候補物品種集合Aと前記第2の候補物品種集合Bとに共通して含まれる物品種の集合を前記共通候補物品種集合P=A∩Bとして抽出すること
を特徴とする。
According to a fourth configuration of the granular material type inspecting apparatus of the present invention, in the second or third configuration, the common candidate extraction unit includes N pieces of the extracted images G i (i = 1,..., N). For each of
When the cut image G i includes a print image as the pattern image Q i , the first candidate variety set A i , the second candidate variety set B i, and the third candidate variety A set of product varieties included in common with the set C i is extracted as the common candidate product set P i = A i ∩B i ∩C i ,
When the cut image G i includes a stamped image as the pattern image Q i , the first candidate variety set A i , the second candidate variety set B i, and the fourth candidate variety A set of product varieties included in common with the set E i is extracted as the common candidate product set P i = A i ∩B i ∩E i ,
When the cut-out image G i does not include the pattern image Q i , the product varieties included in both the first candidate variety set A i and the second candidate variety set B i The set is extracted as the common candidate variety set P i = A i ∩B i .

以上のように、本発明によれば、被検査物品を2方向から撮影し、二次元の画像マッチングに加えて、ステレオ・マッチングにより薬剤の判別を行うとともに、各被検査物品の重量和によって判別候補の絞り込みを行うことで、粒状物品の種類を判別し検査する際の判別精度が高い粒状物品種検査装置を提供することができる。また、検査作業は、被検査物品を載置板上に置いて撮影するのみであるため、簡便に物品種の判別検査を行うことが可能である。   As described above, according to the present invention, the article to be inspected is photographed from two directions, and in addition to the two-dimensional image matching, the medicine is discriminated by stereo matching and discriminated by the sum of the weights of the inspected articles. By narrowing down candidates, it is possible to provide a granular material type inspecting apparatus having high discrimination accuracy when discriminating and inspecting the type of granular article. In addition, since the inspection work is only performed by placing the article to be inspected on the mounting plate and photographing it, it is possible to easily perform the discrimination inspection of the product type.

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

図1は、本発明の実施例1に係る粒状物品種検査装置1の構成を示す図である。本実施例の粒状物品種検査装置1は、透明な包装袋Aに分包された被検査物品Bの種類を判別検査するものである。この場合、被検査物品Bは、錠剤やカプセル等の粒状薬剤である。   FIG. 1 is a diagram showing a configuration of a granular material type inspection apparatus 1 according to Embodiment 1 of the present invention. The granular material type inspection apparatus 1 of this embodiment discriminates and inspects the type of an article B to be inspected that is packaged in a transparent packaging bag A. In this case, the inspected article B is a granular medicine such as a tablet or a capsule.

粒状物品種検査装置1は、撮影ユニット2と制御装置3の2つの部分から構成されている。撮影ユニット2は、被検査物品Bの撮影と計重を行う装置の單元部分である。また、制御装置3は、撮影ユニット2から出力される被検査物品Bの画像情報と計重情報に基づいて被検査物品Bの判別検査を行う装置の單元部分である。この制御装置3としては、制御プログラムがインストールされた汎用のコンピュータを使用することができる。   The granular material type inspection device 1 is composed of two parts, a photographing unit 2 and a control device 3. The photographing unit 2 is a base portion of a device that photographs and weighs the article B to be inspected. The control device 3 is a base portion of a device that performs the discrimination inspection of the inspected article B based on the image information and the weighing information of the inspected article B output from the imaging unit 2. As the control device 3, a general-purpose computer in which a control program is installed can be used.

撮影ユニット2は、載置板4、計重器5、第一照明6、第二照明7、第三照明8、第一カメラ9、第二カメラ10、及び第三カメラ11を備えている。   The photographing unit 2 includes a mounting plate 4, a weigher 5, a first illumination 6, a second illumination 7, a third illumination 8, a first camera 9, a second camera 10, and a third camera 11.

載置板4は、透明な包装袋Aに分包された被検査物品Bを載置するための水平台であり、透光性の板材で構成されている。また、載置板4の下面には、載置板4の被検査物品Bを載置する部分に対向する部分に方形の開口部が形成された黒色の遮光板4aが貼り付けられている。この遮光板4aは、包装袋Aに分包された被検査物品Bを載置する位置を指定すると共に、撮影される画像の余分な部分を除去するのを容易とするために設けられている。   The mounting plate 4 is a horizontal table for mounting the inspected article B packaged in the transparent packaging bag A, and is made of a translucent plate material. Further, a black light-shielding plate 4 a having a square opening formed in a portion facing the portion on which the article B to be inspected is placed is placed on the lower surface of the placement plate 4. The light shielding plate 4a is provided for designating the position where the article B to be inspected packaged in the packaging bag A is to be placed, and for facilitating removal of an excessive portion of the image to be photographed. .

尚、包装袋Aには被検査物品Bが1個以上包装されているものとし、包装袋Aに包装されている被検査物品Bの個数をN(≧1)と記すことにする。   Note that one or more articles B to be inspected are packaged in the packaging bag A, and the number of articles B to be inspected packaged in the packaging bag A is denoted as N (≧ 1).

計重器5は、載置板4上に載置された被検査物品Bの総重量Mを検出する。計重器5としては電子天秤などが使用される。   The weigher 5 detects the total weight M of the inspected article B placed on the placement plate 4. An electronic balance or the like is used as the weigher 5.

第一照明6及び第二照明7は、載置板4の上方に設置された照明器であり、載置板4上に載置される包装袋Aに分包された被検査物品Bを斜め上方から照光する。第一照明6及び第二照明7は、載置板4の被検査物品Bを載置する部分(遮光板4aの開口部)の中心点に対して左右となる位置に設置される。また、第三照明8は、載置板4の下方に設置された照明器であり、載置板4上に載置される包装袋Aに分包された被検査物品Bを斜め下方から照光する。   The first illumination 6 and the second illumination 7 are illuminators installed above the placement plate 4, and obliquely inspect the article B to be inspected packaged in the packaging bag A placed on the placement plate 4. Illuminated from above. The 1st illumination 6 and the 2nd illumination 7 are installed in the position which becomes right and left with respect to the center point of the part (opening part of the light-shielding plate 4a) which mounts the to-be-inspected goods B of the mounting plate 4. FIG. The third illumination 8 is an illuminator installed below the placement plate 4 and illuminates the inspection object B packaged in the packaging bag A placed on the placement plate 4 from obliquely below. To do.

第一カメラ9及び第二カメラ10は、載置板4の上方に設置された撮像装置であり、載置板4上に載置される包装袋Aに分包された被検査物品Bを斜め上方から撮像する。第一カメラ9及び第二カメラ10は、載置板4の被検査物品Bを載置する部分(遮光板4aの開口部)の中心点に対して左右となる位置に設置される。従って、第二カメラ10は、第一カメラ9とは異なる方角の斜め上方から被検査物品Bを撮像することになる。また、第三カメラ11は、載置板4の下方に設置された撮像装置であり、載置板4上に載置される包装袋Aに分包された被検査物品Bを斜め下方から撮像する。尚、第一カメラ9、第二カメラ10、及び第三カメラ11には、CCD素子などの電子撮像装置が使用される。   The first camera 9 and the second camera 10 are imaging devices installed above the placement plate 4, and obliquely inspect the inspection object B packaged in the packaging bag A placed on the placement plate 4. Take an image from above. The first camera 9 and the second camera 10 are installed at positions on the left and right of the center point of the portion (the opening of the light shielding plate 4a) where the article B to be inspected is placed. Therefore, the second camera 10 captures an image of the inspected article B from obliquely above in a direction different from that of the first camera 9. The third camera 11 is an imaging device installed below the placement plate 4, and images the inspected article B packaged in the packaging bag A placed on the placement plate 4 from obliquely below. To do. For the first camera 9, the second camera 10, and the third camera 11, an electronic imaging device such as a CCD element is used.

図2は、実施例1に係る粒状物品種検査装置1の機能ブロック図である。図2において、図1と同様の部分については同符号が付されている。   FIG. 2 is a functional block diagram of the granular material type inspection apparatus 1 according to the first embodiment. In FIG. 2, the same parts as those in FIG.

この粒状物品種検査装置1の制御装置3は、テンプレート記憶部20、第一候補群記憶部21、第二候補群記憶部22、第三候補群記憶部23、第四候補群記憶部24、共通候補記憶部25、共通候補順列記憶部26、領域分離モジュール27、画像選択モジュール28、二次元画像マッチング・モジュール29、ステレオ画像合成モジュール30、ステレオ・マッチング・モジュール31、模様画像抽出モジュール32、照明コントローラ33、印字・刻印判別モジュール34、印字画像マッチング・モジュール35、刻印画像マッチング・モジュール36、共通候補抽出モジュール37、重量判定モジュール38、距離和演算モジュール39、距離和演算モジュール40、距離和演算モジュール41、距離和演算モジュール42、総合判定モジュール43、出力モジュール44、及び出力装置45を備えている。出力装置45以外の部分の各記憶部及び各モジュールは、プログラムによってコーディングされ、制御装置3がそのプログラムをロードして実行することにより、制御装置3において機能的に実現される。尚、出力装置45は、ディスプレイやスピーカ等の出力装置が使用される。   The control device 3 of the granular material type inspection apparatus 1 includes a template storage unit 20, a first candidate group storage unit 21, a second candidate group storage unit 22, a third candidate group storage unit 23, a fourth candidate group storage unit 24, Common candidate storage unit 25, common candidate permutation storage unit 26, region separation module 27, image selection module 28, two-dimensional image matching module 29, stereo image synthesis module 30, stereo matching module 31, pattern image extraction module 32, Illumination controller 33, printing / engraving discrimination module 34, printed image matching module 35, engraved image matching module 36, common candidate extraction module 37, weight determination module 38, distance sum calculation module 39, distance sum calculation module 40, distance sum Calculation module 41, distance sum calculation module 42, total size And a module 43, an output module 44, and an output device 45. Each storage unit and each module other than the output device 45 are coded by a program, and are functionally realized in the control device 3 by the control device 3 loading and executing the program. As the output device 45, an output device such as a display or a speaker is used.

テンプレート記憶部20は、検査対象となる複数種の物品を、各物品種ごとに、その物品種pのテンプレート二次元画像{T(p)}、テンプレート・ステレオ画像{T(p)}、テンプレート印字画像{T(p)}、テンプレート刻印画像{T(p)}、及びその物品種の物品1個当たりの重量{m(p)}を当該物品種pと関連づけて記憶している。 The template storage unit 20 includes, for each product type, a plurality of types of articles to be inspected, a template two-dimensional image {T 1 (p)} of the product type p, and a template stereo image {T 2 (p)}. , The template print image {T 3 (p)}, the template stamp image {T 4 (p)}, and the weight {m (p)} per article of the product type are stored in association with the product type p. ing.

ここで、「テンプレート二次元画像」とは、参照パターンとして使用される物品を真上から撮影した二次元画像である。「テンプレート・ステレオ画像」とは、参照パターンとして使用される物品のステレオ画像である。「テンプレート印字画像」とは、参照パターンとして使用される物品の表面にある印字を撮影した印字画像である。「テンプレート刻印画像」とは、参照パターンとして使用される物品の表面にある刻印を撮影した刻印画像である。前述の規約で定めた通り、各テンプレート二次元画像をT(p)、各テンプレート・ステレオ画像をT(p)、各テンプレート印字画像をT(p)、各テンプレート刻印画像をT(p)と記すことにする。ここで、pは物品種を表す。各テンプレートは、その物品種の物品の代表的なものを撮影した画像又はそれから合成された画像であり、あらかじめ用意され、テンプレート記憶部20にあらかじめ保存されている。 Here, the “template two-dimensional image” is a two-dimensional image obtained by photographing an article used as a reference pattern from directly above. A “template stereo image” is a stereo image of an article used as a reference pattern. The “template print image” is a print image obtained by photographing a print on the surface of an article used as a reference pattern. The “template stamp image” is a stamp image obtained by photographing a stamp on the surface of an article used as a reference pattern. As defined in the above rules, each template two-dimensional image is T 1 (p), each template stereo image is T 2 (p), each template print image is T 3 (p), and each template stamp image is T 4. Let us write (p). Here, p represents a product type. Each template is an image obtained by photographing a representative article of the product type or an image synthesized therefrom, and is prepared in advance and stored in the template storage unit 20 in advance.

尚、印字や刻印のない物品種pについては、テンプレート印字画像やテンプレート刻印画像は存在しない。   Note that there is no template print image or template stamp image for the product type p without print or stamp.

領域分離モジュール27は、第一カメラ9及び第二カメラ10並びに第三カメラ11で撮像されたそれぞれの画像から、載置板4上に載置されたN個の被検査物品Bの画像を個別に切り出して切出画像{G (n),…,G (n)}を生成する。ここで、G (n)(i=1,…,N)は切出画像であり、n(=1,2,3)はカメラの番号を表す。すなわち、n=1は第一カメラ9で撮像された画像から切り出した切出画像、n=2は第二カメラ10で撮像された画像から切り出した切出画像、n=3は第三カメラ11で撮像された画像から切り出した切出画像を表す。従って、領域分離モジュール27は、全部で3N個の切出画像を生成する。 The area separation module 27 individually outputs images of N inspected articles B placed on the placement plate 4 from the images captured by the first camera 9, the second camera 10, and the third camera 11. To generate a cut image {G 1 (n) ,..., G N (n) }. Here, G i (n) (i = 1,..., N) is a clipped image, and n (= 1, 2, 3) represents the camera number. That is, n = 1 is a cut-out image cut out from the image picked up by the first camera 9, n = 2 is a cut-out image cut out from the image picked up by the second camera 10, and n = 3 is the third camera 11. The cut-out image cut out from the image imaged in FIG. Therefore, the region separation module 27 generates 3N cut images in total.

画像選択モジュール28は、領域分離モジュール27によって切り出される切出画像G(n)を選択し出力する。 The image selection module 28 selects and outputs the cut image G i (n) cut by the region separation module 27.

二次元画像マッチング・モジュール29は、テンプレート記憶部20に記憶された各テンプレート二次元画像T(p)と、第一カメラ9又は第二カメラ10若しくは第三カメラ11により撮像された各切出画像Gとの二次元画像マッチングを実行し、テンプレート二次元画像T(p)と切出画像Gとの距離L(G,T(p))を算出する。この距離L(G,T(p))を「二次元画像距離」と呼ぶ。また、二次元画像マッチング・モジュール29は、二次元画像距離L(G,T(p))が所定の閾値ε以下となるテンプレート二次元画像T(pik (A))を抽出し、それらに対応する物品種pik (A)の集合A(i=1,…,N)を抽出する。この候補物品種の集合A={pik (A)}を「第一の候補物品種集合」という。ここで、pik (A)は、第一の候補物品種の集合Aに含まれるk番目の要素(物品)を表す。 The two-dimensional image matching module 29 uses each template two-dimensional image T 1 (p) stored in the template storage unit 20 and each clip imaged by the first camera 9, the second camera 10, or the third camera 11. Two-dimensional image matching with the image G i is executed, and a distance L 1 (G i , T 1 (p)) between the template two-dimensional image T 1 (p) and the cut-out image G i is calculated. This distance L 1 (G i , T 1 (p)) is referred to as “two-dimensional image distance”. Further, the two-dimensional image matching module 29 generates a template two-dimensional image T 1 (p ik (A) ) in which the two-dimensional image distance L 1 (G i , T 1 (p)) is equal to or less than a predetermined threshold ε 1. Then, a set A i (i = 1,..., N) of the product varieties p ik (A) corresponding to them is extracted. This set of candidate varieties A i = {p ik (A) } is referred to as “first candidate varieties set”. Here, p ik (A) represents the k-th element (article) included in the first candidate variety set A i .

第一候補群記憶部21は、二次元画像マッチング・モジュール29が抽出する第一の候補物品種集合A={pik (A)}、及び、集合Aの各要素pik (A)に対するテンプレート二次元画像T(pik (A))とそれに対応する切出画像Gとの二次元画像距離L(G,T(pik (A)))を記憶する。 The first candidate group storage unit 21 includes a first candidate variety set A i = {p ik (A) } extracted by the two-dimensional image matching module 29 and each element p ik (A) of the set A i. The two-dimensional image distance L 1 (G i , T 1 (p ik (A) )) between the template two-dimensional image T 1 (p ik (A) ) and the cut image G i corresponding thereto is stored.

ステレオ画像合成モジュール30は、第一カメラ9及び第二カメラ10により撮像されるN組の切出画像の対{(G (1),G (2)),…,(G (1),G (2))}から、N個の被検査物品のステレオ画像{S,…,S}を合成する。 The stereo image synthesis module 30 includes N pairs of clipped images captured by the first camera 9 and the second camera 10 {(G 1 (1) , G 1 (2) ), ..., (G N (1 ) , G N (2) )} to synthesize stereo images {S 1 ,..., S N } of N inspected articles.

ステレオ・マッチング・モジュール31は、テンプレート記憶部20に記憶された各テンプレート・ステレオ画像T(p)と、各ステレオ画像S(i=1,…,N)とのステレオ・マッチングを実行し、テンプレート・ステレオ画像T(p)とステレオ画像Sとの距離L(S,T(p))を算出する。この距離L(S,T(p))を「ステレオ画像距離」という。また、ステレオ・マッチング・モジュール31は、ステレオ画像距離L(G,T(p))が所定の閾値ε以下となるテンプレート・ステレオ画像T(pik (B))を抽出し、それらに対応する物品種pik (B)の集合B(i=1,…,N)を抽出する。この候補物品種の集合B={pik (B)}を「第二の候補物品種集合」という。ここで、pik (B)は、第二の候補物品種集合Bに含まれるk番目の要素(物品)を表す。 The stereo matching module 31 performs stereo matching between each template stereo image T 2 (p) stored in the template storage unit 20 and each stereo image S i (i = 1,..., N). Then, the distance L 2 (S i , T 2 (p)) between the template stereo image T 2 (p) and the stereo image S i is calculated. This distance L 2 (S i , T 2 (p)) is referred to as “stereo image distance”. In addition, the stereo matching module 31 extracts a template stereo image T 2 (p ik (B) ) in which the stereo image distance L 2 (G i , T 2 (p)) is equal to or less than a predetermined threshold ε 2. Then, a set B i (i = 1,..., N) of product varieties p ik (B) corresponding to them is extracted. This set of candidate varieties B i = {p ik (B) } is referred to as a “second candidate varieties set”. Here, p ik (B) represents the k-th element (article) included in the second candidate variety set B i .

第二候補群記憶部22は、ステレオ・マッチング・モジュール31が抽出する第二の候補物品種集合B={pik (B)}、及び、集合Bの各要素pik (B)に対するテンプレート・ステレオ画像T(pik (B))とそれに対応するステレオ画像Sとのステレオ画像距離L(S,T(pik (B)))を記憶する。 The second candidate group storage unit 22 corresponds to the second candidate variety set B i = {p ik (B) } extracted by the stereo matching module 31 and each element p ik (B) of the set B i . The stereo image distance L 2 (S i , T 2 (p ik (B) )) between the template stereo image T 2 (p ik (B) ) and the corresponding stereo image S i is stored.

模様画像抽出モジュール32は、N個の各切出画像G(i=1,…,N)のそれぞれについて、切出画像G内の物品の表面に印字画像又は刻印画像が存在するか否かを判定する。印字画像又は刻印画像のことをまとめて「模様画像」という。模様画像が存在する場合には、模様画像抽出モジュール32はその模様画像Qを抽出する。 Pattern image extraction module 32, N pieces of the cut image G i (i = 1, ... , N) for each, whether the surface to the print image or engraved image of the article in the clipped images G i exist Determine whether. A printed image or a stamped image is collectively referred to as a “pattern image”. If a pattern image exists, the pattern image extraction module 32 extracts the pattern image Q i .

照明コントローラ33は、第一照明6、第二照明7、及び第三照明8の光量を調節し又はそれらの点消灯を制御する。   The illumination controller 33 adjusts the light quantity of the 1st illumination 6, the 2nd illumination 7, and the 3rd illumination 8, or controls those lighting / extinction.

印字・刻印判別モジュール34は、模様画像抽出モジュール32により抽出された模様画像Qが、印字画像であるか刻印画像であるかを判別する。 The print / stamping determination module 34 determines whether the pattern image Q i extracted by the pattern image extraction module 32 is a print image or a stamp image.

印字画像マッチング・モジュール35は、印字・刻印判別モジュール34により模様画像Qが印字画像であると判別された場合、テンプレート記憶部20に記憶された各テンプレート印字画像T(p)と印字画像Qとの画像マッチングを実行し、テンプレート印字画像T(p)と印字画像Qとの距離L(Q,T(p))を算出する。この距離L(Q,T(p))を「印字画像距離」という。また、印字画像マッチング・モジュール35は、印字画像距離L(G,T(p))が所定の閾値ε以下となるテンプレート印字画像T(pik (C))を抽出し、それらに対応する物品種pik (C)の集合C(i=1,…,N)を抽出する。この候補物品種の集合C={pik (C)}を「第三の候補物品種集合」という。ここで、pik (C)は、第三の候補物品種の集合Cに含まれるk番目の要素(物品)を表す。 When the pattern image Q i is determined to be a print image by the print / engravement determination module 34, the print image matching module 35 and each template print image T 3 (p) stored in the template storage unit 20 and the print image Image matching with Q i is executed, and a distance L 3 (Q i , T 3 (p)) between the template print image T 3 (p) and the print image Q i is calculated. This distance L 3 (Q i , T 3 (p)) is referred to as “print image distance”. Further, the print image matching module 35 extracts a template print image T 3 (p ik (C) ) in which the print image distance L 3 (G i , T 3 (p)) is equal to or less than a predetermined threshold ε 3 , A set C i (i = 1,..., N) of the product varieties p ik (C) corresponding to them is extracted. This set of candidate varieties C i = {p ik (C) } is referred to as a “third candidate varietal set”. Here, p ik (C) represents the k-th element (article) included in the third candidate variety set C i .

第三候補群記憶部23は、印字画像マッチング・モジュール35が抽出する第三の候補物品種集合C={pik (C)}、及び、集合Cの各要素pik (C)に対するテンプレート印字画像T(pik (C))とそれに対応する印字画像Qとの印字画像距離L(Q,T(pik (C)))を記憶する。 The third candidate group storage unit 23 corresponds to the third candidate variety set C i = {p ik (C) } extracted by the print image matching module 35 and each element p ik (C) of the set C i . The print image distance L 3 (Q i , T 3 (p ik (C) )) between the template print image T 3 (p ik (C) ) and the corresponding print image Q i is stored.

刻印画像マッチング・モジュール36は、印字・刻印判別モジュール34により模様画像Qが刻印画像であると判別された場合、テンプレート記憶部20に記憶された各テンプレート刻印画像T(p)と刻印画像Qとの画像マッチングを実行し、テンプレート刻印画像T(p)と刻印画像Qとの距離L(Q,T(p))を算出する。この距離L(Q,T(p))を「刻印画像距離」という。また、刻印画像マッチング・モジュール36は、刻印画像距離L(G,T(p))が所定の閾値ε以下となるテンプレート刻印画像T(pik (E))を抽出し、それらに対応する物品種pik (E)の集合E(i=1,…,N)を抽出する。この候補物品種の集合E={pik (E)}を「第四の候補物品種集合」という。ここで、pik (E)は、第四の候補物品種の集合Eに含まれるk番目の要素(物品)を表す。 When the pattern image Q i is determined to be a stamped image by the printing / stamping determination module 34, the stamped image matching module 36 and each template stamped image T 4 (p) stored in the template storage unit 20 and the stamped image Image matching with Q i is executed, and a distance L 4 (Q i , T 4 (p)) between the template stamped image T 4 (p) and the stamped image Q i is calculated. This distance L 4 (Q i , T 3 (p)) is referred to as “engraved image distance”. Further, the imprinted image matching module 36 extracts a template imprinted image T 4 (p ik (E) ) in which the imprinted image distance L 4 (G i , T 4 (p)) is equal to or smaller than a predetermined threshold ε 4 , A set E i (i = 1,..., N) of product varieties p ik (E) corresponding to them is extracted. This set of candidate varieties E i = {p ik (E) } is referred to as a “fourth candidate varieties set”. Here, p ik (E) represents the k-th element (article) included in the fourth candidate variety set E i .

第四候補群記憶部24は、刻印画像マッチング・モジュール36が抽出する第四の候補物品種集合E={pik (E)}、及び、集合Eの各要素pik (E)に対するテンプレート刻印画像T(pik (E))とそれに対応する刻印画像Qとの刻印画像距離L(Q,T(pik (E)))を記憶する。 The fourth candidate group storage unit 24 corresponds to the fourth candidate variety set E i = {p ik (E) } extracted by the stamped image matching module 36 and each element p ik (E) of the set E i . The stamp image distance L 4 (Q i , T 4 (p ik (E) )) between the template stamp image T 4 (p ik (E) ) and the corresponding stamp image Q i is stored.

共通候補抽出モジュール37は、領域分離モジュール27が出力するN個の切出画像G(i=1,…,N)のそれぞれに対し、共通候補物品種集合P={pik}を抽出する。ここで、切出画像Gに印字画像Qが含まれる場合には、共通候補抽出モジュール37は、第1の候補物品種集合Aと第2の候補物品種集合Bと第3の候補物品種集合Cとに共通して含まれる物品種の集合を共通候補物品種集合P=A∩B∩Cとして抽出する。また、切出画像Gに刻印画像Qが含まれる場合には、共通候補抽出モジュール37は、第1の候補物品種集合Aと第2の候補物品種集合Bと第四の候補物品種集合Eとに共通して含まれる物品種の集合を共通候補物品種集合P=A∩B∩Eとして抽出する。また、切出画像Gに模様画像Qが含まれない場合には、共通候補抽出モジュール37は、第1の候補物品種集合Aと第2の候補物品種集合Bとに共通して含まれる物品種の集合を共通候補物品種集合P=A∩Bとして抽出する。 The common candidate extraction module 37 extracts a common candidate variety set P i = {p ik } for each of the N cut images G i (i = 1,..., N) output from the region separation module 27. To do. Here, when the print image Q i is included in the cut-out image G i , the common candidate extraction module 37 performs the first candidate variety set A i , the second candidate variety set B i, and the third A set of product varieties included in common with the candidate product variety set C i is extracted as a common candidate product set P i = A i ∩B i ∩C i . When the cut image G i includes the stamped image Q i , the common candidate extraction module 37 uses the first candidate product type set A i , the second candidate product type set B i, and the fourth candidate. A set of product types included in common with the product type set E i is extracted as a common candidate product type set P i = A i ∩B i ∩E i . If the cutout image G i does not include the pattern image Q i , the common candidate extraction module 37 is common to the first candidate variety set A i and the second candidate variety set B i. The set of product types included is extracted as a common candidate product type set P i = A i ∩B i .

共通候補記憶部25は、共通候補抽出モジュール37により抽出された共通候補物品種集合P(i=1,…,N)を記憶する。 The common candidate storage unit 25 stores the common candidate product type set P i (i = 1,..., N) extracted by the common candidate extraction module 37.

重量判定モジュール38は、共通候補記憶部25に記憶されたN個の共通候補物品種集合P,…,Pのそれぞれから1つずつ物品種を取り出して集めた共通候補の順列(p1α1,…,pNαN)について、テンプレート記憶部20に記憶された物品種の物品1個当たりの重量を共通候補の順列(p1α1,…,pNαN)について足し合わせた総重量Mを算出する。そして、計重器5が検出する総重量Mとの差|M−M|が所定の閾値ε以下となる共通候補の順列を抽出する。 The weight determination module 38 extracts a common product type from each of the N common candidate product type sets P 1 ,..., P N stored in the common candidate storage unit 25, and collects and collects the common candidate permutations (p 1α1 ,..., P NαN ), the total weight M j is calculated by adding the weight per article of the product type stored in the template storage unit 20 to the permutation (p 1α1 ,..., P NαN ) of the common candidates. . Then, a permutation of common candidates in which the difference | M j −M | from the total weight M detected by the weigher 5 is equal to or less than a predetermined threshold ε M is extracted.

共通候補順列記憶部26は、重量判定モジュール38が抽出する各共通候補の順列を記憶する。   The common candidate permutation storage unit 26 stores permutations of common candidates extracted by the weight determination module 38.

距離和演算モジュール39は、重量判定モジュール38により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート二次元画像T(piαi)とそれに対応する切出画像Gとの二次元画像距離L(G,T(piαi))をその共通候補の順列について足し合わせた第一の距離和D=Σ(G,T(piαi))を算出する。 The distance sum calculation module 39 generates a template two-dimensional image T 1 (p iαi ) corresponding to each product type p iαi for each permutation (p 1α1 ,..., P NαN ) extracted by the weight determination module 38. ) And the corresponding two-dimensional image distance L 1 (G i , T 1 (p iαi )) between the cut-out image G i and the common candidate permutation D 1 = Σ i L 1 (G i , T 1 (p iαi )) is calculated.

距離和演算モジュール40は、重量判定モジュール38により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート・ステレオ画像T(piαi)とそれに対応するステレオ画像Sとのステレオ画像距離L(S,T(piαi))をその共通候補の順列について足し合わせた第二の距離和D=Σ(S,T(piαi))を算出する。 Distance sum calculation module 40, the weight determination each common candidates permutations extracted by module 38 (p 1α1, ..., p NαN) relative to the template stereo image T 2 corresponding to each article type p iαi (p iαi ) And a stereo image distance L 2 (S i , T 2 (p iαi )) between the corresponding stereo image S i and the permutation of the common candidates, a second distance sum D 2 = Σ i L 2 ( S i , T 2 (p iαi )) is calculated.

距離和演算モジュール41は、重量判定モジュール38により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート印字画像T(piαi)とそれに対応する印字画像Qとの印字画像距離L(Q,T(piαi))をその共通候補の順列について足し合わせた第三の距離和D=Σ(Q,T(piαi))を算出する。 The distance sum calculation module 41 generates a template print image T 3 (p iαi ) corresponding to each product type p iαi for each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination module 38. And a print image distance L 3 (Q i , T 3 (p iαi )) between the corresponding print image Q i and a corresponding permutation of the common candidate D 3 = Σ i L 3 (Q i , T 3 (p iαi )) is calculated.

距離和演算モジュール42は、重量判定モジュール38により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート刻印画像T(piαi)とそれに対応する刻印画像Qとの刻印画像距離L(Q,T(piαi))をその共通候補の順列について足し合わせた第四の距離和D=Σ(S,T(piαi))を算出する。 The distance sum calculation module 42, for each permutation (p 1α1 ,..., P NαN ) of the common candidates extracted by the weight determination module 38, is a template stamp image T 4 (p iαi ) corresponding to each product type p iαi. And a stamped image distance L 4 (Q i , T 4 (p iαi )) between the corresponding stamped image Q i and the corresponding permutation of the common candidate D 4 = Σ i L 4 (S i , T 4 (p iαi )) is calculated.

総合判定モジュール43は、重量判定モジュール38により抽出された各共通候補の順列{(p1α1,…,pNαN)}のうち、第1の距離和D、第2の距離和D、第3の距離和D、及び第四の距離和Dの加重和c+c+c+c(c、c,c,cは重み定数)が最小となる共通候補の順列を抽出し、載置板4に載置された被検査物品の集合Sとして出力する。 The overall determination module 43 includes, among the permutations {(p 1α1 ,..., P NαN )} of the common candidates extracted by the weight determination module 38, the first distance sum D 1 , the second distance sum D 2 , weighted sum of the third distance sum D 3, and a fourth distance sum D 4 c 1 D 1 + c 2 D 2 + c 3 D 3 + c 4 D 4 (c 1, c 2, c 3, c 4 are weighting constants) Is extracted as a set S of articles to be inspected placed on the placing plate 4.

出力モジュール44は、総合判定モジュール43が出力する被検査物品の集合Sと、予め設定された正しい物品の集合Sとを比較して、S=Sの場合には出力装置45に対して整合信号を出力し、S≠Sの場合には出力装置45に対して不整合信号を出力する。 The output module 44 compares the set S of articles to be inspected output from the comprehensive determination module 43 with a set of correct articles S 0 set in advance. If S = S 0 , the output module 44 A matching signal is output. When S ≠ S 0 , a mismatch signal is output to the output device 45.

出力装置45は、出力モジュール44から不整合信号が出力された場合には画像や音声によって使用者に対して警告を報知する。   When the mismatch signal is output from the output module 44, the output device 45 notifies the user of a warning by an image or sound.

以上のように構成された本発明の実施例1に係る粒状物品種検査装置1について、以下その動作を説明する。   The operation of the particulate matter type inspection apparatus 1 according to the first embodiment of the present invention configured as described above will be described below.

図3は実施例1に係る粒状物品種検査装置1の動作を表すフローチャートである。   FIG. 3 is a flowchart showing the operation of the granular material type inspection apparatus 1 according to the first embodiment.

使用者は、まず、予め、透明袋Aに合包される物品の正しい物品の組み合わせの集合S={p01,…,p0m}を出力モジュール44に設定しておく。そして、被検査物品Bが包装された透明な透明袋Aを、載置板4の上に載せる。例として、被検査物品Bは、図4に示したような錠剤やカプセル等の粒状薬剤であるとする。 The user first sets a set S 0 = {p 01 ,..., P 0m } of correct article combinations of articles to be packaged in the transparent bag A in the output module 44 in advance. Then, the transparent transparent bag A in which the article to be inspected B is packaged is placed on the mounting plate 4. As an example, it is assumed that the inspected article B is a granular medicine such as a tablet or a capsule as shown in FIG.

まず、ステップS1において、照明コントローラ33は、第一照明6、第二照明7、及び第三照明8を点灯させ、第一カメラ9、第二カメラ10、及び第三カメラ11は、載置板4上に載置された透明袋Aに包装された被検査物品Bを撮像する。符号の規約に従って、第一カメラ9、第二カメラ10、及び第三カメラ11で撮像された画像を、G(1),G(2),G(3)と記す。各画像は、領域分離モジュール27へ出力される。 First, in step S1, the illumination controller 33 turns on the first illumination 6, the second illumination 7, and the third illumination 8, and the first camera 9, the second camera 10, and the third camera 11 are mounted plates. An image of the inspected article B packaged in the transparent bag A placed on the image 4 is taken. Images taken by the first camera 9, the second camera 10, and the third camera 11 in accordance with the code convention are denoted as G (1) , G (2) , G (3) . Each image is output to the region separation module 27.

このとき、被検査物品Bの表面に付された刻印の画像を明確に浮かび上がらせるために、照明コントローラ33は、第一照明6のみ又は第二照明7のみを点灯させて、第一カメラ9及び第二カメラ10での撮影を行うようにすることもできる。   At this time, in order to clearly highlight the image of the inscription on the surface of the article B to be inspected, the illumination controller 33 turns on only the first illumination 6 or only the second illumination 7 and turns on the first camera 9 and It is also possible to perform shooting with the second camera 10.

次に、ステップS2において、領域分離モジュール27は、画像G(1),G(2),G(3)のそれぞれについて、その画像内に含まれる被検査物品Bの部分画像を切り出す。これにより得られる部分画像を切出画像{G (n),…,G (n)}(n=1,2,3)とする。例えば、図4に示した粒状薬剤が被検査物品Bとして透明袋Aに包装されている場合、N=7なので、全部で7×3=21個の切出画像が生成される。それぞれの切出画像はラベリングされ、異なるカメラで撮影された同じ物品の切出画像には同じ物品ラベル(番号)が付される。切出画像をG (n)と記すとき、iが物品ラベルを表している。 Next, in step S2, the region separation module 27 cuts out a partial image of the inspected article B included in each of the images G (1) , G (2) , and G (3) . The partial images obtained in this way are cut out images {G 1 (n) ,..., G N (n) } (n = 1, 2, 3). For example, when the granular medicine shown in FIG. 4 is packaged in the transparent bag A as the article B to be inspected, N = 7, and thus 7 × 3 = 21 cutout images are generated in total. Each cut-out image is labeled, and the same article label (number) is attached to the cut-out image of the same article taken by different cameras. When the cut image is denoted as G i (n) , i represents an article label.

次に、ステップS3において、画像選択モジュール28は、物品ラベルiの小さい順に、切出画像をG (1),G (2),G (3)を選択する。 Next, in step S3, the image selection module 28 selects G i (1) , G i (2) , G i (3) as the cut-out images in ascending order of the article label i.

次に、ステップS4において、二次元画像マッチング・モジュール29は、切出画像G (1),G (2),G (3)とテンプレート記憶部20に記憶された各テンプレート二次元画像T(p)との二次元画像マッチングを実行し、テンプレート二次元画像T(p)と切出画像G (n)との二次元画像距離L(G (n),T(p))を算出する。ここで、二次元画像マッチングは切出画像G (1),G (2),G (3)のすべてについて行う必要はなく、これら3つの切出画像のうち1つについて実行すればよい。従って、例えば、テンプレート記憶部20にM個の物品pのテンプレート二次元画像T(p)が記憶されている場合、M回の二次元画像マッチングが実行される。二次元画像マッチングについては、公知の方法を用いることができ、例えば、DPマッチングなどのエラスティック・マッチング・アルゴリズムが用いられる。 Next, in step S < b > 4, the two-dimensional image matching module 29 performs the cut-out images G i (1) , G i (2) , G i (3) and the template two-dimensional images stored in the template storage unit 20. Two-dimensional image matching with T 1 (p) is executed, and a two-dimensional image distance L 1 (G i (n) , T 1 between the template two-dimensional image T 1 (p) and the cut-out image G i (n). (P)) is calculated. Here, the two-dimensional image matching need not be performed for all of the cut-out images G i (1) , G i (2) , and G i (3). Good. Therefore, for example, when template two-dimensional images T 1 (p) of M articles p are stored in the template storage unit 20, M times of two-dimensional image matching are executed. For the two-dimensional image matching, a known method can be used. For example, an elastic matching algorithm such as DP matching is used.

二次元画像距離L(G (n),T(p))は次式で表される。 The two-dimensional image distance L 1 (G i (n) , T 1 (p)) is expressed by the following equation.

ここで、Φはアフィン変換を表す。‖・‖は距離(ノルム)を表し、‖T(p)−Φ(G (n))‖は画像T(p)と画像Φ(G (n))の対応点間の距離の平均値である。 Here, Φ represents an affine transformation. ‖ / ‖ Represents a distance (norm), and ‖T 1 (p) −Φ (G i (n) ) ‖ is a distance between corresponding points of the image T 1 (p) and the image Φ (G i (n) ). Is the average value.

そして、二次元画像マッチング・モジュール29は、二次元画像距離L(G (n),T(p))が所定の閾値ε以下となるテンプレート二次元画像T(pik (A))を抽出し、それらに対応する物品種pik (A)の集合(第一の候補物品種集合)Aを抽出する。すなわち、第一の候補物品種集合Aは次のように表される。 Then, the two-dimensional image matching module 29 outputs a template two-dimensional image T 1 (p ik (A ) in which the two-dimensional image distance L 1 (G i (n) , T 1 (p)) is equal to or less than a predetermined threshold ε 1. ) ) Is extracted, and a set of product varieties p ik (A) corresponding to them (first candidate product type set) A i is extracted. That is, the first candidate variety set A i is expressed as follows.

抽出された第一の候補物品種集合Aと、その各要素pik (A)に対する二次元画像距離L(G (n),T(p))は、第一候補群記憶部21に保存される。 The extracted first candidate variety set A i and the two-dimensional image distance L 1 (G i (n) , T 1 (p)) for each element p ik (A ) are the first candidate group storage unit 21 is stored.

次に、ステップS5において、ステレオ画像合成モジュール30が、第一カメラ9及び第二カメラ10により撮像されるN組の切出画像の対(G (1),G (2))から、被検査物品のステレオ画像Sを合成する。次いで、ステレオ・マッチング・モジュール31は、テンプレート記憶部20に記憶された各テンプレート・ステレオ画像T(p)と、各ステレオ画像Sとのステレオ・マッチングを実行し、テンプレート・ステレオ画像T(p)とステレオ画像Sとのステレオ画像距離L(S,T(p))を算出する。ステレオ・マッチングについても、公知の方法を用いることができ、例えば、DPマッチングなどのエラスティック・マッチング・アルゴリズムが用いられる。 Next, in step S < b > 5, the stereo image synthesis module 30 determines from the N sets of clipped image pairs (G i (1) , G i (2) ) captured by the first camera 9 and the second camera 10. A stereo image S i of the article to be inspected is synthesized. Next, the stereo matching module 31 performs stereo matching between each template stereo image T 2 (p) stored in the template storage unit 20 and each stereo image S i, and the template stereo image T 2. A stereo image distance L 2 (S i , T 2 (p)) between (p) and the stereo image S i is calculated. Also for stereo matching, a known method can be used, and for example, an elastic matching algorithm such as DP matching is used.

ステレオ画像距離L(S,T(p))は次式で表される。 The stereo image distance L 2 (S i , T 2 (p)) is expressed by the following equation.

そして、ステレオ・マッチング・モジュール31は、ステレオ画像距離L(G,T(p))が所定の閾値ε以下となるテンプレート・ステレオ画像T(pik (B))を抽出し、それらに対応する物品種pik (B)の集合(第二の候補物品種集合)Bを抽出する。すなわち、第二の候補物品種集合Bは次のように表される。 Then, the stereo matching module 31 extracts a template stereo image T 2 (p ik (B) ) in which the stereo image distance L 2 (G i , T 2 (p)) is equal to or less than a predetermined threshold ε 2. Then, a set of product varieties p ik (B) corresponding to them (second candidate product type set) B i is extracted. That is, the second candidate variety set B i is expressed as follows.

抽出された第二の候補物品種集合Bと、その各要素pik (B)に対するステレオ画像距離L(S,T(pik (B)))は、第二候補群記憶部22に保存される。 The extracted second candidate variety set B i and the stereo image distance L 2 (S i , T 2 (p ik (B) )) for each element p ik (B ) are the second candidate group storage unit 22 is stored.

次に、ステップS6において、模様画像抽出モジュール32は、切出画像G (1),G (2),G (3)について、各切出画像G (n)内の物品の表面に模様画像が存在するか否かを判定する。模様画像が存在する場合には、模様画像抽出モジュール32はその模様画像Qを抽出する。 Next, in step S < b > 6, the pattern image extraction module 32 performs the surface of the article in each cut-out image G i (n) for the cut-out images G i (1) , G i (2) , G i (3). It is determined whether or not there is a pattern image. If a pattern image exists, the pattern image extraction module 32 extracts the pattern image Q i .

図5に、模様画像を含む物品画像の例を示す。図5(a)は物品の表面に印字がされている場合であり、図5(b)(c)は物品の表面に刻印がされている場合である。図5(c)に示したように、印字や刻印は物品の一方の面にのみ付されている場合が多い。従って、表側の面の切出画像G (1)又はG (2)と裏面の切出画像G (3)とを用いて模様画像Qを抽出することにより、確実に模様画像Qの抽出ができる。 FIG. 5 shows an example of an article image including a pattern image. FIG. 5A shows a case where the surface of the article is printed, and FIGS. 5B and 5C show a case where the surface of the article is marked. As shown in FIG. 5C, in many cases, printing or engraving is applied only to one surface of an article. Therefore, by extracting the pattern image Q i using the cut-out image G i (1) or G i (2) on the front side surface and the cut-out image G i (3) on the back side, the pattern image Q can be surely obtained. i can be extracted.

尚、模様画像が抽出されなかった場合には、模様画像抽出モジュール32は、照明コントローラ33により、第一照明6又は第二照明7の一方のみを点灯させて、第一カメラ9及び第二カメラ10での撮影を再度行い、切出画像G (1),G (2)を再作成し、再度模様画像の抽出を行うようにしてもよい。このようにすれば、被検査物品Bの表面に付された刻印が不鮮明な場合でも、被検査物品Bの表面に付された刻印の画像を明確に浮かび上がらせることができるので、刻印画像をより確実に抽出することができるようになる。 When the pattern image is not extracted, the pattern image extraction module 32 causes the illumination controller 33 to turn on only one of the first illumination 6 or the second illumination 7 and the first camera 9 and the second camera. 10 may be performed again, the cut-out images G i (1) and G i (2) may be re-created, and the pattern image may be extracted again. In this way, even when the marking on the surface of the article to be inspected B is unclear, the image of the marking on the surface of the article to be inspected B can be clearly raised. It becomes possible to extract reliably.

次に、ステップS7において、模様画像抽出モジュール32により模様画像Qが抽出された場合には、次のステップS8に遷移し、模様画像が抽出されなかった場合は、ステップS11に遷移する。 Next, when the pattern image Q i is extracted by the pattern image extraction module 32 in step S7, the process proceeds to the next step S8, and when the pattern image is not extracted, the process proceeds to step S11.

次に、ステップS8において、印字・刻印判別モジュール34は、模様画像抽出モジュール32により抽出された模様画像Qが、印字画像であるか刻印画像であるかを判別する。ここで、印字画像か刻印画像かの判定は、模様画像のエッジの勾配を判定することにより判別することができる。すなわち、印字画像の場合は模様画像のエッジの勾配が急峻であり、刻印画像の場合は模様画像のエッジの勾配が緩やかである。従って、模様画像のエッジ画像のエッジ部分の平均値を閾値判定することによって、模様画像が印字画像か刻印画像かが判別される。模様画像Qが印字画像である場合にはステップS9に遷移し、模様画像Qが刻印画像である場合にはステップS10に遷移する。 Next, in step S8, the printing / stamping determination module 34 determines whether the pattern image Q i extracted by the pattern image extraction module 32 is a printing image or a stamping image. Here, whether the image is a printed image or a stamped image can be determined by determining the gradient of the edge of the pattern image. In other words, the gradient of the edge of the pattern image is steep in the case of a printed image, and the gradient of the edge of the pattern image is gentle in the case of a stamped image. Accordingly, whether the pattern image is a printed image or a stamped image is determined by determining a threshold value for the average value of the edge portions of the edge image of the pattern image. If the pattern image Q i is a print image, the process proceeds to step S9. If the pattern image Q i is a stamped image, the process proceeds to step S10.

模様画像Qが印字画像の場合、ステップS9において、印字画像マッチング・モジュール35は、テンプレート記憶部20に記憶された各テンプレート印字画像T(p)と印字画像Qとの画像マッチングを実行し、テンプレート印字画像T(p)と印字画像Qとの印字画像距離L(Q,T(p))を算出する。 If the pattern image Q i is a print image, in step S9, the print image matching module 35 executes image matching between each template print image T 3 (p) stored in the template storage unit 20 and the print image Q i. Then, a print image distance L 3 (Q i , T 3 (p)) between the template print image T 3 (p) and the print image Q i is calculated.

印字画像距離L(Q,T(p))は次式で表される。 The print image distance L 3 (Q i , T 3 (p)) is expressed by the following equation.

そして、印字画像マッチング・モジュール35は、印字画像距離L(Q,T(p))が所定の閾値ε以下となるテンプレート印字画像T(pik (C))を抽出し、それらに対応する物品種pik (C)の集合(第三の候補物品種集合)Cを抽出する。すなわち、第三の候補物品種集合Cは次のように表される。 Then, the print image matching module 35 extracts a template print image T 3 (p ik (C) ) in which the print image distance L 3 (Q i , T 3 (p)) is equal to or less than a predetermined threshold ε 3 , A set of product varieties p ik (C) corresponding to them (third candidate variety set) C i is extracted. That is, the third candidate variety set C i is expressed as follows.

抽出された、第三の候補物品種集合Cと、その各要素pik (C)に対する印字画像距離L(Q,T(p))は、第三候補群記憶部23に保存される。 The extracted third candidate variety set C i and the print image distance L 3 (Q i , T 3 (p)) for each element p ik (C) are stored in the third candidate group storage unit 23. Is done.

一方、模様画像Qが刻印画像の場合、ステップS10において、刻印画像マッチング・モジュール36は、テンプレート記憶部20に記憶された各テンプレート刻印画像T(p)と刻印画像Qとの画像マッチングを実行し、テンプレート刻印画像T(p)と刻印画像Qとの刻印画像距離L(Q,T(p))を算出する。 On the other hand, when the pattern image Q i is a stamp image, in step S10, the stamp image matching module 36 performs image matching between each template stamp image T 4 (p) stored in the template storage unit 20 and the stamp image Q i. Is executed, and a stamped image distance L 4 (Q i , T 4 (p)) between the template stamped image T 4 (p) and the stamped image Q i is calculated.

刻印画像距離L(Q,T(p))は次式で表される。 The stamped image distance L 4 (Q i , T 4 (p)) is expressed by the following equation.

そして、刻印画像マッチング・モジュール36は、刻印画像距離L(G,T(p))が所定の閾値ε以下となるテンプレート刻印画像T(pik (E))を抽出し、それらに対応する物品種pik (E)の集合(第四の候補物品種集合)E(i=1,…,N)を抽出する。すなわち、第四の候補物品種集合Eは次のように表される。 Then, the stamped image matching module 36 extracts a template stamped image T 4 (p ik (E) ) in which the stamped image distance L 4 (G i , T 4 (p)) is equal to or less than a predetermined threshold ε 4 . A set (fourth candidate variety set) E i (i = 1,..., N) of the product varieties p ik (E) corresponding to them is extracted. That is, the fourth candidate variety set E i is expressed as follows.

抽出された、第四の候補物品種集合Eと、その各要素pik (E)に対する刻印画像距離L(Q,T(p))は、第四候補群記憶部24に保存される。 The extracted fourth candidate variety set E i and the stamped image distance L 4 (Q i , T 4 (p)) for each element p ik (E) are stored in the fourth candidate group storage unit 24. Is done.

次に、ステップS11において、共通候補抽出モジュール37は、切出画像Gに対する共通候補物品種集合P={pik}を抽出する。この抽出処理は、印字画像、刻印画像の有無によって次のように行われる。 Next, in step S11, the common candidate extraction module 37 extracts a common candidate variety set P i = {p ik } for the cut image G i . This extraction process is performed as follows depending on the presence or absence of a printed image or a stamped image.

(1)切出画像Gに印字画像Qが含まれる場合
共通候補抽出モジュール37は、第1の候補物品種集合Aと第2の候補物品種集合Bと第3の候補物品種集合Cとに共通して含まれる物品種の集合を共通候補物品種集合Pとして抽出する。
(1) When the cut image G i includes the print image Q i The common candidate extraction module 37 performs the first candidate variety set A i , the second candidate variety set B i, and the third candidate variety. A set of product types included in common with the set C i is extracted as a common candidate product type set P i .

(2)切出画像Gに刻印画像Qが含まれる場合
共通候補抽出モジュール37は、第1の候補物品種集合Aと第2の候補物品種集合Bと第四の候補物品種集合Eとに共通して含まれる物品種の集合を共通候補物品種集合Pとして抽出する。
(2) When the cut image G i includes the stamped image Q i The common candidate extraction module 37 performs the first candidate variety set A i , the second candidate variety set B i, and the fourth candidate variety. A set of product types included in common with the set E i is extracted as a common candidate product type set P i .

(3)切出画像Gに模様画像Qが含まれない場合
共通候補抽出モジュール37は、第1の候補物品種集合Aと第2の候補物品種集合Bとに共通して含まれる物品種の集合を共通候補物品種集合Pとして抽出する。
すなわち、共通候補物品種集合Pは次のようになる。
(3) When the cutout image G i does not include the pattern image Q i The common candidate extraction module 37 is included in both the first candidate variety set A i and the second candidate variety set B i extracting a set of the ones varieties common candidate varieties set P i.
That is, the common candidate variety set P i is as follows.

抽出された共通候補物品種集合Pは、共通候補記憶部25に保存される。 The extracted common candidate variety set Pi is stored in the common candidate storage unit 25.

次に、ステップS12において、すべての切出画像Gに対して、ステップS3〜S11までの処理が終了したかを判定して、終了していなければステップS3に戻り、終了していれば、次のステップS13に遷移する。 Next, in step S12, for all the clipped images G i, and determines whether the processing of steps S3~S11 is completed, if not completed the process returns to step S3, if completed, The process proceeds to the next step S13.

次に、ステップS13において、重量判定モジュール38は、計重器5が出力する被検査物品Bの総重量Mを取得する。   Next, in step S <b> 13, the weight determination module 38 acquires the total weight M of the inspected article B output from the weigher 5.

次に、ステップS14において、重量判定モジュール38は、共通候補記憶部25に記憶されたN個の共通候補物品種集合P,…,Pのそれぞれから1つずつ物品種を取り出して集めた共通候補の順列o(α,…,α)=(p1α1,…,pNαN)を作る。そして、この順列o(α,…,α)の各要素piαiについて、テンプレート記憶部20に記憶された物品種の物品1個当たりの重量w(piαi)を取得し、それらの重量w(piαi)を足し合わせた総重量M(α,…,α)を算出する。 Next, in step S14, the weight determination module 38 takes out and collects one product type from each of the N common candidate product type sets P 1 ,..., P N stored in the common candidate storage unit 25. A common candidate permutation o (α 1 ,..., Α N ) = (p 1α1 ,..., P NαN ) is created . Then, for each element p iαi of this permutation o (α 1 ,..., Α N ), the weight w (p iαi ) per article of the product type stored in the template storage unit 20 is acquired, and their weights The total weight M j1 ,..., α N ) obtained by adding w (p iαi ) is calculated.

そして、重量判定モジュール38は、計重器5が検出する総重量Mとの差|M(α,…,α)−M|が所定の閾値ε以下となる共通候補の順列の集合Osを抽出する。すなわち、順列集合Osは次のようになる。 Then, the weight determination module 38 generates a common candidate permutation in which the difference | M j1 ,..., Α N ) −M | from the total weight M detected by the weigher 5 is equal to or less than a predetermined threshold value ε M. A set Os is extracted. That is, the permutation set Os is as follows.

次に、ステップS15において、順列集合Osの各要素o(α,…,α)について、距離和演算モジュール39,40,41,42は、それぞれ、第一の距離和D(α,…,α),第二の距離和D(α,…,α),第三の距離和D(α,…,α),第四の距離和D(α,…,α)を次式により算出する。 Next, in step S15, for each element o (α 1 ,..., Α N ) of the permutation set Os, the distance sum calculation modules 39, 40, 41, and 42 respectively receive the first distance sum D 11 ,..., Α N ), second distance sum D 21 ,..., Α N ), third distance sum D 31 ,..., Α N ), fourth distance sum D 41 ,..., Α N ) is calculated by the following equation.

次いで、総合判定モジュール43は、順列集合Osの各要素o(α,…,α)について、第1の距離和D(α,…,α)、第2の距離和D(α,…,α)、第3の距離和D(α,…,α)、及び第四の距離和D(α,…,α)の加重和D(α,…,α)を次式により算出する。 Next, the comprehensive determination module 43 uses a first distance sum D 11 ,..., Α N ) and a second distance sum D 2 for each element o (α 1 ,..., Α N ) of the permutation set Os. (Α 1 ,..., Α N ), a third distance sum D 31 ,..., Α N ), and a fourth distance sum D 41 ,..., Α N ), a weighted sum D (α 1 ,..., Α N ) is calculated by the following equation.

ここで、c,c,c,cは重み定数であり、実験的に最適な値に決めるとよい。 Here, c 1 , c 2 , c 3 , and c 4 are weight constants, and may be determined to be optimal values experimentally.

そして、総合判定モジュール43は、加重和D(α,…,α)が最小となる共通候補の順列o(β,…,β)を抽出し、載置板4に載置された被検査物品の集合Sとして出力する。すなわち、集合Sは次のようになる。 Then, the comprehensive determination module 43 extracts a permutation o (β 1 ,..., Β N ) of common candidates that minimizes the weighted sum D (α 1 ,..., Α N ), and is placed on the placement plate 4. Output as a set S of inspected articles. That is, the set S is as follows.

最後に、ステップS16において、出力モジュール44は、総合判定モジュール43が出力する被検査物品の集合Sと、予め設定された正しい物品の集合Sとを比較して、S=Sの場合には出力装置45に対して整合信号を出力し、S≠Sの場合には出力装置45に対して不整合信号を出力する。そして、出力装置45は、出力モジュール44から不整合信号が出力された場合には画像や音声によって使用者に対して警告を報知する。 Finally, in step S16, the output module 44 compares the set S of the article to be inspected for total determination module 43 outputs, and a set S 0 of the correct article has been set in advance, in the case of S = S 0 Outputs a matching signal to the output device 45, and outputs a mismatch signal to the output device 45 when S ≠ S 0 . When the mismatch signal is output from the output module 44, the output device 45 notifies the user of a warning by an image or sound.

以上のように、本実施例の粒状物品種検査装置1では、二次元の画像マッチングに加えて、ステレオ・マッチングにより薬剤の判別を行うとともに、各被検査物品の重量和によって判別候補の絞り込みを行うので、粒状物品の種類を判別し検査する際の判別精度を向上させることができる。更に、物品に印字や刻印が付されている場合には、その印字や刻印の照合も併せて行うことで、更に精度を向上させることができる。   As described above, in the granular material type inspection apparatus 1 according to the present embodiment, in addition to two-dimensional image matching, the drug is determined by stereo matching, and the determination candidates are narrowed down by the sum of the weights of the articles to be inspected. Therefore, it is possible to improve the discrimination accuracy when discriminating and inspecting the type of granular article. Further, when the article is printed or engraved, the accuracy can be further improved by performing collation of the printing or engraving together.

また、本実施例においては、印字画像マッチング・モジュール35及び刻印画像マッチング・モジュール36を備えて、印字画像や刻印画像のマッチングも行うようにしたが、用途によっては、被検査物品に印字や刻印が付されていないことが最初から明らかな場合もある。そのような場合、模様画像抽出モジュール32、印字・刻印判別モジュール34、印字画像マッチング・モジュール35、刻印画像マッチング・モジュール36を省略することができる。これらのモジュールを省略する場合、共通候補抽出モジュール37は、常に、共通候補物品種集合Pとして、第1の候補物品種集合Aと第2の候補物品種集合Bとに共通して含まれる物品種の集合を抽出するように変更する。すなわち、共通候補物品種集合Pは次式のようになる。 In this embodiment, the print image matching module 35 and the stamped image matching module 36 are provided to perform matching of the print image and the stamped image. However, depending on the application, printing or stamping may be performed on the inspected article. Sometimes it is clear from the beginning that is not attached. In such a case, the pattern image extraction module 32, the printing / engraving discrimination module 34, the printing image matching module 35, and the engraving image matching module 36 can be omitted. When these modules are omitted, the common candidate extraction module 37 is always common to the first candidate variety set A i and the second candidate variety set B i as the common candidate variety set P i. Change to extract a set of included product types. That is, the common candidate variety set Pi is as follows.

尚、本実施例では、一例として、粒状薬剤の検査について述べたが、本発明の粒状物品種検査装置は、粒状薬剤以外の粒状の被検査物品についても適用することが可能である。   In the present embodiment, the inspection of the granular medicine is described as an example, but the granular material type inspection apparatus of the present invention can also be applied to granular inspected articles other than the granular medicine.

本発明の実施例1に係る粒状物品種検査装置の構成を示す図である。It is a figure which shows the structure of the granular material kind inspection apparatus which concerns on Example 1 of this invention. 実施例1に係る粒状物品種検査装置1の機能ブロック図である。It is a functional block diagram of the granular material kind inspection apparatus 1 which concerns on Example 1. FIG. 実施例1に係る粒状物品種検査装置1の動作を表すフローチャートである。3 is a flowchart showing the operation of the granular material type inspection apparatus 1 according to the first embodiment. 被検査物品Bの例である。It is an example of inspected article B. 模様画像を含む物品画像の例である。It is an example of the article | item image containing a pattern image. 特許文献1に記載の分包薬剤の検薬装置を示す図である。It is a figure which shows the medicine inspection apparatus of the packaging medicine of patent document 1.

符号の説明Explanation of symbols

1 粒状物品種検査装置
2 撮影ユニット
3 制御装置
4 載置板
4a 遮光板
5 計重器
6 第一照明
7 第二照明
8 第三照明
9 第一カメラ
10 第二カメラ
11 第三カメラ
20 テンプレート記憶部
21 第一候補群記憶部
22 第二候補群記憶部
23 第三候補群記憶部
24 第四候補群記憶部
25 共通候補記憶部
26 共通候補順列記憶部
27 領域分離モジュール
28 画像選択モジュール
29 二次元画像マッチング・モジュール
30 ステレオ画像合成モジュール
31 ステレオ・マッチング・モジュール
32 模様画像抽出モジュール
33 照明コントローラ
34 印字・刻印判別モジュール
35 印字画像マッチング・モジュール
36 刻印画像マッチング・モジュール
37 共通候補抽出モジュール
38 重量判定モジュール
39,40,41,42 距離和演算モジュール
43 総合判定モジュール
44 出力モジュール
45 出力装置
A 包装袋
B 被検査物品
DESCRIPTION OF SYMBOLS 1 Granules kind inspection apparatus 2 Image pick-up unit 3 Control apparatus 4 Mounting plate 4a Light-shielding plate 5 Weighing instrument 6 First illumination 7 Second illumination 8 Third illumination 9 First camera 10 Second camera 11 Third camera 20 Template storage Unit 21 first candidate group storage unit 22 second candidate group storage unit 23 third candidate group storage unit 24 fourth candidate group storage unit 25 common candidate storage unit 26 common candidate permutation storage unit 27 region separation module 28 image selection module 29 Dimensional image matching module 30 Stereo image synthesis module 31 Stereo matching module 32 Pattern image extraction module 33 Illumination controller 34 Printing / engraving discrimination module 35 Printed image matching module 36 Engraving image matching module 37 Common candidate extraction module 38 Weight determination Module 39, 40, 41, 42 Distance Calculation module 43 Overall judgment module 44 the output module 45 output apparatus A packaging bag B the article to be inspected

Claims (4)

被検査物品を載置する載置板と、
前記載置板上に載置される被検査物品を斜め上方から撮像する第一の撮像装置と、
前記載置板上に載置される被検査物品を前記第一の撮像装置とは異なる方角の斜め上方から撮像する第二の撮像装置と、
前記載置板上に載置された被検査物品の総重量Mを検出する計重器と、
前記第一及び第二の撮像装置で撮像されたそれぞれの画像から、前記載置板上に載置されたN個(N≧1)の被検査物品の画像を切り出して切出画像{G (n),…,G (n)}(n=1,2:nは撮像装置の番号)を生成する領域分離手段と、
検査対象となる複数種の物品を、各物品種ごとに、その物品種pの物品を撮影したテンプレート二次元画像{T(p)}、その物品種の物品のステレオ・画像であるテンプレート・ステレオ画像{T(p)}、並びにその物品種の物品1個当たりの重量{m(p)}を当該物品種pと関連づけて記憶するテンプレート記憶手段と、
前記テンプレート記憶手段に記憶された各テンプレート二次元画像T(p)と前記第一又は第二の撮像装置により撮像された前記各切出画像G (n)(i=1,…,N)との二次元画像マッチングを実行し、前記テンプレート二次元画像と前記切出画像との距離(以下「二次元画像距離」)L(G (n),T(p))が所定の閾値以下である候補となる物品種の集合(以下「第一の候補物品種集合」)A(i=1,…,N)を抽出する二次元画像マッチング手段と、
前記第一及び第二の撮像装置により撮像されるN組の前記切出画像の対{(G (1),G (2)),…,(G (1),G (2))}から、N個の被検査物品のステレオ画像{S,…,S}を合成するステレオ画像合成手段と、
前記テンプレート記憶手段に記憶された前記各テンプレート・ステレオ画像T(p)と、前記ステレオ画像合成手段により合成された前記各ステレオ画像S(i=1,…,N)とのステレオ・マッチングを実行し、前記テンプレート・ステレオ画像と前記ステレオ画像との距離(以下「ステレオ画像距離」)L(S,T(p))が所定の閾値以下である候補となる物品種の集合(以下「第二の候補物品種集合」)B(i=1,…,N)を抽出するステレオ・マッチング手段と、
N個の前記各切出画像G(i=1,…,N)のそれぞれに対し、前記第一の候補物品種集合Aと前記第二の候補物品種集合Bとに共通して含まれる物品種の集合(以下「共通候補物品種集合」)P=A∩B={pik}を抽出する共通候補抽出手段と、
N個の前記共通候補物品種集合P,…,Pのそれぞれから1つずつ物品種を取り出して集めた共通候補の順列(p1α1,…,pNαN)の中から、前記テンプレート記憶手段に記憶された物品種の物品1個当たりの重量を前記共通候補の順列(p1α1,…,pNαN)について足し合わせた総重量Mと、前記計重器が検出する総重量Mとの差|M−M|が所定の閾値ε以下となる共通候補の順列を抽出する重量判定手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート二次元画像T(piαi)とそれに対応する切出画像G (n)との距離をその共通候補の順列について足し合わせた第一の距離和D=Σ(G (n),T(piαi))を算出する第一の距離和演算手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート・ステレオ画像T(piαi)とそれに対応するステレオ画像Sとの距離をその共通候補の順列について足し合わせた第二の距離和D=Σ(S,T(piαi))を算出する第二の距離和演算手段と、
前記重量判定手段により抽出された各共通候補の順列{(p1α1,…,pNαN)}のうち、前記第一の距離和Dと前記第二の距離和Dとの加重和c+cが最小となる共通候補の順列を抽出し、前記載置板に載置された被検査物品の集合として出力する総合判定手段と、
を備えたことを特徴とする粒状物品種検査装置。
A mounting plate for mounting the article to be inspected;
A first imaging device for imaging the article to be inspected placed on the placing plate from above obliquely;
A second imaging device for imaging an article to be inspected placed on the mounting plate from an obliquely upward direction in a direction different from that of the first imaging device;
A weigher for detecting the total weight M of the article to be inspected placed on the placing plate;
N images (N ≧ 1) of articles to be inspected placed on the mounting plate are cut out from the images picked up by the first and second image pickup devices, and cut out images {G 1 (N) ,..., G N (n) } (n = 1, 2: n is the number of the imaging device);
A template two-dimensional image {T 1 (p)} obtained by photographing a plurality of types of articles to be inspected for each type of product, and a product of the product type p. Template storage means for storing the stereo image {T 2 (p)} and the weight {m (p)} per article of the product type in association with the product type p;
Each template two-dimensional image T 1 (p) stored in the template storage means and each cut-out image G i (n) (i = 1,..., N ) captured by the first or second imaging device ) And a distance between the template two-dimensional image and the cut-out image (hereinafter referred to as “two-dimensional image distance”) L 1 (G i (n) , T 1 (p)) is predetermined. A two-dimensional image matching means for extracting a set of candidate product types that are equal to or less than a threshold value (hereinafter, “first candidate product type set”) A i (i = 1,..., N);
N pairs of the cutout images {(G 1 (1) , G 1 (2) ),..., (G N (1) , G N (2 ) captured by the first and second imaging devices] ) )}, A stereo image synthesizing means for synthesizing stereo images {S 1 ,..., S N } of N inspected articles;
Stereo matching between each template stereo image T 2 (p) stored in the template storage means and each stereo image S i (i = 1,..., N) synthesized by the stereo image synthesis means. And a set of candidate product types whose distance between the template stereo image and the stereo image (hereinafter “stereo image distance”) L 2 (S i , T 2 (p)) is equal to or less than a predetermined threshold (Hereinafter “second candidate product set”) stereo matching means for extracting B i (i = 1,..., N);
For each of the N cutout images G i (i = 1,..., N), the first candidate variety set A i and the second candidate variety set B i are commonly used. A common candidate extraction means for extracting a set of contained product types (hereinafter, “common candidate product type set”) P i = A i ∩B i = {p ik };
From the permutations (p 1α1 ,..., P NαN ) of common candidates obtained by collecting one product type from each of the N common candidate product types sets P 1 ,. , The total weight M j obtained by adding the weights per article of the product types stored for the common candidate permutation (p 1α1 ,..., P NαN ), and the total weight M detected by the weigher Weight determination means for extracting a permutation of common candidates for which the difference | M j −M | is equal to or less than a predetermined threshold value ε M ;
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template two-dimensional image T 1 (p iαi ) corresponding to each product type p iαi and a corresponding cut-out. The first distance sum D 1 = Σ i L 1 (G i (n) , T 1 (p iαi )) is calculated by adding the distance to the image G i (n) with respect to the permutations of the common candidates. A distance sum calculation means,
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template stereo image T 2 (p iαi ) corresponding to each product type p iαi and a stereo image corresponding thereto. A second distance sum calculation means for calculating a second distance sum D 2 = Σ i L 2 (S i , T 2 (p iαi )) obtained by adding the distance to S i for the permutation of the common candidates;
Of the permutations {(p 1α1 ,..., P NαN )} of the common candidates extracted by the weight determination means, the weighted sum c 1 of the first distance sum D 1 and the second distance sum D 2 D 1 + c 2 Comprehensive determination means for extracting a permutation of common candidates that minimizes D 2 , and outputting as a set of inspected articles placed on the mounting plate,
A granular material type inspection apparatus characterized by comprising:
前記テンプレート記憶手段には、各物品種ごとに、その物品種の物品の表面に印字がある場合には、その印字を撮影した画像(以下「印字画像」)をテンプレート印字画像{T(p)}として、当該物品種pと関連づけて記憶され、その物品種の物品の表面に刻印がある場合には、その刻印を撮影した画像(以下「刻印画像」)をテンプレート刻印画像{T(p)}として、当該物品種pと関連づけて記憶されており、
N個の前記各切出画像G (n)(i=1,…,N)のそれぞれについて、前記切出画像G (n)内の物品の表面に前記印字画像又は前記刻印画像(以下「模様画像」)が存在するか否かを判定し、前記模様画像が存在する場合にはその模様画像Qを抽出する模様画像抽出手段と、
前記模様画像抽出手段により抽出された前記模様画像Qが、印字画像であるか刻印画像であるかを判別する印字・刻印判別手段と、
前記印字・刻印判別手段により前記模様画像Qが前記印字画像と判別された場合、前記テンプレート記憶手段に記憶された前記各テンプレート印字画像T(p)と前記印字画像Qとの画像マッチングを実行し、前記テンプレート印字画像と前記印字画像との距離である印字画像距離L(Q,T(p))が所定の閾値以下である候補となる物品種の集合を第三の候補物品種集合C(i=1,…,N)として抽出する印字画像マッチング手段と、
前記印字・刻印判別手段により前記模様画像Qが前記刻印画像と判別された場合、前記テンプレート記憶手段に記憶された前記各テンプレート刻印画像T(p)と前記刻印画像Qとの画像マッチングを実行し、前記テンプレート刻印画像と前記刻印画像との距離である刻印画像距離L(Q,T(p))が所定の閾値以下である候補となる物品種の集合を前記第四の候補物品種集合E(i=1,…,N)として抽出する刻印画像マッチング手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート印字画像T(piαi)とそれに対応する印字画像Qとの距離をその共通候補の順列について足し合わせた第三の距離和D=Σ(Q,T(piαi))を算出する第三の距離和演算手段と、
前記重量判定手段により抽出された各共通候補の順列(p1α1,…,pNαN)に対して、各物品種piαiに対応するテンプレート刻印画像T(piαi)とそれに対応する刻印画像Qとの距離をその共通候補の順列について足し合わせた第四の距離和D=Σ(Q,T(piαi))を算出する第四の距離和演算手段と、
を備え、
前記総合判定手段は、前記重量判定手段により抽出された各共通候補の順列{(p1α1,…,pNαN)}のうち、前記第一の距離和D、前記第二の距離和D、前記第三の距離和D、及び前記第四の距離和Dの加重和c+c+c+c(c、c,c,cは重み定数)が最小となる共通候補の順列を抽出し、前記載置板に載置された被検査物品の集合として出力すること
を特徴とする請求項1記載の粒状物品種検査装置。
In the template storage means, if there is a print on the surface of an article of each product type for each product type, an image obtained by photographing the print (hereinafter referred to as “print image”) is displayed as a template print image {T 3 (p )} Is stored in association with the product type p, and if there is an inscription on the surface of the product of the product type, an image (hereinafter referred to as “engraved image”) obtained by photographing the inscription is used as a template imprinted image {T 4 ( p)} is stored in association with the product type p,
For each of the N cutout images G i (n) (i = 1,..., N), the printed image or the stamped image (hereinafter referred to as “printed image” ) on the surface of the article in the cut out image G i (n) . Pattern image extracting means for determining whether or not the “pattern image” exists, and extracting the pattern image Q i if the pattern image exists;
Printing / stamping discriminating means for discriminating whether the pattern image Q i extracted by the pattern image extracting means is a printed image or a stamped image;
When the pattern image Q i is discriminated as the print image by the print / engraving discrimination means, image matching between the template print images T 3 (p) stored in the template storage means and the print images Q i is performed. And a set of candidate product types whose print image distance L 4 (Q i , T 3 (p)), which is the distance between the template print image and the print image, is equal to or less than a predetermined threshold is Print image matching means for extracting as candidate variety set C i (i = 1,..., N);
When the pattern image Q i is discriminated as the imprinted image by the printing / engraving discriminating means, image matching between the template imprinted image T 4 (p) stored in the template storage means and the imprinted image Q i is performed. And a set of candidate product types for which a stamped image distance L 4 (Q i , T 4 (p)), which is a distance between the template stamped image and the stamped image, is equal to or smaller than a predetermined threshold is set to the fourth Engraving image matching means for extracting as a candidate set E i (i = 1,..., N) of
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template print image T 3 (p iαi ) corresponding to each product type p iαi and a print image Q corresponding thereto. a third distance sum calculating means for calculating a third distance sum D 3 = Σ i L 3 (Q i , T 3 (p iαi )) obtained by adding the distance to i for the common candidate permutation;
For each common candidate permutation (p 1α1 ,..., P NαN ) extracted by the weight determination means, a template stamp image T 4 (p iαi ) corresponding to each product type p iαi and a stamp image Q corresponding thereto. a fourth distance sum calculation means for calculating a fourth distance sum D 4 = Σ i L 4 (Q i , T 4 (p iαi )) obtained by adding the distance to i with respect to the permutations of the common candidates;
With
The comprehensive determination unit includes the first distance sum D 1 and the second distance sum D 2 among the permutations {(p 1α1 ,..., P NαN )} of the common candidates extracted by the weight determination unit. , The third distance sum D 3 , and the weighted sum of the fourth distance sum D 4 c 1 D 1 + c 2 D 2 + c 3 D 3 + c 4 D 4 (c 1 , c 2 , c 3 , c 4 2. The granular material type inspection apparatus according to claim 1, wherein a permutation of common candidates having a minimum weight constant) is extracted and output as a set of inspected articles placed on the mounting plate.
前記載置板は、透光性の板材からなり、
前記載置板上に載置される被検査物品を前記載置板の下方乃至斜め下方から前記載置板を透して撮像する第三の撮像装置を備え、
前記領域分離手段は、前記第一、第二、及び第三の撮像装置で撮像されたそれぞれの画像から、前記切出画像{G (n),…,G (n)}(n=1,2,3:nは撮像装置の番号)を生成し、
前記二次元画像マッチング手段は、前記各テンプレート二次元画像T1k(k=1,2,…)と前記第一、第二、又は第三の撮像装置の何れかにより撮像された前記各切出画像G (n)(i=1,…,N)との二次元画像マッチングを実行し、前記二次元画像距離L(G (n),T1k)が小さい順に、前記第一の候補物品種集合A(i=1,…,N)を抽出するものであることを特徴とする請求項2記載の粒状物品種検査装置。
The mounting plate is made of a translucent plate material,
A third imaging device that images the article to be inspected placed on the placement plate from below or obliquely below the placement plate through the placement plate;
The region separating means extracts the cut image {G 1 (n) ,..., G N (n) } (n = 1, 2, 3: n is the number of the imaging device)
The two-dimensional image matching means is configured to extract each of the template two-dimensional images T 1k (k = 1, 2,...) And the first, second, or third imaging device. The two-dimensional image matching with the image G i (n) (i = 1,..., N) is executed, and the first two-dimensional image distance L 1 (G i (n) , T 1k ) is increased in ascending order. 3. The granular material type inspection apparatus according to claim 2, wherein the candidate type set A i (i = 1,..., N) is extracted.
前記共通候補抽出手段は、N個の前記各切出画像G(i=1,…,N)のそれぞれに対し、
当該切出画像Gに模様画像Qとして印字画像が含まれる場合には、前記第1の候補物品種集合Aと前記第2の候補物品種集合Bと前記第3の候補物品種集合Cとに共通して含まれる物品種の集合を前記共通候補物品種集合P=A∩B∩Cとして抽出し、
当該切出画像Gに模様画像Qとして刻印画像が含まれる場合には、前記第1の候補物品種集合Aと前記第2の候補物品種集合Bと前記第四の候補物品種集合Eとに共通して含まれる物品種の集合を前記共通候補物品種集合P=A∩B∩Eとして抽出し、
当該切出画像Gに模様画像Qが含まれない場合には、前記第1の候補物品種集合Aと前記第2の候補物品種集合Bとに共通して含まれる物品種の集合を前記共通候補物品種集合P=A∩Bとして抽出すること
を特徴とする請求項2又は3に記載の粒状物品種検査装置。
The common candidate extraction means is configured for each of the N cut images G i (i = 1,..., N).
When the cut image G i includes a print image as the pattern image Q i , the first candidate variety set A i , the second candidate variety set B i, and the third candidate variety A set of product varieties included in common with the set C i is extracted as the common candidate product set P i = A i ∩B i ∩C i ,
When the cut image G i includes a stamped image as the pattern image Q i , the first candidate variety set A i , the second candidate variety set B i, and the fourth candidate variety A set of product varieties included in common with the set E i is extracted as the common candidate product set P i = A i ∩B i ∩E i ,
When the cut-out image G i does not include the pattern image Q i , the product varieties included in both the first candidate variety set A i and the second candidate variety set B i 4. The granular material type inspection apparatus according to claim 2, wherein a set is extracted as the common candidate product type set P i = A i ∩B i .
JP2008292824A 2008-11-14 2008-11-14 Granular product type inspection device Expired - Fee Related JP5163985B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008292824A JP5163985B2 (en) 2008-11-14 2008-11-14 Granular product type inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008292824A JP5163985B2 (en) 2008-11-14 2008-11-14 Granular product type inspection device

Publications (2)

Publication Number Publication Date
JP2010117331A JP2010117331A (en) 2010-05-27
JP5163985B2 true JP5163985B2 (en) 2013-03-13

Family

ID=42305083

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008292824A Expired - Fee Related JP5163985B2 (en) 2008-11-14 2008-11-14 Granular product type inspection device

Country Status (1)

Country Link
JP (1) JP5163985B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019039015A1 (en) * 2017-08-25 2019-02-28 富士フイルム株式会社 Medicine inspection assistance device, image processing device, image processing method, and program
WO2019039016A1 (en) * 2017-08-25 2019-02-28 富士フイルム株式会社 Medicine inspection assistance device, image processing device, image processing method, and program

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012005004A1 (en) * 2010-07-09 2012-01-12 パナソニック株式会社 Tablet inspection assistance method and tablet inspection assistance system
JP5582610B2 (en) * 2010-11-03 2014-09-03 学校法人早稲田大学 Image identification apparatus and program
JP5682786B2 (en) * 2011-08-22 2015-03-11 株式会社ダイフク Dispensing audit system
JP5431429B2 (en) 2011-09-06 2014-03-05 東芝テック株式会社 Information processing apparatus and program
JP5725363B2 (en) * 2011-09-27 2015-05-27 株式会社ダイフク Dispensing inspection device
JP5744776B2 (en) * 2012-03-08 2015-07-08 株式会社コンテック Weighing device
JP5702330B2 (en) * 2012-05-14 2015-04-15 株式会社コンテック Drug inspection device
JP5698183B2 (en) * 2012-05-15 2015-04-08 株式会社コンテック Drug inspection device
EP3000458B1 (en) 2013-05-22 2020-02-19 PHC Holdings Corporation Pill inspection device and pill inspection method
JP5997120B2 (en) 2013-09-26 2016-09-28 富士フイルム株式会社 Drug verification device, drug verification system, and drug verification method
JP6100136B2 (en) 2013-09-30 2017-03-22 富士フイルム株式会社 Drug recognition apparatus and method
US10192322B2 (en) * 2014-02-06 2019-01-29 Yuyama Mfg. Co., Ltd. Medicine photographing apparatus, medicine shape measuring apparatus and medicine dispensing apparatus
JP6607185B2 (en) * 2014-03-31 2019-11-20 株式会社湯山製作所 Drug imaging device
JP6497856B2 (en) * 2014-07-03 2019-04-10 アレイ株式会社 Tablet identification device and method, and packaged tablet inspection device
JP6705379B2 (en) * 2014-09-25 2020-06-03 株式会社湯山製作所 Inspection support system
JP5967175B2 (en) * 2014-11-25 2016-08-10 株式会社ダイフク Dispensing audit system
JP7016209B2 (en) * 2016-01-29 2022-02-04 東日本メディコム株式会社 Medical information provision system, server, terminal device, medical information provision method and program
EP3675032A4 (en) * 2017-08-22 2020-09-02 FUJIFILM Toyama Chemical Co., Ltd. Drug identification device, image processing device, image processing method, and program
CN111095262A (en) 2017-08-31 2020-05-01 富士胶片富山化学株式会社 Drug inspection device, image processing method, and program
JP6998048B2 (en) * 2018-03-09 2022-01-18 エイチエスティ・ビジョン株式会社 Image processing system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05337168A (en) * 1992-06-10 1993-12-21 N T T Data Tsushin Kk Automatic tablet packing machine
JP3332543B2 (en) * 1994-01-17 2002-10-07 三洋電機株式会社 Tablet inspection system
JP2700440B2 (en) * 1994-04-19 1998-01-21 エヌ・ティ・ティ・データ通信株式会社 Article identification system
JP4256434B2 (en) * 2006-06-14 2009-04-22 株式会社 タフティ Method and device for testing packaged medicine

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019039015A1 (en) * 2017-08-25 2019-02-28 富士フイルム株式会社 Medicine inspection assistance device, image processing device, image processing method, and program
WO2019039016A1 (en) * 2017-08-25 2019-02-28 富士フイルム株式会社 Medicine inspection assistance device, image processing device, image processing method, and program
WO2019039302A1 (en) * 2017-08-25 2019-02-28 富士フイルム株式会社 Medicine inspection support device, image processing device, image processing method, and program
JPWO2019039015A1 (en) * 2017-08-25 2020-09-24 富士フイルム富山化学株式会社 Drug test support device, image processing device, image processing method and program
US11423246B2 (en) 2017-08-25 2022-08-23 Fujifilm Toyama Chemical Co., Ltd. Medicine inspection assistance device, image processing device, image processing method, and program

Also Published As

Publication number Publication date
JP2010117331A (en) 2010-05-27

Similar Documents

Publication Publication Date Title
JP5163985B2 (en) Granular product type inspection device
JP6753479B2 (en) Drug imaging device
JP5916032B2 (en) Drug test support apparatus and method
US11651864B2 (en) Drug inspection apparatus and method
JP4256434B2 (en) Method and device for testing packaged medicine
CN110418627B (en) Drug identification device, drug identification method, and drug identification program
JP3124296B2 (en) How to detect the position and direction of the fiducial mark
EP2720030B1 (en) Medicine management system and method using the same
CN109073564B (en) Drug inspection device and method, and recording medium
CN110892445B (en) Drug inspection support device, drug identification device, image processing method, and program
EP3674696B1 (en) Medicine inspection assistance device, image processing device, image processing method, and non-transitory computer-readable recording medium
CN111031995A (en) Medicine inspection support device, image processing method, and program
JP6853891B2 (en) Drug audit equipment, image processing equipment, image processing methods and programs
KR101977477B1 (en) Method and apparatus for recognizing concave indication, calssification apparatus of used medicine using the same
JP5127087B2 (en) PTP packaging machine and tablet packaging machine
US7308141B2 (en) Apparatus and method to locate an object
JP5582610B2 (en) Image identification apparatus and program
JP6998048B2 (en) Image processing system
JP7437259B2 (en) Image processing device, drug identification device, image processing method, and drug identification method
JP7375049B2 (en) Image processing device and method
EP4201389A1 (en) Type discriminating device, type discriminating method, type discriminating program, and drug sorting device
WO2015181580A1 (en) Automated review of forms through augmented reality
JP2009110169A (en) Medicament inspection apparatus and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20111024

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20111024

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121119

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121205

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121206

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

Free format text: PAYMENT UNTIL: 20151228

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5163985

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees