JP2006234519A - Inspection method of particulate body and inspection device using it - Google Patents

Inspection method of particulate body and inspection device using it Download PDF

Info

Publication number
JP2006234519A
JP2006234519A JP2005048033A JP2005048033A JP2006234519A JP 2006234519 A JP2006234519 A JP 2006234519A JP 2005048033 A JP2005048033 A JP 2005048033A JP 2005048033 A JP2005048033 A JP 2005048033A JP 2006234519 A JP2006234519 A JP 2006234519A
Authority
JP
Japan
Prior art keywords
region
reference points
area
point
points
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.)
Granted
Application number
JP2005048033A
Other languages
Japanese (ja)
Other versions
JP4639841B2 (en
Inventor
Oscar Vanegas
オスカル バネガス
Mitsuru Shirasawa
満 白澤
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP2005048033A priority Critical patent/JP4639841B2/en
Priority to PCT/JP2006/302973 priority patent/WO2006090671A1/en
Priority to US11/816,536 priority patent/US7916949B2/en
Priority to EP06714113A priority patent/EP1852693A4/en
Priority to KR1020077019019A priority patent/KR100929475B1/en
Priority to CN2006800056176A priority patent/CN101175990B/en
Publication of JP2006234519A publication Critical patent/JP2006234519A/en
Application granted granted Critical
Publication of JP4639841B2 publication Critical patent/JP4639841B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Medical Preparation Storing Or Oral Administration Devices (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an inspection method of a particulate body capable of accurately counting the number of the particulate bodies even in a case that the particulate bodies to be inspected are overlapped with each other or erected, and an inspection device using it. <P>SOLUTION: An image processing part 3 is constituted so that the lump region corresponding to the particulate bodies 10a and 10b is extracted from a binary image stored in an image memory part 2, a plurality of reference points are dispersed and arranged inside the lump region along a contour line, reference points are extracted from the respective reference points, the reference points which are the reference points capable of seeing through only the standard points through the inside of the lump region and present on the side opposite to the standard points so as to hold the central part of the lump region, are extracted as shape judging points with respect to individual standard points, two standard points are judged to belong to the different particulate bodies in a case that at least a part of a connection segment, which connects the shape judging point corresponding to either one of the standard points and the shape judging point corresponding to the other standard point, passes through the outside of the lump region and the number of particulate bodies is discriminated, based on the number of the standard points belonging to the different particulate bodies. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、固形の薬剤のような粒状物体の検査を行う粒状物体の検査方法及びそれを用いる検査装置に関するものである。   The present invention relates to a granular object inspection method for inspecting a granular object such as a solid medicine and an inspection apparatus using the same.

一般に病院などの医療施設において複数の薬剤を患者に投与する場合に、患者が服用する薬剤の種類や個数を間違えないよう、1回に服用する薬剤を包装材で一纏めに分包した状態で患者に提供することが行われている。ここで、薬剤の中には用量を間違えたり、飲み合わせを誤ると、副作用を起こすものもあるから、薬剤の仕分けや分包作業は人手で行うことが義務づけられている。しかしながら、人手によって仕分け作業や分包作業を行ったとしてもミスの発生する可能性があるため、分包袋に包装された薬剤をCCDカメラなどで撮像し、その画像データを画像処理して画像中の物体の境界を認識することにより、分包された薬剤の種類や数量を検査する粒状物体の検査装置が従来より提供されている(例えば特許文献1参照)。   In general, when multiple medicines are administered to a patient in a medical facility such as a hospital, the patient is in a state where the medicines to be taken at a time are packaged together with a packaging material so that the patient does not mistake the type and number of medicines to be taken. Has been made available to. Here, some drugs may cause side effects if the dose is wrong or if they are swallowed. Therefore, it is obliged to manually sort and package the drugs manually. However, there is a possibility that mistakes may occur even if manual sorting and packaging operations are performed. Therefore, the medicine packed in the packaging bag is imaged with a CCD camera, and the image data is processed and imaged. 2. Description of the Related Art Conventionally, a granular object inspection apparatus that inspects the type and quantity of packaged medicine by recognizing the boundary of an object inside has been provided (see, for example, Patent Document 1).

ここで、特許文献1に示される粒状物体の検査装置では、CCDカメラのような撮像手段によって撮像された薬剤の画像に、二値化などのデータ処理を施して得られた画像データを画像処理して、画像中の物体の面積、周長、及び複雑度を求め、面積と複雑度とをもとに薬剤か否かを判定して、薬剤の個数を求めていた。なお、複雑度とは周長の2乗を面積で除した値である。
特公平4−17665号公報(第3頁右欄第4行〜第37行、及び、第1図)
Here, in the granular object inspection apparatus disclosed in Patent Document 1, image data obtained by performing data processing such as binarization on an image of a medicine imaged by an imaging unit such as a CCD camera is subjected to image processing. Then, the area, perimeter, and complexity of the object in the image are obtained, and the number of medicines is obtained by determining whether or not the medicine is based on the area and the complexity. The complexity is a value obtained by dividing the square of the circumference by the area.
Japanese Patent Publication No. 4-17665 (right column, page 3, lines 4 to 37, and FIG. 1)

ところで、複数個の薬剤を分包した場合に一部の薬剤が部分的に重なった状態で撮像される場合があるが、上述した粒状物体の検査装置では物体の面積と複雑度をもとに薬剤か否かを判定しているので、図6(a)のように2個の薬剤10a,10bが離れている場合は面積や周長を正しく検出できるが、2個の薬剤10a,10bが接触していたり、重なっていると面積や周長を正しく検出できないため、薬剤の判定を正確に行えず、個数の計数値が不正確になるという問題があった。   By the way, when a plurality of medicines are packaged, some of the medicines may be imaged in a partially overlapped state, but the above-described granular object inspection apparatus is based on the area and complexity of the object. Since it is determined whether or not it is a medicine, the area and circumference can be correctly detected when the two medicines 10a and 10b are separated as shown in FIG. 6A, but the two medicines 10a and 10b are detected. If they are in contact with each other or overlapped, the area and circumference cannot be detected correctly, so that there is a problem that the determination of the medicine cannot be performed accurately and the count value of the number becomes inaccurate.

また図6(a)のように薬剤10a,10bの片面に十字の溝がある場合、このような薬剤10a,10bが同図(b)のように起立していると、輪郭の一部に凹みが現れるため周長を正しく認識することができず、個数を正しく計数できない可能性があった。   Further, when there are cross grooves on one side of the medicines 10a and 10b as shown in FIG. 6A, if such medicines 10a and 10b stand up as shown in FIG. Since the dent appeared, the circumference could not be recognized correctly, and the number could not be counted correctly.

そこで、薬剤同士が部分的に重なっていたり、接触していても薬剤の面積や周長を正確に測定できるように、薬剤を上側から撮像するだけではなく、複数の方向から撮像することも考えられるが、撮像手段を複数設置するか、又は、撮像手段を複数の撮影位置に移動させる機構が必要になり、コストアップを招いてしまうという問題があった。   Therefore, in order to accurately measure the area and circumference of the drug even when the drugs are partially overlapped or in contact with each other, it is also conceivable to image the drug not only from the top but also from multiple directions. However, there is a problem in that a plurality of image pickup means or a mechanism for moving the image pickup means to a plurality of shooting positions is required, resulting in an increase in cost.

また、検査台に振動を加えるなどして薬剤同士の重なりや接触を無くしたり、立っている薬剤を揺らして横倒しにした後で薬剤を撮像して画像処理を行えば、薬剤の面積や周長を正確に測定できるものと考えられるが、検査台に振動を与える機構などが必要になって、コストアップを招くという問題があった。   In addition, the area and circumference of the medicine can be obtained by removing the overlap and contact between the medicines by applying vibrations to the examination table, or by shaking the lying medicine and laying it down, then imaging the medicine and performing image processing. However, there is a problem that a mechanism for giving vibration to the inspection table is required, resulting in an increase in cost.

本発明は上記問題点に鑑みて為されたものであり、その目的とするところは、検査対象の粒状物体が重なっていたり、立っている場合でも粒状物体の個数を正確に計数できる粒状物体の検査方法及びそれを用いる検査装置を提供することにある。   The present invention has been made in view of the above problems, and the object of the present invention is to provide a granular object that can accurately count the number of granular objects even when the granular objects to be inspected overlap or stand. An object is to provide an inspection method and an inspection apparatus using the inspection method.

上記目的を達成するために、請求項1の発明は、検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に塊領域から個々の物体領域を分離する機能を有した画像処理部と、を備える検査装置により撮像領域内に存在する粒状物体を検査する粒状物体の検査方法であって、画像処理部では、デジタル画像から塊領域を画像処理の対象領域として抽出する処理と、塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する処理と、個々の参照点について当該参照点から塊領域の領域内を通して見通せる他の参照点の数を計数する計数処理とを行った後に、対象領域に存在する複数の参照点から計数処理による計数値が最小の参照点を基準点として抽出する処理と、当該基準点から対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理と、対象領域から物体領域を除いた領域を新たな対象領域とする処理とを繰り返し実行した後、画像処理部が、複数の基準点の各々について、当該基準点のみ対象領域の領域内を通して見通すことができ、且つ、塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出し、何れかの基準点に対応する形状判定点と、他の基準点に対応する形状判定点との間をそれぞれ結ぶ連結線分の少なくとも一部が塊領域の領域外を通る場合は当該2つの基準点が異なる粒状物体に属すると判定し、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別することを特徴とする。   In order to achieve the above object, the invention of claim 1 includes an imaging unit that captures an imaging region including a granular object to be inspected, and a digital image obtained by digitizing pixel values of each pixel of the image of the imaging unit. An image processing unit having a function of separating individual object areas from the mass area when a plurality of object areas corresponding to the granular object are in contact with each other to form one mass area. An inspection method for a granular object for inspecting an existing granular object, wherein the image processing unit extracts a block area from the digital image as a target area for image processing, and creates an outline of the block area inside the block area. A target area after performing a process of distributing and arranging a plurality of reference points along the line and a counting process of counting the number of other reference points that can be seen from the reference point through the area of the lump area for each reference point Present A process for extracting a reference point having a minimum count value from a plurality of reference points as a reference point, and selecting all reference points that can be seen through the target area from the reference point, and selecting the selected reference point and reference After repeatedly executing the process of extracting the area formed by connecting the points as an object area and the process of excluding the object area from the target area as a new target area, the image processing unit For each of the points, only the reference point can be seen through the region of the target region, and a reference point on the opposite side of the reference point across the central portion of the lump region is extracted as a shape determination point. When at least a part of the connecting line segment connecting the shape determination point corresponding to the reference point and the shape determination point corresponding to the other reference point passes outside the mass region, the two reference points are Different grains It was determined to belong to the object, wherein the identifying number of the granular objects based on the number of reference points belonging to different particulate matter.

請求項1の発明によれば、画像処理部では、2つの基準点に対応する形状判定点の間を結ぶ連結線分の少なくとも一部が塊領域の外部領域を通過する場合は、当該2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別することが可能になる。   According to the first aspect of the present invention, in the image processing unit, when at least a part of the connecting line segment connecting the shape determination points corresponding to the two reference points passes through the outer region of the lump region, the two Judging that the reference points belong to different granular objects, the number of granular objects is identified from the number of reference points belonging to different granular objects, and if a granular object with a groove on one side stands, shape determination Since points cannot be extracted, the number of granular objects is not erroneously identified as two, and the number of granular objects can be accurately identified.

請求項2の発明は、検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に塊領域から個々の物体領域を分離する機能を有した画像処理部と、を備える検査装置により撮像領域内に存在する粒状物体を検査する粒状物体の検査方法であって、画像処理部では、デジタル画像から塊領域を画像処理の対象領域として抽出する処理と、塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する処理と、個々の参照点について当該参照点から塊領域の領域内を通して見通せる他の参照点の数を計数する計数処理とを行った後に、対象領域に存在する複数の参照点から計数処理による計数値が最小の参照点を基準点として抽出する処理と、当該基準点から対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理と、対象領域から物体領域を除いた領域を新たな対象領域とする処理とを繰り返し実行した後、画像処理部が、複数の基準点の各々について、当該基準点のみ対象領域の領域内を通して見通すことができ、且つ、塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出し、何れかの基準点と他の1つの基準点との間を結ぶ第1連結線分と輪郭線とで囲まれる第1領域と、当該2つの基準点に対応する形状判定点の間を結ぶ第2連結線分と輪郭線とで囲まれる第2領域との面積差が所定の基準面積よりも小さい場合は当該2つの基準点が異なる粒状物体に属すると判定し、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別することを特徴とする。   According to a second aspect of the present invention, there is provided an imaging unit for imaging an imaging region including a granular object to be inspected, and an object region corresponding to the granular object in a digital image obtained by digitizing pixel values of each pixel of the image of the imaging unit. For inspecting a granular object existing in an imaging region by an inspection apparatus comprising: an image processing unit having a function of separating individual object regions from a lump region when a plurality of contacts form a lump region In this object inspection method, the image processing unit extracts a block area from a digital image as a target area for image processing, and distributes a plurality of reference points along the outline of the block area inside the block area. And a counting process for counting the number of other reference points that can be seen from the reference point through the region of the lump region for each reference point, and then from a plurality of reference points existing in the target region. Counting The process of extracting the reference point with the smallest count value as a reference point, and selecting all reference points that can be seen through the target area from the reference point, and connecting the selected reference point and the reference point to each other After repeatedly executing the process of extracting an area as an object area and the process of excluding the object area from the target area as a new target area, the image processing unit performs the reference point for each of the plurality of reference points. A reference point that can be seen through the area of the target area and is located on the opposite side of the reference area across the center of the mass area is extracted as a shape determination point. Surrounded by a first area surrounded by a first connecting line segment and an outline connecting between the reference points and a second connecting line segment and an outline connecting between the shape determination points corresponding to the two reference points The area difference from the second region If less than the quasi-area is determined to belong to the granular object in which the two reference points are different, and wherein the identifying number of the granular objects based on the number of reference points belonging to different particulate matter.

請求項2の発明によれば、画像処理部では、第1領域と第2領域との面積差が所定の基準面積よりも小さい場合は、2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できず、第2領域が形成されないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別することが可能になる。   According to the invention of claim 2, the image processing unit determines that the two reference points belong to different granular objects when the area difference between the first region and the second region is smaller than a predetermined reference area. Thus, the number of granular objects is identified from the number of reference points belonging to different granular objects, and when a granular object having a groove on one side is standing, shape determination points cannot be extracted and the second region is not formed. Therefore, it is possible to accurately identify the number of granular objects without erroneously identifying the number of granular objects as two.

請求項3の発明は、請求項2の発明において、画像処理部では、第1領域と第2領域との面積差を求める代わりに、第1領域を囲む輪郭線上の点と第1連結線分との間の最大距離と、第2領域を囲む輪郭線上の点と第2連結線分との間の最大距離との距離差を求め、この距離差が所定の基準距離よりも短ければ当該2つの基準点が異なる粒状物体に属すると判定することを特徴とする。   According to a third aspect of the present invention, in the second aspect of the invention, in the image processing unit, instead of calculating the area difference between the first region and the second region, the points on the contour line surrounding the first region and the first connecting line segment are obtained. And the maximum distance between the point on the contour line surrounding the second region and the second connecting line segment is obtained, and if this distance difference is shorter than a predetermined reference distance, 2 It is determined that two reference points belong to different granular objects.

請求項3の発明によれば、第1連結線分および第2連結線分と輪郭線との最大距離を求め、その距離差をもとに判定処理を行っているので、第1領域および第2領域の面積を直接求める場合に比べて、演算処理に必要な時間を短縮することができる。   According to the invention of claim 3, since the maximum distance between the first connecting line segment and the second connecting line segment and the contour line is obtained, and the determination process is performed based on the distance difference, the first region and the second connecting line segment are determined. Compared with the case where the area of the two regions is directly obtained, the time required for the arithmetic processing can be shortened.

請求項4の発明は、請求項2又は3の発明において、画像処理部では、各基準点について形状判定点が複数抽出された場合、複数の形状判定点の中から対応する基準点との距離が最も長い形状判定点を選択し、選択された形状判定点を用いて第2連結線分を形成することを特徴とする。   According to a fourth aspect of the present invention, in the second or third aspect of the invention, when a plurality of shape determination points are extracted for each reference point in the image processing unit, the distance from the corresponding reference point among the plurality of shape determination points The longest shape determination point is selected, and the second connecting line segment is formed using the selected shape determination point.

請求項4の発明によれば、全ての形状判定点を用いて第2連結線分を形成し、それぞれの第2連結線分に対して請求項2又は3の判定処理を行う場合に比べて、判定処理に必要な演算時間を短縮することができる。   According to the invention of claim 4, compared to the case where the second connection line segments are formed using all the shape determination points and the determination process of claim 2 or 3 is performed on each second connection line segment. The calculation time required for the determination process can be shortened.

請求項5の発明は粒状物体の検査装置であって、検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に塊領域から個々の物体領域を分離する機能を有した画像処理部とを備え、画像処理部は、デジタル画像から塊領域を画像処理の対象領域として抽出する機能と、塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する機能と、個々の参照点について当該参照点から塊領域の領域内を通して見通せる他の参照点の数を計数する機能と、対象領域に存在する複数の参照点から計数機能による計数値が最小の参照点を基準点として抽出する処理、基準点から対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理、及び対象領域から物体領域を除いた領域を新たな対象領域とする処理を繰り返し実行する機能と、複数の基準点の各々について、当該基準点のみ対象領域の領域内を通して見通すことができ、且つ、塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出する機能と、何れかの基準点に対応する形状判定点と他の基準点に対応する形状判定点との間をそれぞれ結ぶ連結線分の少なくとも一部が塊領域の領域外を通る場合は当該2つの基準点が異なる粒状物体に属すると判定する機能とを備え、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別する手段を設けたことを特徴とする。   According to a fifth aspect of the present invention, there is provided an apparatus for inspecting a granular object, the imaging means for imaging an imaging area including the granular object to be inspected, and a digital image obtained by digitizing pixel values of each pixel of the image of the imaging means. An image processing unit having a function of separating individual object areas from the mass area when a plurality of object areas corresponding to the granular object are in contact with each other to form one mass area. A function for extracting a lump area as a target area for image processing, a function for distributing a plurality of reference points along the outline of the lump area inside the lump area, and a reference point for each reference point A function that counts the number of other reference points that can be seen through the area of the lump area, and a process that extracts the reference point with the smallest count value by the counting function from a plurality of reference points existing in the target area as a reference point To target area Select all the reference points that can be seen through the area, extract the area formed by connecting the selected reference points and reference points to each other as an object area, and create a new target area by removing the object area from the target area For each of a plurality of reference points, only the reference point can be seen through the region of the target region, and on the opposite side of the reference point across the central portion of the lump region A function for extracting a reference point as a shape determination point and at least a part of a connecting line segment connecting a shape determination point corresponding to one of the reference points and a shape determination point corresponding to another reference point is a lump. A function for determining that the two reference points belong to different granular objects when passing outside the region, and means for identifying the number of granular objects based on the number of reference points belonging to different granular objects. Characterized in that was.

請求項5の発明によれば、画像処理部では、2つの基準点に対応する形状判定点の間を結ぶ連結線分の少なくとも一部が塊領域の外部領域を通過する場合は、当該2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別可能な検査装置を実現できる。   According to the invention of claim 5, in the image processing unit, when at least a part of the connecting line segment connecting the shape determination points corresponding to the two reference points passes through the outer region of the lump region, the two Judging that the reference points belong to different granular objects, the number of granular objects is identified from the number of reference points belonging to different granular objects, and if a granular object with a groove on one side stands, shape determination Since points cannot be extracted, the number of granular objects is not erroneously identified as two, and an inspection apparatus that can accurately identify the number of granular objects can be realized.

請求項6の発明は粒状物体の検査装置であって、検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に塊領域から個々の物体領域を分離する機能を有した画像処理部とを備え、画像処理部は、デジタル画像から塊領域を画像処理の対象領域として抽出する機能と、塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する機能と、個々の参照点について当該参照点から塊領域の領域内を通して見通せる他の参照点の数を計数する機能と、対象領域に存在する複数の参照点から計数機能による計数値が最小の参照点を基準点として抽出する処理、基準点から対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理、及び対象領域から物体領域を除いた領域を新たな対象領域とする処理を繰り返し実行する機能と、複数の基準点の各々について、当該基準点のみ対象領域の領域内を通して見通すことができ、且つ、塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出する機能と、何れかの基準点と他の1つの基準点との間を結ぶ第1連結線分と輪郭線とで囲まれる第1領域と、当該2つの基準点に対応する形状判定点の間を結ぶ第2連結線分と輪郭線とで囲まれる第2領域との面積差が所定の基準面積よりも小さい場合は当該2つの基準点が異なる粒状物体に属すると判定する機能とを備え、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別する手段を設けたことを特徴とする。   According to a sixth aspect of the present invention, there is provided an apparatus for inspecting a granular object, the imaging means for imaging an imaging area including the granular object to be inspected, and a digital image obtained by digitizing the pixel value of each pixel of the image of the imaging means. An image processing unit having a function of separating individual object areas from the mass area when a plurality of object areas corresponding to the granular object are in contact with each other to form one mass area. A function for extracting a lump area as a target area for image processing, a function for distributing a plurality of reference points along the outline of the lump area inside the lump area, and a reference point for each reference point A function that counts the number of other reference points that can be seen through the area of the lump area, and a process that extracts the reference point with the smallest count value by the counting function from a plurality of reference points existing in the target area as a reference point To target area Select all the reference points that can be seen through the area, extract the area formed by connecting the selected reference points and reference points to each other as an object area, and create a new target area by removing the object area from the target area For each of a plurality of reference points, only the reference point can be seen through the region of the target region, and on the opposite side of the reference point across the central portion of the lump region A function of extracting a reference point as a shape determination point, a first area surrounded by a first connecting line segment and an outline connecting one of the reference points and another reference point, and the two When the area difference between the second connection line segment connecting the shape determination points corresponding to the reference points and the second region surrounded by the contour line is smaller than a predetermined reference area, the two reference points are different granular objects. A function to determine that it belongs to Provided, characterized in that a means for identifying the number of the granular objects based on the number of reference points belonging to different particulate matter.

請求項6の発明によれば、画像処理部では、第1領域と第2領域との面積差が所定の基準面積よりも小さい場合は、2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できず、第2領域が形成されないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別可能な検査装置を実現できる。   According to the invention of claim 6, the image processing unit determines that the two reference points belong to different granular objects when the area difference between the first region and the second region is smaller than a predetermined reference area. Thus, the number of granular objects is identified from the number of reference points belonging to different granular objects, and when a granular object having a groove on one side is standing, shape determination points cannot be extracted and the second region is not formed. Therefore, it is possible to realize an inspection apparatus that can accurately identify the number of granular objects without erroneously identifying the number of granular objects as two.

請求項1の発明は粒状物体の検査方法であって、画像処理部では、2つの基準点に対応する形状判定点の間を結ぶ連結線分の少なくとも一部が塊領域の外部領域を通過する場合は、当該2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別することが可能になる。   The invention according to claim 1 is a granular object inspection method, and in the image processing unit, at least a part of the connecting line segment connecting between the shape determination points corresponding to the two reference points passes through the outer region of the lump region. In this case, it is determined that the two reference points belong to different granular objects, the number of granular objects is identified from the number of reference points belonging to different granular objects, and a granular object with a groove on one side stands. In this case, since the shape determination point cannot be extracted, the number of granular objects is not erroneously identified as two, and the number of granular objects can be accurately identified.

請求項2の発明は粒状物体の検査方法であって、画像処理部では、第1領域と第2領域との面積差が所定の基準面積よりも小さい場合は、2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できず、第2領域が形成されないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別することが可能になる。   According to a second aspect of the present invention, there is provided a method for inspecting a granular object. In the image processing unit, when the area difference between the first area and the second area is smaller than a predetermined reference area, the granular object is different in two reference points. The number of granular objects is identified from the number of reference points belonging to different granular objects, and when a granular object with a groove on one side stands, the shape determination point cannot be extracted, Since the second region is not formed, the number of granular objects is not erroneously identified as two, and the number of granular objects can be accurately identified.

請求項5の発明は粒状物体の検査装置であって、画像処理部では、2つの基準点に対応する形状判定点の間を結ぶ連結線分の少なくとも一部が塊領域の外部領域を通過する場合は、当該2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別可能な検査装置を実現できる。   The invention according to claim 5 is an inspection apparatus for granular objects, and in the image processing unit, at least a part of the connecting line segment connecting between the shape determination points corresponding to the two reference points passes through the outer area of the lump area. In this case, it is determined that the two reference points belong to different granular objects, the number of granular objects is identified from the number of reference points belonging to different granular objects, and a granular object with a groove on one side stands. In this case, since the shape determination point cannot be extracted, the number of granular objects is not erroneously identified as two, and an inspection apparatus that can accurately identify the number of granular objects can be realized.

請求項6の発明は粒状物体の検査装置であって、画像処理部では、第1領域と第2領域との面積差が所定の基準面積よりも小さい場合は、2つの基準点が異なる粒状物体に属していると判定して、異なる粒状物体に属する基準点の数から粒状物体の個数を識別しており、片面に溝がある粒状物体が立っている場合は形状判定点を抽出できず、第2領域が形成されないので、粒状物体の個数を2個と誤識別することはなく、粒状物体の個数を正確に識別可能な検査装置を実現できる。   According to a sixth aspect of the present invention, there is provided the granular object inspection apparatus, wherein the image processing unit has a granular object having two different reference points when the area difference between the first region and the second region is smaller than a predetermined reference area. The number of granular objects is identified from the number of reference points belonging to different granular objects, and when a granular object with a groove on one side stands, the shape determination point cannot be extracted, Since the second region is not formed, an inspection apparatus capable of accurately identifying the number of granular objects can be realized without erroneously identifying the number of granular objects as two.

(実施形態1)
以下に本発明に係る粒状物体の検査方法を用いた検査装置の実施形態を図面に基づいて説明する。図1は検査装置の概略構成図であり、検査台6に搬送されてきた検査対象である薬剤のような粒状物体10a,10bを、検査台6の上方に設置されたCCDカメラのような撮像装置1を用いて撮像し、この撮像装置1で撮像された画像信号の濃淡情報に関する信号値が図示しない二値化処理部によって適宜の閾値で二値化されて二値画像が生成された後、この二値画像の画像データを画像記憶部2に記憶させている。画像処理部3では、画像記憶部2に記憶された二値画像を画像処理することで個々の粒状物体に対応する物体領域に分離し、検査判定部4が物体領域の数を計数することで粒状物体の個数を求めている。なお撮像装置1で撮像された画像信号を二値化せず、A/D変換により多値化することで濃淡画像を生成して画像記憶部2に記憶させても良く、濃淡画像を用いる場合は微分処理などを適用することが可能になるから、判定精度を向上させることが可能である。
(Embodiment 1)
Embodiments of an inspection apparatus using a granular object inspection method according to the present invention will be described below with reference to the drawings. FIG. 1 is a schematic configuration diagram of an inspection apparatus, which captures granular objects 10a and 10b such as medicines to be inspected that have been conveyed to an inspection table 6 like a CCD camera installed above the inspection table 6. After the image is picked up using the device 1, the signal value related to the grayscale information of the image signal picked up by the image pickup device 1 is binarized with an appropriate threshold value by a binarization processing unit (not shown) and a binary image is generated. The image data of the binary image is stored in the image storage unit 2. In the image processing unit 3, the binary image stored in the image storage unit 2 is subjected to image processing to be separated into object regions corresponding to individual granular objects, and the inspection determination unit 4 counts the number of object regions. The number of granular objects is obtained. Note that a grayscale image may be generated and stored in the image storage unit 2 by binarizing the image signal picked up by the imaging device 1 by A / D conversion instead of being binarized. Since it is possible to apply differential processing or the like, it is possible to improve the determination accuracy.

検査台6に載置した粒状物体10a,10bに光を照射するために、検査台6に対して撮像装置1と同じ側に照明装置7を配置してあり、照明装置7からは、撮像装置1で撮像された二値画像の背景から薬剤10a,10bを容易に切り離せるように、薬剤10a,10bに対応する部分と背景部分とで輝度差が大きくなるような光を照射させている。また検査台6の表面は光の反射率を低くしてあり、照明装置7が検査台6に光を照射すると、撮像装置1により撮像される画像は、薬剤10a、10bの部分が明るく、背景(検査台6の表面)の部分が暗くなって、両者の輝度差を大きくしている。したがって、薬剤10a,10bの輪郭と背景との間には比較的大きな輝度差が生じ、撮像装置1から出力される画像信号の濃淡情報に関する信号値を二値化することで、薬剤10a,10bの輪郭と背景とを分離することが可能になる。ここで、撮像装置1により撮像された画像信号を二値化して得た二値画像は画素値が0と1との二値のみからなるデジタル画像であるから、このデジタル画像はRAMからなる画像記憶部2に格納される。なお画像記憶部2は二値画像の記憶領域として用いられるだけではなく、後述する各種の画像処理において作業用の記憶領域としても用いられる。画像記憶部2に格納された二値画像は画像処理部3に入力され、以下の各実施形態で説明する画像処理が施されることによって薬剤10a,10bの形状の認識が行われ、その認識結果をもとに検査判定部4が薬剤10a,10bの個数を識別する。なお画像処理部3には、CRTや液晶ディスプレイからなるモニタ装置(図示せず)が接続され、このモニタ装置には、撮像装置1で撮像された画像や、二値化処理部で二値化した二値画像や、画像処理部3による認識結果などを表示できるようになっている。ここに画像記憶部2と画像処理部3と検査判定部4とで画像処理・検査判定部5が構成される。   In order to irradiate the granular objects 10 a and 10 b placed on the inspection table 6 with light, an illumination device 7 is arranged on the same side as the imaging device 1 with respect to the inspection table 6. In order that the medicines 10a and 10b can be easily separated from the background of the binary image picked up in 1, the light corresponding to the medicine 10a and 10b and the background part are irradiated with light that increases the luminance difference. The surface of the examination table 6 has a low light reflectance, and when the illumination device 7 irradiates the examination table 6 with light, the images taken by the imaging device 1 have bright portions of the medicines 10a and 10b. The portion of (the surface of the inspection table 6) is darkened, and the luminance difference between the two is increased. Therefore, a relatively large luminance difference is generated between the outline of the medicines 10a and 10b and the background, and the signal values relating to the grayscale information of the image signal output from the imaging device 1 are binarized, whereby the medicines 10a and 10b are binarized. It becomes possible to separate the outline from the background. Here, since the binary image obtained by binarizing the image signal picked up by the image pickup apparatus 1 is a digital image having only binary values of pixel values 0 and 1, this digital image is an image made up of RAM. Stored in the storage unit 2. The image storage unit 2 is not only used as a storage area for binary images, but also used as a storage area for work in various image processing described later. The binary image stored in the image storage unit 2 is input to the image processing unit 3, and the shapes of the medicines 10a and 10b are recognized by performing image processing described in the following embodiments, and the recognition is performed. Based on the result, the examination determination unit 4 identifies the number of the medicines 10a and 10b. The image processing unit 3 is connected to a monitor device (not shown) composed of a CRT or a liquid crystal display. The monitor device is connected to an image captured by the imaging device 1 or binarized by the binarization processing unit. The binary image thus obtained, the recognition result by the image processing unit 3 and the like can be displayed. Here, the image storage unit 2, the image processing unit 3 and the inspection determination unit 4 constitute an image processing / inspection determination unit 5.

なお、以下に説明する実施形態では、例えば1つの分包袋に分包する複数個の薬剤10a,10bを検査台6の上に載置し、撮像装置1により撮像される複数個の薬剤10a,10bの画像から、検査台6上に載置された薬剤10a,10bの個数が正しい個数か否かを判断するのであって、薬剤10a,10bは最終的には包装材によって1包みに包装される。ここで、包装材が透明ないし半透明であって、薬剤10a,10bを撮像装置1で撮像したときに包装材による包装を行っていない場合と同様の画像を得ることができる場合には、あらかじめ包装材で包装した薬剤10a,10bを検査台6に載置して撮像するようにしても良い。   In the embodiment described below, for example, a plurality of medicines 10a and 10b to be packaged in one sachet is placed on the examination table 6 and a plurality of medicines 10a imaged by the imaging device 1 is used. 10b, it is determined whether or not the number of the medicines 10a and 10b placed on the examination table 6 is the correct number. The medicines 10a and 10b are finally packaged in one package by a packaging material. Is done. Here, when the packaging material is transparent or translucent and when the medicines 10a and 10b are imaged by the imaging apparatus 1, an image similar to the case where packaging with the packaging material is not performed can be obtained in advance. The medicines 10a and 10b wrapped with the packaging material may be placed on the examination table 6 and imaged.

次に本発明の実施形態における画像処理部3の画像処理方法を具体例に基づいて説明する。ここでは、図2(a)に示すように薬剤10a,10bとして円形の2個の錠剤が検査台6に載置された場合を例にとって説明を行う。図示例では薬剤10a,10bの一部が互いに重なっているので、二値画像では2つの薬剤10a,10bに対応する連続した1つの領域(この領域を塊領域と言う)A1が形成され、薬剤10a,10bを個別に識別することができなくなる。而して薬剤10a,10bの個数を計数するためには、二値画像中の塊領域A1から個々の薬剤10a,10bに対応する領域を分離する必要がある。   Next, the image processing method of the image processing unit 3 in the embodiment of the present invention will be described based on a specific example. Here, as shown in FIG. 2A, the case where two circular tablets are placed on the examination table 6 as the medicines 10a and 10b will be described as an example. In the illustrated example, since the drugs 10a and 10b partially overlap each other, in the binary image, one continuous area corresponding to the two drugs 10a and 10b (this area is referred to as a lump area) A1 is formed. 10a and 10b cannot be individually identified. Thus, in order to count the number of the drugs 10a and 10b, it is necessary to separate the areas corresponding to the individual drugs 10a and 10b from the mass area A1 in the binary image.

そこで、複数の薬剤10a,10bが部分的に重なったり、互いに接触している場合に二値画像内で生成される塊領域A1から個々の薬剤10a,10bを分離して認識するために、本実施形態では画像処理部3において以下の処理を行っている。すなわち画像処理部3では、画像記憶部2に記憶された二値画像について、まず塊領域A1の輪郭線の近傍における適宜の画素を参照点に設定する。参照点は塊領域A1の内側であって、塊領域A1の輪郭線の上の部位、又は輪郭線に対して数画素内側の部位に、塊領域A1の輪郭線に沿って略一定の間隔で分散して設定される。   Therefore, in order to separate and recognize the individual drugs 10a and 10b from the mass region A1 generated in the binary image when the plurality of drugs 10a and 10b partially overlap or contact each other, In the embodiment, the image processing unit 3 performs the following processing. That is, the image processing unit 3 first sets an appropriate pixel in the vicinity of the outline of the lump area A1 as a reference point for the binary image stored in the image storage unit 2. The reference point is inside the lump area A1 and is located at a position on the outline of the lump area A1 or a few pixels inside the outline at a substantially constant interval along the outline of the lump area A1. Distributed and set.

ここで、図2(c)に示すように薬剤10aに他の薬剤が接触したり、重なったりしていない場合、すなわち1個の薬剤10aのみで塊領域A2が形成されている場合には、塊領域A2の輪郭線に沿って設定した全ての参照点P1,P2,P3,P4,P5…について、参照点P1…の間を相互に結ぶ線分である連結線分S(1−20),S(2−10),S(3−15),S(5−30)…は全て塊領域A2の内側領域を通ることになる。ここで、連結線分S(m−n)とは、参照点Pmと参照点Pnとの間を結ぶ線分を意味している。   Here, as shown in FIG. 2 (c), when other drugs are not in contact with or overlapped with the drug 10a, that is, when the lump region A2 is formed of only one drug 10a, For all the reference points P1, P2, P3, P4, P5... Set along the outline of the lump area A2, a connecting line segment S (1-20) that is a line segment connecting the reference points P1. , S (2-10), S (3-15), S (5-30)... All pass through the inner area of the lump area A2. Here, the connecting line segment S (mn) means a line segment connecting the reference point Pm and the reference point Pn.

連結線分S(m−n)が塊領域A2の領域内を通っている場合、連結線分S(m−n)上の各画素の画素値は全て同じ値(0又は1)となるので、線分上の各画素の画素値を比較することで、塊領域A2が領域内のみを通っているか否かが判別できる。尚、多値画像の場合には連結線分上の画素の画素値がある設定範囲内の濃度値であれば、同じ塊領域A2の内側領域のみを通過していると判断できる。   When the connecting line segment S (mn) passes through the area of the block area A2, the pixel values of the pixels on the connecting line segment S (mn) are all the same value (0 or 1). By comparing the pixel values of each pixel on the line segment, it can be determined whether or not the block region A2 passes only within the region. In the case of a multi-value image, if the pixel value of a pixel on a connecting line segment is a density value within a certain setting range, it can be determined that only the inner region of the same block region A2 has passed.

したがって、複数の参照点P1…の各々について、他の参照点との間を結ぶ連結線分を形成し、この連結線分上の各画素の画素値が全て同じ値となる連結線分の数(すなわち参照点の数)を計数することで、当該参照点から塊領域A2の領域内を通して見通せる他の参照点の数を計数することができ、図2(c)の場合はその計数値が全ての参照点P1…で同じ値(参照点P1…の総数をkとすると(k−1)個)になる。   Therefore, for each of the plurality of reference points P1,..., A connecting line segment connecting with other reference points is formed, and the number of connecting line segments in which the pixel values of all pixels on the connecting line segment are the same value. By counting (that is, the number of reference points), it is possible to count the number of other reference points that can be seen through the region of the lump area A2 from the reference point. In the case of FIG. All of the reference points P1... Have the same value (when the total number of reference points P1.

一方、図2(b)に示すように部分的に重なった2個の薬剤10a,10bで塊領域A1が形成されている場合に、塊領域A1の輪郭線に沿って複数個の参照点P1…を分散して配置し、全ての参照点P1…について参照点P1…の間を相互に結ぶ連結線分S(1−30),S(2−26),S(3−8),S(9−25),S(10−21)…を形成すると、一部の連結線分(例えば線分S(3−8))は塊領域A1の領域外を通過することになる。すなわち画像処理部3が、対象領域(塊領域A1)の領域内に存在する複数の参照点P1…の各々について、当該参照点から塊領域A1の領域内を通して見通せる他の参照点の数を計数すると、薬剤10a,10bの重なり部分の近傍にある参照点(例えば参照点P5,P6,P25,P26など)では、輪郭線の括れている部分の影になって、塊領域A1の領域内を通して見通すことができない参照点が存在するため、その計数値は他の部位にある参照点に比べて少なくなる
したがって、画像処理部3では、対象領域(塊領域1)の領域内に存在する複数の参照点P1…の各々について、当該参照点から塊領域A1の領域内を通して見通せる他の参照点の数を計数する計数処理を行い、計数処理により得られた計数値を撮像記憶部2に記憶させる。下記の表1は、図2(b)のように分散配置された個々の参照点P1…について計数処理を行って得た計数値の一例を示している。
On the other hand, as shown in FIG. 2B, when the lump area A1 is formed of two drugs 10a and 10b that partially overlap each other, a plurality of reference points P1 are formed along the outline of the lump area A1. Are arranged in a distributed manner, and for all the reference points P1..., Connecting line segments S (1-30), S (2-26), S (3-8), S connecting the reference points P1. When (9-25), S (10-21)... Are formed, some of the connecting line segments (for example, the line segment S (3-8)) pass outside the mass area A1. That is, the image processing unit 3 counts the number of other reference points that can be seen from the reference point through the region of the lump region A1 for each of the plurality of reference points P1... Existing in the region of the target region (lump region A1). Then, at reference points (for example, reference points P5, P6, P25, P26, etc.) in the vicinity of the overlapping part of the medicines 10a, 10b, it becomes a shadow of the part where the outline is bound and passes through the area of the lump area A1. Since there are reference points that cannot be seen, the count value is smaller than the reference points in other parts. Therefore, in the image processing unit 3, a plurality of points existing in the target region (lumb region 1) are present. For each of the reference points P1,..., A counting process is performed to count the number of other reference points that can be seen through the area of the lump area A1 from the reference point, and the count value obtained by the counting process is stored in the imaging storage unit 2 Let Table 1 below shows an example of count values obtained by performing count processing on individual reference points P1... Distributed as shown in FIG.

Figure 2006234519
Figure 2006234519

画像処理部3は上述の計数処理を行うと、対象領域である塊領域A1の領域内にある複数の参照点から、計数処理による計数値(表1参照)が最小の参照点を基準点として設定する。図2(b)に示す例では表1より参照点P3の計数値が最も少なくなるので、画像処理部3では参照点P3を基準点として設定する。なお計数処理の結果、計数値が全ての参照点で同じ値になった場合、画像処理部3ではこの塊領域A1が1つの粒状物体であると判断して以後の処理を終了し、塊領域A1に対応する粒状物体の個数を1個とする。また計数処理の結果、同じ薬剤の参照点、又は、異なる薬剤の参照点で計数値が共に最小値となる参照点が存在する場合も考えられるが、このような場合、画像処理部3では計数値が最小の参照点の中から何れか1つの参照点を任意に選択して基準点とし、選択した基準点について以後の処理を行えば良く、どの点を基準点として粒状物体の個数を計数しても計数結果は同じになる。   When the image processing unit 3 performs the above-described counting process, the reference point having the smallest count value (see Table 1) by the counting process is selected as a reference point from a plurality of reference points in the area of the lump area A1, which is the target area. Set. In the example shown in FIG. 2B, since the count value of the reference point P3 is the smallest from Table 1, the image processing unit 3 sets the reference point P3 as a reference point. As a result of the counting process, when the counted value becomes the same value at all the reference points, the image processing unit 3 determines that the lump area A1 is one granular object, and ends the subsequent processes. The number of granular objects corresponding to A1 is one. Further, as a result of the counting process, there may be a case where there is a reference point where the count value is the minimum at both the reference point of the same medicine or the reference point of different medicines. Any one of the reference points with the smallest numerical value can be arbitrarily selected as a reference point, and the subsequent processing can be performed on the selected reference point, and the number of granular objects is counted using which point as the reference point. Even so, the counting results are the same.

上述のように基準点がP3に決まると、図3(a)のように画像処理部3ではこの基準点P3から対象領域A1の領域内を通して見通せる全ての参照点P1,P2,P4,P5,P15〜P40を選択し、基準点P3と選択された参照点の間を互いに結ぶ連結線分を形成し、これらの連結線分で囲まれる領域を1つの粒状物体に対応する物体領域B1として抽出する(図3(b)参照)。   When the reference point is determined to be P3 as described above, as shown in FIG. 3A, the image processing unit 3 allows all the reference points P1, P2, P4, P5 that can be seen from the reference point P3 through the area of the target area A1. P15 to P40 are selected, a connecting line segment connecting the reference point P3 and the selected reference point is formed, and an area surrounded by these connecting line segments is extracted as an object area B1 corresponding to one granular object (See FIG. 3B).

そして、画像処理部3では、対象領域A1から物体領域B1を除いた領域A3を新たな対象領域とし、この対象領域A3に存在する複数の参照点P6,P7…の中から、上記の計数処理による計数値(表1参照)が最小の参照点P9を選択し、この参照点P9を新たな基準点として設定する。基準点がP9に決定まると、画像処理部3ではこの基準点P9から対象領域A3の領域内を通して見通せる参照点P6,P7,P8…を全て選択し、選択された参照点P6,P7,P8…と基準点P9の間を互いに結んでできる連結線分を形成し、これらの連結線分で囲まれる領域を1つの物体に対応する物体領域B2として抽出する。このとき物体領域B1,B2を合わせた領域は塊領域A1にほぼ等しくなり、塊領域A1から物体領域B1,B2を除いた領域には参照点が存在しないため、画像処理部3は基準点の抽出処理を終了する。ここで、図6(b)のように片面に十字の溝が形成されている薬剤10a,10bが起立している場合、図4(b)のように輪郭線の一部に凹みができるため、画像処理部3が上述の画像処理を行うと、基準点が2つ抽出されてしまう。したがって、基準点の個数だけから粒状物体の数を識別した場合、薬剤10aが立っていると2個の薬剤が存在すると誤検出される可能性があった。   Then, in the image processing unit 3, a region A3 obtained by removing the object region B1 from the target region A1 is set as a new target region, and the above-described counting process is performed from a plurality of reference points P6, P7... Existing in the target region A3. A reference point P9 having the smallest count value (see Table 1) is selected, and this reference point P9 is set as a new reference point. When the reference point is determined to be P9, the image processing unit 3 selects all the reference points P6, P7, P8... That can be seen through the reference point P9 through the target area A3, and the selected reference points P6, P7, P8. ... and the reference point P9 are connected to each other to form a connecting line segment, and a region surrounded by these connecting line segments is extracted as an object region B2 corresponding to one object. At this time, the area obtained by combining the object areas B1 and B2 is substantially equal to the lump area A1, and there is no reference point in the area excluding the object areas B1 and B2 from the lump area A1. The extraction process ends. Here, when the medicines 10a and 10b in which a cross groove is formed on one side as shown in FIG. 6B are raised, a part of the contour line is recessed as shown in FIG. 4B. When the image processing unit 3 performs the above-described image processing, two reference points are extracted. Therefore, when the number of granular objects is identified only from the number of reference points, there is a possibility that two drugs are erroneously detected when the drug 10a is standing.

そこで、本実施形態では画像処理部3が基準点の抽出を終了した後に、抽出された複数の基準点P3,P9の各々について塊領域A1の領域内にある参照点P1…から追跡処理を行う。すなわち画像処理部3では、複数の基準点(P3又はP9)の各々について、塊領域A1内にある複数の参照点P1…の中から、塊領域A1の領域内を通して当該基準点(P3又はP9)しか見通せない参照点を全て抽出し、抽出された参照点の中で塊領域A1の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出する。例えば基準点P3については、基準点P3のみを見通せる参照点として、基準点P3側にある参照点P1,P2,P4,P5の参照点群C1と、塊領域A1の中央部を挟んで反対側にある参照点P26,P27,P28の参照点群C2とが抽出されるが、画像処理部3では参照点群C2に属する参照点P26,P27,P28を形状判定点として抽出する。同様に基準点P9については、この基準点P9のみを見通せる参照点として、基準点P3側にある参照点P6,P7,P8,P10の参照点群C3と、塊領域A1の中央部を挟んで反対側にある参照点P23,P24,P25の参照点群C4とが抽出されるが、画像処理部3では参照点群C4に属する参照点P23,P24,P25を形状判定点として抽出する。   Therefore, in the present embodiment, after the image processing unit 3 finishes the extraction of the reference points, a tracking process is performed for each of the extracted reference points P3 and P9 from the reference points P1. . That is, in the image processing unit 3, for each of a plurality of reference points (P3 or P9), the reference point (P3 or P9) is passed through the region of the lump region A1 from the plurality of reference points P1. ) All the reference points that can only be seen are extracted, and among the extracted reference points, a reference point on the opposite side of the reference point across the central portion of the lump area A1 is extracted as a shape determination point. For example, with respect to the reference point P3, the reference point C3 of the reference points P1, P2, P4, P5 on the reference point P3 side and the opposite side across the central portion of the lump area A1 are used as reference points that allow only the reference point P3 to be seen. The reference point group C2 of the reference points P26, P27, and P28 is extracted, but the image processing unit 3 extracts the reference points P26, P27, and P28 belonging to the reference point group C2 as shape determination points. Similarly, for the reference point P9, as a reference point through which only the reference point P9 can be seen, the reference point group C3 of the reference points P6, P7, P8, and P10 on the reference point P3 side and the central portion of the lump area A1 are sandwiched. The reference point group C4 of the reference points P23, P24, and P25 on the opposite side is extracted, but the image processing unit 3 extracts the reference points P23, P24, and P25 belonging to the reference point group C4 as shape determination points.

このようにして各基準点に対応する形状判定点が抽出されると、画像処理部3では、基準点P3に対応する形状判定点(P26、P27又はP28)と、基準点P9に対応する形状判定点(P23、P24又はP25)の間を結ぶ連結線分を形成する。ここで、二値画像において背景部分の画素値を0(黒)、薬剤部分の画素値を1(白)とすると、基準点P3,P9の間を結ぶ連結線分は輪郭線が括れている部分を通るために、一部が塊領域A1の領域外を通ることになり、連結線分の画素値は両端(基準点P3,P9)が1で、中間部に画素値が0となる部分がある。同様に基準点P3,P9にそれぞれ対応する形状判定点の間を結ぶ連結線分(例えば線分S(23,28))を形成すると、2つの粒状物体10a,10bが重なっていたり接触している場合は、連結線分S(23,28)が輪郭線の括れている部分を通り、その一部が塊領域A1の領域外を通過するため、連結線分の画素値は両端が1で、中間部に画素値が0となる部分がある。したがって、画像処理部3では、2つの基準点に対応する形状判定点の間を結んで連結線分を形成し、この連結線分の少なくとも一部が塊領域A1の領域外を通っていれば、この2つの基準点が異なる粒状物体に属する基準点であると判断する。   When the shape determination point corresponding to each reference point is extracted in this way, the image processing unit 3 uses the shape determination point (P26, P27 or P28) corresponding to the reference point P3 and the shape corresponding to the reference point P9. A connecting line segment connecting the determination points (P23, P24 or P25) is formed. Here, in the binary image, if the pixel value of the background portion is 0 (black) and the pixel value of the drug portion is 1 (white), the connecting line segment connecting the reference points P3 and P9 is surrounded by an outline. In order to pass through the portion, a part passes outside the block region A1, the pixel value of the connecting line segment is 1 at both ends (reference points P3, P9), and the pixel value is 0 in the middle There is. Similarly, when a connecting line segment (for example, line segment S (23, 28)) connecting between the shape determination points corresponding to the reference points P3 and P9 is formed, the two granular objects 10a and 10b overlap or contact each other. In this case, the connecting line segment S (23, 28) passes through the portion where the outline is bound, and a part of the connecting line segment S (23, 28) passes outside the block region A1, so the pixel value of the connecting line segment is 1 at both ends In the middle part, there is a part where the pixel value is zero. Therefore, in the image processing unit 3, a connecting line segment is formed by connecting between the shape determination points corresponding to the two reference points, and at least a part of the connecting line segment passes outside the block region A1. The two reference points are determined to belong to different granular objects.

一方、図4(b)のように1つの薬剤10aが立っている場合は、画像処理部3では、上述の画像処理を行うことで2つの基準点P3,P9を抽出することができるが、個々の基準点P3,P9について形状判定点を探索しても、塊領域A1の中央部を挟んで基準点P3,P9と反対側にある参照点からは基準点P3,P9を両方とも見通すことが可能なので、形状判定点を抽出することができず、形状判定点の間を結ぶ連結線分の一部が塊領域A1の外側領域を通過するという判定条件が成立しなくなるので、2つの基準点P3,P9が異なる粒状物体に属していない、つまり同一の物体に属していると判断できる。而して画像処理部3では複数の基準点の各々について上記の処理を行うことで、異なる粒状物体に属する基準点を抽出することができ、検査判定部4では、異なる粒状物体に属する基準点の数をもとに、粒状物体の個数を識別する。   On the other hand, when one medicine 10a stands as shown in FIG. 4B, the image processing unit 3 can extract the two reference points P3 and P9 by performing the above-described image processing. Even if the shape determination point is searched for each of the reference points P3 and P9, both the reference points P3 and P9 are foreseen from the reference point on the opposite side of the reference points P3 and P9 across the central portion of the lump area A1. Since the shape determination point cannot be extracted and the determination condition that a part of the connecting line segment connecting the shape determination points passes through the outer region of the lump region A1 is not satisfied, two criteria It can be determined that the points P3 and P9 do not belong to different granular objects, that is, belong to the same object. Thus, the image processing unit 3 can extract the reference points belonging to different granular objects by performing the above processing for each of the plurality of reference points, and the inspection determining unit 4 can extract the reference points belonging to the different granular objects. The number of granular objects is identified based on the number of.

以上の動作を説明すると、画像処理部3では複数の参照点から基準点を抽出した後、抽出した複数の基準点の各々について、当該基準点のみ対象領域A1の領域内を通して見通すことができ、且つ、塊領域A1の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出しており、何れかの基準点に対応する形状判定点と、他の基準点に対応する形状判定点との間をそれぞれ結ぶ連結線分の少なくとも一部が塊領域A1の領域外を通る場合は当該2つの基準点が異なる粒状物体に属すると判断し、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別しているので、粒状物体が立っている場合に2つの粒状物体が存在すると誤検出することはなく、粒状物体の個数を正しく計数することが可能になる。   Explaining the above operation, the image processing unit 3 can extract a reference point from a plurality of reference points, and for each of the extracted plurality of reference points, only the reference point can be seen through the region of the target area A1, In addition, a reference point on the opposite side to the reference point across the central portion of the lump area A1 is extracted as a shape determination point, and corresponds to a shape determination point corresponding to one of the reference points and another reference point If at least a part of the connecting line segment connecting the shape determination points to each other passes outside the mass area A1, it is determined that the two reference points belong to different granular objects, and the reference points belonging to different granular objects Since the number of granular objects is identified based on the number of particles, it is possible to correctly count the number of granular objects without erroneous detection that there are two granular objects when the granular object is standing. become.

(実施形態2)
以下に本発明に係る粒状物体の検査方法を用いた検査装置の実施形態を図面に基づいて説明する。検査装置の構成は実施形態1と同様であるので、共通する構成要素には同一の符号を付して、その説明は省略し、以下では本実施形態の特徴部分である画像処理部3の画像処理について図5を参照して説明する。
(Embodiment 2)
Embodiments of an inspection apparatus using a granular object inspection method according to the present invention will be described below with reference to the drawings. Since the configuration of the inspection apparatus is the same as that of the first embodiment, common constituent elements are denoted by the same reference numerals, description thereof is omitted, and an image of the image processing unit 3 that is a characteristic part of the present embodiment is described below. The processing will be described with reference to FIG.

画像処理部3による画像処理方法は実施形態1で説明した画像処理方法と略同様であり、抽出された基準点が異なる粒状物体に属するものか否かを判定する方法が実施形態1と異なっている。図5(a)に示すように2個の粒状物体10a,10bが重なっている場合は、2つの基準点P3,P9の間を結ぶ第1連結線分Saと塊領域A1の輪郭線とで囲まれる第1領域Daの面積と、基準点P3,P9にそれぞれ対応する形状判定点P28,P23の間を結ぶ第2連結線分Sbと塊領域A1の輪郭線とで囲まれる第2領域Dbの面積とは略等しくなる。一方、図4(b)のように片面のみに溝が形成された粒状物体10aが立っている場合、第1連結線分Saと輪郭線とで囲まれる第1領域Daは存在するが、第2領域Dbは存在しなくなる。したがって、画像処理部3では、第1領域Daの面積と第2領域Dbの面積と比較し、両者の差が所定の基準面積よりも小さいか否かで2つの基準点が異なる粒状物体に属しているか否かを判定することができる。   The image processing method by the image processing unit 3 is substantially the same as the image processing method described in the first embodiment, and the method for determining whether or not the extracted reference point belongs to a different granular object is different from the first embodiment. Yes. When the two granular objects 10a and 10b overlap as shown in FIG. 5A, the first connecting line segment Sa connecting the two reference points P3 and P9 and the outline of the lump area A1. The second area Db surrounded by the area of the first area Da surrounded and the second connecting line segment Sb connecting the shape determination points P28 and P23 corresponding to the reference points P3 and P9, respectively, and the outline of the lump area A1. Is substantially equal to the area. On the other hand, when the granular object 10a in which the groove is formed on only one side as shown in FIG. 4B stands, the first region Da surrounded by the first connecting line segment Sa and the outline exists, The two regions Db no longer exist. Therefore, the image processing unit 3 compares the area of the first area Da and the area of the second area Db, and the two reference points belong to different granular objects depending on whether the difference between them is smaller than a predetermined reference area. It can be determined whether or not.

すなわち画像処理部3では、実施形態1で説明したように複数の参照点の中から基準点を抽出して、個々の基準点について形状判定点を抽出した後、何れかの基準点と他の1つの基準点(図5(a)の例では基準点P3及びP9)との間を結ぶ第1の連結線分Saと塊領域A1の輪郭線とで囲まれる第1領域Daと、当該2つの基準点P3,P9に対応する形状判定点P28,P23の間を結ぶ第2連結線分Sbと塊領域A1の輪郭線とで囲まれる第2領域Dbとを求め、第1領域Daと第2領域Dbとの面積差が所定の基準面積よりも小さい場合は2つの基準点P3,P9が異なる粒状物体に属すると判定する。そして、複数の基準点の内の任意の2つの基準点について異なる粒状物体に属するか否かの判定を終えると、検査判定部4では、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を求めており、粒状物体が立っている場合に個数の誤検出が発生するのを防止できる。   That is, in the image processing unit 3, as described in the first embodiment, after extracting a reference point from a plurality of reference points and extracting a shape determination point for each reference point, any reference point and another A first area Da surrounded by a first connecting line segment Sa connecting with one reference point (reference points P3 and P9 in the example of FIG. 5A) and the outline of the lump area A1, and the 2 The second connection line segment Sb connecting between the shape determination points P28 and P23 corresponding to the two reference points P3 and P9 and the second region Db surrounded by the outline of the lump region A1 are obtained, and the first region Da and the first region When the area difference from the two regions Db is smaller than a predetermined reference area, it is determined that the two reference points P3 and P9 belong to different granular objects. Then, after determining whether or not any two reference points of the plurality of reference points belong to different granular objects, the inspection determination unit 4 determines the granularity based on the number of reference points belonging to different granular objects. Since the number of objects is obtained, it is possible to prevent erroneous detection of the number when a granular object is standing.

ところで本実施形態では画像処理部3が、第1領域Daと第2領域Dbの面積差から2つの基準点が異なる粒状物体に属しているか否かを判定しているが、領域Da,Dbの面積を演算するのに比較的長い時間を要する。ここで、図5(b)に示すように第1領域Daを囲む輪郭線上の点から第1連結線分Saに垂線を下ろして、第1連結線分Saと輪郭線上の点との最大距離E1を求めるとともに、第2領域Dbを囲む輪郭線上の点から第2連結線分Sbに垂線を下ろして、第2連結線分Sbと輪郭線上の点との最大距離E2を求めると、2個の粒状物体10a,10bが重なっている場合は最大距離E1,E2が略等しくなる。一方、図4(b)のように片面のみに溝が形成された粒状物体10aが立っている場合、第1連結線分Saと輪郭線とで囲まれる第1領域Daは存在するが、第2領域Dbは存在しなくなる。したがって、画像処理部3では、最大距離E1,E2を比較し、両者の距離差が所定の基準距離よりも短いか否かで2つの基準点が異なる粒状物体に属しているか否かを判定することができる。   In the present embodiment, the image processing unit 3 determines whether or not the two reference points belong to different granular objects from the area difference between the first area Da and the second area Db. It takes a relatively long time to calculate the area. Here, as shown in FIG. 5B, a perpendicular line is dropped from the point on the contour line surrounding the first region Da to the first connection line segment Sa, and the maximum distance between the first connection line segment Sa and the point on the contour line. When E1 is obtained and a perpendicular line is dropped from the point on the contour line surrounding the second region Db to the second connection line segment Sb, the maximum distance E2 between the second connection line segment Sb and the point on the contour line is obtained. When the granular objects 10a and 10b overlap, the maximum distances E1 and E2 are substantially equal. On the other hand, when the granular object 10a in which the groove is formed on only one side as shown in FIG. 4B stands, the first region Da surrounded by the first connecting line segment Sa and the outline exists, The two regions Db no longer exist. Therefore, the image processing unit 3 compares the maximum distances E1 and E2, and determines whether or not the two reference points belong to different granular objects based on whether or not the distance difference between them is shorter than a predetermined reference distance. be able to.

すなわち画像処理部3では、実施形態1で説明したように複数の参照点の中から基準点を抽出して、個々の基準点について形状判定点を抽出した後、何れかの基準点と他の1つの基準点(図5(b)の例では基準点P3及びP9)との間を結ぶ第1の連結線分Saと塊領域A1の輪郭線とで囲まれる第1領域Daと、当該2つの基準点P3,P9に対応する形状判定点P28,P23の間を結ぶ第2連結線分Sbと塊領域A1の輪郭線とで囲まれる第2領域Dbとを求め、第1領域Daを囲む輪郭線上の点と第1連結線分Saとの間の最大距離E1、および、第2領域Dbを囲む輪郭線上の点と第2連結線分Sbとの間の最大距離E2の間の距離差を求め、この距離差が所定の基準距離よりも短ければ当該2つの基準点P3,P9が異なる粒状物体に属すると判断する。そして、複数の基準点の内の任意の2つの基準点について異なる粒状物体に属するか否かの判定を終えると、検査判定部4では、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を求めており、粒状物体が立っている場合に個数の誤検出が発生するのを防止でき、また面積値を求める場合に比べて演算時間を短縮できるという利点もある。   That is, in the image processing unit 3, as described in the first embodiment, after extracting a reference point from a plurality of reference points and extracting a shape determination point for each reference point, any reference point and another A first area Da surrounded by a first connecting line segment Sa connecting with one reference point (reference points P3 and P9 in the example of FIG. 5B) and the outline of the lump area A1, and the 2 A second connection line segment Sb connecting between the shape determination points P28 and P23 corresponding to the two reference points P3 and P9 and a second area Db surrounded by the outline of the lump area A1 are obtained, and the first area Da is surrounded. The distance difference between the maximum distance E1 between the point on the contour line and the first connecting line segment Sa, and the maximum distance E2 between the point on the contour line surrounding the second region Db and the second connecting line segment Sb. If the distance difference is shorter than the predetermined reference distance, the two reference points P3 and P9 are different from each other. It is determined to belong to the object. Then, after determining whether or not any two reference points of the plurality of reference points belong to different granular objects, the inspection determination unit 4 determines the granularity based on the number of reference points belonging to different granular objects. Since the number of objects is obtained, it is possible to prevent erroneous detection of the number when a granular object is standing, and there is an advantage that the calculation time can be shortened compared with the case of obtaining the area value.

なお本実施形態では各基準点P3,P9についてそれぞれ複数の形状判定点が抽出されており、全ての形状判定点を用いて第2連結線分を形成し、それぞれ第2領域Dbの面積値や輪郭線との最大距離E2を求めて、上述の判定処理を行っても良いが、判定処理を複数回行うために演算処理に要する時間が長くなる。したがって、画像処理部3では各基準点P3,P9について抽出された複数の形状判定点の内、基準点P3,P9との距離値が最大となる形状判定点のみを用いて第2連結線分を形成し、以後の判定処理を行うのが好ましく、判定処理に必要な演算時間を短縮することができる。   In the present embodiment, a plurality of shape determination points are extracted for each of the reference points P3 and P9, the second connection line segment is formed using all the shape determination points, and the area value of the second region Db, The above-described determination process may be performed by obtaining the maximum distance E2 from the contour line, but the determination process is performed a plurality of times, so that the time required for the calculation process is increased. Therefore, the image processing unit 3 uses only the shape determination point having the maximum distance value to the reference points P3 and P9 among the plurality of shape determination points extracted for the reference points P3 and P9. And the subsequent determination process is preferably performed, and the calculation time required for the determination process can be shortened.

実施形態1の粒状物体の検査装置の概略構成図である。1 is a schematic configuration diagram of a granular object inspection apparatus according to Embodiment 1. FIG. (a)〜(c)は同上の画像処理方法の説明図である。(A)-(c) is explanatory drawing of the image processing method same as the above. (a)(b)は同上の画像処理方法の説明図である。(A) (b) is explanatory drawing of the image processing method same as the above. (a)(b)は同上の画像処理方法の説明図である。(A) (b) is explanatory drawing of the image processing method same as the above. (a)(b)は実施形態2の粒状物体の検査装置による画像処理方法の説明図である。(A) and (b) are explanatory drawings of the image processing method by the granular object inspection apparatus of the second embodiment. (a)(b)は検査対象である粒状物体の画像の例図である。(A) and (b) are examples of an image of a granular object to be inspected.

符号の説明Explanation of symbols

1 撮像手段
2 画像記憶部
3 画像処理部
4 検査判定部
5 画像処理・検査判定部
6 検査台
7 照明装置
10a,10b 粒状物体
DESCRIPTION OF SYMBOLS 1 Image pickup means 2 Image storage part 3 Image processing part 4 Inspection determination part 5 Image processing / inspection determination part 6 Inspection table 7 Illumination device 10a, 10b Granular object

Claims (6)

検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に前記塊領域から個々の前記物体領域を分離する機能を有した画像処理部と、を備える検査装置により撮像領域内に存在する粒状物体を検査する粒状物体の検査方法であって、
前記画像処理部では、前記デジタル画像から前記塊領域を画像処理の対象領域として抽出する処理と、前記塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する処理と、個々の参照点について当該参照点から前記塊領域の領域内を通して見通せる他の参照点の数を計数する計数処理とを行った後に、対象領域に存在する複数の参照点から前記計数処理による計数値が最小の参照点を基準点として抽出する処理と、当該基準点から前記対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理と、前記対象領域から前記物体領域を除いた領域を新たな対象領域とする処理とを繰り返し実行した後、
前記画像処理部が、複数の基準点の各々について、当該基準点のみ前記対象領域の領域内を通して見通すことができ、且つ、前記塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出し、何れかの基準点に対応する形状判定点と、他の基準点に対応する形状判定点との間をそれぞれ結ぶ連結線分の少なくとも一部が前記塊領域の領域外を通る場合は当該2つの基準点が異なる粒状物体に属すると判定し、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別することを特徴とする粒状物体の検査方法。
An imaging unit that captures an imaging region including a granular object to be inspected, and a digital image obtained by digitizing pixel values of each pixel of the image of the imaging unit. A granular object inspection method for inspecting a granular object existing in an imaging region by an inspection apparatus comprising: an image processing unit having a function of separating individual object regions from the mass region when forming a mass region There,
In the image processing unit, a process of extracting the chunk area from the digital image as a target area for image processing, and a plurality of reference points are distributed and arranged along the outline of the chunk area inside the chunk area. After performing processing and counting processing for counting the number of other reference points that can be seen from the reference point through the region of the block region for each reference point, the counting processing is performed from a plurality of reference points existing in the target region. The process of extracting the reference point with the smallest count value as a reference point, and selecting all the reference points that can be seen through the region of the target area from the reference point, and connecting the selected reference point and the reference point to each other After repeatedly performing a process of extracting a possible area as an object area and a process of removing the object area from the target area as a new target area,
For each of the plurality of reference points, the image processing unit can see only the reference point through the region of the target region, and the reference is on the opposite side of the reference point across the central portion of the mass region A point is extracted as a shape determination point, and at least a part of a connecting line segment connecting a shape determination point corresponding to one of the reference points and a shape determination point corresponding to another reference point is a part of the lump region. A granular object inspection characterized in that when passing outside the region, the two reference points belong to different granular objects, and the number of granular objects is identified based on the number of reference points belonging to different granular objects. Method.
検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に前記塊領域から個々の前記物体領域を分離する機能を有した画像処理部と、を備える検査装置により撮像領域内に存在する粒状物体を検査する粒状物体の検査方法であって、
前記画像処理部では、前記デジタル画像から前記塊領域を画像処理の対象領域として抽出する処理と、前記塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する処理と、個々の参照点について当該参照点から前記塊領域の領域内を通して見通せる他の参照点の数を計数する計数処理とを行った後に、対象領域に存在する複数の参照点から前記計数処理による計数値が最小の参照点を基準点として抽出する処理と、当該基準点から前記対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理と、前記対象領域から前記物体領域を除いた領域を新たな対象領域とする処理とを繰り返し実行した後、
前記画像処理部が、複数の基準点の各々について、当該基準点のみ前記対象領域の領域内を通して見通すことができ、且つ、前記塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出し、何れかの基準点と他の1つの基準点との間を結ぶ第1連結線分と前記輪郭線とで囲まれる第1領域と、当該2つの基準点に対応する形状判定点の間を結ぶ第2連結線分と前記輪郭線とで囲まれる第2領域との面積差が所定の基準面積よりも小さい場合は当該2つの基準点が異なる粒状物体に属すると判定し、異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別することを特徴とする粒状物体の検査方法。
An imaging unit that captures an imaging region including a granular object to be inspected, and a digital image obtained by digitizing pixel values of each pixel of the image of the imaging unit. A granular object inspection method for inspecting a granular object existing in an imaging region by an inspection apparatus comprising: an image processing unit having a function of separating individual object regions from the mass region when forming a mass region There,
In the image processing unit, a process of extracting the chunk area from the digital image as a target area for image processing, and a plurality of reference points are distributed and arranged along the outline of the chunk area inside the chunk area. After performing processing and counting processing for counting the number of other reference points that can be seen from the reference point through the region of the block region for each reference point, the counting processing is performed from a plurality of reference points existing in the target region. The process of extracting the reference point with the smallest count value as a reference point, and selecting all the reference points that can be seen through the region of the target area from the reference point, and connecting the selected reference point and the reference point to each other After repeatedly performing a process of extracting a possible area as an object area and a process of removing the object area from the target area as a new target area,
For each of the plurality of reference points, the image processing unit can see only the reference point through the region of the target region, and the reference is on the opposite side of the reference point across the central portion of the mass region A point is extracted as a shape determination point, a first region surrounded by the first connecting line segment connecting the reference point and another reference point and the contour line, and the two reference points. When the area difference between the second connecting line segment connecting the corresponding shape determination points and the second region surrounded by the contour line is smaller than a predetermined reference area, the two reference points belong to different granular objects. And the number of granular objects is identified based on the number of reference points belonging to different granular objects.
前記画像処理部では、前記第1領域と前記第2領域との面積差を求める代わりに、前記第1領域を囲む輪郭線上の点と前記第1連結線分との間の最大距離と、前記第2領域を囲む輪郭線上の点と前記第2連結線分との間の最大距離との距離差を求め、この距離差が所定の基準距離よりも短ければ当該2つの基準点が異なる粒状物体に属すると判定することを特徴とする請求項2記載の粒状物体の検査方法。   In the image processing unit, instead of obtaining an area difference between the first region and the second region, a maximum distance between a point on a contour line surrounding the first region and the first connecting line segment, A distance difference between a point on the contour line surrounding the second region and the maximum distance between the second connecting line segment is obtained, and if the distance difference is shorter than a predetermined reference distance, the two reference points are different from each other. 3. The method for inspecting a granular object according to claim 2, wherein it is determined that the granular object belongs. 前記画像処理部では、前記各基準点について前記形状判定点が複数抽出された場合、複数の形状判定点の中から対応する基準点との距離が最も長い形状判定点を選択し、選択された形状判定点を用いて前記第2連結線分を形成することを特徴とする請求項2又は3記載の粒状物体の検査方法。   In the image processing unit, when a plurality of the shape determination points are extracted for each of the reference points, the shape determination point having the longest distance from the corresponding reference point is selected and selected from the plurality of shape determination points. 4. The granular object inspection method according to claim 2, wherein the second connecting line segment is formed using a shape determination point. 検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に前記塊領域から個々の前記物体領域を分離する機能を有した画像処理部とを備え、
前記画像処理部は、デジタル画像から前記塊領域を画像処理の対象領域として抽出する機能と、前記塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する機能と、個々の参照点について当該参照点から前記塊領域の領域内を通して見通せる他の参照点の数を計数する機能と、対象領域に存在する複数の参照点から前記計数機能による計数値が最小の参照点を基準点として抽出する処理、前記基準点から前記対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理、及び前記対象領域から前記物体領域を除いた領域を新たな対象領域とする処理を繰り返し実行する機能と、複数の基準点の各々について、当該基準点のみ前記対象領域の領域内を通して見通すことができ、且つ、前記塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出する機能と、何れかの基準点に対応する形状判定点と他の基準点に対応する形状判定点との間をそれぞれ結ぶ連結線分の少なくとも一部が前記塊領域の領域外を通る場合は当該2つの基準点が異なる粒状物体に属すると判定する機能とを備え、
異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別する手段を設けたことを特徴とする粒状物体の検査装置。
An imaging unit that captures an imaging region including a granular object to be inspected, and a digital image obtained by digitizing pixel values of each pixel of the image of the imaging unit. An image processing unit having a function of separating individual object regions from the mass region when forming a mass region;
The image processing unit has a function of extracting the lump area from the digital image as a target area for image processing, and a function of distributing a plurality of reference points along the outline of the lump area inside the lump area. And a function for counting the number of other reference points that can be seen from the reference point through the region of the block region for each reference point, and the count value by the counting function is the smallest from a plurality of reference points existing in the target region. Processing for extracting reference points as reference points, selecting all reference points that can be seen through the target area from the reference points, and extracting an area formed by connecting the selected reference points and reference points as an object area And a function of repeatedly executing the process of removing the object area from the target area as a new target area, and for each of a plurality of reference points, A function that can be seen through the region and that extracts a reference point on the opposite side of the reference point across the center of the mass region as a shape determination point, and a shape corresponding to any reference point If at least a part of the connecting line segment connecting between the determination point and the shape determination point corresponding to another reference point passes outside the mass region, it is determined that the two reference points belong to different granular objects With the ability to
An inspection apparatus for granular objects, comprising means for identifying the number of granular objects based on the number of reference points belonging to different granular objects.
検査対象である粒状物体を含む撮像領域を撮像する撮像手段と、撮像手段の画像の各画素の画素値をデジタル化したデジタル画像内で、粒状物体に対応する物体領域が複数接触して1つの塊領域を形成する場合に前記塊領域から個々の前記物体領域を分離する機能を有した画像処理部とを備え、
前記画像処理部は、デジタル画像から前記塊領域を画像処理の対象領域として抽出する機能と、前記塊領域の内側で当該塊領域の輪郭線に沿って複数の参照点を分散して配置する機能と、個々の参照点について当該参照点から前記塊領域の領域内を通して見通せる他の参照点の数を計数する機能と、対象領域に存在する複数の参照点から前記計数機能による計数値が最小の参照点を基準点として抽出する処理、前記基準点から前記対象領域の領域内を通して見通せる参照点を全て選択し、選択された参照点及び基準点の間を互いに結んでできる領域を物体領域として抽出する処理、及び前記対象領域から前記物体領域を除いた領域を新たな対象領域とする処理を繰り返し実行する機能と、複数の基準点の各々について、当該基準点のみ前記対象領域の領域内を通して見通すことができ、且つ、前記塊領域の中央部を挟んで当該基準点と反対側にある参照点を形状判定点として抽出する機能と、何れかの基準点と他の1つの基準点との間を結ぶ第1連結線分と前記輪郭線とで囲まれる第1領域と、当該2つの基準点に対応する形状判定点の間を結ぶ第2連結線分と前記輪郭線とで囲まれる第2領域との面積差が所定の基準面積よりも小さい場合は当該2つの基準点が異なる粒状物体に属すると判定する機能とを備え、
異なる粒状物体に属する基準点の数をもとに粒状物体の個数を識別する手段を設けたことを特徴とする粒状物体の検査装置。
An imaging unit that captures an imaging region including a granular object to be inspected, and a digital image obtained by digitizing pixel values of each pixel of the image of the imaging unit. An image processing unit having a function of separating individual object regions from the mass region when forming a mass region;
The image processing unit has a function of extracting the lump area from the digital image as a target area for image processing, and a function of distributing a plurality of reference points along the outline of the lump area inside the lump area. And a function for counting the number of other reference points that can be seen from the reference point through the region of the block region for each reference point, and the count value by the counting function is the smallest from a plurality of reference points existing in the target region. Processing for extracting reference points as reference points, selecting all reference points that can be seen through the target area from the reference points, and extracting an area formed by connecting the selected reference points and reference points as an object area And a function of repeatedly executing the process of removing the object area from the target area as a new target area, and for each of a plurality of reference points, A function of extracting a reference point that can be seen through the region and located on the opposite side of the reference point across the central portion of the mass region, and any reference point and another one A first region surrounded by the first connecting line segment connecting the two reference points and the contour line, and a second connecting line segment connecting the shape determination points corresponding to the two reference points and the contour line And a function of determining that the two reference points belong to different granular objects when the area difference from the second region surrounded by is smaller than a predetermined reference area,
An inspection apparatus for granular objects, comprising means for identifying the number of granular objects based on the number of reference points belonging to different granular objects.
JP2005048033A 2005-02-23 2005-02-23 Inspection method for granular object and inspection apparatus using the same Expired - Fee Related JP4639841B2 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2005048033A JP4639841B2 (en) 2005-02-23 2005-02-23 Inspection method for granular object and inspection apparatus using the same
PCT/JP2006/302973 WO2006090671A1 (en) 2005-02-23 2006-02-20 Method of inspecting granular material and inspection device for conducting that method
US11/816,536 US7916949B2 (en) 2005-02-23 2006-02-20 Method of inspecting granular material and inspection device for conducting that method
EP06714113A EP1852693A4 (en) 2005-02-23 2006-02-20 Method of inspecting granular material and inspection device for conducting that method
KR1020077019019A KR100929475B1 (en) 2005-02-23 2006-02-20 Inspection method of granular object and inspection apparatus performing the method
CN2006800056176A CN101175990B (en) 2005-02-23 2006-02-20 Inspection method of particlate body and inspection device using it

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005048033A JP4639841B2 (en) 2005-02-23 2005-02-23 Inspection method for granular object and inspection apparatus using the same

Publications (2)

Publication Number Publication Date
JP2006234519A true JP2006234519A (en) 2006-09-07
JP4639841B2 JP4639841B2 (en) 2011-02-23

Family

ID=37042343

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005048033A Expired - Fee Related JP4639841B2 (en) 2005-02-23 2005-02-23 Inspection method for granular object and inspection apparatus using the same

Country Status (1)

Country Link
JP (1) JP4639841B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012198848A (en) * 2011-03-23 2012-10-18 Burein:Kk Object identification device
JP2014229154A (en) * 2013-05-24 2014-12-08 株式会社ブレイン Article identification system and program for the same
JP5812228B1 (en) * 2014-02-06 2015-11-11 株式会社湯山製作所 Medicine imaging device, medicine shape measuring device, medicine dispensing device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165976A (en) * 1991-12-16 1993-07-02 Nippon Telegr & Teleph Corp <Ntt> Dividing device for three-dimensional semiprojection part shape
JPH06309459A (en) * 1993-04-27 1994-11-04 Fujitsu Autom Ltd Device and method for recognizing pattern
JPH07200770A (en) * 1993-12-28 1995-08-04 Sanyo Electric Co Ltd Tablet inspection system
JPH08322912A (en) * 1995-05-30 1996-12-10 Sanyo Electric Co Ltd Tablet inspection system
JPH09231342A (en) * 1996-02-26 1997-09-05 Sanyo Electric Co Ltd Method and device for inspecting tablet
JP2004234132A (en) * 2003-01-28 2004-08-19 Matsushita Electric Works Ltd Inspection equipment and method for granular object

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165976A (en) * 1991-12-16 1993-07-02 Nippon Telegr & Teleph Corp <Ntt> Dividing device for three-dimensional semiprojection part shape
JPH06309459A (en) * 1993-04-27 1994-11-04 Fujitsu Autom Ltd Device and method for recognizing pattern
JPH07200770A (en) * 1993-12-28 1995-08-04 Sanyo Electric Co Ltd Tablet inspection system
JPH08322912A (en) * 1995-05-30 1996-12-10 Sanyo Electric Co Ltd Tablet inspection system
JPH09231342A (en) * 1996-02-26 1997-09-05 Sanyo Electric Co Ltd Method and device for inspecting tablet
JP2004234132A (en) * 2003-01-28 2004-08-19 Matsushita Electric Works Ltd Inspection equipment and method for granular object

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012198848A (en) * 2011-03-23 2012-10-18 Burein:Kk Object identification device
JP2014229154A (en) * 2013-05-24 2014-12-08 株式会社ブレイン Article identification system and program for the same
JP5812228B1 (en) * 2014-02-06 2015-11-11 株式会社湯山製作所 Medicine imaging device, medicine shape measuring device, medicine dispensing device

Also Published As

Publication number Publication date
JP4639841B2 (en) 2011-02-23

Similar Documents

Publication Publication Date Title
JP5163985B2 (en) Granular product type inspection device
JP7391173B2 (en) Food inspection aid system, food inspection aid device, and computer program
KR100929475B1 (en) Inspection method of granular object and inspection apparatus performing the method
JP6369456B2 (en) Drug inspection device and drug packaging system
CN107315011A (en) Image processing apparatus, image processing method and storage medium
JP3438925B2 (en) Tablet inspection system
JP5174540B2 (en) Wood defect detection device
JP4300809B2 (en) Inspection apparatus and inspection method for granular object
CN111031995A (en) Medicine inspection support device, image processing method, and program
KR102037560B1 (en) Device for measuring appearance of grains
JP4639841B2 (en) Inspection method for granular object and inspection apparatus using the same
CN114813761B (en) Double-light-stroboscopic-based film pinhole and bright spot defect identification system and method
KR101330567B1 (en) pill-detection method for pill box
JP4639840B2 (en) Inspection method for granular object and inspection apparatus using the same
JPH07282219A (en) Tablet inspection device equipped with image recognition means and tablet inspecting method
JP2016217989A (en) Defect inspection device and defect inspection method
JPH07200820A (en) Image recognition processing method
JP2001116534A (en) Circularity deciding method, circularity arithmetic unit, and recording medium
JPH10137696A (en) Separation method and its device
WO2022264382A1 (en) Object discrimination device
JP7309017B1 (en) Tablet inspection device and tablet inspection method
JP2001296251A (en) Apparatus and method for inspecting foreign matter on liquid surface
US20170200383A1 (en) Automated review of forms through augmented reality
JP2017166860A (en) Powder removal condition measuring apparatus and method of measuring powder removal condition
JP4457194B2 (en) Defect inspection equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071108

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100706

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101115

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

Free format text: PAYMENT UNTIL: 20131210

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees