JPS62100093A - Processing device for serial data - Google Patents

Processing device for serial data

Info

Publication number
JPS62100093A
JPS62100093A JP60238596A JP23859685A JPS62100093A JP S62100093 A JPS62100093 A JP S62100093A JP 60238596 A JP60238596 A JP 60238596A JP 23859685 A JP23859685 A JP 23859685A JP S62100093 A JPS62100093 A JP S62100093A
Authority
JP
Japan
Prior art keywords
window
window area
area
coordinate
data
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
JP60238596A
Other languages
Japanese (ja)
Inventor
Akio Izumi
晶雄 泉
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP60238596A priority Critical patent/JPS62100093A/en
Priority to DE3617774A priority patent/DE3617774C2/en
Priority to US06/867,471 priority patent/US4783827A/en
Publication of JPS62100093A publication Critical patent/JPS62100093A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To discriminate the quality of goods by providing a window area in a visual field to watch the goods to be conveyed, counting the number of picture elements as a binary output by image picking-up the goods with the image pickup device and comparing with the reference value. CONSTITUTION:In a visual field S to watch the goods to be conveyed, three windows W1, W2 and W3 are specified. An X coordinate data storing device 51 and a Y coordinate data storing device 52 respectively store the X coordinates and the Y coordinates of the respective windows. A window area output means 54 receives the output from a coordinate comparing means 53, respectively obtains the 'AND' of X1, X2 and X3 coordinate data from the storing device 51 and Y1, Y2 and Y3 coordinate data from the comparing means 53 and sends it to a counting means 55 as the window area signal. The counting means 55 examines the serial scanning data outputted from one-dimensional line sensor 4 for one scanning, detects and counts the picture data in it and sends them throughan adding means 56 to a holding means 57. The total value classified by respective windows of the holding means 57 is compared with the reference value classified by respective windows prepared separately and decides the quality of the goods.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明ば、=+ンヘヤー等の1最送装置で12投送され
てくる物品を望む視野内にN!7.1:Eたは複数個の
窓領域(ウィンド)を設定しておき、該窓領域を通して
該物品を撮像デバイスにより撮像して得られた撮像出力
(2値化出力)中の“1”なら“l”という特定の論理
値をとる画素の数を計数しておき、該計数結果を予め用
意しである基準値と比較することにより、前記物品の良
否を判別するようにした判別装置に関するものであり、
更に詳しくは、該判別装置において、撮像デバイスとし
て、テレビカメラの如き2次元撮像デバイスを用いるの
でなく、ファクシミリの送信走査に用いられる如き、1
次元ラインセンサを用いたときに、該ラインセンサから
出力される直列データを処理して、前記基準値との比較
対象である計数結果に相当する出力を得るための処理装
置に関するものである。
[Detailed Description of the Invention] [Industrial Application Field] According to the present invention, 12 articles are transported within a desired field of view by a single transport device such as a n-hair. 7.1: "1" in the imaging output (binarized output) obtained by setting E or a plurality of window areas (windows) and imaging the article with an imaging device through the window area The present invention relates to a discriminating device that determines whether the article is good or bad by counting the number of pixels that take a specific logical value of "l" and comparing the counting result with a pre-prepared reference value. It is a thing,
More specifically, the discriminating device does not use a two-dimensional imaging device such as a television camera as an imaging device, but a one-dimensional imaging device such as that used for facsimile transmission scanning.
The present invention relates to a processing device for processing serial data output from a dimensional line sensor to obtain an output corresponding to a count result to be compared with the reference value when a dimensional line sensor is used.

〔従来の技術〕[Conventional technology]

近年、ファクトリ−オートメーション用として、撮像カ
メラを用いて製品(物品)の外観検査を行い、製品の良
否判定、欠陥検出等を自動化する撮像装置の応用が増加
してきた。このような製品検査(物品の良否判別)にお
いてはその−手法として、2次元カメラを用い、検査対
象の「製品」を表す映像の急所各部にウィンド(窓領域
)と呼ばれる判定エリアを設定し、検査対象が(ると、
ウィンド内の面積を計数してウィンドごとに設定された
判定基準値と比較し良否を判定する。
2. Description of the Related Art In recent years, the application of imaging devices has been increasing for factory automation, which uses an imaging camera to inspect the appearance of products (articles) and automate product quality determination, defect detection, and the like. In this kind of product inspection (determining the quality of an article), the method is to use a two-dimensional camera and set a judgment area called a window (window area) at each vital part of the image that represents the "product" to be inspected. When the inspection target is (
The area within the window is counted and compared with a determination reference value set for each window to determine pass/fail.

この手法によれば、ウィンドの大きさや位置数などを任
意に変えることにより特徴抽出の部位を自由に選ぶこと
ができるため、応用分野が広く、検査対象の変更に対し
ても柔軟に対応することができ、また映像の各部を独立
して判定できるため、異種製品の分類、共通部分のみの
検査等が行なえる。
According to this method, it is possible to freely select the area for feature extraction by arbitrarily changing the window size and number of positions, etc., so it has a wide range of applications and can flexibly respond to changes in the inspection target. Since each part of the image can be judged independently, it is possible to classify different types of products and inspect only common parts.

また面積を基準値と比較するため、ウィン下の大きさを
適度に決めれば、映像と物品(製品)との多少の位置ず
れや小さなゴミなどを気にすることなく検査ラインに適
用できる。
Furthermore, in order to compare the area with a reference value, if the size of the underside of the window is determined appropriately, it can be applied to the inspection line without worrying about slight misalignment between the image and the product or small dust.

第2図、第3図にこのウィンド画像処理の例を示す。An example of this window image processing is shown in FIGS. 2 and 3.

第2図は文字rAJが正しく印刷されているかどうかを
検査する目的で、特に印刷ミスの多い3ケ所にウィンド
Wl、W2.W3が設定された例を示している。a)は
正しく印刷された例であるが、b)ではAの文字の中央
部がぬりつぶされているためウィンドW2の面積測定値
が基準値を超えており、またAの文字の左下が欠けてい
るのでウィンドW3の面積測定値が基準値を下回ってい
るため、この両者から不良とみなされる。例C)ではウ
ィンドW2. ウィンドW3の測定値は正しいが、ウィ
ンドW1の面積測定値は文字Aの右上にインクのボタ落
ちがあるため基準値を超えやはり不良とみなされる。
For the purpose of checking whether the characters rAJ are printed correctly, FIG. 2 shows windows Wl, W2. An example in which W3 is set is shown. A) is an example that is printed correctly, but in b), the center part of the letter A is filled in, so the area measurement value of window W2 exceeds the standard value, and the lower left of the letter A is missing. Therefore, the area measurement value of window W3 is less than the reference value, and therefore it is considered to be defective from both of these points. In example C), window W2. Although the measured value of the window W3 is correct, the area measured value of the window W1 exceeds the standard value because there is a drop of ink on the upper right corner of the letter A, and is also considered to be defective.

第3図は文字rEJ  rFJ  rLJの分類識別例
を示す説明図であり、ウィンドWl、W2が設定されて
いる。ウィンドWl、W2両者とも面積測定値が基準値
を超えていれば「E」、ウィンドW1だけならば「F」
、ウィンドW2だけならば「L」と判定できる。
FIG. 3 is an explanatory diagram showing an example of classification and identification of characters rEJ rFJ rLJ, and windows Wl and W2 are set. If the area measurement value of both windows Wl and W2 exceeds the standard value, "E", if only window W1, "F"
, if there is only window W2, it can be determined to be "L".

このような手法を用いる従来の処理装置では、2次元の
撮像カメラを用いて、2次元画像中の所定エリアを抽出
しているが、まだまだ価格が高く、手法としては汎用で
ありながら一般の工場にはなかなか普及していない。価
格の高くなる1つの理由は2次元カメラ(2次元撮像デ
バイス)を使用し7でいることによっており、カメラ本
体とそのスキャナーや2次元画像を記憶するメモリ等が
価格低下の大きな障害となっている。
Conventional processing equipment that uses such a method uses a two-dimensional imaging camera to extract a predetermined area in a two-dimensional image, but it is still expensive and although the method is general-purpose, it cannot be used in general factories. It is not very popular in Japan. One reason for the high price is that it uses a 2D camera (2D imaging device), and the camera body, its scanner, and the memory that stores 2D images are major obstacles to lowering the price. There is.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

そこで本発明は、近年ファクシミリの普及に伴い急速に
価格の低下してきた1次元ラインセンサを2次元撮像デ
バイスの代りに用い、搬送される物品の搬送方向をもう
1つの次元として、2次元撮像デバイスを用いた場合と
同様のウィンド手法を安価に構成することを解決すべき
問題点としており、そのために役立つ安価で普及しやす
い直列データ処理装置を提供することを本発明の目的と
している。
Therefore, the present invention uses a one-dimensional line sensor, whose price has rapidly decreased with the spread of facsimiles in recent years, in place of a two-dimensional imaging device, and uses a two-dimensional imaging device with the transport direction of the transported article as another dimension. The problem to be solved is to construct a window method similar to the case using the above method at a low cost, and an object of the present invention is to provide a serial data processing device that is useful for this purpose and is inexpensive and easy to spread.

〔問題点を解決するための手段および作用〕本発明では
、物品を搬送する搬送ラインの速度に反比例したパルス
間隔をもつパルス列(つまり搬送ラインの速度が筒速で
あれば高周期、低速であれば低周期のパルス列)、ある
いは搬送ラインの速度が十分一定と考えられる場合には
通常の等周期クロックを一方の次元とし、−次元ライン
センサのスキャン方向を他方の次元とと2で2次元画像
に相当するものを構成し、設定された複数個のウィンド
を搬送方向に沿って設けた座標データにより識別し、該
ウィンド内の面積に相当する各走査毎の画素数の合計を
演算処理によって求めるよ−)にしたため、高価な2次
元撮像デバイスの代わりに、安価な一次元ラインセンサ
を用い、−走査分の画像メモリしか要しないで、2次元
撮像デバイスと同様のウィンド手法を実現することを可
能にしている。
[Means and effects for solving the problem] In the present invention, a pulse train having a pulse interval inversely proportional to the speed of the transport line that transports the article (that is, if the speed of the transport line is cylinder speed, whether it is high cycle or low speed), (e.g., a low-period pulse train), or if the speed of the conveyance line is considered to be sufficiently constant, a two-dimensional image is created with a normal equal-period clock as one dimension and the scan direction of the -dimensional line sensor as the other dimension. , the plurality of set windows are identified by coordinate data provided along the transport direction, and the total number of pixels for each scan corresponding to the area within the window is calculated by calculation processing. Therefore, instead of an expensive two-dimensional imaging device, we used an inexpensive one-dimensional line sensor to realize a window method similar to that of a two-dimensional imaging device, requiring only an image memory for -scanning. It makes it possible.

なお、上述のようにして、演算処理によってウィンド内
の面積に相当する画素数の合計を前記1次ラインセンサ
の直列出力データから求めるための装置が本発明による
直列データ処理装置である。
The serial data processing device according to the present invention is a device for calculating the total number of pixels corresponding to the area within the window from the serial output data of the primary line sensor through arithmetic processing as described above.

次元、第1図、第1A図を参照して、本発明による直列
データ処理装置の基本的な構成、動作原理を具体的に説
明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The basic configuration and operating principle of the serial data processing apparatus according to the present invention will be specifically explained with reference to FIGS. 1 and 1A.

第1図:よ本発明による直列データ処理装置の基本構成
を示す7’ l) 7−り図、第1A図うよ視野内の・
″フインド領域の座標説明図、である。
Figure 1: Figure 1A shows the basic configuration of the serial data processing device according to the present invention.
This is an explanatory diagram of the coordinates of the ``find area.''

説明の都合14、第1へ図の説明から先に入る。For convenience of explanation, let us first begin with the explanation of the figures.

(覗込さねてくる物品を望む視野S内に、1kに図−j
くの如(、三つのつ・インドWl、W2)W3を定めた
とする。すると、物品の搬送力向であるY方向におJJ
る各ウィンドのY座標区間Yl(ωと◎の間)、Y2 
 ((0,’:Oの間>、  Y3  (■とOの間)
および1次元ラインセンサ4の走査方向であるX方向に
おHjるX座標区間XI、X2.X3は、それぞれ座標
データとし2て15−えられることになる。
(In the field of view S where you want to see the object you are looking into,
Assume that we have determined W3. Then, JJ in the Y direction, which is the direction of the conveying force of the article.
Y coordinate interval Yl (between ω and ◎) of each window, Y2
((0,': between O>, Y3 (between ■ and O)
and X coordinate sections XI, X2 . X3 will be obtained as 2 coordinate data.

次元第1図を参照する。同図において、X座標データ記
憶装置51は、各ウィンドのX座標データX1.X2.
X3を記(gしている。またY座標データ記ta装置5
2は、各・5インドのY座標データYl、Y2.Y3を
泥土aしている。
Dimensions Refer to Figure 1. In the figure, an X coordinate data storage device 51 stores X coordinate data X1 . X2.
X3 is recorded (g). Also, Y coordinate data recording device 5
2 is the Y coordinate data Yl, Y2 . I'm using Y3 as a mud.

座標データ比較手段53は1、図示せざる手段により発
生される物品搬送ラインの搬送速度を表わすパルス列を
入力され、これを計数して物品(つます視野S)と1次
元ラインセンサ4との間の相対的距1離く物品一つまり
視野Sが静止していてう・インセンサ4が逆にY方向に
移動していると考えたときの該センサ4のY座標)を求
め、これと、記憶装置52からの各ウィンドのY座標デ
ータとを比較し、両者が一致する限り、出力を発生して
ウィンド領域出力手段54へ送出している。
1, the coordinate data comparing means 53 receives a pulse train representing the conveyance speed of the article conveyance line generated by a means not shown, counts this pulse train, and calculates the pulse train between the article (the visual field S) and the one-dimensional line sensor 4; If we consider that the object 1, that is, the field of view S, is stationary and the sensor 4 is moving in the Y direction, calculate the relative distance 1 of the sensor 4 (Y coordinate), and calculate this and the memory. The Y coordinate data of each window from the device 52 is compared, and as long as the two match, an output is generated and sent to the window area output means 54.

ウィンド領域出力手段54は、座標比較手段53からの
出力を受けるほか、記’Iff、装置51からのX座標
データも入力されており、両者の論理積出力、例えば比
較手段53からのY1座標データと記憶装置51からの
X1座標データの論理積をつ・インド領域W1信号とし
て、また同様にY2座標データとX2座標データの論理
積をウィンド領域W2信号として、同じ<Y3座標デー
タとX3座標データの論理積をウィンド領域W3信号と
して、8A数手段55へ送出する。
In addition to receiving the output from the coordinate comparison means 53, the window area output means 54 also receives the X coordinate data from the device 51, and outputs the logical product of the two, for example, the Y1 coordinate data from the comparison means 53. The AND of the The AND is sent to the 8A number means 55 as a window area W3 signal.

計数手段55は、1次元ラインセン″IJ4から出力さ
れる直列の走査データを、ウィンド領域信号が入力され
ている間だけ、つまりウィンドWlならWlの領域の範
囲で1走査分ず・つ吟味して、その中の画かデータ(論
理“l“なら“l”)を検出して4敏し、カロ算手段5
6・\送る。
The counting means 55 examines the serial scanning data output from the one-dimensional line sensor "IJ4" only while the window area signal is being input, that is, if the window Wl is selected, the counting means 55 examines the serial scanning data outputted from the one-dimensional line sensor "IJ4" by one scanning within the range of the area Wl. , detects the image or data (“l” if it is logical “l”) therein, calculates it, and calculates the number by calculating means 5.
6.\Send.

加算手段56は、計数手段55からの、各つ1″ンド領
域の範囲内での1走査分ずつの走査y−夕に含まれる画
素データの計数結果を名つ・インド領域毎ζこ加算し、
その合計を保持手段57・\送−,で保持さゼる。
The adding means 56 adds up the counting results of the pixel data included in each scan within the range of each 1" Indian region from the counting means 55 for each Indian region. ,
The total is held by the holding means 57.

この場合、ウィンド領域Wl、W2.W3は例え部分的
にせよ重なり部分が発生し、ないよ−′)に設定される
ので保持手段57乙こは、各つ・イン[゛領域別に求め
られた画素データの合3)が保持されること己こなる4
、そこで各つ・インド別の金工1値を別Qこ用意しまた
各ウィンド別の基十値との比I咬に供I2)その結果に
よって良否の判定を行うこヒができる。
In this case, the window areas Wl, W2 . W3 is set so that even if it is only a partial overlap, there will be no overlapping part. Therefore, the holding means 57 is set so that the sum of the pixel data obtained for each area is held. Kotokonaru 4
Therefore, it is possible to prepare a separate set of metalwork values for each Indian metalwork and compare them with the basic ten values for each window.

本発明による直列データ処理装置の基本構成・−1:ら
びに動作原理は以−Lの如くである。
The basic configuration and operating principle of the serial data processing device according to the present invention are as follows.

[実施例〕 次ζ、こ図を参照して木争明の実施例を説明する。[Example〕 Next, an embodiment of the tree fight will be explained with reference to this figure.

第・1図に、本発明の一実施例とと7での直列デ〜り処
理装置を製品検査に適用した場合の構成、配置例を斜視
図で示す。
FIG. 1 is a perspective view showing an example of the configuration and arrangement of a serial data processing apparatus according to an embodiment of the present invention and 7 applied to product inspection.

同図を参照する。ヘルドコンベヤ1で搬送されてくる製
品2は照明装置3によって照明される。
Refer to the same figure. A product 2 conveyed by a heald conveyor 1 is illuminated by a lighting device 3.

1次元ラインセンサカメラ4の視野5はヘルドコンベヤ
1の進行方向6に直角に配置され、製品2の1次元映像
は直列データとして、本発明による直列データ処理装置
7に送られる。
The field of view 5 of the one-dimensional line sensor camera 4 is arranged at right angles to the traveling direction 6 of the heald conveyor 1, and the one-dimensional image of the product 2 is sent as serial data to the serial data processing device 7 according to the invention.

位置センサ8は製品2を検出し、製品2が視野5の位置
を通過している間だけONL、0N−OFF信号を直列
データ処理装置7に送る。ロークリエンコーダ9は、ベ
ルトコンベヤ1の進行速度に反比例したパルス間隔をも
つパルス列を直列データ処理装置7に送り、直列データ
処理装置7はこの信号を計数することによって、製品2
のベルトコンベヤ進行方向6の座標を知ることができる
ので、これによって製品2上の所定のウィンド領域が1
次元センサカメラ4の視野5を通過中の期間を知り、こ
の間に、該カメラ4の出力中の有意ビット(2値化出力
中の論理“1”なら“1”の画素信号)の数を計数、加
算し、製品2上の所定ウィンド領域の面積に比例した量
を計測することができる。
The position sensor 8 detects the product 2 and sends ONL and ON-OFF signals to the serial data processing device 7 only while the product 2 passes through the position of the field of view 5. The row encoder 9 sends a pulse train having a pulse interval inversely proportional to the traveling speed of the belt conveyor 1 to the serial data processing device 7.
Since the coordinates of the belt conveyor traveling direction 6 can be known, this allows the predetermined window area on the product 2 to be 1
Know the period during which the dimensional sensor camera 4 is passing through the field of view 5, and count the number of significant bits in the output of the camera 4 (pixel signal of "1" if the logic is "1" in the binary output) during this period. , and can measure an amount proportional to the area of a predetermined window area on the product 2.

製品2が通過後、直列データ処理装置7はウィンド領域
についての計測結果を基準値と比較して判定し不良品と
判定されれば、エアシリンダドライバー10に信号を送
り、エアシリンダ11を動かして製品2を不良品コンベ
ヤ12に向けて押しだす。
After the product 2 has passed, the serial data processing device 7 compares the measurement results for the window area with the reference value to determine the product. If the product is determined to be defective, it sends a signal to the air cylinder driver 10 to move the air cylinder 11. The product 2 is pushed out toward the defective product conveyor 12.

第5図は本発明の一実施例としての直列データ処理装置
7のハードウェア構成の例を示すプロ・ツク図である。
FIG. 5 is a block diagram showing an example of the hardware configuration of the serial data processing device 7 as an embodiment of the present invention.

同図において、イメージセンサドライバー13は一次元
ラインイメージセンサ14に、走査の開始を示すトリガ
ー信号TRと転送りロックCLK1を送り、このタイミ
ングに合わせてレンズ15によってイメージセンサ14
上に結像した製品2のアナログ画像13号■Sを出力す
る。アナログ画像信号VSは一定しベルの閾値電圧で2
値化された2値化画像信号VVSとして直列データ処理
装置7に入力される。
In the figure, the image sensor driver 13 sends a trigger signal TR indicating the start of scanning and a transfer lock CLK1 to the one-dimensional line image sensor 14.
Analog image No. 13 ■S of product 2 imaged above is output. The analog image signal VS is constant and has a threshold voltage of 2
The signal is input to the serial data processing device 7 as a binarized image signal VVS.

[)MA (ダイレフ1−メモリアクセス)コントロー
ラ16はi / oポート17からのDMA要求REQ
DMAに対応してDMA応答D M A Rを出力し、
バッファ18.19を切り換えて、バスをDMAコント
ローラ16側に切換え2値化画像信号VVSをV I 
DEO−RAM20にDMA転送する。
[)MA (Die Ref 1 - Memory Access) Controller 16 receives DMA request REQ from I/O port 17
Outputs a DMA response DMAR in response to the DMA,
Switch the buffers 18 and 19, switch the bus to the DMA controller 16 side, and transfer the binary image signal VVS to the V I
DMA transfer to DEO-RAM20.

ロータリーエンコーダ9の出力信号(パルス)は、CP
U21の割込端子INTLとINT2に入力され、割込
処理によって該エンコーダ9がらのパルス数が計数され
る。またCPU2 tは位置センサ8の0N−OFF信
号(製品2の到来の有無を示ずSAMP信号)をi /
 oボートエフを通して読取ることができ、出力は同じ
(i10ポート17を通してACT信号として出力され
、エアーシリンダ11を駆動することができる。
The output signal (pulse) of the rotary encoder 9 is CP
The pulses are input to interrupt terminals INTL and INT2 of U21, and the number of pulses from the encoder 9 is counted by interrupt processing. In addition, the CPU 2 t sends the 0N-OFF signal of the position sensor 8 (SAMP signal indicating whether or not the product 2 has arrived) to i/
It can be read through the o boat ef, and the output is the same (it is output as an ACT signal through the i10 port 17 and can drive the air cylinder 11.

その他にCPU21は、キーボード入力装置22から必
要データ(すなわち設定されたウィンド領域の座標デー
タなど)の入力を受けることができ、ROM22に記述
されたプログラムに従い、汎用RAM23をメモリとし
て処理を行う。
In addition, the CPU 21 can receive input of necessary data (ie, coordinate data of a set window area, etc.) from the keyboard input device 22, and performs processing according to a program written in the ROM 22 using the general-purpose RAM 23 as a memory.

第6図は第5図における要部の信号のタイミングヂャー
トである。同図を併せ参照する。
FIG. 6 is a timing chart of the main parts of the signals in FIG. Please also refer to the same figure.

1次元ラインイメージセンサ14は、トリガー24をス
タート信号TRとして、1947分の全画素数2.04
8のアナログ画像信号25(VS)を出ツノし、2値化
された2値化画像26が■■sとしてDMAコントロー
ラ16に入力される。CP[J21は、2値化画像デー
タVVSが必要な時には、i / oボート17を通し
てDMA要求27(REQDMA)をパルス出力し、該
パルスの立下りでDMA応答2B CDMAR)が返信
され、1ライン分2.048画素のデータ転送が開始さ
れる。
The one-dimensional line image sensor 14 uses the trigger 24 as the start signal TR and has a total number of pixels of 2.04 for 1947 minutes.
An analog image signal 25 (VS) of 8 is output, and a binarized image 26 is inputted to the DMA controller 16 as ■■s. When CP[J21 requires binary image data VVS, it outputs a pulse of DMA request 27 (REQDMA) through the I/O boat 17, and at the falling edge of the pulse, a DMA response 2B (CDMAR) is returned, and one line is sent. Data transfer of 2.048 pixels is started.

2値化画像信号26(VVS)は、転送りロック29(
CLKI)によ−+ 7 V I D E O・RA 
M2OにDMA転送され、該りo 7り29(CLKl
)のタイミングで2値化画像信号26 (VMS)が高
レベルか低レベルかが判定され、それに従いV I D
EO−RAM20内の画像メモリ30(第5図には図示
ゼず)内に第6図Qこ示すよ・うに記憶される。
The binarized image signal 26 (VVS) is transferred to the transfer lock 29 (
CLKI) + 7 V I D E O・RA
The DMA is transferred to M2O, and the data is transferred to M2O.
), it is determined whether the binarized image signal 26 (VMS) is at a high level or a low level, and V I D is determined accordingly.
The image data is stored in the image memory 30 (not shown in FIG. 5) in the EO-RAM 20 as shown in FIG. 6Q.

第7図は第5図に示1.た本発明の一実施例におけるメ
モリ構成の具体例を示した説明図である。
Figure 7 is shown in Figure 5.1. FIG. 2 is an explanatory diagram showing a specific example of a memory configuration in an embodiment of the present invention.

第7図に示した各メモリ領域1ま、第5図ではRAM 
23に配置される。
Each memory area 1 shown in FIG. 7, RAM in FIG.
It is located at 23.

直列データバッファ3OAはD M A転送された直列
データをV I DEO−RAM20から読み込み、R
AM23にバッファリングしておくための領域である。
The serial data buffer 3OA reads the DMA-transferred serial data from the VI DEO-RAM 20, and
This is an area for buffering in AM23.

ウィンドのX座標データ記憶領域3Iは、1次元ライン
センサI4の走査方向をX座標とする各ウィンドの開始
点と終了点の各座標を1次元ラインセンサ1、↓の1ラ
イン分の画素数の順番で表わしたものを記taシている
。このX座標データにより、入力直列データの中からウ
ィンド領域に含まれるデータをとり出し、その中から有
意画素(論理“′1”なら“1“の画素)数を計数する
The window X coordinate data storage area 3I stores the coordinates of the start point and end point of each window with the scanning direction of the one-dimensional line sensor I4 as the X coordinate, and stores the number of pixels for one line of the one-dimensional line sensor 1, ↓. The items expressed in order are listed below. Based on this X coordinate data, the data included in the window area is extracted from the input serial data, and the number of significant pixels (pixels of "1" if the logic is "'1") is counted.

ウィンドのX座標データ記憶領域31中においてX (
N、0)とあるのは、第N番目のウィンドの開始点く開
く点)のX座標(ラインセンサ14の1ラインl′jの
画素数の並びの順て云パ)と1−5SB側の座標)が記
・1Gされる領域である、二と庖意味し2)X (N、
1)とあるの(A1、同しく第N番1.1のウィンF’
の終了点く閉しる点)のX座標(ラインセンサ14の1
ライン分の画素数の並びの(唄で云うとM S B側の
座標)が記jQされる領域であることを意味している。
In the window's X coordinate data storage area 31, X (
N, 0) is the X coordinate of the starting point of the Nth window (opening point) (the order of the number of pixels in one line l'j of the line sensor 14) and the 1-5SB side. This is the area where the coordinates of
1) There is (A1, also No. N 1.1 Win F'
X coordinate (1 of the line sensor 14) of the ending point of
This means that it is an area where the arrangement of the number of pixels for a line (coordinates on the MSB side in the song) is recorded.

ウィンドのX座標データ記憶領域32は、I:1−タリ
エンコーダ9からの出力パルス数でス1わさ?7たウィ
ンドのX座標データを記iQする領域であり、同領域3
2において、Y (N、0)とあるのは、第N番目のウ
ィンドの開始点(開く:点)のY座ILを記憶する領域
であることを意味し、Y(N、1)とあるのは、同じく
第N番目の・:ノイユ・・′トの終了点(閉じる点)の
X座標を記憶する1i[¥域である、ことを意味してい
る。
The window X-coordinate data storage area 32 is filled with the number of output pulses from the I:1-Tari encoder 9. This is the area where the X coordinate data of the 7th window is recorded, and the same area 3
2, Y (N, 0) means that it is an area that stores the Y locus IL of the starting point (opening point) of the Nth window, and Y (N, 1) means that it is the 1i[\\ area that also stores the X coordinate of the end point (closing point) of the Nth .:Nouille...'.

判定デー・夕記憶領域33は、判定されたつ・インドに
ついての測定結果を比較するだめの、その比較の対象に
なる基準値データを配性゛する領域である。同領域3.
3において、REG (N)、THE(N)とあるのは
、第N番目のウィン[・についての測定結果が、 REG (N) i TRE (N) のLn囲にあれば良、範囲外であれば不良であることを
意味するデータである。つまりREG (N)は第N番
目のつ・インドについての基準値を表わすデータであり
、TRE (N)は許容誤差を表わすデータであると云
える。
The judgment data/data storage area 33 is an area for storing reference value data to be compared with the measurement results for the judged country India. Same area 3.
In 3, REG (N) and THE (N) mean that the measurement result for the Nth win is good if it is within the Ln range of REG (N) i TRE (N), and if it is outside the range. If present, this data means that it is defective. In other words, it can be said that REG (N) is data representing the reference value for the Nth India, and TRE (N) is data representing the allowable error.

ワーク領域34は、AからLまでの各ワーク領域から成
るもので、CPUが処理動作を実行する際に用いられる
各ワー・り領域を示し、A71J至1.の添字(識別記
号)ば同じ動作を繰り返すときの添字として用いられる
The work area 34 consists of work areas A to L, and indicates each work area used when the CPU executes a processing operation, A71J to 1. The subscript (identification symbol) is used as a subscript when repeating the same operation.

X座標整理データ記憶領域35は、・ウィンドのX座標
データ記憶領域32に記憶されているY座標データを、
ウィンド番号に関係なく、大きさの順乙こ従って並べ変
えたものである。第1A図において、ウィンドW1の開
始点のX座標は■、終了点のX座標は◎、ウィンドW2
の開始点のX座標は■、#%−j”点のX座標は■、ウ
ィンドW3の開始点のY座標目■、終了点のY座標目、
(へ)であるが、この場合、領域35においては、大き
さの11in、−)まり■、■、0.○、■、θのm4
、二並べ換え”て′1゛Y(1)、’TY (2)、 
T Y (3)、・・・・・・T Y (2N)と置い
たものである。
The X-coordinate organized data storage area 35 stores the Y-coordinate data stored in the window's X-coordinate data storage area 32,
They are rearranged in order of size, regardless of the window number. In FIG. 1A, the X coordinate of the starting point of window W1 is ■, the X coordinate of the ending point is ◎, and window W2
The X coordinate of the starting point of window W3 is ■, the X coordinate of #%-j'' point is ■, the Y coordinate of the starting point of window W3 is ■, the Y coordinate of the ending point is
(to), but in this case, in the area 35, the size is 11 inches, -), ■, ■, 0. m4 of ○, ■, θ
, two rearranged 'te'1゛Y (1), 'TY (2),
T Y (3), ...T Y (2N).

今、ILI−タリエンコーダ9の出力パルスの計S々値
が”T’Y(1)つまり第1A図の■に達U7たとする
と、この場合、この夕・イミンゲでウィンF’WIが開
いたことになり、次元ロータリj=ンコーダ9の出力パ
ルス計数値がTY(2)つまり第1Δ図の○に達すると
、このタイミングでウィンドW2が開き、同様にして出
力パルス計数値がTY(3)に達すると、このタイミン
グでウィンドW1が閉したことになり、以下、同様にし
て、各つ・イン1の開または閉のタイミニフグが順番乙
こ判1す目−る。
Now, suppose that the total S value of the output pulses of the ILI-Tari encoder 9 reaches "T'Y (1)", that is, U7 of ■ in Figure 1A, then in this case, the win F'WI opened this evening at Iminge Therefore, when the output pulse count value of the dimensional rotary j=encoder 9 reaches TY(2), that is, the circle in Fig. 1Δ, the window W2 opens at this timing, and in the same way, the output pulse count value becomes TY(3). When this timing is reached, the window W1 is closed, and in the same manner, each inn 1 is opened or closed in order.

そこで開閉番号データ記憶領域36の0CW(1)では
、領域35!こおけるTV(1)に対応し7たつ、イン
i・番号、この場合はWlを記憶l、、また開閉データ
配位領域37にお乙」るocci)では、つ・インド番
号W1のウィンドが間か閉かのデータ、唯今の例で云う
と開のデータを記憶することになる。
Therefore, in 0CW(1) of the opening/closing number data storage area 36, the area 35! 7, corresponding to the TV (1) in the window, remember the number, in this case Wl, and also in the open/close data arrangement area 37 (occi), the window with the Indian number W1 is stored. This means that data for open or closed, in this example, open data will be stored.

ウィンドワーク領域38は、現在の各ウィンドの開閉状
況を記憶する領域であるが、開閉データ記憶領域37の
データにより、刻々、修正される。
The window work area 38 is an area that stores the current opening/closing status of each window, and is modified every moment based on the data in the opening/closing data storage area 37.

加算ワーク領域39は、N個の領域から成っており、C
PU21がウィンドワーク領域38を見て、開いている
ウィンド、例えばWlを知ると、次元ウィンドのX座標
データ記憶領域31を見てウィンドW1のX座標データ
を知り、これを用いて直列出力データの中からウィンド
領域Wlに含まれる1走査分ずつの存意画素数を検出し
て計数し、その結果をワーク領域39中の、例えばAR
E A (1)に加算するのである。
The addition work area 39 consists of N areas, and C
When the PU 21 looks at the window work area 38 and learns the open window, for example Wl, it looks at the dimensional window's The number of existing pixels included in the window area Wl for each scan is detected and counted, and the result is displayed in the work area 39, for example, in the AR
It is added to E A (1).

次元タイマー領域40は、計数領域T I MER(1
)とTIMER(2)から成っており、前者はロークリ
エンコーダ9の出力パルスを計数する領域であり、後者
は1次元ラインーイメージセンサ14を駆動するクロッ
クCLK 1を計数する領域である。
The dimensional timer area 40 has a counting area T I MER(1
) and TIMER (2), the former is an area for counting the output pulses of the row encoder 9, and the latter is an area for counting the clock CLK 1 that drives the one-dimensional line image sensor 14.

次元、第5図におけるROM22に含まれているプログ
ラムを、フローチャート第8図〜第14図に従って説明
する。
The program included in the ROM 22 in FIG. 5 will be explained in accordance with the flowcharts in FIGS. 8 to 14.

第8図は主プログラムで、通常CPU21こよってこの
ルーチンが繰り返される。
FIG. 8 shows the main program, and this routine is normally repeated by the CPU 21.

キーボード入力装置22からの入力があるかどうかをス
テップ(1)で調べる。何らかのキー人力があればステ
・ノブ(2)へ進み、サブルーチンとしてのキーボード
入力処理ルーチンでキーボードからの入力を読み込んだ
後、ステップ(3)に進む。
It is checked in step (1) whether there is any input from the keyboard input device 22. If there is any key input, the process proceeds to Step Nob (2), and after reading input from the keyboard in a keyboard input processing routine as a subroutine, the process proceeds to Step (3).

ステップ(1)でキーボードの入力がなければステップ
(3)にジャンプする。ステップ(3)では、位置セン
サ8の出力信号SAMPを読込み、前回読込んだSAM
P信号と比較する(ステップ4)。
If there is no keyboard input in step (1), jump to step (3). In step (3), the output signal SAMP of the position sensor 8 is read, and the previously read SAM
Compare with the P signal (step 4).

その結果、ステップ(5)で前回SAMP信号が低レベ
ルで今回読込んだSAMP信号が高レベルかどうかを判
定し、そうであれば、SAMP信号立上り有と判定し、
製品2が視野5にちょうど入ってきたところだと判断し
てステップ(6)に進み、これからのウィンド測定に必
要なイニシャルセットを行うためのイニシャル処理サブ
ルーチンを実行する。SAMP信号立上り無し場合は、
ステップ(7)に進み、今回読込んだSAMP信号が高
レベルであるかどうかを判定する。
As a result, in step (5), it is determined whether the previous SAMP signal was low level and the SAMP signal read this time is high level, and if so, it is determined that the SAMP signal has risen,
It is determined that the product 2 has just entered the field of view 5, and the process proceeds to step (6), where an initial processing subroutine is executed to perform the initial setting necessary for future window measurements. If the SAMP signal does not rise,
Proceeding to step (7), it is determined whether the SAMP signal read this time is at a high level.

その結果、今回読込んだSAMP信号が高レベルであれ
ば、視野中に測定すべき製品があることになるのでステ
ップ(8)に進み、サブルーチンとしての測定処理を実
行する。低レベルであればステップ(9)に進み、今度
は前回読込んだSAMP信号が高レベルであれば製品2
が視野5を丁度通過したタイミングであると判定してス
テップ(10)へ進み、加算ワーク領域39にメモリさ
れた測定結果と判定データ記憶領域33に記taされた
データとを比較し、良品か不良品を判定するためのサブ
ルーチン判定処理を実行する。
As a result, if the SAMP signal read this time is at a high level, it means that there is a product to be measured within the field of view, so the process proceeds to step (8) and a measurement process as a subroutine is executed. If the level is low, proceed to step (9), and if the previously read SAMP signal is high level, product 2
It is determined that the timing has just passed the field of view 5, and the process proceeds to step (10), where the measurement results stored in the addition work area 39 and the data recorded in the judgment data storage area 33 are compared, and whether the product is good or not. Execute subroutine determination processing to determine defective products.

立下りでもない場合は製品2がまったく視野からはずれ
ている場合であり、RET (リターン)へ進む。RE
T後はその他の処理(本発明の要点とは関係しないため
省く)を行い再び5TARTに戻り、以降ステップ(1
)〜(10)を繰り返す。
If it is not a falling edge, it means that product 2 is completely out of sight, and the process proceeds to RET (return). R.E.
After T, perform other processing (omitted as it is not related to the main point of the present invention), return to 5TART, and then proceed to step (1).
) to (10) are repeated.

第9図に前述のサブルーチンとしてのキーボード入力処
理のフローチャートを示す。
FIG. 9 shows a flowchart of keyboard input processing as the subroutine described above.

ステップ(11)では、ナンバーにのウィンド座標を記
憶領域31.32のX(k、J)、Y(k、J)領域に
読み込む(但しに=1.2・・・N、 J=0.1 )
In step (11), the window coordinates of the number are read into the X (k, J), Y (k, J) areas of the storage area 31.32 (where = 1.2...N, J = 0. 1)
.

各データの内容は先に第7図を参照して説明したとおり
である。
The contents of each data are as described above with reference to FIG.

次元ステップ(12) 、 (13)で判定データ記憶
領域33に格納する比較基準値および許容誤差を読込む
ステップ(14)に進む。ステップ(14)ではキー人
力が終了し、必要なデータが全部入力されたかどうかを
判定し、まだ終了してなければステップ(11)にもど
ってステップ(11)−(12)−(13)を操り返す
。必要なデータがすべて入力されてしまえば、ステップ
(15)に進む。
The process proceeds to step (14) of reading the comparison reference value and tolerance stored in the judgment data storage area 33 in the dimension steps (12) and (13). In step (14), it is determined whether the key input has been completed and all necessary data has been input. If it has not been completed yet, return to step (11) and repeat steps (11)-(12)-(13). Manipulate back. Once all necessary data has been input, proceed to step (15).

ステ、ブ(15)では、Y (k、J)の値をに=1゜
2・・・N、J=0.1にわたって全部を調べ、Y (
k。
In step (15), all values of Y (k, J) are examined over the range of = 1°2...N, J = 0.1, and Y (
k.

J)の小さい方から順にKを1から2Nまで割当て、Y
座標整理データ記憶領域35の領域TY(K)にY (
k、J)を、開閉番号データ記憶領域36の領域OCW
 (K)にkを、開閉データ領域37の領域QC(K)
に、Jの値をメモリする。従ってTY (K)≦TY(
K+1>の関係にある。
Assign K from 1 to 2N in descending order of Y)
Y (
k, J) in the area OCW of the opening/closing number data storage area 36.
k in (K), area QC (K) of opening/closing data area 37
, the value of J is memorized. Therefore, TY (K)≦TY(
The relationship is K+1>.

ロータリエンコーダ9の出力パルスをCPU21の割込
入力lNTlで計数してその値がT)′(k)となった
時、ウィンド番号OCW (k)のウィンドが、QC(
k)がOならば閉、すなわぢウィンドの終了点であり、
QC(k)が1ならば開、すなわちウィンドの開始点で
あると判定できる。
When the output pulses of the rotary encoder 9 are counted by the interrupt input lNTl of the CPU 21 and the value becomes T)'(k), the window of the window number OCW (k) is
If k) is O, it is closed, that is, it is the end point of the window,
If QC(k) is 1, it can be determined that it is open, that is, the starting point of the window.

第10図にサブルーチンとしてのイニシャル処理のフロ
ーチャートを示す。イニシャル処理は、測定を行う直前
のイニシャル七ノドを行うもので、ある。この状態では
、ウィンドはどれも閉の状態なので、ウィンドW (k
)のに=l〜Nまですべて、ウィンドが閉であることを
示すOをウィンドワーク領域38に代入する。つ・イン
)”W(k)の測定面積を示す加算ワーク領域39のA
REA(I<、)にも初賄値として0を代入する。
FIG. 10 shows a flowchart of initial processing as a subroutine. Initial processing is performed by performing seven initial steps immediately before measurement. In this state, all windows are closed, so the window W (k
), O indicating that the window is closed is substituted into the window work area 38 for all values from =l to N. A of the addition work area 39 indicating the measurement area of ``W(k)''
0 is also assigned to REA (I<,) as the initial bribe value.

ステップ(T7)では、タイマー領域40117)TI
I〜4Elで(1)とTIMER(2)をブリセントと
してOを入れる。ステップ(18)で記憶領域35 v
−)1゛Y ck)の(lり)の値を指定するワーク領
域34中の添字へを1.lと゛す゛る。
In step (T7), the timer area 40117) TI
In I~4El, set O to (1) and TIMER (2) as Bricent. In step (18) storage area 35 v
-) 1゛Yck) to the subscript in the work area 34 that specifies the value of (1). L and ゛゛ru.

ステップ(19)では、ロークリエンコーダ9からのパ
ルス入力をカウントするために割込入力の1NTIをイ
ネーブルにする。
In step (19), the interrupt input 1NTI is enabled in order to count the pulse input from the low reencoder 9.

第11図にI N T1の割込処理ルーチンlNT1を
示す。このルーチンは、20−クリエンコーダ9からの
出力パルスが1つ入る毎Gこ、i N T1−”(20
)・・・・・・(28) −RE Tの処理を1回だけ
行う。ステ、ア(20)ではTIMER(1)を1っカ
ラン1〜アツプする。ステップ(21)ではT+MEI
マ(1)がTV (A)と等しくなったかどうかを調べ
る。A’、!:サブルーヂンイニシャル処理(第10図
)ζこ、J、り最初は1にセソl”されている。
FIG. 11 shows the interrupt processing routine INT1 of INT1. In this routine, every time one output pulse from the encoder 9 is input, i N T1-''(20
)...(28) -RET processing is performed only once. At Step A (20), TIMER (1) is raised from 1 to 1. In step (21), T+MEI
Check whether Ma(1) is equal to TV(A). A',! : Subroutine initial processing (Fig. 10) ζ, J, is initially set to 1.

もし1” I MER(1) =TV’ (A) T:
あればx −i−ツブ(22)−に進みAを1っカウン
トアツプしてライ7 トW(OcW (A))?、:開
か閉が(II’) 7” −タ(っC(A)を代入する
。これはiコータリエンr2 =ダ9がらの出力パルス
のカウント1直がY座標データ記・1g領域32中のど
れかに等しくなった時、そのY座標データはウィンド番
号が何番(OCW (A)1のもののデータであり、ま
たそれはデータQC(A)が0であればウィンドの終了
点であり、1であればウィンドの開始点であることを意
味し、現在とのウィン1−が開閉しているかということ
を示すウィンドワーク領域38中の領域W (OCW(
A)l を七ノl−する処理である。
If 1" I MER(1) = TV' (A) T:
If so, go to x-i-tub (22)-, count up A by 1, and write 7 W (OcW (A))? , :open or close is (II'). When it becomes equal to either, the Y coordinate data is the data of the window number (OCW (A) 1), and if the data QC (A) is 0, it is the end point of the window, and it is 1. If so, it means that it is the starting point of the window, and the area W (OCW (
A) This is a process of reducing l by seven times.

この後ステップ(21)にもどりT I M lミR(
1)  =TY (A)かどうかを判定する。この時へ
の値は前回のステップ(21)での判定の時よりもステ
ップ(22)で+1されている。、二の(21)−(2
2)−(23)の繰り返しは、Y座標データ記憶領域;
(2の中で等しいものがある可能性があるためで、この
等しいものを全て処理すると、ステップ(21)の判定
はNOとなり、ステップ(24)に進む。
After this, return to step (21) and perform T I M R (
1) Determine whether =TY (A). The value at this time is +1 at step (22) compared to the previous determination at step (21). , 2 (21) - (2
2) - (23) are repeated in the Y coordinate data storage area;
(This is because there is a possibility that there are equal values among 2, and if all of these equal values are processed, the determination in step (21) becomes NO, and the process proceeds to step (24).

ステ・ノブ(24)で(よステップ(25)−(26)
−(27) −(28)をN回くり返すためにワーク領
域34の添字Mを初gJlイ直1にセットする。ステ、
・ツブ(25)でW(M)−〇かどうかを判定する6+
、V(M)はOか1かでありW(M)=1の場合はウィ
ンt’ Mが開であることを意味し、判定はNOである
ためステ・、7プ(26)を実行する。W(M)=Oの
場合はスー)゛〜ノツブ27)ヘジャニ/フ゛しMを+
1し7てステノフ゛(28)でN回の(25)−(26
)−(27)−(28)のルーチンを実行したかどうか
をチェックし、N回終了ならばl”S FF。
At Ste Nobu (24) (Yo Step (25) - (26)
-(27) - In order to repeat -(28) N times, set the subscript M of the work area 34 to the first gJl straight 1. Ste,
・6+ to determine whether W(M)-〇 with Tsubu (25)
, V(M) is either O or 1, and if W(M) = 1, it means that win t'M is open, and the judgment is NO, so execute step (26). do. If W (M) = O, then Sue) ~ Notsubu 27) Hejani/Fish M +
1 and 7 and Stenov (28) N times (25) - (26
)-(27)-(28) have been executed, and if they have been executed N times, l"S FF.

Tに進み4ナブル−チンを終了する。終了し、てぃない
ならばステップ25に進み次のM 1.ご対する処理を
行う。
Proceed to T to finish 4-nable-chin. If it is completed and not completed, proceed to step 25 and proceed to the next M1. We will process your request.

ステップ(26)では、1次元ラインイメージセンサ1
4による現在の走査測定データがメモリされている領域
VVSBに一ついて、ウィンドのX座標データ記憶領域
31からウーインドMの有意画素幅X(M、I)〜X 
(M、O)を知り、その箱間での有意ピノ!・数をカウ
ントし、ウィンド〜1の面積を計数し、AREA (M
)に加算する。この処理により二1ンー・ヤ進行方向の
座(ヅてあ・も・”)・イン1”のY座標区間と一次元
う・インートンリ・14())i[杏方向の座標である
ウィンドのX座標区間で規定さ、11.た個々のウイニ
2何・”内の有意ピノ1−の1)が計数される。
In step (26), the one-dimensional line image sensor 1
4 is stored in the area VVSB where the current scanning measurement data is stored, and from the window X coordinate data storage area 31 to the window M significant pixel width X (M, I) ~
Knowing (M, O), it is a significant pinot between the boxes!・Count the number, count the area of window 1, AREA (M
). By this processing, the Y-coordinate interval of 21-Ya in the direction of movement and the Y-coordinate interval of 14())i in the one-dimensional direction of the window defined by the X coordinate interval, 11. The number of significant pins within each win is counted.

なおVVSB (k)はRAM23内に配置されたデー
タであり (但しに=1.2.・・・・・・2048)
、■I DEO・RAM20にDMAで転送されたVV
S (k)をサブルーチン(後述の第12図に示す測定
処理内のプログラム)でそのままコピーしたものである
。これは処理中に次のD M A転送を行なえるように
するためである。
Note that VVSB (k) is data placed in the RAM 23 (however, = 1.2...2048)
,■I VV transferred to DEO・RAM20 by DMA
This is a copy of S (k) as is in a subroutine (a program within the measurement process shown in FIG. 12, which will be described later). This is to enable the next DMA transfer to be performed during processing.

第12図にサブルーチン(測定処理のフローチャート)
を示す。測定処理では常時DMAで測定データをVID
EO・RAM20に取り込み、これをRA M 23に
コピーする処理をする。
Figure 12 shows the subroutine (flowchart of measurement processing).
shows. During measurement processing, measurement data is always transferred to VID using DMA.
The data is imported into the EO/RAM 20 and then copied to the RAM 23.

ステップ(29)ではDMA要求信号REQDMAをD
 M Aコントローラ16に向けてパルス出力する。こ
のパルス出力27の立下りでDMAコントローラ16は
DMA応答応答信号DMA筒レベルにし、DMAデータ
転送が終了するまでその高レベルを保持するので、ステ
ップ(30)によりDMARが低レベルになるまで待ち
、ステップ(31)へ進む。
In step (29), the DMA request signal REQDMA is
A pulse is output to the MA controller 16. At the fall of this pulse output 27, the DMA controller 16 sets the DMA response response signal to the DMA cylinder level and holds the high level until the DMA data transfer is completed, so wait until DMAR becomes low level in step (30). Proceed to step (31).

ステップ(32)でV V S (I)を1=1〜20
48までV V S B (+)にコピーするが、コピ
ー中にlNT1が入力されてV V S B (+)が
変更し終らない内に読み出されるのをさけるため、1時
的にステップ(31)で割込を禁止し、コピーが終了し
た後ステップ(33)で割込をイネーブルにする。ステ
ップ(34)で一定時間待たせるのはDMA転送を間引
きして、割込処理をバランスよくさせるためである。
In step (32), set V V S (I) to 1=1 to 20.
48 to V V S B (+), but in order to avoid that lNT1 is input during the copying and read out before V V S B (+) is finished changing, the step (31 ), and after copying is completed, interrupts are enabled in step (33). The reason why the process is made to wait for a certain period of time in step (34) is to thin out DMA transfers and balance interrupt processing.

第13図にサブルーチン(判定出力処理のフローチャー
ト)を示す。このルーチンは製品2が視野5を通過した
直後に呼び出されるため、測定を中止する目的でステッ
プ(35)において割込lNT1を禁止する。ステップ
(36)では以下のステップ(37)−(38)−(3
9)をN回繰り返すため添字■を初期値1にセントする
。ステップ(37)では通過した製品2のウィンド測定
データA RE A (1)、(但しI=1.2・・・
・・・N)について、基準埴土許容誤差(REG(1)
±TRE(1))の範囲内に入っているのか否かを判定
し、入っていなければ不良品と判断してステップ(40
)にジャンプする。
FIG. 13 shows a subroutine (flowchart of determination output processing). Since this routine is called immediately after the product 2 passes through the field of view 5, the interrupt 1NT1 is disabled in step (35) in order to stop the measurement. In step (36), the following steps (37)-(38)-(3
9) is repeated N times, the subscript ■ is set to the initial value 1. In step (37), the wind measurement data A RE A (1) of the passed product 2 is obtained (where I=1.2...
...N), the standard clay tolerance (REG(1)
±TRE (1)).If not, it is determined that the product is defective and step (40
) to jump to.

入っている“場合はステップ(38)に進み■を1つ増
やして■がNを超えるまで(ステップ39)ステップ(
37)の判定を続ける。全部のウィンド測定値が良と判
断された場合にだけRETへ進みサブルーチン処理を終
える。
If it is, go to step (38) and increase ■ by one until ■ exceeds N (step 39).
Continue the judgment in 37). Only when all the window measurement values are determined to be good, the process advances to RET and the subroutine process ends.

ステップ(40)ではTIMER(2)に定数をセット
する。これはベルトコンベヤーで製品2が運ばれてエア
シリンダ11の前に達するまでの待ち時間であり、T 
I M E R(2)を計数するために割込2の1NT
2が許可される(ステップ41)。この定数は1よりも
大きい。
In step (40), a constant is set in TIMER (2). This is the waiting time until the product 2 is transported by the belt conveyor and reaches the front of the air cylinder 11, and T
1NT of interrupt 2 to count I M E R (2)
2 is allowed (step 41). This constant is greater than 1.

第14図に割込処理INT2のフローチャートを示す。FIG. 14 shows a flowchart of the interrupt processing INT2.

ステップ(42)ではTIMER(2)=Oなのかどう
かを判定し、0であればステップ(45)に進んで割込
INT2を禁止し、これ以後、再びサブルーチン判定出
力処理内のプログラム(第13図)で1NT2許可とな
るまで割込2のルーチンは実行されない。
In step (42), it is determined whether TIMER(2)=O or not, and if it is 0, the process proceeds to step (45) and interrupt INT2 is prohibited. After this, the program (13th The interrupt 2 routine is not executed until 1NT2 is enabled in Figure 2).

ステップ(43)ではTIMER(2)−1かどうかを
判定し、1であればエアシリンダを駆動させて(ステッ
プ44)、ステップ(46)でT I M E R(2
)をカウントダウンする。ステップ(43)で1でなけ
れば、まだ製品2はエアシリンダの前の位置までは運ば
れていないと判断してステップ(46)ヘジャンプする
In step (43), it is determined whether TIMER (2) - 1. If it is 1, the air cylinder is driven (step 44), and in step (46), TIMER (2) is determined.
) to count down. If it is not 1 in step (43), it is determined that product 2 has not yet been carried to the position in front of the air cylinder, and the process jumps to step (46).

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

以上説明したように本発明によれば、2次元の撮像カメ
ラを1次元のラインイメージセンサに置きかえ、領域3
1に記憶されたウィンドのX座標データと領域32に記
・1.0されたウィンドのY座標データとにより2次元
のウィンドエリアを構成し、ウィンドワーク領域38に
従って領域31中のX座標データ群の中から所定のX座
標データを選択し、ロータリーエンコーダ9からの出ノ
Jパルスに従って有意ビットの加算処理を行なえるよう
に構成したため、安価な1次元イメージセンサによって
2次元のウィンド画像処理を行えるようになった。
As explained above, according to the present invention, the two-dimensional imaging camera is replaced with a one-dimensional line image sensor, and
A two-dimensional window area is constructed by the window X coordinate data stored in 1.0 and the window Y coordinate data recorded in area 32 and 1.0, and the X coordinate data group in area 31 is Since the configuration is configured such that predetermined X coordinate data can be selected from among them and addition processing of significant bits can be performed according to the output J pulse from the rotary encoder 9, two-dimensional window image processing can be performed using an inexpensive one-dimensional image sensor. It became so.

なおこの場合ロータリーエンコーダ9は必ずしモ必要テ
はなく、コンベヤー2が十分等速で移動するならば、定
周期のクロックにおきかえることができる。
In this case, the rotary encoder 9 is not necessarily required, and if the conveyor 2 moves at a sufficiently constant speed, it can be replaced with a fixed-cycle clock.

また製品(物品)の視野内進入を表わすSAMP信号も
必ずしも必要ではなく、例えば視野5中に製品Aが映っ
ていることを2値化画像V V S (J)から判定し
、SAMP信号とみなすこともできる。
Furthermore, the SAMP signal indicating the entry of the product (article) into the field of view is not necessarily necessary; for example, it is determined from the binarized image V V S (J) that the product A is reflected in the field of view 5, and it is regarded as the SAMP signal. You can also do that.

また1次元ラインセンサに対して、コンベヤ移動方向は
直角でなくてもよく、コンベヤの移動が直線でなくても
よい。例えばコンベヤが半円を描いているとすればウィ
ンドの形は極座標で表わされるようになり、2次元カメ
ラを使った場合には簡単にできないウィンドを作ること
ができる。
Furthermore, the conveyor movement direction may not be perpendicular to the one-dimensional line sensor, and the conveyor movement may not be linear. For example, if a conveyor draws a semicircle, the shape of the window can be expressed in polar coordinates, making it possible to create windows that cannot be easily created using a two-dimensional camera.

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

第1図は本発明による直列データ処理装置の基本構成を
示すブロック図、第1A図は視野内ウィンド領域の座標
説明図、第2図、第3図はそれぞれウィンド画像処理の
例を示す説明図、第4図は本発明の一実施例を製品検査
に適用しまた場合の構成、配置例を示す斜視図、第5図
は本発明の一実施例のハードウェア構成を示すブロック
図、第6図は第5図における要部の信号のタイミングチ
ャー1・、第7図は第5図に示した本発明の一実施例に
おけるメモリ構成の具体例を示した説明図、第8図乃至
第14図は、それぞれROMに格納されているプログラ
ムを示すフローチャートであって、第8図は主プロゲラ
人のフローチャート、第9図はキーボード入力処理のフ
ローチャート、第10図はイニシャル処理のフローチャ
ート、第11図は割込処理lNTlのフローチャート、
第12図は測定処理のフローチャー1・、第13図は判
定出力処理のフローチャート、第14図は割込処理■N
T1のフローチャー1へ、である。 符号の説明 4・・・1次元リニアセンサカメラ、7・・・直列デー
タ処理装置、16・・・DMAコントローラ、2o・・
・V ! DEO−RAM、21−CPU、30−・・
画像メモリ、3I・・・ウィンドのX座標データ記憶領
域、35・・・Y座標整理データ記憶領域、38・・・
ウィンドワーク領域、40・・・タイマー領域代理人 
弁理士 並 木 昭 夫 代理人 弁理士 松 崎   清 MIA図 11711J 118 ロ  9m 震 五〇図 j112図 II 13WJ 114a
FIG. 1 is a block diagram showing the basic configuration of a serial data processing device according to the present invention, FIG. 1A is an explanatory diagram of the coordinates of a window area within the field of view, and FIGS. 2 and 3 are explanatory diagrams each showing an example of window image processing. , FIG. 4 is a perspective view showing a configuration and arrangement example when an embodiment of the present invention is applied to product inspection, FIG. 5 is a block diagram showing a hardware configuration of an embodiment of the present invention, and FIG. The figure shows a timing chart 1 of the signals of the main parts in FIG. 5, FIG. The figures are flowcharts showing the programs stored in the ROM, and FIG. 8 is a flowchart for the main programmer, FIG. 9 is a flowchart for keyboard input processing, FIG. 10 is a flowchart for initialization processing, and FIG. 11 is a flowchart for initialization processing. is a flowchart of interrupt processing lNTl,
Figure 12 is a flowchart of measurement processing 1, Figure 13 is a flowchart of judgment output processing, and Figure 14 is interrupt processing ■N.
To flowchart 1 of T1. Explanation of symbols 4... One-dimensional linear sensor camera, 7... Serial data processing device, 16... DMA controller, 2o...
・V! DEO-RAM, 21-CPU, 30-...
Image memory, 3I... Window X coordinate data storage area, 35... Y coordinate arrangement data storage area, 38...
Windwork area, 40...Timer area agent
Patent attorney Akio Namiki Agent Patent attorney Kiyoshi Matsuzaki MIA Figure 11711J 118 Ro 9m Earthquake Figure 50 Figure j 112 Figure II 13WJ 114a

Claims (1)

【特許請求の範囲】 1)一定方向(以下、Y方向と云う)に沿って撮像デバ
イスとの間で相対的に移動せしめられる物品に対し、該
物品を望む視野内に窓領域を設定しておき、前記物品の
該窓領域における前記撮像デバイスによる撮像出力を得
て、これを或る基準値と比較して該物品の良否を判定す
るに際して用いる前記撮像出力を得るための直列データ
の処理装置であって、 前記Y方向と交叉する方向(以下、X方向と云う)に沿
って1ライン分の走査を行い、該物品の画像を順次画素
に分解し、時系列の2値信号に変換し、直列データとし
て出力する前記撮像デバイスとしての1次元撮像デバイ
スと、前記窓領域のX座標区間を予め記憶する第1の記
憶手段と、同じく前記窓領域のY座標区間を予め記憶す
る第2の記憶手段と、前記物品と1次元撮像デバイスと
の間のY方向の相対的位置の変化を監視していて前記撮
像デバイスのY座標が、前記第2の記憶手段に記憶され
ている窓領域のY座標区間にあることを検出すると、前
記第1の記憶手段から当該窓領域のX座標区間を知り、
前記1次元撮像デバイスからの直列出力データのうち、
当該窓領域のX座標区間内のデータを取り出して吟味し
、所定の論理値をとるデータを1走査分ずつ計数した後
順次加算して、前記窓領域に対する撮像出力を作成する
手段と、から成ることを特徴とする直列データの処理装
置。 2)特許請求の範囲第1項記載の直列データの処理装置
において、前記窓領域が複数個の窓領域から成り、前記
作成手段は設定された各窓領域毎に撮像出力を作成する
ようにしたことを特徴とする直列データの処理装置。
[Claims] 1) For an article that is moved relative to an imaging device along a certain direction (hereinafter referred to as the Y direction), a window area is set within the field of view in which the article is desired. a serial data processing device for obtaining the imaging output by the imaging device in the window area of the article, and comparing this with a certain reference value to determine the quality of the article; Scanning one line along a direction intersecting the Y direction (hereinafter referred to as the X direction), sequentially decomposing the image of the article into pixels, and converting it into a time series binary signal. , a one-dimensional imaging device as the imaging device outputting as serial data, a first storage means for storing in advance the X-coordinate interval of the window area, and a second storage means for also storing in advance the Y-coordinate interval of the window area. storage means; monitors changes in the relative position in the Y direction between the article and the one-dimensional imaging device, and the Y coordinate of the imaging device is stored in the window area stored in the second storage means; When it is detected that the window area is in the Y coordinate interval, it learns the X coordinate interval of the window area from the first storage means;
Among the serial output data from the one-dimensional imaging device,
means for extracting and examining data within the X-coordinate interval of the window area, counting data that takes a predetermined logical value for each scan, and sequentially adding the data to create an imaging output for the window area; A serial data processing device characterized by: 2) In the serial data processing device according to claim 1, the window area is made up of a plurality of window areas, and the creating means creates an imaging output for each set window area. A serial data processing device characterized by:
JP60238596A 1985-05-27 1985-10-26 Processing device for serial data Pending JPS62100093A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP60238596A JPS62100093A (en) 1985-10-26 1985-10-26 Processing device for serial data
DE3617774A DE3617774C2 (en) 1985-05-27 1986-05-27 Serial data processing device
US06/867,471 US4783827A (en) 1985-05-27 1986-05-27 Serial data processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60238596A JPS62100093A (en) 1985-10-26 1985-10-26 Processing device for serial data

Publications (1)

Publication Number Publication Date
JPS62100093A true JPS62100093A (en) 1987-05-09

Family

ID=17032542

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60238596A Pending JPS62100093A (en) 1985-05-27 1985-10-26 Processing device for serial data

Country Status (1)

Country Link
JP (1) JPS62100093A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6466547A (en) * 1987-09-08 1989-03-13 Nissan Motor Detection of surface defect
JPH0199184A (en) * 1987-10-13 1989-04-18 Omron Tateisi Electron Co Image processor
JPH01147676A (en) * 1987-12-03 1989-06-09 Fanuc Ltd Control system for dynamic window
JPH04166751A (en) * 1990-10-31 1992-06-12 Toyo Glass Co Ltd Method and apparatus for inspecting defect in bottle and the like
US7411191B2 (en) 2000-06-27 2008-08-12 Ebara Corporation Inspection system by charged particle beam and method of manufacturing devices using the system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5487285A (en) * 1977-12-22 1979-07-11 Nec Corp Automatic tester for porous shielding plate
JPS58186878A (en) * 1982-04-23 1983-10-31 Koyo Denshi Kogyo Kk Body detector

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5487285A (en) * 1977-12-22 1979-07-11 Nec Corp Automatic tester for porous shielding plate
JPS58186878A (en) * 1982-04-23 1983-10-31 Koyo Denshi Kogyo Kk Body detector

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6466547A (en) * 1987-09-08 1989-03-13 Nissan Motor Detection of surface defect
JPH0199184A (en) * 1987-10-13 1989-04-18 Omron Tateisi Electron Co Image processor
JPH01147676A (en) * 1987-12-03 1989-06-09 Fanuc Ltd Control system for dynamic window
JPH04166751A (en) * 1990-10-31 1992-06-12 Toyo Glass Co Ltd Method and apparatus for inspecting defect in bottle and the like
US7411191B2 (en) 2000-06-27 2008-08-12 Ebara Corporation Inspection system by charged particle beam and method of manufacturing devices using the system

Similar Documents

Publication Publication Date Title
US4147930A (en) Object location detector
JPS63503332A (en) Inspection equipment
GB2051350A (en) System for and a method of automatic inspection of products
KR20210008352A (en) System and method for detecting defects in imaged items
Kelley et al. Three vision algorithms for acquiring workpieces from bins
JPS62100093A (en) Processing device for serial data
Strachan et al. Image analysis in the fish and food industries
JPH09288060A (en) Method and apparatus for capturing moving body image
You et al. A mechanical part sorting system based on computer vision
Batchelor et al. Commercial vision systems
Zhou et al. Machine vision based automatic apparatus and method for surface defect detection
JP3579182B2 (en) Visual inspection aid for printed matter
JPH0810130B2 (en) Object measuring device by optical cutting line method
JPS5948160A (en) Correction for running position of printed matter
JP7455010B2 (en) Detection device and detection program
JP7330328B1 (en) Visual inspection auxiliary device
JPS61255484A (en) Detection of crack by picture processing
JPH07167611A (en) Coil&#39;s center deciding system
JPH08272971A (en) Object recognizing method
JPS61120002A (en) Method and device for detecting corner point of image
CN110533635B (en) Soft package surface quality detection method based on machine vision
JPS5990172A (en) Product inspector
JPS5914782B2 (en) Binary pattern digitization processing method
JPH0668761B2 (en) Small particle removal method
JPH0128994B2 (en)