JP2707767B2 - Image processing device - Google Patents

Image processing device

Info

Publication number
JP2707767B2
JP2707767B2 JP1293808A JP29380889A JP2707767B2 JP 2707767 B2 JP2707767 B2 JP 2707767B2 JP 1293808 A JP1293808 A JP 1293808A JP 29380889 A JP29380889 A JP 29380889A JP 2707767 B2 JP2707767 B2 JP 2707767B2
Authority
JP
Japan
Prior art keywords
address
data
mask
memory
line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP1293808A
Other languages
Japanese (ja)
Other versions
JPH03154974A (en
Inventor
達夫 越前谷
繁樹 手塚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nissan Motor Co Ltd
Original Assignee
Nissan Motor 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 Nissan Motor Co Ltd filed Critical Nissan Motor Co Ltd
Priority to JP1293808A priority Critical patent/JP2707767B2/en
Publication of JPH03154974A publication Critical patent/JPH03154974A/en
Application granted granted Critical
Publication of JP2707767B2 publication Critical patent/JP2707767B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は撮像したワークの画像の2値化により得られ
る2値画像データの、任意の部分にマスク処理を行うこ
とのできる画像処理装置に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus capable of performing a mask process on an arbitrary portion of binary image data obtained by binarizing a captured image of a work. Things.

(従来の技術) この種の従来の画像処理装置としては、例えば第6図
に示すものがあり、図中50は一次元カメラ(ビデオカメ
ラ)を示す。
(Prior Art) As a conventional image processing apparatus of this type, there is, for example, one shown in FIG. 6, in which 50 denotes a one-dimensional camera (video camera).

一次元カメラ50はカメラインターフェース回路51に接
続され、カメラインターフェース回路51は2値化回路52
およびアドレス制御回路53に接続され、アドレス制御回
路53はコンパレータ54および55に接続されている。さら
にコンパレータ54,55には、夫々マスクONアドレス記憶
レジスタ56、マスクOFFアドレス記憶レジスタ57が接続
され、コンパレータ54,55の出力端は夫々SRフリップフ
ロップ58の入力端(S)、入力端(R)に接続されてい
る。SRフリップフロップ58の出力端(Q)は2値化回路
52の出力端とともにORゲート59に接続され、ORゲート59
の出力端は図示しない通常の画像処理回路に接続され
る。
The one-dimensional camera 50 is connected to a camera interface circuit 51, and the camera interface circuit 51 is connected to a binarization circuit 52.
And an address control circuit 53, which is connected to comparators 54 and 55. Further, a mask ON address storage register 56 and a mask OFF address storage register 57 are connected to the comparators 54 and 55, respectively. The output terminals of the comparators 54 and 55 are the input terminal (S) and the input terminal (R) of the SR flip-flop 58, respectively. )It is connected to the. The output terminal (Q) of SR flip-flop 58 is a binarization circuit
Connected to the OR gate 59 with the output terminal of 52, the OR gate 59
Are connected to a normal image processing circuit (not shown).

ところで一次元カメラ50からの画像信号(ビデオ画像
信号)はカメラインターフェース回路51を経て2値化回
路52に入力され、そこで2値化される(このときのビデ
オ画像およびそれを2値化した2値画像の電圧波形の一
例を第7図(a)および(b)に示す)。これと同期し
てアドレス制御回路53は各走査ラインに対応するYアド
レスおよび各走査ラインの各ビットに対応するXアドレ
スを発生してコンパレータ54,55に入力する。コンパレ
ータ54は、当該ビデオ画像に基づく、例えば第8図
(a)に示すような2値画像に、マスク処理を開始すべ
きアドレスXsを記憶しているマスクONアドレス記憶レジ
スタ56から入力されるアドレスXsと、前述したXアドレ
スとを比較して、両者が一致したときSRフリップフロッ
プ58をhigh(1)にセットする。同様にコンパレータ55
は、マスクOFFアドレス記憶レジスタ57から入力され
る、マスク処理を終了すべきアドレスXeと前記Xアドレ
スとの比較に基づきSRフリップフロップ58をリセットし
てlow(零)にする。これによりSRフリップフロップ58
から出力される1または零と、前記2値画像(1または
零)とがORゲート59で論理演算され、同図(b)に示す
ような最終的マスク付2値画像が出力されることにな
る。このときこのマスク付2値画像においてはXsからXe
までの範囲がマスクされて同図(a)の最初の1から零
への落ち込みが除去されている。
An image signal (video image signal) from the one-dimensional camera 50 is input to a binarizing circuit 52 via a camera interface circuit 51, where it is binarized (the video image at this time and the binarized binary image thereof). An example of the voltage waveform of the value image is shown in FIGS. 7 (a) and (b). In synchronization with this, the address control circuit 53 generates a Y address corresponding to each scanning line and an X address corresponding to each bit of each scanning line, and inputs them to the comparators 54 and 55. The comparator 54, based on the video image, the binary image as shown in example Figure 8 (a), is inputted from the mask ON address storing register 56 which stores the address X s should start masking and address X s, by comparing the X address as described above, it sets the SR flip-flop 58 to high (1) when they match. Similarly, the comparator 55
Is input from the mask OFF address storing register 57, to low (zero) to reset the SR flip-flop 58 on the basis of a comparison of the X address and the address X e should be terminated masking. As a result, the SR flip-flop 58
1 or 0 and the binary image (1 or 0) are logically operated by the OR gate 59 to output a final masked binary image as shown in FIG. Become. In this case X e from X s in the binary image with the mask
The range from (1) to (0) is masked to eliminate the drop from the first 1 to zero in FIG.

(発明が解決しようとする課題) しかしながらこのような従来の画像処理装置にあって
は、マスク開始アドレスXsおよびマスク終了アドレスXe
を1組しか設定できないため、各2値画像に対し共通の
1個所しかマスク処理することができず、複数個所マス
クしたり各走査ラインの2値画像毎に異なる範囲にマス
クしたい場合には、同様の回路を複数組設けねばなら
ず、回路構成の複雑化によりコストアップを招く。
In the (0006) However, such conventional image processing apparatus, the mask start address X s and mask end address X e
Since only one set can be set, only one common location can be masked for each binary image. If masking is to be performed for a plurality of locations or a different range should be masked for each binary image of each scan line, It is necessary to provide a plurality of similar circuits, which leads to an increase in cost due to a complicated circuit configuration.

本発明は各走査のラインおよびビットに対応するアド
レスを有するメモリの所望のアドレスにマスクデータを
書込むようにすることにより、上述した問題を解決する
ことを目的とする。
SUMMARY OF THE INVENTION It is an object of the present invention to solve the above-mentioned problem by writing mask data to a desired address of a memory having an address corresponding to each scan line and bit.

(課題を解決するための手段) この目的のため、本発明の画像処理装置は、撮像手段
により撮像したワークの画像を2値化する2値化回路
と、得られた2値画像データの所定アドレスにマスク処
理を行うマスク回路とを具える画像処理装置において、
各走査ラインに対応するYアドレスを有するYアドレス
メモリと、各走査ラインの各ビットに対応するXアドレ
スを有し、Xアドレスメモリと、予め設定されたマスク
処理すべきYアドレスおよびXアドレスを記憶し、当該
走査ラインがマスク処理すべきYアドレスのラインであ
る場合には前記Yアドレスメモリの当該Yアドレスにマ
スクフラグデータを書込むとともに、当該ビットがマス
ク処理すべきラインのマスク処理すべきXアドレスのビ
ットである場合には前記Xアドレスメモリの前記Xアド
レスと前記マスクフラグデータと前記2値画像データと
より成るXアドレスにマスクデータを書込むデータ書込
手段とを設け、これらにより前記マスク回路を構成し、
前記Xアドレスメモリの前記Xアドレスと前記マスクフ
ラグデータと前記2値画像データとより成るXアドレス
内のデータを出力するようにしたことを特徴とするもの
である。
(Means for Solving the Problems) For this purpose, an image processing apparatus according to the present invention includes a binarization circuit for binarizing an image of a work imaged by an imaging unit, and a predetermined circuit for binarizing the obtained binary image data. An image processing apparatus comprising: a mask circuit that performs a mask process on an address;
A Y address memory having a Y address corresponding to each scan line, an X address corresponding to each bit of each scan line, and storing an X address memory and a preset Y address and X address to be masked If the scan line is a line of the Y address to be masked, the mask flag data is written to the Y address of the Y address memory, and the X bit of the line to be masked is to be masked. A data writing means for writing mask data to the X address of the X address memory, the mask flag data and the binary image data when the bit is an address, Configure the circuit,
Data in the X address including the X address, the mask flag data, and the binary image data in the X address memory is output.

(作 用) ワークのあるラインのあるビットを走査する際には、
ワークの画像を2値化することにより得られる2値画像
データは、各走査ラインの各ビットに対応するXアドレ
スを有するXアドレスメモリの当該Xアドレスに書込ま
れる。ここで、当該走査ラインがマスク処理すべきYア
ドレスのラインである場合には前記Yアドレスメモリの
当該Yアドレスにマスクフラグデータが書込まれ、当該
ビットがマスク処理すべきラインのマスク処理すべきX
アドレスのビットである場合には、前記Xアドレスメモ
リの前記Xアドレスと前記マスクフラグデータと前記2
値画像データとより成るXアドレスにマスクデータ(例
えば1)が書込まれ、このマスクデータが前記Xアドレ
スメモリから出力される。
(Operation) When scanning a certain bit on a line with a work,
Binary image data obtained by binarizing the image of the work is written to the X address of an X address memory having an X address corresponding to each bit of each scan line. If the scan line is a line of a Y address to be masked, mask flag data is written to the Y address of the Y address memory, and the bit is to be masked for the line to be masked. X
Address bits, the X address of the X address memory, the mask flag data,
Mask data (for example, 1) is written to the X address including the value image data, and the mask data is output from the X address memory.

したがって上記Xアドレスメモリに書込まれたデータ
を順次読出して1本の走査ライン分並べれば、所望のマ
スクを付加した2値画像が得られる。
Therefore, if the data written in the X address memory is sequentially read and arranged for one scanning line, a binary image with a desired mask added can be obtained.

このようにして同一走査ライン上に複数のマスクを設
定したり各走査ライン毎の任意の位置にマスクを設定す
ることができるとともに、一旦設定したマスクを簡単に
変更することができる画像処理装置を、従来例の構成で
上記マスク機能を実現する場合に比べて極めて簡単な回
路構成で構成することができ、大幅なコストダウンを図
ることができる。
In this way, an image processing apparatus that can set a plurality of masks on the same scanning line, set a mask at an arbitrary position for each scanning line, and easily change the mask once set is provided. In addition, compared to the case where the above-described mask function is realized by the configuration of the conventional example, the configuration can be made with an extremely simple circuit configuration, and the cost can be significantly reduced.

(実施例) 以下、本発明の実施例を図面に基づき詳細に説明す
る。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

第1図は本発明の画像処理装置の第1実施例の構成を
示すブロック線図であり、図中10は一次元カメラ(ビデ
オカメラ)を示す。
FIG. 1 is a block diagram showing the configuration of a first embodiment of the image processing apparatus according to the present invention, in which 10 denotes a one-dimensional camera (video camera).

一次元カメラ10は、内蔵する一次元ラインセンサによ
りワークの1走査ライン分の画像を順次撮像するもので
あり、得られたビデオ画像はカメラインターフェース回
路11に入力される。カメラインターフェース回路11を経
たビデオ画像は、例えば第7図(a)に示すように、走
査ライン方向に見たワークの両端部付近で電圧が急激に
低下する電圧波形を示すものであり、2値化回路12に入
力される。2値化回路12において、この電圧波形と同図
に示すスレッシュホールド電圧とを比較してスレッシュ
ホールド電圧より電圧が高い部分を1、低い部分を零と
することにより2値化を行い、例えば同図(b)に示す
ような2値画像を得ることができる。
The one-dimensional camera 10 sequentially captures an image of one scan line of a workpiece by a built-in one-dimensional line sensor, and the obtained video image is input to the camera interface circuit 11. The video image that has passed through the camera interface circuit 11 shows a voltage waveform in which the voltage sharply drops near both ends of the work viewed in the scanning line direction, as shown in FIG. Input to the conversion circuit 12. The binarization circuit 12 compares this voltage waveform with the threshold voltage shown in FIG. 1 to binarize the signal by setting a portion having a voltage higher than the threshold voltage to 1 and a portion having a voltage lower than the threshold voltage to zero. It is possible to obtain a binary image as shown in FIG.

一方、カメラインターフェース回路11には2値化回路
12とともにアドレス制御回路13が接続されており、一次
元カメラ10の走査と同期してアドレス制御回路13に制御
信号が入力される。この信号を受けたアドレス制御回路
13は、各走査ラインに対応するYアドレスおよび各走査
ラインの各ビットに対応するYアドレスを発生して夫々
Yアドレスメモリ14,Xアドレスメモリ15に入力する。な
おこれらメモリ14,15には、後述するようにデータの書
込および書替ができる必要があることからRAM(random
−access memory)を使用している。
On the other hand, the camera interface circuit 11 has a binarization circuit
An address control circuit 13 is connected together with 12, and a control signal is input to the address control circuit 13 in synchronization with the scanning of the one-dimensional camera 10. Address control circuit that receives this signal
13 generates a Y address corresponding to each scanning line and a Y address corresponding to each bit of each scanning line, and inputs them to the Y address memory 14 and the X address memory 15, respectively. Note that these memories 14 and 15 need to be able to write and rewrite data as described later.
-Access memory).

ここで、Yアドレスメモリ14およびXアドレスメモリ
15に対するデータの書込の概要について説明する。Yア
ドレスメモリ14に、第2図に示すように、アドレス制御
回路13からA0〜A15に対応する16ビットにアドレスデー
タ(YADO〜YAD15)が入力されると、このアドレスデー
タにより定まるYアドレスメモリ14のYアドレスにはマ
スクフラグデータ(YD0〜YD2)が書込まれ、このマスク
フラグデータ(YD0〜YD2)はXアドレスメモリ15に入力
される。Xアドレスメモリ15には、同図に示すように、
アドレス制御回路13から12ビットのアドレスデータ(XA
D0〜XAD11)が入力されるとともに、2値化回路12から
の2値データBVD(1または零)を入力されると、{(X
AD0〜XAD11),(3ビットの1または零),BVD}により
定まるXアドレスメモリ15のXアドレスにはXD0としてB
VDと同一の1または零が書込まれ、さらにYアドレスメ
モリ14からマスクフラグデータ(YD0〜YD2)が入力され
ると、{(XAD0〜XAD11),(YD0〜YD2),BVD}により
定まるXアドレスメモリ15のXアドレスには後述するマ
スクデータXD0が書込まれ、このXD0が最終的なマスク付
2値画像データとなる。
Here, the Y address memory 14 and the X address memory
An outline of writing data to 15 will be described. As shown in FIG. 2, when address data (YADO to YAD15) is input to the Y address memory 14 from the address control circuit 13 in 16 bits corresponding to A0 to A15, the Y address memory 14 is determined by the address data. The mask flag data (YD0 to YD2) is written to the Y address of the memory cell, and the mask flag data (YD0 to YD2) is input to the X address memory 15. In the X address memory 15, as shown in FIG.
The address control circuit 13 sends 12-bit address data (XA
D0 to XAD11) and the binary data BVD (1 or 0) from the binarization circuit 12, {(X
AD0 to XAD11), (3 bits of 1 or 0), BVD}
When the same 1 or zero as VD is written, and when the mask flag data (YD0 to YD2) is input from the Y address memory 14, X determined by {(XAD0 to XAD11), (YD0 to YD2), BVD} Mask data XD0 described later is written to the X address of the address memory 15, and this XD0 becomes the final binary image data with mask.

上記X,Yアドレスメモリへのデータの書込みを行うた
めデータ書込手段16を設ける。データ書込手段16は、X
アドレスメモリ15の{(XAD0〜XAD11),(3ビットの
1または零),BVD}により定まるXアドレスにBVDと同
一の1または零を書込むとともに、当該走査ラインがマ
スクすべきラインであるときYアドレスメモリ14の当該
Yアドレスに書込む3ビットのデータ(YD0〜YD2)の少
くとも1ビットに1を書込み(マスクしないラインの場
合には3ビット共零を書込む)、またそのマスクすべき
ラインの当該ビットがマスクすべきビットであるときX
アドレスメモリ15の{(XAD0〜XAD11),(YD0〜YD
2)、BVD}により定まるXアドレスに1を書込む(マス
クしないビットの場合には零を書込む)ものであり、予
め設定した前記マスクすべきラインおよびビットを記憶
しているものとする。なお書込んだデータはデータ書込
手段によって任意に書替えることができる。
Data writing means 16 is provided for writing data to the X, Y address memory. The data writing means 16
When the same 1 or 0 as BVD is written to the X address determined by {(XAD0 to XAD11), (3 bits 1 or 0), BVD} of the address memory 15, and the scan line is a line to be masked Write 1 to at least one bit of the 3-bit data (YD0 to YD2) to be written to the Y address of the Y address memory 14 (if the line is not masked, write zero for all three bits). X when the corresponding bit of the power line is a bit to be masked.
@ (XAD0 to XAD11), (YD0 to YD) of address memory 15
2) It is assumed that 1 is written in the X address determined by BVD} (zero is written in the case of a non-masked bit), and the previously set line and bit to be masked are stored. The written data can be arbitrarily rewritten by data writing means.

ところでこの画像処理装置を実際に使用する検査ステ
ージは第3図に示すように構成される。すなわち、円筒
状のワーク20はワーククランプ装置21によって回動自在
に支持され、その下方の端部に結合されるワーク回転装
置22の駆動により回動する。このとき治具23に固定され
た一次元カメラ10は、照明装置24により照らされるワー
ク側面20aを、ワークの回転とともに順次撮像し、得ら
れたビデオ画像に基づき当該ワークの側面に欠陥が存在
するか否かを検査する。この際、ワーク側面20aに穴、
切欠等が存在する範囲、つまりワーク内に2値信号の
「零」が存在する範囲が予め判っている場合、その範囲
にマスク処理を行うとこの穴、切欠等が判定対象から除
外されてワーク側面の欠陥のみが検出されることにな
り、ワークの欠陥判定上有益である。
An inspection stage that actually uses this image processing apparatus is configured as shown in FIG. That is, the cylindrical work 20 is rotatably supported by the work clamp device 21, and is rotated by the drive of the work rotating device 22 coupled to the lower end thereof. At this time, the one-dimensional camera 10 fixed to the jig 23 sequentially images the work side surface 20a illuminated by the illumination device 24 with the rotation of the work, and based on the obtained video image, a defect exists on the side surface of the work. Check whether or not. At this time, a hole is
If a range in which a notch or the like exists, that is, a range in which a binary signal “zero” exists in the work is known in advance, if a mask process is performed on the range, the hole, the notch, or the like is excluded from the determination target and the work is removed. Only the defect on the side surface is detected, which is useful for determining the defect of the work.

このマスク処理は第4図および第5図のフローチャー
トに基づいて実行される。すなわちまず書込時のフロー
チャートである第4図のステップ101でアドレス制御回
路13よりアドレスデータ(XAD0〜XAD11)がXアドレス
メモリ15の第2図にA0〜A11で示すビットに入力され、
ステップ102で一次元カメラ10からの入力信号を2値化
回路で2値化した信号BVD(1または零)が、Xアドレ
スメモリ15の、第2図にA15で示すビットに入力され
る。ここでBVDが零ならば、制御をステップ103のYesか
らステップ104へと進めて、Xアドレスメモリ15の{(X
AD0〜XAD11),(3ビットの1または零),BVD}により
定まるXアドレスの全てにXD0としてBVDと同一の零を書
込み、BVDが1ならば、制御をステップ103のNoからステ
ップ105へと進めて、Xアドレスメモリ15の{(XAD0〜X
AD11),(3ビットの1または零),BVD}により定まる
Xアドレスの全てにXD0としてBVDと同一の1を書込む
(このデータの書込はデータ書込手段16によって行
う)。
This mask processing is executed based on the flowcharts of FIGS. That is, first, address data (XAD0 to XAD11) is input from the address control circuit 13 to the bits indicated by A0 to A11 in FIG.
In step 102, a signal BVD (1 or 0) obtained by binarizing the input signal from the one-dimensional camera 10 by a binarizing circuit is input to a bit of the X address memory 15 indicated by A15 in FIG. Here, if BVD is zero, the control proceeds from Yes in step 103 to step 104, where {(X
AD0 to XAD11), (3 bits of 1 or 0), BVD}, write the same zero as BVD as XD0 to all X addresses. If BVD is 1, control is passed from No in step 103 to step 105. Proceed to the X address memory 15 (XAD0 to XAD
AD11), (3 bits of 1 or 0), and the same 1 as BVD is written as XD0 in all of the X addresses determined by BVD (this data writing is performed by the data writing means 16).

次のステップ106ではアドレス制御回路13よりアドレ
スデータ(YAD0〜YAD15)をYアドレスメモリ14に入力
し、ステップ107でこのアドレスデータ(YAD0〜YAD15)
により定まるYアドレスの走査ラインがマスクするライ
ンか否かの判定を行う。この判定は予め設定したマスク
するラインおよびビットを記憶しているデータ書込手段
16によってなされ、当該走査ラインがマスクするライン
であれば、ステップ108で3ビットの内の少なくとも1
ビットを1としたマスクフラグデータ(YD0〜YD2)をY
アドレスメモリ14の当該Yアドレスに書込み、マスクす
るラインでなければ、ステップ109で3ビット全てを零
としたマスクフラグデータ(YD0〜YD2)をYアドレスメ
モリ14の当該Yアドレスに書込んだ後、後述するステッ
プ110,111をスキップして制御をそのまま終了する(こ
れによりマスク処理の効率化が図れる)。次いでステッ
プ108から制御をステップ110に進めて当該ビットがマス
クするビットか否かの判定を行い(この判定は予め設定
したマスクするラインおよびビットを記憶しているデー
タ書込手段16によってなされる)、Yesならばステップ1
11でXアドレスメモリ15の{(XAD0〜XAD11),(YD0〜
YD2),BVD}により定まるXアドレスにマスクデータXD0
=1を書込む。なおステップ110のNoの場合にはステッ
プ111をスキップするものとする。
In the next step 106, address data (YAD0 to YAD15) is input from the address control circuit 13 to the Y address memory 14, and in step 107, the address data (YAD0 to YAD15) is input.
It is determined whether or not the scan line of the Y address determined by is a line to be masked. This determination is made by a data writing means storing a preset line and bit to be masked.
16 and if the scan line is a masking line, at step 108 at least one of the three bits
The mask flag data (YD0 to YD2) with the bit set to 1 is Y
If the line is not the line to be written and masked at the Y address of the address memory 14 and the mask flag data (YD0 to YD2) with all three bits set to zero is written at the Y address of the Y address memory 14 at step 109, Steps 110 and 111, which will be described later, are skipped, and the control is terminated as it is (this makes the mask processing more efficient). Then, the control proceeds from step 108 to step 110 to determine whether or not the bit is a bit to be masked (this determination is made by the data writing means 16 storing a preset masking line and bit). If yes, step 1
At 11 {(XAD0 to XAD11) and (YD0 to
YD2), mask data XD0 at the X address determined by BVD}
Write = 1. In the case of No in step 110, step 111 is skipped.

このようにして書込まれたデータXD0は第5図のフロ
ーチャートによって読出される。すなわちまず第5図の
ステップ121で一次元カメラ10からの入力信号に基づ
き、アドレス制御回路13がアドレスデータ(YAD0〜YAD1
5)、(XAD0〜XAD11)を決定し、ステップ122でYアド
レスメモリ14内の、上記アドレスデータ(YAD0〜YAD1
5)で参照されるデータ(YD0〜YD2)をXアドレスメモ
リ15に出力する。次のステップ123ではXアドレスメモ
リ15内の、前記アドレスデータ(XAD0〜XAD11)ならび
にデータ(YD0〜YD2)およびBVDより成るアドレスデー
タで参照されるデータXD0を最終的なマスク付2値信号
として出力する(この出力は後段の図示しない通常の画
像処理回路に入力されてそこで画像処理されることにな
る)。
The data XD0 thus written is read out according to the flowchart of FIG. That is, first, in step 121 of FIG. 5, based on the input signal from the one-dimensional camera 10, the address control circuit 13 stores the address data (YAD0 to YAD1).
5), (XAD0 to XAD11) are determined, and the address data (YAD0 to YAD1) in the Y address memory 14 is determined in step 122.
The data (YD0 to YD2) referenced in 5) is output to the X address memory 15. In the next step 123, the data XD0 referred to by the address data (XAD0 to XAD11) and the address data consisting of the data (YD0 to YD2) and BVD in the X address memory 15 is output as a final binary signal with a mask. (This output is input to a normal image processing circuit (not shown) at the subsequent stage, where image processing is performed).

ところで上記第4図および第5図のフローチャートに
基づくマスク処理を行うと、例えば第8図(a)に示す
当該走査ラインにおける2値画像の、XアドレスX1およ
びX2間がマスク処理すべき範囲である場合、BVD=0の
ため第4図のステップ104でデータ書込手段16の書込に
より一旦XD0=0とされたデータXD0が、制御がステップ
106−107−108−109−110−111と進むことによりマスク
データを書込まれてXD0=1とされて当該アドレスに格
納され、第5図のステップ121−122−123の実行により
当該ビットに対応するマスク付2値信号XD0として読出
され、結果的に第8図(b)に示すマスク付2値画像が
得られる。なお上記マスク処理におけるデータの書込お
よび読出は、(YAD0〜YAD15)の16ビットのYアドレス
によって規定される走査ラインを、(YD0〜YD2)の1ま
たは零の組合せにより8通りに識別することが可能なこ
とから、8ライン毎に行うようにすればよい。また本例
においてはマスクデータとして「1」を書込むようにし
ているが、2値画像からワークに欠陥があるか否かを検
査するのに「1」を用いる場合には「零」を書込むよう
にすれば良い。
Incidentally When a mask processing based on the flowchart of FIG. 4 and FIG. 5, for example of a binary image in the scan line shown in Figure 8 (a), while the X address X 1 and X 2 should masking In the case of the range, since BVD = 0, the data XD0 once set to XD0 = 0 by the writing of the data writing means 16 in step 104 of FIG.
By proceeding to 106-107-108-109-110-111, the mask data is written, XD0 = 1 is set and stored at the address, and by executing steps 121-122-123 in FIG. The corresponding binary signal XD0 with mask is read out, and as a result, a binary image with mask shown in FIG. 8B is obtained. Note that the writing and reading of data in the above mask processing are performed by identifying a scan line defined by a 16-bit Y address of (YAD0 to YAD15) in eight ways by a combination of 1 or zero of (YD0 to YD2). Can be performed every eight lines. In this example, “1” is written as the mask data. However, when “1” is used to check whether or not the work has a defect from the binary image, “0” is written. You can do it.

このようにして同一走査ライン上に複数のマスクを設
定したり各走査ライン毎の任意の位置にマスクを設定す
ることができるとともに、一旦設定したマスクを簡単に
変更することができる画像処理装置を、従来例の構成で
上記マスク機能を実現する場合に比べて極めて簡単な回
路構成で構成することができ、大幅なコストダウンを図
ることができる。
In this way, an image processing apparatus that can set a plurality of masks on the same scanning line, set a mask at an arbitrary position for each scanning line, and easily change the mask once set is provided. In addition, compared to the case where the above-described mask function is realized by the configuration of the conventional example, the configuration can be made with an extremely simple circuit configuration, and the cost can be significantly reduced.

また前記マスクを必要最小限のアドレスのみに設定可
能であることから、2値画像よりワークの欠陥を検査す
る際の精度も向上する。
In addition, since the mask can be set to only the minimum necessary address, the accuracy of inspecting a workpiece for defects from a binary image is also improved.

さらに前記マスクの設定を調整することにより2値画
像をオリジナル波形のままスルーしたり、オリジナル波
形の一部を共通マスクすることができ、またこの画像処
理装置をオリジナル波形無しで任意のパルス波形を発生
するパターンジュネレータとして活用することにより、
装置自体の動作を自己診断することもできる。
Further, by adjusting the setting of the mask, the binary image can be passed through with the original waveform as it is, or a part of the original waveform can be masked in common. By utilizing it as a generated pattern generator,
The operation of the device itself can be self-diagnosed.

(発明の効果) かくして本発明の画像処理装置は上述の如く、各走査
のラインおよびビットに対応するアドレスを有するメモ
リの所望のアドレスにマスクデータを書込むようにした
から、同一走査ライン上に複数のマスクを設定したり各
走査ライン毎の任意の位置にマスクを設定することがで
きるとともに、一旦設定したマスクを簡単に変更するこ
とができる画像処理装置を、従来例の構成で上記マスク
機能を実現する場合に比べて極めて簡単な回路構成で構
成することができ、大幅なコストダウンを図ることがで
きる。
(Effect of the Invention) As described above, the image processing apparatus of the present invention writes mask data at a desired address of a memory having an address corresponding to each scan line and bit. An image processing apparatus that can set a plurality of masks, set a mask at an arbitrary position for each scanning line, and can easily change a mask once set is provided by the above-described mask function with the conventional configuration. Can be configured with an extremely simple circuit configuration as compared with the case of realizing, and a significant cost reduction can be achieved.

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

第1図は本発明の画像処理装置の第1実施例の構成を示
すブロック線図、 第2図は同例におけるXおよびYアドレスメモリのアド
レス構成を説明するための図、 第3図は同例の画像処理装置を用いる検査ステージの構
成を示す斜視図、 第4図および第5図は同例のマスク処理の制御プログラ
ムを示すフローチャート、 第6図は従来例の画像処理装置の構成を示すブロック線
図、 第7図(a),(b)は夫々ビデオ画像およびそれを2
値化した2値画像を例示する図、 第8図(a),(b)は夫々2値画像およびそれをマス
ク処理したマスク付2値画像を例示する図である。 10……一次元カメラ(ビデオカメラ) 11……カメラインターフェース回路 12……2値化回路、13……アドレス制御回路 14……Yアドレスメモリ、15……Xアドレスメモリ 16……データ書込手段、20……ワーク
FIG. 1 is a block diagram showing the configuration of a first embodiment of the image processing apparatus of the present invention, FIG. 2 is a diagram for explaining the address configuration of X and Y address memories in the same embodiment, and FIG. FIG. 4 is a perspective view showing the configuration of an inspection stage using the image processing apparatus of the example. FIGS. 4 and 5 are flowcharts showing a control program for mask processing of the same example. FIG. 6 shows the configuration of a conventional image processing apparatus. 7 (a) and 7 (b) show a video image and its
FIGS. 8 (a) and 8 (b) are diagrams illustrating a binarized image and a masked binary image obtained by masking the binary image, respectively. 10: One-dimensional camera (video camera) 11: Camera interface circuit 12: Binarization circuit, 13: Address control circuit 14: Y address memory, 15: X address memory 16: Data writing means , 20 …… Work

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】撮像手段により撮像したワークの画像を2
値化する2値化回路と、得られた2値画像データの所定
アドレスにマスク処理を行うマスク回路とを具える画像
処理装置において、 各走査ラインに対応するYアドレスを有するYアドレス
メモリと、 各走査ラインの各ビットに対応するXアドレスを有し、
各Xアドレスに前記2値画像データを書込まれるXアド
レスメモリと、 予め設定されたマスク処理すべきYアドレスおよびXア
ドレスを記憶し、当該走査ラインがマスク処理すべきY
アドレスのラインである場合には前記Yアドレスメモリ
の当該Yアドレスにマスクフラグデータを書込むととも
に、当該ビットがマスク処理すべきラインのマスク処理
すべきXアドレスのビットである場合には前記Xアドレ
スメモリの前記Xアドレスと前記マスクフラグデータと
前記2値画像データとより成るXアドレスにマスクデー
タを書込むデータ書込手段とを設け、これらにより前記
マスク回路を構成し、前記Xアドレスメモリの前記Xア
ドレスと前記マスクフラグデータと前記2値画像データ
とより成るXアドレス内のデータを出力するようにした
ことを特徴とする画像処理装置。
1. An image of a work taken by an image pickup means is stored in two
An image processing apparatus comprising: a binarizing circuit for converting a value; and a mask circuit for performing a masking process on a predetermined address of the obtained binary image data. A Y address memory having a Y address corresponding to each scanning line; Having an X address corresponding to each bit of each scan line;
An X address memory in which the binary image data is written at each X address; a Y address and a X address to be masked which are set in advance;
If the line is an address line, the mask flag data is written to the Y address of the Y address memory. If the bit is a bit of the X address to be masked of the line to be masked, the X address is written. Data writing means for writing mask data at an X address of the memory comprising the X address, the mask flag data, and the binary image data, and the mask circuit is constituted by these means; An image processing apparatus for outputting data in an X address including an X address, the mask flag data, and the binary image data.
JP1293808A 1989-11-14 1989-11-14 Image processing device Expired - Lifetime JP2707767B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1293808A JP2707767B2 (en) 1989-11-14 1989-11-14 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1293808A JP2707767B2 (en) 1989-11-14 1989-11-14 Image processing device

Publications (2)

Publication Number Publication Date
JPH03154974A JPH03154974A (en) 1991-07-02
JP2707767B2 true JP2707767B2 (en) 1998-02-04

Family

ID=17799421

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1293808A Expired - Lifetime JP2707767B2 (en) 1989-11-14 1989-11-14 Image processing device

Country Status (1)

Country Link
JP (1) JP2707767B2 (en)

Also Published As

Publication number Publication date
JPH03154974A (en) 1991-07-02

Similar Documents

Publication Publication Date Title
JP2591292B2 (en) Image processing device and automatic optical inspection device using it
JPS58215541A (en) Automatic optical inspection method
JPS6120035B2 (en)
JPH0550783B2 (en)
JP2707767B2 (en) Image processing device
JP2846052B2 (en) Cylindrical inspection equipment
JPS6239811B2 (en)
JPS6026973B2 (en) Object surface inspection method and device
JP2702441B2 (en) Wafer identification character recognition system
JPH0128994B2 (en)
JPS6227933Y2 (en)
JPS6176903A (en) Parts inspecting instrument
JP3438973B2 (en) Template matching method
JP3408869B2 (en) Image processing device
KR0173246B1 (en) Apparatus for processing binary image projection
JP2998518B2 (en) Pattern inspection equipment
JPH03158981A (en) Pattern recognition device
JPH0535876A (en) Image processor
JPH0723875B2 (en) Image display method in glass bottle inspection device
JPS6112316B2 (en)
JPH0224782A (en) Change detecting system of result image in logical filter processing of binary image
JPS62108381A (en) Density histogram detecting system
JPH09179979A (en) Defect detecting device
JP2003295038A5 (en)
JPH0460782A (en) Pattern processor