JP6975423B2 - All-around image generator and all-around image generation method - Google Patents

All-around image generator and all-around image generation method Download PDF

Info

Publication number
JP6975423B2
JP6975423B2 JP2017240000A JP2017240000A JP6975423B2 JP 6975423 B2 JP6975423 B2 JP 6975423B2 JP 2017240000 A JP2017240000 A JP 2017240000A JP 2017240000 A JP2017240000 A JP 2017240000A JP 6975423 B2 JP6975423 B2 JP 6975423B2
Authority
JP
Japan
Prior art keywords
image
model
article
around
container
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
JP2017240000A
Other languages
Japanese (ja)
Other versions
JP2019105611A (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.)
N Tech KK
Yakult Honsha Co Ltd
TOHOSHOJI KK
Original Assignee
N Tech KK
Yakult Honsha Co Ltd
TOHOSHOJI KK
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 N Tech KK, Yakult Honsha Co Ltd, TOHOSHOJI KK filed Critical N Tech KK
Priority to JP2017240000A priority Critical patent/JP6975423B2/en
Publication of JP2019105611A publication Critical patent/JP2019105611A/en
Application granted granted Critical
Publication of JP6975423B2 publication Critical patent/JP6975423B2/en
Active 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)
  • Image Processing (AREA)

Description

本発明は、物品を撮影した複数の画像を用いて、物品の少なくとも一部の全周に亘る全周画像を物品の周方向の位置と対応付けて生成する全周画像生成装置および全周画像生成方法に関する。 The present invention is an all-around image generator and an all-around image that uses a plurality of images of an article to generate an all-around image over at least a part of the entire circumference of the article in association with a position in the circumferential direction of the article. Regarding the generation method.

従来、容器等の物品の外面に付されたラベル等の検査対象を検査する容器検査装置が知られている。例えば、特許文献1に記載された容器検査装置は、容器に付された良品のラベルの外面全周を示す全周画像を記憶する記憶部と、容器を撮像してラベルを含む部分画像を取得する撮像部とを備える。そして、容器検査装置は、部分画像におけるラベルの部分の位置を、全周画像を用いて特定する位置特定部と、特定された位置に応じたラベルの部分の外観検査を、全周画像と部分画像とを比較して行う容器検査部とを備える。 Conventionally, a container inspection device for inspecting an inspection target such as a label attached to the outer surface of an article such as a container has been known. For example, the container inspection device described in Patent Document 1 has a storage unit that stores an all-around image showing the entire outer surface of a good product label attached to a container, and an image of the container to acquire a partial image including the label. It is provided with an image pickup unit. Then, the container inspection device performs an visual inspection of the position specifying part that specifies the position of the label part in the partial image by using the all-around image and the part of the label corresponding to the specified position with the all-around image and the part. It is equipped with a container inspection unit that compares with the image.

また、例えば特許文献2には、容器の向きを検出する容器向き検出装置が開示されている。容器向き検出装置は、容器の外周面の図柄を撮影するカメラを有する撮影装置を備える。記憶部には、容器の周方向に位置の異なる複数の図柄部をモデルとして位置情報と対応付けたモデル登録データが記憶されている。容器向き検出装置は、カメラが容器を撮影して得た部分画像のうち、モデルと類似する類似図柄部を探索するマッチング処理を行い、探し当てた類似図柄部の位置情報と、その類似図柄部と対応するモデルの位置情報とに基づいて、容器の向きを検出する容器向き検出部を備える。 Further, for example, Patent Document 2 discloses a container orientation detecting device for detecting the orientation of a container. The container orientation detection device includes a photographing device having a camera for photographing a pattern on the outer peripheral surface of the container. The storage unit stores model registration data associated with position information using a plurality of symbol units having different positions in the circumferential direction of the container as a model. The container orientation detection device performs matching processing to search for a similar symbol portion similar to the model in the partial image obtained by the camera taking a picture of the container, and the position information of the similar symbol portion found and the similar symbol portion. A container orientation detection unit that detects the orientation of the container based on the position information of the corresponding model is provided.

特開2016−17810号公報Japanese Unexamined Patent Publication No. 2016-17810 特開2017−100796号公報Japanese Unexamined Patent Publication No. 2017-100796

ところで、特許文献1、2に記載された容器検査装置では、容器の部分画像と比較する全周画像を、物品の周方向の位置と対応付けて予め記憶部に記憶しておく必要がある。また、特許文献2に記載された容器向き検出装置では、複数のモデルを作成する際に作業者がモデルとすべき領域を選択する対象である良品のラベルの全周画像を物品の周方向の位置と対応付けて用意する必要がある。例えば、ラベルの原画(版下)の画像データを入手できる場合は、原画を基に周方向の位置と対応付けた全周画像を生成できる。しかし、原画を入手できない場合は、良品の容器をカメラで撮影した部分画像を周方向の位置と対応付けて全周分取得し、これらの部分画像を位置補正しながら繋ぎ合せる作業を手作業で行う必要がある。このため、容器の周方向の位置情報と対応付けられた全周画像を簡単に生成することが要望されている。なお、この種の課題は、容器以外の物品でも、カメラで撮影した撮影画像と全周画像とを用いて各種の検査や検出が行われる場合に共通する。 By the way, in the container inspection apparatus described in Patent Documents 1 and 2, it is necessary to store the entire circumference image to be compared with the partial image of the container in the storage unit in advance in association with the position in the circumferential direction of the article. Further, in the container orientation detection device described in Patent Document 2, when creating a plurality of models, an image of the entire circumference of a good product label, which is an object for an operator to select an area to be a model, is displayed in the circumferential direction of the article. It is necessary to prepare it in association with the position. For example, when the image data of the original image (block copy) of the label can be obtained, it is possible to generate an all-around image associated with the position in the circumferential direction based on the original image. However, if the original image is not available, the partial image of the non-defective container taken with the camera is associated with the position in the circumferential direction and acquired for the entire circumference, and the work of joining these partial images while correcting the position is manually performed. There is a need to do. Therefore, it is required to easily generate an all-around image associated with the position information in the circumferential direction of the container. It should be noted that this kind of problem is common to articles other than containers when various inspections and detections are performed using a photographed image taken by a camera and an all-around image.

本発明の目的は、物品を撮影した複数の部分画像を用いて、全周画像を物品の周方向の位置に対応付けて生成することができる全周画像生成装置および全周画像生成方法を提供することにある。 An object of the present invention is to provide an all-around image generation device and an all-around image generation method capable of generating an all-around image in association with a position in the circumferential direction of an article by using a plurality of partial images obtained by photographing an article. To do.

以下、上記課題を解決するための手段及びその作用効果について記載する。
上記課題を解決する全周画像生成装置は、良品の物品を撮影して得た部分画像を収集して周方向の位置情報と対応付けた全周画像を生成する全周画像生成装置であって、物品を撮影して得た撮影画像を順次取得する画像取得部と、前記画像取得部が取得した一の前記撮影画像中の前記物品の正面位置を基準位置に設定し、当該物品の当該正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積する蓄積部と、前記画像取得部が取得した一の前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得部とを備え、前記蓄積部は、前記画像取得部が前記モデルの取得元の前記撮影画像の後に取得した後の撮影画像に対して前記モデルを用いたマッチング処理を行い、マッチすれば当該マッチした位置の位置情報と前記モデルの位置情報とを基に前記物品の正面位置を割り出し、前記後の撮影画像中の前記物品の前記正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積し、マッチしなければ次の撮影画像に移行する蓄積処理を行い、前記モデル取得部が、前記マッチしたときの前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得処理と、前記蓄積部が、少なくとも最新の前記モデルを用いて行う前記マッチング処理を含む前記蓄積処理とを、周方向の位置情報と対応付けた部分画像を少なくとも全周分に相当する複数収集するまで繰り返して前記全周画像を生成する。この構成によれば、物品の周方向の位置情報に対応付けられた全周画像を比較的簡単に生成することができる。
Hereinafter, means for solving the above problems and their actions and effects will be described.
The all-around image generation device that solves the above-mentioned problems is an all-around image generation device that collects partial images obtained by photographing a non-defective article and generates an all-around image associated with position information in the circumferential direction. , An image acquisition unit that sequentially acquires captured images obtained by photographing an article, and a front position of the article in one of the captured images acquired by the image acquisition unit are set as reference positions, and the front surface of the article is set. A model is created based on a storage unit that stores a partial image at a position in association with position information in the circumferential direction and stores it in a storage unit, and a predetermined area of a part of the article in one photographed image acquired by the image acquisition unit. The storage unit includes a model acquisition unit to be acquired, and the storage unit performs matching processing using the model on the captured image acquired after the captured image of the acquisition source of the model by the storage unit to perform matching. Then, the front position of the article is determined based on the position information of the matched position and the position information of the model, and the partial image at the front position of the article in the subsequent photographed image is used as the position information in the circumferential direction. A storage process is performed in which the images are stored in the storage unit in association with each other, and if there is no match, the image is moved to the next captured image. At least all of the partial images in which the model acquisition process for acquiring a model based on the model and the accumulation process including the matching process performed by the storage unit using at least the latest model are associated with the positional information in the circumferential direction. The whole-circle image is generated repeatedly until a plurality of peripheral images are collected. According to this configuration, it is possible to relatively easily generate an all-around image associated with the position information in the circumferential direction of the article.

上記全周画像生成装置では、前記蓄積部は、前記物品の周を複数分割した代表位置が属する領域ごとに前記部分画像を蓄積し、マッチした際の今回の前記正面位置が属する前記領域に先の前記部分画像が蓄積されている場合は、当該今回の正面位置が前記先の部分画像の前記正面位置よりも当該領域の代表位置に近ければ、当該領域に蓄積する部分画像を、先の前記部分画像から今回の前記部分画像に更新することが好ましい。この構成によれば、蓄積処理を進めるうちに蓄積される部分画像がより適切な部分画像に更新されるため、歪みの少ないより精度の高い全周画像を生成することができる。 In the all-around image generation device, the storage unit accumulates the partial image for each region to which the representative position is divided into a plurality of circumferences of the article, and precedes the region to which the front position at the time of matching belongs. When the partial image of the above is accumulated, if the front position of the present time is closer to the representative position of the region than the front position of the previous partial image, the partial image accumulated in the region is stored in the above. It is preferable to update the partial image to the above-mentioned partial image this time. According to this configuration, since the accumulated partial image is updated to a more appropriate partial image while the accumulation process is advanced, it is possible to generate a more accurate all-around image with less distortion.

上記全周画像生成装置では、前記モデル取得部は、最初に取得した前記モデルの周方向の位置に対して前記物品の周方向における一方向に移動した位置と、他方向に移動した位置との両方の位置で複数の前記モデルを取得し、前記蓄積部は、複数の前記モデルを用いて前記マッチング処理を行うことが好ましい。 In the all-around image generation device, the model acquisition unit has a position moved in one direction in the circumferential direction of the article and a position moved in the other direction with respect to the position in the circumferential direction of the model first acquired. It is preferable to acquire a plurality of the models at both positions and perform the matching process on the storage unit using the plurality of the models.

この構成によれば、最初に取得されたモデルの位置に対して物品の周方向における一方向と他方向との両方向に移動する位置にある複数のモデルを用いたマッチング処理が行われるので、マッチする頻度が高まる。よって、位置情報に対応付けられた全周画像を比較的高速に生成できる。 According to this configuration, matching processing is performed using a plurality of models located at positions that move in both one direction and the other direction in the circumferential direction of the article with respect to the position of the first acquired model. Increase the frequency of doing. Therefore, it is possible to generate an all-around image associated with the position information at a relatively high speed.

上記全周画像生成装置では、前記モデル取得部は、前記モデルの周方向の位置が、他の前記モデルとの間に前記部分画像が蓄積されていない空の領域を挟むように複数の前記モデルを取得し、前記蓄積部は、複数の前記モデルを用いて前記マッチング処理を行うことが好ましい。この構成によれば、モデルの周方向の位置が、他のモデルとの間に部分画像が蓄積されていない空の領域を挟む位置にある複数のモデルを用いてマッチング処理が行われるので、位置情報に対応付けられた全周画像を比較的高速に生成できる。 In the all-around image generation device, the model acquisition unit has a plurality of the models such that the position in the circumferential direction of the model sandwiches an empty region in which the partial image is not accumulated between the model and the other models. It is preferable that the storage unit performs the matching process using a plurality of the models. According to this configuration, the matching process is performed using a plurality of models whose positions in the circumferential direction of the model are located between the other models and the empty area where the partial image is not accumulated. It is possible to generate an all-around image associated with information at a relatively high speed.

上記全周画像生成装置では、前記蓄積部は、所定条件を満たすまで前記モデル取得処理と前記蓄積処理とを繰り返しても前記全周画像を完成できなかった場合、前記部分画像が蓄積されていない未蓄積の領域の代表位置を取得し、当該未蓄積の領域の隣の位置に蓄積済みの領域が存在すれば、当該蓄積済みの領域に蓄積されている前記部分画像の取得元である前記撮影画像から前記未蓄積の領域の前記代表位置に対応する位置の前記部分画像を取得して位置情報と対応付けて前記未蓄積の領域に蓄積することが好ましい。 In the all-around image generation device, if the all-around image cannot be completed even after repeating the model acquisition process and the accumulation process until a predetermined condition is satisfied, the partial image is not accumulated. If the representative position of the unaccumulated area is acquired and the accumulated area exists at the position next to the unaccumulated area, the photographing which is the acquisition source of the partial image accumulated in the accumulated area is taken. It is preferable to acquire the partial image of the position corresponding to the representative position of the unaccumulated region from the image and store it in the unaccumulated region in association with the position information.

この構成によれば、全周画像を完成できなかった場合でも、既存の撮影画像を利用して位置情報に対応付けた全周画像を完成することができる。よって、全周画像を用いて行われる、例えばモデル登録処理、物品向き検出処理、又は物品検査処理などの所定の処理を実施できる。 According to this configuration, even if the all-around image cannot be completed, the all-around image associated with the position information can be completed by using the existing captured image. Therefore, a predetermined process such as a model registration process, an article orientation detection process, or an article inspection process, which is performed using an all-around image, can be performed.

上記全周画像生成装置は、前記全周画像から選択された周方向に位置の異なる複数の画像領域を基に複数のモデルを作成し、当該複数のモデルを周方向の位置情報と対応付けて登録するモデル登録部を更に備える。この構成によれば、物品の向きの検出に必要なモデルの取得元となる全周画像を比較的簡単に生成できることから、周方向に位置の異なる複数のモデルを簡単に取得できる。 The all-around image generator creates a plurality of models based on a plurality of image regions having different positions in the circumferential direction selected from the all-around image, and associates the plurality of models with the position information in the circumferential direction. It also has a model registration unit for registration. According to this configuration, since it is relatively easy to generate an all-around image that is a source of acquiring a model necessary for detecting the orientation of an article, it is possible to easily acquire a plurality of models having different positions in the circumferential direction.

上記全周画像生成装置は、外面に図柄を有する向き特定対象の物品を撮影した撮影画像に対して、前記モデル登録部が作成した前記モデルを用いてマッチング処理を行って、マッチした類似図柄部の位置情報と当該モデルの位置情報とを基に前記撮影画像中の当該物品の正面位置又は当該物品の周方向の所定位置を特定する位置特定部を更に備える。この構成によれば、物品の正面位置又は周方向の所定位置からなる物品の向きを検出することができ、しかも物品の向きの検出に必要な全周画像を比較的簡単に生成することができる。 The all-around image generation device performs matching processing using the model created by the model registration unit on a photographed image obtained by photographing an article of a direction specific target having a pattern on the outer surface, and matches the similar symbol portion. Further, a position specifying portion for specifying the front position of the article in the photographed image or a predetermined position in the circumferential direction of the article is provided based on the position information of the above and the position information of the model. According to this configuration, it is possible to detect the orientation of the article consisting of the front position of the article or a predetermined position in the circumferential direction, and it is possible to relatively easily generate an all-around image necessary for detecting the orientation of the article. ..

上記全周画像生成装置は、前記全周画像から周方向の部分画像である良品画像を全周分に相当する複数生成する良品画像生成部と、検査対象の物品の欠点の有無を検査する検査部と、検査対象の前記物品を撮影した前記撮影画像中の当該物品の正面位置を特定する位置特定部とを更に備え、前記検査部は、前記撮影画像中の検査画像と、前記位置特定部が特定した前記正面位置に対応する前記良品画像とを比較した比較結果を基に前記物品の欠点の有無を検査する。この構成によれば、物品の欠点の有無を検査できるうえ、検査に必要な良品画像を簡単に取得することができる。 The all-around image generation device includes a good-quality image generation unit that generates a plurality of non-defective images corresponding to the entire circumference from the all-around image, and an inspection for inspecting the presence or absence of defects in the article to be inspected. The inspection unit further includes a unit and a position specifying unit for specifying the front position of the article in the captured image obtained by photographing the article to be inspected, and the inspection unit includes an inspection image in the captured image and the position specifying unit. The presence or absence of defects in the article is inspected based on the comparison result of comparison with the non-defective image corresponding to the front position specified by. According to this configuration, it is possible to inspect the presence or absence of defects in the article, and it is possible to easily obtain a good image necessary for the inspection.

上記全周画像生成装置では、前記物品は、外面にラベルが付され、前記検査部は、前記ラベルの欠点を検査することが好ましい。この構成によれば、物品に付されたラベルの欠点を検査することができる。 In the all-around image generation device, it is preferable that the article is labeled on the outer surface and the inspection unit inspects the defect of the label. According to this configuration, defects of the label attached to the article can be inspected.

上記課題を解決する全周画像生成方法は、良品の物品を撮影して得た部分画像を収集して周方向の位置情報と対応付けた全周画像を生成する全周画像生成方法であって、物品を撮影して得た撮影画像を順次取得する画像取得ステップと、前記画像取得ステップで取得した一の前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得ステップと、前記画像取得ステップで前記モデルの取得元の前記撮影画像の後に取得した後の撮影画像に対して前記モデルを用いたマッチング処理を行い、マッチすれば当該マッチした位置の位置情報と前記モデルの位置情報とを基に前記物品の正面位置を割り出し、前記後の撮影画像中の前記物品の前記正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積し、マッチしなければ次の撮影画像に移行する蓄積処理を行う蓄積ステップとを備え、前記マッチしたときの前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得する前記モデル取得ステップと、少なくとも最新の前記モデルを用いて行う前記マッチング処理を含む前記蓄積処理を行う前記蓄積ステップとを、周方向の位置情報と対応付けた部分画像を少なくとも全周分に相当する複数収集するまで繰り返して前記全周画像を生成する。この方法によれば、物品の周方向の位置情報に対応付けられた全周画像を比較的簡単に生成することができる。 The all-around image generation method that solves the above-mentioned problems is an all-around image generation method that collects partial images obtained by photographing a non-defective article and generates an all-around image associated with position information in the circumferential direction. , Image acquisition step to sequentially acquire captured images obtained by photographing an article, and model acquisition to acquire a model based on a predetermined area of a part of the article in one photographed image acquired in the image acquisition step. Matching processing using the model is performed on the step and the captured image acquired after the captured image of the acquisition source of the model in the image acquisition step, and if there is a match, the position information of the matched position and the said. The front position of the article is determined based on the position information of the model, and the partial image of the article at the front position in the later captured image is stored in the storage unit in association with the position information in the circumferential direction and matched. If not, the model acquisition step of acquiring a model based on a predetermined area of a part of the article in the captured image at the time of matching is provided with an accumulation step of performing an accumulation process for shifting to the next captured image. The accumulation step including the matching process performed using at least the latest model is repeated until a plurality of partial images associated with the position information in the circumferential direction are collected at least corresponding to the entire circumference. The all-around image is generated. According to this method, it is possible to relatively easily generate an all-around image associated with the position information in the circumferential direction of the article.

本発明によれば、物品の周方向の位置情報に対応付けられた全周画像を比較的簡単に生成することができる。 According to the present invention, it is possible to relatively easily generate an all-around image associated with the position information in the circumferential direction of an article.

第1実施形態におけるラベル検査装置を示す模式平面図。The schematic plan view which shows the label inspection apparatus in 1st Embodiment. ラベルが付された容器を示す正面図。Front view showing a labeled container. ラベル検査装置の電気的構成及び機能的構成を示すブロック図。The block diagram which shows the electrical structure and the functional structure of a label inspection apparatus. 全周画像生成処理ルーチンを示すフローチャート。A flowchart showing an all-around image generation processing routine. ラベルの全周をパノラマ展開した図。A panoramic view of the entire circumference of the label. 全周画像生成処理における最初の処理を説明する模式図。The schematic diagram explaining the first process in the all-around image generation process. (a),(b)は、部分画像を取得する処理を説明する模式図。(A) and (b) are schematic diagrams illustrating a process of acquiring a partial image. 容器の正面位置(正面角度)を取得する補正演算処理を説明する模式図。The schematic diagram explaining the correction calculation process which acquires the front position (front angle) of a container. 記憶部における位置格納部、第1格納部および第2格納部を示す模式図。The schematic diagram which shows the position storage part, the 1st storage part and the 2nd storage part in a storage part. 第1格納部に格納された部分画像を示す模式図。The schematic diagram which shows the partial image stored in the 1st storage part. 全周画像生成処理における2回目の処理を説明する模式図。The schematic diagram explaining the 2nd processing in the all-around image generation processing. (a),(b)は、部分画像を取得する処理を説明する模式図。(A) and (b) are schematic diagrams illustrating a process of acquiring a partial image. 全周画像生成処理の進捗状況を示す画面の図。The figure of the screen which shows the progress of the all-around image generation processing. 全周画像を示す模式図。Schematic diagram showing an all-around image. 全周画像から作成されるマッチング処理用のモデルを説明する模式図。A schematic diagram illustrating a model for matching processing created from an all-around image. 全周画像から作成される検査用の良品画像データを示す模式図。Schematic diagram showing non-defective image data for inspection created from all-around images. モデル登録処理ルーチンを示すフローチャート。A flowchart showing a model registration processing routine. ラベル検査処理ルーチンを示すフローチャート。A flowchart showing a label inspection processing routine. 検査画像と良品画像とを比較する比較処理を説明する模式図。The schematic diagram explaining the comparison process which compares an inspection image and a non-defective product image. 第2実施形態におけるモデルを追加する二方向方式を説明する模式図。The schematic diagram explaining the two-way method which adds the model in 2nd Embodiment. (a),(b)は、モデルを追加する飛び石方式を説明する模式図。(A) and (b) are schematic diagrams illustrating a stepping stone method for adding a model. 第2実施形態の全周画像生成処理ルーチンを示すフローチャート。The flowchart which shows the all-around image generation processing routine of 2nd Embodiment.

(第1実施形態)
以下、全周画像生成装置を具体化した第1実施形態としてのラベル検査装置について、図面を参照して説明する。
(First Embodiment)
Hereinafter, a label inspection device as a first embodiment, which embodies the all-around image generation device, will be described with reference to the drawings.

図1に示すラベル検査装置11は、搬送部の一例としての搬送装置12を構成するコンベヤ13に載せて搬送される図2に示す物品の一例としての容器20を撮影し、その撮影画像を基に容器20の外周面21に付されたラベル22を検査対象としてラベル22の欠点の有無を検査する。検査内容は、ラベル22の破れ、異物の付着、汚れ、ラベル収縮不良などの欠点(不良箇所)が挙げられる。また、ラベル検査装置11は、容器20に対するラベル22の高さ方向の位置ずれ(高さずれ)も検査する。 The label inspection device 11 shown in FIG. 1 photographs a container 20 as an example of the article shown in FIG. 2 and is conveyed on a conveyor 13 constituting the transfer device 12 as an example of the transfer unit, and based on the photographed image. The label 22 attached to the outer peripheral surface 21 of the container 20 is used as an inspection target, and the presence or absence of defects of the label 22 is inspected. The inspection contents include defects (defective parts) such as tearing of the label 22, adhesion of foreign matter, dirt, and poor label shrinkage. The label inspection device 11 also inspects the position deviation (height deviation) of the label 22 with respect to the container 20 in the height direction.

本実施形態のラベル検査装置11は、複数の撮影画像SG(図6、図11等)を用いて、容器20に付されたラベル22の全周画像AG(図14を参照)を生成する全周画像生成部62(図3を参照)を備えることにより、全周画像生成装置として機能する。全周画像AGは、容器20の検査に用いられる、モデルM(図15)および良品画像RG(図16)の各データを作成するために使用される。 The label inspection device 11 of the present embodiment uses a plurality of captured images SG (FIGS. 6, 11, etc.) to generate an all-around image AG (see FIG. 14) of the label 22 attached to the container 20. By providing the peripheral image generation unit 62 (see FIG. 3), it functions as an all-around image generation device. The all-around image AG is used to create the data of the model M (FIG. 15) and the non-defective image RG (FIG. 16) used for the inspection of the container 20.

図1に示す搬送装置12は、コンベヤ13の上流側に設置された図示しないシュリンクラベラーによって容器20の外周面21にラベル22(シュリンクラベル)が付された容器20を搬送する。ラベル22は、図示しない加熱トンネルを通過して加熱されることにより熱収縮して容器20の外面に密着する状態で付されている。搬送装置12は、コンベヤ13の上流側かつシュリンクラベラーよりも下流側の位置に公知のタイミングスクリューを備え、容器20はタイミングスクリューによって搬送方向Xに所定の間隔が開けられた状態でコンベヤ13へ搬入される。コンベヤ13は、搬送装置12の動力源である電動モータの動力により駆動され、複数の容器20を所定の間隔を開けた状態で所定の搬送速度で搬送する。コンベヤ13に載置された容器20は任意の向きで搬送されてくる。なお、コンベヤ13上の容器20の転倒が心配される場合は、コンベヤ13に容器20の底面を吸引する不図示の吸引孔を設け、吸引装置により吸引孔に負圧を及ぼすことで容器20をコンベヤ13に吸着させることが好ましい。 The transport device 12 shown in FIG. 1 transports a container 20 having a label 22 (shrink label) on the outer peripheral surface 21 of the container 20 by a shrink labeler (not shown) installed on the upstream side of the conveyor 13. The label 22 is attached in a state of being heat-shrinked by being heated through a heating tunnel (not shown) and in close contact with the outer surface of the container 20. The conveyor 12 is provided with a known timing screw at a position upstream of the conveyor 13 and downstream of the shrink labeler, and the container 20 is carried into the conveyor 13 with a predetermined interval in the transport direction X by the timing screw. Will be done. The conveyor 13 is driven by the power of an electric motor that is a power source of the transfer device 12, and conveys a plurality of containers 20 at a predetermined transfer speed with a predetermined interval. The container 20 placed on the conveyor 13 is conveyed in an arbitrary direction. If there is a concern that the container 20 on the conveyor 13 may tip over, the conveyor 13 is provided with a suction hole (not shown) for sucking the bottom surface of the container 20, and the container 20 is subjected to a negative pressure by a suction device. It is preferable to suck it on the conveyor 13.

図1に示すように、ラベル検査装置11は、容器20を撮影する撮影装置30と、撮影装置30が容器20を撮影した撮影画像を用いてラベル22の全周画像AGを生成する全周画像生成処理、およびラベル22を検査する検査処理を行うコントローラ40とを備える。また、コントローラ40は、全周画像AGを用いて、ラベル22の検査に用いるモデルMと良品画像RGとを作成する。なお、コントローラ40は、搬送装置12および撮影装置30の制御も行う。 As shown in FIG. 1, the label inspection device 11 uses the photographing device 30 for photographing the container 20 and the photographed image obtained by photographing the container 20 to generate an all-around image AG of the label 22. It includes a controller 40 that performs a generation process and an inspection process for inspecting the label 22. Further, the controller 40 creates the model M used for the inspection of the label 22 and the non-defective image RG by using the all-around image AG. The controller 40 also controls the transport device 12 and the photographing device 30.

図1に示すように、撮影装置30は、コンベヤ13の搬送経路上の途中に位置する所定の被撮影位置にある容器20を、複数方向(図1に示す例では4方向)から撮影する複数(例えば4つ)のカメラ31と、撮影対象である容器20を照明する照明機器32とを備える。図1に示す4つのカメラ31は、同図における平面視において被撮影位置にある容器20の周方向に約90度ずつずれた4つの位置に配置されている。各カメラ31の高さ位置は、コンベヤ13上を搬送される容器20のラベル22の高さに合わせられている。カメラ31は、レンズ等の光学系と2次元イメージセンサー等の撮像素子(CCD撮像素子又はCMOS撮像素子等)とを備える。 As shown in FIG. 1, the photographing apparatus 30 photographs a plurality of containers 20 at predetermined imaging positions located in the middle of the transport path of the conveyor 13 from a plurality of directions (four directions in the example shown in FIG. 1). It includes (for example, four) cameras 31 and a lighting device 32 that illuminates the container 20 to be photographed. The four cameras 31 shown in FIG. 1 are arranged at four positions displaced by about 90 degrees in the circumferential direction of the container 20 at the imaged position in the plan view in the figure. The height position of each camera 31 is aligned with the height of the label 22 of the container 20 conveyed on the conveyor 13. The camera 31 includes an optical system such as a lens and an image pickup element (CCD image pickup element, CMOS image pickup element, or the like) such as a two-dimensional image sensor.

図1に示す照明機器32は、容器20を照明した光の正反射光がカメラ31に直接進入しない位置に配置されている。照明機器32は、例えば、容器20に対して斜め上方位置または斜め下方位置から容器20を照明する。照明機器32は、例えば白色光源であるが、ラベル22を検査可能であれば白色以外の他の色の光源を用いてもよい。 The lighting device 32 shown in FIG. 1 is arranged at a position where the specularly reflected light of the light illuminating the container 20 does not directly enter the camera 31. The lighting device 32 illuminates the container 20 from an obliquely upper position or an obliquely lower position with respect to the container 20, for example. The lighting device 32 is, for example, a white light source, but a light source of a color other than white may be used as long as the label 22 can be inspected.

図1に示す容器センサ33は、コンベヤ13上の容器20が被撮影位置に到達する直前又は到達したときに容器20を検知する。コントローラ40は、容器センサ33が容器20を検知したタイミングで4つのカメラ31に撮影動作を指令する。この指令に基づいて4つのカメラ31は、容器20を4方向からほぼ同時に撮影する。このため、4つのカメラ31により容器20の側面全周のラベル22の画像が撮影される。 The container sensor 33 shown in FIG. 1 detects the container 20 immediately before or when the container 20 on the conveyor 13 reaches the imaged position. The controller 40 commands the four cameras 31 to take a picture at the timing when the container sensor 33 detects the container 20. Based on this command, the four cameras 31 photograph the container 20 from four directions at almost the same time. Therefore, the images of the label 22 around the entire side surface of the container 20 are taken by the four cameras 31.

各カメラ31は、容器20のラベル22を撮影した撮影画像の画像データ(画像信号)を逐次出力する。各カメラ31から出力された画像データは、コントローラ40に入力される。なお、容器20の全周を撮影可能な構成であれば、カメラ31の数は、4つ以外の複数(例えば3つ又は5つ)でもよいし、1つでもよい。例えば容器20を1回転以上回転(自転)させる構成としたり、容器20に対してカメラ31を回転(公転)させる構成としたりすれば、1つのカメラ31でも容器20の全周を撮影可能である。また、図1において、コンベヤ13の搬送経路を挟んだ両側に配置された2つずつのカメラ31を搬送方向Xに位置をずらして配置し、2つずつのカメラ31が、異なるタイミングで容器20を撮影する構成でもよい。 Each camera 31 sequentially outputs image data (image signal) of a photographed image obtained by photographing the label 22 of the container 20. The image data output from each camera 31 is input to the controller 40. The number of cameras 31 may be a plurality (for example, three or five) other than four, or may be one, as long as the entire circumference of the container 20 can be photographed. For example, if the container 20 is configured to rotate (rotate) by one rotation or more, or the camera 31 is configured to rotate (revolve) with respect to the container 20, one camera 31 can capture the entire circumference of the container 20. .. Further, in FIG. 1, two cameras 31 arranged on both sides of the conveyor 13 on both sides of the conveyor 13 are arranged so as to be displaced in the transport direction X, and the two cameras 31 are arranged at different timings in the container 20. It may be configured to shoot.

図2に示す容器20は、一例として略円筒形状のプラスチック容器からなり、その外周面21にラベル22が付されている。ラベル22は、容器20に対して高さ方向Zにおける所定の高さ範囲に付されている。ラベル22には、その全周に亘り図柄23が描かれている。図2に示す例では、アルファベットの大文字「A,B,C,…,H」の8文字を横に1列に並べた図柄23としている。なお、図2では、説明を簡単にするため簡略な図柄の例としているが、通常、ラベル22の図柄23には、製造会社・商品名あるいはロゴマーク等の図柄部や、商品原料・保存法・製造工場等の品質詳細等の文字列が枠で囲まれた図柄部、バーコードが枠で囲まれた図柄部、イラストやデザイン(図案)等の図柄部のうち1つ又は複数が含まれる。 As an example, the container 20 shown in FIG. 2 is made of a plastic container having a substantially cylindrical shape, and a label 22 is attached to the outer peripheral surface 21 thereof. The label 22 is attached to a predetermined height range in the height direction Z with respect to the container 20. A design 23 is drawn on the label 22 over the entire circumference thereof. In the example shown in FIG. 2, the symbol 23 is formed by arranging eight letters of the uppercase letters "A, B, C, ..., H" in a horizontal row. In addition, although FIG. 2 is an example of a simple design for the sake of simplicity of explanation, usually, the design 23 of the label 22 includes a design part such as a manufacturing company / product name or a logo mark, a product raw material / storage method, and the like. -Includes one or more of the design part where the character string such as quality details of the manufacturing factory is surrounded by a frame, the design part where the bar code is surrounded by a frame, and the design part such as illustrations and designs (designs). ..

次に、図3を参照してラベル検査装置11の電気的構成および機能的構成について説明する。図3に示すように、ラベル検査装置11を構成するコントローラ40は、回路基板に実装されたチップセット等よりなるコンピュータ50を内蔵する。また、コントローラ40には、搬送装置12、撮影装置30を構成するカメラ31および照明機器32、容器センサ33、入力装置41および表示部42が電気的に接続されている。コントローラ40は、搬送装置12の動力源である不図示の電動モータを駆動制御することによりコンベヤ13を一定速度で駆動して容器20を所定の搬送速度で搬送する。また、コントローラ40は、入力装置41から入力された指示信号に基づき、全周画像AGの生成、モデルMの登録、良品画像RGの生成およびラベル検査のための各処理を行う。また、コントローラ40は、全周画像生成進捗画面SC1(図13)、モデル登録画面、ラベル検査結果報知画面(いずれも図示略)等を表示部42に表示させる表示制御を行う。なお、入力装置41および表示部42は、制御盤に備えられてもよいし、コントローラ40の一部又は全部をパーソナルコンピュータ(PC)により構成し、PCに接続されたマウスおよびキーボードにより入力装置41を構成し、モニタにより表示部42を構成してもよい。 Next, the electrical configuration and the functional configuration of the label inspection device 11 will be described with reference to FIG. As shown in FIG. 3, the controller 40 constituting the label inspection device 11 includes a computer 50 made of a chipset or the like mounted on a circuit board. Further, the controller 40 is electrically connected to the transport device 12, the camera 31 and the lighting device 32 constituting the photographing device 30, the container sensor 33, the input device 41, and the display unit 42. The controller 40 drives the conveyor 13 at a constant speed by driving and controlling an electric motor (not shown) which is a power source of the transport device 12, and transports the container 20 at a predetermined transport speed. Further, the controller 40 performs each process for generating the all-around image AG, registering the model M, generating the non-defective image RG, and inspecting the label based on the instruction signal input from the input device 41. Further, the controller 40 performs display control for displaying the all-around image generation progress screen SC1 (FIG. 13), the model registration screen, the label inspection result notification screen (all not shown), and the like on the display unit 42. The input device 41 and the display unit 42 may be provided in the control panel, or a part or all of the controller 40 may be configured by a personal computer (PC), and the input device 41 may be provided by a mouse and a keyboard connected to the PC. , And the display unit 42 may be configured by the monitor.

図3に示すように、コンピュータ50は、CPU51(中央処理装置)および記憶部52を内蔵する。記憶部52は、ハードディスク、不揮発性メモリ又はRAMの一部の記憶領域により構成される。記憶部52には、CPU51が実行するための全周画像生成処理用プログラム(図4)、モデル登録処理用プログラム(図17)、良品画像生成処理用プログラム(図示略)およびラベル検査処理用プログラム(図18)等を含むプログラムPRが記憶されている。また、記憶部52には、ラベル検査処理で用いられるモデルデータMD(図15も参照)、良品画像データGD(図16も参照)および特徴画像データFD等が記憶されている。なお、本実施形態では、モデルデータMDおよび良品画像データGDは、全周画像データを基に作成される。また、特徴画像データFDは、良品画像データGDを基に作成される。 As shown in FIG. 3, the computer 50 includes a CPU 51 (central processing unit) and a storage unit 52. The storage unit 52 is composed of a hard disk, a non-volatile memory, or a partial storage area of the RAM. The storage unit 52 contains an all-around image generation processing program (FIG. 4), a model registration processing program (FIG. 17), a non-defective image generation processing program (not shown), and a label inspection processing program for execution by the CPU 51. A program PR including (FIG. 18) and the like is stored. Further, the storage unit 52 stores model data MD (see also FIG. 15), non-defective image data GD (see also FIG. 16), feature image data FD, and the like used in the label inspection process. In this embodiment, the model data MD and the non-defective image data GD are created based on the all-around image data. Further, the feature image data FD is created based on the non-defective image data GD.

また、図3に示す記憶部52は、全周画像生成処理の際に使用する格納領域(記憶領域)として、位置格納部53、第1格納部54、第2格納部55および第3格納部56を備える。3つの格納部53〜55は全周画像生成処理の過程で保持すべきデータの格納に用いられ、第3格納部56は全周画像生成処理で生成された全周画像AG(図14)の画像データの格納に用いられる。各格納部53〜56は、データの書替えが可能な不揮発性メモリ又はRAMの所定記憶領域により構成される。なお、各格納部53〜56の詳細は後述する。 Further, the storage unit 52 shown in FIG. 3 has a position storage unit 53, a first storage unit 54, a second storage unit 55, and a third storage unit as storage areas (storage areas) used in the all-around image generation processing. 56 is provided. The three storage units 53 to 55 are used to store data to be retained in the process of generating an all-around image, and the third storage unit 56 is a unit of the all-around image AG (FIG. 14) generated in the all-around image generation process. Used for storing image data. Each storage unit 53 to 56 is composed of a predetermined storage area of a non-volatile memory or RAM capable of rewriting data. The details of each storage unit 53 to 56 will be described later.

図3に示すコンピュータ50は、CPU51がプログラムPRを実行することにより全周画像生成処理およびラベル検査処理などを行う。CPU51はプログラムPRを実行することで、図3に示された、制御部61、全周画像生成部62、モデル登録部63、良品画像生成部64、特徴画像生成部65および検査部66として機能する。 The computer 50 shown in FIG. 3 performs all-around image generation processing, label inspection processing, and the like by executing a program PR by the CPU 51. By executing the program PR, the CPU 51 functions as a control unit 61, an all-around image generation unit 62, a model registration unit 63, a non-defective image generation unit 64, a feature image generation unit 65, and an inspection unit 66, as shown in FIG. do.

全周画像生成部62は、画像取得処理部71、モデル取得部72、蓄積部73および角度補正部74を備える。蓄積部73は、マッチング処理部75を備える。また、検査部66は、画像取得処理部81、位置特定部82、ラベル高さ検査部83、検出部84を備える。検出部84は、比較処理部85および判定部86を備える。 The all-around image generation unit 62 includes an image acquisition processing unit 71, a model acquisition unit 72, a storage unit 73, and an angle correction unit 74. The storage unit 73 includes a matching processing unit 75. Further, the inspection unit 66 includes an image acquisition processing unit 81, a position specifying unit 82, a label height inspection unit 83, and a detection unit 84. The detection unit 84 includes a comparison processing unit 85 and a determination unit 86.

図3に示す制御部61は、ラベル検査装置11の制御の全体を司り、各部62〜66に所定の処理等を指示する。また、制御部61は、作業者が操作した入力装置41からの操作信号に基づいて必要なデータの設定および各種の指示の受付けを行う。制御部61は、例えば全周画像生成処理の指示、モデル登録処理の指示およびラベル検査の指示等を受け付ける。また、制御部61は、容器センサ33の検知信号に基づいてカメラ31の撮影動作を制御する。さらに制御部61は、表示部42に各種の画面を表示させる表示制御などを行う。 The control unit 61 shown in FIG. 3 controls the entire control of the label inspection device 11, and instructs each unit 62 to 66 to perform a predetermined process or the like. Further, the control unit 61 sets necessary data and receives various instructions based on the operation signal from the input device 41 operated by the operator. The control unit 61 receives, for example, an instruction for all-around image generation processing, an instruction for model registration processing, an instruction for label inspection, and the like. Further, the control unit 61 controls the shooting operation of the camera 31 based on the detection signal of the container sensor 33. Further, the control unit 61 performs display control such as displaying various screens on the display unit 42.

次に、図3に示す全周画像生成部62について説明する。画像取得処理部71は、カメラ31が撮影した撮影画像(画像データ)を取り込んで取得する処理を行う。画像取得処理部71は、4つのカメラ31から良品の容器20を4方向から撮影した4つの撮影画像を取得する。画像取得処理部71は、画像中の容器20の位置を把握して容器20が中央に位置する所定領域の画像を撮影画像として取得する。なお、本実施形態では、撮影装置30および画像取得処理部71により、画像取得部の一例が構成される。 Next, the all-around image generation unit 62 shown in FIG. 3 will be described. The image acquisition processing unit 71 performs a process of capturing and acquiring a captured image (image data) captured by the camera 31. The image acquisition processing unit 71 acquires four captured images obtained by photographing the non-defective container 20 from four directions from the four cameras 31. The image acquisition processing unit 71 grasps the position of the container 20 in the image and acquires an image of a predetermined region in which the container 20 is located in the center as a captured image. In this embodiment, the photographing device 30 and the image acquisition processing unit 71 constitute an example of the image acquisition unit.

モデル取得部72は、撮影画像からモデルを取得する。本例では、例えば撮影画像中の容器20の正面における所定角度の範囲の一部の画像MGを取得し、その一部の画像MGの特徴を抽出することによりモデルMFを取得する。モデル取得部72は、図6に示すように、撮影画像SG中の容器20の正面における一部の画像MGを取得し、その一部の画像MGの特徴(形状または明るさ)を抽出してモデルMFを取得する。本実施形態では、容器20のラベル22の図柄23を利用するため、一部の画像MGはラベル22の正面部分を含む画像である。一部の画像MGの幅角は20〜60度の範囲内の所定値であり、一例として45度としている。モデル取得部72が作成したモデルMFは記憶部52の所定記憶領域に一時記憶される。なお、容器20の周方向の位置によって特徴が異なれば、容器20におけるラベル22以外の部分をモデルMFとしてもよい。 The model acquisition unit 72 acquires a model from the captured image. In this example, for example, a model MF is acquired by acquiring a part of the image MG in a range of a predetermined angle in front of the container 20 in the photographed image and extracting the features of the part of the image MG. As shown in FIG. 6, the model acquisition unit 72 acquires a part of the image MG in front of the container 20 in the photographed image SG, and extracts the feature (shape or brightness) of the part of the image MG. Get the model MF. In the present embodiment, since the design 23 of the label 22 of the container 20 is used, a part of the image MG is an image including the front portion of the label 22. The width angle of some image MGs is a predetermined value within the range of 20 to 60 degrees, and is set to 45 degrees as an example. The model MF created by the model acquisition unit 72 is temporarily stored in a predetermined storage area of the storage unit 52. If the characteristics differ depending on the position of the container 20 in the circumferential direction, a portion of the container 20 other than the label 22 may be used as the model MF.

蓄積部73は、全周画像生成処理時に撮影画像における容器20の周方向の位置である正面位置を特定して撮影画像から容器20の正面に位置する部分画像PGを切り出し、部分画像PGを位置情報と対応付けて全周分蓄積する処理を行う。蓄積部73は、撮影画像中の容器20の正面位置を特定する際に用いられるマッチング処理部75を備える。マッチング処理部75は、逐次取得する撮影画像(他の撮影画像)に特徴を抽出する処理を施して撮影特徴画像を取得し、その撮影特徴画像に対してモデルMFを用いてその図柄に類似する類似図柄部AM(図7(a))を探索するマッチング処理を行う。 The storage unit 73 specifies the front position, which is the position in the circumferential direction of the container 20 in the captured image during the all-around image generation process, cuts out the partial image PG located in front of the container 20 from the captured image, and positions the partial image PG. Performs the process of accumulating all the circumferences in association with the information. The storage unit 73 includes a matching processing unit 75 used to specify the front position of the container 20 in the captured image. The matching processing unit 75 acquires a photographed feature image by performing a process of extracting features from the photographed images (other photographed images) to be sequentially acquired, and uses a model MF for the photographed feature image to resemble the pattern. A matching process for searching for a similar symbol portion AM (FIG. 7A) is performed.

ここで、蓄積部73が行う蓄積処理の詳細を図5〜図12を参照して説明する。全周画像生成部62は、図5に示すように、ラベル22がパノラマ展開された0〜360度の全周の画像を生成する。蓄積部73は、逐次取得する図6等に示す撮影画像SGから容器20(本例では特にラベル22)の正面位置C0における部分画像PGを切り出し、部分画像PGを全周分に相当する複数収集することにより、ラベル22の全周画像AG(図14)を生成する。図6に示す最初の撮影画像SG(一の撮影画像)が取得されると、蓄積部73は、撮影画像SG中の容器20の正面位置C0における図6に二点鎖線で示す部分画像PGを取得する。ここで、部分画像PGは、後述する代表角度RK(例えば0度)を中心に幅角WPが例えば10〜30度の範囲内の所定値(例えば20度)の画像である。最初は、正面位置C0(正面角度)を代表角度RK=0度とするため、蓄積部73は、正面位置C0を中心とする幅角WPの部分画像PGを取得する。 Here, the details of the storage process performed by the storage unit 73 will be described with reference to FIGS. 5 to 12. As shown in FIG. 5, the all-around image generation unit 62 generates an all-around image of 0 to 360 degrees in which the label 22 is panoramicly expanded. The storage unit 73 cuts out a partial image PG at the front position C0 of the container 20 (particularly the label 22 in this example) from the captured image SG shown in FIG. 6 and the like, and collects a plurality of partial image PGs corresponding to the entire circumference. By doing so, an all-around image AG (FIG. 14) of the label 22 is generated. When the first captured image SG (one captured image) shown in FIG. 6 is acquired, the storage unit 73 displays the partial image PG shown by the alternate long and short dash line in FIG. 6 at the front position C0 of the container 20 in the captured image SG. get. Here, the partial image PG is an image having a width angle WP of a predetermined value (for example, 20 degrees) within a range of, for example, 10 to 30 degrees with a representative angle RK (for example, 0 degree) described later as a center. Initially, since the front position C0 (front angle) is set to the representative angle RK = 0 degrees, the storage unit 73 acquires a partial image PG having a width angle WP centered on the front position C0.

蓄積部73は、容器20の全周360度をJ分割する360/J度刻みの位置(図9に示す代表角度RK)ごとに計J個の部分画像PGを収集する。本例では、360度を36分割する10度刻みの位置ごとに計36個の部分画像PGを収集する。この場合、360度を36分割した幅角10度にその周方向の両側に±γ度の角度幅を加えた図6に示す幅角WPの部分画像PGを取得する。γは、例えば0〜10度の範囲内の値であり、本例ではγ=5度としている。蓄積部73は、最初の撮影画像SG(図6)中の容器20の正面における中心位置C0を中心とする幅角WPが20度の範囲のラベル22の領域を部分画像PGとして取得する。蓄積部73は、最初の撮影画像SG(図6)中の容器20の正面位置を基準位置(仮の0度)(図5参照)に設定し、その後の蓄積処理を進める。なお、カメラ31で容器20を撮影すると、170度近くの画角で撮影画像が得られるが、容器20の幅方向の両端部は図柄23が大きく歪んで撮影されるため、撮影画像SGには、容器20の幅角が例えば90〜170度の範囲内の所定値(例えば110度)の範囲の画像が使用される。但し、撮影画像SGの範囲を決める容器20の幅角は、カメラ31の数に応じて適宜変更可能である。 The storage unit 73 collects a total of J partial image PGs at 360 / J degree increment positions (representative angle RK shown in FIG. 9) that divide 360 degrees around the entire circumference of the container 20 into J. In this example, a total of 36 partial image PGs are collected for each position in increments of 10 degrees that divides 360 degrees into 36. In this case, the partial image PG of the width angle WP shown in FIG. 6 in which the width angle of 360 degrees is divided into 36 and the angle width of ± γ degrees is added to both sides in the circumferential direction is acquired. γ is, for example, a value in the range of 0 to 10 degrees, and in this example, γ = 5 degrees. The storage unit 73 acquires the region of the label 22 in the range of the width angle WP around the center position C0 in the front of the container 20 in the first captured image SG (FIG. 6) as a partial image PG. The storage unit 73 sets the front position of the container 20 in the first captured image SG (FIG. 6) to a reference position (provisional 0 degree) (see FIG. 5), and proceeds with the subsequent storage process. When the container 20 is photographed by the camera 31, a photographed image can be obtained at an angle of view close to 170 degrees. , An image in which the width angle of the container 20 is in the range of a predetermined value (for example, 110 degrees) in the range of, for example, 90 to 170 degrees is used. However, the width angle of the container 20 that determines the range of the captured image SG can be appropriately changed according to the number of cameras 31.

マッチング処理部75は、図7(a)に示す次の撮影画像SGにおけるラベル22の領域を探索対象としてモデルMFを用いてマッチング処理を行う。マッチング処理部75は、次の撮影画像SGを特徴抽出した撮影特徴画像内でモデルMFを所定ピッチ(例えば1画素又は数画素)ずつずらして比較対象の図柄部の位置を変更しながら、モデルMFとの類似度のスコアを順次求める。類似度のスコアが所定の閾値を超えれば、その類似度のスコアとその類似図柄部の位置情報とを記憶部52に一時記憶する。そして、マッチング処理部75は、探索処理を終えると、類似度のスコアが一番高い類似図柄部AMがマッチしたと判断する。図7(a)に示す例では、モデルMFは同図に示す位置で類似図柄部AMとマッチする。 The matching processing unit 75 performs matching processing using the model MF with the area of the label 22 in the next captured image SG shown in FIG. 7A as a search target. The matching processing unit 75 shifts the model MF by a predetermined pitch (for example, one pixel or several pixels) in the captured feature image from which the next captured image SG is feature-extracted, and changes the position of the symbol portion to be compared while changing the position of the model MF. The score of the degree of similarity with is sequentially obtained. When the similarity score exceeds a predetermined threshold value, the similarity score and the position information of the similar symbol portion are temporarily stored in the storage unit 52. Then, when the search processing is completed, the matching processing unit 75 determines that the similar symbol unit AM having the highest similarity score is matched. In the example shown in FIG. 7 (a), the model MF matches the similar symbol portion AM at the position shown in the figure.

蓄積部73は、マッチング処理でマッチした類似図柄部AMの周方向の位置座標で示される検出位置C1を計算し、その検出位置C1と、そのマッチング処理で用いたモデルMFの登録位置Cm(仮の0度である基準位置)とを基に図8に示す幾何学的な関係を用いた計算を行って、撮影画像SG中の容器20の正面位置C0(正面角度θc)を特定する。蓄積部73は、図7(b)に示す次の撮影画像SGから容器20の代表角度RKを中心とする幅角WP(本例では20度)の範囲のラベル22の部分画像PGを取得する。なお、図8に示す幾何学的な関係を用いた計算内容については後述する。 The storage unit 73 calculates the detection position C1 indicated by the position coordinates in the circumferential direction of the similar symbol unit AM matched in the matching process, and the detection position C1 and the registration position Cm (provisional) of the model MF used in the matching process. The front position C0 (front angle θc) of the container 20 in the photographed image SG is specified by performing a calculation using the geometrical relationship shown in FIG. 8 based on the reference position (0 degree). The storage unit 73 acquires a partial image PG of the label 22 in the range of the width angle WP (20 degrees in this example) centered on the representative angle RK of the container 20 from the next photographed image SG shown in FIG. 7 (b). .. The calculation contents using the geometrical relationship shown in FIG. 8 will be described later.

ここで、図9を参照して蓄積部73が蓄積処理で使用する3つの格納部53〜55について説明する。位置格納部53は、全周360度をJ分割(本例では36分割)した代表角度RK=0度、10度、20度、…、360度に対応するJ個(本例では36個)の格納部AKを備える。格納部AKは全周画像生成処理の開始に先立ち初期値(例えば「99」)にリセットされる。部分画像PGの正面位置C0が基準位置(仮の0度)を基準とする角度で示される正面角度θcは、J個のうちいずれかの代表角度RKの領域に属し、正面角度θcが属する領域の代表角度RKの格納部AKには、その代表角度RKと正面角度θcとの誤差が格納される。10度刻みの代表角度RKをRKi(但し、i=0,1,…35)とおくと、正面角度θcが代表角度RKiの領域に属することを示す条件RKi−5<θc≦RKi+5を満たす場合、代表角度RKiの格納部AKには、その代表角度RKiと正面角度θcとの誤差に相当する値が格納される。このように本実施形態では、部分画像PGの位置情報は基準位置(仮の0度)に対する相対位置(相対角度)で示され、代表角度と誤差で示される。 Here, with reference to FIG. 9, three storage units 53 to 55 used by the storage unit 73 in the storage process will be described. The position storage unit 53 has J divisions (36 divisions in this example) of 360 degrees all around, corresponding to representative angles RK = 0 degrees, 10 degrees, 20 degrees, ..., 360 degrees. The storage unit AK is provided. The storage unit AK is reset to the initial value (for example, “99”) prior to the start of the all-around image generation process. The frontal angle θc in which the frontal position C0 of the partial image PG is indicated by an angle with respect to the reference position (provisional 0 degree) belongs to the region of one of the representative angles RK among the J pieces, and the region to which the frontal angle θc belongs. The error between the representative angle RK and the front angle θc is stored in the storage unit AK of the representative angle RK. When the representative angle RK in increments of 10 degrees is set to RKi (where i = 0, 1, ... 35), the condition RKi-5 <θc≤RKi + 5 indicating that the front angle θc belongs to the region of the representative angle RKi is satisfied. In the storage unit AK of the representative angle RKi, a value corresponding to an error between the representative angle RKi and the front angle θc is stored. As described above, in the present embodiment, the position information of the partial image PG is indicated by the relative position (relative angle) with respect to the reference position (provisional 0 degree), and is indicated by the representative angle and the error.

第1格納部54は、代表角度RKに対応するJ個の格納部PKを備える。格納部PKには、代表角度RKを幅中心とする部分画像PGの画像データが格納される。また、第2格納部55は、代表角度RKに対応するJ個の格納部QKを備える。格納部QKには、同じ代表角度RKの格納部PKに格納された部分画像PGの切り出し元である撮影画像SGの画像データが格納される。位置格納部53の格納部AKに初期値以外の値が格納されている場合、同じ代表角度RKの格納部PKにはその代表角度RKと誤差とで規定される正面角度の撮影画像SGから代表角度RKを中心とする所定領域を切り出した部分画像PGが格納される。 The first storage unit 54 includes J storage units PK corresponding to the representative angle RK. The image data of the partial image PG having the representative angle RK as the width center is stored in the storage unit PK. Further, the second storage unit 55 includes J storage units QK corresponding to the representative angle RK. In the storage unit QK, the image data of the captured image SG, which is the cutting source of the partial image PG stored in the storage unit PK of the same representative angle RK, is stored. When a value other than the initial value is stored in the storage unit AK of the position storage unit 53, the storage unit PK of the same representative angle RK is represented by the captured image SG of the front angle defined by the representative angle RK and the error. A partial image PG obtained by cutting out a predetermined area centered on the angle RK is stored.

例えば図9に示す例では、代表角度RKが「0度」の格納部AKには「0(零)」が格納されていることから、その代表角度RKの格納部PKには、代表角度RKと誤差のない正面角度θcが「0度」の撮影画像SGから切り出した部分画像PGが格納される。また、代表角度RKが「20度」の格納部AKには「2」が格納されていることから、その代表角度RKの格納部PKには、代表角度RKと2度の誤差のある正面角度「22度」の撮影画像SGから代表角度RKの20度を幅中心とする部分画像PGが格納されている。そして、蓄積部73は、各格納部PKに部分画像PGを順次格納し、最終的に第1格納部54にはラベル22の全周分の部分画像PGが格納される。 For example, in the example shown in FIG. 9, since "0 (zero)" is stored in the storage unit AK whose representative angle RK is "0 degree", the representative angle RK is stored in the storage unit PK of the representative angle RK. A partial image PG cut out from the captured image SG having a front angle θc of “0 degrees” without an error is stored. Further, since "2" is stored in the storage unit AK whose representative angle RK is "20 degrees", the front angle having an error of 2 degrees from the representative angle RK in the storage unit PK of the representative angle RK. A partial image PG having a width center of 20 degrees of the representative angle RK is stored from the captured image SG of "22 degrees". Then, the storage unit 73 sequentially stores the partial image PG in each storage unit PK, and finally, the partial image PG for the entire circumference of the label 22 is stored in the first storage unit 54.

図10は、図9に示す例において第1格納部54に格納された部分画像PGを示す。図10に示すように、第1格納部54には、正面角度「0度」かつ幅角20度の部分画像PGと、正面角度22度の撮影画像SGからその正面角度が属する代表角度20度を幅中心とする幅角20度の所定領域を切り出した部分画像PGとが格納される。第1格納部54には、部分画像PGが、隣の部分画像PGとγ度(本例では5度)の角度幅ずつ重複して格納される。 FIG. 10 shows a partial image PG stored in the first storage unit 54 in the example shown in FIG. As shown in FIG. 10, the first storage unit 54 has a partial image PG having a front angle of "0 degrees" and a width angle of 20 degrees, and a representative angle of 20 degrees to which the front angle belongs from the captured image SG having a front angle of 22 degrees. A partial image PG obtained by cutting out a predetermined area having a width angle of 20 degrees centered on is stored. The partial image PG is stored in the first storage unit 54 so as to overlap with the adjacent partial image PG by an angle width of γ degree (5 degrees in this example).

そして、図11に示すように、今回の撮影画像SGの正面の一部の画像MGから特徴を抽出してモデルMFを取得し、前回のモデルMFを図11に示す新規のモデルMFに更新する。そして、同様に、図12(a)に示すように、マッチング処理でマッチした類似図柄部AMの位置情報とモデルMFの位置情報とを基に幾何学的な関係を用いた計算により撮影画像SG中の容器20の正面位置C0(正面角度θc)を取得し、撮影画像SGから容器20の代表角度RKを中心とするラベル22の部分画像PGを取得する(図12(b))。そして、その正面角度θcの属する代表角度RKの格納部AKに代表角度RKと正面角度θcとの誤差を格納し、その代表角度RKの格納部PKに部分画像PGを格納する。以降、同様の蓄積処理を繰り返すことにより、図10に示す第1格納部54には、同図に二点鎖線で示す部分画像PGが順次格納され、最終的に全周分に相当するJ枚(本例では36枚)の部分画像PGが蓄積される。 Then, as shown in FIG. 11, features are extracted from a part of the image MG in front of the captured image SG to acquire a model MF, and the previous model MF is updated to the new model MF shown in FIG. .. Similarly, as shown in FIG. 12A, the captured image SG is calculated by using a geometrical relationship based on the position information of the similar symbol portion AM matched by the matching process and the position information of the model MF. The front position C0 (front angle θc) of the container 20 inside is acquired, and the partial image PG of the label 22 centered on the representative angle RK of the container 20 is acquired from the captured image SG (FIG. 12 (b)). Then, the error between the representative angle RK and the front angle θc is stored in the storage unit AK of the representative angle RK to which the front angle θc belongs, and the partial image PG is stored in the storage unit PK of the representative angle RK. After that, by repeating the same accumulation process, the partial image PGs shown by the alternate long and short dash lines in FIG. 10 are sequentially stored in the first storage unit 54 shown in FIG. 10, and finally J images corresponding to the entire circumference are stored. (36 images in this example) partial image PGs are accumulated.

ここで、図9に示すように、位置格納部53に格納された値から代表角度RKとの誤差が分かるので、既に格納部AKに初期値以外の値が格納されていても、代表角度RKとの誤差がより小さい正面角度θcの撮影画像SGが得られれば、その撮影画像SGから部分画像PGを取り込む方が好ましい。そのため、代表角度RKとの誤差がより小さい正面角度θcの撮影画像SGが得られれば、その撮影画像SGから切り出した部分画像PGを第1格納部54に先に格納済みの部分画像PGと置き換える更新をする。こうして蓄積部73は、代表角度RKとの誤差がより小さな部分画像PGに更新しながら、部分画像PGを順次蓄積することにより、生成される全周画像AGの精度を高める。 Here, as shown in FIG. 9, since the error from the representative angle RK can be known from the value stored in the position storage unit 53, the representative angle RK is already stored in the storage unit AK even if a value other than the initial value is stored. If a photographed image SG having a front angle θc with a smaller error from the photographed image SG can be obtained, it is preferable to capture the partial image PG from the photographed image SG. Therefore, if a photographed image SG having a front angle θc having a smaller error from the representative angle RK is obtained, the partial image PG cut out from the photographed image SG is replaced with the partial image PG previously stored in the first storage unit 54. Update. In this way, the storage unit 73 sequentially stores the partial image PG while updating to the partial image PG having a smaller error from the representative angle RK, thereby improving the accuracy of the generated all-around image AG.

図3に戻って、モデル登録部63は、全周画像生成部62が生成した全周画像AGから作業者が入力装置41を操作して選択した複数の画像領域を基に複数のモデルMを作成し、これら複数のモデルMを含むモデルデータMDを記憶部52の所定記憶領域に書き込むことで登録する。 Returning to FIG. 3, the model registration unit 63 sets a plurality of models M based on a plurality of image areas selected by the operator by operating the input device 41 from the all-around image AG generated by the all-around image generation unit 62. It is created and registered by writing the model data MD including these plurality of models M to a predetermined storage area of the storage unit 52.

また、図3に示す良品画像生成部64は、検査時の比較処理で用いる複数の良品画像RGを含む良品画像データGDを生成する。良品画像生成部64は、全周画像AGの画像データを基に、1周をm分割(一例として36分割)した角度(例えば10°)毎に所定の幅角(例えば90〜150度(例えば110度))の部分画像からなる図16に示す良品画像RG0〜RG35を生成する。良品画像RG0〜RG35は、容器20の周方向の位置情報と対応付けられている。なお、良品画像RGの枚数を決める分割数mは、m=36に限らず、適宜変更できる。例えばm=12,18,24,72,120でもよい。 Further, the non-defective product image generation unit 64 shown in FIG. 3 generates non-defective product image data GD including a plurality of non-defective product image RGs used in the comparison process at the time of inspection. The non-defective image generation unit 64 has a predetermined width angle (for example, 90 to 150 degrees (for example)) for each angle (for example, 10 °) in which one circumference is divided into m (36 divisions as an example) based on the image data of the all-around image AG. The non-defective image RG0 to RG35 shown in FIG. 16 consisting of the partial image of 110 degree)) is generated. The non-defective image RG0 to RG35 are associated with the position information in the circumferential direction of the container 20. The number of divisions m that determines the number of non-defective image RGs is not limited to m = 36 and can be changed as appropriate. For example, m = 12, 18, 24, 72, 120 may be used.

さらに、図3に示す特徴画像生成部65は、検査対象の容器20を撮影した撮影画像から検査画像を取得する際に用いる特徴画像データFDを生成する。特徴画像生成部65は、良品画像RG0〜RG35から特徴を抽出して特徴画像FG0〜FG35を生成する。特徴画像FG0〜FG35は、容器20の周方向の位置情報と対応付けられている。 Further, the feature image generation unit 65 shown in FIG. 3 generates feature image data FD used when acquiring an inspection image from a photographed image of the container 20 to be inspected. The feature image generation unit 65 extracts features from the non-defective images RG0 to RG35 and generates feature images FG0 to FG35. The feature images FG0 to FG35 are associated with the positional information in the circumferential direction of the container 20.

次に、図3に示す検査部66について説明する。検査部66は、カメラ31が検査対象の容器20を撮影して取り込んだ画像データ中の検査画像KGと、予め記憶する良品画像RGとを比較してラベル22の欠点FT(いずれも図19を参照)の有無を検査するラベル検査処理を行う。 Next, the inspection unit 66 shown in FIG. 3 will be described. The inspection unit 66 compares the inspection image KG in the image data captured by the camera 31 with the container 20 to be inspected and the non-defective image RG stored in advance, and compares the defect FT of the label 22 (both are shown in FIG. 19). Perform a label inspection process to inspect the presence or absence of (see).

画像取得処理部81は、カメラ31が検査対象の容器20を撮影した撮影画像(画像データ)を取り込む処理を行う。本例の画像取得処理部81は、4つのカメラ31から容器20を4方向から撮影した4つの撮影画像SGを取得する。画像取得処理部81は、撮影画像SGに位置補正および切出し処理等の画像処理を施す。 The image acquisition processing unit 81 performs a process in which the camera 31 captures a photographed image (image data) of the container 20 to be inspected. The image acquisition processing unit 81 of this example acquires four captured images SG obtained by photographing the container 20 from four directions from the four cameras 31. The image acquisition processing unit 81 performs image processing such as position correction and cutting processing on the captured image SG.

位置特定部82は、撮影画像SG中の容器20の周方向の位置である正面位置を特定する。ここで、正面位置は、ラベル22の周方向の所定位置を0度とし、撮影時にカメラ31と対向する検査対象の容器20の正面の位置を角度で表わした値である(図5参照)。位置特定部82は、図15に示すモデルMを用いて、撮影画像SG中の容器20の正面位置を特定する位置特定処理を行う。本例の位置特定部82は、複数のモデルMを用いて、撮影画像中のラベル22の図柄23の中から、モデルMと類似する類似図柄部を探索するオムニ・マッチング処理を行い、その探索した類似図柄部の位置情報とモデルMの登録位置情報とを基に撮影画像SGの正面位置を特定する。 The position specifying unit 82 identifies the front position, which is the position in the circumferential direction of the container 20 in the captured image SG. Here, the front position is a value representing the position of the front of the container 20 to be inspected facing the camera 31 at the time of shooting by an angle, with the predetermined position in the circumferential direction of the label 22 being 0 degree (see FIG. 5). The position specifying unit 82 uses the model M shown in FIG. 15 to perform a position specifying process for specifying the front position of the container 20 in the captured image SG. The position specifying unit 82 of this example uses a plurality of models M to perform an omni-matching process of searching for a similar symbol portion similar to the model M from the symbols 23 of the label 22 in the captured image, and the search is performed. The front position of the captured image SG is specified based on the position information of the similar symbol portion and the registered position information of the model M.

図3に示すラベル高さ検査部83は、容器20に対してラベル22の付された高さ方向Zの位置のずれ(高さずれ)を検査する。本例のラベル高さ検査部83は、位置特定部82がオムニ・マッチング処理で特定したモデルMに類似する類似図柄部の高さ方向Zの位置と、そのモデルMの高さ方向Zにおける登録位置との差(高さずれ量)から、ラベル22の高さ方向Zの位置ずれ(高さずれ)の有無を検査する。なお、カメラ31の撮影エリアは、容器20が載置されるコンベヤ13の上面から既知の所定高さに設定されている。 The label height inspection unit 83 shown in FIG. 3 inspects the container 20 for a deviation (height deviation) in the position of the label 22 in the height direction Z. In the label height inspection unit 83 of this example, the position in the height direction Z of the similar symbol portion similar to the model M specified by the position specifying unit 82 in the omni matching process and the registration in the height direction Z of the model M are registered. From the difference from the position (height deviation amount), the presence or absence of the position deviation (height deviation) in the height direction Z of the label 22 is inspected. The photographing area of the camera 31 is set to a known predetermined height from the upper surface of the conveyor 13 on which the container 20 is placed.

検出部84は、位置特定部82が特定した正面位置に対応する特徴画像FGを用いて撮影画像SGに対してマッチング処理を行い、マッチした領域を検査画像KGとして取得する。本例では、撮影画像SG中のラベル22を含む一部の領域内の画像が検査画像KG(図19を参照)として取得される。検出部84は、検査画像KGと良品画像RGとの比較結果を基にラベル22の欠点FTを検出する。比較処理部85は、検査画像KGと良品画像RGとを比較する比較処理を行い、その比較結果として検査画像KGと良品画像RGとの差分をとって差分画像DG(図19参照)を取得する。そして、判定部86は、差分画像DGに基づいてラベル22の欠点FTの有無を判定する。ここで、欠点FTには、ラベル22の破れ、異物の付着、汚れ(図示略)などが挙げられる。 The detection unit 84 performs matching processing on the captured image SG using the feature image FG corresponding to the front position specified by the position specifying unit 82, and acquires the matched area as the inspection image KG. In this example, the image in a part of the region including the label 22 in the captured image SG is acquired as the inspection image KG (see FIG. 19). The detection unit 84 detects the defect FT of the label 22 based on the comparison result between the inspection image KG and the non-defective image RG. The comparison processing unit 85 performs comparison processing for comparing the inspection image KG and the non-defective product image RG, and as the comparison result, obtains the difference image DG (see FIG. 19) by taking the difference between the inspection image KG and the non-defective product image RG. .. Then, the determination unit 86 determines the presence / absence of the defect FT of the label 22 based on the difference image DG. Here, the defect FT includes tearing of the label 22, adhesion of foreign matter, dirt (not shown), and the like.

次に、ラベル検査装置11の作用を説明する。コンピュータ50がプログラムPRを実行することで行われる全周画像生成処理を、図4に示すフローチャートを参照して説明する。 Next, the operation of the label inspection device 11 will be described. The all-around image generation process performed by the computer 50 executing the program PR will be described with reference to the flowchart shown in FIG.

CPU51は、図4にフローチャートで示された全周画像生成処理を実行する。この処理を実行する前に、CPU51は、記憶部52中の各格納部53〜56を初期化する。図9に示す位置格納部53が初期化されると、各格納部AKの値は初期値「99」になる。 The CPU 51 executes the all-around image generation process shown in the flowchart in FIG. Before executing this process, the CPU 51 initializes each of the storage units 53 to 56 in the storage unit 52. When the position storage unit 53 shown in FIG. 9 is initialized, the value of each storage unit AK becomes the initial value “99”.

まずステップS11では、CPU51は、容器20の撮影画像を取得する。すなわち、カメラ31が容器20を撮影して得た画像データを取得する。本例では、4つのカメラ31が4方向から撮影した全周分(4つ)の撮影画像SGの画像データを取得する。本実施形態では、ステップS11の処理が、画像取得ステップの一例に相当する。 First, in step S11, the CPU 51 acquires a photographed image of the container 20. That is, the camera 31 captures the container 20 and acquires the image data obtained. In this example, the image data of the captured image SG for the entire circumference (4) captured by the four cameras 31 from the four directions is acquired. In the present embodiment, the process of step S11 corresponds to an example of the image acquisition step.

ステップS12では、CPU51は、撮影画像中の容器20の正面位置を基準位置(例えば0度)に設定する。また、図6に示すように、撮影画像SG中の容器20の正面位置における部分画像PGを取得する。CPU51は、代表角度RKが0度の格納部AKにその代表角度RKと正面角度θcとの誤差を格納し、0度の格納部PKに部分画像PGを格納し、さらに0度の格納部QKに撮影画像SGを格納する。 In step S12, the CPU 51 sets the front position of the container 20 in the captured image to the reference position (for example, 0 degree). Further, as shown in FIG. 6, a partial image PG at the front position of the container 20 in the photographed image SG is acquired. The CPU 51 stores the error between the representative angle RK and the front angle θc in the storage unit AK having a representative angle RK of 0 degrees, stores the partial image PG in the storage unit PK of 0 degrees, and further stores the partial image PG in the storage unit QK of 0 degrees. The captured image SG is stored in.

ステップS13では、CPU51は、モデルを作成する。画像中の容器20の正面の一部の領域の画像を切り出し、その一部の画像について特徴抽出を行ってモデルMFを作成する。本例では、図6に示すように、モデルMFには、撮影画像SG中の容器20の正面における所定角度(例えば45度)範囲でかつ高さ方向Zにラベル22の少なくとも一部を含む範囲の画像MGが用いられる。モデルMFは、その登録位置が基準角度(0度)に設定される。なお、モデルMFの位置、形状およびサイズは適宜変更できる。 In step S13, the CPU 51 creates a model. An image of a part of the front surface of the container 20 in the image is cut out, and feature extraction is performed on the part of the image to create a model MF. In this example, as shown in FIG. 6, the model MF has a predetermined angle (for example, 45 degrees) range in front of the container 20 in the captured image SG and a range including at least a part of the label 22 in the height direction Z. Image MG is used. The registration position of the model MF is set to the reference angle (0 degree). The position, shape and size of the model MF can be changed as appropriate.

ステップS14では、CPU51は、次の撮影画像を読み込み、位置補正後、マッチング処理を行う。すなわち、マッチング処理部75は、次の撮影画像に対してモデルMFを用いて類似図柄部を探索するマッチング処理を行う。マッチング処理において、モデルMFと比較される比較対象の図柄領域を処理対象領域内で少しずつ移動させつつマッチング処理を行って、モデルMFとの類似度のスコアが閾値以上となる類似図柄部を探索する。 In step S14, the CPU 51 reads the next captured image, corrects the position, and then performs the matching process. That is, the matching processing unit 75 performs matching processing for searching for a similar symbol portion using the model MF for the next captured image. In the matching process, the matching process is performed while moving the symbol area to be compared with the model MF little by little within the process target area, and a similar symbol portion whose similarity score with the model MF is equal to or higher than the threshold value is searched for. do.

ステップS15では、CPU51は、マッチング処理でマッチできたか否かを判断する。マッチしなければステップS14に戻り、次の撮影画像を読み込んでモデルMFを用いて類似図柄部を探索するマッチング処理を行う。一方、マッチすればステップS16に進む。 In step S15, the CPU 51 determines whether or not the match has been achieved in the matching process. If there is no match, the process returns to step S14, the next captured image is read, and a matching process is performed to search for a similar symbol portion using the model MF. On the other hand, if there is a match, the process proceeds to step S16.

ステップS16では、CPU51は、マッチしたモデルの位置情報を用いて撮影画像中の容器20の正面位置を計算する。この正面位置の計算は、次のように行う。1つの類似図柄部が決定すると、そのとき用いたモデルMFの図8に示すモデル登録位置Cm(モデルMの正面角度の座標)を取得する。さらに、CPU51は、モデル登録位置Cmと、容器幅視野角度αなどの既知の値とを用いて、撮影画像中の容器20の正面位置C0(正面角度θc)を計算する。この容器20の正面角度θcは、図8に示す幾何学的な関係から、以下の(1)式により与えられる。
θc=θmc+
(arcsin((C0−C1)/r)−arcsin((C0−Cm)/r))・180/π…(1)
ここで、θmcは、該当するモデルMFの登録位置に対応する正面角度である。C0は、撮影画像における容器20の中心位置(正面位置)である。Cmは、該当するモデルMFの登録位置(モデル登録位置)である。C1は、該当するモデルMFに類似する類似図柄部が検出された検出位置である。rは、容器20の半径である。半径rは、容器幅視野角度αと容器視野角幅W(図8参照)を用いて、次の(2)式により与えられる。
r=W/2÷sin(α/2)・180/π…(2)
こうして蓄積部73のマッチング処理部75は、上記(1)式および(2)式を用いて、撮影画像中の容器20の正面角度θcを算出する。
In step S16, the CPU 51 calculates the front position of the container 20 in the captured image using the position information of the matched model. The calculation of this front position is performed as follows. When one similar symbol portion is determined, the model registration position Cm (coordinates of the front angle of the model M) shown in FIG. 8 of the model MF used at that time is acquired. Further, the CPU 51 calculates the front position C0 (front angle θc) of the container 20 in the captured image by using the model registration position Cm and a known value such as the container width viewing angle α. The front angle θc of the container 20 is given by the following equation (1) from the geometrical relationship shown in FIG.
θc = θmc +
(Arcsin ((C0-C1) / r) -arcsin ((C0-Cm) / r)) ・ 180 / π ... (1)
Here, θmc is a front angle corresponding to the registration position of the corresponding model MF. C0 is the center position (front position) of the container 20 in the photographed image. Cm is a registration position (model registration position) of the corresponding model MF. C1 is a detection position where a similar symbol portion similar to the corresponding model MF is detected. r is the radius of the container 20. The radius r is given by the following equation (2) using the container width viewing angle α and the container viewing angle width W (see FIG. 8).
r = W / 2 ÷ sin (α / 2) ・ 180 / π ... (2)
In this way, the matching processing unit 75 of the storage unit 73 calculates the front angle θc of the container 20 in the captured image using the above equations (1) and (2).

ステップS17では、CPU51は、正面角度θcが属する代表角度は登録済みであるか否かを判断する。すなわち、CPU51は、今回の正面角度θcが属する代表角度RKの領域である格納部PKに先の部分画像PGが登録済みであるか否かを判断する。本例では、CPU51は、対応する代表角度RKの格納部AKの値を基にその値が「99」以外であるか否かを判断することにより、対応する格納部PKに先の部分画像PGが登録済みであるか否かを判断する。その代表角度が登録済みであればステップS18に進み、登録済みでなければ(つまり未登録であれば)ステップS19に進む。 In step S17, the CPU 51 determines whether or not the representative angle to which the front angle θc belongs has been registered. That is, the CPU 51 determines whether or not the previous partial image PG is registered in the storage unit PK, which is the region of the representative angle RK to which the front angle θc belongs. In this example, the CPU 51 determines whether or not the value is other than "99" based on the value of the storage unit AK of the corresponding representative angle RK, whereby the partial image PG ahead of the corresponding storage unit PK is determined. Determines if is registered. If the representative angle is registered, the process proceeds to step S18, and if it is not registered (that is, if it is not registered), the process proceeds to step S19.

ステップS18では、CPU51は、更新すべき正面位置であるか否かを判断する。すなわち、本実施形態では、容器20の周方向の位置を角度で管理するため、CPU51は、その代表角度RKに対応する格納部AKに格納済み(登録済み)の先の正面角度θcよりも今回の正面角度θcの方が代表角度RKに近いか否かを判断する。本例では、格納部AKには、代表角度RKとの誤差が正面位置情報として格納されるので、先の誤差の絶対値よりも今回の誤差の絶対値の方が小さいか否かを判断する。CPU51は、今回の正面角度θcの方が代表角度RKに近ければ更新すべき正面位置であると判断し、今回の正面角度θcよりも登録済みの先の正面角度θcの方が代表角度RKに近ければ更新すべき正面位置ではないと判断する。更新すべき正面位置であればステップS19に進み、更新すべき正面位置でなければステップS21に進む。 In step S18, the CPU 51 determines whether or not the front position should be updated. That is, in the present embodiment, in order to manage the position of the container 20 in the circumferential direction by an angle, the CPU 51 this time is larger than the front angle θc stored (registered) in the storage unit AK corresponding to the representative angle RK. It is determined whether or not the front angle θc of is closer to the representative angle RK. In this example, since the error from the representative angle RK is stored as the front position information in the storage unit AK, it is determined whether or not the absolute value of the current error is smaller than the absolute value of the previous error. .. The CPU 51 determines that if the front angle θc this time is closer to the representative angle RK, it is the front position to be updated, and the registered front angle θc becomes the representative angle RK than the front angle θc this time. If it is close, it is judged that it is not the front position to be updated. If it is the front position to be updated, the process proceeds to step S19, and if it is not the front position to be updated, the process proceeds to step S21.

ステップS19では、CPU51は、部分画像と正面位置情報を登録する。すなわち、蓄積部73は、今回の撮影画像SGから切り取った今回の部分画像PGを第1格納部54における該当する代表角度RKの格納部AKに格納するとともに、位置格納部53における該当する代表角度RKの格納部AKに正面位置情報を格納する。この格納をもって今回の部分画像PGと正面位置情報とが登録される。この場合、対応する代表角度RKの格納部AKに既に正面位置情報が登録済みである場合は、その登録情報が今回の部分画像PGと正面位置情報に更新される。ここで、正面位置情報は、正面角度θcと代表角度RKとの誤差の値として格納部AKに格納される。また、第2格納部55における該当する代表角度RKの格納部QKには、今回の撮影画像SGが格納される。 In step S19, the CPU 51 registers the partial image and the front position information. That is, the storage unit 73 stores the current partial image PG cut out from the current captured image SG in the storage unit AK of the corresponding representative angle RK in the first storage unit 54, and also stores the corresponding representative angle in the position storage unit 53. The front position information is stored in the storage unit AK of the RK. With this storage, the partial image PG of this time and the front position information are registered. In this case, if the front position information has already been registered in the storage unit AK of the corresponding representative angle RK, the registered information is updated to the partial image PG and the front position information this time. Here, the front position information is stored in the storage unit AK as a value of an error between the front angle θc and the representative angle RK. Further, the captured image SG this time is stored in the storage unit QK of the corresponding representative angle RK in the second storage unit 55.

ステップS20では、CPU51は、モデルを更新する。すなわち、モデル取得部72は、今回の撮影画像SG中の容器20の正面位置における一部の所定領域の画像について特徴を抽出して新規のモデルMFを作成し、前回のモデルMFを新規のモデルMFに置き換える。なお、本実施形態では、ステップS13,S20の処理が、モデル取得ステップの一例に相当する。 In step S20, the CPU 51 updates the model. That is, the model acquisition unit 72 extracts the features of the image of a part of the predetermined region at the front position of the container 20 in the captured image SG to create a new model MF, and uses the previous model MF as a new model. Replace with MF. In this embodiment, the processes of steps S13 and S20 correspond to an example of the model acquisition step.

ステップS21では、CPU51は、全周画像を完成したか否かを判定する。全周画像AGを完成していなければステップS14に戻り、ステップS21で全周画像AGを完成したと判断するまで、全周画像AGの生成処理(S14〜S21)を繰り返す。一方、全周画像AGを完成すればステップS22に進む。なお、本実施形態では、ステップS14〜S19の処理が、蓄積ステップの一例に相当する。 In step S21, the CPU 51 determines whether or not the all-around image is completed. If the all-around image AG is not completed, the process returns to step S14, and the all-around image AG generation process (S14 to S21) is repeated until it is determined in step S21 that the all-around image AG is completed. On the other hand, if the all-around image AG is completed, the process proceeds to step S22. In this embodiment, the processes of steps S14 to S19 correspond to an example of the accumulation step.

ここで、全周画像AGの生成処理(S14〜S21)を繰り返す全周画像生成処理の間、表示部42には図13に示す全周画像生成進捗画面SC1が表示される。この画面SC1には、処理対象中の撮影画像SGを背景とするその前面に円環状の進捗スケールPSが重畳して表示される。進捗スケールPSは、1周360度をJ分割(本例では36分割)した各代表角度RKに対応する領域ごとに、部分画像PGがまだ格納されていない未学習であるか、部分画像PGが格納済みの学習済みであるかを色の違いで判別可能に表示される。また、学習済みの代表角度RKの領域は、格納された部分画像PGの正面角度θcと代表角度RKとの誤差の値に応じて段階的に色分けされて表示される。このため、作業者は、進捗スケールPSを見ることで、全周画像AGの生成進捗状況および出来上がり精度を確認することができる。そして、進捗スケールPSで未学習の領域が無くなると、全周画像AGが完成し、CPU51はステップS22の処理に進む。 Here, during the all-around image generation process in which the all-around image AG generation processes (S14 to S21) are repeated, the all-around image generation progress screen SC1 shown in FIG. 13 is displayed on the display unit 42. On this screen SC1, an annular progress scale PS is superimposed and displayed on the front surface of the captured image SG being processed as a background. In the progress scale PS, the partial image PG is not yet stored or the partial image PG is unlearned for each region corresponding to each representative angle RK obtained by J-dividing 360 degrees per lap (36 divisions in this example). It is displayed so that it can be discriminated by the difference in color whether it has been stored and learned. Further, the learned representative angle RK region is displayed in a stepwise color-coded manner according to the value of the error between the front angle θc of the stored partial image PG and the representative angle RK. Therefore, the operator can confirm the generation progress status and the finished accuracy of the all-around image AG by looking at the progress scale PS. Then, when the unlearned area disappears in the progress scale PS, the all-around image AG is completed, and the CPU 51 proceeds to the process of step S22.

ステップS22では、CPU51は、強化学習するか否かを判定する。強化学習する場合はステップS23に進み、強化学習をしない場合はステップS24に進む。ここで、強化学習は、全周画像の生成処理(S14〜S23)を終了する所定条件である強化学習終了条件が成立するまで更に複数回繰り返し、全周画像AGの出来上がり精度を高める処理である。 In step S22, the CPU 51 determines whether or not reinforcement learning is performed. If reinforcement learning is performed, the process proceeds to step S23, and if reinforcement learning is not performed, the process proceeds to step S24. Here, the reinforcement learning is a process of improving the completion accuracy of the all-around image AG by repeating it a plurality of times until the reinforcement learning end condition, which is a predetermined condition for ending the all-around image generation process (S14 to S23), is satisfied. ..

ステップS23では、CPU51は、強化学習終了条件が成立したか否かを判定する。強化学習終了条件が不成立であればステップS14に戻り、ステップS23で強化学習終了条件が成立したと判断するまで、強化学習(S14〜S23)を繰り返す。一方、強化学習終了条件が成立すればステップS24に進む。なお、CPU51は、強化学習終了の判定に用いる所定の判定パラメータが閾値に達したことをもって強化学習終了条件が成立したと判断する。判定パラメータには、例えば強化学習で読み込んだ撮影画像数、部分画像の更新数、平均誤差、誤差閾値未満の領域の占有率、またはエポック数などが用いられる。 In step S23, the CPU 51 determines whether or not the reinforcement learning end condition is satisfied. If the reinforcement learning end condition is not satisfied, the process returns to step S14, and the reinforcement learning (S14 to S23) is repeated until it is determined in step S23 that the reinforcement learning end condition is satisfied. On the other hand, if the reinforcement learning end condition is satisfied, the process proceeds to step S24. The CPU 51 determines that the reinforcement learning end condition is satisfied when the predetermined determination parameter used for the determination of the end of reinforcement learning reaches the threshold value. As the determination parameter, for example, the number of captured images read by reinforcement learning, the number of partial image updates, the average error, the occupancy rate of the area below the error threshold, the number of epochs, and the like are used.

ステップS24では、CPU51は、全周画像の角度を補正する。作業者は、全周画像生成処理の開始に先立ちまたは全周画像完成後に、全周画像AGの0度の位置を入力装置41の操作でコンピュータ50に指定している。CPU51は、指定された0度の位置を確認し、図14に示す仮の0度の位置を基準に角度と対応付けられた全周画像AGの角度の設定を、指定された位置が0度になるように角度補正する。さらにCPU51は、図14に示すように、全周画像AGを0〜360度の範囲から、0〜360度を超える所定値までの範囲に延長して作成する。本例では、全周画像AGを、例えば0〜540度(1周半)の範囲に延長する。ここで、全周画像AGを、360度を超える範囲に亘り作成するのは、その後、作業者がモデル登録部63を起動させて行うモデル登録時に表示部42にモデル登録画面(図示略)を表示させ、このモデル登録画面で全周画像AGを表示させてモデルM(図15)を登録する領域を入力装置41の操作で指定する作業を円滑に行うためである。全周画像AGを、360度を超える範囲に亘り作成しておけば、図14に示す全周画像AGにおいて例えば文字「G」と「H」との間の0度または360度を跨ぐ領域を指定可能となる。なお、特に必要がなければ、全周画像AGは0〜360度でもよい。 In step S24, the CPU 51 corrects the angle of the all-around image. The operator designates the 0 degree position of the all-around image AG to the computer 50 by the operation of the input device 41 prior to the start of the all-around image generation process or after the all-around image is completed. The CPU 51 confirms the designated 0-degree position, sets the angle of the all-around image AG associated with the angle based on the temporary 0-degree position shown in FIG. 14, and the specified position is 0 degree. Correct the angle so that it becomes. Further, as shown in FIG. 14, the CPU 51 is created by extending the all-around image AG from the range of 0 to 360 degrees to a predetermined value exceeding 0 to 360 degrees. In this example, the all-around image AG is extended to a range of, for example, 0 to 540 degrees (one and a half laps). Here, the reason why the all-around image AG is created over a range exceeding 360 degrees is that the model registration screen (not shown) is displayed on the display unit 42 at the time of model registration when the operator activates the model registration unit 63. This is to smoothly perform the work of displaying the all-around image AG on the model registration screen and designating the area for registering the model M (FIG. 15) by the operation of the input device 41. If the all-around image AG is created over a range exceeding 360 degrees, in the all-around image AG shown in FIG. 14, for example, a region straddling 0 degrees or 360 degrees between the letters "G" and "H" is formed. It can be specified. If there is no particular need, the all-around image AG may be 0 to 360 degrees.

撮影画像SGの不足などを理由に全周画像AGを完成できず、部分画像PGが蓄積されていない空の代表角度RKの領域が少なくとも1つ存在する場合は、既存の撮影画像SGから空の代表角度RKの部分画像を補うことで全周画像AGを完成させてもよい。すなわち、所定条件を満たすまでモデル取得処理と蓄積処理とを繰り返しても、全周画像AGを完成できなかった場合、蓄積部73は、部分画像PGが蓄積されていない未登録の代表角度RKiを取得する。未登録の代表角度RKiの領域の隣の位置に登録済みの代表角度RKi+1またはRKi-1の領域が存在すれば、この隣の領域に蓄積されている部分画像PGの取得元である撮影画像SGをその代表角度RKi+1またはRKi-1の格納部QKから取得する。この撮影画像SGから未登録の領域の代表角度RKiに対応する位置の部分画像PGを取得し、この取得した部分画像PGを位置情報と対応付けて未登録の代表角度RKiの空の領域に蓄積する。この場合、補填された部分画像PGは、その正面角度と代表角度との誤差が規定の±5度を超える誤差(例えば12度)になる。このように完成させた全周画像AGは、その精度が補填箇所で部分的に低下するものの、全周画像AGを用いて行われる、モデル登録処理、良品画像生成処理、容器向き検出処理および検査処理を実施できる。 If the full-circle image AG cannot be completed due to a shortage of the captured image SG and there is at least one region of the representative angle RK in the sky where the partial image PG is not accumulated, the existing captured image SG is empty. The all-around image AG may be completed by supplementing the partial image of the representative angle RK. That is, if the full-circle image AG cannot be completed even after repeating the model acquisition process and the accumulation process until a predetermined condition is satisfied, the accumulation unit 73 sets an unregistered representative angle RKi in which the partial image PG is not accumulated. get. If there is a registered representative angle RKi + 1 or RKi-1 area at a position next to the unregistered representative angle RKi area, the image taken from which the partial image PG accumulated in this adjacent area is acquired. The image SG is acquired from the storage unit QK of the representative angle RKi + 1 or RKi-1. A partial image PG at a position corresponding to the representative angle RKi of the unregistered region is acquired from this captured image SG, and the acquired partial image PG is associated with the position information and stored in an empty region of the unregistered representative angle RKi. do. In this case, the supplemented partial image PG has an error (for example, 12 degrees) in which the error between the front angle and the representative angle exceeds the specified ± 5 degrees. Although the accuracy of the all-around image AG completed in this way is partially reduced at the compensation point, the model registration process, the non-defective image generation process, the container orientation detection process, and the inspection performed using the all-around image AG are performed. Processing can be carried out.

次に、図17を参照してモデル登録処理について説明する。作業者はモデル登録を行う場合、入力装置41を操作してラベル検査装置11にモデル登録処理の開始を指示する。コンピュータ50のCPU51は、指示を受け付けると、図17にフローチャートで示されるモデル登録処理を実行する。 Next, the model registration process will be described with reference to FIG. When registering a model, the operator operates the input device 41 to instruct the label inspection device 11 to start the model registration process. Upon receiving the instruction, the CPU 51 of the computer 50 executes the model registration process shown in the flowchart in FIG.

まずステップS31では、CPU51は、全周画像を表示部42に表示する。つまり、CPU51は、全周画像AGを含むモデル登録画面(図示略)を表示部42に表示する。作業者は、モデル登録画面上の全周画像AGにおいてモデルMとして使用したい特徴のある画像領域であるモデル領域GA(図15を参照)を入力装置41の操作で指定する。 First, in step S31, the CPU 51 displays an all-around image on the display unit 42. That is, the CPU 51 displays the model registration screen (not shown) including the all-around image AG on the display unit 42. The operator designates a model area GA (see FIG. 15), which is a characteristic image area to be used as the model M in the all-around image AG on the model registration screen, by operating the input device 41.

次のステップS32では、CPU51は、モデル領域GAが指定されたか否かを判断する。モデル領域GAが指定されていなければ指定されるまで待機し、モデル領域GAが指定されればステップS33に進む。 In the next step S32, the CPU 51 determines whether or not the model area GA has been designated. If the model area GA is not specified, the process waits until it is specified, and if the model area GA is specified, the process proceeds to step S33.

ステップS33では、CPU51は、モデルを位置情報と対応付けて登録する。全周画像AGは位置情報(容器周方向の横座標と高さ方向の縦座標)と対応付けられたデータであるので、指定されたモデル領域GAの位置情報は全周画像AGの座標から計算上特定される。 In step S33, the CPU 51 registers the model in association with the position information. Since the all-around image AG is data associated with the position information (horizontal coordinates in the container circumferential direction and vertical coordinates in the height direction), the position information of the specified model area GA is calculated from the coordinates of the all-around image AG. Specified above.

次のステップS34では、CPU51は、全てのモデルを登録したか否かを判定する。全てのモデルの登録を終了していなければステップS32に戻り、以降、ステップS32〜S34の処理を、ステップS34で全てのモデルの登録を終了したと判定するまで繰り返す。こうして作業者は、モデル領域GAを順番に指定し、全て(例えば8つ)のモデルMを登録し終わることで、記憶部52にはモデルデータMDが記憶される。 In the next step S34, the CPU 51 determines whether or not all the models have been registered. If the registration of all models has not been completed, the process returns to step S32, and thereafter, the processes of steps S32 to S34 are repeated until it is determined in step S34 that the registration of all models has been completed. In this way, the operator designates the model areas GA in order and completes the registration of all (for example, eight) models M, so that the model data MD is stored in the storage unit 52.

また、良品画像生成部64は、全周画像AGの画像データを基に、1周をm分割(一例として36分割)した角度(例えば10°)毎に所定の幅角(例えば110度)の部分画像からなる図16に示す良品画像RG0〜RG35を取得する。そして、良品画像生成部64は、良品画像RG0〜RG35を容器20の周方向の位置(正面位置)と対応付けて記憶部52に記憶する。また、特徴画像生成部65は、良品画像RG0〜RG35から特徴を抽出して特徴画像FG0〜FG35を生成する。そして、特徴画像生成部65は、特徴画像FG0〜FG35を容器20の周方向の位置(正面位置)と対応付けて記憶部52に記憶する。このようにモデルデータMD、良品画像データGDおよび特徴画像データFDの作成および登録は、コンピュータ50が全周画像AGから自動で行うので、作業者は入力装置41により条件や領域の指定などの比較的簡単な操作を行うだけで済む。 Further, the non-defective image generation unit 64 has a predetermined width angle (for example, 110 degrees) for each angle (for example, 10 °) obtained by dividing one circumference into m (36 divisions as an example) based on the image data of the all-around image AG. The good product images RG0 to RG35 shown in FIG. 16 consisting of partial images are acquired. Then, the non-defective product image generation unit 64 stores the non-defective product images RG0 to RG35 in the storage unit 52 in association with the position (front position) in the circumferential direction of the container 20. Further, the feature image generation unit 65 extracts features from the non-defective images RG0 to RG35 and generates feature images FG0 to FG35. Then, the feature image generation unit 65 stores the feature images FG0 to FG35 in the storage unit 52 in association with the position (front position) in the circumferential direction of the container 20. In this way, the computer 50 automatically creates and registers the model data MD, the non-defective image data GD, and the feature image data FD from the all-around image AG, so that the operator can compare conditions and area designations by the input device 41. All you have to do is perform a simple operation.

次に、図18を参照してラベル検査処理について説明する。コンピュータ50は、ラベル検査処理を行う。コンピュータ50のCPU51は、記憶部52に必要なデータGD,FDが記憶された状態で、図18にフローチャートで示されたラベル検査処理を実行する。なお、記憶部52には、良品の容器20の全周画像から、ユーザが入力装置41を操作して0度から360/N度(例えば45度)の角度範囲ごとの部分画像の中の一部の領域がモデルM1〜M8として登録されている。モデルM1〜M8は、特徴(形状または明るさ)が抽出された特徴画像(例えば形状画像)であり、容器20(又はラベル22)の周方向の位置(角度)に対応付けられている。 Next, the label inspection process will be described with reference to FIG. The computer 50 performs a label inspection process. The CPU 51 of the computer 50 executes the label inspection process shown in the flowchart in FIG. 18 in a state where the data GD and FD required for the storage unit 52 are stored. It should be noted that the storage unit 52 is one of the partial images for each angle range of 0 to 360 / N degrees (for example, 45 degrees) from the entire circumference image of the non-defective container 20 by the user operating the input device 41. Areas of the unit are registered as models M1 to M8. The models M1 to M8 are feature images (for example, shape images) from which features (shape or brightness) are extracted, and are associated with positions (angles) in the circumferential direction of the container 20 (or label 22).

また、記憶部52には、良品の容器20の周方向に異なる位置(角度)毎の部分画像、又はラベル22の原画(図5参照)を周方向に異なる位置(角度)毎に分割した部分画像である、複数の良品画像RGと、各良品画像RGの特徴が抽出された特徴画像FGとが、周方向の位置(角度)と対応付けられて記憶されている。本実施形態では、複数ずつの良品画像RGおよび特徴画像FGは、良品画像生成部64が、良品の容器20が撮影された複数の画像を基に自動で生成したもの、あるいはラベル22の原画(版下)を分割して生成したものであり、容器20の周方向の位置(角度)と対応付けられている。 Further, in the storage unit 52, a partial image at different positions (angles) in the circumferential direction of the non-defective container 20 or a portion obtained by dividing the original image of the label 22 (see FIG. 5) into different positions (angles) in the circumferential direction. A plurality of non-defective image RGs, which are images, and a feature image FG from which the features of each non-defective image RG are extracted are stored in association with a position (angle) in the circumferential direction. In the present embodiment, the plurality of non-defective image RGs and the feature image FG are automatically generated by the non-defective image generation unit 64 based on the plurality of images taken by the non-defective container 20, or the original image of the label 22 (the original image of the label 22). It is generated by dividing the block copy), and is associated with the position (angle) in the circumferential direction of the container 20.

まずステップS41では、CPU51は、容器20の画像データを取得する。すなわち、カメラ31が容器20を撮影して得た画像データを取得する。このとき、4つのカメラ31が4方向から撮影した全周分(4つ)の撮影画像SGの画像データを取得する。以下では、撮影画像SGには、容器20に付された検査対象のラベル22に破れまたは異物等の付着などの欠点があるものとする。 First, in step S41, the CPU 51 acquires the image data of the container 20. That is, the camera 31 captures the container 20 and acquires the image data obtained. At this time, the image data of the captured image SG for the entire circumference (4) captured by the four cameras 31 from the four directions is acquired. In the following, it is assumed that the captured image SG has a defect such as tearing or adhesion of foreign matter to the label 22 to be inspected attached to the container 20.

ステップS42では、CPU51は、撮影画像中の容器の正面位置を特定する。位置特定部82が、オムニ・マッチング処理を実行し、ラベル22の正面角度θc・高さを特定する。位置特定部82は、カメラ31が検査対象の容器20を撮影して得た撮影画像SGのうちラベル22の領域を対象としてモデルMと類似する類似図柄部を探索するオムニ・マッチング処理を行う。位置特定部82は、このオムニ・マッチング処理において、モデルMと比較すべき図柄領域を少しずつ移動させつつマッチング処理を行って、モデルMとの類似度のスコアが閾値以上となる類似図柄部を探索する。また、スコアが閾値以上の類似図柄部が検出されない場合は、次のモデルMに変更する。こうしてモデルMを順次変更しつつ、全てのモデルM1〜M8について類似図柄部を探索するマッチング処理を行う。本例では、位置特定処理において、4つの撮影画像のうち1つの撮影画像SGについてオムニ・マッチング処理を行ってもよいし、4つの撮影画像SGの全てについてオムニ・マッチング処理を行ってもよい。類似図柄部が複数検出された場合は、そのうち一番スコアの高い1つの類似図柄部に決定する。なお、オムニ・マッチング処理では、例えば類似度のスコアが目標値を超える類似図柄部が探索された時点でマッチング処理を中止してもよい。 In step S42, the CPU 51 identifies the front position of the container in the captured image. The position specifying unit 82 executes the omni matching process and specifies the front angle θc and the height of the label 22. The position specifying unit 82 performs an omni-matching process for searching for a similar symbol portion similar to the model M in the region of the label 22 in the captured image SG obtained by photographing the container 20 to be inspected by the camera 31. In this omni matching process, the position specifying unit 82 performs the matching process while moving the symbol area to be compared with the model M little by little, and performs the matching process to obtain a similar symbol portion whose similarity score with the model M is equal to or higher than the threshold value. Explore. If a similar symbol portion having a score equal to or higher than the threshold value is not detected, the model is changed to the next model M. In this way, while sequentially changing the model M, a matching process for searching for a similar symbol portion is performed for all the models M1 to M8. In this example, in the position specifying process, omni-matching processing may be performed on one of the four captured images SG, or omni-matching processing may be performed on all four captured image SGs. When a plurality of similar symbol parts are detected, one of the similar symbol parts having the highest score is determined. In the omni matching process, for example, the matching process may be stopped when a similar symbol portion whose similarity score exceeds the target value is searched for.

ステップS43では、CPU51は、検査画像と良品画像との比較処理を行う。詳しくは、比較処理部85は、図19に示すように、検査画像KGと良品画像RGとの差分をとる演算を行い、比較結果として、同図に示す差分画像DGを取得する。差分画像DGは、ラベル22のうち正常な部分が白地となり、ラベル22における欠点FTの部分が黒色又は灰色となる画像である。この差分画像DGにおいて濃度(例えば輝度)が濃度閾値以下の領域(黒色又は灰色の領域)が欠点FTとして検出する。例えばラベル22の破れや異物が欠点FTとして検出される。なお、図19の例とは、両画像KG,RGの差分を逆にとってもよい。この場合、正常な部分が黒地、欠点FTが白色又は灰色となる。 In step S43, the CPU 51 performs a comparison process between the inspection image and the non-defective product image. Specifically, as shown in FIG. 19, the comparison processing unit 85 performs an operation for taking the difference between the inspection image KG and the non-defective image RG, and acquires the difference image DG shown in the figure as the comparison result. The difference image DG is an image in which the normal portion of the label 22 is a white background and the defect FT portion of the label 22 is black or gray. In this difference image DG, a region (black or gray region) whose density (for example, brightness) is equal to or lower than the density threshold value is detected as a defect FT. For example, tearing of the label 22 or foreign matter is detected as a defect FT. Note that the difference between the two images KG and RG may be reversed from the example of FIG. In this case, the normal part is a black background, and the defect FT is white or gray.

ステップS44では、CPU51は、検査結果を出力する。詳しくは、判定部86は、差分画像DGを基に欠点FTの有無を判定する。そして、制御部61は、検査結果を表示部42に表示させる。判定部86は、欠点FTの有無に加え欠点FTの種類を判定してもよい。例えば、差分画像DGにおいて、濃度、形状、サイズ等をパラメータとし、パラメータごとに設定した閾値等を用いて欠点FTの種類を判定してもよい。この場合、表示部42には欠点の有無に加え、欠点ありの場合は欠点FTの種類が表示される。 In step S44, the CPU 51 outputs the inspection result. Specifically, the determination unit 86 determines the presence or absence of the defect FT based on the difference image DG. Then, the control unit 61 causes the display unit 42 to display the inspection result. The determination unit 86 may determine the type of defect FT in addition to the presence or absence of defect FT. For example, in the difference image DG, the density, shape, size, and the like may be used as parameters, and the type of the defective FT may be determined by using the threshold value and the like set for each parameter. In this case, in addition to the presence or absence of defects, the display unit 42 displays the type of defect FT if there are defects.

以上詳述したように、この実施形態によれば、以下の効果が得られる。
(1)全周画像生成装置の一例を構成する全周画像生成部62は、良品の容器20の撮影画像SGを順次取得する画像取得処理部71と、画像取得処理部71が取得した一の撮影画像SG中の容器20の正面位置を基準位置に設定し、その容器20の正面位置における部分画像PGを周方向の位置情報と対応付けて記憶部52に蓄積する蓄積部73とを備える。さらに、全周画像生成部62は、一の撮影画像SG中の容器20の一部の所定領域を基にモデルMFを取得するモデル取得部72を備える。蓄積部73は、蓄積処理として、まずモデルMFの取得元の撮影画像SGの後に取得した次の撮影画像SGに対してモデルMFを用いたマッチング処理を行う。さらに蓄積部73は、蓄積処理として、マッチすればそのマッチした検出位置C1とモデルMFの登録位置Cmとを基に容器20の正面位置C0を割り出し、次の撮影画像SG中の容器20の正面位置C0における部分画像PGを周方向の位置情報(代表角度RKと誤差)と対応付けて記憶部52に蓄積する。また、蓄積部73は、マッチしなければ更に次の撮影画像SGに移行する。モデル取得部72が、マッチしたときの撮影画像SG中の容器20の一部の所定領域を基にモデルMFを取得するモデル取得処理と、蓄積部73が、最新のモデルMFを用いて行うマッチング処理を含む蓄積処理とを、周方向の位置情報と対応付けた部分画像PGを全周分に相当する複数収集するまで繰り返すことで全周画像AGを生成する。よって、容器20の周方向の位置情報に対応付けられた全周画像AGを比較的簡単に生成することができる。例えば、作業者が容器20の撮影位置を手作業で位置決めしつつ容器20を撮影し、複数の撮影画像からPCの入力装置を操作する手作業で容器20の部分画像を位置情報と対応付けて1周分に相当する複数取得する面倒な作業を省くことができる。
As described in detail above, according to this embodiment, the following effects can be obtained.
(1) The all-around image generation unit 62, which constitutes an example of the all-around image generation device, includes an image acquisition processing unit 71 that sequentially acquires captured images SG of a non-defective container 20 and one acquired by the image acquisition processing unit 71. A storage unit 73 is provided in which the front position of the container 20 in the captured image SG is set as a reference position, and the partial image PG at the front position of the container 20 is associated with the position information in the circumferential direction and stored in the storage unit 52. Further, the all-around image generation unit 62 includes a model acquisition unit 72 that acquires a model MF based on a predetermined region of a part of the container 20 in one captured image SG. As the storage process, the storage unit 73 first performs a matching process using the model MF on the next captured image SG acquired after the captured image SG of the acquisition source of the model MF. Further, as a storage process, the storage unit 73 determines the front position C0 of the container 20 based on the matching detection position C1 and the registration position Cm of the model MF if they match, and the storage unit 73 determines the front position C0 of the container 20 and the front surface of the container 20 in the next captured image SG. The partial image PG at the position C0 is stored in the storage unit 52 in association with the position information in the circumferential direction (error with the representative angle RK). Further, if the storage unit 73 does not match, the storage unit 73 further shifts to the next captured image SG. The model acquisition process in which the model acquisition unit 72 acquires the model MF based on a predetermined area of a part of the container 20 in the captured image SG at the time of matching, and the matching performed by the storage unit 73 using the latest model MF. An all-around image AG is generated by repeating the accumulation process including the process until a plurality of partial image PGs associated with the position information in the circumferential direction are collected corresponding to the whole circumference. Therefore, it is possible to relatively easily generate the all-around image AG associated with the position information in the circumferential direction of the container 20. For example, an operator manually positions the shooting position of the container 20 while shooting the container 20, and manually operates the input device of the PC from a plurality of shot images to manually associate the partial image of the container 20 with the position information. It is possible to eliminate the troublesome work of acquiring a plurality of images corresponding to one lap.

ところで、ラインカメラを用いて一周分の画像を得ることができるが、この場合、全周画像取得用のラインカメラを別途用意しなければならず、しかもカメラが異なると、検査対象の容器20の撮影画像と、全周画像AGを基に生成されたモデルMや良品画像RGとの画質等が異なるため、検査精度に影響する。しかし、本実施形態では、検査に用いるカメラ31等の通常のカメラで撮影した容器20の撮影画像SGを用いて全周画像AGを生成できる。よって、高い検査精度が得られる。 By the way, an image for one round can be obtained by using a line camera, but in this case, a line camera for acquiring an all-round image must be prepared separately, and if the cameras are different, the container 20 to be inspected Since the image quality and the like of the captured image and the model M and the non-defective image RG generated based on the all-around image AG are different, the inspection accuracy is affected. However, in the present embodiment, the all-around image AG can be generated by using the captured image SG of the container 20 captured by a normal camera such as the camera 31 used for the inspection. Therefore, high inspection accuracy can be obtained.

(2)蓄積部73は、容器20の周を複数分割した代表角度RKが属する格納部AK(領域)ごとに部分画像PGを蓄積する。蓄積部73は、マッチした際の今回の正面角度θc(正面位置C0)が属する代表角度RKの格納部AKに先の部分画像PGが蓄積済み(登録済み)である場合は、今回の正面角度θcが先の部分画像PGの正面角度θcよりも代表角度RKに近ければ、その代表角度RKの格納部AKの記憶データを先の部分画像PGから今回の部分画像PGに更新する。よって、蓄積処理を進めるうちに蓄積される部分画像PGがより適切な部分画像PGに更新されるため、歪みの少ないより精度の高い全周画像AGを生成することができる。 (2) The storage unit 73 stores the partial image PG for each storage unit AK (region) to which the representative angle RK is divided into a plurality of circumferences of the container 20. When the previous partial image PG is stored (registered) in the storage unit AK of the representative angle RK to which the current front angle θc (front position C0) at the time of matching belongs, the storage unit 73 has the current front angle. If θc is closer to the representative angle RK than the front angle θc of the previous partial image PG, the stored data of the storage unit AK of the representative angle RK is updated from the previous partial image PG to the current partial image PG. Therefore, since the accumulated partial image PG is updated to a more appropriate partial image PG while the accumulation process is advanced, it is possible to generate a more accurate full-circumferential image AG with less distortion.

(3)蓄積部73は、所定条件を満たすまでモデル取得処理と蓄積処理とを繰り返しても、全周画像AGを完成できなかった場合、部分画像PGが蓄積されていない未登録の領域の代表角度RKを取得する。そして、蓄積部73は、未登録の領域の隣の位置に登録済みの領域が存在すれば、その登録済みの領域に蓄積されている部分画像PGの取得元である撮影画像SGから未登録の領域の代表角度RKに対応する位置の部分画像PGを取得し、その取得した部分画像PGを位置情報と対応付けて未登録の領域に蓄積する。よって、全周画像AGを完成できなかった場合でも、既存の撮影画像SGを利用して全周画像AGを完成することができる。よって、全周画像AGを用いて行われる、モデル登録処理、物品向き検出処理および物品検査処理などの所定の処理を実施できる。 (3) The storage unit 73 is a representative of an unregistered area in which the partial image PG is not stored when the full-circle image AG cannot be completed even after repeating the model acquisition process and the storage process until a predetermined condition is satisfied. Get the angle RK. Then, if a registered area exists at a position next to the unregistered area, the storage unit 73 is not registered from the captured image SG that is the acquisition source of the partial image PG stored in the registered area. A partial image PG at a position corresponding to the representative angle RK of the region is acquired, and the acquired partial image PG is associated with the position information and stored in an unregistered region. Therefore, even if the all-around image AG cannot be completed, the all-around image AG can be completed by using the existing photographed image SG. Therefore, it is possible to carry out predetermined processing such as model registration processing, article orientation detection processing, and article inspection processing, which are performed using the all-around image AG.

(4)ラベル検査装置11は、全周画像生成部62と、全周画像生成部62が生成した全周画像AGから選択された周方向に位置の異なる複数のモデル領域GAを基に複数のモデルMを作成し、これら複数のモデルMを周方向の位置情報と対応付けて登録するモデル登録部63とを備える。よって、容器20の正面位置の特定などの処理に用いられる複数のマッチング処理用のモデルMを、簡単に生成した全周画像AGを利用して比較的簡単に生成できる。 (4) The label inspection device 11 has a plurality of model regions GA having different positions in the circumferential direction selected from the all-around image generation unit 62 and the all-around image AG generated by the all-around image generation unit 62. It includes a model registration unit 63 that creates a model M and registers the plurality of models M in association with the position information in the circumferential direction. Therefore, a plurality of models M for matching processing used for processing such as specifying the front position of the container 20 can be relatively easily generated by using the easily generated all-around image AG.

(5)ラベル検査装置11は、外面に図柄23を有する向き特定対象の容器20を撮影した撮影画像に対してモデルMを用いてマッチング処理を行って、マッチした類似図柄部の位置情報と当該モデルMの位置情報とを基に撮影画像SG中の容器20の正面位置C0を特定する位置特定部82を備える。よって、容器20がカメラ31の方を向く正面の位置である向きを検出することができ、しかも容器20の向きの検出に必要な全周画像AGを比較的簡単に生成できる。 (5) The label inspection device 11 performs a matching process using the model M on the photographed image of the container 20 having the symbol 23 on the outer surface and the orientation-specific target, and performs the matching process with the position information of the matched similar symbol portion and the corresponding. A position specifying unit 82 for specifying the front position C0 of the container 20 in the captured image SG based on the position information of the model M is provided. Therefore, the orientation of the container 20 at the front position facing the camera 31 can be detected, and the all-around image AG required for detecting the orientation of the container 20 can be relatively easily generated.

(6)ラベル検査装置11は、全周画像生成部62と、全周画像AGから周方向の部分画像である良品画像RGを全周分に相当する複数生成する良品画像生成部64と、検査対象の容器20(特にラベル)の欠点FTの有無を検査する検査部66と、撮影画像SGにおける検査対象の容器20の正面位置C0を特定する位置特定部82とを備える。検査部66は、検査画像KGと、正面位置C0に対応する良品画像RGとを比較した比較結果を基に容器20の欠点FTの有無を検査する。よって、容器20の欠点FTの有無を検査できるうえ、検査に必要な良品画像データGDを簡単に取得することができる。特に、本実施形態では、位置特定部82が、撮影画像SGに対して複数のモデルMを用いてマッチング処理を行って、撮影画像SGにおける検査対象の容器20の正面位置C0を特定する。これら複数のモデルMは、全周画像生成部62が生成した全周画像AGから選択されたモデル領域GAを基に生成される。よって、検査に必要な複数のモデルMを簡単に取得することができる。 (6) The label inspection device 11 inspects the all-around image generation unit 62, the good-quality image generation unit 64 that generates a plurality of non-defective image RGs that are partial images in the circumferential direction from the all-around image AG, and corresponds to the entire circumference. It is provided with an inspection unit 66 for inspecting the presence or absence of a defect FT of the target container 20 (particularly a label), and a position specifying unit 82 for specifying the front position C0 of the container 20 to be inspected in the captured image SG. The inspection unit 66 inspects the presence or absence of the defect FT of the container 20 based on the comparison result of comparing the inspection image KG and the good product image RG corresponding to the front position C0. Therefore, it is possible to inspect the presence or absence of the defect FT of the container 20, and it is possible to easily acquire the non-defective image data GD necessary for the inspection. In particular, in the present embodiment, the position specifying unit 82 performs matching processing on the captured image SG using a plurality of models M to specify the front position C0 of the container 20 to be inspected in the captured image SG. These plurality of models M are generated based on the model region GA selected from the all-around image AG generated by the all-around image generation unit 62. Therefore, it is possible to easily acquire a plurality of models M required for inspection.

(7)ラベル検査装置11が検査対象とする容器20は、外面にラベル22が付され、検査部66は、ラベル22の欠点FTを検査する。よって、容器20の付されたラベル22の欠点FTを検査することができる。 (7) The container 20 to be inspected by the label inspection device 11 has a label 22 on the outer surface, and the inspection unit 66 inspects the defect FT of the label 22. Therefore, the defect FT of the label 22 to which the container 20 is attached can be inspected.

(8)全周画像生成方法は、画像取得ステップ(S11)と、モデル取得ステップ(S13,S20)と、蓄積ステップ(S14〜S19)とを備える。この方法によって、容器20の周方向の位置情報に対応付けられた全周画像AGを比較的簡単に生成することができる。 (8) The all-around image generation method includes an image acquisition step (S11), a model acquisition step (S13, S20), and an accumulation step (S14 to S19). By this method, it is possible to relatively easily generate the all-around image AG associated with the position information in the circumferential direction of the container 20.

(第2実施形態)
次に、第2実施形態について図20〜図22を参照して説明する。この第2実施形態では、マッチング処理を複数のモデルMFを用いて行って全周画像生成処理の所要時間を短縮している。コンピュータ50は、全周画像生成の指示を受け付けると、図22にフローチャートで示される全周画像生成処理を実行する。
(Second Embodiment)
Next, the second embodiment will be described with reference to FIGS. 20 to 22. In this second embodiment, the matching process is performed using a plurality of model MFs to shorten the time required for the all-around image generation process. Upon receiving the instruction for generating the all-around image, the computer 50 executes the all-around image generation process shown in the flowchart in FIG. 22.

図22に示すステップS51〜S55の処理は、第1実施形態の図4におけるステップS11〜S15の処理と同じである。すなわち、最初に取得した撮影画像SGにおける容器20の正面位置を基準位置(例えば0度)に設定するとともに正面位置における部分画像PGを取得する(S51,S52)。この撮影画像SG中の容器20の正面位置における一部の所定領域の画像からモデルMを作成する(S53)。そして、次の撮影画像SGに対してモデルMFを用いたマッチング処理を行い(S54)、マッチすれば(S55で肯定判定)ステップS56に進む。一方、マッチしなければ(S55で否定判定)、マッチするまで撮影画像SGを順次読み込み、マッチすればステップS56に進む。 The processing of steps S51 to S55 shown in FIG. 22 is the same as the processing of steps S11 to S15 in FIG. 4 of the first embodiment. That is, the front position of the container 20 in the first captured image SG is set to the reference position (for example, 0 degree), and the partial image PG at the front position is acquired (S51, S52). A model M is created from an image of a part of a predetermined area in the front position of the container 20 in the captured image SG (S53). Then, a matching process using the model MF is performed on the next captured image SG (S54), and if there is a match (affirmative determination in S55), the process proceeds to step S56. On the other hand, if there is no match (negative determination in S55), the captured images SG are sequentially read until they match, and if they match, the process proceeds to step S56.

そして、ステップS56では、最もマッチしたモデルの位置を基に容器の正面位置を算出する。ここで、最初は1つのモデルMFを用いたマッチング処理なので、1つのモデルMFの登録位置を基に容器20の正面位置を算出する。なお、その後の処理においてモデルMFの数は最大数まで順次増える。 Then, in step S56, the front position of the container is calculated based on the position of the most matched model. Here, since the matching process initially uses one model MF, the front position of the container 20 is calculated based on the registered position of one model MF. In the subsequent processing, the number of model MFs is sequentially increased up to the maximum number.

次のステップS57〜S59の処理は、図4におけるステップS17〜19の処理に相当する。すなわち、撮影画像SG中の容器20の正面位置が登録済みであれば(S57で肯定判定)、更新すべき正面位置であるか否かを判断する(S58)。そして、正面位置が未登録である場合(S57で否定判定)又は更新すべき正面位置であれば(S58で肯定判定)、部分画像と正面位置情報を記憶部52に記憶することで登録する(S59)。つまり、正面位置からこれが属する代表角度RKが決まり、蓄積部73は、正面位置情報を位置格納部53の対応する代表角度RKの格納部AKに格納し、部分画像PGを第1格納部54の対応する代表角度RKの格納部PKに格納する。なお、格納部AKに格納される正面位置情報は、正面角度θcと代表角度RKとの誤差である。また、蓄積部73は、第2格納部55の対応する代表角度RKの格納部QKに撮影画像SGを格納する。 The processing of the next steps S57 to S59 corresponds to the processing of steps S17 to 19 in FIG. That is, if the front position of the container 20 in the photographed image SG has already been registered (affirmative determination in S57), it is determined whether or not the front position should be updated (S58). If the front position is not registered (negative judgment in S57) or the front position to be updated (affirmative judgment in S58), the partial image and the front position information are registered by being stored in the storage unit 52 (the storage unit 52). S59). That is, the representative angle RK to which this belongs is determined from the front position, the storage unit 73 stores the front position information in the storage unit AK of the corresponding representative angle RK of the position storage unit 53, and the partial image PG is stored in the first storage unit 54. It is stored in the storage unit PK of the corresponding representative angle RK. The front position information stored in the storage unit AK is an error between the front angle θc and the representative angle RK. Further, the storage unit 73 stores the captured image SG in the storage unit QK of the corresponding representative angle RK of the second storage unit 55.

ステップS60では、CPU51はモデル追加条件が成立したか否かを判断する。本実施形態では、モデル取得部72がモデルMFを最大数まで追加する2つの方式がある。1つは二方向方式、他の1つは飛び石方式である。モデル追加条件は、モデルMFを追加する方式に応じて決まる。例えば今回の撮影画像SG中の容器20の正面角度θcが属する代表角度RKの領域が、既存のモデルMFの取得元の撮影画像SGの正面角度θcが属する代表角度RKの領域と隣合っていなければ、つまり間に1つ以上の未登録の領域を挟んでいれば、モデル追加条件が成立する。モデル追加条件が不成立であればステップS62に進み、モデル追加条件が成立すればステップS61に進む。なお、モデルMFを追加する2つの方式の詳細は後述する。 In step S60, the CPU 51 determines whether or not the model addition condition is satisfied. In this embodiment, there are two methods in which the model acquisition unit 72 adds the maximum number of model MFs. One is a two-way method and the other is a stepping stone method. The model addition condition is determined according to the method of adding the model MF. For example, the region of the representative angle RK to which the front angle θc of the container 20 in the captured image SG of this time belongs must be adjacent to the region of the representative angle RK to which the front angle θc of the captured image SG of the acquisition source of the existing model MF belongs. In other words, if one or more unregistered areas are sandwiched between them, the model addition condition is satisfied. If the model addition condition is not satisfied, the process proceeds to step S62, and if the model addition condition is satisfied, the process proceeds to step S61. The details of the two methods for adding the model MF will be described later.

ステップS61では、CPU51は、モデルを追加する。モデル取得部72は、今回の撮影画像SG中の容器20の正面位置における一部の所定領域の画像を基に特徴の抽出を行ってモデルMFを作成して追加する。このため、今回の撮影画像SGの正面角度θcが属する代表角度RKの領域が、既存のモデルMFに対応する領域に対して1つ以上の未登録の領域を間に挟んで位置する場合は、今回の撮影画像SGから新規のモデルMFを作成して追加する。 In step S61, the CPU 51 adds a model. The model acquisition unit 72 creates and adds a model MF by extracting features based on an image of a part of a predetermined region at a front position of the container 20 in the captured image SG this time. Therefore, when the region of the representative angle RK to which the front angle θc of the captured image SG belongs is located with one or more unregistered regions in between with respect to the region corresponding to the existing model MF, Create and add a new model MF from the captured image SG this time.

ステップS62では、CPU51はモデル消去条件が成立したか否かを判断する。例えば、既存のモデルMFに対応する領域の両隣の領域が登録済みとなれば、モデル消去条件が成立する。また、モデルMFに対応する領域の両隣のうち一方または両方が未登録であれば、その隣の未登録の領域へ蓄積されるべき部分画像PGの取得のためのマッチング処理に使用可能なモデルMFは残されるので、モデル消去条件は不成立となる。モデル消去条件が不成立であればステップS64に進み、モデル消去条件が成立すればステップS63に進む。 In step S62, the CPU 51 determines whether or not the model deletion condition is satisfied. For example, if the areas on both sides of the area corresponding to the existing model MF are registered, the model deletion condition is satisfied. Further, if one or both of both sides of the area corresponding to the model MF are unregistered, the model MF that can be used for the matching process for acquiring the partial image PG to be accumulated in the unregistered area next to the area. Is left, so the model deletion condition is not satisfied. If the model deletion condition is not satisfied, the process proceeds to step S64, and if the model deletion condition is satisfied, the process proceeds to step S63.

ステップS63では、CPU51は、モデル消去条件が成立したモデルMFを消去する。なお、モデルMFの消去も、モデル取得部72が行う。
ステップS64では、CPU51は、全周画像を完成したか否かを判定する。全周画像を完成していなければステップS54に戻り、ステップS64で全周画像を完成したと判断するまで、全周画像の生成処理(S54〜S64)を繰り返す。一方、全周画像を完成すれば図4におけるステップS22と同様の処理に進む。
In step S63, the CPU 51 deletes the model MF for which the model deletion condition is satisfied. The model acquisition unit 72 also erases the model MF.
In step S64, the CPU 51 determines whether or not the all-around image is completed. If the all-around image is not completed, the process returns to step S54, and the all-around image generation process (S54 to S64) is repeated until it is determined that the all-around image is completed in step S64. On the other hand, when the all-around image is completed, the process proceeds to the same process as in step S22 in FIG.

以下、第1実施形態の図4におけるステップS22〜S24と同様の処理を行う。つまり、全周画像が完成すると(S64で肯定判定)、強化学習をするか否かを判断し(S22)、強化学習をする場合は(S22で肯定判定)、ステップS54〜S64およびS22,S23の処理を、強化学習終了条件が成立するまで繰り返す。また、強化学習の有無によらず、全周画像AGを完成すると、全周画像AGの角度補正を行う(S24)。その結果、図14に示すように、指定の位置を0度とする角度と対応付けられた全周画像AGの画像データが生成される。 Hereinafter, the same processing as in steps S22 to S24 in FIG. 4 of the first embodiment is performed. That is, when the all-around image is completed (affirmative judgment in S64), it is determined whether or not reinforcement learning is performed (S22), and in the case of reinforcement learning (affirmative judgment in S22), steps S54 to S64 and S22, S23. Is repeated until the reinforcement learning end condition is satisfied. Further, when the all-around image AG is completed regardless of the presence or absence of reinforcement learning, the angle of the all-around image AG is corrected (S24). As a result, as shown in FIG. 14, the image data of the all-around image AG associated with the angle with the designated position as 0 degree is generated.

次に複数のモデルMFを用いる2つの方式について説明する。まず、図20を参照して二方向方式について説明する。二方向方式は、物品の周方向において時計方向と反時計方向との二方向に向かってモデルMFを増やす方式である。すなわち、最初に基準位置(0度)でモデルMFを作成し、マッチング処理の結果、マッチしたモデルMFの位置から定まる撮影画像SGの正面位置が属する角度領域が、登録中のモデルMFに対応する角度領域(例えば0度)に対して1つ以上の未登録の角度領域を開けた位置である場合、今回の撮影画像SGからモデルMFを作成する。この条件を満たすのは、既存のモデルMFに対応する角度領域(例えば0度)に対して、時計方向側で1つ以上の未登録の角度領域を開けている場合と、反時計方向側で1つ以上の未登録の角度領域を開けている場合とがある。本方式では、時計方向に増殖するモデルMFcと反時計方向に増殖するモデルMFkとの両方向にモデルMFを増殖する。このため、モデルMFは時計方向にも増えるし、反時計方向にも増える。この結果、蓄積処理の途中から複数のモデルMFでマッチング処理を行うことになるので、モデルMFが1つであった第1実施形態の方式に比べ、全周画像を早期に完成することができる。 Next, two methods using a plurality of model MFs will be described. First, the two-way method will be described with reference to FIG. The two-way method is a method in which the model MF is increased in the two directions of the clockwise direction and the counterclockwise direction in the circumferential direction of the article. That is, the model MF is first created at the reference position (0 degree), and as a result of the matching process, the angle region to which the front position of the captured image SG determined from the position of the matched model MF belongs corresponds to the registered model MF. When one or more unregistered angle regions are opened with respect to the angle region (for example, 0 degree), the model MF is created from the captured image SG this time. This condition is satisfied when one or more unregistered angle regions are opened on the clockwise side with respect to the angle region (for example, 0 degrees) corresponding to the existing model MF, and when the counterclockwise side is satisfied. One or more unregistered angle regions may be open. In this method, the model MF is propagated in both directions of the model MFc that propagates in the clockwise direction and the model MFk that propagates in the counterclockwise direction. Therefore, the model MF increases in the clockwise direction and also in the counterclockwise direction. As a result, since the matching process is performed by a plurality of model MFs from the middle of the accumulation process, the entire circumference image can be completed earlier than the method of the first embodiment in which one model MF is used. ..

次に、図21を参照して飛び石方式について説明する。飛び石方式は、モデルMFを1つ以上の未登録の角度領域を開けた位置にモデルMFを増やす方式である。最初に基準位置(0度)でモデルMFを作成する。モデルMFを用いたマッチング処理の結果、モデルMFとマッチした位置から定まる撮影画像SG中の容器20の正面位置が属する角度領域が、登録中のモデルに対応する角度領域(例えば0度)に対して1つ以上の未登録(「99」)の角度領域を開けた位置である場合、今回の撮影画像SGからモデルMFを作成して追加する。モデルMFに対応する角度領域の両隣が未登録「99」の角度領域なので、次の撮影画像SGに対するマッチング処理においてモデルMFがマッチする頻度が高くなる。図21(a)に示す例では、最初の左モデルMLに対して未登録の角度領域を1つ開けて中モデルMMが増え、さらに図21(b)に示す例のように右モデルMRが増える。以降、3つのモデルML,MM,MRを用いてマッチング処理が行われる。 Next, the stepping stone method will be described with reference to FIG. The stepping stone method is a method of increasing the model MF to a position where one or more unregistered angle regions are opened. First, a model MF is created at the reference position (0 degree). As a result of the matching process using the model MF, the angle region to which the front position of the container 20 in the captured image SG determined from the position matching the model MF belongs is the angle region (for example, 0 degree) corresponding to the registered model. If one or more unregistered (“99”) angle regions are opened, a model MF is created and added from the captured image SG this time. Since both sides of the angle region corresponding to the model MF are unregistered “99” angle regions, the frequency with which the model MF matches in the matching process for the next captured image SG increases. In the example shown in FIG. 21 (a), the middle model MM is increased by opening one unregistered angle region with respect to the first left model ML, and the right model MR is further increased as in the example shown in FIG. 21 (b). increase. After that, the matching process is performed using the three models ML, MM, and MR.

この結果、蓄積処理の開始後の途中から複数のモデルMFでマッチング処理を行うことになるので、モデルMFが1つであった第1実施形態の方式に比べ、全周画像AGを早期に完成することができる。なお、複数のモデルMFを用いたマッチング処理では、複数のモデルMFを順番に切り換えてモデルMFごとの探索処理を直列処理で行ってもよいが、例えばマルチコアのCPU51を用いて複数のモデルMFを用いた各探索処理を並列処理で行うことが好ましい。 As a result, since the matching process is performed by a plurality of model MFs from the middle after the start of the accumulation process, the all-around image AG is completed earlier than the method of the first embodiment in which one model MF is used. can do. In the matching process using a plurality of model MFs, the plurality of model MFs may be switched in order and the search process for each model MF may be performed in series processing. For example, a plurality of model MFs may be used by using a multi-core CPU 51. It is preferable to perform each of the search processes used in parallel.

(9)二方向方式において、モデル取得部72は、最初に取得したモデルMFの位置に対して容器20の周方向における一方向(時計方向)と他方向(反時計方向)との両方向に移動するように複数(例えば2つ)のモデルMFを取得する。蓄積部73は、最初に取得されたモデルMFの位置に対して周方向における一方向と他方向との両方向に移動する位置にある複数のモデルMFを用いてマッチング処理を行う。この結果、マッチング処理でマッチする頻度が高まる。よって、位置情報に対応付けられた全周画像AGを比較的高速に生成できる。 (9) In the two-way method, the model acquisition unit 72 moves in both one direction (clockwise direction) and the other direction (counterclockwise direction) in the circumferential direction of the container 20 with respect to the position of the model MF acquired first. Acquire a plurality of (for example, two) model MFs so as to do so. The storage unit 73 performs a matching process using a plurality of model MFs located at positions that move in both directions of one direction and the other direction in the circumferential direction with respect to the position of the first acquired model MF. As a result, the frequency of matching in the matching process increases. Therefore, the all-around image AG associated with the position information can be generated at a relatively high speed.

(10)飛び石方式において、モデル取得部72は、モデルMFの周方向の位置が、他のモデルMFとの間に部分画像PGが蓄積されていない空の領域を挟むように複数のモデルMFを取得する。蓄積部73は、モデルMFの周方向の位置が、他のモデルMFとの間に部分画像PGが蓄積されていない空の領域を挟む位置にある複数のモデルMFを用いてマッチング処理を行う。この結果、マッチング処理でマッチする頻度が高まる。よって、位置情報に対応付けられた全周画像AGを比較的高速に生成できる。 (10) In the stepping stone method, the model acquisition unit 72 sets a plurality of model MFs so that the position in the circumferential direction of the model MF sandwiches an empty region in which the partial image PG is not accumulated between the model MF and the other model MFs. get. The storage unit 73 performs matching processing using a plurality of model MFs whose positions in the circumferential direction of the model MF are located between the model MF and the other model MF in an empty area where the partial image PG is not stored. As a result, the frequency of matching in the matching process increases. Therefore, the all-around image AG associated with the position information can be generated at a relatively high speed.

実施形態は、上記に限定されず、以下のように変更してもよい。
・画像取得部は、撮影装置30に替え、容器20を撮影した画像データが蓄積された外部記憶装置91(図3に二点鎖線で示す)又はネット回線を介してサーバ(図示せず)から画像データを読み込む図3に示す入力部57(例えばUSBポート又は回線接続部)であってもよい。このように画像取得部が入力部57であって、外部記憶装置91から画像データ(検査画像)を取得したり、サーバから入力部57を介して画像データ(検査画像)を取得したりするものであっても、位置情報に対応付けられた全周画像AGを比較的簡単に生成することができる。
The embodiment is not limited to the above, and may be changed as follows.
The image acquisition unit is replaced with the photographing device 30 from an external storage device 91 (shown by a two-dot chain line in FIG. 3) in which image data obtained by photographing the container 20 is stored, or from a server (not shown) via a net line. It may be an input unit 57 (for example, a USB port or a line connection unit) shown in FIG. 3 for reading image data. In this way, the image acquisition unit is the input unit 57, which acquires image data (inspection image) from the external storage device 91 or acquires image data (inspection image) from the server via the input unit 57. Even so, the all-around image AG associated with the position information can be generated relatively easily.

・撮影画像SG中の容器20の正面位置における部分画像PGは、代表角度RKを中心とする部分画像に限定されず、正面角度θcを中心とする真正面の部分画像でもよい。前記実施形態では、撮影画像SG中の容器20の幅中心を正面位置とし、代表角度との誤差がある場合は代表角度RKを中心とする幅角WPの部分画像PGを蓄積したが、撮影画像SGにおける正面角度θcを中心とする部分画像PGを蓄積してもよい。この場合も、代表角度RKと正面角度θcとの誤差を記憶し、誤差が小さくなるように正面角度θcを中心とする部分画像PGを更新すればよい。この構成でも、例えば強化学習などをして誤差が小さくなれば、比較的精度の高い全周画像AGを得ることはできる。 The partial image PG at the front position of the container 20 in the photographed image SG is not limited to the partial image centered on the representative angle RK, and may be a partial image directly in front centered on the front angle θc. In the above embodiment, the center of the width of the container 20 in the captured image SG is set as the front position, and if there is an error from the representative angle, the partial image PG of the width angle WP centered on the representative angle RK is accumulated. A partial image PG centered on the front angle θc in SG may be accumulated. Also in this case, the error between the representative angle RK and the front angle θc may be stored, and the partial image PG centered on the front angle θc may be updated so that the error becomes small. Even with this configuration, if the error is reduced by, for example, reinforcement learning, it is possible to obtain an all-around image AG with relatively high accuracy.

・モデルデータMDと良品画像データGDの少なくとも一方は、全周画像AGを基に生成されなくてもよい。データMD,GDの少なくとも一方は、作業者が手作業で容器20の周方向の位置を調整しつつカメラ31で撮影した撮影画像SGを基に生成したものでもよい。 -At least one of the model data MD and the non-defective image data GD does not have to be generated based on the all-around image AG. At least one of the data MD and GD may be generated based on the photographed image SG taken by the camera 31 while the operator manually adjusts the position in the circumferential direction of the container 20.

・全周画像AGを構成する部分画像PGの枚数を決める分割数Jは、10度ずつの36分割とするJ=36に限らず、6以上の自然数であればよい。ここで、分割数Jが、6以上の自然数であればよい理由は下記のとおりである。マッチングにより位置(角度)を取得し全周画像AGを作成するため、マスター画像と次の画像の両方が確実に撮像されている必要がある。すなわち、マスター画像が端の方にあるとき、次の画像が正面に位置する場合の限界値が、一方向から取得した画像で検査に使える(有効な)範囲は120度なので、正面を中心に±60度であり、この60度で全周の360度を割った数が「6」となる。これにより分割数Jは、「6」以上の自然数が好ましい。例えばJ=6,12,18,24,72,120,180,360でもよい。例えば30度ずつ分割した12分割、20度ずつ分割した18分割、15度ずつ分割した24分割、5度ずつ分割した72分割、3度ずつ分割した120分割でもよい。さらには180分割、360分割でもよい。要求される精度および処理速度等を考慮して適宜な分割数Jを選択できる。 The number of divisions J that determines the number of partial image PGs constituting the all-around image AG is not limited to J = 36, which is 36 divisions of 10 degrees each, and may be a natural number of 6 or more. Here, the reason why the division number J may be a natural number of 6 or more is as follows. In order to acquire the position (angle) by matching and create the all-around image AG, it is necessary that both the master image and the next image are surely captured. That is, when the master image is near the edge, the limit value when the next image is located in front is 120 degrees, which is the (effective) range that can be used for inspection in the image acquired from one direction, so centering on the front. It is ± 60 degrees, and the number obtained by dividing 360 degrees of the entire circumference by this 60 degrees is “6”. As a result, the number of divisions J is preferably a natural number of "6" or more. For example, J = 6,12,18,24,72,120,180,360 may be used. For example, 12 divisions divided by 30 degrees, 18 divisions divided by 20 degrees, 24 divisions divided by 15 degrees, 72 divisions divided by 5 degrees, and 120 divisions divided by 3 degrees may be used. Further, it may be divided into 180 and 360. An appropriate number of divisions J can be selected in consideration of the required accuracy, processing speed, and the like.

・第2実施形態における二方向方式において、第1実施形態と同様に、マッチしたモデルMFの位置から定まる撮影画像SGの正面位置が属する角度領域が、隣の未登録の角度領域の位置である場合に、今回の撮影画像SGから新規のモデルMFを作成してもよい。 -In the two-way method in the second embodiment, the angle region to which the front position of the captured image SG determined from the position of the matched model MF belongs is the position of the adjacent unregistered angle region, as in the first embodiment. In this case, a new model MF may be created from the captured image SG this time.

・全周画像生成装置の検査部66は、物品(例えば容器20)のラベル22以外の部分も検査してよい。物品の外面に施された印刷、溝又は凹部からなる図柄を検査してもよい。 The inspection unit 66 of the all-around image generator may inspect parts other than the label 22 of the article (for example, the container 20). You may inspect the print, groove or recessed pattern on the outer surface of the article.

・容器は、ラベル22(その図柄)が付された容器に限定されず、容器の外面に図柄が印刷された容器、2色成形等により図柄が一体的に成形された容器などでもよい。外面に図柄を有する各種の容器に適用することができる。この場合、容器20の高さ方向Zの一部の全周画像AGに限らず、容器20の高さ方向Zの全域の全周画像AGを生成してもよい。また、容器20の高さ方向Zに位置の異なる複数の全周画像AGを生成してもよい。 -The container is not limited to the container with the label 22 (the design thereof), and may be a container in which the design is printed on the outer surface of the container, or a container in which the design is integrally molded by two-color molding or the like. It can be applied to various containers having a pattern on the outer surface. In this case, not only a part of the all-around image AG in the height direction Z of the container 20 but also an all-around image AG of the entire area in the height direction Z of the container 20 may be generated. Further, a plurality of all-around image AGs having different positions in the height direction Z of the container 20 may be generated.

・マッチング処理は、形状マッチング処理に限定されず、公知の他のマッチング処理でもよい。例えば正規化相関マッチング等の相関マッチング処理でもよい。
・全周画像生成装置を、物品の周方向の所定位置に印刷するために、物品の所定位置が向く向きを検出する特許文献2に記載された物品向き検出装置に適用してもよい。この場合、モデル登録部63が、全周画像生成部62が生成した全周画像AGから複数のモデルMを作成する。撮影画像に対するモデルMを用いたマッチング処理の結果、マッチした類似図柄部の位置情報とモデルMの位置情報とを基に物品の向きを検出する。そして、物品の所定位置である被印刷部が印刷装置と対向するまで物品を回転させ、印刷装置により物品の被印刷部に印刷が施される。
-The matching process is not limited to the shape matching process, and may be another known matching process. For example, correlation matching processing such as normalized correlation matching may be used.
-The all-around image generation device may be applied to the article orientation detection device described in Patent Document 2 for detecting the direction in which a predetermined position of an article faces in order to print at a predetermined position in the circumferential direction of the article. In this case, the model registration unit 63 creates a plurality of models M from the all-around image AG generated by the all-around image generation unit 62. As a result of the matching process using the model M for the captured image, the orientation of the article is detected based on the position information of the matched similar symbol portion and the position information of the model M. Then, the article is rotated until the printed portion at a predetermined position of the article faces the printing device, and the printing device prints on the printed portion of the article.

・全周画像生成装置の検査部66が、カメラ31で容器20等の物品を撮影した部分画像と全周画像AGとを比較して物品の外観検査を行うものでもよい。この構成でも、外観検査に用いられる全周画像AGを全周画像生成部62により簡単に取得できる。 The inspection unit 66 of the all-around image generator may inspect the appearance of the article by comparing the partial image of the article such as the container 20 with the camera 31 with the all-around image AG. Even with this configuration, the all-around image AG used for the visual inspection can be easily acquired by the all-around image generation unit 62.

・容器20を挟持可能な一対のベルトの速度差を利用して容器20を回転させながら搬送する搬送装置としたり、容器を回転テーブルに載せて回転させる回転テーブル方式、チャック部又は負圧吸着部などの把持部により持ち上げた容器を回転させる回転方式としたりし、1つのカメラ31で、回転する容器20を1回転する間に複数回撮影してもよい。 A rotary table method, a chuck part or a negative pressure suction part that transports the container 20 while rotating it by using the speed difference of a pair of belts that can hold the container 20 or puts the container on a rotary table and rotates it. A rotation method may be adopted in which the container lifted by the grip portion such as the above is rotated, or a single camera 31 may take a picture a plurality of times while the rotating container 20 is rotated once.

・位置特定部82がオムニ・マッチング処理を行わない構成でもよい。容器20又はラベル22に印刷等により周方向の異なる位置に複数の目印を付け、位置特定部82は、撮影画像SG中の目印の位置から容器20の正面位置を特定してもよい。 -The position specifying unit 82 may be configured not to perform the omni matching process. A plurality of marks may be attached to the container 20 or the label 22 at different positions in the circumferential direction by printing or the like, and the position specifying unit 82 may specify the front position of the container 20 from the positions of the marks in the photographed image SG.

・照明機器32に替え、例えば、撮像対象の容器20を挟んでカメラ31とは反対側に、赤外光(赤外線)を照射する照明機器を配置し、反射光と透過光との双方を用いたラベル22の外観検査を行ってもよい。 -Instead of the lighting device 32, for example, a lighting device that irradiates infrared light (infrared light) is arranged on the opposite side of the camera 31 with the container 20 to be imaged sandwiched between them, and both reflected light and transmitted light are used. The appearance of the label 22 may be inspected.

・ラベルは、シュリンクラベルに限定されず、物品の外面に接着剤で接着したものでもよい。この場合、ラベルは樹脂製に限定されず、紙、金属、ラミネートでもよい。また、ラベル22は、物品の全周に付されていなくてもよい。ラベル22は、例えば物品の周方向の一部のみに付されてもよい。 -The label is not limited to the shrink label, and may be one that is adhered to the outer surface of the article with an adhesive. In this case, the label is not limited to the resin, but may be paper, metal, or laminate. Further, the label 22 does not have to be attached to the entire circumference of the article. The label 22 may be attached to, for example, only a part of the article in the circumferential direction.

・容器の形状は、有底円筒形状に限らず、台錘形状、外周面の一部が括れた形状、丸壜や角壜でもよい。また、容器の材質は、合成樹脂に限らず、金属やセラミック(例えばガラス又は陶磁器)でもよい。 -The shape of the container is not limited to the bottomed cylindrical shape, but may be a pedestal shape, a shape in which a part of the outer peripheral surface is constricted, a round bottle or a square bottle. The material of the container is not limited to synthetic resin, but may be metal or ceramic (for example, glass or ceramic).

・容器は、カップでもよい。カップとしては、例えば即席食品用のカップが挙げられる。また、容器は飲料液や食品の収容を目的とするものに限らず、食用以外の液体、固形物、粒または粉の収容を目的とするものでもよい。また、空の容器を検査してよいし、内容物が収容された容器を検査してもよい。 -The container may be a cup. Examples of the cup include a cup for instant food. Further, the container is not limited to the one intended for storing beverage liquids and foods, but may be intended for storing non-edible liquids, solids, grains or powders. In addition, an empty container may be inspected, or a container containing the contents may be inspected.

・物品は、容器に限定されず、外面に図柄を有する物品であれば足りる。例えばシュリンクラベルが付された物品、図柄が印刷、溝又は凹部などからなる物品でもよい。また、物品は、部品又は製品でもよい。 -The article is not limited to the container, and any article having a design on the outer surface is sufficient. For example, an article with a shrink label, an article in which the design is printed, a groove, a recess, or the like may be used. Further, the article may be a part or a product.

11…全周画像生成装置の一例としてのラベル検査装置、12…搬送装置、13…コンベヤ、20…容器、21…外周面(外面)、22…ラベル、23…図柄、30…画像取得部の一例を構成する撮影装置、31…画像取得部の一例を構成するカメラ、32…照明機器、33…容器センサ、40…コントローラ、41…入力装置、42…表示部、50…コンピュータ、51…CPU、52…記憶部、53…位置格納部、54…第1格納部、55…第2格納部、56…第3格納部、57…画像取得部の一例を構成する入力部、61…制御部、62…全周画像生成部、63…モデル登録部、64…良品画像生成部、65…特徴画像生成部、66…検査部、71…画像取得部の一例を構成する画像取得処理部、72…モデル取得部、73…蓄積部、74…角度補正部、75…マッチング処理部、81…画像取得処理部、82…位置特定部、83…ラベル高さ検査部、84…検出部、85…比較処理部、86…判定部、91…外部記憶装置、PR…プログラム、MD…モデルデータ、GD…良品画像データ、FD…特徴画像データ、SG…撮影画像、MF,MFc,MFk,ML,MM,MR…モデル、AM…類似図柄部、C0…正面位置、RK…代表角度、PG…部分画像、AG…全周画像、PS…進捗スケール、KG…検査画像、RG,RG0〜RG35…良品画像、FG,FG0〜FG35…特徴画像、DG…差分画像、GA…画像領域の一例としてのモデル領域、M,M1〜M8…モデル、FT…欠点、X…搬送方向、Z…高さ方向。 11 ... Label inspection device as an example of an all-around image generation device, 12 ... Conveyor device, 13 ... Conveyor, 20 ... Container, 21 ... Outer peripheral surface (outer surface), 22 ... Label, 23 ... Design, 30 ... Image acquisition unit An example of a photographing device, 31 ... a camera constituting an example of an image acquisition unit, 32 ... a lighting device, 33 ... a container sensor, 40 ... a controller, 41 ... an input device, 42 ... a display unit, 50 ... a computer, 51 ... a CPU. , 52 ... Storage unit, 53 ... Position storage unit, 54 ... First storage unit, 55 ... Second storage unit, 56 ... Third storage unit, 57 ... Input unit constituting an example of image acquisition unit, 61 ... Control unit , 62 ... All-around image generation unit, 63 ... Model registration unit, 64 ... Good product image generation unit, 65 ... Feature image generation unit, 66 ... Inspection unit, 71 ... Image acquisition processing unit that constitutes an example of the image acquisition unit, 72. ... Model acquisition unit, 73 ... Accumulation unit, 74 ... Angle correction unit, 75 ... Matching processing unit, 81 ... Image acquisition processing unit, 82 ... Position identification unit, 83 ... Label height inspection unit, 84 ... Detection unit, 85 ... Comparison processing unit, 86 ... Judgment unit, 91 ... External storage device, PR ... Program, MD ... Model data, GD ... Good product image data, FD ... Feature image data, SG ... Photographed image, MF, MFc, MFk, ML, MM , MR ... model, AM ... similar pattern part, C0 ... front position, RK ... representative angle, PG ... partial image, AG ... all-around image, PS ... progress scale, KG ... inspection image, RG, RG0 to RG35 ... good product image , FG, FG0 to FG35 ... feature image, DG ... difference image, GA ... model area as an example of image area, M, M1 to M8 ... model, FT ... defect, X ... transport direction, Z ... height direction.

Claims (10)

良品の物品を撮影して得た部分画像を収集して周方向の位置情報と対応付けた全周画像を生成する全周画像生成装置であって、
物品を撮影して得た撮影画像を順次取得する画像取得部と、
前記画像取得部が取得した一の前記撮影画像中の前記物品の正面位置を基準位置に設定し、当該物品の当該正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積する蓄積部と、
前記画像取得部が取得した一の前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得部とを備え、
前記蓄積部は、前記画像取得部が前記モデルの取得元の前記撮影画像の後に取得した後の撮影画像に対して前記モデルを用いたマッチング処理を行い、マッチすれば当該マッチした位置の位置情報と前記モデルの位置情報とを基に前記物品の正面位置を割り出し、前記後の撮影画像中の前記物品の前記正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積し、マッチしなければ次の撮影画像に移行する蓄積処理を行い、
前記モデル取得部が、前記マッチしたときの前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得処理と、前記蓄積部が、少なくとも最新の前記モデルを用いて行う前記マッチング処理を含む前記蓄積処理とを、周方向の位置情報と対応付けた部分画像を少なくとも全周分に相当する複数収集するまで繰り返して前記全周画像を生成することを特徴とする全周画像生成装置。
An all-around image generator that collects partial images obtained by photographing a non-defective article and generates an all-around image associated with position information in the circumferential direction.
An image acquisition unit that sequentially acquires captured images obtained by photographing an article,
The front position of the article in the photographed image acquired by the image acquisition unit is set as a reference position, and the partial image of the article at the front position is stored in the storage unit in association with the position information in the circumferential direction. Accumulation part and
The image acquisition unit includes a model acquisition unit that acquires a model based on a predetermined area of a part of the article in the photographed image acquired by the image acquisition unit.
The storage unit performs matching processing using the model on the captured image acquired after the captured image of the acquisition source of the model by the image acquisition unit, and if there is a match, the position information of the matched position is performed. The front position of the article is determined based on the position information of the model, and the partial image of the article at the front position in the later captured image is stored in the storage unit in association with the position information in the circumferential direction. If there is no match, the accumulation process is performed to move to the next captured image, and
The model acquisition unit acquires a model based on a predetermined area of a part of the article in the captured image at the time of the match, and the storage unit performs at least the latest model. The all-around image is generated by repeating the accumulation process including the matching process until a plurality of partial images associated with the position information in the circumferential direction are collected, which corresponds to at least the entire circumference. Image generator.
前記蓄積部は、前記物品の周を複数分割した代表位置が属する領域ごとに前記部分画像を蓄積し、マッチした際の今回の前記正面位置が属する前記領域に先の前記部分画像が蓄積されている場合は、当該今回の正面位置が前記先の部分画像の前記正面位置よりも当該領域の代表位置に近ければ、当該領域に蓄積する部分画像を、先の前記部分画像から今回の前記部分画像に更新することを特徴とする請求項1に記載の全周画像生成装置。 The storage unit accumulates the partial image for each region to which the representative position is divided into a plurality of circumferences of the article, and the partial image is accumulated in the region to which the front position of the present time when matched is assigned. If the front position of this time is closer to the representative position of the region than the front position of the previous partial image, the partial image accumulated in the region is transferred from the previous partial image to the current partial image. The all-around image generator according to claim 1, wherein the image is updated to. 前記モデル取得部は、最初に取得した前記モデルの周方向の位置に対して前記物品の周方向における一方向に移動した位置と、他方向に移動した位置との両方の位置で複数の前記モデルを取得し、
前記蓄積部は、複数の前記モデルを用いて前記マッチング処理を行うことを特徴とする請求項1または請求項2に記載の全周画像生成装置。
The model acquisition unit has a plurality of the models at both positions of the position moved in one direction in the circumferential direction of the article and the position moved in the other direction with respect to the position in the circumferential direction of the model first acquired. To get,
The all-around image generation device according to claim 1 or 2, wherein the storage unit performs the matching process using a plurality of the models.
前記モデル取得部は、前記モデルの周方向の位置が、他の前記モデルとの間に前記部分画像が蓄積されていない空の領域を挟むように複数の前記モデルを取得し、
前記蓄積部は、複数の前記モデルを用いて前記マッチング処理を行うことを特徴とする請求項1または請求項2に記載の全周画像生成装置。
The model acquisition unit acquires a plurality of the models so that the position in the circumferential direction of the model sandwiches an empty region in which the partial image is not accumulated between the model and the other models.
The all-around image generation device according to claim 1 or 2, wherein the storage unit performs the matching process using a plurality of the models.
前記蓄積部は、所定条件を満たすまで前記モデル取得処理と前記蓄積処理とを繰り返しても前記全周画像を完成できなかった場合、前記部分画像が蓄積されていない未蓄積の領域の代表位置を取得し、当該未蓄積の領域の隣の位置に蓄積済みの領域が存在すれば、当該蓄積済みの領域に蓄積されている前記部分画像の取得元である前記撮影画像から前記未蓄積の領域の前記代表位置に対応する位置の前記部分画像を取得して位置情報と対応付けて前記未蓄積の領域に蓄積することを特徴とする請求項1〜請求項4のいずれか一項に記載の全周画像生成装置。 When the whole-circle image cannot be completed even if the model acquisition process and the accumulation process are repeated until a predetermined condition is satisfied, the accumulation unit determines a representative position of an unaccumulated region in which the partial image is not accumulated. If there is an accumulated area at a position next to the unaccumulated area, the unaccumulated area can be obtained from the captured image that is the acquisition source of the partial image accumulated in the accumulated area. The whole according to any one of claims 1 to 4, wherein the partial image of the position corresponding to the representative position is acquired, associated with the position information, and accumulated in the unaccumulated area. Circumferential image generator. 前記全周画像から選択された周方向に位置の異なる複数の画像領域を基に複数のモデルを作成し、当該複数のモデルを周方向の位置情報と対応付けて登録するモデル登録部を更に備えたことを特徴とする請求項1〜5のいずれか一項に記載の全周画像生成装置。 Further provided with a model registration unit that creates a plurality of models based on a plurality of image areas having different positions in the circumferential direction selected from the all-around image and registers the plurality of models in association with the position information in the circumferential direction. The all-around image generation device according to any one of claims 1 to 5, wherein the image is generated. 外面に図柄を有する向き特定対象の物品を撮影した撮影画像に対して、前記モデル登録部が作成した前記モデルを用いてマッチング処理を行って、マッチした類似図柄部の位置情報と当該モデルの位置情報とを基に前記撮影画像中の当該物品の正面位置又は当該物品の周方向の所定位置を特定する位置特定部を更に備えたことを特徴とする請求項6に記載の全周画像生成装置。 Matching processing is performed using the model created by the model registration unit on a photographed image of an article to be oriented and an object having a symbol on the outer surface, and the position information of the matched similar symbol portion and the position of the model are performed. The all-around image generation device according to claim 6, further comprising a position specifying portion for specifying a front position of the article or a predetermined position in the circumferential direction of the article based on the information. .. 前記全周画像から周方向の部分画像である良品画像を全周分に相当する複数生成する良品画像生成部と、
検査対象の物品の欠点の有無を検査する検査部と、
検査対象の前記物品を撮影した前記撮影画像中の当該物品の正面位置を特定する位置特定部とを更に備え、
前記検査部は、前記撮影画像中の検査画像と、前記位置特定部が特定した前記正面位置に対応する前記良品画像とを比較した比較結果を基に前記物品の欠点の有無を検査することを特徴とする請求項1〜6のいずれか一項に記載の全周画像生成装置。
A non-defective image generation unit that generates a plurality of non-defective images that are partial images in the circumferential direction from the all-around image corresponding to the entire circumference.
The inspection department that inspects the items to be inspected for defects and
Further provided with a position specifying portion for specifying the front position of the article in the photographed image obtained by photographing the article to be inspected.
The inspection unit inspects the presence or absence of defects in the article based on the comparison result of comparing the inspection image in the captured image with the good product image corresponding to the front position specified by the position specifying unit. The all-around image generator according to any one of claims 1 to 6.
前記物品は、外面にラベルが付され、
前記検査部は、前記ラベルの欠点を検査することを特徴とする請求項8に記載の全周画像生成装置。
The article is labeled on the outer surface and
The all-around image generation device according to claim 8, wherein the inspection unit inspects defects of the label.
良品の物品を撮影して得た部分画像を収集して周方向の位置情報と対応付けた全周画像を生成する全周画像生成方法であって、
物品を撮影して得た撮影画像を順次取得する画像取得ステップと、
前記画像取得ステップで取得した一の前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得ステップと、
前記画像取得ステップで前記モデルの取得元の前記撮影画像の後に取得した後の撮影画像に対して前記モデルを用いたマッチング処理を行い、マッチすれば当該マッチした位置の位置情報と前記モデルの位置情報とを基に前記物品の正面位置を割り出し、前記後の撮影画像中の前記物品の前記正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積し、マッチしなければ次の撮影画像に移行する蓄積処理を行う蓄積ステップとを備え、
前記マッチしたときの前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得する前記モデル取得ステップと、少なくとも最新の前記モデルを用いて行う前記マッチング処理を含む前記蓄積処理を行う前記蓄積ステップとを、周方向の位置情報と対応付けた部分画像を少なくとも全周分に相当する複数収集するまで繰り返して前記全周画像を生成することを特徴とする全周画像生成方法。
It is an all-around image generation method that collects partial images obtained by photographing a non-defective article and generates an all-around image associated with position information in the circumferential direction.
An image acquisition step for sequentially acquiring captured images obtained by photographing an article, and
A model acquisition step of acquiring a model based on a predetermined area of a part of the article in the photographed image acquired in the image acquisition step, and a model acquisition step.
In the image acquisition step, matching processing using the model is performed on the captured image acquired after the captured image of the acquisition source of the model, and if there is a match, the position information of the matched position and the position of the model are performed. The front position of the article is determined based on the information, and the partial image of the article at the front position in the later captured image is stored in the storage unit in association with the position information in the circumferential direction. It is equipped with a storage step that performs storage processing to transfer to the captured image of.
The accumulation process including the model acquisition step of acquiring a model based on a predetermined area of a part of the article in the captured image at the time of matching and the matching process performed using at least the latest model is performed. A method for generating an all-around image, which comprises repeating the accumulation step until a plurality of partial images associated with position information in the circumferential direction are collected, corresponding to at least all the circumferences, to generate the all-around image.
JP2017240000A 2017-12-14 2017-12-14 All-around image generator and all-around image generation method Active JP6975423B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017240000A JP6975423B2 (en) 2017-12-14 2017-12-14 All-around image generator and all-around image generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017240000A JP6975423B2 (en) 2017-12-14 2017-12-14 All-around image generator and all-around image generation method

Publications (2)

Publication Number Publication Date
JP2019105611A JP2019105611A (en) 2019-06-27
JP6975423B2 true JP6975423B2 (en) 2021-12-01

Family

ID=67061170

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017240000A Active JP6975423B2 (en) 2017-12-14 2017-12-14 All-around image generator and all-around image generation method

Country Status (1)

Country Link
JP (1) JP6975423B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7182273B2 (en) * 2019-02-21 2022-12-02 キリンテクノシステム株式会社 Label inspection method and inspection device
JP7501093B2 (en) 2020-05-19 2024-06-18 株式会社ジェイテクト Flaw detection device and flaw detection method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0746222B2 (en) * 1989-09-12 1995-05-17 東洋製罐株式会社 Pre-printing method for taper drawing material
JPH05164706A (en) * 1991-12-17 1993-06-29 Kuwabara Yasunaga Inspecting method for mixing-in of vessel of different kind
JPH0624424A (en) * 1992-07-02 1994-02-01 Kuwabara Yasunaga Facing/p0sitioning method for container
JP4907330B2 (en) * 2006-12-20 2012-03-28 日本電産トーソク株式会社 Cylindrical appearance inspection method
JP5279017B2 (en) * 2008-12-02 2013-09-04 国立大学法人 東京大学 Imaging apparatus and imaging method
JP6693732B2 (en) * 2015-12-04 2020-05-13 株式会社エヌテック Container orientation detection device, container processing device, and container orientation detection method

Also Published As

Publication number Publication date
JP2019105611A (en) 2019-06-27

Similar Documents

Publication Publication Date Title
JP6630545B2 (en) Positioning method, positioning device, program, and computer-readable recording medium
JP7329143B2 (en) Systems and methods for segmentation of transparent objects using polarization cues
US20180012346A1 (en) Portable composable machine vision system for identifying projectiles
JP2019105610A (en) Distorted image inspection device and distorted image inspection method
JP2017100796A (en) Container orientation detection device, container processing apparatus and container orientation detection method
JP2003211096A (en) Sorting/array apparatus of article
JPH03210679A (en) Method and device for pattern matching
JP6975423B2 (en) All-around image generator and all-around image generation method
JP2009031060A (en) Visual examination device and image processing method thereof
JPWO2015008732A1 (en) Optical character recognition device
CN111739003B (en) Machine vision method for appearance detection
JP2005509855A (en) Method and apparatus for selecting containers among others
JPH0624424A (en) Facing/p0sitioning method for container
CN102713580B (en) Appearance inspection device
CN114674830A (en) Bottle cap flaw detection module on high-speed production line
CN115601245B (en) Shadow eliminating device and method, empty disc identifying device and method
JP4345148B2 (en) Rice grain quality discrimination device
CN110596118A (en) Print pattern detection method and print pattern detection device
JPH06174649A (en) Inspection apparatus of inside and outside of can
JP3316400B2 (en) Container inspection by field programmable array logic
JP2001041895A5 (en)
JPH07332951A (en) Apparatus and method for inspecting image
JP2005098832A (en) Specimen inspection apparatus
JP6359363B2 (en) Container inspection device and container inspection method
CN115601735B (en) Empty disc recognition device and method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201030

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210813

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20211027

R150 Certificate of patent or registration of utility model

Ref document number: 6975423

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150