JP3797586B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP3797586B2
JP3797586B2 JP23864398A JP23864398A JP3797586B2 JP 3797586 B2 JP3797586 B2 JP 3797586B2 JP 23864398 A JP23864398 A JP 23864398A JP 23864398 A JP23864398 A JP 23864398A JP 3797586 B2 JP3797586 B2 JP 3797586B2
Authority
JP
Japan
Prior art keywords
image data
target
threshold value
processing apparatus
image processing
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
JP23864398A
Other languages
Japanese (ja)
Other versions
JP2000067232A (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.)
Nitto Seiko Co Ltd
Original Assignee
Nitto Seiko 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 Nitto Seiko Co Ltd filed Critical Nitto Seiko Co Ltd
Priority to JP23864398A priority Critical patent/JP3797586B2/en
Publication of JP2000067232A publication Critical patent/JP2000067232A/en
Application granted granted Critical
Publication of JP3797586B2 publication Critical patent/JP3797586B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、画像データを2値化処理することにより目標物を認識する画像処理装置に関する。
【0002】
【従来の技術】
近年、製造ライン等において、製品の筐体、部品等の検査や組み立てを行うに際し、例えばベルトコンベアの上を搬送される筐体、部品等を、CCDカメラ等の撮像装置を用いて撮像し、取得された画像データに所定の処理を行うことにより、不良品が発生していないか等の検査を行ったり、実際に組み立てを行ったりする方法が実用化されている。以下、筐体の所定の位置に適切に穴があけられているか否かの検査を行う場合を例として、かかる検査等に用いる従来の画像処理装置について説明する。
【0003】
図4は、上記の従来の画像処理装置について説明するための図であり、検査対象となるガスメータ筐体の一例を示す図である。近年のガスメータは、例えば、地震やガス漏れの発生のため、ガスの供給を停止した場合などにはLEDを点滅させることにより利用者にその旨を認識させるようになっているが、以下では、同図に示すガスメータ筐体900に、LEDの表示窓となる穴901が適切な位置に、また適切な大きさであけられているか否かを検査する場合を例として、従来の画像処理装置の処理内容について説明する。
【0004】
図5は、ガスメータ筐体900の上部の拡大図である。同図に示されるように、穴901の位置及び大きさは、例えばベルトコンベア上を搬送される筐体900を撮像するカメラのカメラ中心を原点とする座標系において、穴901の中心Cの座標と、X軸方向の半径xr、Y軸方向の半径yrを求めることにより特定することができる。そこで、例えばマスタとなる筐体を用いて穴901の位置及び大きさを記憶しておき、他の筐体については、マスタの穴901の位置からのずれ等を得ることにより、上記検査を行うことができる。
【0005】
ここで、穴901の中心及び半径を求めるためには、穴901の周辺から取得された画像データを2値化することによる方法が一般的である。即ち、筐体900から取得した画像データにおいて、所定位置に、所定の大きさのウィンドウWを設定する。
【0006】
このウィンドウWは、当該範囲内の画像データが以後の処理の対象となることを意味するものであり、2値化処理を行うことにより穴901の存在範囲が判別可能となるように設定する。即ち、ウィンドウWの範囲内に穴901の存在範囲を全て含み、かつ、筐体900及び穴901以外の部分を含まないようにする必要がある。ウィンドウWの位置及び大きさについては、例えば、左上頂点(図中のM)の位置と縦横各辺の長さを、筐体900に合わせて予め設定しておく。
【0007】
その後、ウィンドウWの範囲内の画像データを2値化する。2値化処理を行うには閾値を決定する必要があるが、閾値の決定方法として、固定した閾値を用いる方法の他、従来より種々の自動閾値決定方法が考案されている。
【0008】
例えば、上述のように製造ライン等に用いられる画像処理装置における自動閾値決定方法としては、「大津の方法」と称される公知の方法を利用することができる。大津の方法については、“画像解析ハンドブック(高木幹雄、下田陽久監修、東京大学出版会(503ページ))"に詳細に説明されているが、以下に簡単に説明する。
【0009】
大津の方法は、判別分析法ともよばれる方法であり、画像データから濃度ヒストグラムを取得し、ある閾値によって当該濃度ヒストグラムを2クラスに分割した場合のクラス間分散σB 2(k)が最大になる閾値k*を選ぶという原理に基づく方法である。
【0010】
ここで、クラス間分散σB 2(k)は、下記の(式1)で表すことができる。
【0011】
【数1】

Figure 0003797586
【0012】
また、上記に示した式において、Piとは、niを濃度ヒストグラムにおけるレベルiの画素の数、Nを全画素数とした場合に、pi=ni/Nで表される数値を意味する。即ち、濃度レベルを[1,2,3,…,L]とし、画素をレベル[1,k]と、レベル[k+1,L]の2クラスに分割するとした場合に、クラス間分散σB 2(k)を最大とするkを閾値として決定する。
【0013】
大津の方法等を用いて閾値を決定した後は、決定された閾値を用いて、ウィンドウWの範囲内の画像データを2値化する。2値化された画像データにおいては、筐体900の部分が白、穴901の部分が黒の画素で表されるため、上述の図5で説明したような、穴901の中心Cの位置及び半径を取得することができる。
【0014】
さらに、取得された結果から、筐体900の所定の位置に、適切な大きさの穴901があけられているか否かを判定することが可能である。
【0015】
【発明が解決しようとする課題】
しかしながら、上記従来の画像処理装置では、筐体900の適切な位置に、適切な大きさの穴901があけられているか否かについては検査することができるが、当該穴901の中の適切な位置にLEDが設置されているか否かまでを一度の処理で検査することができず、検査の効率が悪いという問題点を有していた。
【0016】
即ち、2値化された画像データでは、穴901の中に存在するLEDのような目標物は、穴901の中に隠れてしまい、もはや識別できないからである。これは、上記のようにガスメータの検査に用いる場合だけでなく、画像データから複数の目標物を順次識別しようとした場合に、一般的に発生する問題である。
【0017】
本発明は、上記問題点に鑑み、複数の目標物を含む画像データから、効率よく当該複数の目標物を識別することができる画像処理装置を提供することを目的とする。
【0018】
【課題を解決するための手段】
上記課題を解決するために、本発明の画像処理装置は、画像データを2値化処理することにより目標物を認識する画像処理装置であって、第1の閾値を用いて2値化処理した画像データから、第1の目標物が認識された場合に、当該第1の目標物が存在する範囲内の2値化処理前の画像データを抽出し、抽出した画像データから第2の閾値を求め、抽出した画像データを、前記第2の閾値を用いて2値化処理するようにしたこと特徴とする。
【0019】
さらに、前記画像処理装置は、第2の目標物が認識された場合に、さらに全ての目標物が認識されるまで2値化処理前の画像データから新たな閾値を求め、新たな閾値を用いて2値化処理を繰り返し実行する機能を有することが好ましい。このようにすることにより、目標物が三つ以上あるような場合でも容易に対応することができる。ここで、複数の閾値の大小関係については、目標物によって種々の場合が考えられ、必ずしも一定の大小関係を有するべきものではない。
【0021】
また、前記画像処理装置はさらに、認識された目標物に関する情報を出力する出力手段を有することもできる。ここで出力する情報としては、位置、大きさ、形状等種々考えられ、認識された目標物に対するその後の処理を円滑にすることができる。
【0022】
【発明の実施の形態】
以下、本発明に係る画像処理装置の実施の形態について図面を参照しながら説明する。図1は、本発明に係る画像処理装置の一適用例としての検査システムの構成の一例を示す図である。
【0023】
同図に示されるように、本実施の形態の検査システムは、本発明に係る画像処理装置1及びCCDカメラ2から構成され、CCDカメラ2にはストロボ3が付属して備えられている。同図において、90は、上述のガスメータの如き検査対象物、91は、本発明に係る画像処理装置における第1の目標物(本実施の形態では、筐体に開けられた穴)、92は、本発明に係る画像処理装置における第2の目標物(本実施の形態では、所定の位置に設置されるべきLED)を表している。
【0024】
本実施の形態の画像処理装置1は、ストロボ制御部101、CCDカメラインタフェース102、第1フレームRAM103、第2フレームRAM104、ROM105、操作部106、表示部107、制御部100を含み、各部はインタフェースバス109にて接続されている。
【0025】
ストロボ制御部101は、CCDカメラ2に付属するストロボ3の発光を制御する。CCDカメラインタフェース102は、CCDカメラ2から、検査対象物90を撮像して得た画像データを取得する。
【0026】
第1フレームRAM103には、制御部100による2値化処理の前の画像データが格納され、第2フレームRAM104には、2値化処理後の画像データが格納される。2値化処理の詳細、及び第1フレームRAM103、第2フレームRAM104に格納される画像データの内容の詳細等に関しては後述する。
【0027】
ROM105には、本発明に係る画像処理装置を実現するために、制御部100で実行されるべきプログラム等の情報が格納されている。操作部106としては、本実施の形態の検査システムの操作に用いる液晶パネル、スイッチ等が設置され、操作部106を介して入力された内容に対応した情報や、システムの動作状況等、種々の情報が表示部107に表示される。表示部107としては、液晶ディスプレイ等種々の表示装置を用いることができる。
【0028】
図2は、本実施の形態における制御部100の処理内容を示すフローチャートである。同図に示されるように、制御部100は、まず、CCDカメラ2の駆動を指令し、CCDカメラインタフェース102を介して、検査対象物90の画像データを取得する(S201)。取得された画像データは、第1フレームRAM103に記憶される。
【0029】
次に、第1フレームRAM103上において、上述の如く、所定の範囲のウィンドウを設定し、当該ウィンドウの範囲内の画像データを2値化するための閾値(以下、「第1の閾値」という。)を決定する(S202)。ここで、閾値の自動的な決定方法としては、上述の大津の方法の他、モード法、p−タイル法、微分ヒストグラム法等、種々の方法を用いることが可能である。
【0030】
第1の閾値が決定されると、当該第1の閾値を用いて、第1フレームRAM103に記憶された所定の範囲内の画像データを2値化し、2値化された画像データを第2フレームRAM104に格納する(S203)。図3(a)に、第1の閾値を用いて2値化された画像データの内容の一例を示す。同図の例では、筐体90の部分が白、穴91の部分が黒となり、上述したように穴の位置や半径に関する情報を取得することが可能となっている。
【0031】
制御部100は、第2フレームRAM104に記憶された2値化された画像データから、第1の目標物が発見できたか否かを判定する(S204)。具体的には、穴91の中心が所定の位置にあるか、半径は所定の範囲内にあるか等を判定し、検査を行う。
【0032】
穴の形状が円であるか否かの判定には、真円度と呼ばれる数値を用いることができる。真円度とは、形状がどの程度円に近いかを数値化した値であり、具体的には、円の面積をA、周囲の長さをPとすると、(4πA)/(P2)(%)で表される。
【0033】
本実施の形態では、第1の目標物は、穴91であるが、穴に限らず種々の物に適用することが可能である。目標物が発見できたか否かの判定は、その目標物に対応して、種々の方法を用いることができる。
【0034】
制御部100は、第1の目標物が発見できない場合(S204:No)には、エラーを出力し(S205)、処理を終了する。第1の目標物が発見された場合には(S204:Yes)、第2の目標物を認識すべく、第1の目標物の存在位置及び大きさ等に関する情報を取得する(S206)。これらの情報は、ステップS203で第1の目標物を識別する際に既に取得されているのが通常であるから、それらの中から、第2の目標物の識別に必要な情報を設定する。
【0035】
上述の情報を設定すると、第1フレームRAM103に記憶されている2値化前の画像データにおいて、第1の目標物の存在範囲内であって、第1の目標物の大きさより少し小さい範囲の画像データを抽出し、ステップS202と同様の方法により、当該範囲内の画像データを2値化するための閾値(以下、「第2の閾値」という。)を求める(S207)。具体的には、図3(a)にて黒の画素で表される穴91の範囲より少し小さい範囲に対応する2値化処理前の画像データを抽出し、抽出された画像データから第2の閾値を求める。なお、本実施の形態では、第1の目標物の存在範囲より少し小さい範囲に対応する画像データを抽出するようにしたが、2値化処理後の画像データにおいて目標物を表す黒画素に対応する範囲を全て抽出するようにしてもよい。
【0036】
第2の閾値が求まると、当該第2の閾値を用いて、ステップS207にて抽出された2値化前の画像データの2値化を行い、第2フレームRAM104に格納する(S208)。図3(b)に、本ステップでの2値化処理の結果の一例を示す。制御部100は、本ステップにおいて第2フレームRAM104に記憶された2値化された画像データから、第1の目標物の範囲内に、第2の目標物が発見できたか否かを判定する(S209)。本実施の形態では、第2の目標物とは、穴91の内部に存在するLED92を指す。ここでの目標物が発見できたか否かの判定は、LED92の形状等を予め設定されている値と比較することなどにより行うことができる。
【0037】
第2の目標物が発見できない場合(S209:No)には、ステップS205へと進み、エラーを出力して処理を終了する。第2の目標物が発見できた場合には(S209:Yes)、当該第2の目標物の存在位置、大きさ等に関する情報を取得する(S210)。ここでは、座標だけを取得してもよいし、大きさだけ取得するようにしてもよい。その後、制御部100は、取得した情報を出力する(S211)。具体的には、取得した情報をロボットなどの外部機器に出力して、穴91にキャップを挿入する処理などを必要に応じて行うように制御することができる。なお、ここで、制御部100は、ステップS210で取得した情報を特に外部に出力せず、例えば、LED92が所定の位置に設置されているか等の検査処理を行うようにすることもできる。
【0038】
以上に説明したように、本発明の画像処理装置を用いることにより、複数の目標物を効率的に識別することが可能となる。なお、本実施の形態では、目標物が2つ(穴91及びLED92)である場合について説明したが、目標物が3つ以上ある場合でも、例えば、図2のフローチャートにおけるステップS206からS208までの処理を繰り返すことにより容易に対応することができる。
【0039】
また、本実施の形態では、大津の方法を用いた閾値の自動決定について説明したが、前述の如く閾値の自動決定法は種々考案されているので、当該決定の方法も目標物の特徴等に応じて変更すれば、より認識の精度を上げることも可能である。一方、システム全体の設置環境等によっては、閾値を固定値とすることで処理効率を上げるようにすることもできる。
【0040】
また、本実施の形態では、毎回閾値の決定を行っているが、同一の目標物について一旦閾値が決定された際には、当該閾値を記憶しておき、以後の閾値決定処理を省略するようにしてもよい。
【0041】
また、本実施の形態では、一度取得された画像データは第1フレームRAM103に記憶することにより、処理効率の向上を図っているが、目標物の形態によっては、目標物を発見しようとする際や、閾値を決定しようとする際などに、再度CCDカメラ等を駆動させて、画像データを取得しなおすようにすることも可能である。
【0042】
さらに、2値化処理に際しては、状況に応じてルックアップテーブル(LUT)等を利用し、処理を高速にすることもできる。また、2値化処理の後には、膨張、収縮処理などにより画像ノイズを取り除くようにしてもよい。
【0043】
【発明の効果】
以上に説明したように、本発明の画像処理装置によれば、第1の閾値を用いて2値化処理した画像データから、第1の目標物が認識された場合に、当該第1の目標物が存在する範囲に対応する2値化処理前の画像データを、第2の閾値を用いて2値化処理するようにしているので、複数の目標物を含む画像データから、効率よく当該複数の目標物を識別することが可能になるという効果を奏する。
【0044】
さらに、前記第2の閾値を用いて2値化された画像データから、第2の目標物が認識された場合に、さらに全ての目標物が認識されるまで2値化処理前の画像データの2値化処理を繰り返し実行する機能を有することにより、目標物が三つ以上あるような場合でも容易に対応することができるという効果を奏する。
【0046】
また、認識された目標物に関する情報を出力する出力手段を有することにより、認識された目標物に対するその後の処理を円滑に行えるようにすることができるという効果がある。
【図面の簡単な説明】
【図1】本発明に係る画像処理装置の一適用例としての検査システムの構成の一例を示す図である。
【図2】本実施の形態における制御部の処理内容を示すフローチャートである。
【図3】2値化処理された画像データの内容の一例を示す図である。
【図4】従来の画像処理装置の処理内容について説明するための図である。
【図5】従来の画像処理装置の処理内容について説明するための図である。
【符号の説明】
1 画像処理装置
2 CCDカメラ
3 ストロボ
91 穴
92 LED
100 制御部
101 ストロボ制御部
102 CCDカメラインタフェース
103 第1フレームRAM
104 第2フレームRAM
105 ROM
106 操作部
107 表示部
109 インタフェースバス[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus that recognizes a target by binarizing image data.
[0002]
[Prior art]
In recent years, when inspecting and assembling product casings and parts in a production line, for example, the casings and parts transported on a belt conveyor are imaged using an imaging device such as a CCD camera, A method of inspecting whether or not a defective product has occurred by performing predetermined processing on the acquired image data or actually assembling has been put into practical use. Hereinafter, a conventional image processing apparatus used for such an inspection will be described by taking as an example the case of performing an inspection as to whether or not a hole is appropriately drilled at a predetermined position of the housing.
[0003]
FIG. 4 is a diagram for explaining the above-described conventional image processing apparatus, and is a diagram illustrating an example of a gas meter casing to be inspected. In recent years, for example, when gas supply is stopped due to the occurrence of an earthquake or gas leak, the gas meter is made to recognize that effect by blinking the LED, but in the following, In the case of inspecting whether or not a hole 901 serving as an LED display window is opened at an appropriate position and with an appropriate size in the gas meter casing 900 shown in FIG. Processing contents will be described.
[0004]
FIG. 5 is an enlarged view of the upper portion of the gas meter housing 900. As shown in the figure, the position and size of the hole 901 are, for example, the coordinates of the center C of the hole 901 in the coordinate system having the camera center of the camera that images the housing 900 conveyed on the belt conveyor as the origin. And by determining the radius xr in the X-axis direction and the radius yr in the Y-axis direction. Therefore, for example, the position and size of the hole 901 are stored using a housing serving as a master, and the above inspection is performed on other housings by obtaining a deviation from the position of the hole 901 in the master. be able to.
[0005]
Here, in order to obtain the center and radius of the hole 901, a method by binarizing image data acquired from the periphery of the hole 901 is generally used. That is, a window W having a predetermined size is set at a predetermined position in the image data acquired from the casing 900.
[0006]
This window W means that the image data in the range is a target of subsequent processing, and is set so that the existence range of the hole 901 can be determined by performing binarization processing. That is, it is necessary to include the entire existence range of the hole 901 within the range of the window W and not to include a part other than the casing 900 and the hole 901. As for the position and size of the window W, for example, the position of the upper left vertex (M in the figure) and the lengths of the vertical and horizontal sides are set in advance according to the casing 900.
[0007]
Thereafter, the image data within the window W is binarized. In order to perform binarization processing, it is necessary to determine a threshold value. As a method for determining a threshold value, various automatic threshold value determination methods have been devised in addition to a method using a fixed threshold value.
[0008]
For example, as described above, as an automatic threshold value determining method in an image processing apparatus used in a production line or the like, a known method called “Otsu's method” can be used. The method of Otsu is described in detail in “Image Analysis Handbook (supervised by Mikio Takagi, Yohisa Shimoda, University of Tokyo Press (page 503))”, but will be briefly described below.
[0009]
Otsu's method is also called a discriminant analysis method. When a density histogram is obtained from image data and the density histogram is divided into two classes according to a certain threshold, the interclass variance σ B 2 (k) is maximized. This is a method based on the principle of selecting a threshold value k * .
[0010]
Here, the interclass variance σ B 2 (k) can be expressed by the following (formula 1).
[0011]
[Expression 1]
Figure 0003797586
[0012]
Further, in the above indicated formula, and P i, the number of pixels of level i a n i in the concentration histogram, when the N was the total number of pixels, a numerical value represented by p i = n i / N means. That is, when the density level is [1, 2, 3,..., L] and the pixel is divided into two classes of level [1, k] and level [k + 1, L], the interclass variance σ K that maximizes B 2 (k) is determined as a threshold value.
[0013]
After the threshold is determined using the Otsu method or the like, the image data within the window W is binarized using the determined threshold. In the binarized image data, the housing 900 portion is represented by white pixels and the hole 901 portions are represented by black pixels. Therefore, the position of the center C of the hole 901 and the position described above with reference to FIG. The radius can be obtained.
[0014]
Furthermore, it is possible to determine whether or not an appropriately sized hole 901 is made at a predetermined position of the housing 900 from the obtained result.
[0015]
[Problems to be solved by the invention]
However, in the conventional image processing apparatus, it is possible to inspect whether or not a hole 901 having an appropriate size is formed at an appropriate position of the casing 900, but an appropriate one in the hole 901 can be inspected. Whether or not the LED is installed at the position cannot be inspected by a single process, and there is a problem that the inspection efficiency is poor.
[0016]
That is, in the binarized image data, a target such as an LED existing in the hole 901 is hidden in the hole 901 and can no longer be identified. This is a problem that generally occurs not only when the gas meter is used for inspection as described above but also when a plurality of targets are sequentially identified from the image data.
[0017]
In view of the above problems, an object of the present invention is to provide an image processing apparatus that can efficiently identify a plurality of targets from image data including the plurality of targets.
[0018]
[Means for Solving the Problems]
In order to solve the above problems, an image processing apparatus of the present invention is an image processing apparatus that recognizes a target by performing binarization processing on image data, and binarization processing is performed using a first threshold value. When the first target is recognized from the image data, image data before binarization processing within the range where the first target exists is extracted, and the second threshold value is extracted from the extracted image data. The obtained and extracted image data is binarized using the second threshold value.
[0019]
Furthermore, when the second target is recognized, the image processing apparatus obtains a new threshold value from the image data before binarization processing until all the target items are recognized , and uses the new threshold value. it preferably has a function of repeatedly executing binarization Te. By doing in this way, even when there are three or more targets, it can be easily handled. Here, regarding the magnitude relationship between the plurality of threshold values, various cases are conceivable depending on the target, and it should not necessarily have a certain magnitude relationship.
[0021]
The image processing apparatus may further include output means for outputting information related to the recognized target. As the information to be output here, various positions, sizes, shapes, and the like are conceivable, and subsequent processing on the recognized target can be made smooth.
[0022]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of an image processing apparatus according to the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing an example of the configuration of an inspection system as an application example of an image processing apparatus according to the present invention.
[0023]
As shown in the figure, the inspection system of the present embodiment includes an image processing apparatus 1 and a CCD camera 2 according to the present invention, and the CCD camera 2 is provided with a strobe 3 attached thereto. In the figure, 90 is an inspection object such as the above-mentioned gas meter, 91 is a first target in the image processing apparatus according to the present invention (in this embodiment, a hole opened in the housing), and 92 is The second target in the image processing apparatus according to the present invention (in this embodiment, an LED to be installed at a predetermined position) is shown.
[0024]
The image processing apparatus 1 according to the present embodiment includes a strobe control unit 101, a CCD camera interface 102, a first frame RAM 103, a second frame RAM 104, a ROM 105, an operation unit 106, a display unit 107, and a control unit 100. They are connected by a bus 109.
[0025]
The strobe controller 101 controls the light emission of the strobe 3 attached to the CCD camera 2. The CCD camera interface 102 acquires image data obtained by imaging the inspection object 90 from the CCD camera 2.
[0026]
The first frame RAM 103 stores image data before binarization processing by the control unit 100, and the second frame RAM 104 stores image data after binarization processing. Details of the binarization processing and details of the contents of the image data stored in the first frame RAM 103 and the second frame RAM 104 will be described later.
[0027]
The ROM 105 stores information such as a program to be executed by the control unit 100 in order to realize the image processing apparatus according to the present invention. As the operation unit 106, a liquid crystal panel, a switch, and the like used for the operation of the inspection system according to the present embodiment are installed. Information is displayed on the display unit 107. As the display unit 107, various display devices such as a liquid crystal display can be used.
[0028]
FIG. 2 is a flowchart showing the processing contents of the control unit 100 in the present embodiment. As shown in the figure, the control unit 100 first commands the driving of the CCD camera 2 and acquires the image data of the inspection object 90 via the CCD camera interface 102 (S201). The acquired image data is stored in the first frame RAM 103.
[0029]
Next, on the first frame RAM 103, as described above, a window within a predetermined range is set, and a threshold value for binarizing image data within the window range (hereinafter referred to as “first threshold value”). ) Is determined (S202). Here, as a method for automatically determining a threshold value, various methods such as a mode method, a p-tile method, a differential histogram method, and the like can be used in addition to the method of Otsu described above.
[0030]
When the first threshold is determined, image data within a predetermined range stored in the first frame RAM 103 is binarized using the first threshold, and the binarized image data is converted into the second frame. The data is stored in the RAM 104 (S203). FIG. 3A shows an example of the content of the image data binarized using the first threshold value. In the example shown in the figure, the housing 90 is white and the hole 91 is black, and it is possible to acquire information on the position and radius of the hole as described above.
[0031]
The control unit 100 determines whether or not the first target has been found from the binarized image data stored in the second frame RAM 104 (S204). Specifically, it is determined whether or not the center of the hole 91 is at a predetermined position, the radius is within a predetermined range, and the like are inspected.
[0032]
A numerical value called roundness can be used to determine whether or not the shape of the hole is a circle. The roundness is a numerical value indicating how close the shape is to a circle. Specifically, when the area of the circle is A and the circumference is P, (4πA) / (P 2 ) (%)
[0033]
In the present embodiment, the first target is the hole 91, but is not limited to the hole and can be applied to various objects. Various methods can be used to determine whether or not a target has been found in correspondence with the target.
[0034]
When the first target cannot be found (S204: No), the control unit 100 outputs an error (S205) and ends the process. When the first target is found (S204: Yes), information on the position and size of the first target is acquired to recognize the second target (S206). Since these pieces of information are usually already acquired when the first target is identified in step S203, information necessary for identifying the second target is set from them.
[0035]
When the above information is set, the pre-binarized image data stored in the first frame RAM 103 is within the range of the first target and is slightly smaller than the size of the first target. Image data is extracted, and a threshold (hereinafter referred to as “second threshold”) for binarizing the image data in the range is obtained by the same method as in step S202 (S207). Specifically, image data before binarization processing corresponding to a range slightly smaller than the range of the hole 91 represented by black pixels in FIG. 3A is extracted, and second image data is extracted from the extracted image data. The threshold value is obtained. In this embodiment, image data corresponding to a range slightly smaller than the range where the first target is present is extracted, but it corresponds to a black pixel representing the target in the binarized image data. You may make it extract all the ranges to perform.
[0036]
When the second threshold value is obtained, the image data before binarization extracted in step S207 is binarized using the second threshold value and stored in the second frame RAM 104 (S208). FIG. 3B shows an example of the result of the binarization process in this step. The control unit 100 determines whether or not the second target has been found within the range of the first target from the binarized image data stored in the second frame RAM 104 in this step ( S209). In the present embodiment, the second target refers to the LED 92 existing inside the hole 91. Whether or not the target has been found can be determined by comparing the shape or the like of the LED 92 with a preset value.
[0037]
If the second target cannot be found (S209: No), the process proceeds to step S205, an error is output, and the process ends. If the second target is found (S209: Yes), information on the location, size, etc. of the second target is acquired (S210). Here, only the coordinates may be acquired, or only the size may be acquired. Thereafter, the control unit 100 outputs the acquired information (S211). Specifically, the acquired information can be output to an external device such as a robot, and the process of inserting a cap into the hole 91 can be controlled as necessary. Here, the control unit 100 can also perform an inspection process such as whether the LED 92 is installed at a predetermined position without outputting the information acquired in step S210 to the outside.
[0038]
As described above, a plurality of targets can be efficiently identified by using the image processing apparatus of the present invention. In the present embodiment, the case where there are two targets (hole 91 and LED 92) has been described. However, even when there are three or more targets, for example, steps S206 to S208 in the flowchart of FIG. It can be easily handled by repeating the process.
[0039]
In this embodiment, the automatic threshold value determination using the Otsu method has been described. However, as described above, various threshold value automatic determination methods have been devised. If it is changed accordingly, the recognition accuracy can be increased. On the other hand, depending on the installation environment of the entire system, the processing efficiency can be increased by setting the threshold value to a fixed value.
[0040]
In this embodiment, the threshold value is determined every time. However, when the threshold value is once determined for the same target, the threshold value is stored, and the subsequent threshold value determination process is omitted. It may be.
[0041]
Further, in the present embodiment, the image data once acquired is stored in the first frame RAM 103 to improve the processing efficiency. However, depending on the form of the target, when trying to find the target Alternatively, when the threshold value is to be determined, the CCD camera or the like can be driven again to acquire the image data again.
[0042]
Furthermore, in the binarization process, a look-up table (LUT) or the like can be used depending on the situation to speed up the process. Further, after the binarization processing, image noise may be removed by expansion and contraction processing.
[0043]
【The invention's effect】
As described above, according to the image processing apparatus of the present invention, when the first target is recognized from the image data binarized using the first threshold, the first target Since the image data before binarization processing corresponding to the range in which the object exists is binarized using the second threshold value, the plurality of the data can be efficiently obtained from the image data including a plurality of targets. It is possible to identify the target object.
[0044]
Further, when the second target is recognized from the image data binarized using the second threshold, the image data before binarization processing is further processed until all the targets are recognized. By having the function of repeatedly executing the binarization process, it is possible to easily cope with a case where there are three or more targets.
[0046]
In addition, by providing an output unit that outputs information about the recognized target, there is an effect that the subsequent processing on the recognized target can be smoothly performed.
[Brief description of the drawings]
FIG. 1 is a diagram showing an example of a configuration of an inspection system as an application example of an image processing apparatus according to the present invention.
FIG. 2 is a flowchart showing processing contents of a control unit in the present embodiment.
FIG. 3 is a diagram illustrating an example of the content of binarized image data.
FIG. 4 is a diagram for explaining processing contents of a conventional image processing apparatus.
FIG. 5 is a diagram for explaining processing contents of a conventional image processing apparatus.
[Explanation of symbols]
1 Image processing device 2 CCD camera 3 Strobe 91 Hole 92 LED
100 Control Unit 101 Strobe Control Unit 102 CCD Camera Interface 103 First Frame RAM
104 Second frame RAM
105 ROM
106 Operation unit 107 Display unit 109 Interface bus

Claims (3)

画像データを2値化処理することにより目標物を認識する画像処理装置であって、
第1の閾値を用いて2値化処理した画像データから、第1の目標物が認識された場合に、当該第1の目標物が存在する範囲内の2値化処理前の画像データを抽出し、抽出した画像データから第2の閾値を求め、抽出した画像データを、前記第2の閾値を用いて2値化処理するようにしたことを特徴とする画像処理装置。
An image processing apparatus for recognizing a target by binarizing image data,
When the first target is recognized from the image data binarized using the first threshold , image data before binarization within the range where the first target exists is extracted. Then, a second threshold value is obtained from the extracted image data, and the extracted image data is binarized using the second threshold value.
前記画像処理装置は、
前記第2の閾値を用いて2値化された画像データから、第2の目標物が認識された場合に、さらに全ての目標物が認識されるまで2値化処理前の画像データから新たな閾値を求め、新たな閾値を用いて2値化処理を繰り返し実行する機能を有することを特徴とする請求項1に記載の画像処理装置。
The image processing apparatus includes:
When the second target is recognized from the image data binarized using the second threshold value, a new image is obtained from the image data before the binarization process until all the targets are further recognized. The image processing apparatus according to claim 1, wherein the image processing apparatus has a function of obtaining a threshold value and repeatedly executing the binarization process using the new threshold value .
前記画像処理装置はさらに、
認識された目標物に関する情報を出力する出力手段を有することを特徴とする請求項1、2の何れかに記載の画像処理装置。
The image processing apparatus further includes:
The image processing apparatus according to claim 1 , further comprising an output unit that outputs information about the recognized target.
JP23864398A 1998-08-25 1998-08-25 Image processing device Expired - Fee Related JP3797586B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23864398A JP3797586B2 (en) 1998-08-25 1998-08-25 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23864398A JP3797586B2 (en) 1998-08-25 1998-08-25 Image processing device

Publications (2)

Publication Number Publication Date
JP2000067232A JP2000067232A (en) 2000-03-03
JP3797586B2 true JP3797586B2 (en) 2006-07-19

Family

ID=17033194

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23864398A Expired - Fee Related JP3797586B2 (en) 1998-08-25 1998-08-25 Image processing device

Country Status (1)

Country Link
JP (1) JP3797586B2 (en)

Also Published As

Publication number Publication date
JP2000067232A (en) 2000-03-03

Similar Documents

Publication Publication Date Title
EP1970839B1 (en) Apparatus, method, and program for face feature point detection
EP3176751B1 (en) Information processing device, information processing method, computer-readable recording medium, and inspection system
CN111507958A (en) Target detection method, training method of detection model and electronic equipment
JP5010207B2 (en) Pattern inspection apparatus and semiconductor inspection system
US20210272272A1 (en) Inspection support apparatus, inspection support method, and inspection support program for concrete structure
CN111351789B (en) Method, system and electronic device for detecting/maintaining equipment
CN116337868B (en) Surface defect detection method and detection system
CN115641332A (en) Method, device, medium and equipment for detecting product edge appearance defects
JP3265595B2 (en) Image processing method and apparatus
CN112802017A (en) Method and device for detecting product external qualification based on workbench
CN109257594B (en) Television delivery detection method and device and computer readable storage medium
JP3797586B2 (en) Image processing device
CN115984185A (en) Paper towel package defect detection method, device and system and storage medium
CN115311237A (en) Image detection method and device and electronic equipment
CN111935480B (en) Detection method for image acquisition device and related device
CN111046878B (en) Data processing method and device, computer storage medium and computer
JPH02251714A (en) Method for inspecting polarity of mounted polar part and visual inspection method for mounting board
JPH0718812B2 (en) Foreign object detection method
CN112967224A (en) Electronic circuit board detection system, method and medium based on artificial intelligence
JPH06109446A (en) Inspection apparatus for wiring pattern
JP2004110543A (en) Face image processing unit and program
JP2020003452A (en) Inspection device, method for inspection, and program for inspection device
JPH0310107A (en) Inspecting method utilizing gradation pattern matching
JPH0797410B2 (en) Image processing method
JP5505953B2 (en) Image discrimination system, method and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040728

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060124

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060315

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060411

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060414

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees