JPH04142676A - Binary image conversion method - Google Patents

Binary image conversion method

Info

Publication number
JPH04142676A
JPH04142676A JP2267353A JP26735390A JPH04142676A JP H04142676 A JPH04142676 A JP H04142676A JP 2267353 A JP2267353 A JP 2267353A JP 26735390 A JP26735390 A JP 26735390A JP H04142676 A JPH04142676 A JP H04142676A
Authority
JP
Japan
Prior art keywords
window
image
image area
binary image
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2267353A
Other languages
Japanese (ja)
Inventor
Toshihiro Yamashita
智弘 山下
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 JP2267353A priority Critical patent/JPH04142676A/en
Publication of JPH04142676A publication Critical patent/JPH04142676A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To easily extract an object body image area by setting both the outer image area of a window set into a binary image and the body image area in the window that intersects the boundary of the window at image data of the same value to convert the image data. CONSTITUTION:Window 9 is set in input binary image, the image area a2 outside this window 9 and body image areas a3 and a4 in the window that intersect the boundary of the window are set at image data of the same value to convert image area to binary image. Accordingly, even if image areas a3 and a4 partly appear in window 9 in addition to object body image area a1, the image area a3 and a4 and image area a2 outside the window 9 are set at image data of the same value. With this, the object body image area can be extracted easily discriminating it from other image areas.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 この発明は、入力された2値画像にウィンドウを設定し
て、そのウィンドウ内の特定の物体画像領域につき特微
量の計測などの処理を実行するための画像処理装置に関
連し、殊にこの発明は、前記2値画像を目的とする処理
を実行するのに好都合な新たな2値画像に変換するため
の2値画像変換方法に関する。
[Detailed Description of the Invention] <Industrial Application Field> This invention sets a window in an input binary image and executes processing such as measuring a characteristic quantity for a specific object image area within the window. The present invention relates to an image processing apparatus for processing an image, and more particularly, the present invention relates to a binary image conversion method for converting the binary image into a new binary image convenient for performing processing aimed at.

〈従来の技術〉 例えばプリント基板上に実装された電子部品を検査する
のに、検査対象の電子部品をカメラで撮像し、その濃淡
画像を画像処理装置に取り込んで2値化している。その
後、その2値画像の所定部位にウィンドウを設定し、そ
のウィンドウ内に含まれる検査対象の物体画像領域を検
出して面積1周囲長などの特微量を抽出する。
<Prior Art> For example, when inspecting an electronic component mounted on a printed circuit board, an image of the electronic component to be inspected is captured by a camera, and the grayscale image is taken into an image processing device and binarized. Thereafter, a window is set at a predetermined portion of the binary image, and the object image area to be inspected included within the window is detected to extract feature quantities such as area per perimeter.

この場合に電子部品の位置ずれなどを考慮してウィンド
ウを十分に大きく設定するため、ウィンドウ内には検査
対象の電子部品の画像のみならず周辺の電子部品の画像
が部分的に現れる場合がある。このようなウィンドウ内
の2値画像に対しラベリング処理を施し、各ラベルの物
体画像領域の面積を計測して、しきい値と比較すること
により検査対象の物体画像領域であるかどうかを判別し
ている。
In this case, the window is set sufficiently large to take into account misalignment of the electronic component, so not only the image of the electronic component to be inspected but also images of surrounding electronic components may partially appear within the window. . The binary image within such a window is subjected to labeling processing, and the area of the object image area of each label is measured and compared with a threshold value to determine whether it is the object image area to be inspected. ing.

〈発明が解決しようとする問題点〉 しかしながらこのような方法では、ラベリングや領域の
判別などの各処理が複雑となり、多くの処理時間を必要
とするなどの問題がある。
<Problems to be Solved by the Invention> However, in such a method, each process such as labeling and region discrimination becomes complicated and requires a lot of processing time.

この発明は、上記問題に着目してなされたもので、ウィ
ンドウ内に対象とする物体画像領域以外の画像領域が部
分的に現れても、対象とする物体画像領域をその他の画
像領域と区別して容易に抽出できる2値画像変換方法を
提供することを目的とする。
This invention was made with attention to the above problem, and even if an image area other than the target object image area partially appears in the window, the target object image area is distinguished from other image areas. It is an object of the present invention to provide a binary image conversion method that allows easy extraction.

〈問題点を解決するための手段〉 この発明は、2値画像を入力して各画素データを変換す
るための2値画像変換方法であって、入力された2値画
像にウィンドウを設定し、このウィンドウの外側の画像
領域と前記ウィンドウの境界と交わるウィンドウ内の物
体画像領域とを同一値の画素データに設定して、2値画
像を変換するようにしている。
<Means for Solving the Problems> The present invention is a binary image conversion method for inputting a binary image and converting each pixel data, the method comprising: setting a window on the input binary image; The image area outside this window and the object image area within the window that intersects with the boundary of the window are set to pixel data of the same value to convert the binary image.

〈作用〉 ウィンドウ内に対象とする物体画像領域以外の画像領域
が部分的に現れても、その画像領域とウィンドウの外側
の画像領域とを同一値の画素データに設定するので、対
象とする物体画像領域を、その他の画像領域と区別して
容易に抽出できる。
<Operation> Even if an image area other than the target object image area partially appears in the window, that image area and the image area outside the window are set to the same pixel data, so the target object image area is set to the same value pixel data. Image regions can be easily extracted by distinguishing them from other image regions.

〈実施例〉 第1図は、この発明が実施された画像処理システムの構
成例を示すもので、カメラ1と画像処理装置2とを含ん
でいる。
<Embodiment> FIG. 1 shows an example of the configuration of an image processing system in which the present invention is implemented, and includes a camera 1 and an image processing device 2. As shown in FIG.

この画像処理システムは、例えばプリント基板上の電子
部品を自動検査するシステムなどに適用されるもので、
カメラ1で対象物3を撮像し、その画像信号を画像処理
装置2に取り込む。
This image processing system is applied, for example, to systems that automatically inspect electronic components on printed circuit boards.
A camera 1 images an object 3, and the image signal is taken into an image processing device 2.

前記画像処理装置2は、2値化回路42画像メモリ5.
変換回路6.ラベリング回路7.計測回路8などを含ん
でいる。
The image processing device 2 includes a binarization circuit 42, an image memory 5.
Conversion circuit 6. Labeling circuit 7. It includes a measurement circuit 8 and the like.

前記2値化回路4はカメラ1より入力された濃淡画像を
所定のしきい値で2値化処理し、その2値画像を画像メ
モリ5に格納する。
The binarization circuit 4 binarizes the gray scale image input from the camera 1 using a predetermined threshold value, and stores the binarized image in the image memory 5.

第3図(1)は、画像メモリ5に格納された2値画像A
の一例を示す。図中、a、〜a4の斜線部分は物体画像
領域であって、各画素には例えば「1」の2値データが
与えられる。またbの白地部分は背景領域であって、各
画素には例えば「0」の2値データが与えられる。
FIG. 3 (1) shows a binary image A stored in the image memory 5.
An example is shown below. In the figure, the shaded areas a to a4 are object image regions, and each pixel is given binary data of "1", for example. Further, the white portion of b is a background area, and each pixel is given binary data of, for example, "0".

前記変換回路6は、第3図(1)に示す2値画像Aに対
し所定の大きさのウィンドウ9を画像内の所定位置に設
定する。第3図(1)に示す例では、中央部に位置する
対象とする物体画像領域a1はウィンドウ9内に含まれ
、対象外の物体画像領域a2はウィンドウ9外に位置す
る。また端部位置の対象外の各物体画像領域as+ai
はウィンドウ9の境界と交わり、それぞれ物体画像領域
a !l l  a 4の一部がウィンドウ9内に現れ
ている。
The conversion circuit 6 sets a window 9 of a predetermined size at a predetermined position within the binary image A shown in FIG. 3(1). In the example shown in FIG. 3(1), the target object image area a1 located at the center is included within the window 9, and the non-target object image area a2 is located outside the window 9. In addition, each object image area as+ai that is not the target at the end position
intersect with the boundary of window 9, respectively, and the object image area a! A portion of l l a 4 appears in window 9 .

この変換回路6では、ウィンドウ9が設定された2値画
像Aにつき、2値データの変換処理を行い、これにより
2値画像Aを第3図(3)に示すような新たな2値画像
Bに変換する。すなわち前記ウィンドウ9の外側の画像
領域と、前記ウィンドウ9の境界と交わるウィンドウ9
内の物体画像領域asta4とを同一値の画素データ(
この場合「1」)に設定して、2値画像をAからBへ変
換するのである。
This conversion circuit 6 performs a binary data conversion process on the binary image A for which the window 9 has been set, thereby converting the binary image A into a new binary image B as shown in FIG. 3(3). Convert to That is, the image area outside the window 9 and the window 9 intersecting the border of the window 9
The pixel data of the same value (
In this case, it is set to "1") to convert the binary image from A to B.

前記ラベリング回路7は、第3図(3)に示す2値画像
Bに対してラベリング処理を施し、例えば物体画像領域
a+にラベル「1」を、データ変換領域Cにラベル「2
」を、それぞれ割り当てる。計測回路8はラベル「1」
が付された物体画像領域a1につき面積2周囲長さなど
の特徴量を計測する。
The labeling circuit 7 performs labeling processing on the binary image B shown in FIG.
”, respectively. Measurement circuit 8 is labeled “1”
Feature quantities such as area 2 and circumference length are measured for the object image region a1 labeled with .

第2図は、前記変換回路6の具体例を示すもので、2個
のオア回路10.IIと、3個のアンド回路12〜・1
4と、2個のノット回路15゜16とで構成されている
FIG. 2 shows a specific example of the conversion circuit 6, which includes two OR circuits 10. II and three AND circuits 12~・1
4 and two knot circuits 15° and 16.

また図中、VBIは第3図(1)の2値画(DAを構成
する2値画像信号を、WDは前記ウィンドウ9を構成す
るウィンドウ信号(例えばウィンドウ9内が「l」、ウ
ィンドウ9外かrOJの信号)を、MODEは変換モー
ドを設定するためのモード信号を、0N10FFはウィ
ンドウ9の設定をオン・オフするウィンドウ設定信号を
、それぞれ示す。
Further, in the figure, VBI is the binary image signal of FIG. MODE is a mode signal for setting the conversion mode, and 0N10FF is a window setting signal for turning on/off the setting of window 9.

いま第3図(1)に示す2値画像Aに変換処理を施す場
合を考えると、まずモード信号MODEおよびウィンド
ウ設定信号0N10FFをともに「1」に設定する。こ
れによりウィンドウ信号WDがアンド回路12およびオ
ア回路10を経てアンド回路13の一方の入力として与
えられる。このアンド回路13には、第3図(1)の2
値画像八を構成する2値画像信号VBiが他方の入力と
して与えられ、その結果、アシド回路13の出力として
第3図(2)に示すような2値画像A′が得られる。こ
の2値画像八′においては、ウィンドウ9の外側領域を
構成する各画素の画素データはすべて「0」である。
Now, considering the case where the conversion process is performed on the binary image A shown in FIG. 3(1), first the mode signal MODE and the window setting signal 0N10FF are both set to "1". As a result, the window signal WD is applied as one input to the AND circuit 13 via the AND circuit 12 and the OR circuit 10. This AND circuit 13 includes 2 in FIG. 3(1).
The binary image signal VBi constituting the value image 8 is given as the other input, and as a result, a binary image A' as shown in FIG. 3(2) is obtained as the output of the acid circuit 13. In this binary image 8', the pixel data of each pixel constituting the area outside the window 9 is all "0".

一方、アンド回路14にはモード信号MODEとウィン
ドウ設定信号0N10FFとウィンドウ信号WDの反転
信号とが入力され、その結果、アンド回路14の出力と
してウィンドウ9の内側の全領域は「0」の画素データ
で構成され、またウィンドウ9の外側の全領域は「1」
の画素データで構成される。
On the other hand, the mode signal MODE, the window setting signal 0N10FF, and the inverted signal of the window signal WD are inputted to the AND circuit 14, and as a result, the entire area inside the window 9 is output as pixel data of "0" , and the entire area outside window 9 is "1"
It consists of pixel data.

各アンド回路13.14の出力はオア回路11へ入力さ
れ、その結果、オア回路11の出力MVBIとして第3
図(3)に示すような2値画像Bか得られる。なお第4
図は変換回路6の入出力の関係を論理表で示したもので
ある。
The outputs of each AND circuit 13 and 14 are input to the OR circuit 11, and as a result, the third
A binary image B as shown in Figure (3) is obtained. Furthermore, the fourth
The figure shows the relationship between the input and output of the conversion circuit 6 in the form of a logic table.

前記2値画像Bにおいては、画素データrNで構成され
る領域は、中央の物体画像領域a。
In the binary image B, the area composed of pixel data rN is the central object image area a.

とデータ変換領域C1すなわち前記ウィンドウ9の外側
の画像領域とウィンドウ9と交わるウィンドウ9内の物
体画像領域a s +  84とであって、しかもデー
タ変換領域Cは常に2値画像Bの原点位置0を含むこと
になる。従ってこの2値画像Bにラベリング処理を施し
たとき、原点位置Oを含まないラベルの画像領域が対象
とする物体画像領域a1であると容易に判断し得、この
物体画像領域a、について特徴量の計測を実施すること
になる。
and the data conversion area C1, that is, the image area outside the window 9, and the object image area a s + 84 within the window 9 that intersects with the window 9, and the data conversion area C is always at the origin position 0 of the binary image B. will be included. Therefore, when labeling processing is applied to this binary image B, it can be easily determined that the image area of the label that does not include the origin position O is the target object image area a1, and the feature amount for this object image area a. will be measured.

〈発明の効果〉 この発明は上記の如く、入力された2値画像にウィンド
ウを設定し、このウィンドウの外側の画像領域と前記ウ
ィンドウの境界と交わるウィンドウ内の物体画像領域と
を同一値の画素データに設定して2値画像を変換するよ
うにしたから、ウィンドウ内に対象とする物体画像領域
以外の画像領域が部分的に現れても、対象とする物体画
像領域をその他の画像領域と区別して容易に抽出するこ
とか可能であり、ラベリングや領域の判別などの各処理
を容易イ1し得、処理の迅速化をはかることかできる。
<Effects of the Invention> As described above, the present invention sets a window in the input binary image, and divides the image area outside this window and the object image area within the window that intersects the boundary of the window into pixels of the same value. data to convert the binary image, so even if an image area other than the target object image area partially appears in the window, the target object image area can be distinguished from other image areas. It is possible to separate and easily extract the data, and it is possible to easily perform various processing such as labeling and region discrimination, thereby speeding up the processing.

【図面の簡単な説明】 第1図はこの発明か実施された画像処理システムの構成
を示すブロック図、第2図は変換回路の具体例を示す電
気回路図、第3図はこの発明の2値画像変換方法を示す
説明図、第4図は変換回路の入出力の関係を示す説明図
である。 1・・・・カメラ   2・・・・画像処理装置6・・
・・変換回路 特許出願人   オ ム ロ ン 株 式 会 社第 図 瘍 国 盲二ッ【
[Brief Description of the Drawings] Fig. 1 is a block diagram showing the configuration of an image processing system according to the present invention, Fig. 2 is an electric circuit diagram showing a specific example of a conversion circuit, and Fig. 3 is a block diagram showing the configuration of an image processing system according to the present invention. FIG. 4 is an explanatory diagram showing the value image conversion method, and FIG. 4 is an explanatory diagram showing the input/output relationship of the conversion circuit. 1...Camera 2...Image processing device 6...
... Conversion circuit patent applicant Omron Co., Ltd.

Claims (1)

【特許請求の範囲】 2値画像を入力して各画素データを変換するための2値
画像変換方法であって、 入力された2値画像にウィンドウを設定し、このウィン
ドウの外側の画像領域と前記ウィンドウの境界と交わる
ウィンドウ内の物体画像領域とを同一値の画素データに
設定して2値画像を変換することを特徴とする2値画像
変換方法。
[Claims] A binary image conversion method for inputting a binary image and converting each pixel data, the method comprising: setting a window on the input binary image; A binary image conversion method comprising converting a binary image by setting pixel data of the same value to an object image area within the window that intersects with the boundary of the window.
JP2267353A 1990-10-03 1990-10-03 Binary image conversion method Pending JPH04142676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2267353A JPH04142676A (en) 1990-10-03 1990-10-03 Binary image conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2267353A JPH04142676A (en) 1990-10-03 1990-10-03 Binary image conversion method

Publications (1)

Publication Number Publication Date
JPH04142676A true JPH04142676A (en) 1992-05-15

Family

ID=17443640

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2267353A Pending JPH04142676A (en) 1990-10-03 1990-10-03 Binary image conversion method

Country Status (1)

Country Link
JP (1) JPH04142676A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0844852A (en) * 1994-07-29 1996-02-16 Nec Corp Image processor
JP2009008453A (en) * 2007-06-26 2009-01-15 Panasonic Electric Works Co Ltd Object discrimination method and object discrimination device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0844852A (en) * 1994-07-29 1996-02-16 Nec Corp Image processor
JP2009008453A (en) * 2007-06-26 2009-01-15 Panasonic Electric Works Co Ltd Object discrimination method and object discrimination device

Similar Documents

Publication Publication Date Title
US5253306A (en) Method of matching patterns and apparatus therefor
JPH04142676A (en) Binary image conversion method
JPH04106460A (en) Detecting method of defect
JPH0260265B2 (en)
JPH0291505A (en) Inspecting device for solder surface of circuit board
JPH1114317A (en) Appearance inspection method and device
JPS5816837B2 (en) pattern detection device
JPS6312987A (en) Detecting method for moving object
JPS58129888A (en) Position detector
JPH0129643Y2 (en)
JPS62247473A (en) Picture processor
JP2773871B2 (en) Image data binarization method
JPS58195987A (en) Symbol and character detector
JPH0559547U (en) Image target detection device
JPS63184886A (en) Binarizing system for picture processing
JPH0718810B2 (en) Pattern inspection method
JPH0525352B2 (en)
JPH02154106A (en) Shape inspection instrument
JPH0413750B2 (en)
JPS63277959A (en) Inspecting method for threaded neck of container
JPH11328409A (en) Device for inspecting sheet material defect
JPS62194587A (en) Fruit recognizing device
JPH04102051A (en) Apparatus for inspecting appearance
JPH03224074A (en) Method and device for image processing
JPS62150143A (en) Detection of pattern defect