Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7565247B2 - Area determination method, tablet inspection method, and tablet inspection device - Google Patents
[go: Go Back, main page]

JP7565247B2 - Area determination method, tablet inspection method, and tablet inspection device - Google Patents

Area determination method, tablet inspection method, and tablet inspection device Download PDF

Info

Publication number
JP7565247B2
JP7565247B2 JP2021075806A JP2021075806A JP7565247B2 JP 7565247 B2 JP7565247 B2 JP 7565247B2 JP 2021075806 A JP2021075806 A JP 2021075806A JP 2021075806 A JP2021075806 A JP 2021075806A JP 7565247 B2 JP7565247 B2 JP 7565247B2
Authority
JP
Japan
Prior art keywords
region
tablet
area
captured image
inspection
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.)
Active
Application number
JP2021075806A
Other languages
Japanese (ja)
Other versions
JP2022170002A (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.)
Screen Holdings Co Ltd
Original Assignee
Screen Holdings Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Screen Holdings Co Ltd filed Critical Screen Holdings Co Ltd
Priority to JP2021075806A priority Critical patent/JP7565247B2/en
Publication of JP2022170002A publication Critical patent/JP2022170002A/en
Application granted granted Critical
Publication of JP7565247B2 publication Critical patent/JP7565247B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

本発明は、錠剤の撮影画像における領域判定方法、錠剤を検査する錠剤検査方法、および錠剤を検査する錠剤検査装置に関する。 The present invention relates to a method for determining an area in a captured image of a tablet, a tablet inspection method for inspecting tablets, and a tablet inspection device for inspecting tablets.

従来、医薬品やサプリメントなどの錠剤の表面に、文字やマークなどの画像を、インクジェット方式で印刷する錠剤印刷装置が知られている。錠剤印刷装置は、コンベア等により錠剤を搬送しつつ、錠剤に向けてインク滴を吐出することにより、錠剤の表面に画像を印刷する。また、錠剤印刷装置は、印刷前または印刷後の錠剤を撮影し、得られた撮影画像に基づいて、錠剤の外観検査を行う。 Conventionally, tablet printing devices are known that use an inkjet system to print images such as letters and marks on the surfaces of tablets such as medicines and supplements. The tablet printing device prints images on the surfaces of tablets by ejecting ink droplets toward the tablets while transporting the tablets on a conveyor or the like. The tablet printing device also photographs the tablets before or after printing, and performs an appearance inspection of the tablets based on the photographed images.

従来の錠剤印刷装置については、例えば、特許文献1に記載されている。 A conventional tablet printing device is described, for example, in Patent Document 1.

特開2019-124519号公報JP 2019-124519 A

錠剤の外観検査では、錠剤の上面と側面とを、異なるパラメータで検査する場合がある。また、錠剤の上面および側面のうち、上面のみを検査する場合もある。このため、錠剤の撮影画像において、錠剤の上面に相当する領域と、錠剤の側面に相当する領域とを、区別する必要がある。上記の特許文献1では、エッジの検出を行うことにより、錠剤の上面に相当する領域と錠剤の側面に相当する領域との境界を、特定している。しかしながら、エッジの検出を利用する場合、閾値の調整が難しいという問題がある。 In visual inspection of tablets, the top and side surfaces of the tablet may be inspected using different parameters. Also, there may be cases where only the top surface of the tablet is inspected. For this reason, it is necessary to distinguish between the area corresponding to the top surface of the tablet and the area corresponding to the side surface of the tablet in the captured image of the tablet. In the above-mentioned Patent Document 1, the boundary between the area corresponding to the top surface of the tablet and the area corresponding to the side surface of the tablet is identified by detecting edges. However, when edge detection is used, there is a problem in that it is difficult to adjust the threshold value.

本発明は、このような事情に鑑みなされたものであり、撮影画像に含まれる錠剤の上面領域を、エッジ検出に依存することなく判定できる技術を提供することを目的とする。 The present invention has been developed in consideration of these circumstances, and aims to provide a technology that can determine the top surface area of a tablet contained in a captured image without relying on edge detection.

上記課題を解決するため、本願の第1発明は、上面および側面を有する錠剤の撮影画像における領域判定方法であって、a)前記撮影画像の各ピクセルを、輝度値に基づくクラスタリングにより、前記上面に相当する第1上面領域と、前記側面に相当する第1側面領域と、背景に相当する第1背景領域と、の3つの領域に分類する工程と、b)前記工程a)の後に、前記第1上面領域を、前記第1側面領域側へ膨張させることにより、前記錠剤の全体に相当する第1全体領域を生成する工程と、c)前記工程b)の後に、前記第1全体領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記錠剤の全体に相当する第2全体領域を決定する工程と、d)前記工程c)の後に、前記第2全体領域を、前記第1上面領域側へ収縮させることにより、前記上面に相当する第2上面領域を生成する工程と、e)前記工程d)の後に、前記第2上面領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記上面に相当する第3上面領域を決定する工程と、を有する。 In order to solve the above problem, the first invention of the present application is a method for determining an area in a photographed image of a tablet having an upper surface and a side surface, comprising: a) a step of classifying each pixel of the photographed image into three areas, a first upper surface area corresponding to the upper surface, a first side surface area corresponding to the side surface, and a first background area corresponding to the background, by clustering based on brightness values; b) a step of generating a first overall area corresponding to the entire tablet by expanding the first upper surface area toward the first side surface area after the step a); c) a step of determining a second overall area corresponding to the entire tablet by a region segmentation method that determines a boundary line with a large brightness gradient using the first overall area as a teaching label after the step b); d) a step of generating a second upper surface area corresponding to the upper surface by shrinking the second overall area toward the first upper surface area after the step c); and e) a step of determining a third upper surface area corresponding to the upper surface using a region segmentation method that determines a boundary line with a large brightness gradient using the second upper surface area as a teaching label after the step d).

本願の第2発明は、第1発明の領域判定方法であって、f)前記工程e)の後に、前記第2全体領域と前記第3上面領域の排他的論理和をとることにより、前記側面に相当する第2側面領域を決定する工程をさらに有する。 The second invention of the present application is the area determination method of the first invention, further comprising the step of: f) after step e), determining a second side area corresponding to the side by taking the exclusive OR of the second overall area and the third top surface area.

本願の第3発明は、第1発明または第2発明の領域判定方法であって、前記工程a)では、前記撮影画像の各ピクセルを、k-meansクラスタリングにより、前記第1上面領域、前記第1側面領域、および前記第1背景領域に分類する。 The third invention of the present application is the region determination method of the first or second invention, in which in step a), each pixel of the captured image is classified into the first top surface region, the first side surface region, and the first background region by k-means clustering.

本願の第4発明は、第1発明から第3発明までのいずれか1発明の領域判定方法であって、前記工程c)および前記工程e)では、後述する数式(1)で表されるエネルギーEが最小となる境界線Cを求める。 The fourth invention of the present application is a region determination method according to any one of the first to third inventions, in which in the steps c) and e), a boundary line C is found that minimizes the energy E expressed by the formula (1) described below.

本願の第5発明は、錠剤を検査する錠剤検査方法であって、A)錠剤の撮影画像を取得する工程と、B)請求項1から請求項4までのいずれか1項に記載の領域判定方法により、前記撮影画像中の検査領域を判定する工程と、C)前記撮影画像の前記検査領域を検査する工程と、を有する。 The fifth invention of the present application is a tablet inspection method for inspecting tablets, comprising: A) a step of acquiring a photographed image of the tablet; B) a step of determining an inspection area in the photographed image by the area determination method according to any one of claims 1 to 4; and C) a step of inspecting the inspection area in the photographed image.

本願の第6発明は、上面および側面を有する錠剤を検査する錠剤検査装置であって、錠剤の撮影画像を取得する撮像部と、前記撮影画像中の検査領域を判定する領域判定部と、前記撮影画像の前記検査領域を検査する検査部と、を備え、前記領域判定部は、a)前記撮影画像の各ピクセルを、輝度値に基づくクラスタリングにより、前記上面に相当する第1上面領域と、前記側面に相当する第1側面領域と、背景に相当する第1背景領域と、の3つの領域に分類する工程と、b)前記工程a)の後に、前記第1上面領域を、前記第1側面領域側へ膨張させることにより、前記錠剤の全体に相当する第1全体領域を生成する工程と、c)前記工程b)の後に、前記第1全体領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記錠剤の全体に相当する第2全体領域を決定する工程と、d)前記工程c)の後に、前記第2全体領域を、前記第1上面領域側へ収縮させることにより、前記上面に相当する第2上面領域を生成する工程と、e)前記工程d)の後に、前記第2上面領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記上面に相当する第3上面領域を決定する工程と、を実行し、前記第3上面領域を前記検査領域とする。 The sixth invention of the present application is a tablet inspection device for inspecting tablets having a top surface and a side surface, comprising an imaging unit for acquiring a photographed image of the tablet, an area determination unit for determining an inspection area in the photographed image, and an inspection unit for inspecting the inspection area of the photographed image, the area determination unit performing the steps of: a) classifying each pixel of the photographed image into three areas, a first top surface area corresponding to the top surface, a first side surface area corresponding to the side surface, and a first background area corresponding to the background, by clustering based on brightness values; and b) after step a), expanding the first top surface area toward the first side surface area to obtain a first background area corresponding to the entire tablet. A process for generating an entire region; c) after the process b), a process for determining a second entire region corresponding to the entire tablet using a region segmentation method that uses the first entire region as an instruction label to find a boundary line where the luminance gradient increases; d) after the process c), a process for generating a second upper surface region corresponding to the upper surface by shrinking the second entire region toward the first upper surface region; and e) after the process d), a process for determining a third upper surface region corresponding to the upper surface using a region segmentation method that uses the second upper surface region as an instruction label to find a boundary line where the luminance gradient increases. The third upper surface region is set as the inspection region.

本願の第1発明~第6発明によれば、エッジ検出に依存することなく、撮影画像に含まれる錠剤の上面領域を判定できる。また、クラスタリングのみで判定する場合よりも精度よく、錠剤の上面領域を判定できる。 According to the first to sixth aspects of the present application, the top surface area of the tablet contained in the captured image can be determined without relying on edge detection. In addition, the top surface area of the tablet can be determined more accurately than when it is determined by clustering alone.

特に、本願の第2発明によれば、エッジ検出に依存することなく、撮影画像に含まれる錠剤の側面領域を判定できる。また、クラスタリングのみで判定する場合よりも精度よく、錠剤の側面領域を判定できる。 In particular, according to the second invention of the present application, the side area of the tablet contained in the captured image can be determined without relying on edge detection. Furthermore, the side area of the tablet can be determined more accurately than when it is determined by clustering alone.

錠剤印刷装置の構成を示した図である。FIG. 1 is a diagram showing a configuration of a tablet printing device. 搬送機構の部分斜視図である。FIG. ヘッドの下面図である。FIG. コンピュータと、錠剤印刷装置の各部との電気的接続を示したブロック図である。FIG. 2 is a block diagram showing electrical connections between a computer and each part of the tablet printing device. 錠剤の外観検査に関するコンピュータの機能を、概念的に示したブロック図である。FIG. 1 is a block diagram conceptually showing the functions of a computer related to visual inspection of tablets. 領域判定処理の手順を示したフローチャートである。13 is a flowchart showing a procedure of an area determination process. 撮影画像の例を示した図である。FIG. 13 is a diagram showing an example of a captured image. 撮影画像を構成する複数のピクセルの輝度値の分布を示したヒストグラムである。1 is a histogram showing the distribution of luminance values of a plurality of pixels constituting a captured image. ステップS1の処理の様子を示した図である。FIG. 11 is a diagram showing the processing state of step S1. ステップS2の処理の様子を示した図である。FIG. 11 is a diagram showing the processing state of step S2. ステップS3の処理の様子を示した図である。FIG. 11 is a diagram showing the processing state of step S3. ステップS4の処理の様子を示した図である。FIG. 11 is a diagram showing the processing state of step S4. ステップS5の処理の様子を示した図である。FIG. 11 is a diagram showing the processing state of step S5. ステップS6の処理の様子を示した図である。FIG. 11 is a diagram showing the processing state of step S6.

以下、本発明の実施形態について、図面を参照しつつ説明する。なお、以下の説明においては、複数の錠剤が搬送される方向を「搬送方向」と称し、搬送方向に対して垂直かつ水平な方向を「幅方向」と称する。 The following describes an embodiment of the present invention with reference to the drawings. In the following description, the direction in which the tablets are transported is referred to as the "transport direction," and the direction perpendicular and horizontal to the transport direction is referred to as the "width direction."

<1.印刷装置の全体構成>
図1は、本発明の一実施形態に係る錠剤検査装置を含む錠剤印刷装置1の構成を示した図である。この錠剤印刷装置1は、複数の錠剤9を搬送しながら、各錠剤9の表面に、製品名、製品コード、重量、成分含有量、会社名、ロゴマーク等の画像を印刷する装置である。図1に示すように、本実施形態の錠剤印刷装置1は、搬送機構10、第1撮像部20、印刷部30、第2撮像部40、不良品排出部50、良品排出部60、およびコンピュータ70を備えている。
1. Overall configuration of the printing device
1 is a diagram showing the configuration of a tablet printing device 1 including a tablet inspection device according to an embodiment of the present invention. This tablet printing device 1 is a device that prints images such as product name, product code, weight, ingredient content, company name, logo mark, etc. on the surface of each tablet 9 while conveying a plurality of tablets 9. As shown in FIG. 1, the tablet printing device 1 of this embodiment includes a conveying mechanism 10, a first imaging unit 20, a printing unit 30, a second imaging unit 40, a defective product ejection unit 50, a non-defective product ejection unit 60, and a computer 70.

搬送機構10は、複数の錠剤9を整列した状態で保持しつつ搬送する機構である。搬送機構10は、一対のプーリ11と、一対のプーリ11の間に架け渡された環状の搬送ベルト12とを有する。錠剤印刷装置1に投入された複数の錠剤9は、振動フィーダや搬送ドラム等により構成される搬入機構80によって、等間隔に整列されるとともに、搬送ベルト12の表面に供給される。一対のプーリ11の一方は、搬送用モータ13から得られる動力により回転する。これにより、搬送ベルト12が、図1中の矢印の方向に回動する。このとき、一対のプーリ11の他方は、搬送ベルト12の回動に伴い従動回転する。 The conveying mechanism 10 is a mechanism that conveys multiple tablets 9 while holding them in an aligned state. The conveying mechanism 10 has a pair of pulleys 11 and a circular conveying belt 12 that is stretched between the pair of pulleys 11. Multiple tablets 9 fed into the tablet printing device 1 are aligned at equal intervals and supplied to the surface of the conveying belt 12 by a feed mechanism 80 that is composed of a vibrating feeder, a conveying drum, etc. One of the pair of pulleys 11 is rotated by power obtained from a conveying motor 13. As a result, the conveying belt 12 rotates in the direction of the arrow in FIG. 1. At this time, the other of the pair of pulleys 11 is rotated in conjunction with the rotation of the conveying belt 12.

図2は、搬送機構10の部分斜視図である。図2に示すように、搬送ベルト12には、複数の吸着孔14が設けられている。複数の吸着孔14は、搬送方向および幅方向に、等間隔に配列されている。また、図1に示すように、搬送機構10は、搬送ベルト12の内側の空間から気体を吸い出す吸引機構15を有する。吸引機構15を動作させると、搬送ベルト12の内側の空間が、大気圧よりも低い負圧となる。複数の錠剤9は、この負圧によって、吸着孔14に吸着保持される。 Figure 2 is a partial perspective view of the conveying mechanism 10. As shown in Figure 2, the conveying belt 12 is provided with a plurality of suction holes 14. The plurality of suction holes 14 are arranged at equal intervals in the conveying direction and the width direction. Also, as shown in Figure 1, the conveying mechanism 10 has a suction mechanism 15 that sucks out gas from the space inside the conveying belt 12. When the suction mechanism 15 is operated, the space inside the conveying belt 12 becomes negative pressure, which is lower than atmospheric pressure. The plurality of tablets 9 are adsorbed and held by the suction holes 14 due to this negative pressure.

このように、複数の錠剤9は、搬送ベルト12の表面に、搬送方向および幅方向に整列した状態で保持される。そして、搬送機構10は、搬送ベルト12を回動させることによって、複数の錠剤9を搬送方向に搬送する。後述する4つのヘッド31の下方では、複数の錠剤9は、水平方向に搬送される。 In this way, the tablets 9 are held on the surface of the conveyor belt 12 in a state aligned in the conveying direction and width direction. The conveyor mechanism 10 then rotates the conveyor belt 12 to convey the tablets 9 in the conveying direction. Below the four heads 31 described below, the tablets 9 are conveyed horizontally.

第1撮像部20は、印刷前の錠剤9の撮影画像を取得する部位である。第1撮像部20は、搬入機構80よりも搬送経路の下流側かつ後述する印刷位置P2よりも搬送経路の上流側の第1撮像位置P1において、搬送ベルト12により搬送される複数の錠剤9を撮影する。第1撮像部20には、例えば、CCDやCMOS等の撮像素子が幅方向に配列されたラインセンサが用いられる。ただし、第1撮像部20は、エリアセンサ等の他の撮像装置であってもよい。 The first imaging unit 20 is a part that captures images of the tablets 9 before printing. The first imaging unit 20 captures images of the tablets 9 transported by the transport belt 12 at a first imaging position P1 that is downstream of the transport path from the loading mechanism 80 and upstream of the transport path from a printing position P2 described below. The first imaging unit 20 is, for example, a line sensor in which imaging elements such as CCD or CMOS are arranged in the width direction. However, the first imaging unit 20 may also be another imaging device such as an area sensor.

錠剤9は、円形の上面および下面と、円筒状の側面とを有する。錠剤9の下面は、搬送ベルト12の吸着孔14に吸着される。第1撮像部20は、複数の錠剤9を、斜め上方から撮影する。したがって、第1撮像部20により得られる錠剤9の撮影画像には、錠剤9の上面および側面が写る。 The tablets 9 have circular upper and lower surfaces and cylindrical side surfaces. The lower surfaces of the tablets 9 are attracted to the suction holes 14 of the conveyor belt 12. The first imaging unit 20 captures images of the tablets 9 from diagonally above. Therefore, the images of the tablets 9 captured by the first imaging unit 20 include the upper and side surfaces of the tablets 9.

撮影により取得された撮影画像は、第1撮像部20からコンピュータ70へ送信される。コンピュータ70は、第1撮像部20から送信された撮影画像に基づいて、各吸着孔14における錠剤9の有無、錠剤9の位置、錠剤9の回転角度、および錠剤9に欠け等の欠陥が無いかどうか等を検査する。 The captured image is transmitted from the first imaging unit 20 to the computer 70. Based on the captured image transmitted from the first imaging unit 20, the computer 70 checks whether or not there is a tablet 9 in each suction hole 14, the position of the tablet 9, the rotation angle of the tablet 9, and whether or not there are any defects such as chips in the tablet 9.

印刷部30は、第1撮像位置P1よりも搬送経路の下流側かつ後述する第2撮像位置P3よりも搬送経路の上流側の印刷位置P2において、錠剤9の表面に、インクジェット方式で画像を印刷する処理部である。図1に示すように、本実施形態の印刷部30は、4つのヘッド31を有する。4つのヘッド31は、搬送ベルト12の上方に位置し、錠剤9の搬送方向に沿って、一列に配置されている。4つのヘッド31は、錠剤9の表面に向けて、互いに異なる色(例えば、シアン、マゼンタ、イエロー、およびブラックの各色)のインク滴を吐出する。すると、これらの各色により形成される単色画像の重ね合わせによって、錠剤9の表面に、多色画像が印刷される。なお、各ヘッド31から吐出されるインクには、日本薬局方、食品衛生法等で認可された原料により製造された可食性インクが使用される。 The printing unit 30 is a processing unit that prints an image on the surface of the tablet 9 by an inkjet method at a printing position P2 that is downstream of the first imaging position P1 on the conveying path and upstream of the second imaging position P3 described later on the conveying path. As shown in FIG. 1, the printing unit 30 of this embodiment has four heads 31. The four heads 31 are located above the conveying belt 12 and arranged in a row along the conveying direction of the tablet 9. The four heads 31 eject ink droplets of different colors (e.g., cyan, magenta, yellow, and black) toward the surface of the tablet 9. Then, a multi-color image is printed on the surface of the tablet 9 by superimposing the monochromatic images formed by each of these colors. Note that the ink ejected from each head 31 is edible ink manufactured from raw materials approved by the Japanese Pharmacopoeia, the Food Sanitation Act, etc.

図3は、1つのヘッド31の下面図である。図3には、搬送ベルト12と、搬送ベルト12に保持された複数の錠剤9とが、二点鎖線で示されている。図3中に拡大して示したように、ヘッド31の下面である吐出面310には、インク滴を吐出可能な複数のノズル311が設けられている。本実施形態では、ヘッド31の下面に、複数のノズル311が、搬送方向および幅方向に二次元的に配列されている。各ノズル311は、幅方向に位置をずらして配列されている。このように、複数のノズル311を二次元的に配置すれば、各ノズル311の幅方向の位置を、互いに接近させることができる。ただし、複数のノズル311は、幅方向に沿って一列に配列されていてもよい。 Figure 3 is a bottom view of one head 31. In Figure 3, the conveyor belt 12 and multiple tablets 9 held by the conveyor belt 12 are indicated by two-dot chain lines. As shown enlarged in Figure 3, the discharge surface 310, which is the bottom surface of the head 31, is provided with multiple nozzles 311 capable of discharging ink droplets. In this embodiment, the multiple nozzles 311 are arranged two-dimensionally in the conveying direction and the width direction on the bottom surface of the head 31. Each nozzle 311 is arranged with its position shifted in the width direction. In this way, by arranging the multiple nozzles 311 two-dimensionally, the positions of each nozzle 311 in the width direction can be made close to each other. However, the multiple nozzles 311 may also be arranged in a line along the width direction.

ノズル311からのインク滴の吐出方式には、例えば、ピエゾ素子に電圧を加えて変形させることにより、ノズル311内のインクを加圧して吐出する、いわゆるピエゾ方式が用いられる。ただし、インク滴の吐出方式は、ヒータに通電してノズル311内のインクを加熱膨張させることにより吐出する、いわゆるサーマル方式であってもよい。 The method of ejecting ink droplets from the nozzle 311 is, for example, the so-called piezo method, in which a voltage is applied to a piezo element to deform it, thereby pressurizing the ink in the nozzle 311 and ejecting it. However, the ink droplets may also be ejected using the so-called thermal method, in which electricity is passed through a heater to heat and expand the ink in the nozzle 311, thereby ejecting it.

第2撮像部40は、印刷後の錠剤9の撮影画像を取得する部位である。第2撮像部40は、印刷位置P2よりも搬送経路の下流側かつ後述する不良品排出位置P4よりも搬送経路の上流側の第2撮像位置P3において、搬送ベルト12により搬送される複数の錠剤9を撮影する。第2撮像部40には、例えば、CCDやCMOS等の撮像素子が幅方向に配列されたラインセンサが用いられる。ただし、第2撮像部40は、エリアセンサ等の他の撮像装置であってもよい。 The second imaging unit 40 is a part that captures images of the tablets 9 after printing. The second imaging unit 40 captures images of the tablets 9 transported by the transport belt 12 at a second imaging position P3 that is downstream of the printing position P2 on the transport path and upstream of the defective product discharge position P4 described below on the transport path. The second imaging unit 40 is, for example, a line sensor in which imaging elements such as CCD or CMOS are arranged in the width direction. However, the second imaging unit 40 may also be another imaging device such as an area sensor.

第2撮像部40は、複数の錠剤9を、斜め上方から撮影する。したがって、第2撮像部40により得られる錠剤9の撮影画像には、錠剤9の上面および側面が写る。撮影により取得された撮影画像は、第2撮像部40からコンピュータ70へ送信される。コンピュータ70は、第2撮像部40から送信された撮影画像に基づいて、錠剤9の表面に形成された印刷画像の良否を検査する。 The second imaging unit 40 photographs the tablets 9 from diagonally above. Therefore, the photographed image of the tablets 9 obtained by the second imaging unit 40 shows the top and side surfaces of the tablets 9. The photographed image is transmitted from the second imaging unit 40 to the computer 70. The computer 70 inspects the quality of the printed image formed on the surface of the tablets 9 based on the photographed image transmitted from the second imaging unit 40.

不良品排出部50は、第2撮像位置P3よりも搬送経路の下流側かつ後述する良品排出位置P5よりも搬送経路の上流側の不良品排出位置P4において、不良品と判定された錠剤9を排出する部位である。不良品排出部50は、搬送ベルト12の内側に配置された不良品ブロー機構51と、不良品ブロー機構51から搬送ベルト12をはさんで下方に配置された不良品回収部52とを有する。不良品ブロー機構51は、搬送ベルト12の複数の吸着孔14のうち、不良品と判定された錠剤9を保持する吸着孔14のみに、気体を吹き付ける。そうすると、当該吸着孔14が、大気圧よりも高い陽圧となる。これにより、当該吸着孔14における錠剤9の吸着が解除され、搬送ベルト12から不良品回収部52へ、不良品と判定された錠剤9が落下する。 The defective product discharge section 50 is a section that discharges tablets 9 determined to be defective at a defective product discharge position P4 downstream of the second imaging position P3 and upstream of the non-defective product discharge position P5 described later. The defective product discharge section 50 has a defective product blow mechanism 51 arranged inside the conveyor belt 12 and a defective product collection section 52 arranged below the conveyor belt 12 from the defective product blow mechanism 51. The defective product blow mechanism 51 blows gas only to the suction hole 14 that holds the tablet 9 determined to be defective among the multiple suction holes 14 of the conveyor belt 12. Then, the suction hole 14 becomes a positive pressure higher than atmospheric pressure. As a result, the suction of the tablet 9 at the suction hole 14 is released, and the tablet 9 determined to be defective falls from the conveyor belt 12 to the defective product collection section 52.

良品排出部60は、不良品排出位置P4よりも搬送経路の下流側の良品排出位置P5において、良品と判定された錠剤9を排出する部位である。良品排出部60は、搬送ベルト12の内側に配置された良品ブロー機構61と、良品ブロー機構61から搬送ベルト12をはさんで下方に配置された良品回収部62とを有する。良品ブロー機構61は、搬送ベルト12の複数の吸着孔14へ向けて、気体を吹き付ける。そうすると、当該吸着孔14が、大気圧よりも高い陽圧となる。これにより、当該吸着孔14における錠剤9の吸着が解除され、搬送ベルト12から良品回収部62へ、良品と判定された錠剤9が落下する。 The good product discharge section 60 is a section that discharges tablets 9 that have been determined to be good products at a good product discharge position P5 downstream of the defective product discharge position P4 on the conveying path. The good product discharge section 60 has a good product blow mechanism 61 that is arranged inside the conveying belt 12, and a good product recovery section 62 that is arranged below the good product blow mechanism 61 across the conveying belt 12. The good product blow mechanism 61 blows gas toward the multiple suction holes 14 of the conveying belt 12. This causes the suction holes 14 to be at a positive pressure higher than atmospheric pressure. This releases the suction of the tablets 9 at the suction holes 14, and the tablets 9 that have been determined to be good products fall from the conveying belt 12 to the good product recovery section 62.

<2.コンピュータについて>
コンピュータ70は、錠剤印刷装置1内の各部の動作制御と、撮影画像に基づく錠剤9の外観検査と、を行う情報処理装置である。図4は、コンピュータ70と、錠剤印刷装置1の各部との電気的接続を示したブロック図である。図4中に概念的に示したように、コンピュータ70は、CPU等のプロセッサ701、RAM等のメモリ702、およびハードディスクドライブ等の記憶部703を有する。記憶部703内には、印刷処理および外観検査を実行するためのコンピュータプログラムCPが、記憶されている。第1撮像部20および第2撮像部40から送信される錠剤9の撮影画像は、錠剤9ごとに分割されて、記憶部703に記憶される。
<2. About Computers>
The computer 70 is an information processing device that controls the operation of each part in the tablet printing device 1 and inspects the appearance of the tablet 9 based on the captured image. FIG. 4 is a block diagram showing the electrical connection between the computer 70 and each part of the tablet printing device 1. As conceptually shown in FIG. 4, the computer 70 has a processor 701 such as a CPU, a memory 702 such as a RAM, and a storage unit 703 such as a hard disk drive. A computer program CP for executing the printing process and the appearance inspection is stored in the storage unit 703. The captured images of the tablet 9 transmitted from the first imaging unit 20 and the second imaging unit 40 are divided for each tablet 9 and stored in the storage unit 703.

コンピュータ70は、上述した搬送機構10、第1撮像部20、4つのヘッド31、第2撮像部40、不良品ブロー機構51、良品ブロー機構61、および搬入機構80と、有線または無線により通信可能に接続されている。コンピュータ70は、コンピュータプログラムCPに従って、これらの各部を動作制御する。 The computer 70 is connected to the above-mentioned transport mechanism 10, the first imaging unit 20, the four heads 31, the second imaging unit 40, the defective product blowing mechanism 51, the non-defective product blowing mechanism 61, and the loading mechanism 80 via wired or wireless communication. The computer 70 controls the operation of each of these units according to the computer program CP.

図5は、錠剤9の外観検査に関するコンピュータ70の機能を、概念的に示したブロック図である。図5に示すように、コンピュータ70は、第1領域判定部71、第1検査部72、印刷指示部73、第2領域判定部74、第2検査部75、および排出指示部76を有する。第1領域判定部71、第1検査部72、印刷指示部73、第2領域判定部74、第2検査部75、および排出指示部76の各機能は、コンピュータ70のプロセッサ701が、コンピュータプログラムCPに従って動作することにより実現される。 Figure 5 is a block diagram conceptually illustrating the functions of computer 70 related to visual inspection of tablet 9. As shown in Figure 5, computer 70 has a first area determination unit 71, a first inspection unit 72, a print instruction unit 73, a second area determination unit 74, a second inspection unit 75, and a discharge instruction unit 76. Each function of first area determination unit 71, first inspection unit 72, print instruction unit 73, second area determination unit 74, second inspection unit 75, and discharge instruction unit 76 is realized by the processor 701 of computer 70 operating in accordance with computer program CP.

第1領域判定部71は、第1撮像部20から送信された撮影画像(以下「第1撮影画像I1」と称する)から、検査対象となる領域を判定する。本実施形態では、錠剤9の上面および側面を印刷前の検査対象とする。したがって、第1領域判定部71は、第1撮影画像I1のうち、錠剤9の上面に相当する領域と、錠剤9の側面に相当する領域とを、検査領域として判定する。そして、第1領域判定部71は、判定された検査領域を示す第1検査領域情報D1を、第1検査部72へ出力する。領域判定の詳細な方法については、後述する。 The first area determination unit 71 determines the area to be inspected from the captured image (hereinafter referred to as the "first captured image I1") transmitted from the first imaging unit 20. In this embodiment, the top and side surfaces of the tablet 9 are inspected before printing. Therefore, the first area determination unit 71 determines the area of the first captured image I1 that corresponds to the top surface of the tablet 9 and the area that corresponds to the side surface of the tablet 9 as the inspection area. The first area determination unit 71 then outputs first inspection area information D1 indicating the determined inspection area to the first inspection unit 72. A detailed method of area determination will be described later.

第1検査部72は、第1撮影画像I1に基づいて、印刷前の錠剤9の検査を行う。具体的には、第1検査部72は、第1撮影画像I1に基づいて、各吸着孔14における錠剤9の有無、錠剤9の位置、錠剤9の回転角度、および錠剤9に欠け等の欠陥が無いかどうか等を検査する。このとき、第1検査部72は、第1撮影画像I1のうち、第1検査領域情報D1により指定される検査領域について、欠陥の有無を検査する。そして、第1検査部72は、検査結果D2を、印刷指示部73および排出指示部76へ出力する。 The first inspection unit 72 inspects the tablets 9 before printing based on the first captured image I1. Specifically, the first inspection unit 72 inspects the presence or absence of tablets 9 in each suction hole 14, the position of the tablets 9, the rotation angle of the tablets 9, and whether or not the tablets 9 have defects such as chips, based on the first captured image I1. At this time, the first inspection unit 72 inspects the presence or absence of defects in the inspection area specified by the first inspection area information D1 in the first captured image I1. The first inspection unit 72 then outputs the inspection result D2 to the print instruction unit 73 and the discharge instruction unit 76.

印刷指示部73は、印刷部30の動作を制御する。印刷指示部73は、第1検査部72の検査結果D2に基づいて、錠剤9に対する印刷の可否、印刷すべき位置、および印刷の角度を判断する。そして、印刷指示部73は、その判断結果に基づいて、複数のヘッド31へ印刷指示D3を出力する。複数のヘッド31は、印刷指示D3により指定されるノズル311から、指定されたタイミングで、インク滴を吐出する。これにより、錠剤9の上面に画像が印刷される。 The print instruction unit 73 controls the operation of the printing unit 30. Based on the inspection results D2 of the first inspection unit 72, the print instruction unit 73 determines whether printing can be performed on the tablet 9, the position to print, and the angle of printing. Based on the determination result, the print instruction unit 73 then outputs print instructions D3 to the multiple heads 31. The multiple heads 31 eject ink droplets from nozzles 311 specified by the print instruction D3 at the specified timing. This causes an image to be printed on the top surface of the tablet 9.

第2領域判定部74は、第2撮像部40から送信された撮影画像(以下「第2撮影画像I2」と称する)から、検査対象となる領域を判定する。本実施形態では、錠剤9の上面および側面を印刷後の検査対象とする。したがって、第2領域判定部74は、第2撮影画像I2のうち、錠剤9の上面に相当する領域と、錠剤9の側面に相当する領域とを、検査領域として判定する。そして、第2領域判定部74は、判定された検査領域を示す第2検査領域情報D4を、第2検査部75へ出力する。領域判定の詳細な方法については、後述する。 The second area determination unit 74 determines the area to be inspected from the captured image (hereinafter referred to as the "second captured image I2") transmitted from the second imaging unit 40. In this embodiment, the top and side surfaces of the tablet 9 are inspected after printing. Therefore, the second area determination unit 74 determines the area of the second captured image I2 that corresponds to the top surface of the tablet 9 and the area that corresponds to the side surface of the tablet 9 as the inspection area. The second area determination unit 74 then outputs second inspection area information D4 indicating the determined inspection area to the second inspection unit 75. A detailed method of area determination will be described later.

第2検査部75は、第2撮影画像I2に基づいて、印刷後の錠剤9の検査を行う。具体的には、第2検査部75は、第2撮影画像I2に基づいて、錠剤9の上面に形成された印刷画像が正常か否か、および、錠剤9に新たな欠陥が無いかどうか等を検査する。このとき、第2検査部75は、第2撮影画像I2のうち、第2検査領域情報D4により指定される領域について、印刷画像の良否および欠陥の有無を検査する。そして、第2検査部75は、検査結果D5を、排出指示部76へ出力する。 The second inspection unit 75 inspects the tablet 9 after printing based on the second captured image I2. Specifically, the second inspection unit 75 inspects whether the printed image formed on the top surface of the tablet 9 is normal and whether there are any new defects on the tablet 9 based on the second captured image I2. At this time, the second inspection unit 75 inspects the quality of the printed image and the presence or absence of defects for the area of the second captured image I2 specified by the second inspection area information D4. The second inspection unit 75 then outputs the inspection result D5 to the discharge instruction unit 76.

排出指示部76は、不良品排出部50の動作を制御する。排出指示部76は、第1検査部72の検査結果D2および第2検査部75の検査結果D5に基づいて、錠剤9が良品であるか不良品であるかを判断する。そして、排出指示部76は、錠剤9が不良品であると判断した場合には、不良品排出部50へ排出指示D6を出力する。これにより、不良品ブロー機構51が動作して、不良品と判断された錠剤9が、不良品回収部52へ排出される。また、排出指示部76は、錠剤9が良品であると判断した場合には、不良品排出部50へ排出指示D6を出力しない。この場合、良品と判断された錠剤9は、不良品排出位置P4を通過して良品排出位置P5まで搬送される。そして、良品ブロー機構61が動作することにより、良品と判断された錠剤9が、良品回収部62へ排出される。 The discharge instruction unit 76 controls the operation of the defective product discharge unit 50. The discharge instruction unit 76 judges whether the tablet 9 is a good product or a defective product based on the inspection result D2 of the first inspection unit 72 and the inspection result D5 of the second inspection unit 75. If the discharge instruction unit 76 judges that the tablet 9 is a defective product, it outputs a discharge instruction D6 to the defective product discharge unit 50. This causes the defective product blow mechanism 51 to operate, and the tablet 9 judged to be a defective product is discharged to the defective product collection unit 52. If the discharge instruction unit 76 judges that the tablet 9 is a good product, it does not output the discharge instruction D6 to the defective product discharge unit 50. In this case, the tablet 9 judged to be a good product is conveyed to the good product discharge position P5 through the defective product discharge position P4. Then, the good product blow mechanism 61 operates, and the tablet 9 judged to be a good product is discharged to the good product collection unit 62.

<3.撮影画像の領域判定について>
上述の通り、コンピュータ70の第1領域判定部71および第2領域判定部74は、撮影画像中の検査対象となる領域を判定する。以下では、この領域判定処理の詳細について、説明する。なお、以下では、第1撮像部20または第2撮像部40により取得された撮影画像を「撮影画像I」とする。撮影画像Iは、第1撮影画像I1であってもよく、第2撮影画像I2であってもよい。
<3. Area determination of captured image>
As described above, the first area determination unit 71 and the second area determination unit 74 of the computer 70 determine the area to be inspected in the captured image. Details of this area determination process will be described below. In the following, the captured image acquired by the first imaging unit 20 or the second imaging unit 40 is referred to as the "captured image I." The captured image I may be the first captured image I1 or the second captured image I2.

図6は、領域判定処理の手順を示したフローチャートである。図6に示すように、コンピュータ70は、まず、撮影画像Iを構成する複数のピクセルを、輝度値に基づくクラスタリングにより、3つの領域に分類する(ステップS1)。 Figure 6 is a flowchart showing the procedure for the region determination process. As shown in Figure 6, the computer 70 first classifies the multiple pixels that make up the captured image I into three regions by clustering based on the brightness values (step S1).

図7は、撮影画像Iの例を示した図である。図8は、撮影画像Iを構成する複数のピクセルの輝度値の分布を示したヒストグラムである。図8のヒストグラムにおいて、横軸は輝度値であり、縦軸はピクセル数である。図7および図8に示すように、錠剤9の撮影画像Iでは、錠剤9の上面の輝度値が、最も高くなる傾向がある(図8の符号L1の部分)。また、錠剤9の撮影画像Iでは、錠剤9の側面の輝度値が、上面の次に高くなる傾向がある(図8の符号L2の部分)。また、錠剤9の撮影画像Iでは、背景の輝度値が、最も低くなる傾向がある(図8の符号L3の部分)。 Figure 7 shows an example of a captured image I. Figure 8 is a histogram showing the distribution of luminance values of multiple pixels constituting the captured image I. In the histogram in Figure 8, the horizontal axis represents luminance value, and the vertical axis represents the number of pixels. As shown in Figures 7 and 8, in the captured image I of the tablet 9, the luminance value of the top surface of the tablet 9 tends to be the highest (part marked L1 in Figure 8). Also, in the captured image I of the tablet 9, the luminance value of the side surface of the tablet 9 tends to be the second highest after the top surface (part marked L2 in Figure 8). Also, in the captured image I of the tablet 9, the luminance value of the background tends to be the lowest (part marked L3 in Figure 8).

ステップS1では、この輝度値の傾向を利用して、撮影画像Iに含まれる複数のピクセルを、3つの領域に分類する。具体的には、コンピュータ70が、撮影画像Iに含まれる複数のピクセルを、k-meansクラスタリングにより、錠剤9の上面に相当する第1上面領域A11と、錠剤9の側面に相当する第1側面領域A21と、背景に相当する第1背景領域A31と、の3つの領域に分類する。 In step S1, this tendency of brightness values is used to classify the multiple pixels included in the captured image I into three regions. Specifically, the computer 70 classifies the multiple pixels included in the captured image I into three regions using k-means clustering: a first top region A11 corresponding to the top surface of the tablet 9, a first side region A21 corresponding to the side of the tablet 9, and a first background region A31 corresponding to the background.

k-meansクラスタリングについてより詳細に説明すると、コンピュータ70は、まず、撮影画像Iに含まれる複数のピクセルを、ランダムに、または所定の法則に従って、3つのクラスタに分類する。次に、コンピュータ70は、各クラスタに属する複数のピクセルの輝度値の平均値を求める。その後、各ピクセルの輝度値と、3つのクラスタの上記平均値との差を求める。そして、各ピクセルを、上記の差が最も小さいクラスタに分類し直す。コンピュータ70は、このような処理を、ピクセルの分類結果が変動しなくなるまで、あるいは、所定の終了条件を満たすまで繰り返す。その結果、図9のように、撮影画像Iに含まれる複数のピクセルが、最も輝度値が高いピクセル群である第1上面領域A11と、その次に輝度値が高いピクセル群である第1側面領域A21と、最も輝度値が低いピクセル群である第1背景領域A31と、に分類される。 To explain k-means clustering in more detail, the computer 70 first classifies the multiple pixels included in the captured image I into three clusters randomly or according to a predetermined rule. Next, the computer 70 calculates the average brightness value of the multiple pixels belonging to each cluster. Then, the computer 70 calculates the difference between the brightness value of each pixel and the above average value of the three clusters. Then, each pixel is reclassified into the cluster with the smallest difference. The computer 70 repeats this process until the pixel classification results no longer fluctuate or a predetermined termination condition is met. As a result, as shown in FIG. 9, the multiple pixels included in the captured image I are classified into the first top surface area A11, which is the pixel group with the highest brightness value, the first side surface area A21, which is the pixel group with the second highest brightness value, and the first background area A31, which is the pixel group with the lowest brightness value.

このステップS1では、撮影画像Iが、錠剤9の上面、錠剤9の側面、および背景の3つの領域に、概ね分類される。ただし、光の反射などの影響で、一部のピクセルが誤ったクラスタに分類される場合がある。特に、錠剤9の側面に相当するピクセルは、誤ったクラスタに分類される場合が多い。そこで、3つの領域をより精度良く判別するために、コンピュータ70は、以下のステップS2~S6の処理を行う。 In this step S1, the captured image I is roughly classified into three regions: the top surface of the tablet 9, the side of the tablet 9, and the background. However, some pixels may be classified into the wrong cluster due to the influence of light reflection, etc. In particular, pixels corresponding to the side of the tablet 9 are often classified into the wrong cluster. Therefore, in order to more accurately distinguish between the three regions, the computer 70 performs the processes of the following steps S2 to S6.

ステップS1が終了すると、コンピュータ70は、錠剤9の全体に相当する第1全体領域A41を生成する(ステップS2)。ここでは、上述した3つの領域A11,A21,A31のうち、比較的安定した分類結果を得やすい第1上面領域A11に基づいて、第1全体領域A41を生成する。図10は、ステップS2の処理の様子を示した図である。図10では、膨張前の第1上面領域A11が破線で示され、膨張後の第1全体領域A41が実線で示されている。図10のように、コンピュータ70は、略楕円形状の第1上面領域A11を、短径方向に沿って、第1側面領域A21側へ膨張させる。このとき、コンピュータ70は、予め記憶部703に記憶された膨張率を使用して、第1上面領域A11を膨張させる。これにより、概ね錠剤9の全体形状に沿った第1全体領域A41が生成される。 When step S1 is completed, the computer 70 generates a first overall region A41 corresponding to the entire tablet 9 (step S2). Here, the first overall region A41 is generated based on the first upper surface region A11, which is easier to obtain a relatively stable classification result among the three regions A11, A21, and A31 described above. FIG. 10 is a diagram showing the processing of step S2. In FIG. 10, the first upper surface region A11 before expansion is shown by a dashed line, and the first overall region A41 after expansion is shown by a solid line. As shown in FIG. 10, the computer 70 expands the first upper surface region A11, which has a substantially elliptical shape, toward the first side region A21 along the minor axis direction. At this time, the computer 70 expands the first upper surface region A11 using an expansion rate previously stored in the storage unit 703. As a result, the first overall region A41 that generally follows the overall shape of the tablet 9 is generated.

続いて、コンピュータ70は、錠剤9の全体に相当し、かつ、第1全体領域A41よりも精密な第2全体領域A42を決定する(ステップS3)。ここでは、ステップS2で得られた第1全体領域A41を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、第2全体領域A42を決定する。図11は、ステップS3の処理の様子を示した図である。図11では、教示ラベルとなる第1全体領域A41が破線で示され、領域分割手法により決定される第2全体領域A42が実線で示されている。 Then, the computer 70 determines a second overall region A42 that corresponds to the entire tablet 9 and is more precise than the first overall region A41 (step S3). Here, the first overall region A41 obtained in step S2 is used as a teaching label, and the second overall region A42 is determined by a region segmentation method that finds a boundary line with a large luminance gradient. Figure 11 is a diagram showing the processing of step S3. In Figure 11, the first overall region A41 that is the teaching label is shown by a dashed line, and the second overall region A42 determined by the region segmentation method is shown by a solid line.

このステップS3では、コンピュータ70は、撮影画像Iの第1全体領域A41の輪郭線の近傍において、次の数式(1)で表されるエネルギーEが最小となる閉曲線である境界線Cを求める。 In this step S3, the computer 70 determines a boundary line C, which is a closed curve in the vicinity of the contour of the first entire area A41 of the captured image I, for which the energy E expressed by the following formula (1) is minimum.

Figure 0007565247000001
Figure 0007565247000001

なお、数式(1)において、∇lは輝度値の変化率(輝度勾配)であり、length(C)は境界線Cの長さであり、αは定数である。また、関数g(x)は、g(x)=exp(-√x)と定義する。したがって、輝度勾配の大きさ|∇l|が大きくなるとg(|∇l|)は小さくなる。すなわち、このステップS3では、境界線Cの長さが過大とならないよう制限しつつ、輝度勾配が最大となる境界線Cを求める。そして、コンピュータ70は、求められた閉曲線である境界線Cにより囲まれる領域を、第2全体領域A42として決定する。 In formula (1), ∇l is the rate of change of the luminance value (luminance gradient), length(C) is the length of boundary line C, and α is a constant. The function g(x) is defined as g(x) = exp(-√x). Therefore, as the magnitude of the luminance gradient |∇l| increases, g(|∇l|) decreases. That is, in step S3, boundary line C with the maximum luminance gradient is found while restricting the length of boundary line C so that it does not become excessively large. Then, computer 70 determines the area enclosed by boundary line C, which is the found closed curve, as second entire area A42.

続いて、コンピュータ70は、ステップS3で得られた第2全体領域A42を収縮させることにより、錠剤9の上面に相当する第2上面領域A12を生成する(ステップS4)。図12は、ステップS4の処理の様子を示した図である。図12では、収縮前の第2全体領域A42が破線で示され、収縮後の第2上面領域A12が実線で示されている。図12のように、コンピュータ70は、略楕円形状の第2全体領域A42を、短径方向に沿って、第1上面領域A11側へ収縮させる。このとき、コンピュータ70は、予め記憶部703に記憶された収縮率を使用して、第2全体領域A42を収縮させる。これにより、概ね錠剤9の上面形状に沿った第2上面領域A12が生成される。 Next, the computer 70 shrinks the second overall region A42 obtained in step S3 to generate a second upper surface region A12 corresponding to the upper surface of the tablet 9 (step S4). FIG. 12 is a diagram showing the processing of step S4. In FIG. 12, the second overall region A42 before shrinkage is shown by a dashed line, and the second upper surface region A12 after shrinkage is shown by a solid line. As shown in FIG. 12, the computer 70 shrinks the second overall region A42, which is approximately elliptical, toward the first upper surface region A11 along the minor axis direction. At this time, the computer 70 shrinks the second overall region A42 using a shrinkage rate previously stored in the storage unit 703. As a result, the second upper surface region A12 that generally follows the shape of the upper surface of the tablet 9 is generated.

続いて、コンピュータ70は、錠剤9の上面に相当し、かつ、第2上面領域A12よりも精密な第3上面領域A13を決定する(ステップS5)。ここでは、ステップS4で得られた第2上面領域A12を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、第3上面領域A13を決定する。図13は、ステップS5の処理の様子を示した図である。図13では、教示ラベルとなる第2上面領域A12が破線で示され、領域分割手法により決定される第3上面領域A13が実線で示されている。 Next, the computer 70 determines a third top surface area A13 that corresponds to the top surface of the tablet 9 and is more precise than the second top surface area A12 (step S5). Here, the second top surface area A12 obtained in step S4 is used as a teaching label, and the third top surface area A13 is determined by a region segmentation method that finds a boundary line where the luminance gradient becomes large. Figure 13 is a diagram showing the processing of step S5. In Figure 13, the second top surface area A12, which is the teaching label, is shown by a dashed line, and the third top surface area A13 determined by the region segmentation method is shown by a solid line.

このステップS5では、コンピュータ70は、撮影画像Iの第2上面領域A12の輪郭線の近傍において、上記の数式(1)で表されるエネルギーEが最小となる閉曲線である境界線Cを求める。ただし、ステップS5における定数αは、上記のステップS3における定数αと異なる値であってもよい。コンピュータ70は、境界線Cの長さが過大とならないよう制限しつつ、輝度勾配が最大となる境界線Cを求める。そして、コンピュータ70は、求められた閉曲線である境界線Cにより囲まれる領域を、第3上面領域A13として決定する。 In this step S5, the computer 70 finds a boundary line C, which is a closed curve near the contour of the second upper surface area A12 of the captured image I, where the energy E expressed by the above formula (1) is minimum. However, the constant α in step S5 may be a value different from the constant α in the above step S3. The computer 70 finds the boundary line C where the brightness gradient is maximum, while limiting the length of the boundary line C so that it is not excessively large. The computer 70 then determines the area enclosed by the found boundary line C, which is a closed curve, as the third upper surface area A13.

その後、コンピュータ70は、錠剤9の側面に相当し、かつ、第1側面領域A21よりも精密な第2側面領域A22を決定する(ステップS6)。図14は、ステップS6の処理の様子を示した図である。このステップS6では、コンピュータ70は、ステップS3において決定された第2全体領域A42と、ステップS5において決定された第3上面領域A13との排他的論理和をとることにより、第2側面領域A22を決定する。すなわち、コンピュータ70は、第2全体領域A42から第3上面領域A13を除いた残りの部分を、第2側面領域A22として決定する。 Then, the computer 70 determines a second side area A22 that corresponds to the side of the tablet 9 and is more precise than the first side area A21 (step S6). FIG. 14 is a diagram showing the processing of step S6. In this step S6, the computer 70 determines the second side area A22 by taking the exclusive OR of the second entire area A42 determined in step S3 and the third upper surface area A13 determined in step S5. In other words, the computer 70 determines the remaining portion of the second entire area A42 excluding the third upper surface area A13 as the second side area A22.

そして、コンピュータ70は、ステップS5において決定された第3上面領域A13と、ステップS6において決定された第2側面領域A22とを、検査領域として判定する(ステップS7)。 Then, the computer 70 determines the third top surface area A13 determined in step S5 and the second side surface area A22 determined in step S6 as the inspection areas (step S7).

以上のように、コンピュータ70は、まず、撮影画像Iのピクセルを、輝度値に基づくクラスタリングにより、3つの領域に分類する(ステップS1)。次に、コンピュータ70は、3つの領域のうち、比較的安定した分類結果が得られる第1上面領域A11を膨張させることにより、第1全体領域A41を生成する(ステップS2)。続いて、コンピュータ70は、第1全体領域A41を教示ラベルとして、領域分割手法により、精密な第2全体領域A42を決定する(ステップS3)。続いて,コンピュータ70は、第2全体領域A42を収縮させることにより、第2上面領域A12を生成する(ステップS4)。続いて、コンピュータ70は、第2上面領域A12を教示ラベルとして、領域分割手法により、精密な第3上面領域A13を決定する(ステップS5)。その後、コンピュータ70は、第2全体領域A42と第3上面領域A13との排他的論理和をとることにより、精密な第2側面領域A22を生成する(ステップS6)。 As described above, the computer 70 first classifies the pixels of the captured image I into three regions by clustering based on the brightness values (step S1). Next, the computer 70 generates the first entire region A41 by expanding the first top surface region A11, which is one of the three regions from which a relatively stable classification result can be obtained (step S2). Next, the computer 70 determines the precise second entire region A42 by a region division method using the first entire region A41 as a teaching label (step S3). Next, the computer 70 generates the second upper surface region A12 by contracting the second entire region A42 (step S4). Next, the computer 70 determines the precise third upper surface region A13 by a region division method using the second upper surface region A12 as a teaching label (step S5). After that, the computer 70 generates the precise second side region A22 by taking the exclusive OR of the second entire region A42 and the third upper surface region A13 (step S6).

このようにすれば、エッジ検出に依存することなく、撮影画像Iに含まれる錠剤9の上面領域および側面領域を判定できる。また、クラスタリングのみで錠剤9の上面領域および側面領域を判定する場合よりも精度よく、錠剤9の上面領域および側面領域を判定できる。したがって、錠剤9の上面および側面の検査を、精度よく行うことができる。 In this way, the top and side regions of tablet 9 contained in captured image I can be determined without relying on edge detection. Furthermore, the top and side regions of tablet 9 can be determined more accurately than when the top and side regions of tablet 9 are determined by clustering alone. Therefore, the top and side regions of tablet 9 can be inspected with high accuracy.

特に、錠剤9の撮影画像Iにおいて、錠剤9の全体領域と背景領域との境界は、輝度値の差が比較的大きい。このため、コンピュータ70は、上記のステップS3において、錠剤9の上面領域よりも先に、錠剤9の全体領域を、領域分割手法により決定している。これにより、コンピュータ70は、第2全体領域A42を精度よく決定する。そして、コンピュータ70は、当該第2全体領域A42を収縮させることにより生成された、信頼性の高い第2上面領域A12に対して、さらに領域分割手法を適用することにより、精密な第3上面領域A13を決定する。これにより、第3上面領域A13を、より精度よく決定できる。 In particular, in the photographed image I of the tablet 9, the boundary between the entire region of the tablet 9 and the background region has a relatively large difference in brightness value. For this reason, in the above step S3, the computer 70 determines the entire region of the tablet 9 using a region segmentation method before the top surface region of the tablet 9. This allows the computer 70 to accurately determine the second entire region A42. The computer 70 then applies a region segmentation method to the highly reliable second top surface region A12 generated by shrinking the second entire region A42, thereby determining a precise third top surface region A13. This allows the third top surface region A13 to be determined more accurately.

<4.変形例>
以上、本発明の実施形態について説明したが、本発明は、上記の実施形態に限定されるものではない。
4. Modifications
Although the embodiment of the present invention has been described above, the present invention is not limited to the above embodiment.

上記の実施形態では、ステップS1において、k-meansクラスタリングを実行していた。しかしながら、k-meansクラスタリングに代えて、k-medoidsクラスタリングを実行してもよい。すなわち、ステップS1において、クラスタ毎に、輝度値の平均値を求める代わりに、輝度値の中央値を求めてもよい。そして、各ピクセルの輝度値と、3つのクラスタの上記中央値との差を求め、各ピクセルを、上記の差が最も小さいクラスタに分類し直してもよい。 In the above embodiment, k-means clustering is performed in step S1. However, k-medoids clustering may be performed instead of k-means clustering. That is, in step S1, instead of calculating the average brightness value for each cluster, the median brightness value may be calculated. Then, the difference between the brightness value of each pixel and the above median value of the three clusters may be calculated, and each pixel may be reclassified into the cluster with the smallest difference.

また、上記の実施形態では、錠剤9の上面および側面が検査対象とされていた。しかしながら、錠剤9の上面および側面のうち、上面のみが検査対象とされていてもよい。その場合、上述したステップS6の処理は省略されてもよい。 In the above embodiment, the top and side surfaces of the tablet 9 are inspected. However, of the top and side surfaces of the tablet 9, only the top surface may be inspected. In that case, the process of step S6 described above may be omitted.

また、上記の実施形態では、印刷前の第1撮像位置P1と、印刷後の第2撮像位置P3の2箇所において、錠剤9の撮影が行われていた。すなわち、上記の実施形態では、印刷前と印刷後の2回の検査が行われていた。しかしながら、錠剤9の検査は、印刷前および印刷後のいずれか一方のみであってもよい。 In addition, in the above embodiment, the tablet 9 was photographed at two locations: the first imaging position P1 before printing, and the second imaging position P3 after printing. That is, in the above embodiment, inspection was performed twice, before printing and after printing. However, the tablet 9 may be inspected only either before printing or after printing.

また、上記の実施形態では、錠剤9の上面に印刷を行う錠剤印刷装置1について説明した。しかしながら、本発明は、印刷機能を持たない錠剤検査装置に適用されるものであってもよい。 In the above embodiment, a tablet printing device 1 that prints on the top surface of a tablet 9 has been described. However, the present invention may also be applied to a tablet inspection device that does not have a printing function.

また、上記の実施形態では、印刷部30に、4つのヘッド31が設けられていた。しかしながら、印刷部30に含まれるヘッド31の数は、1~3つであってもよく、5つ以上であってもよい。 In addition, in the above embodiment, the printing unit 30 is provided with four heads 31. However, the number of heads 31 included in the printing unit 30 may be one to three, or may be five or more.

また、錠剤印刷装置1は、上記の実施形態の構成に加えて、錠剤9に付着したインクを乾燥させる乾燥機構を有していてもよい。乾燥機構は、印刷部30よりも搬送方向の下流側、かつ、不良品排出部50よりも搬送方向の上流側に設けるとよい。乾燥機構は、例えば、搬送ベルト12により搬送される錠剤9に向けて熱風を吹き付ける機構とすればよい。 In addition to the configuration of the above embodiment, the tablet printing device 1 may also have a drying mechanism for drying the ink adhering to the tablets 9. The drying mechanism may be provided downstream of the printing unit 30 in the conveying direction and upstream of the defective product ejection unit 50 in the conveying direction. The drying mechanism may be, for example, a mechanism for blowing hot air toward the tablets 9 conveyed by the conveyor belt 12.

また、本発明における「錠剤」は、医薬品としての錠剤だけではなく、サプリメントとしての錠剤や、ラムネなどの錠菓であってもよい。 In addition, the "tablet" in the present invention may refer not only to a pharmaceutical tablet, but also to a supplement tablet or a tablet candy such as Ramune.

また、上記の実施形態では、撮影画像の各ピクセルの値が「輝度」であるとして説明した。しかしながら、撮影画像の各ピクセルの値を変換等した値、例えば「濃度値」等の値に対して、本発明を適用可能であることは言うまでもない。 In the above embodiment, the value of each pixel in the captured image is described as "brightness." However, it goes without saying that the present invention can be applied to values obtained by converting the value of each pixel in the captured image, such as "density values."

その他、錠剤印刷装置の細部については、本発明の趣旨を逸脱しない範囲で、適宜に変更を加えることが可能である。また、上記の実施形態や変形例に登場した各要素を、矛盾が生じない範囲で、適宜に組み合わせてもよい。 Other details of the tablet printing device can be modified as appropriate without departing from the spirit of the present invention. In addition, the elements appearing in the above embodiments and variations can be combined as appropriate without causing any contradictions.

1 錠剤印刷装置
9 錠剤
10 搬送機構
20 第1撮像部
30 印刷部
40 第2撮像部
50 不良品排出部
60 良品排出部
70 コンピュータ
71 第1領域判定部
72 第1検査部
73 印刷指示部
74 第2領域判定部
75 第2検査部
76 排出指示部
80 搬入機構
A11 第1上面領域
A12 第2上面領域
A13 第3上面領域
A21 第1側面領域
A22 第2側面領域
A31 第1背景領域
A41 第1全体領域
A42 第2全体領域
D1 第1検査領域情報
D2 検査結果
D3 印刷指示
D4 第2検査領域情報
D5 検査結果
D6 排出指示
I 撮影画像
I1 第1撮影画像
I2 第2撮影画像
LIST OF SYMBOLS 1 Tablet printing device 9 Tablet 10 Conveying mechanism 20 First imaging section 30 Printing section 40 Second imaging section 50 Defective product ejection section 60 Good product ejection section 70 Computer 71 First area determination section 72 First inspection section 73 Print instruction section 74 Second area determination section 75 Second inspection section 76 Ejection instruction section 80 Carrying-in mechanism A11 First top surface area A12 Second top surface area A13 Third top surface area A21 First side surface area A22 Second side surface area A31 First background area A41 First entire area A42 Second entire area D1 First inspection area information D2 Inspection result D3 Print instruction D4 Second inspection area information D5 Inspection result D6 Ejection instruction I Photographed image I1 First photographed image I2 Second photographed image

Claims (6)

上面および側面を有する錠剤の撮影画像における領域判定方法であって、
a)前記撮影画像の各ピクセルを、輝度値に基づくクラスタリングにより、前記上面に相当する第1上面領域と、前記側面に相当する第1側面領域と、背景に相当する第1背景領域と、の3つの領域に分類する工程と、
b)前記工程a)の後に、前記第1上面領域を、前記第1側面領域側へ膨張させることにより、前記錠剤の全体に相当する第1全体領域を生成する工程と、
c)前記工程b)の後に、前記第1全体領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記錠剤の全体に相当する第2全体領域を決定する工程と、
d)前記工程c)の後に、前記第2全体領域を、前記第1上面領域側へ収縮させることにより、前記上面に相当する第2上面領域を生成する工程と、
e)前記工程d)の後に、前記第2上面領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記上面に相当する第3上面領域を決定する工程と、
を有する、領域判定方法。
A method for determining an area in a captured image of a tablet having an upper surface and a side surface, comprising:
a) classifying each pixel of the captured image into three regions, a first top region corresponding to the top surface, a first side region corresponding to the side surface, and a first background region corresponding to a background, by clustering based on brightness values;
b) after step a), expanding the first upper surface region toward the first side surface region to generate a first entire region corresponding to the entire tablet;
c) after the step b), a step of determining a second overall region corresponding to the entire tablet by a region segmentation method for determining a boundary line with a large luminance gradient using the first overall region as a teaching label;
d) after step c), shrinking the second overall region toward the first upper surface region to generate a second upper surface region corresponding to the upper surface;
e) after step d), determining a third upper surface region corresponding to the upper surface by a region division method for determining a boundary line with a large luminance gradient using the second upper surface region as an instruction label;
The region determination method includes the steps of:
請求項1に記載の領域判定方法であって、
f)前記工程e)の後に、前記第2全体領域と前記第3上面領域の排他的論理和をとることにより、前記側面に相当する第2側面領域を決定する工程
をさらに有する、領域判定方法。
The area determination method according to claim 1 ,
f) after step e), determining a second side surface area corresponding to the side by taking an exclusive OR of the second overall area and the third top surface area.
請求項1または請求項2に記載の領域判定方法であって、
前記工程a)では、前記撮影画像の各ピクセルを、k-meansクラスタリングにより、前記第1上面領域、前記第1側面領域、および前記第1背景領域に分類する、領域判定方法。
The area determination method according to claim 1 or 2,
In the step a), each pixel of the captured image is classified into the first top surface region, the first side surface region, and the first background region by k-means clustering.
請求項1から請求項3までのいずれか1項に記載の領域判定方法であって、
前記工程c)および前記工程e)では、前記輝度勾配を∇l、関数g(x)をg(x)=exp(-√x)、境界の長さをlength(C)、αを定数として、
Figure 0007565247000002
で表されるエネルギーEが最小となる境界線Cを求める、領域判定方法。
The area determination method according to any one of claims 1 to 3,
In the steps c) and e), the luminance gradient is ∇l, the function g(x) is g(x)=exp(−√x), the length of the boundary is length(C), and α is a constant,
Figure 0007565247000002
The method for determining an area is to find a boundary line C that minimizes the energy E represented by the following equation:
錠剤を検査する錠剤検査方法であって、
A)錠剤の撮影画像を取得する工程と、
B)請求項1から請求項4までのいずれか1項に記載の領域判定方法により、前記撮影画像中の検査領域を判定する工程と、
C)前記撮影画像の前記検査領域を検査する工程と、
を有する、錠剤検査方法。
A tablet inspection method for inspecting tablets, comprising:
A) acquiring an image of a tablet;
B) determining an inspection area in the captured image by a region determination method according to any one of claims 1 to 4;
C) inspecting the inspection area of the captured image;
A tablet inspection method comprising the steps of:
上面および側面を有する錠剤を検査する錠剤検査装置であって、
錠剤の撮影画像を取得する撮像部と、
前記撮影画像中の検査領域を判定する領域判定部と、
前記撮影画像の前記検査領域を検査する検査部と、
を備え、
前記領域判定部は、
a)前記撮影画像の各ピクセルを、輝度値に基づくクラスタリングにより、前記上面に相当する第1上面領域と、前記側面に相当する第1側面領域と、背景に相当する第1背景領域と、の3つの領域に分類する工程と、
b)前記工程a)の後に、前記第1上面領域を、前記第1側面領域側へ膨張させることにより、前記錠剤の全体に相当する第1全体領域を生成する工程と、
c)前記工程b)の後に、前記第1全体領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記錠剤の全体に相当する第2全体領域を決定する工程と、
d)前記工程c)の後に、前記第2全体領域を、前記第1上面領域側へ収縮させることにより、前記上面に相当する第2上面領域を生成する工程と、
e)前記工程d)の後に、前記第2上面領域を教示ラベルとして、輝度勾配が大きくなる境界線を求める領域分割手法により、前記上面に相当する第3上面領域を決定する工程と、
を実行し、前記第3上面領域を前記検査領域とする、錠剤検査装置。
1. A tablet inspection apparatus for inspecting tablets having a top surface and a side surface, comprising:
An imaging unit for acquiring a photographed image of a tablet;
an area determination unit that determines an inspection area in the captured image;
an inspection unit that inspects the inspection area of the captured image;
Equipped with
The area determination unit is
a) classifying each pixel of the captured image into three regions, a first top region corresponding to the top surface, a first side region corresponding to the side surface, and a first background region corresponding to a background, by clustering based on brightness values;
b) after step a), expanding the first upper surface region toward the first side surface region to generate a first entire region corresponding to the entire tablet;
c) after the step b), a step of determining a second overall region corresponding to the entire tablet by a region segmentation method for determining a boundary line with a large luminance gradient using the first overall region as a teaching label;
d) after step c), shrinking the second overall region toward the first upper surface region to generate a second upper surface region corresponding to the upper surface;
e) after step d), determining a third upper surface region corresponding to the upper surface by a region division method for determining a boundary line with a large luminance gradient using the second upper surface region as an instruction label;
and the third upper surface area is the inspection area.
JP2021075806A 2021-04-28 2021-04-28 Area determination method, tablet inspection method, and tablet inspection device Active JP7565247B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021075806A JP7565247B2 (en) 2021-04-28 2021-04-28 Area determination method, tablet inspection method, and tablet inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021075806A JP7565247B2 (en) 2021-04-28 2021-04-28 Area determination method, tablet inspection method, and tablet inspection device

Publications (2)

Publication Number Publication Date
JP2022170002A JP2022170002A (en) 2022-11-10
JP7565247B2 true JP7565247B2 (en) 2024-10-10

Family

ID=83944320

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021075806A Active JP7565247B2 (en) 2021-04-28 2021-04-28 Area determination method, tablet inspection method, and tablet inspection device

Country Status (1)

Country Link
JP (1) JP7565247B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6491776B1 (en) 2018-04-12 2019-03-27 株式会社Windy Tablet recognition or identification system and method
WO2019138930A1 (en) 2018-01-15 2019-07-18 株式会社Screenホールディングス Tablet inspection method and tablet inspection device
JP2019124519A (en) 2018-01-15 2019-07-25 株式会社Screenホールディングス Tablet inspection method and tablet inspection device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8712163B1 (en) * 2012-12-14 2014-04-29 EyeNode, LLC Pill identification and counterfeit detection method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019138930A1 (en) 2018-01-15 2019-07-18 株式会社Screenホールディングス Tablet inspection method and tablet inspection device
JP2019124519A (en) 2018-01-15 2019-07-25 株式会社Screenホールディングス Tablet inspection method and tablet inspection device
JP6491776B1 (en) 2018-04-12 2019-03-27 株式会社Windy Tablet recognition or identification system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
インクジェット式錠剤印刷機「OMNITO」の外観検査の紹介,月刊画像ラボ別冊 医薬品製造における自動外観検査 技術・装置ガイド ,日本,日本工業出版株式会社,2020年10月10日,p.36
松田 晋也,高速3D計測を搭載した錠剤外観検査装置,画像ラボ,日本,日本工業出版株式会社,2015年07月10日,第26巻 第7号,pp.61~66

Also Published As

Publication number Publication date
JP2022170002A (en) 2022-11-10

Similar Documents

Publication Publication Date Title
JP7496458B2 (en) Information processing device, information processing method, information processing program, learning device, learning method, and trained model
JP7607110B2 (en) Conveyor and Processing Equipment
JP7181377B2 (en) Inspection method, program, inspection device, and printing device
JP6644648B2 (en) Tablet printing apparatus and tablet printing method
JP2020069084A (en) Granular material conveying device and granular material processing device
JP6978970B2 (en) Printing equipment and printing method
CN109195803B (en) Data processing device, tablet printing device, data processing method, and tablet printing method
JP7225068B2 (en) Defect inspection device for printed matter, defect inspection method and program, and printing system
JP7602595B2 (en) Tablet Printing Equipment
JP7565247B2 (en) Area determination method, tablet inspection method, and tablet inspection device
TW202406527A (en) Tablet printing apparatus and tablet printing method can improve the inspection accuracy when the tablets on which information is printed as a code is under inspection
JP7451364B2 (en) Tablet printing device and tablet printing method
JP6991920B2 (en) Vibration feeder and printing equipment
JP7256139B2 (en) Defect inspection device for printed matter, defect inspection method and program, and printing system
JP2018079240A (en) Printing apparatus and validation method
JP2021041052A (en) Printing method and printer
JP2019072497A (en) Tablet printing apparatus and tablet printing method
JP2019202506A (en) Printing method, printer and granular material
JP6397061B2 (en) Tablet printing method
JP7545869B2 (en) Method and device for producing printed edible objects
JP2020062468A (en) Tablet printing device and tablet printing method
JP2024128532A (en) Inspection method and inspection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20231218

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240912

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240930

R150 Certificate of patent or registration of utility model

Ref document number: 7565247

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150