JP2889490B2 - Threshold setting method in image processing apparatus - Google Patents

Threshold setting method in image processing apparatus

Info

Publication number
JP2889490B2
JP2889490B2 JP6096849A JP9684994A JP2889490B2 JP 2889490 B2 JP2889490 B2 JP 2889490B2 JP 6096849 A JP6096849 A JP 6096849A JP 9684994 A JP9684994 A JP 9684994A JP 2889490 B2 JP2889490 B2 JP 2889490B2
Authority
JP
Japan
Prior art keywords
value
pixel
ccd camera
image
threshold
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 - Fee Related
Application number
JP6096849A
Other languages
Japanese (ja)
Other versions
JPH07270136A (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.)
NITSUTO SEIKO KK
Original Assignee
NITSUTO SEIKO KK
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 NITSUTO SEIKO KK filed Critical NITSUTO SEIKO KK
Priority to JP6096849A priority Critical patent/JP2889490B2/en
Publication of JPH07270136A publication Critical patent/JPH07270136A/en
Application granted granted Critical
Publication of JP2889490B2 publication Critical patent/JP2889490B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、CCDカメラを使用し
て部品の形状を検査する際に使用される画像処理装置に
おけるしきい値設定方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for setting a threshold value in an image processing apparatus used for inspecting the shape of a component using a CCD camera.

【0002】[0002]

【従来の技術】最近、CCDカメラを使用して各種部品
の形状を認識し、その部品の良否を瞬時に判別するよう
にした検査機能を有する画像処理装置が各種開発されて
いる。この一例として、ねじの頭部形状の良否を判別す
るためのねじの頭部形状検査装置がある。この装置は、
所定間隔をおいて配置された透明な材料でなる2本の搬
送ベルトを有し、この搬送ベルトによりねじの頭部が係
止されて一列に連続して供給されるように構成されてい
る。また、前記ねじの移動路を挟む位置にはストロボと
その光線を受けるCCDカメラとが配置されており、ね
じがCCDカメラの前方に位置すると、ストロボが作動
してねじの頭部のシルエットがCCDカメラにより取り
込まれる。この時、CCDカメラの画像を構成する画素
の受光量に応じた電圧値から得られる画像の輝度値とあ
らかじめ設定された所定しきい値とが比較されてねじの
頭部の形状が二値化データとして算出され、この二値化
データが良否判定部に送られるように構成されている。
また、この良否判定部は前記二値化データからねじの頭
部形状の特徴点を算出して、これを基準となるねじの頭
部形状の特徴点と比較し、その良否を判別するように構
成されている。
2. Description of the Related Art Recently, various image processing apparatuses having an inspection function for recognizing the shape of various parts using a CCD camera and instantaneously determining the quality of the parts have been developed. As an example of this, there is a screw head shape inspection device for determining the quality of the screw head shape. This device is
It has two transport belts made of a transparent material arranged at a predetermined interval, and the heads of the screws are locked by the transport belts so that the screws are continuously supplied in a line. Further, a strobe and a CCD camera for receiving the light beam are arranged at positions sandwiching the movement path of the screw. When the screw is positioned in front of the CCD camera, the strobe operates and the head silhouette of the screw is moved to the CCD. Captured by the camera. At this time, the brightness value of the image obtained from the voltage value corresponding to the amount of light received by the pixels constituting the image of the CCD camera is compared with a predetermined threshold value, and the shape of the screw head is binarized. The binarized data is calculated as data, and the binarized data is sent to the pass / fail determination unit.
The pass / fail determination unit calculates a feature point of the head shape of the screw from the binarized data, compares the calculated feature point with a feature point of the head shape of the screw as a reference, and determines the pass / fail. It is configured.

【0003】[0003]

【発明が解決しようとする課題】上記装置では、CCD
カメラの画像を構成する画素ごとに輝度値を算出し、こ
の輝度値を所定しきい値と比較して二値化データを算出
しているが、このしきい値はねじの検査位置の照明むら
があるにも拘わらず、全画素にわたって一定に設定され
ている。ところが、CCDカメラがストロボの照射光を
受けてねじの頭部のシルエットを取り込む場合には、図
5に示すように光の回折によりねじ4の頭部の周縁部に
回り込む光量が多く、ねじ4の頭部の形状が実際よりも
小さくなる関係で、できる限りしきい値を大きくする必
要が生じているが、このしきい値を大きくし過ぎると、
光量の少ない部分の背景の輝度値に近づき、この部分の
二値化データがノイズの影響を受け易く、ノイズ分がわ
ずかでも加わると背景部分に拘わらずねじ4の一部とし
て二値化データに変換され、ねじ4の頭部形状が正確に
認識できなくなる等の欠点が生じている。また、逆にC
CDカメラがストロボの光の反射光を受けるように配置
されている場合にも、ねじ4の頭部が曲面を持っている
ようなときには、図6に示すようにねじ4の頭部の周縁
部での反射光が少なくなり、同様にねじ4の頭部の形状
が実際よりも小さくなる関係で、できる限りしきい値を
小さくする必要が生じている。そのため、暗部の背景部
分のうちの明るい部分の画素がノイズの影響を受け易
く、ノイズ分がわずかでも加わると背景部分に拘わらず
ねじ4の一部として二値化データに変換され、ねじの頭
部形状が正確に認識できなくなる等の欠点が生じてい
る。
In the above apparatus, a CCD is used.
A brightness value is calculated for each pixel constituting the image of the camera, and the brightness value is compared with a predetermined threshold value to calculate binarized data. Is set constant over all pixels. However, when the CCD camera receives the illumination light from the strobe and captures the silhouette of the head of the screw, as shown in FIG. 5, a large amount of light goes around the periphery of the head of the screw 4 due to diffraction of the light. Because the shape of the head of is smaller than it actually is, it is necessary to increase the threshold as much as possible, but if this threshold is too large,
When the luminance value of the portion near the light amount is small, the binarized data of this portion is easily affected by noise. Even if a small amount of noise is added, the binarized data becomes part of the screw 4 regardless of the background portion. It is converted, and drawbacks such as the inability to accurately recognize the head shape of the screw 4 occur. Conversely, C
Even when the CD camera is arranged to receive the reflected light of the strobe light, when the head of the screw 4 has a curved surface, as shown in FIG. Since the amount of light reflected on the screw 4 decreases and the shape of the head of the screw 4 becomes smaller than the actual shape, it is necessary to reduce the threshold value as much as possible. For this reason, pixels in the bright portion of the background portion of the dark portion are easily affected by noise, and even if a small amount of noise is added, the pixel is converted into binary data as a part of the screw 4 regardless of the background portion, and the head of the screw is There are drawbacks such as the inability to accurately recognize the part shape.

【0004】本発明は、上記欠点の除去を目的として発
明されたもので、CCDカメラの取り込む背景画像の明
るさに応じて各画素ごとにしきい値を設定するしきい値
設定方法を提供することを目的とするものである。
SUMMARY OF THE INVENTION The present invention has been made for the purpose of eliminating the above-mentioned drawbacks, and provides a threshold value setting method for setting a threshold value for each pixel according to the brightness of a background image captured by a CCD camera. It is intended for.

【0005】また、本発明はCCDカメラを光源からの
照射光を受けるように配置する場合、CCDカメラの画
像を構成する各画素の輝度値から各画素ごとにその周辺
領域の画素が持つ輝度値の最小値を求めてこれを基準と
して自身のしきい値を算出して背景画像の明るさに応じ
て各画素ごとにしきい値を設定し、背景画像に陰影があ
ってもこれの影響を少なくして二値化データを得ること
ができるしきい値設定方法を提供することを目的とする
ものである。
Further, according to the present invention, when a CCD camera is arranged so as to receive irradiation light from a light source, the brightness value of a pixel in a peripheral area of each pixel is determined for each pixel based on the brightness value of each pixel constituting an image of the CCD camera. Calculates its own threshold value based on this value and sets a threshold value for each pixel according to the brightness of the background image, reducing the influence of shadows even in the background image. It is an object of the present invention to provide a threshold value setting method that can obtain binary data.

【0006】さらに、本発明はCCDカメラを光源から
の光の反射光を受けるように配置する場合でも、ねじの
頭部が曲面を有している時には、CCDカメラの画像を
構成する各画素の輝度値から各画素ごとにその周辺領域
の画素が持つ輝度値の最大値を基準として自身のしきい
値を算出して暗部の背景画像の暗さに応じて各画素ごと
にしきい値を設定し、部品の反射光に光量差があっても
これの影響を少なくして二値化データを得ることができ
るしきい値設定方法を提供することを目的とするもので
ある。
Further, even when the CCD camera is arranged so as to receive the reflected light of the light from the light source, when the head of the screw has a curved surface, the present invention is also applicable to each pixel constituting the image of the CCD camera. Calculate its own threshold based on the maximum luminance value of the pixels in the surrounding area for each pixel from the luminance value, and set the threshold value for each pixel according to the darkness of the background image in the dark area It is another object of the present invention to provide a threshold value setting method capable of obtaining binary data by reducing the influence of a difference in the amount of reflected light from a component.

【0007】その上、本発明はCCDカメラにより取り
込まれる濃淡画像をCRT表示部で表示しながらCRT
表示部上で任意の領域を設定してこの領域内の画素のし
きい値を任意に設定するしきい値設定方法を提供するこ
とを目的とするものである。
In addition, the present invention provides a CRT displaying a grayscale image captured by a CCD camera on a CRT display unit.
It is an object of the present invention to provide a threshold value setting method for setting an arbitrary region on a display unit and arbitrarily setting a threshold value of a pixel in this region.

【0008】[0008]

【課題を解決するための手段】光源からの光を受ける部
品の移動路に対してCCDカメラを配置し、部品がCC
Dカメラの前方に位置すると、CCDカメラの画像を構
成する各画素の電圧値とあらかじめ設定されたしきい値
とを比較して部品の形状を二値化データとして認識して
この二値化データに基づいてCRT表示部に部品の形状
を表示する画像処理装置において、光源作動時の部品が
ない状態でCCDカメラの各画素の電圧値を画像の輝度
値に変換して一時記憶し、各画素ごとにその周囲領域内
にある画素の輝度値を求めてこれを基準に自身のしきい
値を変更するように構成されている。
Means for Solving the Problems A CCD camera is arranged on a moving path of a component receiving light from a light source, and
When positioned in front of the D camera, the voltage value of each pixel constituting the image of the CCD camera is compared with a preset threshold value, and the shape of the part is recognized as binary data. In the image processing apparatus for displaying the shape of the component on the CRT display unit based on the above, the voltage value of each pixel of the CCD camera is converted into the luminance value of the image and temporarily stored in the state where there is no component when the light source is activated, and each pixel is temporarily stored. Each time, a luminance value of a pixel in the surrounding area is obtained, and the threshold value is changed based on the luminance value.

【0009】また、光源から照射される光を受ける位置
にCCDカメラが配置される場合には、各画素ごとに一
定周辺領域内にある画素の輝度値の最小値を求めてこれ
を基準に自身のしきい値を設定するように構成してもよ
い。
When a CCD camera is arranged at a position for receiving light emitted from a light source, the minimum value of the luminance value of a pixel in a certain peripheral area is determined for each pixel, and the minimum value is determined based on the minimum value. May be set.

【0010】さらに、光源から照射される光の反射光を
受ける位置にCCDカメラが配置される場合には、各画
素ごとに一定領域内にある画素の最大値を求めてこれを
基準に自身のしきい値を設定するように構成してもよ
い。
Further, when the CCD camera is disposed at a position where the reflected light of the light emitted from the light source is received, the maximum value of the pixels within a certain area is obtained for each pixel, and the maximum value of the pixel is determined based on the maximum value. You may comprise so that a threshold value may be set.

【0011】その上、光源からの光を受ける部品の移動
路に対してCCDカメラを配置し、部品がCCDカメラ
の前方に位置すると、CCDカメラの画像を構成する各
画素の電圧値とあらかじめ設定されたしきい値とを比較
して部品の形状を二値化データとして認識してこの二値
化データに基づいてCRT表示部に部品の形状を表示す
る画像処理装置において、光源作動時の部品がない状態
でのCCDカメラの各画素の電圧値を画像の輝度値に変
換して、この輝度値に基づく濃淡画像をCRT表示部に
表示し、この濃淡画像上での任意の領域設定信号を受け
ると、所望しきい値の入力を待ってその領域内の画素の
しきい値を設定するように構成してもよい。
In addition, a CCD camera is arranged on the moving path of the component receiving the light from the light source, and when the component is positioned in front of the CCD camera, the voltage value of each pixel constituting the image of the CCD camera is set in advance. In the image processing apparatus which recognizes the shape of the component as binarized data by comparing the threshold value with the set threshold value and displays the shape of the component on the CRT display unit based on the binarized data, The voltage value of each pixel of the CCD camera in a state where there is no image is converted into a luminance value of an image, a grayscale image based on the luminance value is displayed on a CRT display unit, and an arbitrary area setting signal on the grayscale image is displayed. When receiving the threshold value, the threshold value of the pixel in the area may be set after the input of the desired threshold value.

【0012】[0012]

【作 用】本発明の画像処理装置では、作業開始前に、
領域あるいは自動しきい値設定モードが選択されると、
光源が作動し、部品がない状態でのCCDカメラの画像
を構成する各画素の電圧値が画像の輝度値に変換され
て、一時記憶される。さらに、各画素ごとにその周辺の
画素の持つ輝度値から適当な値が選択されてこれに基づ
いて自身のしきい値が算出され、記憶される。
[Operation] In the image processing apparatus of the present invention, before starting work,
When the area or automatic threshold setting mode is selected,
When the light source is activated, the voltage value of each pixel constituting the image of the CCD camera in a state where there are no components is converted into a luminance value of the image and temporarily stored. Further, for each pixel, an appropriate value is selected from the luminance values of the peripheral pixels, and its own threshold value is calculated and stored based on the selected value.

【0013】前記各画素のしきい値を決定する際に、C
CDカメラが光源からの光の反射光を受ける場合には各
画素ごとに一定周辺領域の画素の持つ輝度値を読み出し
て、その最大値を基準に、またCCDカメラが光源から
の照射光を受ける場合には前記輝度値の最小値を基準に
ノイズ分を考慮したオフセット値を増減して各画素のし
きい値を算出して記憶する。このしきい値の設定が全画
素について行われ、全画素がその周辺の明るさまたは暗
さに応じたしきい値を持つことができる。しかも、背景
画像にベルト等の陰影あるいは反射部があってもこの陰
影部分あるいは反射部に位置する画素のしきい値を滑ら
かに変化させてこれら陰影部あるいは反射部の影響を少
なくすることができる。
When determining the threshold value of each pixel, C
When the CD camera receives the reflected light from the light source, it reads out the brightness value of the pixels in the fixed peripheral area for each pixel, and the CCD camera receives the light from the light source based on the maximum value. In this case, the threshold value of each pixel is calculated and stored by increasing or decreasing the offset value in consideration of the noise component based on the minimum value of the luminance value. This threshold value is set for all pixels, and all pixels can have threshold values according to the brightness or darkness of the surrounding pixels. In addition, even if the background image has a shadow or a reflective portion such as a belt, the threshold value of the pixel located in the shadow or the reflective portion can be smoothly changed to reduce the influence of the shadow or the reflective portion. .

【0014】また、前記画素のしきい値を決定する場
合、前記各画素の輝度値からCRT表示部に濃淡画像を
表示して作業者が任意の領域を設定してこの領域内にあ
る画素のしきい値を任意に設定するようにしてもよい。
この場合、背景画像中の余分な部分を削除しておくこと
ができる。
Further, when determining the threshold value of the pixel, a grayscale image is displayed on a CRT display unit from the luminance value of each pixel, and an operator sets an arbitrary area, and sets the pixels within this area. The threshold value may be set arbitrarily.
In this case, an extra portion in the background image can be deleted.

【0015】上記各画素のしきい値設定完了後に、CC
Dカメラの前方に部品が位置してその形状がCCDカメ
ラにより取り込まれて、部品の形状が二値化画像として
CRT表示部上に表示される。この時、各画素の画像の
輝度値から二値化データを作成するしきい値はその画素
の周辺の明るさまたは暗さに応じて設定されているた
め、光の回折による部品の周縁部の細りあるいは部品の
頭部が曲面を持つ時の光の反射による部品の細りをでき
る限り少なくなる。また、全画素にわたって照明むらが
生じていても全画素にわたってほぼ一定の耐ノイズ性を
有することができ、光の回折あるいは光の反射量による
部品の周縁部の変形が少なくなるばかりか、背景部分を
構成する画素の電圧値にノイズ分が加わっても、背景部
分を部品の一部とすることもなく、実際の部品の形状に
最も近い二値化画像を得ることができる。
After the threshold value setting for each pixel is completed, CC
The component is positioned in front of the D camera, and its shape is captured by the CCD camera, and the shape of the component is displayed on the CRT display unit as a binary image. At this time, since the threshold value for generating binarized data from the luminance value of the image of each pixel is set according to the brightness or darkness around the pixel, the peripheral edge of the component due to light diffraction Thinning or thinning of the part due to reflection of light when the head of the part has a curved surface is minimized. In addition, even if illumination unevenness occurs in all pixels, it can have almost constant noise resistance over all pixels, and not only does the deformation of the peripheral portion of the component due to light diffraction or light reflection amount decrease, but also the background portion Even if a noise component is added to the voltage value of the pixel constituting the pixel, a binary image closest to the actual shape of the component can be obtained without making the background part a part of the component.

【0016】[0016]

【実施例】以下、本発明の実施例を図面に基づき説明す
る。図1において、1は画像処理装置の一例のねじの頭
部形状検査装置(以下、検査装置という)であり、この
検査装置1は所定間隔をおいて配置された透明な材料で
なる2本の搬送ベルト2を有している。この搬送ベルト
2は、回転自在に取付けられたプーリ(図示せず)に巻
回されており、回転駆動源(図示せず)の回転を受けて
同速度で同方向に移動し、後記するCCDカメラ3の下
方の検査位置までねじ4を正しい姿勢で一列に連続して
供給するように構成されている。
Embodiments of the present invention will be described below with reference to the drawings. In FIG. 1, reference numeral 1 denotes a screw head shape inspection device (hereinafter, referred to as an inspection device) as an example of an image processing device. The inspection device 1 includes two transparent materials arranged at predetermined intervals. It has a transport belt 2. The conveyor belt 2 is wound around a rotatably mounted pulley (not shown), and moves in the same direction at the same speed in response to the rotation of a rotary drive source (not shown). The screw 4 is continuously supplied in a line in a correct posture to the inspection position below the camera 3.

【0017】一方、前記検査装置1は前記検査位置でし
かもねじ4の移動路を挟む位置に配置された光源の一例
のストロボ5とその照射光を受けるCCDカメラ3とを
有している。また、前記検査装置1はCCDカメラ3の
画像を構成する各画素の受光量に応じた電圧値を映像信
号として受信する制御装置6を有している。この制御装
置6は、マイクロプロセッサでなる制御部7を有し、こ
の制御部7にはねじ4の頭部形状の良否判定に必要な基
準となるねじ4の頭部形状の特徴点を含む各種情報並び
にカーソル座標データ、新しきい値等しきい値設定の際
に必要な情報を記憶する記憶部8が接続されている。こ
れら情報は後記する入力部9から入力されたり、制御部
7で算出されて記憶部8に送られるように構成されてい
る。また、前記制御部7にはインタフェイスバスを介し
て、ねじ4が検査位置を通過するとこれを検出してねじ
検出信号を出力する部品検出部10、ストロボ駆動フラ
グを受けてストロボ5aから光を照射させるストロボ駆
動部5、領域しきい値設定モード、自動しきい値設定モ
ードあるいは検査モード等のモード指令信号、濃淡画像
あるいは二値化画像の表示を指令する表示モード指令信
号、その他必要な情報を入力する入力部9、CCDカメ
ラ3の各画素が持つ電圧値を受けて二値化データを算出
するCCDカメラインタフェイス11、各画素の輝度値
および二値化データを制御部7から指定される輝度値エ
リア、しきい値エリア、二値エリアのいずれかに記憶す
るフレームRAM12、表示コントロール部13並びに
CRT表示部14が接続されている。
On the other hand, the inspection apparatus 1 has a strobe 5 as an example of a light source disposed at the inspection position and at a position sandwiching the moving path of the screw 4 and a CCD camera 3 for receiving irradiation light. Further, the inspection device 1 has a control device 6 that receives a voltage value corresponding to the amount of received light of each pixel constituting an image of the CCD camera 3 as a video signal. The control device 6 includes a control unit 7 composed of a microprocessor. The control unit 7 includes various kinds of features including a feature point of the head shape of the screw 4 which is a reference necessary for determining whether the head shape of the screw 4 is good. A storage unit 8 for storing information, cursor coordinate data, and information necessary for setting a threshold value such as a new threshold value is connected. These pieces of information are configured to be input from an input unit 9 described later, calculated by the control unit 7, and sent to the storage unit 8. Also, the control unit 7 detects, when the screw 4 has passed the inspection position, the component detection unit 10 that outputs the screw detection signal when the screw 4 has passed the inspection position, and receives light from the strobe 5a in response to the strobe drive flag via the interface bus. A strobe drive unit 5 to be irradiated, a mode command signal such as an area threshold setting mode, an automatic threshold setting mode or an inspection mode, a display mode command signal for commanding display of a grayscale image or a binary image, and other necessary information. An input unit 9 for inputting a pixel value, a CCD camera interface 11 for receiving the voltage value of each pixel of the CCD camera 3 to calculate binarized data, and specifying the luminance value and the binarized data of each pixel by the control unit 7. The frame RAM 12, the display control unit 13, and the CRT display unit 14 stored in any one of a luminance value area, a threshold area, and a binary area. It is.

【0018】前記CCDカメラインタフェイス11は、
制御部7で画像取り込みフラグがセットされる時タイミ
ングパルスを出力するタイミングパルス発生部11a、
CCDカメラ3の画像を構成する各画素の電圧値をタイ
ミングパルスを受信するごとに輝度値に変換するA/D
変換部11b、制御部7からの選択信号によって固定し
きい値設定部11cに設定されたしきい値、フレームR
AM12に記憶された各画素ごとのしきい値のいずれか
を後記する信号二値化部11dに送る選択部、前記輝度
値としきい値とを比較して二値化データを算出してこれ
を後記するフレームRAM12に出力する信号二値化部
11d、タイミングパルスを受信するごとにアドレスを
発生してフレームRAM12に送るアドレス発生部11
fからなっている。このCCDカメラインタフェイス1
1は、制御部7が検査モード指令信号を受けて画像取り
込みフラグをセットすると、タイミングパルスに同期し
て各画素ごとの電圧値から輝度値に変換して、これと制
御部7からのしきい値選択指令信号に応じたしきい値と
を比較して各画素ごとに二値化データを算出し、これを
フレームRAM12の二値エリア内で前記画素に対応し
て作成された画像アドレスに出力するように構成されて
いる。この時、CCDカメラ3からは常時各画素の電圧
値を含む映像信号が送信されるので、画像の最初の画素
に対応する電圧値を待って、A/D変換を開始し、輝度
値、二値化データを順次算出するように構成されてい
る。
The CCD camera interface 11 includes:
A timing pulse generator 11a that outputs a timing pulse when the image capture flag is set by the controller 7;
A / D for converting the voltage value of each pixel constituting the image of the CCD camera 3 into a luminance value each time a timing pulse is received
Conversion section 11b, threshold value set in fixed threshold value setting section 11c by selection signal from control section 7, frame R
A selection unit that sends one of the threshold values for each pixel stored in the AM 12 to a signal binarization unit 11d described later, compares the luminance value with the threshold value, calculates binary data, and calculates A signal binarizing unit 11d for outputting to a frame RAM 12 to be described later, an address generating unit 11 for generating an address each time a timing pulse is received and sending the address to the frame RAM 12
f. This CCD camera interface 1
When the control unit 7 receives an inspection mode command signal and sets an image capture flag, the control unit 7 converts a voltage value for each pixel into a luminance value in synchronization with a timing pulse, and a threshold value from the control unit 7 A threshold value corresponding to the value selection command signal is compared to calculate binarized data for each pixel, and output this to the image address created for the pixel in the binary area of the frame RAM 12 It is configured to be. At this time, since a video signal including the voltage value of each pixel is always transmitted from the CCD camera 3, the A / D conversion is started after waiting for the voltage value corresponding to the first pixel of the image, and the luminance value and the second It is configured to sequentially calculate the quantified data.

【0019】また、前記CCDカメラインタフェイス1
1は制御部7が自動しきい値設定モード指令信号を受け
て画像取り込みフラグをセットすると、同様にタイミン
グパルスに同期して画素ごとに輝度値に変換してこの輝
度値をフレームRAM12に出力するように構成されて
いる。
The CCD camera interface 1
When the control unit 7 receives the automatic threshold setting mode command signal and sets the image capture flag, similarly, the control unit 7 converts the brightness value for each pixel in synchronization with the timing pulse, and outputs the brightness value to the frame RAM 12. It is configured as follows.

【0020】さらに、前記CCDカメラインタフェイス
11は制御部7が領域しきい値設定モード指令信号を受
けて画像取り込みフラグをセットすると、同様にタイミ
ングパルスに同期して画素ごとに輝度値に変換してこの
輝度値をフレームRAM12に出力するように構成され
ている。
Further, when the control unit 7 receives the area threshold setting mode command signal and sets the image capture flag, the CCD camera interface 11 similarly converts the image into a luminance value for each pixel in synchronization with the timing pulse. It is configured to output the luminance value of the lever to the frame RAM 12.

【0021】前記フレームRAM12は、検査モード時
には制御部7から二値エリアセット指令信号を、自動し
きい値設定モード時および領域しきい値設定モード時に
は制御部7から輝度値エリアセット指令信号を受けて、
CCDカメラインタフェイス11から与えられる輝度値
および二値化データ、並びに制御部7から与えられるし
きい値を各エリアに書込むように構成されている。ま
た、このフレームRAM12は全画素の電圧値を輝度値
または二値化データに変換し終えると、画像取り込み完
了信号を制御部7に出力する一方で、制御部7から直接
アクセス可能に構成されており、しきい値エリアの任意
のしきい値アドレスに任意の新しきい値を書込むことが
できるように構成されている。さらに、前記フレームR
AM12は表示コントロール部13から濃淡画像表示指
令信号、あるいは二値化画像表示指令信号を受けると、
その指令信号に応じて輝度値エリアの輝度値あるいは二
値エリアの二値化データを表示コントロール部13を通
じてCRT表示部14に出力するように構成されてい
る。しかも、前記フレームRAM12はテキストRAM
(図示せず)を有しており、カーソルパターン表示指令
信号を受けてカーソル座標に記憶されるCRT表示部1
4上の点にカーソルパターンを表示するように構成され
ている。
The frame RAM 12 receives a binary area set command signal from the control unit 7 in the inspection mode, and receives a luminance value area set command signal from the control unit 7 in the automatic threshold setting mode and the area threshold setting mode. hand,
The luminance value and the binarized data given from the CCD camera interface 11 and the threshold given from the control unit 7 are written in each area. The frame RAM 12 is configured to output an image capture completion signal to the control unit 7 upon completion of converting the voltage values of all pixels into luminance values or binary data, and to be directly accessible from the control unit 7. , Any new threshold value can be written to any threshold address in the threshold area. Further, the frame R
When the AM 12 receives the grayscale image display command signal or the binary image display command signal from the display control unit 13,
According to the command signal, the luminance value of the luminance value area or the binarized data of the binary area is output to the CRT display section 14 through the display control section 13. Moreover, the frame RAM 12 is a text RAM.
(Not shown), and receives a cursor pattern display command signal and stores the cursor coordinates at the CRT display unit 1
4 is configured to display a cursor pattern at a point above.

【0022】前記表示コントロール部13は、入力部9
からの表示モード指令信号に基づき制御部7から出力さ
れる濃淡画像あるいは二値化画像の表示指令信号を受け
ると、その指令内容に応じてフレームRAM12内の輝
度値、二値化データのいずれかの出力指令信号をフレー
ムRAM12に送るように構成されている。また、CR
T表示部14はフレームRAM12から輝度値、二値化
データのいずれかを受けると、これに基づく濃淡画像、
二値化画像を表示するように構成されている。なお、図
示はしないが、この表示コントロール部13はCCDカ
メラ3が取り込んだ画像の輝度値に応じた明るさを持つ
濃淡画像および前記輝度値から得られる二値化画像をリ
アルタイムでCRT表示部14に表示することもでき
る。
The display control unit 13 includes an input unit 9.
When a display command signal for a grayscale image or a binarized image output from the control unit 7 is received based on a display mode command signal from the CPU, any one of the luminance value and the binary data in the frame RAM 12 according to the content of the command is received. Is sent to the frame RAM 12. Also, CR
When the T display unit 14 receives any one of the luminance value and the binarized data from the frame RAM 12, the T display unit 14
It is configured to display a binarized image. Although not shown, the display control unit 13 displays a grayscale image having a brightness corresponding to the brightness value of the image captured by the CCD camera 3 and a binarized image obtained from the brightness value on a CRT display unit 14 in real time. Can also be displayed.

【0023】前記制御部7は、図2Aおよび図2Bに示
すように、 1)モード指令信号を待つ。 2)検査モード指令信号の時、27)にジャンプする。 3)領域しきい値設定モード指令信号の時、11)にジ
ャンプする。 4)自動しきい値設定モード指令信号の時、フレームR
AMに輝度値エリアセット指令信号を出力する。ストロ
ボ駆動フラグおよび画像取り込みフラグをセットする。 5)フレームRAMからの画像取り込み完了信号を待
つ。 6)しきい値を設定する画素を指定する(CCDカメラ
の画像の端部の画素からX座標方向、Y座標方向に隣接
する画素が順次呼び出される。最外周の後記領域幅に相
当する数列は除かれる。)。 7)指定された画素に対して、あらかじめ設定された領
域幅(画素数)内の画素が持つ輝度値を輝度値エリアか
ら呼び出し、その最小値からノイズ分の所定オフセット
値を差し引いた値を前記画素の新しきい値として算出す
る。 8)前記新しきい値をその画素に対応するしきい値エリ
アのしきい値アドレスに記憶する。 9)前記指定された画素が最終の画素かを判断して、こ
れが最終の画素でない時、6)に戻る。 10)指定された画素が最終の画素の時、1)に戻る。 11)フレームRAMに輝度値エリアセット指令信号を
出力するとともに、ストロボ駆動フラグおよび画像取り
込みフラグをセットする。 12)フレームRAMからの画像取り込み完了信号を待
つ。 13)輝度値エリアの輝度値に基づく濃淡画像の表示指
令信号を表示コントロール部に出力する。 14)記億部の第1カーソル座標アドレスにカーソル座
標データを書込む(初期値は任意の点)。カーソルパタ
ーンをテキストRAMに書込む。 15)入力部からのカーソル座標データの入力を待つ。 16)第1カーソル座標アドレス内のカーソル座標デー
タを新カーソル座標データと書換える。カーソルパター
ンをテキストRAMに書換える。 17)入力部からの領域設定開始指令信号を待ち、これ
がない時、15)に戻る。 18)記憶部の第2カーソル座標アドレスに現在カーソ
ル座標データを書込み、カーソルパターンをテキストR
AMに書込む。 19)カーソル座標データの入力を待つ。 20)第2カーソル座標アドレス内のカーソル座標デー
タを新カーソル座標データと書き換える。カーソルパタ
ーンをテキストRAMに書換える。 21)入力部からの領域設定完了指令信号を待ち、これ
がない時、19)に戻る。 22)入力部からの新しきい値の入力を待つ(記憶部に
記憶されたしきい値を初期化する。)。 23)新しきい値を記憶部で一時記憶する。 24)カーソル座標アドレス内の二点を対角とする矩形
領域の画素に対応するしきい値アドレスを順次算出して
これに一時記憶された新しきい値を書込む。 25)領域しきい値完了指令信号の有無を判断して、こ
れがない時、15)に戻る。 26)領域しきい値完了指令信号がある時、1)に戻
る。 27)部品検出部からのねじ検出信号を待つ。 28)フレームRAMに二値エリアセット指令信号を出
力するとともに、画像取り込みフラグおよびストロボ駆
動フラグをセットする。 29)フレームRAMからの画像取り込み完了信号を待
つ。 30)二値エリア内の二値化データからねじの頭部のシ
ルエットの特徴点を算出して、これを記憶部に記憶され
た基準値と比較し、ねじの頭部形状の良否を判定し、判
定結果を出力して、1)に戻る。ように構成されてい
る。
As shown in FIGS. 2A and 2B, the control section 7 1) waits for a mode command signal. 2) In the case of the inspection mode command signal, jump to 27). 3) Jump to 11) at the time of the area threshold setting mode command signal. 4) At the time of the automatic threshold setting mode command signal, the frame R
A luminance value area set command signal is output to the AM. Set the flash drive flag and image capture flag. 5) Wait for an image capture completion signal from the frame RAM. 6) Designate a pixel for which a threshold is to be set (pixels adjacent in the X coordinate direction and Y coordinate direction are sequentially called from the pixel at the end of the image of the CCD camera. Excluded.) 7) For a specified pixel, a luminance value of a pixel within a preset area width (number of pixels) is called from a luminance value area, and a value obtained by subtracting a predetermined offset value for noise from the minimum value is obtained. It is calculated as a new threshold value of the pixel. 8) The new threshold value is stored in a threshold address of a threshold area corresponding to the pixel. 9) It is determined whether the designated pixel is the last pixel. If this is not the last pixel, the process returns to 6). 10) When the designated pixel is the last pixel, return to 1). 11) Output a luminance value area setting command signal to the frame RAM, and set a flash drive flag and an image capture flag. 12) Wait for an image capture completion signal from the frame RAM. 13) Output a display command signal of a grayscale image based on the luminance value of the luminance value area to the display control unit. 14) Write the cursor coordinate data to the first cursor coordinate address in the memory section (the initial value is an arbitrary point). Write the cursor pattern into the text RAM. 15) Wait for input of cursor coordinate data from the input unit. 16) Rewrite the cursor coordinate data in the first cursor coordinate address with the new cursor coordinate data. Rewrite the cursor pattern into the text RAM. 17) Wait for an area setting start command signal from the input unit. If there is no such signal, return to 15). 18) Write the current cursor coordinate data to the second cursor coordinate address in the storage unit, and change the cursor pattern to text R
Write to AM. 19) Wait for input of cursor coordinate data. 20) Rewrite the cursor coordinate data in the second cursor coordinate address with the new cursor coordinate data. Rewrite the cursor pattern into the text RAM. 21) Wait for an area setting completion command signal from the input unit. If there is no such signal, return to 19). 22) Wait for the input of a new threshold from the input unit (initialize the threshold stored in the storage unit). 23) The new threshold is temporarily stored in the storage unit. 24) A threshold address corresponding to a pixel in a rectangular area having two points in the cursor coordinate address as diagonals is sequentially calculated, and the temporarily stored new threshold value is written into this. 25) It is determined whether or not there is an area threshold completion command signal. 26) Return to 1) when there is an area threshold completion command signal. 27) Wait for a screw detection signal from the component detector. 28) Output the binary area set command signal to the frame RAM, and set the image capture flag and the flash drive flag. 29) Wait for an image capture completion signal from the frame RAM. 30) Calculate the characteristic point of the silhouette of the head of the screw from the binarized data in the binary area, compare it with the reference value stored in the storage unit, and determine the quality of the head shape of the screw. , And outputs the determination result, and returns to 1). It is configured as follows.

【0024】上記検査装置では、検査開始に先立ってね
じ4がない状態で入力部9から自動しきい値設定モード
指令信号あるいは領域しきい値設定モード指令信号が制
御部7に出力されると、フレームRAM12に輝度値エ
リアセット指令信号が出力される。同時に、ストロボ駆
動フラグおよび画像取り込みフラグがセットされ、スト
ロボ駆動部5の作動によりストロボ5aが作動して光が
CCDカメラ3に向かって照射される。この時、CCD
カメラ3の画像を構成する各画素のアナログ電圧値から
画像の輝度値がタイミングパルスに同期して算出され、
これが画素ごとにフレームRAM12に出力される。さ
らに、アドレス発生部11fから各画素ごとのしきい値
アドレスがフレームRAM12に出力され、前記輝度値
が各画素に対応した輝度値アドレスに書込まれる。
In the above inspection apparatus, when the automatic threshold setting mode command signal or the area threshold setting mode command signal is output from the input unit 9 to the control unit 7 without the screw 4 prior to the start of the inspection, A luminance value area set command signal is output to the frame RAM 12. At the same time, a strobe drive flag and an image capture flag are set, and the strobe drive unit 5 activates the strobe 5 a to emit light toward the CCD camera 3. At this time, CCD
A luminance value of the image is calculated from an analog voltage value of each pixel constituting the image of the camera 3 in synchronization with the timing pulse,
This is output to the frame RAM 12 for each pixel. Further, a threshold address for each pixel is output from the address generation unit 11f to the frame RAM 12, and the luminance value is written in a luminance value address corresponding to each pixel.

【0025】前記入力部9から自動しきい値設定指令信
号が出力されている時には、順次画素ごとにその一定周
辺領域の画素の持つ輝度値がフレームRAM12から読
み出されて、その最小値から所定のオフセット値を差し
引いた値が前記画素の新しきい値としてフレームRAM
12内のしきい値アドレスに記憶される。この新しきい
値の設定が完了する毎に、新しきい値が設定される画素
が最終か否かが判断され、これが最終の画素である時、
新しきい値の設定を完了し、次のモード指令信号を待
つ。この新しきい値の設定が画像全面の画素について行
われ、各画素ごとにその周囲の明るさの最小値を基準に
してしかも全画素にわたってノイズに対する一定のオフ
セット値を持ったしきい値が設定される。そのため、図
3に示すようにCCDカメラ3により取り込まれた背景
画像の輝度値に対して一点鎖線に示す最小値が得られ、
さらに細線で示される新しきい値が設定される。
When the automatic threshold setting command signal is output from the input unit 9, the luminance value of the pixels in the certain peripheral area is sequentially read out from the frame RAM 12 for each pixel, and a predetermined value is determined from the minimum value. Is subtracted from the frame RAM as a new threshold value of the pixel.
12 is stored in the threshold address. Each time the setting of the new threshold is completed, it is determined whether the pixel for which the new threshold is set is final or not. When this is the final pixel,
Complete the setting of the new threshold and wait for the next mode command signal. This new threshold value is set for all pixels of the image, and a threshold value is set for each pixel based on the minimum value of the surrounding brightness and having a fixed offset value for noise over all pixels. You. Therefore, as shown in FIG. 3, a minimum value indicated by a dashed line with respect to the luminance value of the background image captured by the CCD camera 3 is obtained,
Further, a new threshold value indicated by a thin line is set.

【0026】また、前記入力部9から領域しきい値設定
モード指令信号が出力されている場合には、フレームR
AM12の輝度値エリア内の輝度値が表示コントロール
部13に出力され、この輝度値に基づく濃淡画像がCR
T表示部14で表示される。同時に、制御部7はカーソ
ル座標データの入力を待って、記憶部8の第1カーソル
座標アドレスのカーソル座標データを新カーソル座標デ
ータに書換えるとともに、カーソルパターンをフレーム
RAM12内のテキストRAMに書込み、CRT表示部
14の濃淡画像上にカーソルを重ねて表示する。この状
態で、入力部9からの領域設定開始指令信号を待ち、こ
の指令信号により第2カーソル座標アドレスに現在カー
ソル座標データを書込み、カーソルパターンをフレーム
RAM12内のテキストRAMに書込み、領域設定完了
指令信号を待つ。この領域設定完了指令信号が出力され
ると、入力部9からの新しきい値の入力を待ち、入力さ
れた新しきい値を記憶部8で記憶するとともに、前記2
点を対角とする矩形領域内の画素のしきい値アドレスを
順次算出し、新しきい値に書換える。そのため、CRT
表示部14上で実際の画像を表示してこの画像上で領域
を設定し、画像上の明るさに応じて領域内にある画素の
しきい値を設定することができ、耐ノイズ性を任意に設
定できるばかりか、ねじ4の頭部検査に不要な部分の画
像も簡単に排除することもできる。また、この時、新し
きい値に基づく二値化画像をCRT表示部14で表示す
るようにしてもよい。
When the area threshold setting mode command signal is output from the input unit 9, the frame R
The luminance value in the luminance value area of the AM 12 is output to the display control unit 13, and a grayscale image based on the luminance value is output to the CR.
It is displayed on the T display unit 14. At the same time, the control unit 7 waits for the input of the cursor coordinate data, rewrites the cursor coordinate data of the first cursor coordinate address in the storage unit 8 with the new cursor coordinate data, and writes the cursor pattern in the text RAM in the frame RAM 12; The cursor is superimposed on the grayscale image on the CRT display unit 14 and displayed. In this state, an area setting start command signal from the input unit 9 is waited, the current cursor coordinate data is written to the second cursor coordinate address by this command signal, the cursor pattern is written to the text RAM in the frame RAM 12, and the area setting completion command is issued. Wait for the signal. When this region setting completion command signal is output, the input unit 9 waits for the input of a new threshold value, stores the input new threshold value in the storage unit 8, and
The threshold addresses of the pixels in the rectangular area having the point as the diagonal are sequentially calculated and rewritten with the new threshold. Therefore, CRT
An actual image is displayed on the display unit 14, an area is set on this image, and a threshold value of a pixel in the area can be set according to the brightness on the image. In addition to the above, it is possible to easily eliminate an image of a portion unnecessary for the head inspection of the screw 4. At this time, a binarized image based on the new threshold value may be displayed on the CRT display unit 14.

【0027】一方、前記入力部9から検査モード指令信
号およびモータ駆動指令信号が出力されると、搬送ベル
ト2によりねじ4がCCDカメラ3の前方を通過する。
ねじ4がCCDカメラ3の前方位置に達し、センサがこ
れを検出すると、ストロボ駆動フラグと画像取り込みフ
ラグがセットされ、しきい値設定モードの場合と同様に
ストロボ5aから光が照射される。同時に、ねじ4の頭
部のシルエットがCCDカメラ3により取り込まれて、
各画素ごとのアナログ電圧としてCCDカメラインタフ
ェイス11に出力される。前記アナログ電圧値から各画
素ごとの輝度値が算出され、この輝度値が制御部7から
選択部11eへの選択指令信号により選択される固定の
しきい値あるいは各画素ごとのしきい値との比較により
二値化データに変換される。さらに、この二値化データ
が各画素ごとにフレームRAM12内の画像アドレスに
記憶され、この二値化データに基づき二値化画像がCR
T表示部14に表示される。この時、図3に示すように
背景画像の照明むらに合わせてしきい値が設定されてい
るため、背景画像の輝度値からほぼ一定の輝度値離れた
すなわちオフセットされた輝度値を基準に二値化データ
を得ることができ、これから得られる二値化画像は光の
回折により生じるねじ4の細りの少ない画像となる。ま
た、ストロボ5aからの光量が不足するようなCCDカ
メラ3の画像の周辺部の画素の輝度値にノイズ分が加わ
っても、背景部分がねじ4の一部として二値化データに
変換されてCRT表示部14上に表示されるようなこと
は皆無となり、画像全面にわたって一定の耐ノイズ性を
もって二値化画像を表示することができる。
On the other hand, when the inspection mode command signal and the motor drive command signal are output from the input unit 9, the screws 4 pass by the conveyor belt 2 in front of the CCD camera 3.
When the screw 4 reaches the position in front of the CCD camera 3 and the sensor detects this, the strobe drive flag and the image capture flag are set, and light is emitted from the strobe 5a as in the threshold setting mode. At the same time, the silhouette of the head of the screw 4 is captured by the CCD camera 3,
The analog voltage is output to the CCD camera interface 11 for each pixel. A luminance value for each pixel is calculated from the analog voltage value, and the luminance value is calculated based on a fixed threshold value selected by the selection command signal from the control unit 7 to the selection unit 11e or a threshold value for each pixel. It is converted into binary data by comparison. Further, the binarized data is stored in an image address in the frame RAM 12 for each pixel, and based on the binarized data, the binarized image is stored in a CR.
It is displayed on the T display unit 14. At this time, as shown in FIG. 3, since the threshold value is set in accordance with the illumination unevenness of the background image, the threshold value is set to a value that is substantially constant, that is, offset from the luminance value of the background image. Binarized data can be obtained, and a binarized image obtained from the binarized data is an image with less thinning of the screw 4 caused by diffraction of light. Also, even if noise is added to the brightness value of the peripheral pixels of the image of the CCD camera 3 where the amount of light from the strobe 5a is insufficient, the background portion is converted to binary data as a part of the screw 4. There is no such thing as being displayed on the CRT display unit 14, and the binarized image can be displayed with constant noise resistance over the entire image.

【0028】また、前記二値化画像がCRT表示部14
に表示されると同時に、フレームRAM12内の二値化
データからねじ4の頭部のシルエットの特徴点が算出さ
れ、あらかじめ設定された基準値と比較され、ねじ4の
頭部形状の良否が判定される。
The binarized image is displayed on a CRT display unit 14.
At the same time, the feature point of the silhouette of the head of the screw 4 is calculated from the binarized data in the frame RAM 12 and compared with a preset reference value to determine whether the head shape of the screw 4 is good or bad. Is done.

【0029】なお、前記各画素のしきい値を決定する場
合、図4に示すようにその周囲の領域にある画素が持つ
輝度値の最大値を選択してこれにノイズ分のオフセット
値を加えた値を新しきい値としてもよい。この場合、ス
トロボからの反射光を受けてCCDカメラが部品の形状
を取り込む際に適しており、特に部品が反射光の光量差
が大きくなるような曲面を持つ部品であると、その形状
を実際の形状に近い二値化画像として表示することがで
きる。
When the threshold value of each pixel is determined, as shown in FIG. 4, the maximum luminance value of the pixels in the surrounding area is selected, and an offset value for noise is added thereto. The new value may be used as the new threshold. In this case, it is suitable when the CCD camera captures the shape of the component by receiving the reflected light from the strobe, and if the component has a curved surface where the difference in the amount of reflected light is large, the shape is actually Can be displayed as a binarized image close to the shape of.

【0030】[0030]

【発明の効果】以上説明したように、本発明は透過光、
反射光に拘わらず部品の形状をCCDカメラで取り込む
際に、CCDカメラの画像を構成する各画素のしきい値
を部品が通過する際の背景画像の明るさに応じて変化さ
せて設定するように構成しているため、部品が通過する
背景画像に照明むらがあっても、その明るさに応じたし
きい値を設定でき、耐ノイズ性を全画素ほぼ一定にでき
る。また、本発明は透過光をCCDカメラが受ける場合
に、部品の形状が光の回折により部品が実際よりも小さ
く認識されたり、またCCDカメラが部品の曲面部で反
射する反射光を受ける場合にはその反射光の光量差が大
きいことにより部品が実際よりも小さく認識されるが、
これを耐ノイズ性を低下させることなく、実際の形状に
できる限り近づけなることができる。さらに、本発明
は、CRT表示部上で任意の領域を設定してその領域内
の画素のしきい値を変更するように構成しているため、
部品の形状の検査に不要な部分の画像の排除が簡単に行
うことができる。
As described above, according to the present invention, transmitted light,
When capturing the shape of a component with a CCD camera irrespective of reflected light, the threshold value of each pixel constituting the image of the CCD camera is changed and set according to the brightness of the background image when the component passes. Therefore, even if there is uneven illumination in the background image through which the parts pass, a threshold value can be set according to the brightness, and the noise resistance can be made substantially constant for all pixels. Further, the present invention is applicable to a case where a CCD camera receives transmitted light, and the shape of the component is recognized as being smaller than the actual shape due to diffraction of light, or when the CCD camera receives reflected light reflected on a curved surface portion of the component. Is recognized as smaller than the actual part due to the large difference in the amount of reflected light,
This can be made as close as possible to the actual shape without reducing the noise resistance. Further, the present invention is configured such that an arbitrary area is set on the CRT display unit and the threshold value of the pixel in the area is changed.
It is possible to easily remove an image of a part unnecessary for the inspection of the shape of the part.

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

【図1】本発明に係る画像処理装置の一例のねじの頭部
形状検査装置の概略構成を示すブロック図である。
FIG. 1 is a block diagram showing a schematic configuration of a screw head shape inspection apparatus as an example of an image processing apparatus according to the present invention.

【図2A】本発明に係る制御部の動作を説明するフロー
チャートである。
FIG. 2A is a flowchart illustrating an operation of a control unit according to the present invention.

【図2B】本発明に係る領域しきい値設定モード時の制
御部の動作を説明するフローチャートである。
FIG. 2B is a flowchart illustrating the operation of the control unit in the area threshold setting mode according to the present invention.

【図3】本発明に係るCCDカメラの画像を構成する画
素一列分の輝度値を示す説明図である。
FIG. 3 is an explanatory diagram showing luminance values of one column of pixels constituting an image of the CCD camera according to the present invention.

【図4】本発明の他の実施例に係るCCDカメラの画像
を構成する画素一列分の輝度値を示す説明図である。
FIG. 4 is an explanatory diagram showing luminance values of one column of pixels constituting an image of a CCD camera according to another embodiment of the present invention.

【図5】従来例に係るCCDカメラの画像を構成する画
素一列分の輝度値を示す説明図である。
FIG. 5 is an explanatory diagram showing luminance values for one column of pixels forming an image of a CCD camera according to a conventional example.

【図6】別の従来例に係るCCDカメラの画像を構成す
る画素一列分の輝度値を示す説明図である。
FIG. 6 is an explanatory diagram showing luminance values for one column of pixels forming an image of a CCD camera according to another conventional example.

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

1 ねじの頭部形状検査装置 2 搬送ベルト 3 CCDカメラ 4 ねじ 5 ストロボ駆動部 5a ストロボ 6 制御装置 7 制御部 8 記憶部 9 入力部 10 部品検出部 11 CCDカメラインタフェイス 11a タイミングパルス発生部 11b A/D変換部 11c 固定しきい値設定部 11d 信号二値化部 11e 選択部 11f アドレス発生部 12 フレームRAM 13 表示コントロール部 14 CRT表示部 DESCRIPTION OF SYMBOLS 1 Inspection device of screw head shape 2 Conveyor belt 3 CCD camera 4 Screw 5 Strobe drive unit 5a Strobe 6 Control unit 7 Control unit 8 Storage unit 9 Input unit 10 Component detection unit 11 CCD camera interface 11a Timing pulse generation unit 11b A / D conversion section 11c fixed threshold value setting section 11d signal binarization section 11e selection section 11f address generation section 12 frame RAM 13 display control section 14 CRT display section

フロントページの続き (56)参考文献 特開 平5−278205(JP,A) 特開 平6−58722(JP,A) 特開 平5−115005(JP,A) 特開 平6−201609(JP,A) 特開 平7−30753(JP,A) 特開 平7−43129(JP,A) (58)調査した分野(Int.Cl.6,DB名) G01B 11/00 - 11/30 G06T 5/00 Continuation of front page (56) References JP-A-5-278205 (JP, A) JP-A-6-58722 (JP, A) JP-A-5-115005 (JP, A) JP-A-6-201609 (JP) , A) JP-A-7-30753 (JP, A) JP-A-7-43129 (JP, A) (58) Fields investigated (Int. Cl. 6 , DB name) G01B 11/00-11/30 G06T 5/00

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 光源からの光を受ける部品の移動路に対
してCCDカメラを配置し、部品がCCDカメラの前方
に位置すると、CCDカメラの画像を構成する各画素の
電圧値とあらかじめ設定されたしきい値とを比較して部
品の形状を二値化データとして認識してこの二値化デー
タに基づいてCRT表示部に部品の形状を表示する画像
処理装置において、 光源作動時の部品がない状態でCCDカメラの各画素の
電圧値を画像の輝度値に変換して一時記憶し、各画素ご
とにその周囲領域内にある画素の輝度値に応じて自身の
しきい値を変更することを特徴とするしきい値設定方
法。
1. A CCD camera is arranged on a moving path of a component receiving light from a light source, and when the component is positioned in front of the CCD camera, a voltage value of each pixel constituting an image of the CCD camera is set in advance. In the image processing apparatus which compares the shape of the component as binarized data by comparing the threshold value with the threshold value and displays the shape of the component on the CRT display based on the binarized data, Convert the voltage value of each pixel of the CCD camera to an image brightness value and temporarily store it in the absence state, and change its own threshold for each pixel according to the brightness value of the pixels in the surrounding area A threshold setting method characterized by the following.
【請求項2】 光源から照射される光を受ける位置にC
CDカメラを配置する一方、各画素ごとに一定周辺領域
内にある画素の輝度値の最小値を基準に自身のしきい値
を設定することを特徴とする請求項1に記載のしきい値
設定方法。
2. C is located at a position for receiving light emitted from a light source.
2. The threshold value setting according to claim 1, wherein the CD camera is arranged, and the threshold value is set for each pixel based on the minimum value of the luminance value of the pixel in a certain peripheral area. Method.
【請求項3】 光源から照射される光の反射光を受ける
位置にCCDカメラを配置する一方、各画素ごとに一定
領域内にある画素の最大値を基準に自身のしきい値を設
定することを特徴とする請求項1に記載のしきい値設定
方法。
3. A method in which a CCD camera is arranged at a position where reflected light of light emitted from a light source is received, and its own threshold value is set for each pixel based on the maximum value of pixels within a certain area. The threshold setting method according to claim 1, wherein
【請求項4】 光源からの光を受ける部品の移動路に対
してCCDカメラを配置し、部品がCCDカメラの前方
に位置すると、CCDカメラの画像を構成する各画素の
電圧値とあらかじめ設定されたしきい値とを比較して部
品の形状を二値化データとして認識してこの二値化デー
タに基づいてCRT表示部に部品の形状を表示する画像
処理装置において、 光源作動時の部品がない状態でのCCDカメラの各画素
の電圧値を画像の輝度値に変換して、この輝度値に基づ
く濃淡画像をCRT表示部に表示し、この濃淡画像上で
の任意の領域設定信号を受けると、その領域内の画素の
しきい値を所望値の入力を待って設定することを特徴と
するしきい値設定方法。
4. A CCD camera is arranged with respect to a moving path of a component receiving light from a light source, and when the component is positioned in front of the CCD camera, a voltage value of each pixel constituting an image of the CCD camera is set in advance. In the image processing apparatus which compares the shape of the component as binarized data by comparing the threshold value with the threshold value and displays the shape of the component on the CRT display based on the binarized data, The voltage value of each pixel of the CCD camera in the absence state is converted into a brightness value of an image, a grayscale image based on the brightness value is displayed on a CRT display unit, and an arbitrary area setting signal on the grayscale image is received. And setting a threshold value of a pixel in the area after inputting a desired value.
JP6096849A 1994-03-29 1994-03-29 Threshold setting method in image processing apparatus Expired - Fee Related JP2889490B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6096849A JP2889490B2 (en) 1994-03-29 1994-03-29 Threshold setting method in image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6096849A JP2889490B2 (en) 1994-03-29 1994-03-29 Threshold setting method in image processing apparatus

Publications (2)

Publication Number Publication Date
JPH07270136A JPH07270136A (en) 1995-10-20
JP2889490B2 true JP2889490B2 (en) 1999-05-10

Family

ID=14175952

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6096849A Expired - Fee Related JP2889490B2 (en) 1994-03-29 1994-03-29 Threshold setting method in image processing apparatus

Country Status (1)

Country Link
JP (1) JP2889490B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008125903A (en) 2006-11-22 2008-06-05 Hamamatsu Photonics Kk Image pickup apparatus
JP5964642B2 (en) * 2012-04-19 2016-08-03 第一高周波工業株式会社 Rebar end measuring device and rebar end measuring method

Also Published As

Publication number Publication date
JPH07270136A (en) 1995-10-20

Similar Documents

Publication Publication Date Title
US6298175B1 (en) Object sensor system comprising controlled light source
EP0312046A2 (en) Apparatus and method for inspecting defect of mounted component with slit light
JP2002357408A (en) Optical measuring device
CA2078374A1 (en) Method for displaying defect and apparatus therefor
JP3181435B2 (en) Image processing apparatus and image processing method
JP2000193601A (en) Surface defect inspecting device
JPH11345085A (en) Pointing position detecting device and method, presentation system and information storage medium
JPH11345087A (en) Presentation system and position detecting method
JP2889490B2 (en) Threshold setting method in image processing apparatus
JPH0979988A (en) Surface defect inspecting device
JP3891697B2 (en) Bending angle detection method and bending angle detection device for press brake
JP2000276297A (en) Device and method for detecting pointing position, presentation system, and information storage medium
JP3985385B2 (en) Surface defect detector
JP2637591B2 (en) Position recognition apparatus and method
JPH0862155A (en) Object 0bserving apparatus
JP3122226B2 (en) Method and apparatus for recognizing outline of sewn object
JP3494518B2 (en) Image recognition device using the light section method
JPH10300446A (en) Surface defect inspection device
JP2936015B2 (en) Surface condition inspection method
JP2924514B2 (en) Cross-sectional shape measuring device
JP2001076148A (en) Method and device for inspecting defect on object surface
JP3740836B2 (en) Three-dimensional shape measuring device
JP3025562B2 (en) Surface condition inspection method using bright and dark illumination
JPH10327312A (en) Image reader
JP3724659B2 (en) Image processing device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees