JPH0896077A - Apparatus and method for detecting inclination of symbol string - Google Patents

Apparatus and method for detecting inclination of symbol string

Info

Publication number
JPH0896077A
JPH0896077A JP6262064A JP26206494A JPH0896077A JP H0896077 A JPH0896077 A JP H0896077A JP 6262064 A JP6262064 A JP 6262064A JP 26206494 A JP26206494 A JP 26206494A JP H0896077 A JPH0896077 A JP H0896077A
Authority
JP
Japan
Prior art keywords
symbol string
symbol
inclination
detecting
string
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.)
Pending
Application number
JP6262064A
Other languages
Japanese (ja)
Inventor
Toshihiko Matsumoto
俊彦 松本
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP6262064A priority Critical patent/JPH0896077A/en
Publication of JPH0896077A publication Critical patent/JPH0896077A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)

Abstract

(57)【要約】 【目的】 文字又は記号列を撮像して、文字又は記号列
の傾きを検出する装置において、文字又は記号列中に最
も左(最初)又は最も右(最後)の文字又は記号と同じ
ものが複数存在する場合でも、記号又は文字列の最初と
最後の記号を参照して正確に文字又は記号列の傾きを検
出することができるようにする。 【構成】 文字列の撮像データから文字列の最初と最後
の文字をサーチし、所定の文字パターンとの一致度が高
い箇所を文字列の存在箇所として認識し、認識された文
字列中の最初と最後の文字に基づいて記号列の傾きを検
出する。このとき、最初又は最後の文字が文字列中に複
数存在した場合、文字列の端点位置を選択し、これに基
づいて文字列の傾きを検出するので、傾き検出の精度が
向上する。
(57) [Summary] [Purpose] In a device for detecting the inclination of a character or symbol string by imaging the character or symbol string, the leftmost (first) or rightmost (last) character in the character or symbol string or Even if there are a plurality of same symbols, it is possible to accurately detect the inclination of a character or symbol string by referring to the first and last symbols of the symbol or character string. [Structure] The first and last characters of the character string are searched from the image data of the character string, and the part with a high degree of matching with a predetermined character pattern is recognized as the existing part of the character string, and the first character in the recognized character string is detected. And the inclination of the symbol string is detected based on the last character. At this time, when a plurality of first or last characters are present in the character string, the end point position of the character string is selected and the inclination of the character string is detected based on this, so the accuracy of inclination detection is improved.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、物体を撮像したデータ
より、該物体に記された記号列の外観検査を行う記号列
の傾き検出装置及び方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus and a method for detecting the inclination of a symbol string for inspecting the appearance of the symbol string written on the object from the imaged data of the object.

【0002】[0002]

【従来の技術】従来、例えば、製品のロット番号などが
正しく記されているかといった外観検査を行うには、物
体に付された記号列を撮像し、この撮像画面内にどのよ
うに入ってくるかわからない記号列の撮像データより記
号列の傾きを検出し、水平位置に修正して記号を検査す
る装置及び方法が知られている。この装置及び方法にお
ける記号列の傾き検出及び修正方法を以下に説明する。
2. Description of the Related Art Conventionally, for example, in order to perform a visual inspection such as whether a lot number of a product is correctly written, a symbol string attached to an object is imaged and how it comes into the image pickup screen. There is known a device and a method for detecting a tilt of a symbol string from image data of an unknown symbol string, correcting the inclination of the symbol string, and inspecting the symbol by correcting it to a horizontal position. The method for detecting and correcting the inclination of the symbol string in this apparatus and method will be described below.

【0003】従来の記号列の傾き検出及び修正方法の概
念について図1を参照して説明する。まず、前設定段階
として、被検査対象の文字、記号などの数種のパターン
を記憶しておく。その際、検査時に物体が傾いているこ
とを考慮して、傾いたパターンも複数記憶しておく。こ
の例では、パターン文字として、「1,2,3,…」を
用いており、図1(a)に示すようなパターンを記憶し
ておく。さらに、物体自体の傾き、又は文字、記号など
の列(以下、文字列という)の傾きを求めるために、文
字列が左から右に並ぶ場合に、最も左にある文字と最も
右にある文字を入力する。この例では、仮に、それぞれ
「1」と「3」であるとする。
The concept of a conventional symbol string inclination detection and correction method will be described with reference to FIG. First, as a pre-setting step, several types of patterns such as characters and symbols to be inspected are stored. At that time, in consideration of the fact that the object is inclined at the time of inspection, a plurality of inclined patterns are stored. In this example, “1, 2, 3, ...” Is used as the pattern character, and the pattern as shown in FIG. 1A is stored. Furthermore, when the character strings are arranged from left to right in order to obtain the inclination of the object itself or the inclination of a string of characters or symbols (hereinafter referred to as a character string), the leftmost character and the rightmost character are arranged. Enter. In this example, it is assumed that they are "1" and "3", respectively.

【0004】次に、傾き検出段階として図1(b)に示
すように画面内を走査して前設定で記憶させてあるパタ
ーンとの一致度が高い箇所を求める。これにより、画面
内で記号列「1,2,3」の各記号が存在する概略の位
置が分かる。なお、文字のパターンの傾き角は、とびと
びの値を持つので、検査対象物体の文字と完全に一致す
るとは限らない。次に、図1(c)に示すように、検査
前に入力しておいた最も左と最も右にある文字、ここで
は「1」と「3」の文字の中心座標を求め、それぞれ中
心座標同士を結ぶ直線より、文字列全体としての水平方
向に対する傾き角度を算出する。最後に、外観検査の段
階として、図1(d)に示すように、上記傾き検出段階
で求めた傾き角度に合わせて画像メモリの内容をアフィ
ン変換で傾かせ、改めて文字パターンとのマッチングを
求めて検査結果とする。
Next, as an inclination detecting step, as shown in FIG. 1B, the screen is scanned to find a portion having a high degree of coincidence with the pattern stored in the preset setting. As a result, the approximate position where each symbol of the symbol string “1, 2, 3” exists on the screen can be known. Since the inclination angle of the pattern of the character has a discontinuous value, it does not always match the character of the object to be inspected. Next, as shown in FIG. 1C, the center coordinates of the leftmost and rightmost characters that have been input before the inspection, here, the characters “1” and “3” are obtained, and the center coordinates of the respective characters are calculated. The inclination angle of the entire character string with respect to the horizontal direction is calculated from the straight line connecting the two. Finally, as a visual inspection step, as shown in FIG. 1D, the contents of the image memory are tilted by affine transformation according to the tilt angle found in the tilt detection step, and matching with the character pattern is found again. The test result.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上述し
た従来の方法では、文字列の傾き検出段階で、指定した
最も左又は最も右と同じ文字が記号列中に複数存在する
場合、傾き角度算出のために参照する文字が入力された
最も左と右の文字になるかどうかは不定であり、例え
ば、図2に示すように、最も左の文字「1」は問題ない
が、最も右の文字「3」については文字列中に重複して
おり、どちらの「3」を傾き検出に用いるのかが不定と
なる。このような場合、最も左にある文字とその次に出
てきた右の文字を選択すると、これらの文字の中心を結
ぶ直線が短くなり、求める傾き角度の精度が悪くなる。
このため、記号列の水平修正も厳密に行われず、外観検
査が不確実なものとなる虞がある。
However, in the above-mentioned conventional method, when there are a plurality of designated leftmost or rightmost characters in the character string in the character string inclination detection step, the inclination angle is calculated. It is uncertain whether or not the character to refer to is the leftmost and rightmost characters that have been input. For example, as shown in FIG. 2, the leftmost character "1" is not a problem, but the rightmost character ""3" is duplicated in the character string, and it becomes uncertain which "3" is used for inclination detection. In such a case, when the leftmost character and the rightmost character that appears next are selected, the straight line connecting the centers of these characters becomes short, and the accuracy of the obtained tilt angle deteriorates.
Therefore, the horizontal correction of the symbol string is not strictly performed, and the appearance inspection may be uncertain.

【0006】本発明は、上記問題を解決するためになさ
れたもので、文字又は記号列の傾きを検出する際に、文
字又は記号列中に、最も左(最初)又は最も右(最後)
の文字又は記号と同じものが複数存在する場合でも、必
ずその中から最初の文字又は記号と最後の文字又は記号
とを物体の傾き角算出のために参照し、求める傾き角の
精度を向上させることができる記号列傾き検出装置及び
方法を提供することを目的とする。
The present invention has been made to solve the above problem, and when detecting the inclination of a character or symbol string, the leftmost (first) or rightmost (last) of the character or symbol string is detected.
Even if there are multiple characters or symbols that are the same as above, be sure to refer to the first character or symbol and the last character or symbol among them to calculate the tilt angle of the object, and improve the accuracy of the required tilt angle. It is an object of the present invention to provide a symbol string inclination detecting device and method capable of performing the inclination detection.

【0007】[0007]

【課題を解決するための手段】上記目的を達成するため
に請求項1の発明は、物体に記された記号列を撮像し、
その撮像データより記号列の傾きを検出する記号列傾き
検出装置において、記号列の最初と最後の記号を指定
し、そのパターンを記憶するパターン記憶手段と、撮像
データから、前記パターン記憶手段に記憶されたパター
ンと一致度が高い箇所を記号列の位置として検出する記
号列検出手段と、前記記号列検出手段により検出された
記号列の最初と最後の記号から該記号列の傾きを検出す
る傾き検出手段とを備え、前記傾き検出手段は、前記パ
ターン検出手段に記憶された最初又は最後の記号が記号
列中に複数存在する場合に、前記記号列検出手段により
検出した記号列位置の端点となる位置を選択して、その
端点に位置する記号に基づいて記号列の傾きを検出する
ものである。
In order to achieve the above-mentioned object, the invention of claim 1 images a symbol string described on an object,
In a symbol string inclination detecting device for detecting the inclination of a symbol string from the imaged data, a pattern storage means for designating the first and last symbols of the symbol string and storing the pattern, and the image data to be stored in the pattern memory means. Sequence detecting means for detecting a position having a high degree of coincidence with the generated pattern as the position of the symbol sequence, and inclination for detecting the inclination of the symbol sequence from the first and last symbols of the symbol sequence detected by the symbol sequence detecting means. A detecting means, the inclination detecting means, when a plurality of first or last symbols stored in the pattern detecting means are present in the symbol string, and an end point of the symbol string position detected by the symbol string detecting means. Is selected, and the inclination of the symbol string is detected based on the symbol located at the end point.

【0008】また、請求項2の発明は、前記請求項1の
構成において、前記傾き検出手段は、前記パターン検出
手段に記憶された最初と最後の記号が記号列中に複数存
在する場合に、その複数のうち最右端又は最左端に位置
する記号を選択し、この選択された記号の位置に基づい
て記号列の傾きを検出するものである。
According to a second aspect of the present invention, in the structure of the first aspect, when the inclination detecting means has a plurality of first and last symbols stored in the pattern detecting means in a symbol string, The symbol located at the rightmost end or the leftmost end is selected from the plurality of symbols, and the inclination of the symbol string is detected based on the position of the selected symbol.

【0009】また、請求項3の発明は、前記請求項1又
は請求項2の構成において、前記パターン記憶手段に、
複数の角度での記号のパターンを記憶させたものであ
る。
According to a third aspect of the present invention, in the structure of the first or second aspect, the pattern storage means has
The pattern of symbols at a plurality of angles is stored.

【0010】また、請求項4の発明は、請求項1乃至請
求項3のいずれかに記載の記号列傾き検出装置を用いて
検出した記号列の傾きに基づいて撮像データを修正する
データ修正手段と、前記データ修正手段による修正後の
データに基づいて記号列を検査する検査手段とを備えた
ものである。
Further, the invention of claim 4 is a data correcting means for correcting the imaging data based on the inclination of the symbol string detected by the symbol string inclination detecting device according to any one of claims 1 to 3. And a checking means for checking the symbol string based on the data corrected by the data correcting means.

【0011】また、請求項5の発明は、物体に記された
記号列を撮像し、その撮像データより記号列の傾きを検
出する記号列傾き検出方法において、記号列の最初と最
後の記号を指定し、そのパターンを記憶するステップ
と、撮像データから、記憶されたパターンと一致度が高
い箇所を記号列の位置として検出するステップと、検出
された記号列の最初と最後の記号から該記号列の傾きを
検出するステップとを有し、上記記号列の傾きを検出す
るステップにおいて、最初又は最後の記号が記号列中に
複数存在する場合に、検出した記号列位置の端点となる
位置を選択して、その端点に位置する記号に基づいて記
号列の傾きを検出することを特徴とする記号列傾き検出
方法である。
According to a fifth aspect of the present invention, in a symbol string inclination detecting method for imaging a symbol string written on an object and detecting the inclination of the symbol string from the imaged data, the first and last symbols of the symbol string are detected. A step of specifying and storing the pattern, a step of detecting, from the imaging data, a position having a high degree of coincidence with the stored pattern as a position of the symbol string, and the symbol from the first and last symbols of the detected symbol string. And a step of detecting the inclination of the symbol string, and in the step of detecting the inclination of the symbol string, when there are a plurality of first or last symbols in the symbol string, the position that is the end point of the detected symbol string position is set. It is a method for detecting the inclination of a symbol string, which comprises selecting and detecting the inclination of the symbol string based on the symbol located at the end point.

【0012】[0012]

【作用】上記請求項1の記号列傾き検出装置によれば、
記号列検出手段は、記号列の撮像データからパターン記
憶手段に記憶された記号列の最初と最後の記号をサーチ
して、一致度が高い箇所を記号列の存在箇所と認識す
る。傾き検出手段は、認識された記号列の最初と最後の
記号に基づいて記号列の傾きを検出する。このとき、パ
ターン検出手段に記憶された最初又は最後の記号が記号
列中に複数存在した場合、傾き検出手段は、記号列検出
手段により検出した記号列の端点位置を選択し、この選
択した位置座標に基づいて記号列の傾きを検出する。こ
のため、傾き検出の精度が向上する。
According to the symbol string inclination detecting device of the first aspect,
The symbol string detecting means searches the image data of the symbol string for the first and last symbols of the symbol string stored in the pattern storing means, and recognizes a portion having a high degree of coincidence as an existing portion of the symbol string. The inclination detecting means detects the inclination of the symbol string based on the first and last symbols of the recognized symbol string. At this time, when a plurality of first or last symbols stored in the pattern detecting means are present in the symbol string, the inclination detecting means selects the end point position of the symbol string detected by the symbol string detecting means, and selects the selected position. The inclination of the symbol string is detected based on the coordinates. Therefore, the accuracy of tilt detection is improved.

【0013】また、請求項2の傾き検出装置によれば、
傾き検出手段は、最初又は最後の記号と同じ複数の記号
のうち最右端又は最左端に位置する記号を選択すること
で、記号列中に最初又は最後の記号が複数存在しても、
高精度にて傾き検出を行うことができる。
According to the tilt detecting device of the second aspect,
The inclination detecting means selects the symbol located at the rightmost end or the leftmost end among the same plurality of symbols as the first or last symbol, so that even if there are a plurality of first or last symbols in the symbol string,
Inclination can be detected with high accuracy.

【0014】また、請求項3の傾き検出装置によれば、
パターン記憶手段には複数の角度での記号パターンを記
憶させているので、記号列検出を精度良く行うことがで
きる。
According to the tilt detecting device of claim 3,
Since the pattern storage means stores the symbol patterns at a plurality of angles, the symbol string can be detected accurately.

【0015】また、請求項4の位置ずれ検査装置によれ
ば、データ修正手段は、請求項1乃至請求項3のいずれ
かに記載の記号列傾き検出装置により検出された記号列
の傾きに基づいて撮像データを水平位置に修正し、検査
手段はデータ修正手段による修正後の記号列データから
記号を検査する。このため、物体に付された記号の外観
検査を精度良く行うことができる。
Further, according to the position shift inspection apparatus of the fourth aspect, the data correcting means is based on the inclination of the symbol string detected by the symbol string inclination detecting apparatus according to any one of the first to third aspects. The imaging data is corrected to a horizontal position by the inspection means, and the inspection means inspects the symbol from the symbol string data corrected by the data correction means. Therefore, the appearance inspection of the symbol attached to the object can be performed accurately.

【0016】また、請求項5の記号列傾き検出方法によ
れば、記号列の最初又は最後の記号が記号列中に複数存
在した時、記号列の端点位置を選択し、この選択した端
点に位置する記号に基づいて記号列の傾きを検出する。
これにより、傾き検出のために参照する記号を誤認する
ことがなくなり、記号列の傾きを精度良く検出すること
ができる。
According to the symbol string inclination detection method of claim 5, when a plurality of first or last symbols of the symbol string are present in the symbol string, the end point position of the symbol string is selected and the selected end point is selected. The inclination of the symbol string is detected based on the symbol located.
As a result, it is possible to prevent the symbol referred to for detecting the inclination from being mistakenly recognized, and to detect the inclination of the symbol string with high accuracy.

【0017】[0017]

【実施例】本発明の一実施例を図面を参照して説明す
る。本発明の記号列傾き検出装置及び方法においては、
図1(c)に示した記号列の傾き検出の段階において、
前設定段階で指定した最初又は最後と同じ記号が記号列
中に複数存在する場合に、誤認しないようにしている。
すなわち、図2に示したような場合、記号列「1」
「3」「3」の最初の記号「1」と最後の記号「3」を
正確に認識するようにしている。この方法について図3
を参照して説明する。図3は、記号列中の最初と最後の
記号をサーチする時に、同じ記号が文字列中に複数存在
する場合に、記号列の両端点(最右端と最左端)を選択
する手順を示す。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described with reference to the drawings. In the symbol string inclination detection apparatus and method of the present invention,
At the stage of detecting the inclination of the symbol string shown in FIG.
When there are multiple symbols in the symbol string that are the same as the first or last symbol specified in the pre-setting stage, misidentification is prevented.
That is, in the case as shown in FIG. 2, the symbol string “1”
The first symbol "1" and the last symbol "3" of "3" and "3" are correctly recognized. Figure 3
Will be described with reference to. FIG. 3 shows a procedure for selecting both end points (the rightmost end and the leftmost end) of the symbol string when the same symbol is present in the character string when searching the first and last symbols in the symbol string.

【0018】図3において、まず、予め指定された最初
の記号すなわち記号列の最も左の文字をサーチし(S
1)、その後、最も左の記号を複数個発見したかを判定
し(S2)、複数個発見されれば(S2でYES)、記
号列の最小のx座標に位置する記号、つまり最も左に位
置する記号を最初の記号として採用する(S3)。S2
で複数個発見されなかった時(S2でNO)、及びS3
の処理の後はS4に進み、今度は予め指定された最後の
記号すなわち記号列の最も右の記号についてサーチし
(S4)、複数個発見したか否かを判定する(S5)。
複数個発見されれば(S5でYES)、記号列の最大の
x座標に位置する記号、つまり最も右に位置する記号を
最後の記号として採用し(S6)、処理を終える。S5
で複数個発見されなければ、そのまま処理を終了する
(S5でNO)。
In FIG. 3, first, the leftmost character of the first designated symbol, that is, the symbol string is searched (S
1) After that, it is judged whether or not the leftmost symbol is found (S2). If a plurality of the leftmost symbols are found (YES in S2), the symbol located at the minimum x coordinate of the symbol string, that is, the leftmost symbol. The located symbol is adopted as the first symbol (S3). S2
If more than one is not found in S2 (NO in S2), and S3
After the processing of (1), the process proceeds to S4, and this time, the last symbol designated in advance, that is, the rightmost symbol of the symbol string is searched (S4), and it is determined whether a plurality of symbols have been found (S5).
If a plurality of symbols are found (YES in S5), the symbol located at the maximum x coordinate of the symbol string, that is, the symbol located on the far right is adopted as the final symbol (S6), and the process is terminated. S5
If a plurality of items are not found in, the process is terminated (NO in S5).

【0019】このように、図2に示したような指定した
最初又は最後と同じ記号が記号列中に複数存在する場
合、従来の方法であれば最後の記号「3」については記
号列中のどちらの「3」を最後の記号として認識するか
不定となるが、本発明の装置及び方法であれば重複する
「3」のうちx座標の最も大きい座標位置にある「3」
の方を採用し、正しく認識することができるようにして
いる。これにより、後述の記号列傾き検出及び検査装置
における記号列の傾きの検出の精度を向上することがで
きる。
As described above, when a plurality of the same symbols as the designated first or last ones as shown in FIG. 2 are present in the symbol string, the last symbol "3" is included in the symbol string in the conventional method. It is uncertain which "3" is recognized as the last symbol, but in the apparatus and method of the present invention, the "3" at the coordinate position having the largest x coordinate among the overlapping "3" s.
Is adopted so that it can be recognized correctly. Accordingly, it is possible to improve the accuracy of detecting the inclination of the symbol string, which will be described later, and detecting the inclination of the symbol string in the inspection device.

【0020】また、図3の手順中S3では最初の記号と
重複するものが発見された場合、その記号列のx座標の
最小値を持つ記号を採用し、図3の手順中S6では最後
の記号と重複するものが発見された場合、その記号列の
最大値を持つ記号を採用するようにしているが、この他
の方法として、S3では最初の記号と重複する記号とを
比較して最右端に位置するものを最初の記号として選択
し、S6では最後の記号と重複する記号とを比較して最
左端にあるものを選択するようにしてもよい。さらに、
図3の手順では記号列の傾きは−90°から90°まで
の範囲で最初と最後の記号を検出する、すなわちx座標
のみから検出するようにしているが、y座標についても
検出するステップを付加すれば、記号列が360°どの
ように傾いていても最初と最後の記号を認識することが
できる。
Further, if a duplicate of the first symbol is found in S3 in the procedure of FIG. 3, the symbol having the minimum x coordinate of the symbol string is adopted, and in S6 in the procedure of FIG. 3, the last symbol is adopted. If a duplicate symbol is found, the symbol with the maximum value of the symbol string is adopted, but as another method, in S3, the first symbol is compared with the duplicate symbol and the maximum value is compared. The rightmost one may be selected as the first symbol, and the last symbol may be compared with the overlapping symbol in S6 to select the leftmost symbol. further,
In the procedure of FIG. 3, the inclination of the symbol string is in the range of −90 ° to 90 °, and the first and last symbols are detected, that is, only the x coordinate is detected, but the step of detecting the y coordinate is also performed. If added, the first and last symbols can be recognized no matter how the symbol string is inclined by 360 °.

【0021】図4は、上述した方法が適用される位置ず
れ修正及び検査装置の概略構成を示す。カメラ1は、物
体に付された記号列を撮像してビデオ信号を出力する。
A/D変換器2は、カメラ1からのビデオ信号をディジ
タル信号に変換する。画像メモリ3は、ディジタル変換
された画像データを記憶する。入力装置4は、キーボー
ドなどでなり、サーチにより検査しようとする記号列の
最初と最後の記号を指定すなわち、登録パターンの切出
しなどを行う。パターン記憶部5は、検査される記号の
登録パターンや、検査される記号列の間隔データなどを
記憶するものであり、予め検査される記号のパターンは
カメラ1にて撮像したデータを画像メモリ3を経て入力
し、登録しておけばよい。
FIG. 4 shows a schematic structure of a positional deviation correcting and inspecting apparatus to which the above-mentioned method is applied. The camera 1 images the symbol string attached to the object and outputs a video signal.
The A / D converter 2 converts the video signal from the camera 1 into a digital signal. The image memory 3 stores the digitally converted image data. The input device 4 is composed of a keyboard or the like, and specifies the first and last symbols of a symbol string to be inspected by searching, that is, cuts out a registered pattern. The pattern storage unit 5 stores a registered pattern of symbols to be inspected, interval data of inspected symbol strings, and the like, and the pattern of symbols to be inspected in advance is obtained by image data of the image captured by the camera 1. You just have to enter and register.

【0022】サーチ処理部6は、記号列検出手段を構成
し、画像メモリ3の画像データからパターン記憶部5で
指定された記号列をサーチするものである。傾き角度検
出部・位置ずれ修正部7は、傾き検出手段及び修正手段
を構成し、サーチ処理部6で検出された記号列の最初と
最後の記号を認識して該記号列の傾きを検出し、また、
傾き角度に応じて記号列を水平位置に回転させ、修正後
のデータを画像メモリ3の所定エリアに登録するるもの
である。検査部8は、位置ずれ修正部7により修正され
た画像メモリ3に登録された画像データとパターン記憶
部5に記憶されているパターンとを比較することにより
記号が正しく付されているか否かを検査するものであ
る。すなわち、この検査は、位置ずれ修正後の画像デー
タと傾きなしの記号列パターンとの一致度を求めること
により行うので検査精度の向上が図れる。D/A変換器
9は、画像メモリ3の画像データをアナログ変換するも
のである。表示部10は、画像メモリ3のデータや検査
部8の検査結果を出力表示するものである。図3に示し
た記号列の傾き検出方法は、サーチ処理部6と、位置ず
れ修正部7にて行われる。
The search processing unit 6 constitutes a symbol string detecting means and searches the image data in the image memory 3 for a symbol string designated by the pattern storage unit 5. The tilt angle detection unit / positional deviation correction unit 7 constitutes a tilt detection unit and a correction unit, recognizes the first and last symbols of the symbol string detected by the search processing unit 6, and detects the inclination of the symbol string. ,Also,
The symbol string is rotated to a horizontal position according to the tilt angle, and the corrected data is registered in a predetermined area of the image memory 3. The inspection unit 8 compares the image data registered in the image memory 3 corrected by the positional deviation correction unit 7 with the pattern stored in the pattern storage unit 5 to determine whether or not the symbol is correctly added. It is something to inspect. That is, since this inspection is performed by obtaining the degree of coincidence between the image data after the positional deviation correction and the symbol string pattern without inclination, the inspection accuracy can be improved. The D / A converter 9 converts the image data in the image memory 3 into analog data. The display unit 10 outputs and displays the data of the image memory 3 and the inspection result of the inspection unit 8. The method for detecting the inclination of the symbol string shown in FIG. 3 is performed by the search processing unit 6 and the positional deviation correction unit 7.

【0023】次に、上記のように構成された位置ずれ修
正及び検査装置の図3に示した記号のサーチ処理(S
1,S4)の詳細について、図5を参照して説明する。
図5は図3のS1,S4のサブルーチンに相当する。図
5において、本処理では、まず、サーチ処理にて検出さ
れる記号列と画像データとの一致度のしきい値を設定し
(S10)、次に、パターン記憶部5に記憶されている
記号パターンの中から予め指定された記号(以下、モデ
ルという)の角度を初期値すなわち、水平位置に設定し
(S11)、このモデルの位置を画像データにより規定
される画面の左上に合わせ(S12)、この状態で一致
度を計測する(S13)。
Next, the symbol search process (S in FIG. 3) of the positional deviation correcting and inspecting apparatus constructed as described above is performed.
1, S4) will be described in detail with reference to FIG.
FIG. 5 corresponds to the subroutine of S1 and S4 in FIG. 5, in the present process, first, a threshold value of the degree of coincidence between the symbol string detected in the search process and the image data is set (S10), and then the symbols stored in the pattern storage unit 5 are set. An angle of a symbol (hereinafter, referred to as a model) designated in advance from the pattern is set to an initial value, that is, a horizontal position (S11), and the position of this model is aligned with the upper left of the screen defined by the image data (S12). The degree of coincidence is measured in this state (S13).

【0024】次に、計測された一致度がS10で設定し
たしきい値以上かを判定し(S14)、一致度がしきい
値以上であれば(S14でYES)、最も左のモデルが
サーチできたとしてその位置座標を記憶し(S15)、
S16に進む。S14で一致度がしきい値以下であれば
(S14でNO)、S15を処理することなくS16に
進む。S16では画像データの全ての位置について一致
度を計測したか否かを判定し、全ての位置で計測してい
なければ(S16でNO)、S11で設定されたモデル
を画面上で1画素ずらし(S17)、全ての位置につい
て一致度を計測するまでS13〜S17の処理を繰り返
す。S16で全ての位置で一致度を計測したと判断され
れば(S16でYES)、次に、全てのモデル角度でサ
ーチしたか否かを判定し(S18)、S18で全ての角
度でサーチしていなければ(S18でNO)、モデルの
角度を変更し(S19)、S12に戻り、S18で全て
のモデル角度でサーチしていれば(S18でYES)、
処理を終了する。なお、上記手順中、S14で一致度が
しきい値以上の箇所が複数検出されればS15で複数の
位置座標が記憶される。
Next, it is judged whether the measured coincidence is greater than or equal to the threshold set in S10 (S14). If the coincidence is greater than or equal to the threshold (YES in S14), the leftmost model is searched. If possible, the position coordinates are stored (S15),
Proceed to S16. If the degree of coincidence is less than or equal to the threshold value in S14 (NO in S14), the process proceeds to S16 without processing S15. In S16, it is determined whether or not the degree of coincidence has been measured at all positions of the image data, and if not measured at all positions (NO in S16), the model set in S11 is shifted by one pixel on the screen ( S17), and the processes of S13 to S17 are repeated until the degree of coincidence is measured for all the positions. If it is determined in S16 that the degree of coincidence has been measured at all positions (YES in S16), then it is determined whether or not the search has been performed in all model angles (S18), and the search is performed in all angles in S18. If not (NO in S18), the model angle is changed (S19), the process returns to S12, and if all model angles are searched in S18 (YES in S18),
The process ends. In the above procedure, if a plurality of locations where the degree of coincidence is greater than or equal to the threshold value are detected in S14, a plurality of position coordinates are stored in S15.

【0025】上述した図3及び図5の処理を行うこと
で、記号列の最初(最も左)と最後(最も右)の記号
(文字)を正確に認識することができ、これらの記号の
中心座標に基づいて図6に示す記号列の傾きを求める式
から記号列の傾きを精度よく検出することができる。さ
らに、記号列の傾き検出に基づいて画像メモリ3の内容
を、例えば、図7に示すようなアフィン変換の式により
回転させて、さらに、記号の一致度を、例えば、図8に
示すようなマッチングの式を用いて検査すればよい。こ
うして、物体に付された記号の認識や外観検査における
性能を向上させることができる。なお、図7、図8に示
す方法は一例であって、これらに限られるものではな
い。
By performing the above-described processing of FIGS. 3 and 5, it is possible to accurately recognize the first (leftmost) and last (rightmost) symbols (characters) of the symbol string, and to identify the center of these symbols. The inclination of the symbol string can be accurately detected from the equation for obtaining the inclination of the symbol string shown in FIG. 6 based on the coordinates. Further, the content of the image memory 3 is rotated based on the detection of the inclination of the symbol string, for example, by an affine transformation formula as shown in FIG. 7, and the degree of coincidence of the symbols is as shown in FIG. It suffices to check using a matching expression. In this way, it is possible to improve the performance of the recognition of the symbol attached to the object and the appearance inspection. The methods shown in FIGS. 7 and 8 are merely examples, and the methods are not limited to these.

【0026】本発明は上記実施例構成及び方法に限られ
ず種々の変形が可能であり、上記図1(a)に示したよ
うな複数の傾いた記号パターンは、予め撮像した画像デ
ータに基づいて操作者が入力装置4から各種属性を設定
することにより得られるが、一つの角度の記号パターン
に対して自動的に数種の回転パターンが得られるように
しておけば操作の手間が省け、また、回転の角度を細か
く分割すれば傾いた記号に対して確実に一致した文字を
検出することができる。さらに、検査前に、検査しよう
とする記号又は文字列の最初と最後にくる記号又は文字
を入力装置4から指定し、入力するが、その際に、自動
的に最初の記号又は文字と最後の記号又は文字が指定さ
れ、登録されるようにしておいてもよい。
The present invention is not limited to the configuration and method of the above-described embodiment, and various modifications can be made. A plurality of inclined symbol patterns as shown in FIG. 1 (a) are based on image data captured in advance. It can be obtained by the operator setting various attributes from the input device 4. However, if several kinds of rotation patterns are automatically obtained with respect to the symbol pattern of one angle, the labor of the operation can be saved, and By finely dividing the angle of rotation, it is possible to reliably detect a character that matches a tilted symbol. Further, before the inspection, the symbols or characters to be inspected at the beginning and end of the symbol or character string to be inspected are specified from the input device 4 and input, but at that time, the first symbol or character and the A symbol or a character may be designated and registered.

【0027】また、検査する文字列が複数種類ある場
合、予めその複数の文字列を図9に示すように形式化し
ておき、検査前にその形式番号を入力装置4から入力す
ることで、最初と最後の文字が登録されるようにしてお
いてもよい。すなわち、図9における形式「A−1」が
入力されると、自動的に文字列“A,B,C”の検査が
可能となる。その際の最初の文字、最後の文字は“A”
と“C”であることが自動的に登録される。
If there are a plurality of character strings to be inspected, the plurality of character strings are formalized in advance as shown in FIG. 9, and the format number is input from the input device 4 before the inspection. The last character may be registered. That is, when the format "A-1" in FIG. 9 is input, the character strings "A, B, C" can be automatically inspected. The first letter and the last letter at that time are "A"
And "C" are automatically registered.

【0028】[0028]

【発明の効果】以上のように請求項1及び請求項5の装
置及び方法によれば、記号列の傾き検出に際して、記号
列の中に指定した最初又は最後の記号と同一記号が複数
存在しても、記号列の端点位置を選択して傾き検出のた
めの参照記号とするので、最初又は最後の記号を誤認す
ることなく、確実に記号列の最初と最後の記号を選択し
て検出することができ、従って、記号列の傾き角度の精
度を良好なものとすることができる。また、請求項2の
傾き検出装置によれば、傾き検出手段が最初又は最後の
記号と同じ複数の記号のうち最右端又は最左端に位置す
る記号を選択するようにしているので、より高精度に記
号列の傾き検出が行える。また、請求項3の傾き検出装
置によれば、パターン記憶手段に複数の角度での記号パ
ターンを記憶させているので、検査しようとする記号を
確実に検出することができる。また、請求項4の記号列
位置ずれ検査装置は、請求項1乃至請求項3に記載の傾
き検出装置により検出された傾き角度に基づいて記号列
を水平位置に修正し、この修正データ中の記号を検査す
るようにしているので、記号列の外観検査を正確に行う
ことができる。
As described above, according to the apparatus and the method of claims 1 and 5, when the inclination of a symbol string is detected, a plurality of symbols identical to the designated first or last symbol exist in the symbol string. However, since the end point position of the symbol string is selected and used as the reference symbol for tilt detection, the first and last symbols of the symbol string can be reliably selected and detected without misidentifying the first or last symbol. Therefore, the accuracy of the inclination angle of the symbol string can be improved. Further, according to the inclination detecting device of the second aspect, the inclination detecting means selects the symbol located at the rightmost end or the leftmost end among the same plurality of symbols as the first or last symbol, so that the accuracy is higher. The inclination of the symbol string can be detected. Further, according to the inclination detecting device of the third aspect, since the pattern storing means stores the symbol patterns at a plurality of angles, it is possible to reliably detect the symbol to be inspected. Further, the symbol string position deviation inspection device according to claim 4 corrects the symbol string to a horizontal position based on the tilt angle detected by the tilt detection device according to any one of claims 1 to 3, Since the symbols are inspected, the appearance of the symbol string can be accurately inspected.

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

【図1】従来の文字列傾き検出の方法手順を示す図であ
る。
FIG. 1 is a diagram showing a method procedure of a conventional character string inclination detection.

【図2】傾きを検出すべき文字列に指定した最後の文字
が重複している状態を示す図である。
FIG. 2 is a diagram showing a state in which the last character specified in a character string whose inclination is to be detected overlaps.

【図3】本発明の一実施例による最初と最後の文字を検
出するための処理手順を示すフローチャートである。
FIG. 3 is a flowchart showing a processing procedure for detecting first and last characters according to an embodiment of the present invention.

【図4】本発明の一実施例による文字列の傾き検出装置
を搭載した位置ずれ修正及び検査装置の概略構成を示す
ブロック図である。
FIG. 4 is a block diagram showing a schematic configuration of a misalignment correction and inspection device equipped with a character string inclination detection device according to an embodiment of the present invention.

【図5】図3における最も左及び最も右に位置する文字
の候補を検出するための手順を示すフローチャートであ
る。
5 is a flowchart showing a procedure for detecting character candidates located at the leftmost and rightmost positions in FIG.

【図6】文字列の傾きを求める式を説明するための図で
ある。
FIG. 6 is a diagram for explaining an expression for obtaining the inclination of a character string.

【図7】アフィン変換の式を説明するための図である。FIG. 7 is a diagram for explaining an affine transformation formula.

【図8】マッチングを説明するための図である。FIG. 8 is a diagram for explaining matching.

【図9】他の実施例による最初と最後の文字の指定方法
を説明する図である。
FIG. 9 is a diagram illustrating a method of designating first and last characters according to another embodiment.

【符号の説明】[Explanation of symbols]

1 カメラ 3 画像メモリ 4 入力装置 5 パターン記憶部(パターン記憶手段) 6 サーチ処理部(記号列検出手段) 7 位置ずれ修正部(傾き検出手段、修正手段) DESCRIPTION OF SYMBOLS 1 camera 3 image memory 4 input device 5 pattern storage unit (pattern storage unit) 6 search processing unit (symbol string detection unit) 7 position shift correction unit (tilt detection unit, correction unit)

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 物体に記された記号列を撮像し、その撮
像データより記号列の傾きを検出する記号列傾き検出装
置において、 記号列の最初と最後の記号を指定し、そのパターンを記
憶するパターン記憶手段と、 撮像データから、前記パターン記憶手段に記憶されたパ
ターンと一致度が高い箇所を記号列の位置として検出す
る記号列検出手段と、 前記記号列検出手段により検出された記号列の最初と最
後の記号から該記号列の傾きを検出する傾き検出手段と
を備え、 前記傾き検出手段は、前記パターン検出手段に記憶され
た最初又は最後の記号が記号列中に複数存在する場合
に、前記記号列検出手段により検出した記号列位置の端
点となる位置を選択して、その端点に位置する記号に基
づいて記号列の傾きを検出するものであることを特徴と
する記号列傾き検出装置。
1. A symbol string inclination detecting device for imaging a symbol string written on an object and detecting the inclination of the symbol string from the imaged data, wherein the first and last symbols of the symbol string are designated and the pattern is stored. Pattern storage means, a symbol string detection means for detecting, from the imaged data, a position having a high degree of coincidence with the pattern stored in the pattern storage means as the position of the symbol string, and the symbol string detected by the symbol string detection means. A tilt detecting means for detecting the tilt of the symbol string from the first and last symbols of the symbol string, wherein the tilt detecting means has a plurality of first or last symbols stored in the pattern detecting means in the symbol string. In addition, the position of the symbol string position detected by the symbol string detecting means is selected as an end point, and the inclination of the symbol string is detected based on the symbol located at the end point. That symbol column slope detection device.
【請求項2】 前記傾き検出手段は、前記パターン検出
手段に記憶された最初と最後の記号が記号列中に複数存
在する場合に、その複数のうち最右端又は最左端に位置
する記号を選択し、この選択された記号の位置に基づい
て記号列の傾きを検出することを特徴とする請求項1記
載の記号列傾き検出装置。
2. The inclination detecting means selects a symbol located at the rightmost end or the leftmost end of the plurality of symbols when a plurality of first and last symbols stored in the pattern detecting means are present in the symbol string. Then, the symbol string inclination detection device according to claim 1, wherein the inclination of the symbol string is detected based on the position of the selected symbol.
【請求項3】 前記パターン記憶手段に、複数の角度で
の記号のパターンを記憶させたことを特徴とする請求項
1又は請求項2記載の記号列傾き検出装置。
3. The symbol string inclination detection device according to claim 1, wherein the pattern storage means stores symbol patterns at a plurality of angles.
【請求項4】 請求項1乃至請求項3のいずれかに記載
の記号列傾き検出装置を用いて検出した記号列の傾きに
基づいて撮像データを修正するデータ修正手段と、 前記データ修正手段による修正後のデータに基づいて記
号列を検査する検査手段とを備えたことを特徴とする記
号列位置ずれ検査装置。
4. A data correction means for correcting imaging data based on the inclination of a symbol string detected using the symbol string inclination detection device according to claim 1, and the data correction means. An inspection device for inspecting a symbol string position based on the corrected data.
【請求項5】 物体に記された記号列を撮像し、その撮
像データより記号列の傾きを検出する記号列傾き検出方
法において、 記号列の最初と最後の記号を指定し、そのパターンを記
憶するステップと、 撮像データから、記憶されたパターンと一致度が高い箇
所を記号列の位置として検出するステップと、 検出された記号列の最初と最後の記号から該記号列の傾
きを検出するステップとを有し、 上記記号列の傾きを検出するステップにおいて、最初又
は最後の記号が記号列中に複数存在する場合に、検出し
た記号列位置の端点となる位置を選択して、その端点に
位置する記号に基づいて記号列の傾きを検出することを
特徴とする記号列傾き検出方法。
5. A symbol string inclination detection method for imaging a symbol string written on an object and detecting the inclination of the symbol string from the imaged data, wherein the first and last symbols of the symbol string are designated and the pattern is stored. And a step of detecting a position having a high degree of coincidence with the stored pattern as a position of the symbol string from the imaging data, and a step of detecting the inclination of the symbol string from the first and last symbols of the detected symbol string. And, in the step of detecting the inclination of the symbol string, when there are a plurality of first or last symbols in the symbol string, select a position that is the end point of the detected symbol string position, A method for detecting the inclination of a symbol string, which comprises detecting the inclination of a symbol string based on a symbol located.
JP6262064A 1994-09-29 1994-09-29 Apparatus and method for detecting inclination of symbol string Pending JPH0896077A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6262064A JPH0896077A (en) 1994-09-29 1994-09-29 Apparatus and method for detecting inclination of symbol string

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6262064A JPH0896077A (en) 1994-09-29 1994-09-29 Apparatus and method for detecting inclination of symbol string

Publications (1)

Publication Number Publication Date
JPH0896077A true JPH0896077A (en) 1996-04-12

Family

ID=17370534

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6262064A Pending JPH0896077A (en) 1994-09-29 1994-09-29 Apparatus and method for detecting inclination of symbol string

Country Status (1)

Country Link
JP (1) JPH0896077A (en)

Similar Documents

Publication Publication Date Title
US5793901A (en) Device and method to detect dislocation of object image data
KR900007434B1 (en) Pattern checker
JPH0789063A (en) Print inspection system
JP2010071951A (en) Visual inspection device and visual inspection method
JP3924796B2 (en) Pattern position measuring method and measuring apparatus
JP3422147B2 (en) Position shift amount detecting device and image measuring device
JPH08136235A (en) Pattern detection method
JPH08313225A (en) Appearance inspection apparatus
JPH0896077A (en) Apparatus and method for detecting inclination of symbol string
JP3427230B2 (en) Image processing device
JPH02230381A (en) Work inspecting device
JP2984267B1 (en) Object processing method
JPH1115975A (en) Appearance inspecting method
KR100227421B1 (en) Uninserted inspection device of printed board and its control method
JP3048987B2 (en) Electronic component mounting inspection apparatus, method thereof, and recording medium recording program
JPH11328404A (en) Image recognition device and image recognition method
JPH036409A (en) Method and apparatus for inspecting printed circuit board
JPH10283480A (en) Recognition processing device and storage medium for recognition processing applied to this device
JPH08193818A (en) Apparatus and method for inspecting pattern
JPH10269357A (en) Inspection method of printed matter
JPH05281151A (en) Wafer pattern inspection device
JPH1153564A (en) Image-processing device and machine-readable recording medium recording rotation angle detection program
JPH09282453A (en) Location recognition method
JPH1027253A (en) Image processing method
JPH09128543A (en) Model image registration method and apparatus and object appearance inspection apparatus using the same

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020924