JP2019105611A - Whole circumference image generation device and whole circumference image generation method - Google Patents

Whole circumference image generation device and whole circumference image generation method Download PDF

Info

Publication number
JP2019105611A
JP2019105611A JP2017240000A JP2017240000A JP2019105611A JP 2019105611 A JP2019105611 A JP 2019105611A JP 2017240000 A JP2017240000 A JP 2017240000A JP 2017240000 A JP2017240000 A JP 2017240000A JP 2019105611 A JP2019105611 A JP 2019105611A
Authority
JP
Japan
Prior art keywords
image
model
article
container
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2017240000A
Other languages
Japanese (ja)
Other versions
JP6975423B2 (en
Inventor
和見 坂野
Kazumi Sakano
和見 坂野
孝 西田
Takashi Nishida
孝 西田
裕行 木部
Hiroyuki Kibe
裕行 木部
邦光 豊島
Kunimitsu Toyoshima
邦光 豊島
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
Toho Shoji KK
Original Assignee
N Tech KK
Yakult Honsha Co Ltd
Toho Shoji 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, Toho Shoji 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

Abstract

To provide a whole circumference image generation device and a whole circumference image generation method capable of relatively easily generating a whole circumference image made to correspond to circumference-directional position information on an article.SOLUTION: In a label inspection device, an image acquisition processing part acquires photographic images of a container one after another (S11). A model acquisition part acquires a model based upon a pat of a container in a first photographic image (S13). A storage part performs matching processing using the model on a next photographic image, finds a front position of the container based upon the position information of a matching position and the position of the model when the match is obtained, stores the partial image at the front position of the container in the next photographic image in a memory part associatively with the position information (S14-S19). Then a model acquisition part repeats processing to acquire a model based upon a part of the container in a matching photographic image and the storage part repeats storage processing to store a partial image through matching processing using at least a latest model (S14-S20).SELECTED DRAWING: Figure 4

Description

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

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

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

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

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

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

以下、上記課題を解決するための手段及びその作用効果について記載する。
上記課題を解決する全周画像生成装置は、良品の物品を撮影して得た部分画像を収集して周方向の位置情報と対応付けた全周画像を生成する全周画像生成装置であって、物品を撮影して得た撮影画像を順次取得する画像取得部と、前記画像取得部が取得した一の前記撮影画像中の前記物品の正面位置を基準位置に設定し、当該物品の当該正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積する蓄積部と、前記画像取得部が取得した一の前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得部とを備え、前記蓄積部は、前記画像取得部が前記モデルの取得元の前記撮影画像の後に取得した後の撮影画像に対して前記モデルを用いたマッチング処理を行い、マッチすれば当該マッチした位置の位置情報と前記モデルの位置情報とを基に前記物品の正面位置を割り出し、前記後の撮影画像中の前記物品の前記正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積し、マッチしなければ次の撮影画像に移行する蓄積処理を行い、前記モデル取得部が、前記マッチしたときの前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得処理と、前記蓄積部が、少なくとも最新の前記モデルを用いて行う前記マッチング処理を含む前記蓄積処理とを、周方向の位置情報と対応付けた部分画像を少なくとも全周分に相当する複数収集するまで繰り返して前記全周画像を生成する。この構成によれば、物品の周方向の位置情報に対応付けられた全周画像を比較的簡単に生成することができる。
Hereinafter, the means for solving the above-mentioned subject and its operation effect are described.
An all-round image generating device that solves the above-mentioned problem is a all-round image generating device that collects partial images obtained by photographing non-defective articles and generates an all-round image correlated with position information in the circumferential direction. An image acquisition unit for sequentially acquiring a photographed image obtained by photographing an article; and setting a front position of the article in one of the photographed images acquired by the image acquisition unit as a reference position; A storage unit that associates a partial image at a position with circumferential position information and stores the image in a storage unit, and a model based on a predetermined region of a part of the article in the one captured image acquired by the image acquisition unit A model acquisition unit for acquiring, the storage unit performs a matching process using the model on a captured image after the image acquisition unit has acquired the captured image after the acquisition source of the model; Position of the matching position The front position of the article based on the information and the position information of the model, and the partial image at the front position of the article in the subsequent captured image is stored in the storage unit in association with circumferential position information; If they do not match, storage processing is performed to shift to the next captured image, and the model acquisition unit acquires a model based on a predetermined region of a part of the article in the captured image at the time of the match. A plurality of partial images in which processing and the storage processing including the matching processing performed using at least the latest model, the partial processing associated with position information in the circumferential direction are collected at least corresponding to the entire circumference The above-mentioned all-round image is generated repeatedly. According to this configuration, it is possible to relatively easily generate the entire circumference image associated with the position information of the article in the circumferential direction.

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

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

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

上記全周画像生成装置では、前記モデル取得部は、前記モデルの周方向の位置が、他の前記モデルとの間に前記部分画像が蓄積されていない空の領域を挟むように複数の前記モデルを取得し、前記蓄積部は、複数の前記モデルを用いて前記マッチング処理を行うことが好ましい。この構成によれば、モデルの周方向の位置が、他のモデルとの間に部分画像が蓄積されていない空の領域を挟む位置にある複数のモデルを用いてマッチング処理が行われるので、位置情報に対応付けられた全周画像を比較的高速に生成できる。   In the all-around image generation device, the model acquisition unit may set a plurality of the models such that positions in the circumferential direction of the model sandwich an empty area in which the partial image is not accumulated between the model and another model. Preferably, 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 in which positions in the circumferential direction of the model sandwich the empty region where partial images are not stored between other models. An all-round image associated with information can be generated relatively quickly.

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

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

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

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

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

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

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

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

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

(第1実施形態)
以下、全周画像生成装置を具体化した第1実施形態としてのラベル検査装置について、図面を参照して説明する。
First Embodiment
Hereinafter, a label inspection device as a first embodiment in which an all-round image generation device is embodied 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 apparatus 11 shown in FIG. 1 photographs the container 20 as an example of the article shown in FIG. 2 which is placed on the conveyor 13 constituting the conveyance apparatus 12 as an example of the conveyance section and is conveyed. The label 22 attached to the outer peripheral surface 21 of the container 20 is inspected to inspect the presence or absence of the defect of the label 22. The inspection contents include defects (defective points) such as tearing of the label 22, adhesion of foreign matter, contamination, and label contraction failure. The label inspection apparatus 11 also inspects positional 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 according to the present embodiment generates an all-round image AG (see FIG. 14) of the label 22 attached to the container 20 by using a plurality of photographed images SG (FIG. 6, FIG. 11, etc.). By including the circumferential image generation unit 62 (see FIG. 3), the image processing apparatus functions as an all-round image generation device. The all around image AG is used to create each data of the model M (FIG. 15) and the non-defective item 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 conveying device 12 shown in FIG. 1 conveys the container 20 to which the label 22 (shrink label) is attached to the outer peripheral surface 21 of the container 20 by a not-shown shrinker installed on the upstream side of the conveyor 13. The label 22 is attached in a state of being thermally shrunk and in close contact with the outer surface of the container 20 by being heated through a heating tunnel (not shown). The transport device 12 is provided with a known timing screw at a position upstream of the conveyor 13 and downstream of the insulin collector, and the container 20 is carried into the conveyor 13 with a predetermined interval in the transport direction X opened by the timing screw. Be done. The conveyor 13 is driven by the power of an electric motor, which is a power source of the conveyance device 12, and conveys the plurality of containers 20 at a predetermined conveyance speed with a predetermined interval. The containers 20 placed on the conveyor 13 are transported in any direction. If there is concern that the container 20 on the conveyor 13 may fall, the conveyor 13 is provided with a suction hole (not shown) for suctioning the bottom surface of the container 20, and the container 20 is subjected to negative pressure by the suction device. It is preferable to make it adsorb to 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 generates an all-round image AG of the label 22 using the imaging device 30 for imaging the container 20 and the captured image obtained by imaging the container 20 by the imaging device 30. The controller 40 is provided with a generation process and an inspection process for inspecting the label 22. Further, the controller 40 creates the model M and the non-defective item image RG used for the inspection of the label 22 using the all-round image AG. The controller 40 also controls the conveyance device 12 and the imaging 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 device 30 photographs a plurality of containers 20 located at a predetermined photographing position located halfway along the conveyance path of the conveyor 13 from a plurality of directions (four directions in the example shown in FIG. 1). The camera 31 includes (for example, four) cameras 31 and an illumination device 32 for illuminating the container 20 to be photographed. The four cameras 31 shown in FIG. 1 are arranged at four positions shifted by about 90 degrees in the circumferential direction of the container 20 at the imaging position in plan view in the same drawing. The height position of each camera 31 is adjusted to the height of the label 22 of the container 20 transported on the conveyor 13. The camera 31 includes an optical system such as a lens and an imaging device such as a two-dimensional image sensor (such as a CCD imaging device or a CMOS imaging device).

図1に示す照明機器32は、容器20を照明した光の正反射光がカメラ31に直接進入しない位置に配置されている。照明機器32は、例えば、容器20に対して斜め上方位置または斜め下方位置から容器20を照明する。照明機器32は、例えば白色光源であるが、ラベル22を検査可能であれば白色以外の他の色の光源を用いてもよい。   The illumination device 32 shown in FIG. 1 is disposed at a position where the specular reflection light of the light illuminating the container 20 does not directly enter the camera 31. The lighting apparatus 32 illuminates the container 20 from, for example, an obliquely upper position or an obliquely lower position with respect to the container 20. The lighting device 32 is, for example, a white light source, but light sources of colors 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 imaging position. The controller 40 instructs the four cameras 31 to perform imaging operations 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 the four directions substantially simultaneously. Therefore, an image of the label 22 around the entire side surface of the container 20 is 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. Image data output from each camera 31 is input to the controller 40. The number of cameras 31 may be plural (for example, three or five) other than four, or may be one, as long as the configuration is capable of capturing the entire circumference of the container 20. For example, if the container 20 is configured to rotate (rotation) at least one rotation, or if the camera 31 is configured to rotate (revolution) with respect to the container 20, the entire circumference of the container 20 can be photographed even with one camera 31. . Further, in FIG. 1, the two cameras 31 arranged on both sides of the conveyance path of the conveyor 13 are disposed at different positions in the conveyance direction X, and the two cameras 31 have the containers 20 at different timings. It may be configured to shoot the

図2に示す容器20は、一例として略円筒形状のプラスチック容器からなり、その外周面21にラベル22が付されている。ラベル22は、容器20に対して高さ方向Zにおける所定の高さ範囲に付されている。ラベル22には、その全周に亘り図柄23が描かれている。図2に示す例では、アルファベットの大文字「A,B,C,…,H」の8文字を横に1列に並べた図柄23としている。なお、図2では、説明を簡単にするため簡略な図柄の例としているが、通常、ラベル22の図柄23には、製造会社・商品名あるいはロゴマーク等の図柄部や、商品原料・保存法・製造工場等の品質詳細等の文字列が枠で囲まれた図柄部、バーコードが枠で囲まれた図柄部、イラストやデザイン(図案)等の図柄部のうち1つ又は複数が含まれる。   The container 20 shown in FIG. 2 is, for example, 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 the container 20 at a predetermined height range in the height direction Z. A symbol 23 is drawn on the entire circumference of the label 22. In the example shown in FIG. 2, eight letters of upper case letters "A, B, C,..., H" of the alphabet are arranged in a line in a row. In addition, in FIG. 2, although it is set as an example of a simple symbol to simplify description, usually, the symbol 23 of the label 22 is a symbol such as a manufacturing company, a brand name or a logo mark, a commodity material / storage method -Includes one or more of a symbol part surrounded by a character string such as quality details of a manufacturing plant etc., a symbol part surrounded by a bar code, a symbol part such as an illustration or design (design) .

次に、図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, an electrical configuration and a 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 apparatus 11 incorporates a computer 50 composed of a chipset or the like mounted on a circuit board. Further, to the controller 40, the conveyance device 12, the camera 31 and the illumination device 32, which constitute the photographing device 30, the container sensor 33, the input device 41, and the display unit 42 are electrically connected. The controller 40 drives and controls the conveyor 13 at a constant speed by driving and controlling an electric motor (not shown), which is a power source of the conveyance device 12, and conveys the container 20 at a predetermined conveyance speed. Further, based on the instruction signal input from the input device 41, the controller 40 performs each process for generation of the all-round image AG, registration of the model M, generation of the non-defective item image RG, and label inspection. Further, the controller 40 performs display control to cause the display unit 42 to display an all-round image generation progress screen SC1 (FIG. 13), a model registration screen, a label inspection result notification screen (all not shown), and the like. 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 is configured by a personal computer (PC), and the input device 41 is connected by a mouse and a keyboard connected to the PC. , And the display unit 42 may be configured by a 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 incorporates a CPU 51 (central processing unit) and a storage unit 52. The storage unit 52 is configured of a storage area of a hard disk, a non-volatile memory, or part of a RAM. The storage unit 52 includes an all-round image generation processing program (FIG. 4) for the CPU 51 to execute, a model registration processing program (FIG. 17), a non-defective image generation processing program (not shown) and a label inspection processing program A program PR including (FIG. 18) and the like is stored. The storage unit 52 also stores model data MD (see also FIG. 15), non-defective item image data GD (see also FIG. 16), feature image data FD and the like used in label inspection processing. In the present embodiment, the model data MD and the non-defective item image data GD are created based on the all-round image data. In addition, the feature image data FD is created based on the non-defective item 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 is used as a storage area (storage area) to be used in the all-round image generation process, including the position storage unit 53, the first storage unit 54, the second storage unit 55, and the third storage unit. 56 is provided. The three storage units 53 to 55 are used to store data to be held in the process of the all-round image generation process, and the third storage unit 56 is an all-round image AG (FIG. 14) generated in the all-round image generation process. It is used to store image data. Each of the storage units 53 to 56 is configured by a predetermined storage area of a non-volatile memory or a RAM capable of rewriting data. In addition, the detail of each storage part 53-56 is mentioned later.

図3に示すコンピュータ50は、CPU51がプログラムPRを実行することにより全周画像生成処理およびラベル検査処理などを行う。CPU51はプログラムPRを実行することで、図3に示された、制御部61、全周画像生成部62、モデル登録部63、良品画像生成部64、特徴画像生成部65および検査部66として機能する。   The computer 50 illustrated in FIG. 3 performs an all-round image generation process, a label inspection process, and the like by the CPU 51 executing the program PR. The CPU 51 executes the program PR to function as the control unit 61, the all-round image generation unit 62, the model registration unit 63, the non-defective image generation unit 64, the feature image generation unit 65 and the inspection unit 66 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, an accumulation unit 73, and an angle correction unit 74. The storage unit 73 includes a matching processing unit 75. The inspection unit 66 further 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 illustrated in FIG. 3 is responsible for the entire control of the label inspection apparatus 11, and instructs each of the units 62 to 66 to perform predetermined processing and the like. Further, the control unit 61 performs setting of necessary data and reception of various instructions based on an operation signal from the input device 41 operated by the worker. The control unit 61 receives, for example, an instruction for an all-round image generation process, an instruction for a model registration process, and an instruction for a label inspection. The control unit 61 also controls the photographing operation of the camera 31 based on the detection signal of the container sensor 33. Furthermore, the control unit 61 performs display control to cause the display unit 42 to display various screens.

次に、図3に示す全周画像生成部62について説明する。画像取得処理部71は、カメラ31が撮影した撮影画像(画像データ)を取り込んで取得する処理を行う。画像取得処理部71は、4つのカメラ31から良品の容器20を4方向から撮影した4つの撮影画像を取得する。画像取得処理部71は、画像中の容器20の位置を把握して容器20が中央に位置する所定領域の画像を撮影画像として取得する。なお、本実施形態では、撮影装置30および画像取得処理部71により、画像取得部の一例が構成される。   Next, the all-round image generation unit 62 shown in FIG. 3 will be described. The image acquisition processing unit 71 performs processing for capturing and acquiring a captured image (image data) captured by the camera 31. The image acquisition processing unit 71 acquires four photographed 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 area in which the container 20 is positioned at the center as a photographed image. In the present embodiment, the imaging device 30 and the image acquisition processing unit 71 constitute an example of an 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 part of the image MG in a range of a predetermined angle in front of the container 20 in the captured image is acquired, and the features of the part of the image MG are extracted to acquire the model MF. As shown in FIG. 6, the model acquisition unit 72 acquires a part of the image MG in the front of the container 20 in the captured image SG, and extracts the feature (shape or brightness) of the part of the image MG. Get model MF. In the present embodiment, in order to use the pattern 23 of the label 22 of the container 20, a part of the image MG is an image including the front portion of the label 22. The width angle of a part of the image MG is a predetermined value within the range of 20 to 60 degrees, and is 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 feature is different depending on the position of the container 20 in the circumferential direction, a portion other than the label 22 in the container 20 may be used as the model MF.

蓄積部73は、全周画像生成処理時に撮影画像における容器20の周方向の位置である正面位置を特定して撮影画像から容器20の正面に位置する部分画像PGを切り出し、部分画像PGを位置情報と対応付けて全周分蓄積する処理を行う。蓄積部73は、撮影画像中の容器20の正面位置を特定する際に用いられるマッチング処理部75を備える。マッチング処理部75は、逐次取得する撮影画像(他の撮影画像)に特徴を抽出する処理を施して撮影特徴画像を取得し、その撮影特徴画像に対してモデルMFを用いてその図柄に類似する類似図柄部AM(図7(a))を探索するマッチング処理を行う。   The accumulation unit 73 specifies a front position, which is a position in the circumferential direction of the container 20 in the captured image during the entire circumference image generation processing, cuts out a partial image PG located in front of the container 20 from the captured image, and locates the partial image PG A process of accumulating data for all rounds in association with information is performed. The accumulation unit 73 includes a matching processing unit 75 used when specifying the front position of the container 20 in the photographed image. The matching processing unit 75 performs processing for extracting features to the captured image (another captured image) sequentially acquired to obtain a captured feature image, and the model MF is used for the captured 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 accumulation process performed by the accumulation unit 73 will be described with reference to FIGS. As illustrated in FIG. 5, the all-round image generation unit 62 generates an image of the whole circumference of 0 to 360 degrees in which the label 22 is panoramically expanded. The storage unit 73 cuts out a partial image PG at the front position C0 of the container 20 (particularly in this example, the label 22) from the captured image SG shown in FIG. 6 etc. sequentially acquired, and collects a plurality of partial images PG By doing this, 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 accumulation unit 73 obtains a partial image PG indicated by a two-dot chain 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 value WP of, for example, a predetermined value (for example, 20 degrees) within a range of 10 to 30 degrees with respect to a representative angle RK (for example, 0 degrees) described later. First, in order to set the front position C0 (front angle) to the representative angle RK = 0 degrees, the accumulation unit 73 acquires a partial image PG of the 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 accumulation unit 73 collects a total of J partial images PG at each position (representative angle RK shown in FIG. 9) in 360 / J-degrees where the 360 ° of the entire circumference of the container 20 is divided by J. In this example, a total of 36 partial images PG are collected at every 10 degree position where 360 degrees is divided into 36 parts. In this case, a partial image PG of the width angle WP shown in FIG. 6 is obtained by adding an angle width of ± γ degrees on both sides in the circumferential direction to 10 degrees of width angle obtained by dividing 360 degrees into 36. γ is, for example, a value within the range of 0 to 10 degrees, and in this example, γ is set to 5 degrees. The accumulation unit 73 acquires, as a partial image PG, an area of the label 22 in a range in which the width angle WP is 20 degrees around the center position C0 in the front of the container 20 in the first captured image SG (FIG. 6). The storage unit 73 sets the front position of the container 20 in the first captured image SG (FIG. 6) to the reference position (temporary 0 degree) (see FIG. 5), and advances the subsequent storage processing. When the container 20 is photographed with the camera 31, a photographed image can be obtained at an angle of view near 170 degrees, but since both sides of the container 20 are photographed with the pattern 23 largely distorted, the photographed image SG An image in which the width angle of the container 20 is in a range of, for example, 90 to 170 degrees and which has a predetermined value (for example, 110 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 a matching process 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 photographed feature image in which the next photographed image SG is feature-extracted to change the position of the symbol part to be compared. Find the score of similarity with. If the score of the degree of similarity exceeds a predetermined threshold, the score of the degree of similarity and the position information of the similar pattern portion are temporarily stored in the storage unit 52. Then, when the search processing is finished, the matching processing unit 75 determines that the similar symbol portion AM having the highest score of similarity is matched. In the example shown in FIG. 7A, 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 a detection position C1 indicated by position coordinates in the circumferential direction of the similar symbol portion AM matched in the matching process, and detects the detection position C1 and a registered position Cm of the model MF used in the matching process The calculation using the geometrical relationship shown in FIG. 8 is performed on the basis of the reference position which is 0 degree of) to specify the front position C0 (front angle θc) of the container 20 in the captured image SG. The accumulation 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 captured image SG shown in FIG. 7B. . The contents of calculation 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, three storage units 53 to 55 used by the storage unit 73 in the storage process will be described with reference to FIG. The position storage unit 53 is J (36 in this example) corresponding to the representative angles RK = 0 degrees, 10 degrees, 20 degrees,..., 360 degrees obtained by dividing the entire circumference 360 degrees into J (36 in this example). The storage unit AK of The storage unit AK is reset to an initial value (for example, "99") prior to the start of the all around image generation process. A front angle θc at which the front position C0 of the partial image PG is indicated by an angle based on the reference position (temporary 0 degree) belongs to a region of any one of the J representative angles RK and a region to which the front angle θc belongs In the storage portion AK of the representative angle RK, an error between the representative angle RK and the front angle θc is stored. When the representative angle RK in steps of 10 degrees is 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 The storage unit AK of the representative angle RKi stores a value corresponding to an error between the representative angle RKi and the front angle θc. 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 (temporary 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 storage portion PK stores image data of a partial image PG whose center is the width of the representative angle RK. Further, the second storage unit 55 includes J storage units QK corresponding to the representative angle RK. In the storage unit QK, image data of a captured image SG which is a cutout 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 representative of the photographed image SG of the front angle defined by the representative angle RK and the error. A partial image PG in which a predetermined region centered at the angle RK is cut out 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 degrees”, the representative angle RK is stored in the storage unit PK of the representative angle RK. And a partial image PG cut out from the photographed image SG having a front angle θc of “0 degree” without any error. Further, since “2” is stored in the storage unit AK of which the representative angle RK is “20 degrees”, the storage angle PK of the representative angle RK has a front angle with an error of 2 degrees from the representative angle RK. A partial image PG whose width center is 20 degrees of the representative angle RK is stored from the photographed image SG of “22 degrees”. Then, the storage unit 73 sequentially stores the partial images PG in the respective storage units PK, and finally the partial images PG for the entire circumference of the label 22 are 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 with a front angle "0 degree" and a width angle of 20 degrees, and a representative angle of 20 degrees from the photographed image SG with a front angle of 22 degrees. And a partial image PG obtained by cutting out a predetermined area having a width angle of 20 degrees with the width center as the center. In the first storage unit 54, the partial image PG is stored so as to overlap the adjacent partial image PG by an angle width of γ degrees (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 current captured image SG to obtain a model MF, and the previous model MF is updated to a new model MF shown in FIG. . Then, similarly, as shown in FIG. 12A, the captured image SG is calculated by using a geometrical relationship based on the positional information of the similar symbol portion AM matched in the matching process and the positional information of the model MF. The front position C0 (front angle θc) of the container 20 inside is acquired, and a partial image PG of the label 22 centered on the representative angle RK of the container 20 is acquired from the photographed 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. Thereafter, by repeating the same storage processing, partial images PG shown by two-dot chain lines in FIG. 10 are sequentially stored in the first storage unit 54 shown in FIG. Partial images PG (36 sheets in this example) 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 with respect to the representative angle RK is known from the value stored in the position storage unit 53, the representative angle RK is obtained even if a value other than the initial value is already stored in the storage unit AK. It is preferable to capture the partial image PG from the photographed image SG, if the photographed image SG having a front angle θc smaller than the error of is obtained. Therefore, if a captured image SG having a smaller front angle θc with respect to the representative angle RK is obtained, the partial image PG cut out from the captured image SG is replaced with the partial image PG previously stored in the first storage unit 54. Update Thus, the storage unit 73 sequentially updates the partial images PG while updating to the partial images PG with a smaller error from the representative angle RK, thereby enhancing the accuracy of the generated all-round image AG.

図3に戻って、モデル登録部63は、全周画像生成部62が生成した全周画像AGから作業者が入力装置41を操作して選択した複数の画像領域を基に複数のモデルMを作成し、これら複数のモデルMを含むモデルデータMDを記憶部52の所定記憶領域に書き込むことで登録する。   Returning to FIG. 3, the model registration unit 63 selects a plurality of models M based on a plurality of image areas selected by the operator operating the input device 41 from the all-round image AG generated by the all-round image generation unit 62. The model data MD including the plurality of models M is created and registered by writing in 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でもよい。   The non-defective item image generation unit 64 shown in FIG. 3 generates non-defective item image data GD including a plurality of non-defective item images RG used in comparison processing at the time of inspection. The non-defective image generation unit 64 generates a predetermined width angle (for example, 90 to 150 degrees (for example, 10 degrees) per angle (for example, 10 degrees) obtained by dividing 1 round into m (for example, 36 divisions) based on the image data of the entire circumference image AG. Non-defective images RG0 to RG35 shown in FIG. 16 consisting of partial images of 110 degrees) are generated. The non-defective images RG0 to RG35 are associated with positional information of the container 20 in the circumferential direction. The division number m for determining the number of non-defective images RG is not limited to m = 36, and can be changed as appropriate. For example, m may be 12, 18, 24, 72, 120.

さらに、図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 obtained by photographing 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 characteristic images FG <b> 0 to FG <b> 35 are associated with positional information of the container 20 in the circumferential direction.

次に、図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 and captured by the camera 31 with the container 20 to be inspected with the non-defective item image RG stored in advance, and sets the defect FT of the label 22 (both in FIG. Perform label inspection processing to check the presence or absence of

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

位置特定部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 specifies a front position that is a 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, which faces the camera 31 at the time of photographing, as a predetermined angle in the circumferential direction of the label 22 (see FIG. 5). The position specifying unit 82 performs a position specifying process of specifying the front position of the container 20 in the captured image SG using the model M shown in FIG. The position specifying unit 82 in this example performs an omni-matching process for searching for a similar pattern portion similar to the model M from the patterns 23 of the label 22 in the captured image using a plurality of models M, and performs the search The front position of the captured image SG is specified based on the position information of the similar symbol part 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 displacement (height displacement) of the position in the height direction Z where the label 22 is attached to the container 20. The label height inspection unit 83 of this example registers the position in the height direction Z of the similar pattern portion similar to the model M specified by the position specifying unit 82 in the omni-matching process, and registers the model M in the height direction Z The presence or absence of positional deviation (height deviation) in the height direction Z of the label 22 is inspected from the difference from the position (height deviation). In addition, the imaging | photography area of the camera 31 is set as the known predetermined height from the upper surface of the conveyor 13 in which the container 20 is mounted.

検出部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 a matching process on the captured image SG using the feature image FG corresponding to the front position identified by the position identification unit 82, and acquires a matched region as an inspection image KG. In this example, an image in a partial region including the label 22 in the captured image SG is acquired as an inspection image KG (see FIG. 19). The detection unit 84 detects the defect FT of the label 22 based on the comparison result of the inspection image KG and the non-defective item image RG. The comparison processing unit 85 performs comparison processing for comparing the inspection image KG and the non-defective product image RG, obtains the difference between the inspection image KG and the non-defective product image RG as a comparison result, and acquires a difference image DG (see FIG. 19). . Then, the determination unit 86 determines the presence or absence of the defect FT of the label 22 based on the difference image DG. Here, the defects FT include tears on the label 22, adhesion of foreign matter, stains (not shown), and the like.

次に、ラベル検査装置11の作用を説明する。コンピュータ50がプログラムPRを実行することで行われる全周画像生成処理を、図4に示すフローチャートを参照して説明する。   Next, the operation of the label inspection device 11 will be described. The all-round image generation processing 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 an all-round image generation process shown by the flowchart in FIG. Before executing this process, the CPU 51 initializes 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 an 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 acquires image data obtained by photographing the container 20. In this example, the image data of the photographed image SG of the entire circumference (four) taken by the four cameras 31 from 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 photographed image to a reference position (for example, 0 degrees). Further, as shown in FIG. 6, a partial image PG at the front position of the container 20 in the captured image SG is acquired. The CPU 51 stores the difference 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 storage unit QK of 0 degrees. The photographed 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 partial region of the front of the container 20 in the image is cut out, and feature extraction is performed on the partial image to create a model MF. In this example, as shown in FIG. 6, the model MF is a range including at least a part of the label 22 in the height direction Z at a predetermined angle (for example, 45 degrees) range in the front of the container 20 in the captured image SG. The image MG of is used. In the model MF, the registration position 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 and performs a matching process after position correction. That is, the matching processing unit 75 performs a matching process on the next captured image to search for similar symbol parts using the model MF. In the matching process, the matching process is performed while moving a pattern area of the comparison object to be compared with the model MF little by little in the processing target area, and a similar pattern portion having a score of similarity with the model MF equal to or more than a threshold is searched Do.

ステップS15では、CPU51は、マッチング処理でマッチできたか否かを判断する。マッチしなければステップS14に戻り、次の撮影画像を読み込んでモデルMFを用いて類似図柄部を探索するマッチング処理を行う。一方、マッチすればステップS16に進む。   In step S15, the CPU 51 determines whether or not the matching process can match. If it does not 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 part using the model MF. On the other hand, if it matches, it will progress 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 the front position is performed as follows. When one similar symbol portion is determined, a model registration position Cm (coordinates of a front angle of the model M) shown in FIG. 8 of the model MF used at that time is acquired. Furthermore, the CPU 51 calculates the front position C0 (front angle θc) of the container 20 in the captured image using the model registration position Cm and a known value such as the container width view 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 ((C 0-Cm) / r))) 180 / pi ... (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 at which a similar symbol 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 view angle α and the container view angle width W (see FIG. 8).
r = W / 2 ÷ sin (α / 2) · 180 / π (2)
Thus, the matching processing unit 75 of the storage unit 73 calculates the front angle θc of the container 20 in the photographed image, using the 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 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 has been registered in the storage unit PK which is an area of the representative angle RK to which the front angle θc of this time 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, to thereby obtain the partial image PG in the corresponding storage unit PK. It is judged whether or not is registered. If the representative angle is already registered, the process proceeds to step S18, and if 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 the front position is to be updated. That is, in the present embodiment, in order to manage the circumferential position of the container 20 by an angle, the CPU 51 uses the storage angle AK corresponding to the representative angle RK at this time more than the front angle θc already stored (registered). It is determined whether or not the front angle θc of is closer to the representative angle RK. In this example, since the error with the representative angle RK is stored as the front position information in the storage unit AK, it is determined whether the absolute value of the current error is smaller than the absolute value of the previous error. . The CPU 51 determines that the front position to be updated is the front position to be updated if the current front angle θc is closer to the representative angle RK, and the registered front angle θc is the representative angle RK than the current front angle θc. If it is close, it is judged that it is not the front position which should be updated. If the front position is to be updated, the process proceeds to step S19. If the front position is not 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 a partial image and 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 the corresponding representative angle in the position storage unit 53. The front position information is stored in the storage unit AK of RK. With this storage, the current partial image PG and front position information are registered. In this case, when the front position information has already been registered in the storage unit AK of the corresponding representative angle RK, the registration information is updated to the current partial image PG and the front position information. 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. In addition, in the storage unit QK of the corresponding representative angle RK in the second storage unit 55, the current captured image SG is stored.

ステップ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 features of an image of a predetermined region at a front position of the container 20 in the current captured image SG to create a new model MF, and generates a new model MF of the previous model. Replace with MF. In the present 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 has been completed. If the all-round image AG is not completed, the process returns to step S14, and the generation process (S14 to S21) of the all-round image AG is repeated until it is determined that the all-round image AG is completed in step S21. On the other hand, if the all around image AG is completed, the process proceeds to step S22. In the present 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-round image generation process of repeating the all-round image AG generation process (S14 to S21), the all-round image generation progress screen SC1 shown in FIG. 13 is displayed on the display unit 42. On the screen SC1, an annular progress scale PS is superimposed and displayed on the front surface of the photographed image SG being processed as a background. The progress scale PS is unlearned that the partial image PG has not been stored yet, or the partial image PG is not yet stored for each area corresponding to each representative angle RK divided into 360 (one divided 360 in this example) into 360 degrees. It is displayed in a distinguishable manner by the difference in color whether stored or already learned. In addition, the region of the learned representative angle RK is color-coded stepwise in accordance with the value of the error between the front angle θc of the stored partial image PG and the representative angle RK. For this reason, the worker can confirm the generation progress status and the completion accuracy of the all-around image AG by viewing the progress scale PS. When the unlearned area on the progress scale PS disappears, 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 to perform reinforcement learning. If reinforcement learning is to be performed, the process proceeds to step S23. If reinforcement learning is not performed, the process proceeds to step S24. Here, reinforcement learning is processing that is repeated a plurality of times until reinforcement learning end conditions are satisfied, which is a predetermined condition for ending the generation processing (S14 to S23) of all-round images, to improve the completion accuracy of all-round images AG. .

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

ステップ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 entire circumference image. The operator designates the 0-degree position of the all-round image AG in the computer 50 by operating the input device 41 prior to the start of the all-round image generation process or after the all-round image is completed. The CPU 51 confirms the designated 0 degree position, and sets the angle of the all-round image AG associated with the angle on the basis of the provisional 0 degree position shown in FIG. Correct the angle so that Further, as shown in FIG. 14, the CPU 51 creates the all-round image AG by extending it from the range of 0 to 360 degrees to a predetermined value exceeding 0 to 360 degrees. In this example, the full circumference image AG is extended, for example, to a range of 0 to 540 degrees (one and a half). Here, to create the all-round image AG over a range exceeding 360 degrees, a model registration screen (not shown) is displayed on the display unit 42 at the time of model registration performed by the operator activating the model registration unit 63 thereafter. This is for the purpose of smoothly performing an operation of displaying the entire circumference image AG on the model registration screen and designating a region 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, for example, in the all-around image AG shown in FIG. 14, an area across 0 or 360 degrees between the characters “G” and “H” is It can be specified. In addition, if it is not necessary in particular, all the circumference 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 there is at least one region of the representative angle RK of the sky in which the partial image PG is not stored because the entire-circle image AG can not be completed due to a lack of the captured image SG, etc. The full circumference image AG may be completed by supplementing the partial image of the representative angle RK. That is, even if the model acquisition process and the accumulation process are repeated until the predetermined condition is satisfied, if the all-around image AG can not be completed, the accumulation unit 73 sets the unregistered representative angle RKi in which the partial image PG is not accumulated. get. If there is an area of the registered representative angle RKi + 1 or RKi-1 at a position next to the area of the unregistered representative angle RKi, the photographing which is the acquisition source of the partial image PG accumulated in this adjacent area An image SG is obtained from the storage unit QK of its representative angle RKi + 1 or RKi-1. A partial image PG at a position corresponding to the representative angle RKi of the unregistered area is acquired from the captured image SG, and the acquired partial image PG is associated with position information and accumulated in the empty area of the unregistered representative angle RKi. Do. In this case, the compensated partial image PG has an error (for example, 12 degrees) in which the error between the front angle and the representative angle exceeds a prescribed ± 5 degree. Although the accuracy of the complete circumference image AG completed in this way is partially reduced at the filling point, model registration processing, non-defective image generation processing, container orientation detection processing and inspection performed using the total circumference image AG The process can be performed.

次に、図17を参照してモデル登録処理について説明する。作業者はモデル登録を行う場合、入力装置41を操作してラベル検査装置11にモデル登録処理の開始を指示する。コンピュータ50のCPU51は、指示を受け付けると、図17にフローチャートで示されるモデル登録処理を実行する。   Next, model registration processing will be described with reference to FIG. When the operator performs model registration, the operator operates the input device 41 and instructs the label inspection device 11 to start model registration processing. When receiving the instruction, the CPU 51 of the computer 50 executes model registration processing shown by 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 on the display unit 42 a model registration screen (not shown) including the all around image AG. The operator designates a model area GA (see FIG. 15) which is an image area having a feature to be used as the model M in the all-round 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 is designated. If the model area GA is not specified, the process waits until the model area GA is specified. 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-round image AG is data associated with position information (horizontal coordinate in the container circumferential direction and vertical coordinate in the height direction), position information of the designated model area GA is calculated from the coordinates of the all-round image AG Identified above.

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

また、良品画像生成部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により条件や領域の指定などの比較的簡単な操作を行うだけで済む。   In addition, the non-defective item image generation unit 64 sets a predetermined width angle (for example, 110 degrees) for each angle (for example, 10 degrees) obtained by dividing one round into m (for example, 36 divisions) based on the image data of the entire circumference image AG. The non-defective images RG0 to RG35 shown in FIG. 16 composed of partial images are acquired. Then, the non-defective item image generation unit 64 stores the non-defective item images RG0 to RG35 in the storage unit 52 in association with the circumferential position (front position) of the container 20. The feature image generation unit 65 also extracts features from the non-defective images RG0 to RG35 to generate 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 circumferential position (front position) of the container 20. As described above, since the computer 50 automatically performs creation and registration of the model data MD, the non-defective image data GD and the feature image data FD from the all-around image AG, the operator compares the specification of the condition and the area by the input device 41 You just need to do 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 label inspection processing. The CPU 51 of the computer 50 executes the label inspection process shown by the flowchart in FIG. 18 in a state where the necessary data GD and FD are stored in the storage unit 52. In the storage unit 52, the user operates the input device 41 from the entire circumferential image of the non-defective container 20, and one of the partial images for each angular range of 0 to 360 / N degrees (for example, 45 degrees). The area of the part is registered as models M1 to M8. The models M1 to M8 are feature images (for example, shape images) from which features (shapes or brightness) are extracted, and are associated with circumferential positions (angles) of the container 20 (or label 22).

また、記憶部52には、良品の容器20の周方向に異なる位置(角度)毎の部分画像、又はラベル22の原画(図5参照)を周方向に異なる位置(角度)毎に分割した部分画像である、複数の良品画像RGと、各良品画像RGの特徴が抽出された特徴画像FGとが、周方向の位置(角度)と対応付けられて記憶されている。本実施形態では、複数ずつの良品画像RGおよび特徴画像FGは、良品画像生成部64が、良品の容器20が撮影された複数の画像を基に自動で生成したもの、あるいはラベル22の原画(版下)を分割して生成したものであり、容器20の周方向の位置(角度)と対応付けられている。   In the storage unit 52, partial images at different positions (angles) in the circumferential direction of the non-defective container 20 or portions obtained by dividing the original image of the label 22 (see FIG. 5) at different positions (angles) in the circumferential direction A plurality of non-defective images RG, which are images, and a feature image FG in which the features of each non-defective image RG are extracted are stored in association with positions (angles) in the circumferential direction. In the present embodiment, the non-defective item image RG and the characteristic image FG are generated by the non-defective item image generation unit 64 automatically based on the plurality of images of the non-defective container 20 taken. It is generated by dividing the printing plate) and is associated with the circumferential position (angle) 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 image data of the container 20. That is, the camera 31 acquires image data obtained by photographing the container 20. At this time, image data of the photographed image SG of the entire circumference (four) taken by the four cameras 31 from four directions is acquired. In the following, it is assumed that the photographed image SG has a defect such as breakage or adhesion of a foreign substance or the like 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 specifies the front position of the container in the photographed image. The position specifying unit 82 executes the omni-matching process to specify 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 with respect to the area of the label 22 in the captured image SG obtained by capturing the container 20 to be inspected by the camera 31. In this omni-matching process, the position specifying unit 82 performs a matching process while moving a symbol area to be compared with the model M little by little, and sets a similar pattern part whose score of similarity with the model M is equal to or more than a threshold Explore. Moreover, when the similar symbol part whose score is more than a threshold value is not detected, it changes to the following model M. Thus, while sequentially changing the model M, a matching process is performed to search for similar symbol parts for all the models M1 to M8. In this example, in the position specifying process, the omni matching process may be performed on one of the four captured images SG, or the omni matching process may be performed on all the four captured images SG. When a plurality of similar symbol parts are detected, one similar symbol part having the highest score among them is determined. In the omni-matching process, for example, the matching process may be stopped when a similar symbol portion whose score of similarity exceeds the target value is searched.

ステップ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 comparison processing between the inspection image and the non-defective image. Specifically, as shown in FIG. 19, the comparison processing unit 85 performs an operation of taking the difference between the inspection image KG and the non-defective item image RG, and acquires a difference image DG shown in the figure as a comparison result. The difference image DG is an image in which the normal part of the label 22 is white and the part of the defect FT in the label 22 is black or gray. In the difference image DG, a region (black or gray region) whose density (for example, luminance) is equal to or less than the density threshold is detected as the defect FT. For example, a broken label 22 or a foreign substance is detected as a defect FT. The difference between the two images KG and RG may be reversed from the example of FIG. In this case, the normal part is black 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 an 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 the defect FT in addition to the presence or absence of the defect FT. For example, in the difference image DG, the density, the shape, the size, and the like may be used as parameters, and the type of the defect FT may be determined using a threshold or the like set for each parameter. In this case, in addition to the presence or absence of the defect, the type of the defect FT is displayed on the display unit 42 in the case of the defect.

以上詳述したように、この実施形態によれば、以下の効果が得られる。
(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 above, according to this embodiment, the following effects can be obtained.
(1) The all-round image generation unit 62 that constitutes an example of the all-round image generation device is an image acquisition processing unit 71 that sequentially acquires the photographed image SG of the non-defective container 20; The storage unit 73 sets the front position of the container 20 in the captured image SG as a reference position and associates the partial image PG at the front position of the container 20 with position information in the circumferential direction and stores the partial image PG in the storage unit 52. Furthermore, 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 accumulation process, the accumulation unit 73 first performs a matching process using the model MF on the next photographed image SG acquired after the photographed image SG of the acquisition source of the model MF. Further, as the accumulation processing, if the storage unit 73 matches, the accumulation unit 73 determines the front position C0 of the container 20 based on the matched detection position C1 and the registered position Cm of the model MF, 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 circumferential position information (representative angle RK and an error). If the storage unit 73 does not match, the storage unit 73 shifts to the next captured image SG. Model acquisition processing for acquiring the model MF based on a predetermined region of a part of the container 20 in the captured image SG when the model acquisition unit 72 matches, and matching performed by the accumulation unit 73 using the latest model MF The all-round image AG is generated by repeating the accumulation process including the process until a plurality of partial images PG associated with circumferential position information are collected corresponding to the entire circumference. Thus, it is possible to relatively easily generate the all-round image AG associated with the position information of the container 20 in the circumferential direction. For example, the operator photographs the container 20 while manually positioning the photographing position of the container 20, and manually operates the input device of the PC from a plurality of photographed images in association with the partial image of the container 20 with the position information It is possible to eliminate the troublesome work of acquiring a plurality corresponding to one rotation.

ところで、ラインカメラを用いて一周分の画像を得ることができるが、この場合、全周画像取得用のラインカメラを別途用意しなければならず、しかもカメラが異なると、検査対象の容器20の撮影画像と、全周画像AGを基に生成されたモデルMや良品画像RGとの画質等が異なるため、検査精度に影響する。しかし、本実施形態では、検査に用いるカメラ31等の通常のカメラで撮影した容器20の撮影画像SGを用いて全周画像AGを生成できる。よって、高い検査精度が得られる。   By the way, although it is possible to obtain an image for one rotation using a line camera, in this case, it is necessary to separately prepare a line camera for acquiring an all-round image, and if the cameras are different, Since the image quality and the like of the photographed image and the model M and the non-defective image RG generated based on the all-round image AG are different, they affect the inspection accuracy. However, in the present embodiment, the all-around image AG can be generated 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 accumulation unit 73 accumulates the partial image PG for each storage unit AK (region) to which the representative angle RK, which is obtained by dividing the circumference of the container 20 into a plurality, belongs. If the previous partial image PG is already 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 storage 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 partial image PG accumulated during progress of the accumulation processing is updated to a more appropriate partial image PG, it is possible to generate a more accurate all-round image AG with less distortion.

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

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

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

(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-round image generation unit 62, a non-defective item image generation unit 64 that generates a plurality of non-defective images RG that are partial images in the circumferential direction from the all-round image AG. The inspection unit 66 inspects the presence or absence of the defect FT of the target container 20 (in particular, the label), and the position specifying unit 82 specifying the front position C0 of the container 20 to be inspected in the photographed image SG. The inspection unit 66 inspects the presence / absence of the defect FT of the container 20 based on the comparison result of comparing the inspection image KG and the non-defective product image RG corresponding to the front position C0. Therefore, the presence or absence of the defect FT of the container 20 can be inspected, and the non-defective item image data GD necessary for the inspection can be easily acquired. In particular, in the present embodiment, the position specifying unit 82 performs the matching process 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. The plurality of models M are generated based on the model area GA selected from the all-round image AG generated by the all-round image generation unit 62. Therefore, a plurality of models M necessary for inspection can be easily acquired.

(7)ラベル検査装置11が検査対象とする容器20は、外面にラベル22が付され、検査部66は、ラベル22の欠点FTを検査する。よって、容器20の付されたラベル22の欠点FTを検査することができる。   (7) The label 22 is attached to the outer surface of the container 20 to be inspected by the label inspection apparatus 11, and the inspection unit 66 inspects the defect FT of the label 22. Thus, the defect FT of the label 22 attached to the container 20 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). According to this method, it is possible to relatively easily generate the all-round image AG associated with the positional information of the container 20 in the circumferential direction.

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

図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 processes of steps S51 to S55 shown in FIG. 22 are the same as the processes of steps S11 to S15 in FIG. 4 of the first embodiment. That is, the front position of the container 20 in the captured image SG acquired first is set to the reference position (for example, 0 degree), and the partial image PG at the front position is obtained (S51, S52). The model M is created from an image of a part of a predetermined area at the front position of the container 20 in the photographed image SG (S53). Then, matching processing using the model MF is performed on the next captured image SG (S54), and if it matches (affirmative determination in S55), the process proceeds to step S56. On the other hand, if it does not match (negative determination in S55), the photographed image SG is sequentially read until it matches, and if it matches, 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 processing is initially performed using one model MF, the front position of the container 20 is calculated based on the registration position of one model MF. In the subsequent processing, the number of models MF is sequentially increased 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 processes of the next steps S57 to S59 correspond to the processes of steps S17 to S19 in FIG. That is, if the front position of the container 20 in the captured image SG has been registered (YES at S57), it is determined whether it is the front position to be updated (S58). Then, if the front position is not registered (NO in S57) or if it is a front position to be updated (YES in S58), the partial image and the front position information are registered by storing in the storage unit 52 ( S59). That is, the representative angle RK to which it belongs is determined from the front position, and the storage portion 73 stores the front position information in the storage portion AK of the corresponding representative angle RK of the position storage portion 53, and the partial image PG is stored in the first storage portion 54. The corresponding representative angle RK is stored in the storage unit PK. 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 a model addition condition is satisfied. In the present embodiment, there are two methods in which the model acquisition unit 72 adds up to the maximum number of models MF. One is a two-way system, and the other is a stepping stone system. The model addition condition is determined according to the method of adding the model MF. For example, the area of the representative angle RK to which the front angle θc of the container 20 in the captured image SG this time belongs must be adjacent to the area 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. For example, 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 extracts features based on an image of a part of a predetermined area at the front position of the container 20 in the captured image SG this time, and creates and adds a model MF. Therefore, when the area of the representative angle RK to which the front angle θc of the present captured image SG belongs is positioned with one or more unregistered areas in between with respect to the area corresponding to the existing model MF, A new model MF is created from the captured image SG this time and added.

ステップS62では、CPU51はモデル消去条件が成立したか否かを判断する。例えば、既存のモデルMFに対応する領域の両隣の領域が登録済みとなれば、モデル消去条件が成立する。また、モデルMFに対応する領域の両隣のうち一方または両方が未登録であれば、その隣の未登録の領域へ蓄積されるべき部分画像PGの取得のためのマッチング処理に使用可能なモデルMFは残されるので、モデル消去条件は不成立となる。モデル消去条件が不成立であればステップS64に進み、モデル消去条件が成立すればステップS63に進む。   In step S62, the CPU 51 determines whether a model deletion condition is satisfied. For example, if the area on both sides of the area corresponding to the existing model MF is registered, the model elimination condition is satisfied. Further, if one or both of both sides of the region corresponding to the model MF are unregistered, the model MF usable for the matching process for acquisition of the partial image PG to be accumulated in the adjacent unregistered region. Is left, the model elimination 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 performs deletion of the model MF.
At step S64, the CPU 51 determines whether or not the all around image has been completed. If the all-round image is not completed, the process returns to step S54, and the all-round image generation processing (S54 to S64) is repeated until it is determined in step S64 that the all-round image is completed. On the other hand, if the all around image is completed, the process proceeds to the same processing as 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 steps S22 to S24 in FIG. 4 of the first embodiment is performed. That is, when the all-round image is completed (affirmative determination in S64), it is determined whether or not reinforcement learning is to be performed (S22). When reinforcement learning is to be performed (affirmation determination in S22), steps S54 to S64 and S22, S23. Are repeated until the reinforcement learning termination condition is satisfied. Further, regardless of the presence or absence of reinforcement learning, when the all-round image AG is completed, the angle correction of the all-round image AG is performed (S24). As a result, as shown in FIG. 14, the image data of the all-round image AG associated with the angle at which the designated position is 0 degrees 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 models MF will be described. First, the two-way method will be described with reference to FIG. The two-way system is a system in which the model MF is increased in two directions, clockwise and counterclockwise, in the circumferential direction of the article. That is, first, the model MF is created at the reference position (0 degree), and the angle region to which the front position of the captured image SG determined from the position of the matched model MF belongs as a result of matching processing corresponds to the model MF under registration. When it is the position which opened one or more unregistered angle areas with respect to an angle area (for example, 0 degree), model MF is created from this photography picture SG. This condition is satisfied when one or more unregistered angle areas are opened clockwise on the angle area (for example, 0 degree) corresponding to the existing model MF, and counterclockwise There may be cases where one or more unregistered angle areas are open. In this method, the model MF is propagated in both the clockwise direction propagating model MFc and the counterclockwise direction propagating model MFk. 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 the plurality of models MF in the middle of the accumulation process, the whole circumference image can be completed earlier than the method of the first embodiment in which there is one model MF. .

次に、図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 system 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 degrees). As a result of the matching process using the model MF, the angle area to which the front position of the container 20 in the captured image SG determined from the position matched with the model MF belongs with respect to the angle area (for example, 0 degrees) corresponding to the model being registered. In the case where one or more unregistered (“99”) angle regions are opened, a model MF is created from the captured image SG of this time and added. Since both sides of the angle area corresponding to the model MF are angle areas of the unregistered “99”, the frequency of matching the model MF in the matching process for the next captured image SG is high. In the example shown in FIG. 21 (a), one unregistered angle region is opened with respect to the first left model ML, and the middle model MM is increased, and the right model MR is further as shown in FIG. 21 (b). Increase. Thereafter, matching processing is performed using 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 models MF in the middle after the start of the accumulation process, the whole circumference image AG is completed earlier compared to the method of the first embodiment in which there is one model MF. can do. In the matching process using a plurality of models MF, the plurality of models MF may be switched in order and the search process for each model MF may be performed by serial processing, but for example, a plurality of models MF are processed using a multi-core CPU 51 It is preferable to perform each search process used in parallel processing.

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

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

実施形態は、上記に限定されず、以下のように変更してもよい。
・画像取得部は、撮影装置30に替え、容器20を撮影した画像データが蓄積された外部記憶装置91(図3に二点鎖線で示す)又はネット回線を介してサーバ(図示せず)から画像データを読み込む図3に示す入力部57(例えばUSBポート又は回線接続部)であってもよい。このように画像取得部が入力部57であって、外部記憶装置91から画像データ(検査画像)を取得したり、サーバから入力部57を介して画像データ(検査画像)を取得したりするものであっても、位置情報に対応付けられた全周画像AGを比較的簡単に生成することができる。
The embodiment is not limited to the above, and may be modified as follows.
The image acquisition unit is replaced with the imaging device 30, and from the server (not shown) via the external storage device 91 (shown by a two-dot chain line in FIG. 3) in which the image data obtained by imaging the container 20 is stored It may be an input unit 57 (for example, a USB port or a line connection unit) shown in FIG. 3 that reads image data. As described above, the image acquisition unit is the input unit 57, and acquires image data (examination image) from the external storage device 91, or acquires image data (examination image) from the server via the input unit 57. Even in this case, the all-round 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 captured image SG is not limited to the partial image centered on the representative angle RK, and may be a partial image directly on the front around the front angle θc. In the embodiment, the width center of the container 20 in the captured image SG is the front position, and the partial image PG of the width angle WP centered on the representative angle RK is accumulated if there is an error with the representative angle. A partial image PG centered on the front angle θc in SG may be stored. 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 as to reduce the error. Also in this configuration, if the error is reduced by, for example, reinforcement learning, it is possible to obtain the all-round 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 item image data GD may not be generated based on the all-round image AG. At least one of the data MD and GD may be generated based on the photographed image SG photographed by the camera 31 while the operator manually adjusts the circumferential position 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 J of divisions for determining the number of partial images PG constituting the all-round image AG is not limited to 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 should 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 to ensure that both the master image and the next image are captured. That is, when the master image is toward the end, the limit value when the next image is in front is the image that can be used for inspection in the image acquired from one direction (effective) is 120 degrees, so the front is centered It is ± 60 degrees, and the number obtained by dividing 360 degrees all around by this 60 degrees becomes “6”. Thus, the division number J is preferably a natural number of "6" or more. For example, J = 6, 12, 18, 24, 72, 120, 180, and 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. Furthermore, it may be 180 divisions or 360 divisions. An appropriate division number J can be selected in consideration of required accuracy and processing speed.

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

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

・容器は、ラベル22(その図柄)が付された容器に限定されず、容器の外面に図柄が印刷された容器、2色成形等により図柄が一体的に成形された容器などでもよい。外面に図柄を有する各種の容器に適用することができる。この場合、容器20の高さ方向Zの一部の全周画像AGに限らず、容器20の高さ方向Zの全域の全周画像AGを生成してもよい。また、容器20の高さ方向Zに位置の異なる複数の全周画像AGを生成してもよい。   The container is not limited to the container on which the label 22 (the design thereof) is attached, but may be a container on which the design is printed on the outer surface of the container, a container in which the design is integrally formed by two-color molding or the like. It can be applied to various containers having a graphic on the outer surface. In this case, the entire circumferential image AG of the entire region in the height direction Z of the container 20 may be generated without being limited to the partial circumferential image AG in the height direction Z of the container 20. In addition, a plurality of all-round images AG 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 generating device may be applied to the article orientation detection device described in Patent Document 2 that detects the direction in which the predetermined position of the article is directed in order to print the 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-round image AG generated by the all-round image generation unit 62. As a result of the matching process using the model M for the photographed image, the direction of the article is detected based on the position information of the matched similar symbol part and the position information of the model M. Then, the article is rotated until the printed portion, which is a predetermined position of the article, faces the printing device, and printing is performed on the printed portion of the article by the printing device.

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

・容器20を挟持可能な一対のベルトの速度差を利用して容器20を回転させながら搬送する搬送装置としたり、容器を回転テーブルに載せて回転させる回転テーブル方式、チャック部又は負圧吸着部などの把持部により持ち上げた容器を回転させる回転方式としたりし、1つのカメラ31で、回転する容器20を1回転する間に複数回撮影してもよい。   · A conveying device that conveys the container 20 while rotating the container 20 using the speed difference between a pair of belts capable of holding the container 20, or a rotary table method in which the container is placed on the rotary table and rotated, a chuck or a negative pressure adsorption unit Alternatively, the container lifted by the holding portion may be rotated, or one camera 31 may be used to take a plurality of shots during one rotation of the rotating container 20.

・位置特定部82がオムニ・マッチング処理を行わない構成でもよい。容器20又はラベル22に印刷等により周方向の異なる位置に複数の目印を付け、位置特定部82は、撮影画像SG中の目印の位置から容器20の正面位置を特定してもよい。   The position specifying unit 82 may not be configured 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 captured image SG.

・照明機器32に替え、例えば、撮像対象の容器20を挟んでカメラ31とは反対側に、赤外光(赤外線)を照射する照明機器を配置し、反射光と透過光との双方を用いたラベル22の外観検査を行ってもよい。   -Instead of the illumination device 32, for example, an illumination device that emits infrared light (infrared radiation) is disposed on the opposite side of the imaging target container 20 to the camera 31, 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 adhesively bonded to the outer surface of the article. In this case, the label is not limited to resin but may be paper, metal or laminate. Also, the label 22 may not be attached to the entire circumference of the article. The label 22 may be attached, for example, only to a part of the circumferential direction of the article.

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

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

・物品は、容器に限定されず、外面に図柄を有する物品であれば足りる。例えばシュリンクラベルが付された物品、図柄が印刷、溝又は凹部などからなる物品でもよい。また、物品は、部品又は製品でもよい。   -An article is not limited to a container, but it is sufficient if it is an article which has a pattern on the outer surface. For example, it may be an article to which a shrink label is attached, or an article to which a graphic is printed, a groove or a recess or the like. Also, 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 all-round image generation device 12 Transport device 13 Conveyor 20 Container 21 Outer peripheral surface (outer surface) 22 Label 23 Symbol 30 of image acquisition unit An imaging apparatus constituting an example, 31: camera constituting an example of an image acquisition unit, 32: illumination device, 33: container sensor, 40: controller, 41: input device, 42: display unit, 50: computer, 51: 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 an image acquisition unit, 61: control unit 62: all-round image generation unit 63: model registration unit 64: non-defective image generation unit 65: feature image generation unit 66: inspection unit 71: image acquisition processing unit constituting an example of the image acquisition unit 72 ... model acquisition unit, 73 ... storage unit, 4 angle correction unit 75 matching processing unit 81 image acquisition processing unit 82 position specifying unit 83 label height inspection unit 84 detection unit 85 comparison processing unit 86 determination unit 91 ... external storage device, PR ... program, MD ... model data, GD ... non-defective image data, FD ... feature image data, SG ... photographed image, MF, MFc, MFk, ML, MM, MR ... model, AM ... similar symbol part , C0 ... front position, RK ... representative angle, PG ... partial image, AG ... whole circumference image, PS ... progress scale, KG ... inspection image, RG, RG0 to RG35 ... non-defective image, FG, FG0 to FG35 ... characteristic image, DG: Difference image, GA: Model region as an example of image region, M, M1 to M8: Model, FT: Defect, X: Transport direction, Z: Height direction.

Claims (10)

良品の物品を撮影して得た部分画像を収集して周方向の位置情報と対応付けた全周画像を生成する全周画像生成装置であって、
物品を撮影して得た撮影画像を順次取得する画像取得部と、
前記画像取得部が取得した一の前記撮影画像中の前記物品の正面位置を基準位置に設定し、当該物品の当該正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積する蓄積部と、
前記画像取得部が取得した一の前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得部とを備え、
前記蓄積部は、前記画像取得部が前記モデルの取得元の前記撮影画像の後に取得した後の撮影画像に対して前記モデルを用いたマッチング処理を行い、マッチすれば当該マッチした位置の位置情報と前記モデルの位置情報とを基に前記物品の正面位置を割り出し、前記後の撮影画像中の前記物品の前記正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積し、マッチしなければ次の撮影画像に移行する蓄積処理を行い、
前記モデル取得部が、前記マッチしたときの前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得処理と、前記蓄積部が、少なくとも最新の前記モデルを用いて行う前記マッチング処理を含む前記蓄積処理とを、周方向の位置情報と対応付けた部分画像を少なくとも全周分に相当する複数収集するまで繰り返して前記全周画像を生成することを特徴とする全周画像生成装置。
An all-round image generating device for collecting a partial image obtained by photographing a non-defective article and generating an all-round image correlated with position information in the circumferential direction,
An image acquisition unit that sequentially acquires photographed images obtained by photographing an article;
The front position of the article in the one captured image acquired by the image acquisition unit is set as a reference position, and a partial image of the article at the front position of the article is stored in the storage unit in association with circumferential position information. An accumulation unit,
And a model acquisition unit that acquires a model based on a predetermined area of a part of the article in the one captured image acquired by the image acquisition unit.
The storage unit performs a matching process using the model on the captured image after the image acquisition unit acquires the captured image after the acquisition source of the model, and if it matches, the position information of the matched position The front position of the article is determined based on the position information of the model and the model, and a partial image at the front position of the article in the subsequent captured image is stored in the storage unit in association with circumferential position information. If it does not match, it performs accumulation processing to shift to the next captured image,
The model acquisition unit performs model acquisition processing for acquiring a model based on a predetermined region of a part of the article in the captured image when the matching is performed, and the storage unit performs at least using the latest model An all-round image is generated by repeating the accumulation process including the matching process until a plurality of partial images corresponding to circumferential position information are collected at least for the entire circumference. Image generator.
前記蓄積部は、前記物品の周を複数分割した代表位置が属する領域ごとに前記部分画像を蓄積し、マッチした際の今回の前記正面位置が属する前記領域に先の前記部分画像が蓄積されている場合は、当該今回の正面位置が前記先の部分画像の前記正面位置よりも当該領域の代表位置に近ければ、当該領域に蓄積する部分画像を、先の前記部分画像から今回の前記部分画像に更新することを特徴とする請求項1に記載の全周画像生成装置。   The accumulation unit accumulates the partial image for each area to which a representative position obtained by dividing the circumference of the article is divided, and the partial image is accumulated in the area to which the current front position at the time of matching belongs. If the current front position is closer to the representative position of the area than the front position of the previous partial image, the partial image to be accumulated in the area is the partial image from the previous partial image to the current partial image. The full circle image generation device according to claim 1, wherein the full circle image is updated. 前記モデル取得部は、最初に取得した前記モデルの周方向の位置に対して前記物品の周方向における一方向に移動した位置と、他方向に移動した位置との両方の位置で複数の前記モデルを取得し、
前記蓄積部は、複数の前記モデルを用いて前記マッチング処理を行うことを特徴とする請求項1または請求項2に記載の全周画像生成装置。
The model acquisition unit is configured to generate the plurality of models at positions obtained by moving in one direction in the circumferential direction of the article with respect to positions in the circumferential direction of the model acquired first and at positions moved in the other direction. Get
The all-around image generation device according to claim 1, 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 such that a circumferential position of the model sandwiches an empty area in which the partial image is not accumulated between the model and another model.
The all-around image generation device according to claim 1, wherein the storage unit performs the matching process using a plurality of the models.
前記蓄積部は、所定条件を満たすまで前記モデル取得処理と前記蓄積処理とを繰り返しても前記全周画像を完成できなかった場合、前記部分画像が蓄積されていない未蓄積の領域の代表位置を取得し、当該未蓄積の領域の隣の位置に蓄積済みの領域が存在すれば、当該蓄積済みの領域に蓄積されている前記部分画像の取得元である前記撮影画像から前記未蓄積の領域の前記代表位置に対応する位置の前記部分画像を取得して位置情報と対応付けて前記未蓄積の領域に蓄積することを特徴とする請求項1〜請求項4のいずれか一項に記載の全周画像生成装置。   The storage unit is configured to set a representative position of an unaccumulated area in which the partial image is not accumulated, when the all-round image can not be completed even if the model acquisition process and the accumulation process are repeated until a predetermined condition is satisfied. If there is an accumulated area at a position next to the unaccumulated area, the acquired image from the photographed image which is the acquisition source of the partial image accumulated in the accumulated area is The whole image according to any one of claims 1 to 4, wherein the partial image at a position corresponding to the representative position is acquired, correlated with position information, and accumulated in the unaccumulated area. Round image generator. 前記全周画像から選択された周方向に位置の異なる複数の画像領域を基に複数のモデルを作成し、当該複数のモデルを周方向の位置情報と対応付けて登録するモデル登録部を更に備えたことを特徴とする請求項1〜5のいずれか一項に記載の全周画像生成装置。   A model registration unit is further provided, which creates a plurality of models based on a plurality of image areas having different positions in the circumferential direction selected from the circumferential image, and registers the plurality of models in association with circumferential position information. The all-around image generating device according to any one of claims 1 to 5, characterized in that: 外面に図柄を有する向き特定対象の物品を撮影した撮影画像に対して、前記モデル登録部が作成した前記モデルを用いてマッチング処理を行って、マッチした類似図柄部の位置情報と当該モデルの位置情報とを基に前記撮影画像中の当該物品の正面位置又は当該物品の周方向の所定位置を特定する位置特定部を更に備えたことを特徴とする請求項6に記載の全周画像生成装置。   A matching process is performed on a photographed image obtained by photographing an article whose direction is to be specified and having a design on the outer surface, using the model created by the model registration unit, and position information of the matched similar symbol part and the position of the model 7. The all-around image generating device according to claim 6, further comprising a position specifying unit for specifying a front position of the article in the photographed image or a predetermined position in the circumferential direction of the article based on information. . 前記全周画像から周方向の部分画像である良品画像を全周分に相当する複数生成する良品画像生成部と、
検査対象の物品の欠点の有無を検査する検査部と、
検査対象の前記物品を撮影した前記撮影画像中の当該物品の正面位置を特定する位置特定部とを更に備え、
前記検査部は、前記撮影画像中の検査画像と、前記位置特定部が特定した前記正面位置に対応する前記良品画像とを比較した比較結果を基に前記物品の欠点の有無を検査することを特徴とする請求項1〜6のいずれか一項に記載の全周画像生成装置。
A non-defective image generation unit configured to generate a plurality of non-defective images that are partial images in the circumferential direction from the all-circumferential image corresponding to all the circumferences;
An inspection unit which inspects the presence or absence of a defect of an article to be inspected;
And a position specifying unit for specifying a 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 a defect of the article based on a comparison result of comparing the inspection image in the photographed image and the non-defective image corresponding to the front position specified by the position specifying unit. The all-around image generation device according to any one of claims 1 to 6, which is characterized by the above.
前記物品は、外面にラベルが付され、
前記検査部は、前記ラベルの欠点を検査することを特徴とする請求項8に記載の全周画像生成装置。
The article is labeled on the outer surface,
The apparatus according to claim 8, wherein the inspection unit inspects the defect of the label.
良品の物品を撮影して得た部分画像を収集して周方向の位置情報と対応付けた全周画像を生成する全周画像生成方法であって、
物品を撮影して得た撮影画像を順次取得する画像取得ステップと、
前記画像取得ステップで取得した一の前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得するモデル取得ステップと、
前記画像取得ステップで前記モデルの取得元の前記撮影画像の後に取得した後の撮影画像に対して前記モデルを用いたマッチング処理を行い、マッチすれば当該マッチした位置の位置情報と前記モデルの位置情報とを基に前記物品の正面位置を割り出し、前記後の撮影画像中の前記物品の前記正面位置における部分画像を周方向の位置情報と対応付けて記憶部に蓄積し、マッチしなければ次の撮影画像に移行する蓄積処理を行う蓄積ステップとを備え、
前記マッチしたときの前記撮影画像中の前記物品の一部の所定領域を基にモデルを取得する前記モデル取得ステップと、少なくとも最新の前記モデルを用いて行う前記マッチング処理を含む前記蓄積処理を行う前記蓄積ステップとを、周方向の位置情報と対応付けた部分画像を少なくとも全周分に相当する複数収集するまで繰り返して前記全周画像を生成することを特徴とする全周画像生成方法。
A method for generating an all-round image, which collects a partial image obtained by photographing a non-defective article and generates an all-round image correlated with position information in the circumferential direction,
An image acquisition step of sequentially acquiring photographed images obtained by photographing an article;
A model acquisition step of acquiring a model based on a predetermined area of a part of the article in one of the photographed images acquired in the image acquisition step;
A matching process using the model is performed on the captured image acquired after the captured image of the model acquisition source in the image acquisition step, and if it matches, the position information of the matched position and the position of the model Based on the information, the front position of the article is determined, partial images at the front position of the article in the subsequent captured image are stored in the storage unit in correspondence with circumferential position information, and if they do not match, the next And an accumulation step for performing an accumulation process to shift to a photographed image of
Performing the storage process including the model acquisition step of acquiring a model based on a predetermined region of a part of the article in the captured image when the match is made, and the matching process performed using at least the latest model A method of generating an all-round image, comprising repeatedly repeating the accumulating step until a plurality of partial images corresponding to circumferential position information are collected at least for the entire circumference.
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 true JP2019105611A (en) 2019-06-27
JP6975423B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020134365A (en) * 2019-02-21 2020-08-31 キリンテクノシステム株式会社 Label inspection method and inspection device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05164706A (en) * 1991-12-17 1993-06-29 Kuwabara Yasunaga Inspecting method for mixing-in of vessel of different kind
US5253175A (en) * 1989-09-12 1993-10-12 Toyo Seikan Kaisha Ltd. Method for preliminarily printing blank for tapered draw-formed body
JPH0624424A (en) * 1992-07-02 1994-02-01 Kuwabara Yasunaga Facing/p0sitioning method for container
JP2008151720A (en) * 2006-12-20 2008-07-03 Nidec Tosok Corp Cylinder appearance inspecting method
JP2010135872A (en) * 2008-12-02 2010-06-17 Univ Of Tokyo Imaging apparatus and imaging method
JP2017100796A (en) * 2015-12-04 2017-06-08 株式会社エヌテック Container orientation detection device, container processing apparatus and container orientation detection method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5253175A (en) * 1989-09-12 1993-10-12 Toyo Seikan Kaisha Ltd. Method for preliminarily printing blank for tapered draw-formed body
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
JP2008151720A (en) * 2006-12-20 2008-07-03 Nidec Tosok Corp Cylinder appearance inspecting method
JP2010135872A (en) * 2008-12-02 2010-06-17 Univ Of Tokyo Imaging apparatus and imaging method
JP2017100796A (en) * 2015-12-04 2017-06-08 株式会社エヌテック Container orientation detection device, container processing apparatus and container orientation detection method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020134365A (en) * 2019-02-21 2020-08-31 キリンテクノシステム株式会社 Label inspection method and inspection device
JP7182273B2 (en) 2019-02-21 2022-12-02 キリンテクノシステム株式会社 Label inspection method and inspection device

Also Published As

Publication number Publication date
JP6975423B2 (en) 2021-12-01

Similar Documents

Publication Publication Date Title
US10083522B2 (en) Image based measurement system
US11727613B2 (en) Systems and methods for stitching sequential images of an object
JP5947169B2 (en) Appearance inspection apparatus, appearance inspection method and program
US8295588B2 (en) Three-dimensional vision sensor
CN100376889C (en) Intelligent digital graphics context detection system and detection method
CN104025116B (en) Image-pickup method
JP2017100796A (en) Container orientation detection device, container processing apparatus and container orientation detection method
US10401227B2 (en) Colorimetry device and colorimetry method
TWI621827B (en) Method of length measurement for 2d photography
JP2019105610A (en) Distorted image inspection device and distorted image inspection method
CN113030095A (en) Polaroid appearance defect detecting system
CN110596118A (en) Print pattern detection method and print pattern detection device
JP4153755B2 (en) Solar panel color unevenness inspection device
JPH0624424A (en) Facing/p0sitioning method for container
JP2019105611A (en) Whole circumference image generation device and whole circumference image generation method
JP6913362B2 (en) Label inspection method and inspection equipment
JP3993107B2 (en) Component recognition data creation method and creation apparatus, and component recognition data creation program
JP6359363B2 (en) Container inspection device and container inspection method
JPH07332951A (en) Apparatus and method for inspecting image
JP6699694B2 (en) Inspection system, inspection method
JP5959430B2 (en) Bottle cap appearance inspection device and appearance inspection method
JP7402498B2 (en) Label inspection method and label inspection system
TW201804980A (en) Method for generating template for solid preparation, computer-readable storage media storing program for generating template for solid preparation, method for inspecting print on solid preparation, and device for inspecting print on solid preparation
JP2004271205A (en) Defect inspection device of container mouth part
JP7268341B2 (en) Inspection performance diagnostic device, inspection performance diagnostic method, program for inspection performance diagnostic device, and inspection performance diagnostic system

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