JPH0663734B2 - Deviation inspection device for display pattern - Google Patents

Deviation inspection device for display pattern

Info

Publication number
JPH0663734B2
JPH0663734B2 JP1308246A JP30824689A JPH0663734B2 JP H0663734 B2 JPH0663734 B2 JP H0663734B2 JP 1308246 A JP1308246 A JP 1308246A JP 30824689 A JP30824689 A JP 30824689A JP H0663734 B2 JPH0663734 B2 JP H0663734B2
Authority
JP
Japan
Prior art keywords
image data
pattern
inspection
area
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP1308246A
Other languages
Japanese (ja)
Other versions
JPH03167407A (en
Inventor
良一 山田
尚 楠山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kao Corp
Original Assignee
Kao Corp
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 Kao Corp filed Critical Kao Corp
Priority to JP1308246A priority Critical patent/JPH0663734B2/en
Publication of JPH03167407A publication Critical patent/JPH03167407A/en
Publication of JPH0663734B2 publication Critical patent/JPH0663734B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はラインで流れている製品の包装紙に印刷された
商品名等の図柄の位置ずれを検査する装置に関する。
The present invention relates to an apparatus for inspecting a positional deviation of a design such as a product name printed on a wrapping paper of a product flowing in a line.

〔従来の技術〕[Conventional technology]

例えば石鹸のような製品は、個々に包装紙にて包装され
た上、一つの箱に複数個詰められており、各々の石鹸の
上面部分にあたる包装紙には商品名等の図柄が印刷され
ている。従って、上記包装の際に包装紙のずれにより、
前記図柄が所定位置に位置しない石鹸が一つでもある
と、目立ち易く、商品に対する品質やブランドを損ねる
恐れがある。
For example, products such as soap are individually wrapped in wrapping paper and then packed in a plurality of boxes, and patterns such as product names are printed on the wrapping paper that is the upper surface of each soap. There is. Therefore, due to the deviation of the wrapping paper during the above packaging,
If there is at least one soap in which the design is not located at a predetermined position, it is likely to be conspicuous and the quality or brand of the product may be impaired.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

そこで、従来は、個々の石鹸に対して図柄が所定位置に
あるか否かを目視点検により検査していたが、ラインの
流れが早いこともあり、正確な検査は不可能であった。
Therefore, conventionally, each soap was inspected by visual inspection for whether or not the pattern was at a predetermined position, but since the flow of the line was fast, it was impossible to perform an accurate inspection.

本発明は上述した問題点をなくすためになされたもので
あり、表示図柄の位置ずれの検査を自動化した表示図柄
のずれ検査装置を提供することを目的とする。
The present invention has been made to eliminate the above-mentioned problems, and an object of the present invention is to provide a display pattern deviation inspection device in which the inspection of the position deviation of the display symbol is automated.

〔課題を解決するための手段〕[Means for Solving the Problems]

本発明の表示図柄のずれ検査装置は第1図に示すよう
に、ラインで搬送される製品もしくは該製品の包装紙に
記された図柄の位置ずれを検査する装置であって、 検査位置に搬送された製品の図柄もしくは該図柄の一部
を検査パターンRとし、該検査パターンRを含む領域41
を撮像するカメラ(A)と、 前記カメラ(A)で撮像した撮像領域41の画像データD
を記憶する第1の画像データ記憶手段(B)と、 第1の画像データ記憶手段(B)に記憶された画像デー
タDと、検査位置に正確にセットした製品の画像データ
との比較により、製品自体の撮像時の位置ずれを求め、
第1の画像データ記憶手段(B)に記憶された画像デー
タDの位置情報を補正する位置補正手段(C)と、 同一図柄でかつ位置ずれのないパターンの画像データを
基本データdとして記憶する第2の画像データ記憶手
段(E)と、 前記検査パターンRをほぼ中心に含む検索領域Qを設定
し、前記検査パターンRと同じ大きさとした検出領域q
を、この検索領域Q内で順次シフトさせたときに、該検
出領域qに対応する、上記画像データD上の検出データ
dと、前記第2の画像データ記憶手段(E)よりの基本
データdとを各画素毎に比較を行って両データ間での
マッチング度合を調べるテンプレートマッチング手段
(F)と、 前記テンプレートマッチング手段(F)による比較によ
り、マッチング度合が最高であったときの前記検出領域
qのシフト位置から、当該図柄のずれ量を求める位置判
定手段(G)とを備える。
As shown in FIG. 1, the display pattern deviation inspection apparatus of the present invention is an apparatus for inspecting a positional deviation of a product conveyed on a line or a pattern printed on the packaging paper of the product, and conveyed to an inspection position. The pattern of the produced product or a part of the pattern is used as an inspection pattern R, and an area 41 including the inspection pattern R
(A) for imaging the image, and image data D of the imaging region 41 imaged by the camera (A)
By comparing the first image data storage means (B) for storing the image data, the image data D stored in the first image data storage means (B), and the image data of the product accurately set at the inspection position, Find the position shift of the product itself at the time of imaging,
Position correction means (C) for correcting the position information of the image data D stored in the first image data storage means (B), and image data of a pattern having the same design and no positional deviation is stored as basic data d 0. A second image data storage means (E) for performing the search, and a search area Q including the inspection pattern R substantially at the center are set, and a detection area q having the same size as the inspection pattern R is set.
Are sequentially shifted in the search area Q, the detection data d on the image data D corresponding to the detection area q and the basic data d from the second image data storage means (E) The template matching means (F) for checking the matching degree between both data by comparing 0 with each pixel, and the detection when the matching degree is the highest by the comparison by the template matching means (F). Position determination means (G) for obtaining the amount of deviation of the symbol from the shift position of the area q is provided.

〔作用〕[Action]

検査位置に製品が搬送された時、カメラ(A)によっ
て、その製品(1)の図柄もしくは該図柄の一部を検査
パターンRとし、その検査パターンRを含む領域41に対
して撮像され、その画像データDが第1の画像データ記
憶手段(B)に記憶される。
When the product is conveyed to the inspection position, the pattern of the product (1) or a part of the pattern is set as the inspection pattern R by the camera (A), and the region 41 including the inspection pattern R is imaged. The image data D is stored in the first image data storage means (B).

次に画像データD内の製品(1)のライン流れ方向に対
する離隔距離とライン流れ方向と直交する方向に対する
離隔距離とから、製品(1)の位置ずれを求め、前記画
像データDの位置情報が位置補正手段(C)によつて補
正される。
Next, the positional deviation of the product (1) is obtained from the separation distance of the product (1) in the image data D with respect to the line flow direction and the separation distance with respect to the direction orthogonal to the line flow direction, and the position information of the image data D is obtained. It is corrected by the position correction means (C).

又、予め、同一図柄でかつ位置ずれのないパターンの画
像データを基本データdとして第2の画像データ記憶
手段(E)に記憶しておく。
Further, the image data of the pattern having the same design and no positional deviation is stored in advance in the second image data storage means (E) as the basic data d 0 .

次に、前記検査パターンRをほぼ中心に含むようにして
検索領域Qが設定され、前記検査パターンRと同じ大き
さとした検出領域qが、この検索領域Q内で順次シフト
される。このとき、該検出領域qに対応する、上記画像
データD上の検出データdが次々と読み出され、この読
み出された検出データdが、前記第2の画像データ記憶
手段(E)よりの基本データdと各画素毎に比較さ
れ、両データ間でのマッチング度合がテンプレートマッ
チング手段(F)によって調べられる。
Next, the search area Q is set so as to include the inspection pattern R substantially at the center, and the detection area q having the same size as the inspection pattern R is sequentially shifted in the search area Q. At this time, the detection data d on the image data D corresponding to the detection area q is read one after another, and the read detection data d is read from the second image data storage means (E). The basic data d 0 is compared with each pixel, and the matching degree between both data is checked by the template matching means (F).

このテンプレートマッチング手段(F)による比較によ
り、マッチング度合が最高であったときの前記検出領域
qのシフト位置が、検査パターンRの存在位置を示して
いる。そこで、位置判定手段(G)によって、この位置
と基本データdの位置との差が当該図柄のずれ量とし
て求められる。
The shift position of the detection area q when the matching degree is the highest by the comparison by the template matching means (F) indicates the existing position of the inspection pattern R. Therefore, the position determining means (G) obtains the difference between this position and the position of the basic data d 0 as the amount of deviation of the symbol.

ところで、検出領域qを検索領域Q内でシフトさせる
際、複数画像づつシフトすれば両データ間でのマッチン
グ度合が最大となるシフト位置が早期に検出されるが、
そのときに検出されたずれ量の精度は悪い(最大で複数
画素分の誤差が出る)。一方、1画像づつシフトさせれ
ば、高精度でずれ量検出が行えるが時間がかかり過ぎ
る。
By the way, when the detection area q is shifted in the search area Q, if a plurality of images are shifted, the shift position where the degree of matching between both data becomes the maximum is detected early.
The accuracy of the amount of deviation detected at that time is poor (errors of a plurality of pixels at maximum). On the other hand, if the image is shifted by one image, the amount of deviation can be detected with high accuracy, but it takes too much time.

そこで、本発明では、特許請求の範囲第2項にあるよう
に、上記テンプレートマッチング手段(F)は、最初
は、検索領域Q内で検出領域qをm画素づつシフトさせ
ることにより、マッチング度合が最高となるシフト位置
を探し、このときの検出領域qの位置を中心とした第2
の検索領域Q′(<Q)を設定し、この第2の検索領域
Q′に対し、検出領域qをn(<m)画素ずつシフトさ
せてマッチング度合の最高点を探し、このようにして検
索領域を順次狭めることにより、検出領域qのシフト量
を最終的に1画素にしても、高精度でずれ量を短時間で
検出できる。
Therefore, according to the present invention, as described in claim 2, the template matching means (F) first shifts the detection area q in the search area Q by m pixels to obtain a matching degree. The second shift centering on the position of the detection area q at this time is searched for the highest shift position.
Search area Q ′ (<Q) is set, and the detection area q is shifted by n (<m) pixels with respect to the second search area Q ′ to find the highest matching degree. By sequentially narrowing the search region, even if the shift amount of the detection region q is finally 1 pixel, the shift amount can be detected with high accuracy in a short time.

〔実施例〕〔Example〕

第2図に本発明の表示図柄のずれ検査装置の一実施例を
示している。
FIG. 2 shows an embodiment of the display pattern deviation inspection device of the present invention.

1は、検査対象の石鹸を示しており、コンベア2によ
り、図中左方向に一定の速度で搬送されている。3及び
4は、検査位置に石鹸1が搬送されたか否かを検査する
センサーである。5は検査位置にある石鹸1に対して照
明するための照明灯であり、商用周波に伴うちらつきを
なくすために高周波蛍光灯を用いている。6はCCD撮像
素子を用いたカメラであり、検査位置にある石鹸1の上
面の画像を捕らえる。
Reference numeral 1 denotes a soap to be inspected, which is conveyed leftward in the drawing at a constant speed by a conveyor 2. 3 and 4 are sensors that inspect whether or not the soap 1 has been conveyed to the inspection position. Reference numeral 5 is an illuminating lamp for illuminating the soap 1 at the inspection position, and uses a high-frequency fluorescent lamp to eliminate the flicker associated with the commercial frequency. Reference numeral 6 denotes a camera using a CCD image pickup device, which captures an image of the upper surface of the soap 1 at the inspection position.

7は本装置を集中制御するためのCPU(中央演算処理装
置)であり、内部には、後で詳しく述べる画像処理の際
に機能する画像処理部7aを有する。8は、CPU7が行う制
御プログラムを格納するROM(リードオンリーメモリ)
である。9は、信号入力部であり、前記センサー3,4よ
りの検出信号はこの信号入力部9を介してCPU7に取り込
まれる。10は、前記カメラ6よりの映像信号を記憶する
画像メモリであり、11は、カメラ6による撮像画面をモ
ニターするための画像モニターディスプレイである。12
は、種々の設定条件等を入力するためのキーボードであ
る。13は、石鹸1をラインの流れから側方へ排出する排
出装置であり、14は、CPU7の信号出力部であり、本装置
の検査により、表示図柄の位置ずれによる不良が検出さ
れたときに、前記排出装置13に対して所定の排出信号を
送出すると共に、前記センサー3,4により、石鹸1が検
査位置に来たことが検出された時にカメラ6に対してレ
リーズ信号を出力する。
Reference numeral 7 denotes a CPU (central processing unit) for centrally controlling the present apparatus, and internally has an image processing unit 7a which functions at the time of image processing described in detail later. 8 is a ROM (read only memory) that stores the control program executed by the CPU 7.
Is. Reference numeral 9 denotes a signal input section, and the detection signals from the sensors 3 and 4 are taken into the CPU 7 via the signal input section 9. Reference numeral 10 is an image memory for storing a video signal from the camera 6, and 11 is an image monitor display for monitoring an image pickup screen of the camera 6. 12
Is a keyboard for inputting various setting conditions and the like. 13 is a discharge device for discharging the soap 1 to the side from the flow of the line, 14 is a signal output unit of the CPU 7, and when a defect due to the displacement of the display pattern is detected by the inspection of this device, A predetermined discharge signal is sent to the discharge device 13 and a release signal is output to the camera 6 when the sensors 3 and 4 detect that the soap 1 has reached the inspection position.

15は、本装置にて行なった検査結果を表示する計測結果
表示ディスプレイであり、16は、前記検査結果をデータ
として記憶するためのフロッピーディスク装置である。
Reference numeral 15 is a measurement result display for displaying the inspection result of this apparatus, and 16 is a floppy disk device for storing the inspection result as data.

次に上記構成になる装置の動作を第3図(A)のフロー
チャートに従って説明する。
Next, the operation of the apparatus having the above configuration will be described with reference to the flowchart of FIG.

まず最初に、以下に説明する検査の際に必要となる基本
パターンについて述べる。第4図は、カメラ6で撮像さ
れた石鹸1の画像を示しており、外枠41はカメラ6の撮
像領域である。石鹸1において、“bac"とあるのは商標
名であり、“WHITE"とあるのは商品名であり、又、石鹸
1の下方にあるのは、ストライプの図柄を示している。
検査対象とするパターン(以下検査パターンRという)
は、前記文字あるいは図柄のいずれを採用してもよい
が、本実施例では、“bac"の内の中央の文字“a"とし
た。これに伴い比較の際の基準となるパターンとして、
検査パターンRと同一図柄でかつ位置ずれのないパター
ンの画像データを基本データdとして予め登録してお
く必要があり、この基本パターンRに対する情報とし
ては、第5図(A)に示したように、文字“a"の領域に
対する画素データと、文字“a"の、石鹸1の端縁よりの
距離x、yのデータを含み、その登録方法については後
で述べる。
First, the basic pattern required for the inspection described below will be described. FIG. 4 shows an image of the soap 1 picked up by the camera 6, and the outer frame 41 is an image pickup area of the camera 6. In the soap 1, “bac” is a trade name, “WHITE” is a trade name, and the area below the soap 1 is a striped pattern.
Pattern to be inspected (hereinafter referred to as inspection pattern R)
Any of the above-mentioned characters or patterns may be adopted as, but in the present embodiment, the character "a" in the center of "bac" was used. As a result, as a reference pattern for comparison,
It is necessary to previously register image data of a pattern having the same pattern as the inspection pattern R and having no positional deviation as the basic data d 0, and as information for this basic pattern R 0 , it is shown in FIG. 5 (A). As described above, the pixel data for the area of the character "a" and the data of the distances x and y of the character "a" from the edge of the soap 1 are included, and the registration method will be described later.

さて、ステップS1において、検査対象とする石鹸1の品
種をキーボード12により選択すると、品種毎に登録され
ていた基本パターンRから所望のものがフロッピーデ
ィスク装置から読み出される。次のステップS2でセンサ
ー3,4よりの検出信号待ちとなり、石鹸1が所定の検査
位置に来て、センサー3,4より所定の検査信号がCPU7に
取り込まれると、ステップS3にてカメラ6で撮像した石
鹸1の画像データDが画像メモリー10に取り込まれる。
Now, in step S1, when the type of the soap 1 to be inspected is selected by the keyboard 12, the desired one is read from the basic pattern R 0 registered for each type from the floppy disk device. In the next step S2, the detection signal from the sensors 3 and 4 is waited, the soap 1 comes to a predetermined inspection position, and the predetermined inspection signal is taken into the CPU 7 from the sensors 3 and 4, and the camera 6 in step S3. The image data D of the imaged soap 1 is taken into the image memory 10.

ステップS4では、石鹸1が検査位置に次々に搬送されて
いるか否かが判定され、続けて搬送されているときは次
のステップS5に進む、 ところでカメラ6より1フィールドの画面を取り込むに
は1/60秒必要とするので、シャッター付きカメラを用
いた場合、レリーズ信号が入力されると、読み出し画素
がフィールドの先頭に来た時点でシャッターが切られる
ので、最悪の場合、つまり、読み出し画素がフィールド
先頭を通過した直後であれば、次にシャッターが切られ
るまでおよそ1/60秒待つことになる。ライン速度が40
m/分の場合、第4図で示したように、1/60秒の間に
石鹸1が11mm移動することになる。そこでこのステップ
S5において、画像メモリー10に記憶された石鹸1の画像
データDから、石鹸1の一方の端縁Lを検出し、撮像領
域41内の石鹸1の、ライン流れ方向に対する離隔距離X
(第5図(B)に図示)を求め、又、石鹸1の、ライン
流れ方向と直交する方向に対する離隔距離Y(第5図
(C)に図示)を求め、前記測定位置に正確にセットさ
れた石鹸1に対して同様に測定した距離から、前記石鹸
1の画像データDが画像メモリ10上でアドレスシフトさ
れることで位置補正される。
In step S4, it is determined whether or not the soaps 1 are successively conveyed to the inspection position. If the soaps 1 are continuously conveyed, the process proceeds to the next step S5. / 60 seconds is required, so when using a camera with a shutter, when the release signal is input, the shutter is released when the read pixel comes to the beginning of the field, so in the worst case, that is, the read pixel is Immediately after passing the beginning of the field, it will wait about 1/60 second until the shutter is released next time. Line speed is 40
In the case of m / min, as shown in FIG. 4, the soap 1 moves 11 mm in 1/60 seconds. So this step
In S5, one edge L of the soap 1 is detected from the image data D of the soap 1 stored in the image memory 10 and the separation distance X of the soap 1 in the imaging region 41 with respect to the line flow direction is detected.
(Shown in FIG. 5 (B)), and the separation distance Y (shown in FIG. 5 (C)) of the soap 1 with respect to the direction orthogonal to the line flow direction is set and set accurately at the measurement position. The image data D of the soap 1 is address-shifted on the image memory 10 from the distance measured in the same manner for the soap 1, and the position is corrected.

尚、レリーズ信号の入力と同時にシャッターが切られる
ランダムシャッターカメラもあるが、このカメラを用い
ても、高速で移動している石鹸1を光センサーで検出す
る簡単な位置検出システムでは、シャッターが切られる
時点の石鹸1の検出位置には数ミリの誤差が含まれるた
め、上述したような位置補正は不可欠である。ステップ
S6では、第5図(D)に示すように、検査パターンRで
ある文字“a"を中心に含む検索領域Qが、画像データD
(撮像領域41のデータ)を記憶している画像メモリー1
に対して設定される。
There are random shutter cameras that release the shutter at the same time as the release signal is input, but even with this camera, the shutter is released with a simple position detection system that detects the soap 1 moving at high speed with an optical sensor. Since the detected position of the soap 1 at a given time includes an error of several millimeters, the position correction as described above is indispensable. Step
In S6, as shown in FIG. 5 (D), the search area Q including the character "a" which is the inspection pattern R at the center is the image data D.
Image memory 1 storing (data of imaging area 41)
Is set for.

次のステップS7では、第5図(E)に示すごとく、画像
メモリー10上の検索領域Qに対して、検査パターンRと
同じ大きさの検出領域qを次々にシフトさせ、このとき
の検出領域qに対応する、画像メモリー10上のデータ
(検出データdという)と、前述のパターンRよりの
基本データdとのマッチングを度合いを調べるテンプ
レートマッチングが行われる。このテンプレートマッチ
ングの処理を第6図〜第8図のパターン図を用いて具体
的に説明する。
In the next step S7, as shown in FIG. 5 (E), the detection areas q having the same size as the inspection pattern R are successively shifted with respect to the search areas Q on the image memory 10, and the detection areas at this time are detected. Template matching is performed to check the degree of matching between the data on the image memory 10 (referred to as detection data d) corresponding to q and the basic data d 0 from the pattern R 0 described above. The template matching process will be specifically described with reference to the pattern diagrams of FIGS. 6 to 8.

第6図におけるI−1〜I−9図は、テンプレートマッ
チングの第1段階を示しており、I−1図において、12
×12画素の領域は第5図(D)に示した検索領域Qに相
当し、円で囲んだ3×3画素の領域Rにある白又は黒ド
ットが検査対象の検査パターンRを示しており、各画素
における白ドット及び黒ドットを“0",“1"で表わす
と、この検査パターンRは次のような画素情報を持つ。
FIGS. I-1 to I-9 in FIG. 6 show the first stage of template matching, and in FIG.
The region of × 12 pixels corresponds to the search region Q shown in FIG. 5D, and the white or black dots in the region R of 3 × 3 pixels surrounded by a circle indicate the inspection pattern R to be inspected. When the white dot and the black dot in each pixel are represented by "0" and "1", this inspection pattern R has the following pixel information.

又、破線の円で囲んだ3×3画素の領域が前述した検出
領域qであり、この検出領域qよりの検出データと、基
本パターンRよりの基本データとどの程度マッチング
しているかを調べるようになっているが、以下に説明す
るマッチング判定をわかり易くするために、検出領域q
に基本パターンRの画素情報を示した。
Further, the 3 × 3 pixel area surrounded by the broken line circle is the above-mentioned detection area q, and it is examined how much the detection data from this detection area q matches the basic data from the basic pattern R 0. However, in order to make the matching determination described below easier to understand, the detection area q
The pixel information of the basic pattern R 0 is shown in FIG.

I−1図においては、検出領域qより読み出した検出デ
ータは、 であり、前記の基本データとのマッチング程度を調べる
ために、対応する各画素間で減算を行なうと次表のよう
になる。
In FIG. I-1, the detection data read from the detection area q is Then, in order to check the degree of matching with the basic data, subtraction is performed between the corresponding pixels, as shown in the following table.

上表でわかるように減算結果が0となった個数をカウン
トすることにより、マッチングした画素数がわかり、パ
ターンI−1ではマッチング画素は4個である。
As can be seen from the above table, the number of matched pixels is found by counting the number of subtraction results that are 0. In pattern I-1, the number of matching pixels is four.

I−1図でのマッチング判定が終わると、I−2図で示
したように、検出領域qは右方向に4画素分シフトす
る。このI−2図での検出データは前回と同様、すべて
“0"であるため、マッチング画素数は4個である。
When the matching determination in FIG. I-1 is completed, the detection area q shifts to the right by four pixels, as shown in FIG. I-2. Since the detection data in FIG. I-2 are all “0” as in the previous case, the number of matching pixels is four.

次のI−3図で示すように検出領域qが右端までくる
と、次のI−4図で示すように、検出領域qは左端に戻
ると共に4画素分下方にシフトする。次のI−5図にな
ると、検出領域qと、検査パターンRとで一部の画素で
合致するようになる。このときの検出データは、 であり、基本データとの減算を行なうと、0となったマ
ッチング画素数は、6個であり、パターンI−1〜I−
4のときに比べてマッチング度合いが高くなっている。
When the detection area q reaches the right end as shown in the next FIG. I-3, the detection area q returns to the left end and shifts downward by four pixels as shown in the next I-4. In the next figure I-5, the detection area q and the inspection pattern R are matched in some pixels. The detection data at this time is The number of matching pixels that have become 0 when the subtraction is performed with the basic data is 6 and the patterns I-1 to I-
The degree of matching is higher than in the case of 4.

以下のI−6図〜I−9図におけるマッチング画素数は
それぞれ4個であるため、第一段階のマッチングにおい
ては、I−5図での比較でマッチング度合いは最も高く
なる。そこでI−10図に示したように、I−5図におけ
る検出領域qを中心として周囲に2画素分だけ広げた領
域Q′を、第7図に示す第2段階愛での検索領域として
いる。
Since the number of matching pixels in each of FIGS. I-6 to I-9 below is four, the degree of matching is highest in the comparison in FIG. I-5 in the first-stage matching. Therefore, as shown in Fig. I-10, a region Q'which is expanded by two pixels around the detection region q in Fig. I-5 is used as a search region in the second stage love shown in Fig. 7. .

II−1図では、検出領域qは、検索領域Q′内の左上か
ら始まり、今度は2画素づつシフトする。この場合も、
第1段階と同様に、マッチング画素数を調べると、II−
1、II−4、II−7及びII−9図では4個であるのに対
し、II−2、II−3、II−5及びII−6図では6個とな
り、マッチング度合いが高くなっている。尚、本実施例
では説明を簡略化するために、画像データを12×12の14
4画素とし、基準画像データを3×3の9画素としたた
め、前記のII−2、II−3、II−5及びII−6図でマッ
チング度合いが等しくなったが、実際に適用する検索領
域Qは、60×60の3600画素であり、検出領域qは28×28
の784画素であるため、いずれかのマッチングでマッチ
ング度合いが最高となる。ここでは、II−2図でマッチ
ング度合いが最高となったとして以下話しを進める。
In Fig. II-1, the detection area q starts from the upper left in the search area Q'and this time shifts by two pixels. Also in this case,
As in the first step, when the number of matching pixels is checked, II-
1, II-4, II-7 and II-9 are four, whereas II-2, II-3, II-5 and II-6 are six, and the matching degree is high. There is. In this embodiment, in order to simplify the explanation, the image data is set to 12 × 12 14
Since the number of pixels is 4 and the standard image data is 9 pixels of 3 × 3, the matching degree is the same in the above-mentioned FIGS. II-2, II-3, II-5, and II-6. Q is 60 × 60 3600 pixels, and the detection area q is 28 × 28.
Since it is 784 pixels, the matching degree becomes highest in any matching. Here, the following discussion will be made assuming that the degree of matching is the highest in Fig. II-2.

II−10図で示したように、II−2図における検出領域q
を中心として周囲に1画素分だけ広げた領域とした検索
領域Q″を設定し、次に第8図に示す第3段階へ進む。
As shown in Fig. II-10, the detection area q
A search area Q ″, which is an area expanded by one pixel around the center, is set, and then the process proceeds to the third step shown in FIG.

第3段階においては、検出領域qは、検索領域Q″内を
左上から1画素ずつシフトする。この場合のマッチング
度合いは、図から明らかなように、III−9図で検出デ
ータと基本データとが完全に合致するために最高とな
り、マッチング画素数は9個となる。そこで次のステッ
プS8ではIII−10図で示したように、III−9図における
検出領域qの位置がどこにあったかを検出し、その検出
した位置を石鹸1の検査パターンRであった文字“a"の
位置とし、その位置と基本パターンRに対する前記距
離x,y(第5図(A)図示)とから、検査対象の石鹸1
における表示図柄のずれ量が演算される。ステップS9で
は、そのずれ量の大きさから良品か不良品かの判定が行
われ、ずれ量に規定値より大きく不良品と判定されたと
きは、ステップS10の排出処理に進む。
In the third stage, the detection area q is shifted in the search area Q ″ by one pixel from the upper left. The matching degree in this case is as shown in FIG. Is the highest, and the number of matching pixels is 9. Therefore, in the next step S8, as shown in Fig. III-10, the position of the detection area q in Fig. III-9 is detected. Then, the detected position is set as the position of the character "a" which was the inspection pattern R of the soap 1, and the inspection is performed from the position and the distance x, y (shown in FIG. 5A) with respect to the basic pattern R 0 . Target soap 1
The deviation amount of the display symbol in is calculated. In step S9, it is determined from the magnitude of the deviation amount whether the product is a good product or a defective product. When the deviation amount is determined to be a defective product larger than a specified value, the process proceeds to the discharging process of step S10.

第3図(B)は、ステップS10の排出処理を示すサブル
ーチンであり、まず、ステップS21にて、当該石鹸1が
排出装置13によってラインから排除され、次のステップ
S22でこのような排出動作が連続したか否かの判定が行
われ、排出動作が単発的に生じる場合は、ステップS25
に進み、計測結果表示ディスプレイ15に排出動作したこ
とを示す表示がなされる。一方、前記排出動作が連続し
た場合は、生産ラインに問題があるとして、ステップS2
2からステップS23に進み、生産ラインが停止され、次の
ステップS24で異常表示がなされる。
FIG. 3B is a subroutine showing the discharging process of step S10. First, in step S21, the soap 1 is removed from the line by the discharging device 13, and the next step
In S22, it is determined whether or not such discharging operation is continuous, and if the discharging operation occurs sporadically, Step S25
Then, the display indicating that the discharging operation is performed is displayed on the measurement result display display 15. On the other hand, if the discharge operation continues, it is determined that there is a problem in the production line, and the step S2
The process proceeds from step 2 to step S23, the production line is stopped, and an error is displayed in step S24.

第3図(A)に戻り、次のステップS11では、ずれ量等
が計測結果、表示ディスプレイ15に表示され、次のステ
ップS12でキーボード12より、終了のキーを押したとき
は、この検出モードが終了し、元のステップS1に戻る
が、そうでない場合は、ステップS2に戻り、次に検査位
置に送給される石鹸1に対して上述と同様な検査を行な
う。
Returning to FIG. 3 (A), in the next step S11, the deviation amount and the like are displayed on the display display 15 as the measurement result, and when the end key is pressed from the keyboard 12 in the next step S12, this detection mode is detected. Is completed and the process returns to the original step S1. If not, the process returns to step S2, and the soap 1 sent to the inspection position is subjected to the same inspection as described above.

このように、検査過程においては、ラインを流れる石鹸
1に対してリアルタイムでその表示図柄の位置ずれが検
査され、そのずれ量が計測結果表示ディスプレイ15に表
示されるが、上記の基本パターンが未登録の初期の動作
においても、表示図柄のずれ量のみが表示されるので、
そのずれ量をチェックすることにより、良品か不良品を
判断することができる。これにより、良品と判断した石
鹸1に対する検査パターンRを、基本パターンRとし
てフロッピーディスク装置16に登録すればよい。
In this way, in the inspection process, the positional deviation of the display pattern is inspected in real time with respect to the soap 1 flowing through the line, and the amount of the deviation is displayed on the measurement result display display 15. Even in the initial operation of registration, since only the deviation amount of the display pattern is displayed,
By checking the deviation amount, it is possible to determine whether the product is a good product or a defective product. As a result, the inspection pattern R for the soap 1 determined to be non-defective may be registered in the floppy disk device 16 as the basic pattern R 0 .

上述したテンプレートマッチングにおいては、比較動作
を3段階に分け、各段階に適正な検索領域Q、Q′、
Q″を設定するようにしたので、一つの石鹸1に対して
行なうべき総比較回数を低減できる。例えば、検索領域
Qを60×60画素、検出領域qを28×28画素としたとき、
検索領域Q内でパターン比較のために検出領域qを移動
する範囲は第1段階では4画素毎に比較するので32÷4
=8回の移動になり原点での比較を含めて9回の移動と
なり、横方向へ9回、縦方向へ9回の計81回の基本パタ
ーンとの比較をする。
In the template matching described above, the comparison operation is divided into three stages, and search regions Q, Q ′,
Since Q ″ is set, the total number of comparisons to be made for one soap 1 can be reduced. For example, when the search area Q is 60 × 60 pixels and the detection area q is 28 × 28 pixels,
The range in which the detection area q is moved for pattern comparison in the search area Q is 32 ÷ 4 because it is compared every 4 pixels in the first stage.
= 8 times of movement, including 9 times including the comparison at the origin, 9 times in the horizontal direction and 9 times in the vertical direction for a total of 81 comparisons with the basic pattern.

第2段階では第1段階で最も一致具合いの良かった場所
を中心に2画素毎に9回の基本パターンとの比較をす
る。
In the second stage, the comparison with the basic pattern is performed 9 times for every 2 pixels centering on the place where the best match is obtained in the first stage.

第3段階では第2段階で最も一致具合いの良かった場所
を中心に1画素毎に9回の基本パターンとの比較をす
る。
In the third stage, the comparison with the basic pattern is performed nine times for each pixel, centering on the place where the best match is obtained in the second stage.

従って比較回数の合計は 9×9+9+9=99回となる。Therefore, the total number of comparisons is 9 × 9 + 9 + 9 = 99 times.

一方、これを通常の1画素毎のテンプレートマッチング
法で行う場合、 60−28=32 横方向へ32画素、縦方向へ32画素の比較移動が必要であ
り、原点の比較を含めると、33回の比較が必要で 33×33=1089回にもなる。
On the other hand, when this is performed by the normal template matching method for each pixel, it is necessary to perform a comparative movement of 60−28 = 32 32 pixels in the horizontal direction and 32 pixels in the vertical direction. Is required, which is 33 × 33 = 1089 times.

このように本発明に適用したテンプレートマッチング法
では比較回数を通常の11分の1程度に低減でき高速の検
査が可能となるので、石鹸1のように1分間に250ない
し300個もの大量が流れるラインであっても、当該検査
装置を安価なコンピュータ装置によって実現できる。
As described above, in the template matching method applied to the present invention, the number of comparisons can be reduced to about 1/11 of the ordinary one, and high-speed inspection can be performed. Therefore, a large amount of 250 to 300 pieces per minute flows like soap 1. Even on a line, the inspection device can be realized by an inexpensive computer device.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明は、検査位置に搬送された
製品をカメラで撮像し、その画像データと、基準となる
データとの比較からわかる撮像時の製品の位置ずれ量に
基づき当該画像データを位置補正したので、撮像時にタ
イムラグが生じる、安価なシャッター付きカメラを使用
できる。そして、この位置補正した画像データに対し、
所定の読出し領域を順次シフトさせつつして読み出した
検出データと、予め登録してあった位置ずれのない基本
データとのマッチング程度をテンプレートマッチング法
にて調べることにより、当該製品の図柄もしくは図柄の
一部の位置を検出し、良・不良を判定するようにしたの
で、登録する基本データを変えるだけで種々の商品に対
する表示図柄の位置ずれを検出できる。又、テンプレー
トマッチングでのパターン比較の際、検出領域qを1画
素づつではなく、数画素づつシフトさせて、検出すべき
図柄もしくは図柄の一部のおおまかな位置を検出し、次
にこの検出した位置を中心とした検索領域Q′に狭め
て、以下同様なパターン比較を行う方法を採用すれば、
パターン比較回数を大幅に低減でき、それ故、処理速度
の遅い安価なコンピュータ装置にて本装置を実現でき
る。
As described above, according to the present invention, the product conveyed to the inspection position is imaged by the camera, and the image data is based on the positional deviation amount of the product at the time of imaging which is understood from the comparison between the image data and the reference data. Since the position is corrected, it is possible to use an inexpensive camera with a shutter, which causes a time lag during imaging. Then, for this position-corrected image data,
By checking the degree of matching between the detection data read while sequentially shifting the predetermined read area and the basic data that has been registered in advance and has no positional deviation by the template matching method, the design of the product or the design Since a part of the positions is detected and the quality is determined to be good or bad, it is possible to detect the position shift of the display pattern for various products by simply changing the basic data to be registered. Further, when comparing patterns by template matching, the detection area q is shifted not by one pixel but by several pixels to detect a rough position of the design or a part of the design to be detected, and then the detected position is detected. By narrowing the search area Q'to the center and adopting a similar pattern comparison method below,
The number of pattern comparisons can be significantly reduced, and thus the present apparatus can be realized by an inexpensive computer apparatus having a slow processing speed.

【図面の簡単な説明】[Brief description of drawings]

第1図は本発明の表示図柄のずれ検査装置のクレーム対
応図、第2図は本発明の一実施例を示すシステム図、第
3図(A)及び第3図(B)は第2図図示の装置の制御
動作を示すフローチャート、第4図は、第2図の装置に
おいて、カメラにて撮像された石鹸の画像を示す図、第
5図(A)は、第4図図示の石鹸に対する基本パターン
を示す図、第5図(B)及び第5図(C)は撮像した石
鹸の位置補正を説明するための図、第5図(D)は、石
鹸における検査パターンに対して設定した検索領域を示
す図、第5図(E)は、テンプレートマッチングを示す
図、第5図(F)は、検査結果であるずれ量を示す図、
第6図ないし第8図は、テンプレートマッチングでなさ
れる比較処理を示すパターン図である。 1……石鹸、2……コンベア、3,4……センサー、 5……照明灯、6……カメラ、7……CPU、 7a……画像処理部、8……ROM、 10……画像メモリー、 11……画像モニターディスプレイ、 12……キーボード、13……排出処理、 15……計測結果表示ディスプレイ、 16……フロッピーディスク装置。
FIG. 1 is a diagram corresponding to claims of a display pattern deviation inspection device of the present invention, FIG. 2 is a system diagram showing an embodiment of the present invention, and FIGS. 3 (A) and 3 (B) are FIG. 4 is a flow chart showing the control operation of the apparatus shown in FIG. 4, FIG. 4 is a view showing an image of soap taken by the camera in the apparatus shown in FIG. 2, and FIG. 5 (A) is for the soap shown in FIG. The figure which shows a basic pattern, FIG.5 (B) and FIG.5 (C) are the figures for demonstrating the position correction of the imaged soap, FIG.5 (D) was set with respect to the inspection pattern in soap. FIG. 5 (E) is a diagram showing a search area, FIG. 5 (E) is a diagram showing template matching, and FIG. 5 (F) is a diagram showing a shift amount as an inspection result.
6 to 8 are pattern diagrams showing the comparison process performed by template matching. 1 ... Soap, 2 ... Conveyor, 3,4 ... Sensor, 5 ... Illumination lamp, 6 ... Camera, 7 ... CPU, 7a ... Image processing section, 8 ... ROM, 10 ... Image memory , 11 …… Image monitor display, 12 …… Keyboard, 13 …… Ejection processing, 15 …… Measurement result display, 16 …… Floppy disk device.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】ラインで搬送される製品もしくは該製品の
包装紙に記された図柄の位置ずれを検査する装置であっ
て、 検査位置に搬送された製品の図柄もしくは該図柄の一部
を検査パターンRとし、該検査パターンRを含む領域41
を撮像するカメラ(A)と、 前記カメラ(A)で撮像した撮像領域41の画像データD
を記憶する第1の画像データ記憶手段(B)と、 第1の画像データ記憶手段(B)に記憶された画像デー
タD内の製品のライン流れ方向に対する離隔距離とライ
ン流れ方向と直交する方向に対する離隔距離とから、第
1の画像データ記憶手段(B)に記憶された画像データ
Dの位置情報を補正する位置補正手段(C)と、 同一図柄でかつ位置ずれのないパターンの画像データを
基本データdとして記憶する第2の画像データ記憶手
段(E)と、 前記検査パターンRをほぼ中心に含む検索領域Qを設定
し、前記検査パターンRと同じ大きさとした検出領域q
を、この検索領域Q内で順次シフトさせたときに、該検
出領域qに対応する、上記画像データD上の検出データ
dと、前記第2の画像データ記憶手段(E)よりの基本
データdとを各画素毎に比較を行って両データ間での
マッチング度合を調べるテンプレートマッチング手段
(F)と、 前記テンプレートマッチング手段(F)による比較によ
り、マッチング度合が最高であったときの前記検出領域
qのシフト位置から、当該図柄のずれ量を求める位置判
定手段(G)とを備えたことを特徴とする表示図柄のず
れ検査装置。
1. A device for inspecting a positional deviation of a product conveyed on a line or a wrapping paper of the product, which inspects the product or a part of the product conveyed to an inspection position. An area 41 including a pattern R and including the inspection pattern R
(A) for imaging the image, and image data D of the imaging region 41 imaged by the camera (A)
A first image data storage means (B) for storing the product, and a separation distance with respect to the line flow direction of the product in the image data D stored in the first image data storage means (B) and a direction orthogonal to the line flow direction. The position correction means (C) that corrects the position information of the image data D stored in the first image data storage means (B) from the separation distance with respect to the image data of the pattern having the same design and no positional deviation. A second image data storage unit (E) for storing the basic data d 0 and a search area Q including the inspection pattern R at the center are set, and a detection area q having the same size as the inspection pattern R is set.
Are sequentially shifted in the search area Q, the detection data d on the image data D corresponding to the detection area q and the basic data d from the second image data storage means (E) The template matching means (F) for checking the matching degree between both data by comparing 0 with each pixel, and the detection when the matching degree is the highest by the comparison by the template matching means (F). A deviation checking device for a display symbol, comprising: a position determining means (G) for obtaining a deviation amount of the symbol from the shift position of the area q.
【請求項2】上記テンプレートマッチング手段(F)
は、検出領域qをm画素づつシフトさせることにより、
マッチング度合が最高となったときの検出領域qの位置
を中心とした第2の検索領域Q′(<Q)を設定し、こ
の第2の検索領域Q′に対し、検出領域qをn(<m)
画素づつシフトさせる操作を、検出領域qのシフト量が
1画素となるまで繰り返す、請求項1記載の表示図柄の
ずれ検査装置。
2. The template matching means (F)
By shifting the detection area q by m pixels,
A second search area Q '(<Q) centered on the position of the detection area q when the degree of matching is maximized is set, and the detection area q is set to n ( <M)
The display pattern deviation inspection device according to claim 1, wherein the operation of shifting pixel by pixel is repeated until the shift amount of the detection region q becomes 1 pixel.
JP1308246A 1989-11-28 1989-11-28 Deviation inspection device for display pattern Expired - Lifetime JPH0663734B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1308246A JPH0663734B2 (en) 1989-11-28 1989-11-28 Deviation inspection device for display pattern

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1308246A JPH0663734B2 (en) 1989-11-28 1989-11-28 Deviation inspection device for display pattern

Publications (2)

Publication Number Publication Date
JPH03167407A JPH03167407A (en) 1991-07-19
JPH0663734B2 true JPH0663734B2 (en) 1994-08-22

Family

ID=17978699

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1308246A Expired - Lifetime JPH0663734B2 (en) 1989-11-28 1989-11-28 Deviation inspection device for display pattern

Country Status (1)

Country Link
JP (1) JPH0663734B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3924796B2 (en) * 1995-04-25 2007-06-06 株式会社デンソー Pattern position measuring method and measuring apparatus
JP4573431B2 (en) * 2000-12-21 2010-11-04 花王株式会社 Surface inspection method and surface inspection apparatus for soap containing bubbles
JP2010025855A (en) * 2008-07-23 2010-02-04 Sakata Denki Track displacement measuring device
JP5956241B2 (en) * 2012-05-07 2016-07-27 株式会社ブリヂストン Inspection method and inspection apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60190802A (en) * 1984-07-20 1985-09-28 Hitachi Ltd Method and apparatus for detecting position
JPS6159575A (en) * 1984-08-30 1986-03-27 Hitachi Ltd Pattern inspecting system
JPS61151709A (en) * 1984-12-26 1986-07-10 Hitachi Ltd Method and apparatus of graphic pattern matching in position
JPS61176807A (en) * 1985-02-01 1986-08-08 Hitachi Ltd Inspection of pattern

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60190802A (en) * 1984-07-20 1985-09-28 Hitachi Ltd Method and apparatus for detecting position
JPS6159575A (en) * 1984-08-30 1986-03-27 Hitachi Ltd Pattern inspecting system
JPS61151709A (en) * 1984-12-26 1986-07-10 Hitachi Ltd Method and apparatus of graphic pattern matching in position
JPS61176807A (en) * 1985-02-01 1986-08-08 Hitachi Ltd Inspection of pattern

Also Published As

Publication number Publication date
JPH03167407A (en) 1991-07-19

Similar Documents

Publication Publication Date Title
JPH11148807A (en) Method and instrument for measuring bump height
KR101643713B1 (en) Method for inspecting of product using learning type smart camera
JP2000180382A (en) Visual examination apparatus
JP2002005846A (en) Defect inspecting apparatus
JPH11248641A (en) Device and method for inspecting surface defect
JPH0663734B2 (en) Deviation inspection device for display pattern
JPH07332951A (en) Apparatus and method for inspecting image
EP0443062B1 (en) Device for inspecting quality of printed matter and method thereof
JP2004170394A (en) Press plate inspection device and press plate inspection system
JP6359363B2 (en) Container inspection device and container inspection method
JP2002288633A (en) Image processing device and its positional correction method
KR100691433B1 (en) Electronic part vision inspection method
JP2002008029A (en) Image inspection device
JP2011112593A (en) Inspection method and inspection device of printed matter
JP2561193B2 (en) Print pattern inspection device
JPH0995028A (en) Printing inspection device
JPH07121721A (en) Printed character inspecting method
JP2000214103A (en) Defect-inspecting device
JP3177945B2 (en) Surface defect inspection equipment
JP4278764B2 (en) Defect inspection apparatus and defect inspection method
JPH0544982B2 (en)
JP2012122877A (en) Method for inspecting foreign substance in liquid
JPH07159127A (en) Dimension inspecting method and device
JP3400859B2 (en) Defect pattern detection method and device
JP2001242086A (en) Article testing method based on image processing and its device