JPH03167407A - Apparatus for inspecting deviation of display pattern - Google Patents

Apparatus for inspecting deviation of display pattern

Info

Publication number
JPH03167407A
JPH03167407A JP1308246A JP30824689A JPH03167407A JP H03167407 A JPH03167407 A JP H03167407A JP 1308246 A JP1308246 A JP 1308246A JP 30824689 A JP30824689 A JP 30824689A JP H03167407 A JPH03167407 A JP H03167407A
Authority
JP
Japan
Prior art keywords
pattern
image data
region
matching
detection area
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
JP1308246A
Other languages
Japanese (ja)
Other versions
JPH0663734B2 (en
Inventor
Ryoichi Yamada
良一 山田
Takashi Kusuyama
楠山 尚
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)

Abstract

PURPOSE:To decrease the number of pattern comparing circuit by judging whether a pattern is located at a normal position or not based on comparison in template matching and the shift position of a detecting region when the matching degree is at the highest degree. CONSTITUTION:As basic data (a) as a reference in comparison inspection, image data which are equal to a pattern to be inspected and have no position deviation are registered in a second image-data memory means C. Image data containing a pattern region to be inspected R are picked up and stored in a first image- data memory means B. At the time of the inspection, an inspecting region (theta) having the same size as the region R is sequentially shifted in a specified retrieving region Q including the region R. At this time, the detected data are read out of the means B in correspondence with the region (q). The matching degree of both detected data and the reference data which are read out of the means C is examined. Whether the pattern is located at the normal position or not is judged with a position judging means E based on the position of the region (q) when the matching degree becomes the highest value.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は製品の包装紙に印刷された商品名等の図柄の位
置ずれを検査する装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an apparatus for inspecting misalignment of designs such as product names printed on product wrapping paper.

〔従来の技術〕[Conventional technology]

例えば石餘のような製品は、個々に包装紙にて包装され
た上、一つの箱に複数個詰められており、各々の石鹸の
上面部分にあたる包装紙には商品名等の図柄が印刷され
ている。従って、上記包装の際に包装紙のずれにより、
前記図柄が所定位置に位置しない石鹸が一つでもあると
、目立ち易く、商品に対する品質やブランドを損ねる恐
れがある。
For example, products such as soap soap are individually wrapped in wrapping paper and multiple pieces are packed in one box, and the product name and other designs are printed on the wrapping paper on the top of each soap. ing. Therefore, due to the shift of the wrapping paper during the above packaging,
If even one soap does not have the above-mentioned design in a predetermined position, it will be easily noticeable and may damage the quality and brand of the product.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

そこで、従来は、個々の石鹸に対して図柄が所定位置に
あるか否かを目視点検により検査していたが、ラインの
流れが早いこともあり、正確な検査は不可能であった。
Therefore, in the past, each soap was visually inspected to see if the pattern was in a predetermined position, but due to the rapid flow of the line, accurate inspection was impossible.

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

〔課題を解決するための手段〕 本発明の表示図柄のずれ検査装置は、第1図に示すよう
に、製品もしくは製品の包装紙に記された図柄の位置ず
れを検査する装置であって、検査対象とする前記図柄も
しくは該図柄の一部の領域■を含むようにして撮像する
カメラAと、前記カメラA”i?撮像した画像データを
記憶する第1の画像データ記憶手段Bと、 位置ずれのない前記図柄もしくは該図柄の一部の基準と
なる基本データを記憶する第2の画像データ記憶手段C
と、 前記領域Rと同じ大きさとした検出領域qを、該領域R
を含む検索領域Q内で順次シフ1・させたときに、該検
出領域qに対応して、前記第1の画像データ記憶手段B
より読み出した検出データと、前記第2の画像データ記
憶千段Cより読み出した基本データとを各画lP.毎に
比較を行って両データ間でのマッチング度合いを閥べる
テンプレートマッチング手段Dと、 前記テンプレートマッチングによる比鮫により、マッチ
ング度合いが最高であったときの前記検出領域qのシフ
ト位置に基づき当該図柄もしくは該図柄の一部が正常な
位置にあるか否かを判定する位置判定手段Eとを備えた
ことを持微とする。
[Means for Solving the Problems] As shown in FIG. 1, the display pattern displacement inspection device of the present invention is a device for inspecting the displacement of a design written on a product or a product wrapping paper, and includes: A camera A that captures an image so as to include the pattern to be inspected or a partial area of the pattern; a first image data storage means B that stores image data captured by the camera A''; a second image data storage means C for storing basic data serving as a reference for the symbol or a part of the symbol;
and, a detection area q having the same size as the area R is set as the area R.
When the shift 1 is performed sequentially within the search area Q including
The detection data read out from the second image data storage stage C and the basic data read out from the second image data storage stage C are stored in each image IP. a template matching means D that compares the degree of matching between both data at each time, and a template matching means D that compares the degree of matching between both data; The present invention is characterized by a position determining means E for determining whether the symbol or a part of the symbol is in a normal position.

〔作用〕[Effect]

比較検査の際の基準となる基本データとして、検査対象
とする図柄もしくは該図柄の一部と同一であってかつ位
置ずれのない画像データを第2の画像データ記憶手段C
に登録させておき、一方、カメラAにて、検査対象の図
柄もしくは図柄の一部の領域Rを含む画像データを撮像
して第1の画像データ記憶手段Bに記憶させる。そして
、検査時には、前記領域と同じ大きさとした検出領域q
を、該領域Rを含む所定の検索領域Q内で順次シフトさ
せたときに、該検出領域qに対応して、前記第1の画像
データ記憶手段Bより、順次に検出データとして読み出
され、この検出データと、第2の画像データ記憶千段C
から読み出した基本データとが、テンプレートマッチン
グ手段Dにおいて、各画素毎に比較されて両データ間で
のマッチング度合いが凋べられ、マッチング度合が最高
となったときの前記検出領域qの位置から当該図柄もし
くは該図柄の一部が正常な位置にあったか否かが位置判
定手段Eによって判定される。
As basic data serving as a reference for comparative inspection, image data that is the same as the pattern to be inspected or a part of the pattern and that has no positional deviation is stored in the second image data storage means C.
On the other hand, the image data including the pattern to be inspected or a part of the area R of the pattern is captured by the camera A and stored in the first image data storage means B. At the time of inspection, a detection area q having the same size as the above area is set.
are sequentially shifted within a predetermined search area Q including the area R, sequentially read out as detection data from the first image data storage means B corresponding to the detection area q, This detected data and the second image data storage stage C
The template matching means D compares each pixel with the basic data read out from the template matching means D to improve the degree of matching between the two pieces of data. The position determining means E determines whether the symbol or a part of the symbol is in a normal position.

〔実施例〕〔Example〕

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

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

7は本装置を集中制御するためのCPU(中央演算処理
装置)であり、内部には、後で詳しく述べる画像処理の
際に機能する画像処理郎7aを有する。8は、CPU7
が行う制御プログラムを格納するROM(リードオンリ
ーメモリ)である。9は、信号入力郎であり、前記セン
サー3.4よりの検出信号はこの信号入力郎9を介して
CPU7に取り込まれる。IOは、前記カメラ6よりの
映像信号を記憶する画像メモリであり、1lは、カメラ
6による撮像画面をモニターするための画像モニターデ
ィスプレイである。l2は、種々の設定条件等を入力す
るためのキーボードである。l3は、本装置の検査によ
り、表示図柄の位置ずれによる不良が検出された石鹸l
をラインの流れから排出させるための排出装置であり、
14は、排出装置13に対するCPU7の信号出力部で
ある,!5は、本装置にて行なった検査結果を表示する
計測結果表示ディスプレイであり、16は、前記検査結
果をデータとして記憶するためのフロッピーディスク装
置である。
Reference numeral 7 denotes a CPU (central processing unit) for centrally controlling the present apparatus, which includes an image processing unit 7a that functions during image processing, which will be described in detail later. 8 is CPU7
This is a ROM (read only memory) that stores control programs executed by the ROM. 9 is a signal input port, and the detection signal from the sensor 3.4 is taken into the CPU 7 via this signal input port 9. IO is an image memory that stores the video signal from the camera 6, and 1l is an image monitor display for monitoring the image captured by the camera 6. 12 is a keyboard for inputting various setting conditions and the like. 13 is a soap l for which a defect due to misalignment of the display pattern was detected by the inspection of this device.
It is a discharge device for discharging from the flow of the line,
14 is a signal output section of the CPU 7 to the ejection device 13,! Reference numeral 5 denotes a measurement result display display for displaying the test results performed by this apparatus, and 16 is a floppy disk device for storing the test results as data.

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

まず最初に、以下に説明する検査の際に必要となる基本
パターンについて述べる。第4図は、カメラ6で撮像さ
れた石鹸lの画像を示しており、外枠4lはカメラ6の
撮像領域である。石鹸lにおいて、“bac”とあるの
は商標名であり、“WH夏TE”とあるのは商品名であ
り、又、石鹸1の下方にあるのは、ストライプの図柄を
示している。
First, we will discuss the basic patterns required for the inspection described below. FIG. 4 shows an image of the soap l taken by the camera 6, and the outer frame 4l is the imaging area of the camera 6. In Soap 1, "bac" is a trade name, "WH Summer TE" is a product name, and below Soap 1 is a striped pattern.

検査対象とするパターン(以下検査パターンRという)
は、前記文字あるいは図柄のいずれを採用してもよいが
、本実施例では、“bac”の内の中央の文字“a”と
した。これに伴い比較の際の基準となるパターンとして
、検査パターンRと同一の基本パターンR0を予め登録
しておく必要かあり、この基本パターンRnに対する情
報としては、第5図(A)に示したように、文字゜a”
の領域に対する画素データと、文字“a”の、石鹸lの
端縁よりの距HXs yのデータを含み、その登録方法
については後で述べる。
Pattern to be inspected (hereinafter referred to as inspection pattern R)
may be any of the above-mentioned letters or designs, but in this embodiment, the central letter "a" in "bac" is used. Accordingly, it is necessary to register in advance the basic pattern R0, which is the same as the inspection pattern R, as a reference pattern for comparison, and the information for this basic pattern Rn is shown in FIG. 5(A). Like, the letter ゜a”
It includes pixel data for the area , and data of the distance HXsy of the character "a" from the edge of the soap l, and the method of registering it will be described later.

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

ステップS4では、石鹸1が検査位[ζこ次々ζこ搬送
さ゜れているか否かが判定され、続けて搬送されている
ときは次のステップS5に進む、ところでカメラ6より
1フィールドの画面を取り込むにはl/60秒必要とす
るので、シャッター付きカメラを用いた場合、フィール
ドの先頭でシャッターを切るので、次の画像取り込みに
l/60秒待つことになる。従って、センサー3.4よ
りの検出信号と、実際の画像取り込みとの間に最悪の場
合で1/60秒のずれが発生し、ライン速度が40n/
分の場合、第4図で示したように、1/60秒の間に石
鹸lがllIIIII1移動することになる。そこでこ
のステップS5において、画像メモリー10に記憶され
た石鹸lの画像データから、石鹸lの一方の端縁Lを検
出し、撮像領域4l内の石鹸1の、ライン流れ方向に対
する離隔距離X(第5図(B)に図示)を求め、又、石
鹸lの、ライン流れ方向と直交する方向に対する離隔距
離Y(第5図(C)に図示)を求め、正確な測定位置に
ある石鹸Iに対して同様に測定した距離から、前記石鹸
1の画像データが位置補正される。ステップS6では、
第5図(D)に示すように、検査パターンRである文字
“a”を中心とした検索領域Qが決定される。
In step S4, it is determined whether or not the soap 1 is being conveyed to the inspection position [ζ one after another. If it is being conveyed continuously, the process proceeds to the next step S5. By the way, one field of screen is captured by the camera 6. It takes 1/60 seconds to capture an image, so if a camera with a shutter is used, the shutter is released at the beginning of the field, so it will take 1/60 seconds to capture the next image. Therefore, in the worst case, there will be a lag of 1/60 seconds between the detection signal from sensor 3.4 and the actual image capture, and the line speed will be 40n/2.
In the case of 1 minute, as shown in FIG. 4, the soap 1 moves 11 times in 1/60 seconds. Therefore, in step S5, one edge L of the soap l is detected from the image data of the soap l stored in the image memory 10, and the separation distance X (the 5 (B)), and the separation distance Y (shown in FIG. 5 (C)) of the soap l in the direction orthogonal to the line flow direction. The position of the image data of the soap 1 is corrected based on the distance measured in the same manner. In step S6,
As shown in FIG. 5(D), a search area Q centered on the letter "a", which is the test pattern R, is determined.

次のステップS7では、第5図(E)に示すごとく、検
索領域Qに対して、次々にシフトさせる小区画の領域(
以下検出領域qという)から読み出した画像データ(以
下検出データという)と、基本パターンR0の画像デー
タ(以下基本データという)とのマッチングを度合いを
調べるテンプレートマッチングが行われる。このテンプ
レートマッチングの処理を第6図〜第8図のパターン図
を用いて具体的に説明する。
In the next step S7, as shown in FIG. 5(E), the area of small sections (
Template matching is performed to check the degree of matching between the image data read from the detection area q (hereinafter referred to as detection data) and the image data of the basic pattern R0 (hereinafter referred to as basic data). This template matching process will be specifically explained using pattern diagrams shown in FIGS. 6 to 8.

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

した検出領域qであり、この検出領域qよりの検出デー
タと、基本パターンR0よりの基本データとどの程度マ
ッチングしているかを調べるようになっているが、以下
に説明するマッチング判定をわかり易くするために、検
出領域qに基本パターンR。
The detection area q is a detection area q, and the extent to which the detection data from this detection area q matches the basic data from the basic pattern R0 is investigated, but in order to make the matching judgment explained below easier to understand. , the basic pattern R is in the detection area q.

の画素情報を示した。pixel information is shown.

I−1図においては、検出領域qより読み出した検出デ
ータは、 調べるために、対応する各画素間で減算を行なうと次表
のようになる。
In Figure I-1, the detection data read from the detection area q is subtracted between each corresponding pixel in order to examine it, resulting in the following table.

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

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

次の1−3図で示すように検出領域qが右端までくると
、次の1−4図で示すよう1こ、検出領域qは左端に戻
ると共1こ4画素分下方にシフトする。
When the detection area q reaches the right end as shown in the following figure 1-3, the detection area q returns to the left end and shifts downward by one or four pixels as shown in the next figure 1-4.

次の1−5rlJになると、検出領域qと、検査パター
ンRとで一部の画素で合致するようになる。このときの
検出データは、 であり、基本データとの減算を行なうと、Oとなったマ
ッチング画素数は、6個であり、パターンI−t〜I−
4のときに比べてマッチング度合いが高くなっている。
At the next 1-5rlJ, the detection area q and the inspection pattern R come to match in some pixels. The detected data at this time is as follows, and when subtracted from the basic data, the number of matching pixels that becomes O is 6, and the patterns I-t to I-
The degree of matching is higher than in case 4.

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

I[−1図では、検出領域qは、検索領域Q゜内の左上
から始まり、今度は2画素づつシフトする。
I[-1 In the diagram, the detection area q starts from the upper left within the search area Q° and is now shifted by two pixels.

この場合も、第1段階と同様に、マッチング画素数を調
べると、n−1,n−4、II−7及び■一9図では4
個であるのに対し、II−2、If−3、n−5及びI
I−6図では6個となり、マッチング度合いが高くなっ
ている。尚、本実施例では説明を簡略化するために、画
像データを12Xl2の144画素とし、基準画像デー
タを3×3の9画素としたため、前記のn−2、II−
3、II−5及びn−6図でマッチング度合いが等しく
なったが、実際に適用する検索領域Qは、60X60の
3600画素であり、検出領域qは28X2Bの784
画業であるため、いずれかのマッチングでマッチング度
合いが最高となる。ここでは、n−2図でマッチング度
合が最高となったとして以下話しを進める。
In this case, as in the first stage, when we examine the number of matching pixels, we find n-1, n-4, II-7, and 4 in Figure 1-9.
II-2, If-3, n-5 and I
In Figure I-6, there are six, indicating a high degree of matching. In this example, in order to simplify the explanation, the image data was set to 144 pixels of 12Xl2, and the reference image data was set to 9 pixels of 3x3, so the above n-2, II-
3, II-5 and n-6, the matching degree is the same, but the search area Q actually applied is 3600 pixels of 60×60, and the detection area q is 784 pixels of 28×2B.
Since it is a painting industry, the degree of matching is the highest in any one of the matching methods. Here, we will proceed with the following discussion assuming that the degree of matching is highest in the n-2 diagram.

II−10図で示したように、II−6図における検出
領域qを中心として周囲に1画素分だけ広げた領域とし
た検索領域Q”を設定し、次に第8図に示す第3段階へ
進む。
As shown in Figure II-10, a search area Q'' is set as an area centered around the detection area q in Figure II-6 and expanded by one pixel around it, and then the third stage shown in Figure 8 is performed. Proceed to.

第3段階においては、検出領域qは、検索領域Q”内を
左上から1画素づつシフトする。この場合のマッチング
度合いは、図から明らかなように、III−9図で検出
データと基本データとが完全に合致するtこめに最高と
なり、マッチング画素数は9個となる。そこで次のステ
ップS8ではIII−10図で示したように、[[−9
図における検出領域qの位置がどこにあったかを検出し
、その検出した位置を石鹸lの検査パターンRであった
文字@a“の位置とし、その位置と基本パターンR0に
対する前記距111x,y(第5図(A)図示)とから
、検査対象の石鹸lにおける表示図柄のずれ量が演算さ
れる。ステップS9では、そのずれ量の大きさから良品
か不良品かの判定が行われ、ずれ量が規定値よりも大き
く不良品と判定されたときは、ステップSIOの排出処
理に進む。
In the third stage, the detection area q is shifted one pixel at a time from the upper left within the search area Q''.As is clear from the figure, the degree of matching in this case is as shown in Figure III-9 between the detection data and the basic data. reaches its maximum value at the end of t, where t completely matches, and the number of matching pixels becomes 9.Therefore, in the next step S8, as shown in Figure III-10, [[-9
The position of the detection area q in the figure is detected, and the detected position is set as the position of the character @a", which was the inspection pattern R of the soap l, and the distance 111x, y (th) between that position and the basic pattern R0 is determined. 5 (A) shown), the amount of deviation of the displayed pattern on the soap l to be inspected is calculated.In step S9, it is determined whether the product is good or defective based on the size of the amount of deviation, and the amount of deviation is If the value is larger than the specified value and the product is determined to be defective, the process proceeds to step SIO for discharge processing.

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

第3図(A)に戻り、次のステップSllでは、ずれ量
等が叶測結果、表示ディスプレイl5に表示され、次の
ステップS12でキーボード12より、終了のキーを押
したときは、この検出モードが終了し、元のステップS
lに戻るが、そうでない場合は、ステップS2に戻り、
次に検査位置に送給される石鹸lに対して上述と同様な
検査を行なう。
Returning to FIG. 3(A), in the next step Sll, the measurement results such as the amount of deviation are displayed on the display l5, and when the end key is pressed on the keyboard 12 in the next step S12, this detection The mode ends and the original step S
Return to l, but if not, return to step S2,
Next, the same test as described above is performed on the soap l delivered to the test position.

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

上述したテンプレートマッチングにおいては、比較動作
を3段階に分け、各段階に適正な検索領域Q.Q’,Q
”を設定するようにしたので、一つの石atに対して行
なうべき総比較回数を低減できる。例えば、検索領域Q
を60X60画素、検出領域qを28X28画素とした
とき、検索領域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 an appropriate search area Q. Q',Q
”, the total number of comparisons that need to be made for one stone can be reduced.For example, if the search area Q
is 60 x 60 pixels and the detection area q is 28 x 28 pixels, the detection area q is set for pattern comparison within the search area Q.
The range of movement is 32 ÷ 4 = 8 movements because in the first step, every 4 pixels are compared, which means 9 movements including the comparison at the origin, 9 times in the horizontal direction and 9 times in the vertical direction. A total of 81 basic patterns are compared.

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

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

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

一方、これを通常の!画素毎のテンプレートマッチング
法で行う場合、 60−28=32 横方向へ32画素、縦方向へ32画素の比較移動が必要
であり、原点の比較を含めると、33回の比較が必要で 33X33=1089回にもなる。
On the other hand, this is normal! When using the pixel-by-pixel template matching method, 60-28=32 Comparative movement of 32 pixels in the horizontal direction and 32 pixels in the vertical direction is required, and if the comparison of the origin is included, 33 comparisons are required, and 33X33= That's 1089 times.

このように本発明に適用したテンプレートマッチング法
では比較回数を通常の11分の1程度に低減でき高速の
検査が可能となるので、石鹸lのように藍分間に250
ないし300個もの大量が流れるラインであっても、当
該検査装置を安価なコンピュータ装置によって実現でき
る。
In this way, the template matching method applied to the present invention can reduce the number of comparisons to about one-eleventh of the usual number and enable high-speed inspection.
Even in a line where a large quantity of 300 to 300 pieces flows, the inspection device can be implemented using an inexpensive computer device.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明は、検査する製品に対する
画像データに対し、所定の読出し領域を順次シフトさせ
つつして読み出した検出データと、予め登録してあった
位置ずれのない基本データとのマッチング程度をテンプ
レートマッチング法にて調べることにより、当該製品の
図柄もしくは図柄の一部の位置を検出し、良・不良を判
定するようにしたので、登録する基本データを変えるだ
けで種々の商品に対する表示図柄の位置ずれを検出でき
る。又、テンプレートマッチングでのパターン比較の際
、検出領域qを1画素づつではなく、数画素づつシフト
させて、検出すべき図柄もしくは図柄の一部のおおまか
な位置を検出し、次にこの検出した立置を中心とした検
索領域Q゜に狭めて、以下同様なパターン比較を行う方
法を採用すれば、パターン比較回数を大幅に低減でき、
それ故、処理速度の遅い安価なコンピュータ装置にて本
装置を実現できる。
As explained above, the present invention enables detection data read out by sequentially shifting a predetermined readout area with respect to image data for a product to be inspected, and basic data registered in advance with no positional deviation. By checking the degree of matching using the template matching method, we can detect the position of the design or part of the design of the product and determine whether it is good or bad. It is possible to detect the positional shift of the displayed pattern. Also, when comparing patterns in template matching, the detection area q is shifted not by one pixel but by several pixels to detect the approximate position of the pattern or part of the pattern to be detected, and then If we narrow the search area to Q゜ centered on Q゜ and then use a method to perform similar pattern comparisons, the number of pattern comparisons can be greatly reduced.
Therefore, the present device can be implemented using an inexpensive computer device with a slow processing speed.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の表示図柄のずれ検査装置のクレーム対
応図、第2図は本発明の一実施例を示すシステム図、第
3図(A)及び第3図(B)は第2図図示の装置の制御
動作を示すフローチャート、第4図は、第2図の装置に
おいて、カメラ4こて撮像された石鎗の画像を示す図、
第5図(A)は、第4図図示の石蛤に対する基本パター
ンを示す図、第5図(B)及び第5図(C)は撮像した
石鹸の位置補正を説明するための図、第5図(D)は、
石鹸に゛おける検査パターンに対して設定した検索領域
を示す図、第5図(E)は、テンプレートマッチングを
示す図、第5図(F)は、検査結果であるずれ量を示す
図、第6図ないし第8図は、テンプレートマッチングで
なされる比較処理を示すパターン図である。 !・・・石鹸、2・・・コンベア、3.4・・・センサ
ー5・・・照明灯、6・・・カメラ、7・・・CPU,
7a・・・画像処理部、8・・・ROM,lO・・・画
像メモリー 11・・・画像モニターディスプレイ、l2・・・キー
ボード、l3・・・排出装置、l5・・・計測結果表示
ディスプレイ、l6・・・フロッピーディスク装置。
Fig. 1 is a complaint correspondence diagram of the display pattern deviation inspection device of the present invention, Fig. 2 is a system diagram showing an embodiment of the present invention, and Fig. 3 (A) and Fig. 3 (B) are Fig. 2 4 is a flowchart showing the control operation of the illustrated device; FIG. 4 is a diagram showing an image of the stone spear captured by the camera 4 in the device shown in FIG. 2;
FIG. 5(A) is a diagram showing the basic pattern for the stone clam shown in FIG. 4, FIG. 5(B) and FIG. Figure 5 (D) is
FIG. 5(E) is a diagram showing the search area set for the inspection pattern for soap. FIG. 5(E) is a diagram showing template matching. FIG. 6 to 8 are pattern diagrams showing comparison processing performed in template matching. ! ...Soap, 2...Conveyor, 3.4...Sensor 5...Lighting light, 6...Camera, 7...CPU,
7a... Image processing section, 8... ROM, lO... Image memory 11... Image monitor display, l2... Keyboard, l3... Ejection device, l5... Measurement result display display, l6...Floppy disk device.

Claims (2)

【特許請求の範囲】[Claims] (1)製品もしくは製品の包装紙に記された図柄の位置
ずれを検査する装置であって、 検査対象とする前記図柄もしくは該図柄の一部の領域R
を含むようにして撮像するカメラと、前記カメラで撮像
した画像データを記憶する第1の画像データ記憶手段と
、 位置ずれのない前記図柄もしくは該図柄の一部の基準と
なる基本データを記憶する第2の画像データ記憶手段と
、 前記領域Rと同じ大きさとした検出領域qを、該領域R
を含む検索領域Q内で順次シフトさせたときに、該検出
領域qに対応して、前記第1の画像データ記憶手段より
読み出した検出データと、前記第2の画像データ記憶手
段より読み出した基本データとを各画素毎に比較を行っ
て両データ間でのマッチング度合いを調べるテンプレー
トマッチング手段と、 前記テンプレートマッチングによる比較により、マッチ
ング度合いが最高であったときの前記検出領域qのシフ
ト位置に基づき当該図柄もしくは該図柄の一部が正常な
位置にあるか否かを判定する位置判定手段とを備えたこ
とを特徴とする表示図柄のずれ検査装置。
(1) A device for inspecting the positional deviation of a design written on a product or product wrapping paper, which includes a region R of the design or a part of the design to be inspected.
a first image data storage means that stores the image data taken by the camera; and a second image data storage means that stores basic data serving as a reference for the pattern or a part of the pattern without positional deviation. image data storage means, and a detection area q having the same size as the area R.
, the detection data read out from the first image data storage means and the basic information read out from the second image data storage means corresponding to the detection area q. a template matching means that compares the data pixel by pixel to check the degree of matching between the two data; 1. A display symbol shift inspection device comprising: position determination means for determining whether the symbol or a part of the symbol is in a normal position.
(2)上記テンプレートマッチング手段は、検出領域q
をm画素づつシフトさせることにより、マッチング度合
いが最高となったときの検出領域qの位置を中心とした
第2の検索領域Q′(<Q)を設定し、この第2の検索
領域Q′に対し、検出領域qをn(<m)画素づつシフ
トさせる操作を、検出領域qのシフト量が1画素となる
まで繰り返す、請求項1記載の表示図柄のずれ検査装置
(2) The template matching means detects the detection area q
By shifting by m pixels, a second search area Q'(<Q) centered at the position of the detection area q when the matching degree is the highest is set, and this second search area Q' 2. The display pattern shift inspection device according to claim 1, wherein the operation of shifting the detection area q by n (<m) pixels is repeated until the amount of shift of the detection area 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 true JPH03167407A (en) 1991-07-19
JPH0663734B2 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872871A (en) * 1995-04-25 1999-02-16 Nippondenso Co., Ltd. Method and device for measuring the position of a pattern
JP2002189001A (en) * 2000-12-21 2002-07-05 Kao Corp Method of inspecting translucent mold surface
JP2010025855A (en) * 2008-07-23 2010-02-04 Sakata Denki Track displacement measuring device
JP2013234862A (en) * 2012-05-07 2013-11-21 Bridgestone Corp Examination method and examination 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

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872871A (en) * 1995-04-25 1999-02-16 Nippondenso Co., Ltd. Method and device for measuring the position of a pattern
JP2002189001A (en) * 2000-12-21 2002-07-05 Kao Corp Method of inspecting translucent mold surface
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
JP2013234862A (en) * 2012-05-07 2013-11-21 Bridgestone Corp Examination method and examination apparatus

Also Published As

Publication number Publication date
JPH0663734B2 (en) 1994-08-22

Similar Documents

Publication Publication Date Title
JPH0736004B2 (en) Inspection method and device
JPH07159337A (en) Fault inspection method for semiconductor element
JPH03167407A (en) Apparatus for inspecting deviation of display pattern
KR100691433B1 (en) Electronic part vision inspection method
JP2002008029A (en) Image inspection device
JPH06102199A (en) Method and device for automatic cloth inspection
JP2001235425A (en) Method and apparatus for inspecting thickness irregularity of pet bottle
KR20000058836A (en) Inspecting Method Of Electronic Parts
JPH0843048A (en) Method and apparatus for compensating inspection accuracy of inspecting system for appearance of article
JPH07286836A (en) Method for inspecting molded goods and method for controlling molding
JPH0829357A (en) Appearance inspection device for automation line
JP2001175866A (en) Device and method for image process inspection
JPH071935B2 (en) Package abnormality inspection device
JPH0544982B2 (en)
JP2000221514A (en) Method for inspecting rib omission of color filter substrate with rib
JPH11132966A (en) Meandering following apparatus for flaw inspection apparatus
JP3053707B2 (en) Paper misregistration amount detection method, apparatus thereof, and printed matter evaluation apparatus
JP2002352222A (en) Printing inspecting device for glass tableware printer
JP4074718B2 (en) Inspection device and inspection method
JP2786554B2 (en) Long body inspection equipment
JPH0679862A (en) Method for inspecting quality of printing paper surface and apparatus therefor
JPH0324671A (en) Device for inspecting defect
JPH09101268A (en) Defect inspection device
JPH0976470A (en) Printed matter inspecting device
JPH0578399B2 (en)