JP3887807B2 - Image measuring device - Google Patents

Image measuring device Download PDF

Info

Publication number
JP3887807B2
JP3887807B2 JP31005897A JP31005897A JP3887807B2 JP 3887807 B2 JP3887807 B2 JP 3887807B2 JP 31005897 A JP31005897 A JP 31005897A JP 31005897 A JP31005897 A JP 31005897A JP 3887807 B2 JP3887807 B2 JP 3887807B2
Authority
JP
Japan
Prior art keywords
point
edge
image
coordinates
measurement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP31005897A
Other languages
Japanese (ja)
Other versions
JPH11132740A (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.)
Nikon Corp
Original Assignee
Nikon Corp
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 Nikon Corp filed Critical Nikon Corp
Priority to JP31005897A priority Critical patent/JP3887807B2/en
Publication of JPH11132740A publication Critical patent/JPH11132740A/en
Application granted granted Critical
Publication of JP3887807B2 publication Critical patent/JP3887807B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Length Measuring Devices With Unspecified Measuring Means (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、画像計測装置に係り、更に詳しくは対象物の画像情報から対象物の輪郭上の複数点を検出し、これに基づいて形状認識やその他の計測処理を行う画像計測装置に関する。
【0002】
【従来の技術】
工業や医療の分野で用いられる画像計測装置では、撮像して得た対象物の画像をディスプレイの表示画面に表示するだけでなく、対象物の画像情報から対象物の輪郭上の複数点を抽出し、それに基づいて計測処理を行うようになっている。特に、画像情報から対象物の輪郭即ちエッジを検出するエッジ検出処理は、画像から長さ、面積測定等の様々な計測処理を行う前提となるので、これらの処理に先立って行う必要がある。
【0003】
エッジ検出用の計測処理プログラムの一つに、キャリパーツールと呼ばれる計測処理プログラムがある。このキャリパーツールでは、対象物の画像のエッジ(輪郭)の一部の上にエッジ検出の対象となる所定の小さな範囲を設定すると共に、その範囲にあるエッジ上の点の座標を自動的に検出するようになっている。
【0004】
【発明が解決しようとする課題】
しかしながら、上述したキャリパーツールによる測定では、オペレータが画面上に表示されるエッジ検出の対象範囲、位置及び方向を示すエッジ位置検出領域のマーク(目印)であるキャリパを、マウスでつかみ対象物の画像のうち測定したい箇所に移動し、エッジの方向に応じてキャリパの傾き(方向)をその都度マウスで指示することにより、エッジ検出の対象となる上記所定の範囲を画像のエッジ上に設定する必要があった。このため、キャリパをマウスでつかむ動作や測定箇所への移動、エッジの方向に応じてキャリパの方向を変える操作が必要不可欠となり、操作が煩わしくなる原因となっていた。
【0005】
本発明は、かかる事情の下になされたもので、その目的はより簡単な操作でエッジ検出を行うことができる画像計測装置を提供することにある。
【0006】
【課題を解決するための手段】
請求項1に記載の発明は、計測対象物(10)の像を撮像して得られた画像情報(51B)を用いて前記計測対象物(10)の形状を計測する画像計測装置であって、前記画像情報を記憶するメモリ(41D)と;前記画像情報に対応する画像を表示画面上に表示する画像表示装置(43)と;前記表示画面上に表示された画像に対して計測箇所の近傍の点の指示を入力するための点入力手段(42b、53B)と;前記メモリ(41D)内の画像情報(51B)に含まれる各画素の位置情報と階調情報とに基づいて、前記点入力手段(42b、53B)により指示された点の近傍に存在する前記対象物(10)の像(10’)のエッジ上の複数点の内所定の条件を満たすエッジ上の点の座標であるエッジ座標を検出する第1のエッジ検出手段(53D1 )と;前記エッジ座標が検出された前記エッジ上の点を基準点として含む所定範囲内に前記指示された点と前記基準点とを結ぶ方向の複数ラインを設定し、該複数ラインの前記基準点を含むライン以外の少なくとも2ラインについて、各ライン毎に前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標を検出する第2のエッジ検出手段(53D2 )と;前記第1、第2のエッジ検出手段により検出された相互に近接する少なくとも3点のエッジ上の点の座標に基づき前記3点が属するエッジ要素の種類を認識することにより、前記計測対象物の少なくとも一部の形状を認識する形状認識手段(53F)とを有する。
【0007】
これによれば、メモリに記憶された画像情報に対応する画像が画像表示装置の表示画面上に表示された状態で、その画像に対して点入力手段により計測箇所の近傍の点の指示が入力されると、第1のエッジ検出手段によりメモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいて、点入力手段により指示された点の近傍に存在する対象物の像のエッジ上の複数点の内最近傍に存在するエッジ上の点の座標であるエッジ座標が検出される。次いで、第2のエッジ検出手段により、エッジ座標が検出されたエッジ上の点を基準点として含む所定範囲内に指示された点と基準点とを結ぶ方向の複数ラインが設定され、該複数ラインの前記基準点を含むライン以外の少なくとも2ラインについて、各ライン毎にメモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標が検出される。そして、形状認識手段により、第1、第2のエッジ検出手段により検出された相互に近接する少なくとも3点のエッジ上の点の座標に基づき前記3点が属するエッジ要素の種類を認識することにより、計測対象物の少なくとも一部の形状が認識される。従って、計測箇所を指示する点の入力という簡単な操作のみで、計測対象物のエッジ検出及び形状認識を行うことができる。
【0008】
請求項2に記載の発明は、請求項1に記載の画像計測装置において、任意の幾何形状の指示を入力するための計測条件入力手段(42b、42a、53B)と、前記計測条件入力手段により指示された幾何形状を求める計測処理をする計測手段(53H)とを更に有し、該計測手段(53H)は、前記形状認識手段(53F)により認識された形状の中から前記指示に対応する幾何形状のパラメータを求めることを特徴とする。
【0009】
これによれば、計測条件入力手段により任意の幾何形状の指示を入力すると、計測手段により、形状認識手段により認識された形状の中から指示に対応する幾何形状のパラメータが求められる。従って、任意の幾何形状の指示を入力するという簡単な操作で、その幾何形状の計測の結果を得ることができる。
【0010】
請求項3に記載の発明は、計測対象物(10)の像を撮像して得られた画像情報(51B)を用いて前記計測対象物(10)の形状を計測する画像計測装置であって、前記画像情報を記憶するメモリ(41D)と;前記画像情報に対応する画像を表示画面上に表示する画像表示装置(43)と;前記表示画面上に表示された画像に対して計測箇所の近傍の点の指示を入力するための点入力手段(42b、53B)と;前記メモリ(41D)内の画像情報(51B)に含まれる各画素の位置情報と階調情報とに基づいて、前記点入力手段(42b、53B)により指示された点の近傍に存在する前記対象物(10)の像(10’)のエッジ上の複数点の内所定の条件を満たすエッジ上の点の座標であるエッジ座標を検出する第1のエッジ検出手段(53D1 )と;前記エッジ座標が検出された前記エッジ上の点を基準点として含む所定範囲内に前記指示された点と前記基準点とを結ぶ方向の複数ラインを設定し、該複数ラインの前記基準点を含むライン以外の少なくとも2ラインについて、各ライン毎に前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標を検出する第2のエッジ検出手段(53D2 )とを備え、前記第2のエッジ検出手段(53D2 )は、前記基準点のエッジ座標及びこれに近接する少なくとも2点のエッジ上の座標に基づき直線要素を認識し、該直線要素と、基準点を含む前記指示された点と前記基準点とを結ぶ方向のライン上に存在する画素の階調変化とに基づいて前記直線要素の法線ベクトルを求める機能をも更に有することを特徴とする。
【0011】
これによれば、メモリに記憶された画像情報に対応する画像が画像表示装置の表示画面上に表示された状態で、その画像に対して点入力手段により計測箇所の近傍の点の指示が入力されると、第1のエッジ検出手段によりメモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいて、点入力手段により指示された点の近傍に存在する対象物の像のエッジ上の複数点の内最近傍に存在するエッジ上の点の座標であるエッジ座標が検出される。次いで、第2のエッジ検出手段により、エッジ座標が検出されたエッジ上の点を基準点として含む所定範囲内に指示された点と基準点とを結ぶ方向の複数ラインが設定され、該複数ラインの前記基準点を含むライン以外の少なくとも2ラインについて、各ライン毎にメモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標が検出される。また、この場合、基準点を含むエッジが直線、曲線のいずれであっても、第2のエッジ検出手段(53D2 )により、基準点のエッジ座標及びこれに近接する少なくとも2点のエッジ上の座標に基づき直線要素(最小2乗近似による要素)を認識し、かつ該直線要素と基準点を含む前記指示された点と前記基準点とを結ぶ方向のライン上に存在する画素の階調変化(これにより直線要素の法線ベクトルの概略方向がわかる)とに基づいて前記直線要素の法線ベクトルを確実に求めることができる。
【0012】
上記請求項1〜3に記載の各発明において、第1のエッジ検出手段は、メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいて、指示された点の最近傍に存在するエッジ上の点の座標であるエッジ座標を検出するものであれば、その検出方法は如何なる方法であっても良く、例えば、請求項4に記載の発明の如く、前記第1のエッジ検出手段(53D1 )は、前記点入力手段により指示された指示点を中心とする放射状の複数のサーチ方向のライン上に存在する画素の位置情報と階調情報とに基づいて複数のエッジ上の点を検出し、これらの点の内の前記指示点との距離が最短の点の座標をエッジ座標として検出しても良い。かかる場合には、指示点を中心とする放射状の複数のサーチ方向のライン上に存在する画素の位置情報と階調情報とに基づいて複数のエッジ上の点を検出し、これらの点の内の前記指示点との距離が最短の点の座標をエッジ座標として検出するので、例えば、指示点を中心とする同心円の半径を徐々に大きくしてエッジ座標を計測する場合等に比べ、エッジ検出に用いられる画素の数が少なくなり、迅速なエッジ検出が可能になる。この場合、サーチ方向を増やすことにより、より精度良く指示点の最近傍に存在するエッジ上の点の座標を検出できるようになる。
【0013】
あるいは、請求項5に記載の発明の如く、前記第1のエッジ検出手段(53D1 )は、点入力手段により指示された点を中心とする所定の矩形範囲(R)内に行方向及び列方向の複数ラインを設定し、前記行方向及び列方向のそれぞれについて、前記指示された点を含むラインと、該ライン以外の少なくとも2ラインについて、各ライン毎に前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標を検出し、これらの点の内の前記指示された点との距離が最短の点の座標をエッジ座標とするようにしても良い。
【0019】
【発明の実施の形態】
以下、本発明の一実施形態を図1ないし図12に基づいて説明する。
【0020】
図1には、一実施形態に係る画像計測装置の全体構成が概略的に示されている。この図1の画像計測装置は、計測対象物(以下、「対象物」という)10の像を撮像して得られた画像情報である画像データを用いて対象物10の形状等を計測する装置であり、撮像ユニット20と、光源ユニット60と、インターフェイスユニット30と、ホストコンピュータ40とを備えている。
【0021】
前記撮像ユニット20は、対象物10(例えば、機械部品や半導体チップや液晶ディスプレイパネル、生物・生体試料など)を撮像するための構成部分である。この撮像ユニット20は、対象物10を載置してベース21上を2次元移動可能なXYステージ22と、XYステージ22の上方に配置され、ベース21上に植設された支柱23に固定された光学系ユニット24とを備えている。
【0022】
これをさらに詳述すると、XYステージ22は、ベース21上をY方向(図1における紙面直交方向)に移動するYステージ22Yと、このYステージ22Y上をY方向に直交するX方向(図1における紙面内左右方向)に移動可能なXステージ22Xとを備えている。この内、Xステージ22X上に対象物10が載置されている。Yステージ22Y、Xステージ22Xは、後述するインターフェイスユニット30内の制御部31によって制御される不図示のリニアアクチュエータを含む駆動系により駆動されるようになっている。また、Yステージ22Y、Xステージ22Xの位置は、不図示のレーザ干渉計あるいはエンコーダ等の位置検出装置によって計測されるようになっており、この位置検出装置の出力信号が制御部31及びこれを介してホストコンピュータ40に送出されるようになっている。
【0023】
光学系ユニット24内には、対象物10の像を結像面に結像させる対物レンズ等の光学系25、光学系25の結像面に配置されたCCDカメラ26、落射照明用光学系27等が収容されている。CCDカメラ26は、光学系25によって結像面に結像された対象物10の像を撮像して撮像信号(電気信号)を後述するインターフェイスユニット30内の撮像制御部32に出力する。このCCDカメラ26は、ホストコンピュータ40からの制御信号(コマンド)に基づき後述するインターフェイスユニット30内の撮像制御部32によって撮像可能状態、撮像停止状態などが制御される。なお、対象物10の撮像装置としては、CCDカメラの他、撮像管を用いても良く、あるいは非常に大きな画素数の撮像をする場合は1次元撮像素子(いわゆるラインセンサ)を用いることも可能である。後者のラインセンサを用いる場合には、XYステージ22を移動させ、対象物10とラインセンサとを相対移動させながら順次対象物の画像を1ラインづつ読み取るようにして撮像を行う必要がある。
【0024】
また、撮像ユニット20では、ベース21の内部に透過照明用光学系28が設けられている。そして、後述する光源ユニット60内の不図示の光源からの光によって対象物10が前記落射照明用光学系27を介して図1の上方から落射照明、又は透過照明用光学系28を介して下方からの透過照明で照明され、光学系ユニット24内の光学系25によって結像面に対象物10の像が結像されるようになっている。
【0025】
前記光源ユニット60は、光ファイバなどを介して撮像ユニット20に落射又は透過の照明光を出力するものであり、光源を含み光量が調節可能な調光装置とこの調光装置からの光を前記光ファイバに導くための光学系とを有する。また、落射照明、透過照明の選択及びこれらの光の光量の調整は後述するインターフェイスユニット30内部の制御部31によって制御されるようになっている。
【0026】
インターフェイスユニット30は、制御部31、撮像制御部32を含んで構成されている。制御部31は、ホストコンピュータ40からの制御信号を受けてXYステージ22のリニアアクチュエータを制御してXYステージ22を移動させたり、落射照明、透過照明を選択したり、光源ユニット60から出力される光の光量を制御するための構成部分であり、マイクロプロセッサとそのファームウェアで構成される。
【0027】
撮像制御部32は、前述の如く、ホストコンピュータ40からの制御信号(コマンド)に基づきCCDカメラ26の撮像可能状態、撮像停止状態を制御したり、CCDカメラ26からの撮像信号を、白黒256階調でA/D変換して画像データ(1画素について1バイト)としてホストコンピュータ40に出力する。
【0028】
前記ホストコンピュータ(以下、適宜「コンピュータ」という)40は、本実施形態ではマウスなどのポインティングデバイスによる操作が可能な所定のオペレーティングシステムで動作するパーソナルコンピュータを用いて構成され、コンピュータ本体41に入力デバイスであるキーボード42a,マウス42bと画像表示装置としてのディスプレイ43とを接続した構成になっている。
【0029】
コンピュータ本体41は、マイクロプロセッサ41B、メモリ41D、キーボード42a,マウス42bを接続するためのキーボードインターフェイス(キーボードコントローラ)41H、ディスプレイ43を接続するためのビデオインターフェイス41J、シリアルインターフェイス41L、ハードディスク41P及び画像入力ボード41Rを有している。
【0030】
マイクロプロセッサ41Bはハードディスク41Pに格納された制御プログラムをメモリ41Dにロードしてプログラムを起動させることによって、シリアルインターフェイス(RS232C)41Lを介してインターフェイスユニット30の制御部31に制御信号を送ってXYステージ22のリニアアクチュエータの制御、光学系25の倍率制御、光量制御等を行うようになっており、これらの設定はハードディスク41Pに記憶できるようになっている。また、マイクロプロセッサ41Bは、画像入力ボード41R及び撮像制御部32を介してCCDカメラ26の撮像の制御を行うとともに、CCDカメラ26からの撮像信号が撮像制御部32でA/D変換されて得られる画像データ51Bをメモリ41Dに転送し予め用意している配列を用いて各画素の画像データを配列要素として記憶するようになっている。従って、メモリ41D内には、各画素の256階調の階調情報と位置情報(配列の情報)とを含む画像情報としての画像データが記憶されることになる。
【0031】
前記ハードディスク41Pには、エッジ(輪郭)検出、ピッチ測定など測定対象物10の画像データに対して様々な画像処理・計測処理を行う様々なプログラムが格納されており、マイクロプロセッサ41Bではこれらのプログラムをメモリ41Dにロードしてプログラムを起動させることによって画像処理・計測処理を行うようになっている。
【0032】
また、マイクロプロセッサ41Bは、ビデオインターフェイス41Hに制御コマンドを送るとともに、メモリ41D内の画像データ51Bや画像処理・計測処理の結果の情報をビデオインターフェイス41Jを介してディスプレイ43に転送して対象物10の画像や画像処理・計測処理の結果をディスプレイ43の表示画面の所定の領域(ウィンドウ)に表示する。
【0033】
図1には、メモリ41Dに、画像データ51Bが記憶されるとともに、計測条件入力のためのプログラム53B、エッジ検出のためのプログラム53D、形状認識のためのプログラム53F、計測のためのプログラム53H、マーク位置移動のためのプログラム53J及びオペレーティングシステム53Lがロードされた状態が示されている。エッジ検出のためのプログラム53Dは、詳細を後述する第1のエッジ検出プログラム53D1 と第2のエッジ検出プログラム53D2 と第3のエッジ検出プログラム53D3 とを含んでいる。上記各プログラムは、それぞれを一つの実行モジュール(あるいは実行ファイル)で構成することが勿論できるが、任意の複数を一つの実行モジュールで構成したり、全てを単一の実行モジュールで構成することも可能である。どのような構成にするかは、オペレーティングシステム、開発言語等に基づいて決定すれば良い。なお、オペレーティングシステム53Lに表示管理機能、入出力管理機能等の管理機能がある場合、各プログラムはこの機能を呼び出して表示、入出力等を行う。
【0034】
上記各プログラムを用いて様々な処理を行う点が本実施形態の特徴であるので、以下、これらのプログラムについて簡単に説明する。
【0035】
計測条件入力のためのプログラム53Bは、ディスプレイ43の表示画面上に計測条件のメニュー(タスクバーやツールバー、ツールボックスなどで表示される)及びメモリ41D内の画像データ51Bの画像が表示された状態において、マウス42b(又はキーボード42a)の操作によりマウスカーソル(又はグラフィックカーソル、カーソル)の位置を検出することによって、光学系25の倍率、透過照明/落射照明の選択、照明光量の調整等の計測条件やディスプレイ43の表示画面に表示された画像上に対して計測箇所の指示やエッジ検出処理、幾何形状の計測処理の指示その他の計測条件を入力するためのプログラムである。本実施形態では、上記のマウス42b(及びキーボード42a)及び計測条件入力のためのプログラム53Bによって、点入力手段及び計測条件入力手段が実現されている。
【0036】
第1のエッジ検出プログラム53D1 は、ディスプレイ43の表示画面上に表示された計測条件のメニューの内のエッジ検出処理を指示することにより起動し、キーボード42a、マウス42b等の入力デバイスにより点(測定開始点)の指示とともに第1の検出モード又は第2の検出モードの選択がなされ、それらの指示、選択内容が計測条件入力のためのプログラム53Bで入力された場合に、前記モードの選択に応じてそれぞれ次のような処理を実行するプログラムである。すなわち、このプログラム53D1 は、第1の検出モード、すなわちベクトルサーチのモードが選択された場合に、その指示された点の近傍に存在するエッジ上の点の内、所定の条件を満たす点、例えば最近傍に存在するエッジ上の点(対象物10の画像の輪郭上の1点:以下、適宜「エッジ点」、「エッジ位置」あるいは「エッジの位置」という)の座標を後述するベクトルサーチによりメモリ41D内の対象物10の画像データ51B(この画像データには、各画素についての256階調の階調情報と位置情報とが含まれる)に基づいて検出し、また、第2の検出モード、すなわちエリアサーチのモードが選択された場合に、その指示された点を中心とする所定の範囲内について後述するエリアサーチを行い、その所定の範囲内の対象物10の画像データに基づいて前記指示された点の最近傍に存在するエッジ点の座標を検出するプログラムである。前記所定の条件は、最近傍の他、最もシャープなエッジ上、明から暗に変化するエッジ上、暗から明に変化するエッジ上、マニュアル指定されたエッジ上等の条件とすることができる。
【0037】
このプログラム53D1 では第1の検出モードの場合、指示された指示点を中心とする複数の検出方向の直線を用いてエッジを検出し、指示点の最近傍のエッジ点の座標をエッジ座標として検出する(ベクトルサーチを行う)。また、第2の検出モードの場合、前記指示された点を中心とする所定範囲内で検出して見つかったエッジ点の内、その範囲内の指示された点の最近傍のエッジ点の座標をエッジ座標とするようにしてエッジの検出を行う。また、本実施形態の場合、このエッジの検出の際に、画像データ51Bの各画素の階調情報を微分することにより、エッジ点を検出するか、画像データ51Bの各画素を白黒2値化してエッジ点を検出するかの設定が可能になっている。
【0038】
第2のエッジ検出プログラム53D2 は、第1のエッジ検出プログラム53D1 の終了によって起動する。このプログラム53D2 では前記検出モード及び設定がいずれの場合でも、メモリ41D内の画像データが示す各画素の位置情報と階調情報とに基づいてエッジ座標が検出されたエッジ点を基準点とし、この基準点を含む所定範囲内に指示された点と基準点とを結ぶ方向の複数ラインを設定し、各ライン毎にエッジ上の点を求め、求めた点の中から各ライン毎に基準点に最短な点の座標を求めることにより近接する複数のエッジ点の座標を検出するようになっている。また、このプログラム53D2 は、前記検出した複数のエッジ点の座標に基づき直線要素を認識し、該直線要素と基準点を含む方向のライン上に存在する画素の階調変化とに基づいて前記直線要素の法線ベクトルを求め、前記法線ベクトルと同一の方向を向いたキャリパ(エッジ検出の対象範囲、位置、方向を示すマーク)を前記基準点の位置に設定するようになっている。第3のエッジ検出プログラム53D3 は、第2のエッジ検出プログラム53D2 の終了によって起動する。このプログラム53D3 は、前記設定されたキャリパの範囲内に含まれる画素の階調変化に基づいてエッジ点を検出しその点の座標を求める。
【0039】
なお、前記プログラム53D1 、53D2 、53D3 が検出するエッジ点は、計測条件入力のためのプログラム53Bによって設定されるエッジ検出処理条件によって、計測目的に最適のエッジ上から検出することができるようになっている。これについての詳細は後述する。
【0040】
本実施形態ではこのエッジ検出のためのプログラム53Dに含まれる第1のエッジ検出プログラム53D1 によって第1のエッジ検出手段が実現され、第2のエッジ検出プログラム53D2 によって第2のエッジ検出手段が実現されている。
【0041】
前記形状認識のためのプログラム53Fは、エッジ検出のためのプログラム53Dで検出された近接する少なくとも3点のエッジ点の座標に基づいて前記3点が属するエッジ要素の種類を認識することにより、計測対象物10の少なくとも一部の形状を認識するプログラムであり、これによって形状認識手段が実現される。本実施形態では、このプログラム53Fは、認識した対象物10の形状を直線、円又は円弧といった幾何学的に表現できる図形(以下、これを「幾何形状」という)に要素分割し、この要素分割した形状の情報を各図形のコードや位置情報などを含むファイルにしてメモリ41D及びハードディスク41Pに記憶する機能をも有している。かかる機能の設定は、ディスプレイ43の表示画面上に表示された計測条件のメニュー(タスクバーやツールバー、ツールボックスなどで表示される)をマウス42bにより選択することにより計測条件入力のためのプログラム53Bによって行われる。上記のように、認識した対象物10の形状を要素分割し、その要素分割した形状の情報にしておくことで、データ量が減少するだけでなく、対象物10がCAD又はCAMなどにより設計・製作されている場合、計算機上で設計値と比較し誤差を算出するのが容易且つ迅速になる。
【0042】
計測のためのプログラム53Hは、マウス42bで表示画面上のメニューからある幾何形状が選択され、その幾何形状の指示が計測条件入力のためのプログラム53Bによって入力された際に、形状認識のためのプログラム53Fによって認識された対象物10の形状の中からその指示に対応する幾何形状のパラメータの計測を実行するプログラムである。幾何形状として、例えば、直線、線分、円、多角形等があり、計測内容としては長さ、距離、角度、面積等がある。計測結果は、ディスプレイ43の表示画面の所定の領域(ウィンドウ内のボックス)に表示されるようになっている。
【0043】
また、このプログラム53Hは、後述するように、マーク位置移動のためのプログラム53Jでマウス42b等によりキャリパを移動させるのに伴って、第2のエッジ検出プログラム53D2 及び、第3のエッジ検出プログラム53D3 を子プロセスとしてプログラム53D2 でキャリパを設定すると共に、プログラム53D3 によってそのキャリパで示されたエッジ検出の対象範囲内のエッジ点の座標をリアルタイムで検出し、そのエッジ座標をディスプレイ43の表示画面の所定の領域(ウィンドウ内のボックス)に表示する機能をも有する。さらに、このプログラム53Hは、マーク位置移動のためのプログラム53Jと並行して動作し、キャリパで示されたエッジ検出の対象範囲内で検出された複数のエッジ点相互間の距離をリアルタイムで算出してディスプレイ43の表示画面の所定の領域(ウィンドウ内のボックス)に表示する。本実施形態では、このプログラム53Hによって任意の幾何形状の計測を実行する計測手段及びリアルタイム検出手段が実現されている。
【0044】
マーク位置移動のためのプログラム53Jは、画面上に表示されるエッジ検出の対象範囲、位置及び方向を示すマークであるキャリパを、マウス42b等で指示された所望の位置に移動させるためのプログラムであり、本実施形態ではマウス42bとプログラム53Jとによってマーク位置移動手段が実現されている。
【0045】
上記の各プログラム53D、53F、53H、53Jによってそれぞれ実行されるエッジ検出及び法線ベクトル検出、形状認識、幾何形状の計測、キャリパの移動、リアルタイム検出・表示等の各処理の内容については、後に更に詳述する。
【0046】
次に、上記のようにして構成された本実施形態に係る画像計測装置の動作について説明する。
【0047】
まず、対象物10をXYステージ22上に置いて、コンピュータ40の入力デバイスを操作し、対象物10の撮像のため照明条件等の設定後、撮像開始の設定をする。この撮像開始の設定により、コンピュータ40からの制御信号に基づき撮像制御部32によりCCDカメラ26は撮像可能状態に設定される。CCDカメラ26によりその撮像範囲内にある対象物10の像が撮像され、その画像信号が撮像制御部32によりA/D変換され画像データとしてホストコンピュータ40に出力され、コンピュータ本体41のマイクロプロセッサ41Bにより前述の如くしてメモリ41Dに記憶される。そして、マイクロプロセッサ41Bによりビデオインターフェイス41Jを介してメモリ41D内の画像データ51Bによる対象物10の画像がディスプレイ43の表示画面の所定の領域(ウインドウ)に表示される。
【0048】
オペレータは、ディスプレイ43に表示された画像データ51Bによる対象物10の像を見ながら、マウス42b等によりディスプレイ43に表示された計測条件のメニューのうちのエッジ検出処理及びその検出モード(第1の検出モード又は第2の検出モード)の選択、並びに点(表示画面上に表示された対象物10の画像の輪郭近傍の点(計測開始点))の指示等の計測条件の入力操作を行う。これにより、計測条件入力のためのプログラム53Bによって上記の計測条件が入力される。この計測条件の入力により、エッジ検出のためのプログラム53D、計測のためのプログラム53H及びマーク位置移動のためのプログラム53Jが起動する。そして、エッジ検出のためのプログラム53Dによってエッジ検出が開始される。
【0049】
(ベクトルサーチの設定の場合)
前記エッジ検出は、まず第1のエッジ検出プログラム53D1 によるエッジ検出が行われる。図2は、第1の検出モード、すなわちべクトルサーチのサーチ方向のラインを例示した図である。この図2において、中心の点Pがマウス42bによって指示された点である。
【0050】
サーチ方向は方向1から12までの12方向あり、直線1−7,2−8,3−9,4−10,5−11,6−12の6つの直線の方向を順次正方向負方向の順でエッジ検出を行う。例えば、直線1−7の検出をする場合、第1のエッジ検出プログラム53D1 ではマウス42b等により指示した点Pを基準として方向1のライン上に位置する点(画素)の画像データを順次メモリ41Dから読み出し、その画像データが示す輝度(階調)とその微分値(輝度(階調)の変化率)を計算する。この場合、輝度の微分値に極大点又は極小点があればその点の位置をエッジ点とする。次いで、方向7についてもその方向のライン上に位置する点(画素)の画像データが示す輝度(階調)とその微分値(輝度(階調)の変化率)を計算し、エッジ点をサーチする。そして、直線2−8、……、6−12についても上記と同様にして順次エッジ検出を行う。
【0051】
今、図2の方向4の方向にエッジがあるものとして説明を進める。図3(a)は後述するようにキャリパSが設定された状態を示す図であるが、以下、便宜上この図及び同図(b)、(c)に基づいて、上記のエッジ位置の検出の原理について更に詳述する。図2の方向4の直線が、図3(a)の3ラインに相当する。
【0052】
図2の方向4のサーチ即ち、図3(a)の3ラインに沿ってサーチが行われると、同図(b)のような画像データの示す輝度の変化、(c)のような輝度の微分値の変化が検出される。この場合、図3(b)から明らかなように、対象物10(その像10’)があると輝度が大きくなるという変化を示し、その輝度の微分値は、輝度が暗から明に変化するとき極大点Mを示し、その逆の明から暗に変化するときは極小点M’を示している。この場合、マウス42b等により指示した点P(図3(a)の左側にある)には極大点Mが近くにありこのMの座標をエッジ座標として検出する。
【0053】
このようにして、各サーチ方向について求めたエッジ位置の座標について、マウス42b等により指示した点の座標までの距離をそれぞれ計算する。そして、この距離が最も短い点、すなわちマウス42b等により指示した点の最近傍に存在するエッジ点の座標をエッジ座標として検出する。これにより、グレイスケールで高精度にエッジの位置が求められる。
【0054】
上述のようにして、マウス等で指示された点の最近傍に存在するエッジ点の座標であるエッジ座標が求まると、第2のエッジ検出プログラム53D2 が起動する。プログラム53D2 は前記エッジ点を中心とするエッジ検出の対象となる所定の小さな長方形状の範囲(エッジ位置検出領域)を設定する。上記の「エッジ位置検出領域」が画像上のどの範囲、どの位置及び方向にあるかを示すマーク(目印)が、キャリパであり、その一方の辺の長さであるサーチ長と他方の辺の長さであるプロジェクション長は、計測条件入力のためのプログラム53Bにおいて設定可能であり、予め設定された値が用いられる。また、上記の「エッジ位置検出領域」の設定と同時に、計測のためのプログラム53Hによりそれに対応するキャリパSがディスプレイ43の表示画面上に表示される。キャリパとエッジ位置検出領域とは1対1に対応しているので、以下適宜エッジ位置検出領域をもキャリパという。このときのキャリパSの角度は、上記の検出されたエッジ座標に対応する点が求められたサーチ方向に一致している。
【0055】
上記のようにして、キャリパS及びそのキャリパSで表示されるエッジ位置検出領域の設定が終了すると、第2のエッジ検出プログラム53D2 は、次のようにして法線ベクトルの算出処理を行う。
【0056】
ここでは、図3(a)に示されるように、図2の4の方向にエッジ点Mが検出され、該エッジ点Mを中心としてキャリパSが設定された場合を採り上げて説明する。なお、図3(a)に示したキャリパSの場合、左右方向の長さがサーチ長であり、上下方向がプロジェクション長である。第2のエッジ検出プログラム53D2 は、サーチ長の方向に設定したライン上にある画素の輝度の微分値に基づいてエッジ点を検出する。前記サーチ長の方向に設定するラインは複数とすることができ、プロジェクション長が、ラインの数に対応している。
【0057】
この場合、図3(a)の3ライン目のサーチ結果である図3(b)、(c)の輝度の変化、輝度の微分値の変化から明らかなように、エッジ点Mにおけるエッジの法線ベクトルの概略的な方向は方向4になる。ここで、エッジの法線ベクトルの方向は、エッジの明方向に向かうものと定義している。
【0058】
図3(a)中にキャリパSで示される領域内の1、2、4、5の各ラインについて、前述したエッジ座標Mの検出の際と同様の各画素の画像データの階調(輝度)及び階調の微分値(変化率)の変化に基づくエッジ位置検出を行う。これにより、図3(b)、(c)の3ラインの場合と同様の1、2、4、5の各ラインについての輝度の変化と輝度の微分値の変化を示すデータが得られ、エッジの位置m1,m2,m4,m5、m1’、m2’、m4’、m5’の座標が求められる。そして、各ラインについて、原点(基準点)Mに最短なエッジ点の座標を検出することにより、エッジ点m1,m2,m4,m5の座標が求められる。これらのエッジ点は、マウス42b等により指示した点P近傍における対象物10の画像10’の輪郭の微小部分であり、求めたエッジ点m1,m2,m4,m5及びMの座標から最小2乗直線などを計算し、この最小2乗直線の傾きを求めることによりエッジ点Mにおける正しい法線ベクトルVの方向が求められる。法線ベクトルを求める際に隣接する(又は連続する)エッジ位置の座標を用いているので、その処理は速くなる。上記のようにして、エッジ点Mにおける法線ベクトルが求まると、その向きに合わせてキャリパSが点Mを中心に表示画面上で回転移動され、正しい法線ベクトルと同一方向に設定され、ディスプレイ43の表示画面上に表示される。
【0059】
以上の処理が終了すると、第3のエッジ検出プログラム53D3 が起動する。プログラム53D3 は、前記設定されたキャリパSの範囲内に相当する画像データをメモリ41Dから読み出し、その画像データが示す輝度(階調)とその微分値を計算し、微分値の極大点又は極小点をエッジ点として検出し、その点の座標値を求め、エッジ座標データ51Dとしてメモリ41Dに記憶する(図1参照)。エッジの法線方向に設定されたキャリパSによってエッジ点が検出されるので、高精度にエッジ点の座標を求めることができる。この場合、計測対象物の形状、表面状態によっては、複数の極大点、極小点が検出されるので、プログラム53D3 は、計測目的に最適のエッジ上の点を選択する機能も備えている。
【0060】
図12(a)にそのような計測対象物60の平面図を、図12(b)に前記計測対象物の画像データが示す輝度(階調)の微分値を示す。計測対象物60は、その左右の端部の斜面部61、61’と、長孔62とを有する。図12(a)において、符号61a、61b、61a’、61b’は夫々前記斜面の端部である。符号62a、62bは、夫々長孔62の側面である。符号63は表面の傷(溝)である。点Mは第1のエッジ検出プログラム53D1 が検出した基準点、ベクトルVは第2のエッジ検出プログラム53D2 が検出したベクトル、破線で示したSは第2のエッジ検出プログラム53D2 が設定したキャリパである。図12(b)に示す微分値は、前記斜面61、61’の端部、長孔62の側面、傷63の位置で極大値、又は極小値を示している。図12(b)の各極大値、極小値には夫々図12(a)の対応する位置の符号を付してある。これらの位置は、いずれもエッジである。
【0061】
計測条件入力のためのプログラム53Bでは、第3のエッジ検出プログラム53D3 が検出するエッジ点を計測目的に応じて、これらの極大値、極小値の位置から選択する条件を設定することができるようになっている。
【0062】
例えば、▲1▼キャリパSの最も点M側端部(又はその反対側端部側)にあるエッジ点、即ち61a(61a’)を検出する。▲2▼キャリパSの点M側端部(又はその反対側端部)からN番目にあるエッジ点、即ち、N=2であれば61b(61b’)を検出する。▲3▼微分値が正(又は負)であるエッジ点、即ち61b、63、62a、61a’(61a、63、62b、61b’)を検出する。これは、像が明から暗(暗から明)に変化するエッジ点である。▲4▼微分値が所定の値以上のエッジ点のみ検出する。これによって、コントラストが小さい、微少な傷のエッジ点、例えば63を検出しないようにすることができる。▲5▼微分値が最大(又は最小)(即ちコントラスト最大)であるエッジ点を検出する。▲6▼前記▲1▼〜▲5▼の組み合わせを設定することができる。
【0063】
なお、このような検出するエッジ点の選択は、第1のエッジ検出プログラム53D1 、第2のエッジ検出プログラム53D2 におけるエッジ点の検出についても適用することができるようになっている。
【0064】
次に、エッジ検出モードとして第2の検出モード(以下「エリアサーチ」という)が選択された場合を説明する。
【0065】
(エリアサーチの設定の場合)
この場合も、まず、第1のエッジ検出プログラム53D1 によるエッジ検出が行われる。
【0066】
エリアサーチの場合、第1のエッジ検出プログラム53D1 は、まず、計測条件入力のためのプログラム53Bでマウス42b等により指示した点を中心として、所定面積のサーチエリアを設定する。このサーチエリアがディスプレイ43の画面上に表示される。
【0067】
図4は、このサーチエリアRの一例を示したものであり、マウス42b等により指示した点はこのサーチエリアRの中心点Pになっている。
【0068】
第1のエッジ検出プログラム53D1 はサーチエリアR内に行方向と列方向の細かなエリア(表示画面上のピクセルの幅の1ラインのエリアに相当)を設定し、それぞれの細分化された細長いエリア(以下、適宜「細分化エリア」という)について、対象物10の画像10’のエッジ点を検出する。
【0069】
この場合、最初に点Pを含む行方向の直線(基準線)Lの細分化エリアについて上記のエッジ点の検出が行われる。ここで、このエッジ点の検出は、行方向及び列方向の何れの方向の場合も必ずしも全てのラインの細分化エリアについて行う必要はなく、予め設定された数のピクセルおきに行うようにしても良い。行方向について、2ピクセルおきに検出対象細分化エリアを設定した場合、エッジ検出を行う行方向の細分化エリアは、図4の斜線部のように示される。
【0070】
図5は、このエリアサーチによるエッジ検出の様子を概念的に示した図であり、図5(a)のように、まずサーチエリアRの基準線L上のエッジ検出が行われる。このときの処理は、ベクトルサーチの場合の検出と同様であり、対象物の画像10’に対して点Pから基準線L上に位置する点(画素)の画像データを順次メモリ41Dから読み出し、その画像データで示される輝度とその微分値を計算し、輝度の微分値の極大点又は極小点からエッジの位置(エッジ点)m10を検出する。同様にして、他の行方向の細分化エリアについてもエッジ点m11、m12、m14、m15の検出が行われる。次いで、図5(b)のように、サーチエリアRの列方向にエッジ検出を行いエッジ点m20、m21を検出する。
【0071】
こうして得られた各エッジ点と点Pとの距離をそれぞれ計算し、最も小さな値になる(即ち点Pに対して最短距離にある)エッジ点を見つけ、その点の座標をエッジ座標として検出する。
【0072】
上述のようにして、マウス42bで指示された点Pの最近傍に存在するエッジ点の座標であるエッジ座標が求まると、第2のエッジ検出プログラム53D2 が起動する。プログラム53D2 は、前記エッジ点を中心としてエッジ位置検出領域を設定するとともに、計測のためのプログラム53Hによりそれに対応する前記領域の範囲、位置及び方向を示すマークであるキャリパSをディスプレイ43の表示画面上に表示する。この時のキャリパSの角度は、次のようにして求める。
【0073】
点Pに対して最短距離にある、上で求めたエッジ点の座標(エッジ座標)M(x,y)と点Pの座標P(x,y)から
ベクトルV(x,y)=M(x,y)−P(x,y) ………(1)
となるベクトルVを求め、このベクトルVの傾きを求め、それをキャリパの角度とする。すなわち、キャリパの角度Uは、
角度U=ARCTAN(Vx/Vy) (Vy≠0)………(2)
エッジ検出のためのプログラム53Dにより、上記のようにしてベクトルVの角度が算出されると、エッジ座標MをキャリパSの中心位置、ベクトルVの角度をその傾きとしてキャリパSがディスプレイ43の表示画面上に表示される。図6は、その表示例を示したものである。
【0074】
この場合、上記のエリアサーチは必ずしもサーチエリアR内の行方向、列方向の全てのラインの細分化エリアについて行われているとは限らない(図6の場合、行方向について2ピクセルおきに行われている)ので、上記のベクトルVの方向がエッジ点Mにおけるエッジの法線方向に一致しているとは限らない。
【0075】
上記のようにしてキャリパSが表示されると、前述したベクトルサーチの場合と同様にして、キャリパSで示されるエッジ位置検出領域内のキャリパSの向きと同方向の各ラインについて、各画素の画像データの階調(輝度)及び階調の微分値(変化率)の変化に基づくエッジ位置検出が行われ、各ラインについて点Mに最短なエッジ点の座標が求められ、求めたエッジ点の座標及び点Mの座標から最小2乗直線に基づいてエッジ点Mにおける正しい法線ベクトルの方向が求められる。そして、その法線ベクトルの向きに合わせてキャリパSが点Mを中心に表示画面上で回転移動され、正しい法線ベクトルと同一方向で表示される。
【0076】
以上の処理が終了すると、第3のエッジ検出プログラム53D3 が起動し、ベクトルサーチの場合と同様にしてエッジ点が検出され、その座標が高精度に求められる。
【0077】
ところで、エッジの検出の際に、画像データ51Bの各画素の階調情報を微分することによりエッジ点を検出する設定でなく、画像データ51Bの各画素を白黒2値化してエッジ点を検出する設定がなされている場合には、第1のエッジ検出プログラム53D1 では、まず、サーチエリアR内の画素の画像データを2値化する。図7は、その2値化を例示したものであり、サーチエリアRのうち対象物の画像10’があるところは「1」、ないところは「0」になる。そして、「1」になっている点(画素)のそれぞれとマウス42bで指示された点Pとの距離を計算し、その距離が最短となる点の座標をエッジ座標として検出する。そして、第2のエッジ検出プログラム53D2 では、各ラインの「1」の画素の内、点Pとの距離が最短な画素の座標に基づいて最小2乗直線を求め、エッジ座標に対応する点の概略的な法線ベクトルを求めるようにしても良い。このようにすれば、前述した各画素の階調情報を微分(変化率)するエリアサーチの場合に比べ、より高速に演算しエッジを検出することができる。
【0078】
いずれにしても、これまでに説明したエッジサーチ(ベクトルサーチ、エリアサーチ)により、マウス42bにより指示した点最近傍のエッジ座標と、そのエッジ座標に対応する点におけるエッジの法線ベクトルが求められ、その法線ベクトルの向きに合わせて、上記エッジ座標の点を中心としてキャリパが設定され画面上に表示され、そのキャリパに基づいて再度エッジ点の座標が求められる。このようにすることによってどのような形状のエッジであっても、必ずエッジの法線方向にキャリパを設定することが可能となり、測定の再現性が向上する。
【0079】
なお、エッジサーチの範囲は大きくないので、サーチされる部分が直線以外の例えば円弧であっても、前述した直線近似に基づいて求めた法線ベクトルは、エッジ点Mの正しい法線ベクトルとほぼ一致するものである。サーチされる部分の形状についての情報を与え、その形状に対応する最小2乗曲線を求め、該曲線上の検出点Mにおける法線ベクトルを求めるようにしても良い。
【0080】
次に、形状認識のためのプログラム53Fの詳細を説明する。前記第3のエッジ検出プログラム53D3 と同時に、又はこれに代えて形状認識のためのプログラム53Fが起動し、対象物10の少なくとも一部の形状の形状認識が行えるようになっている。ここで形状認識された結果は、計測のためのプログラム53Hで用いられる。
【0081】
まず、プログラム53D1 によって検出された基準点とプログラム53D2 によって検出されたこれに近接する少なくとも2点の合計3点以上のエッジ点の座標に基づき最小2乗法、又はhough 変換法によりエッジ要素の形状の種類を認識する。形状の種類の認識方法は、最小2乗形状からの誤差の大きさ検出による方法や、hough 変換による方法が選択できるようになっている。即ち、最小2乗法による認識方法の場合、前記3点以上のエッジ点の座標に基づいて、最小2乗直線、最小2乗円を求め、夫々に対する残差の少ない方の形状であると認識する。
【0082】
hough 変換による方法の場合は、多数の点から任意に選んだ2点によって構成される直線の法線ベクトルの方向の分布の状態を監視し、分布が特定の方向に集約するならば直線であると認識し、多数の点から任意に選んだ3点によって構成される円の中心座標の分布の状態を監視し、分布が特定の位置に集約するならば円であると認識する。このときの処理に用いられるエッジ点の個数が多い程、正確に形状認識されるので、プログラム53D2 で設定するサーチラインの数は多い方が好ましい。例えば、前記サーチラインを4本と設定した場合は、基準点と合わせて合計5個のエッジ点の座標からどのような幾何形状か(例えば、直線、円又は円弧)を認識する。
【0083】
形状認識のためのプログラム53Fは、更に、上記認識した形状の詳細を正確に求める処理を行う。前記形状の種類を認識する処理において、キャリパ内のエッジ要素が直線の形状として認識された場合、認識された直線のパラメータが概略求められている。そこで、更にその直線のパラメータを詳細に求める処理が行われる。最小2乗法による誤差の大きさによる検出方法が選択されていた場合、基準点から認識した直線上で一方の側に一定間隔離れた位置にエッジ検出の対象となるエッジ位置検出領域(キャリパ)を設定し、そのキャリパの範囲にあるエッジ及びその法線方向の検出が行われる。そして、順次一定距離ずつエッジ検出の場所を移動させながらエッジ検出を行う。そして、エッジ検出して得たエッジ点が前記直線上に有るか否かを検査する。直線との誤差が所定値以下ならば直線上の点とみなし、その点も含めて直線を再計算する。そして、再度誤差を計算し、所定値以下であれば次のエッジ点について上記の処理を繰り返す。誤差が所定値よりも大きい場合は、その直前の点を直線の一端の点とする。そして、もう一方の端について上記処理を行う。かくして、対象物の形状の一部を構成する直線を表わす直線のパラメータが、両端の点の位置を含めて求められる。求めた直線のパラメータはメモリ41D内に幾何形状データ51C(図1参照)として記憶される。
【0084】
hough 変換法が選択された場合、次のようにして直線のパラメータを求めるようになっている。
【0085】
一般に、直線の方程式「y=ax+b」は、「ρ=x・COSθ+y・SINθ ただしρは、原点から直線に下ろした垂線の長さ、θは垂線とx軸とのなす角度である)」の式で表され、原点を点Pにとると、ρ及びθはエッジの法線ベクトルの長さ及び角度が近似的にあてはまるようになっている。ここでは、この近似値近傍で適当な大きさのρ−θ空間を表す2次元配列を予め用意し、検出したエッジ点(x,y)をρ,θをパラメータとした直線の式に代入し、得られたρ−θの関係を示す軌跡がρ−θ空間を通過する毎に、その2次元配列の配列要素に1を加える、という処理が行われる。画像中の検出したエッジ点に対するすべての軌跡を描いた後、最も大きな値となっている配列要素を抽出する。最小2乗法の場合と同様に、キャリパの位置を順次移動させながらエッジ点を新たに検出して点数を増やしていき、抽出された点近傍に次の点が存在しなくなるまで繰り返す。最も大きな値となっている配列要素がρ及びθであり、最後に検出した点が両端の点である。
【0086】
いずれの設定でも、同一直線上のエッジ点列を求めることができ、直線が検出される。
【0087】
図9は、第1のエッジ検出プログラム53D1 において第1の検出モード(ベクトルサーチ)で基準点を検出し、形状認識のためのプログラム53Fで直線の形状要素を抽出する様子を例示したものである。
【0088】
点P1、P2、P3で囲まれた対象物の画像10’の輪郭を成す直線P1ーP2近傍の点Xをマウスで指示すると、同図(a)のように、第1のエッジ検出プログラム53D1 によって第1の検出モードでマウスによる指示点Xを中心として放射状にベクトルサーチによるエッジ検出が行われ、第2のエッジ検出プログラム53D2 によって指示点Xの最近傍のエッジ点p0の座標及びその法線ベクトルが検出され、キャリパが設定され、第3のエッジ検出プログラム53D3 によって、このキャリパによるエッジ点の正確な座標が求められる。そして、形状認識のためのプログラム53Fによってこれらのエッジ点に基づき前述の如くして直線要素が認識される。次いで、同図(b)のように、指示点Xの最近傍点のエッジ座標p0から順に所定の距離だけ離れた点p1、p2、p3、p4、p5、p6の順にエッジ位置の検出が行われ、同様に、反対方向の点p7,p8の順にエッジ位置の検出が行われ、上述した直線を求める処理と両端の点P1,P2を検出する処理とが行われる。このようにして、対象物の画像10’の輪郭を成す直線(線分)P1−P2が認識され、認識した直線のパラメータ(直線の方程式、両端点の位置など)が求められ、メモリ41Dに記憶される。
【0089】
こうして、対象物の画像10’の輪郭(エッジ)近傍をマウスなどで指示するだけで、直線の両端及び直線のパラメータを求めることができる。第2の検出モードでも同様であり、対象物の画像10’の輪郭(エッジ)近傍をマウスなどで指示するだけで、サーチエリアRが設定されて、エッジ座標が検出され、その直線の両端及び直線のパラメータを求めることができる。
【0090】
形状認識のためのプログラム53Fの形状の種類を認識する処理において、キャリパで示されるエッジ位置検出領域内のエッジ要素が円又は円弧の形状として認識された場合、円のパラメータを求める処理が行われる。
【0091】
形状の種類を認識する処理によって、円の半径と中心の位置とが概略求められている。はじめに基準点の位置から認識した円の周上で一方方向に一定距離離れた位置にエッジ検出の対象となるエッジ位置検出領域(キャリパ)を設定し、そのキャリパ範囲にあるエッジ及びその法線方向の検出が行われる。そして、順次一定距離ずつエッジ検出の場所を移動させながらエッジ検出が行われる。こうしてエッジ検出して得たエッジ点が前記円周上に有るか否かを検査する。円要素との誤差が所定値以下ならば同一円周上の点とみなし、その点も含めて円を再計算する。再度誤差を計算し、所定値以下であれば、次のエッジ検出の場所の点について上記処理を繰り返す。誤差が所定値よりも大きい場合は、その直前の点を円弧の一端の点とする。そして、もう一方の端について上記処理を行う。かくして、対象物の形状の一部を構成する円弧を表わす円弧のパラメータが、両端の点の位置を含めて求められる。円弧が閉じた円である場合は、一方方向への処理において、基準点に戻った時に処理を終了する。求めた円弧のパラメータはメモリ41D内に幾何形状データ51Cとして記憶される。
【0092】
この場合も上述した最小2乗形状からの誤差の大きさによる検出方法だけでなく、hough 変換法による方法が選択できるようになっている。hough 変換法の場合は、前記直線の場合の直線の式を円の式に替えて直線の場合と同様の処理を行うことによって円パラメータの詳細が求められる。
【0093】
本実施形態の画像計測装置では、以上のようにして、撮像ユニット20を用いて読み取られた画像データ51Bからディスプレイ43の表示画面に表示された画像に対して、測定したい対象物の輪郭(エッジ)近傍をマウス42bで指定することにより、その位置から最も近い位置にあるエッジの座標の検出を行い、検出されたエッジ座標を基準にしてエッジ検出を行って対象物10の形状を認識するようになっている。そして、対象物10の輪郭をなす直線又は円弧の始点終点座標を自動的に求めることができる。このように、本実施形態の画像計測装置は、マウス42bなどにより表示画面上の1点を指示するという簡単な操作で、対象物の形状認識ができる。
【0094】
計測対象物の像10’を構成する直線や円、円弧などの各要素に対して形状認識のためのプログラム53Fによる処理を行うことによって得られた様々な情報、例えば、指示された位置最近傍のエッジ座標と法線ベクトル及びその座標を含む形状情報(直線なら両端点座標、円弧なら両端点座標と中心座標、といった要素分割して得られた情報)などは、所定のフォーマットにして登録し、メモリ41D(仮想メモリの場合も含む)に幾何形状データ51Cとして記憶しておくとともに、ファイルとしてハードディスク41Pに保存されるようになっている。このファイルを読みだすことで、1度撮像した対象物について、くり返し表示と後述するような測定とができるようになっている。
【0095】
このように、認識した形状を直線、円又は円弧に要素分割した情報を記憶するので、測定対象物の形状に関するデータ量が小さくなり、また、計測のためのプログラム53Hによる幾何形状の計測を実行する処理速度が速くなる。
【0096】
次に、計測のためのプログラム53Hによる、前記メモリ41D内の幾何形状データ51Cを用いた計測について説明する。マウス42bなどにより、計測のためのプログラム53Hを起動すると、ディスプレイ43の画面上に表示された図形と所望の演算・計測内容を指示することにより、前述した処理により認識された対象物10の形状及び要素分割して得られた情報を用いて以下のような演算処理及び計測処理が行われる。
【0097】
一般的な幾何寸法は、「直線−直線」の計算又は「円−直線」又は「円−円」の計算によって求めることができる。そこで、直線と直線が指示された場合は、交点座標、直角度、平行度、直線と直線との距離などが自動的に計算される。また、円と直線が指示された場合は、交点座標、円と直線の最短距離、中心座標と直線との距離、中心座標から直線に下だした垂線の足の座標等が自動的に演算される。円と円が指示された場合は、円と円の交点座標、円中心間距離などが求まる。また、指示された図形が複数の直線からなる閉形状の場合、要素分割して得られた情報から閉図形を認識し、その閉図形を構成する直線の数に応じて、3本では三角形、4本では四角形などと認識し、これらの頂点の座標や重心座標、中心座標が求められる。所定の数の円や直線から成る閉図形の場合を複数選べば、予め登録しておいた円の数、直線の数から、指定の形状が認識され、所定の出力が計算される。
【0098】
上記の演算・計測結果はディスプレイ43の表示画面の所定の領域(ウィンドウ内のボックス)に表示されるようになっている。
【0099】
図11は、別の計測対象物に対してこのような幾何寸法を求める計測処理が行われる場合のディスプレイ43の表示の一例である。図11に示されるような対象物の画像10’がディスプレイの表示画面上のウィンドウに表示されている場合において、マウス42bにより、計測のためのプログラム53Hで幾何寸法計測処理を指定した後、2点1、2を計測箇所として指示すれば、幾何形状データ51Cからそれらの点が属する幾何形状、即ち夫々直線が選択され、上述した直線−直線計算が行われ、交点Bの座標、2直線の角度θなどが求められる。同様に、2点9、9’をマウス42bにより計測箇所として指示すれば、2直線の角度、平行度、2直線間の距離Lが求められる。また、4つの点3、4、5、6を連続で選べば四角形の要素成分が求められる。また、2点7、8を連続で選べば上述した円−円計算が行われ、円と円の交点Aの座標が求められ、同様に2点11、12を連続で選べば2つの円の中心間距離Dが求められる。上記いずれの場合も、求められた計測結果は、ディスプレイ43の表示画面上のウィンドウ44Dに表示される。
【0100】
なお、計測箇所として指示された点が属する図形要素が幾何形状データ51Cに含まれていない場合は、その時点で前記した各処理がなされ、その点が属する図形要素の形状の種類と詳細パラメータとが求められ、前記幾何寸法を求める処理が行われる。そして、求めた幾何形状データはメモリ41Dに記憶される。
【0101】
本実施形態の装置は、表示画面44上に表示された計測対象物のエッジに沿って、キャリパSを移動させ、キャリパSの位置における計測対象物のエッジ座標をリアルタイムに求めることもできる。以下これについて説明する。即ち、計測処理のためのプログラム53Hによって、リアルタイムエッジ検出処理が指示されると、マウス42bの操作に応じてマーク位置移動のためのプログラム53Jによって表示画面上でキャリパSの位置が移動される度毎に、エッジ検出、法線ベクトルの検出、エッジ座標再検出の一連の処理が、計測のためのプログラム53Hによりエッジ検出のためのプログラム53D(プログラム53D1 、53D2 、53D3 )を子プロセスとして行われ、キャリパSが法線方向を向くように表示画面上に表示されると共に、移動したキャリパの位置、方向に基づいて検出されたエッジ点の座標が求められる。このときキャリパSは対象物10の画像10’の輪郭に添って移動するように表示される。
【0102】
図8はその表示例を示したものである。ディスプレイ43の表示画面44上で対象物10の画像10’が表示されるウィンドウ44Aにおいて、まず始めに、対象物10の画像10’の輪郭近傍の点Aをマウス42b等により指示する。その後、この点Aに表示されたキャリパSを点B,C,D,E,F,Gに移動させると、各点でエッジ座標及び法線方向が求められ、キャリパSは矢印で示した方向になるように表示され、このキャリパの範囲内の画素の輝度変化に基づいてエッジ点が検出され、その点の座標が求められる。また、計測のためのプログラム53Hにより、キャリパSの移動位置毎に、キャリパSの中心を通る法線方向の輝度分布がウィンドウ44Bに、また点A,B,C,D,E,F,G各点におけるエッジの座標がウィンドウ44Cに表示されるようになっている。ウィンドウ44Dは、計測結果を表示する部分でありこの点については後述する。
【0103】
このように、キャリパSを移動にさせるのに伴って、エッジ点の座標がリアルタイムで検出されてそのエッジ座標が画面上に表示される。その際、キャリパSも表示されるので、エッジ検出の対象範囲を容易に把握することができ、使い易くなる。また、キャリパSが法線ベクトルと同方向にして画面上にリアルタイムに表示されるので、どの方向で計測を行っているかが確認でき、かつ、法線方向に設定されたキャリパSに基づいてエッジ座標を求めているので、高精度に座標を求めることができる。
【0104】
更に、本実施形態の装置の計測のためのプログラム53Hは、マウス42bによるキャリパの移動に伴って、任意幾何形状の寸法をリアルタイム計測処理する機能も備えている。
【0105】
図10(a)は、この場合の計測の様子を示したものである。ディスプレイ43の表示画面44上で対象物の画像10’が表示されるウィンドウ44Aにおいて、計測のためのプログラム53Hでリアルタイム計測処理を指定した後、まず、対象物の輪郭上の点K1,K2を通るようにマウス42b等によりキャリパSを移動させて計測位置を指示する。この場合、キャリパSのプロジェクション長を長目に設定することが好ましい。すると、図10(a)の計測対象部分の拡大図である図10(b)に示されるように、キャリパS内において、点K1の近傍に複数のエッジ点k1 〜kn が検出される。同様に、キャリパS内において、点K2の近傍に複数のエッジ点k1 ’〜kn ’が検出される。
【0106】
そして、検出したエッジ点k1 〜kn 、k1 ’〜kn ’を用いて前述した最小2乗法又はhough 変換法による形状認識処理を行い、点K1、K2の属する図形要素の形状の種類(この場合は共に直線)を認識する。この場合、形状認識処理に用いる点は、キャリパS内に存在する点に限られるのでデー多数が少なく、形状認識は短時間に終了する。
【0107】
そして、形状認識の処理によって得られた直線要素に関する情報を用いて直線−直線計算が開始され、演算・計測結果が表示される。キャリパ内における形状の代表点、例えば検出した点k1 〜kn 、k1 ’〜kn ’それぞれの平均点(K11,K12)の座標はウィンドウ44Cに、2直線(点K11を通る対象物の輪郭,点K12を通る対象物の輪郭)の平行度、距離、角度、直角度等はウィンドウ44Dに、直線K11−K12の輝度分布はウィンドウ44Bにそれぞれ表示される。同様に、対象物10の輪郭上の点K3,K4を通るようにキャリパSを移動させて計測位置を指示すると、点K3,K4について同様に処理が行われ結果が表示される。こうしてマウスなどにより、形状を指示するという簡単な操作で、その幾何形状の計測の結果を得ることができる。また、対象物10の輪郭上の点K1,K2,K3,K4の相互間の距離がリアルタイムで算出され表示されるので、対象物の画像10’からその輪郭上の2点間の距離を容易に測定することができる。また、キャリパを法線ベクトルと同方向にして画面上にリアルタイムに表示するので、どの方向で計測を行っているかが把握し易くなる。なお、点k1 〜kn 、k1 ’〜kn ’を検出した後、幾何形状データ41Cを参照して、形状を認識するようにしても良い。
【0108】
このように、計測箇所の指示をマウスによりキャリパを用いて行う場合には、キャリパを移動させるだけで、対象物の画像に基づく上記の種々の計測を自動的に行なうことができる。この他、キャリパが輪郭上の1点のみを通るように設定し、このキャリパによって検出した点から任意に選んだ直線への垂線の長さあるいは前記点と任意に選んだ点との距離、若しくは該任意点を端点として含む任意に選んだ直線との角度をリアルタイムで算出し表示することも可能である。かかる計測は、対象物上のあるエッジ点の座標(x、y)を検出した場合に、この座標を対象物上の任意に選んだ点を原点とする極座標(r、θ)に変換する等によって容易に行うことができる。
【0109】
以上説明したように、本実施形態の画像計測装置によると、マウス42bにより測定箇所を指示するという簡単な操作で、対象物10の画像10’に基づいて様々な計測を行うことができる。
【0110】
なお、上記実施形態では、ベクトルサーチの際のサーチ方向を12方向とした場合について説明したが、これに限らず、そのサーチ方向の数は、より多くすることは可能であり、多ければ多いほど検出確度が上がるのは言うまでもない。また、検出したエッジの法線ベクトルはエッジの明方向に方向をとるものとしたが、その逆方向でもよいことは勿論である。
【0111】
さらに、上記実施形態では、計測処理などの演算は、プログラムを用いてマイクロプロセッサで行われる場合について説明したが、これに限らず、デジタルシグナルプロセッサ(DSP)などを用いて処理を行うようにしても良い。
【0112】
また、上記実施形態では、CCDカメラにより撮像して得た画像データをそのままメモリ内に記憶し、この画像情報を用いて種々の計測処理を行う場合について説明したが、本発明がこれに限定されることはなく、例えば予め撮像して得た対象物の画像情報をフロッピーディスク、光磁気ディスク等の情報記録媒体に記録し、この記録媒体に記録した情報をメモリ内に記録し、この情報を用いて上述した種々の計測を行うようにしても良い。
【0113】
【発明の効果】
以上説明したように、請求項1ないし5に記載の発明によれば、点の指示を入力するという簡単な操作で計測対象物のエッジ検出及び形状認識をすることができるという従来にない優れた効果がある。
【0114】
特に、請求項2に記載の発明によれば、上記効果に加え、任意の幾何形状の指示を入力するという簡単な操作で、その幾何形状の計測の結果を得ることができるという効果もある。
【図面の簡単な説明】
【図1】本発明の実施形態に係る画像計測装置を示す図である。
【図2】第1の検出モードの設定をした場合のサーチ方向を例示した図である。
【図3】(a)はキャリパSが設定された状態を示す図、(b)は(a)中の3ライン上において方向4のサーチをしたときのライン上の画素の画像データの示す輝度の変化を示す図、(c)は(b)輝度の微分値の変化を示す図である。
【図4】サーチエリアを例示した図である。
【図5】エッジ検出によって見つかったエッジの位置を例示した図であって、(a)はサーチエリアRの行方向に複数のエッジ点が得られた様子を示す図、(b)はサーチエリアRの列方向に複数のエッジ点が得られた様子を示す図である。
【図6】エッジ座標を中心位置として設定されたキャリパの表示例を示した図である。
【図7】サーチエリアRおける画像データの2値化を例示した図である。
【図8】キャリパSが対象物の画像10’の輪郭に添って移動する様子を示す図である。
【図9】第1の検出モードでエッジ検出をした後に、直線の形状要素を抽出する様子を例示した図である((a)、(b))。
【図10】(a)は計測のためのプログラムによる任意幾何形状のリアルタイム計測処理の一例を説明するための図、(b)は(a)の計測対象部分を拡大して示す図である。
【図11】別の計測対象物に対して幾何寸法を求める計測処理が行われる場合のディスプレイの表示の一例を示す図である。
【図12】(a)はエッジ点検出の対象となる計測対象物の一例を示す平面図、(b)は(a)の計測対象物の画像データが示す輝度(階調)の微分値を示す図である。
【符号の説明】
10 計測対象物
41D メモリ
42a キーボード(計測条件入力手段の一部)
42b マウス(点入力手段の一部、計測条件入力手段の一部、マーク位置移動手段の一部)
43 ディスプレイ(表示装置)
51B 画像データ(画像情報)
53B 計測条件入力のためのプログラム(点入力手段の一部、計測条件入力手段の一部)
53D1 第1のエッジ検出プログラム(第1のエッジ検出手段)
53D2 第2のエッジ検出プログラム(第2のエッジ検出手段)
53F 形状認識のためのプログラム(形状認識手段)
53H 計測のためのプログラム(計測手段、リアルタイム検出手段)
53J マーク位置移動のためのプログラム(マーク位置移動手段の一部)
P 基準点
S キャリパ(マーク)
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image measurement apparatus, and more particularly to an image measurement apparatus that detects a plurality of points on the contour of an object from image information of the object and performs shape recognition and other measurement processes based on the detected points.
[0002]
[Prior art]
Image measurement devices used in the industrial and medical fields not only display the image of the object obtained by imaging on the display screen of the display, but also extract multiple points on the outline of the object from the image information of the object In addition, measurement processing is performed based on this. In particular, the edge detection process for detecting the contour or edge of the object from the image information is premised on performing various measurement processes such as length and area measurement from the image, and therefore must be performed prior to these processes.
[0003]
One measurement processing program for edge detection is a measurement processing program called a caliper tool. With this caliper tool, a predetermined small range that is subject to edge detection is set on a part of the edge (contour) of the image of the object, and the coordinates of points on the edge within that range are automatically detected. It is supposed to be.
[0004]
[Problems to be solved by the invention]
However, in the above-described measurement using the caliper tool, the operator grasps the caliper that is the mark (mark) of the edge position detection area indicating the target range, position, and direction of the edge detection displayed on the screen with the mouse. It is necessary to set the predetermined range on the edge of the image by moving to the point to be measured and indicating the caliper inclination (direction) according to the direction of the edge with the mouse each time. was there. For this reason, the operation of grasping the caliper with the mouse, the movement to the measurement location, and the operation of changing the direction of the caliper in accordance with the direction of the edge are indispensable, and the operation becomes troublesome.
[0005]
The present invention has been made under such circumstances, and an object of the present invention is to provide an image measuring apparatus capable of performing edge detection with a simpler operation.
[0006]
[Means for Solving the Problems]
Invention of Claim 1 is an image measuring device which measures the shape of the said measurement object (10) using the image information (51B) obtained by imaging the image of the measurement object (10). A memory (41D) for storing the image information; an image display device (43) for displaying an image corresponding to the image information on a display screen; a measurement location for the image displayed on the display screen; Based on point input means (42b, 53B) for inputting an instruction of a nearby point; and position information and gradation information of each pixel included in the image information (51B) in the memory (41D), The coordinates of the point on the edge satisfying a predetermined condition among a plurality of points on the edge of the image (10 ′) of the object (10) existing in the vicinity of the point designated by the point input means (42b, 53B). First edge detection means for detecting a certain edge coordinate (53D1); setting a plurality of lines in a direction connecting the designated point and the reference point within a predetermined range including a point on the edge where the edge coordinates are detected as a reference point; Secondly, for at least two lines other than the line including the reference point, the coordinates of the point on the edge are detected for each line based on the position information and gradation information of each pixel included in the image information in the memory. The edge detection means (53D2); and the type of edge element to which the three points belong based on the coordinates of the points on at least three edges close to each other detected by the first and second edge detection means By doing so, it has shape recognition means (53F) for recognizing at least a part of the shape of the measurement object.
[0007]
According to this, in the state where the image corresponding to the image information stored in the memory is displayed on the display screen of the image display device, an instruction of a point in the vicinity of the measurement location is input to the image by the point input unit. Then, based on the position information and gradation information of each pixel included in the image information in the memory by the first edge detection means, an image of the object existing in the vicinity of the point designated by the point input means Edge coordinates that are the coordinates of a point on the edge existing closest to the plurality of points on the edge are detected. Next, the second edge detection means sets a plurality of lines in a direction connecting the designated point and the reference point within a predetermined range including the point on the edge where the edge coordinates are detected as a reference point, and the plurality of lines For at least two lines other than the line including the reference point, the coordinates of the points on the edge are detected based on the position information and gradation information of each pixel included in the image information in the memory for each line. Then, by recognizing the type of the edge element to which the three points belong based on the coordinates of the points on at least three edges close to each other detected by the first and second edge detecting means by the shape recognition means The shape of at least a part of the measurement object is recognized. Therefore, the edge detection and shape recognition of the measurement object can be performed with only a simple operation of inputting a point indicating the measurement location.
[0008]
According to a second aspect of the present invention, in the image measuring device according to the first aspect, the measurement condition input means (42b, 42a, 53B) for inputting an instruction of an arbitrary geometric shape and the measurement condition input means Measurement means (53H) for performing a measurement process for obtaining the instructed geometric shape, and the measurement means (53H) corresponds to the instruction from the shapes recognized by the shape recognition means (53F). It is characterized in that a geometric parameter is obtained.
[0009]
According to this, when an instruction for an arbitrary geometric shape is input by the measurement condition input means, a geometric shape parameter corresponding to the instruction is obtained from the shapes recognized by the shape recognition means by the measurement means. Therefore, the result of measurement of the geometric shape can be obtained by a simple operation of inputting an instruction for an arbitrary geometric shape.
[0010]
Invention of Claim 3 is an image measuring device which measures the shape of the said measurement object (10) using the image information (51B) obtained by imaging the image of the measurement object (10). A memory (41D) for storing the image information; an image display device (43) for displaying an image corresponding to the image information on a display screen; a measurement location for the image displayed on the display screen; Based on point input means (42b, 53B) for inputting an instruction of a nearby point; and position information and gradation information of each pixel included in the image information (51B) in the memory (41D), The coordinates of the point on the edge satisfying a predetermined condition among a plurality of points on the edge of the image (10 ′) of the object (10) existing in the vicinity of the point designated by the point input means (42b, 53B). First edge detection means for detecting a certain edge coordinate (53D1); setting a plurality of lines in a direction connecting the designated point and the reference point within a predetermined range including a point on the edge where the edge coordinates are detected as a reference point; Secondly, for at least two lines other than the line including the reference point, the coordinates of the point on the edge are detected for each line based on the position information and gradation information of each pixel included in the image information in the memory. Edge detecting means (53D2), wherein the second edge detecting means (53D2) recognizes a linear element based on the edge coordinates of the reference point and the coordinates on at least two edges adjacent to the reference point, And a function for obtaining a normal vector of the linear element based on the linear element and a gradation change of a pixel existing on a line in a direction connecting the designated point including the reference point and the reference point. Yes And wherein the Rukoto.
[0011]
According to this, in the state where the image corresponding to the image information stored in the memory is displayed on the display screen of the image display device, an instruction of a point in the vicinity of the measurement location is input to the image by the point input unit. Then, based on the position information and gradation information of each pixel included in the image information in the memory by the first edge detection means, an image of the object existing in the vicinity of the point designated by the point input means Edge coordinates that are the coordinates of a point on the edge existing closest to the plurality of points on the edge are detected. Next, the second edge detection means sets a plurality of lines in a direction connecting the designated point and the reference point within a predetermined range including the point on the edge where the edge coordinates are detected as a reference point, and the plurality of lines For at least two lines other than the line including the reference point, the coordinates of the points on the edge are detected based on the position information and gradation information of each pixel included in the image information in the memory for each line. In this case, even if the edge including the reference point is a straight line or a curve, the second edge detection means (53D2) uses the edge coordinates of the reference point and coordinates on at least two edges adjacent to the reference point. Based on the linear element (element by least square approximation), and gradation change of pixels existing on the line in the direction connecting the designated point including the linear element and the reference point and the reference point ( Accordingly, the normal vector of the straight line element can be reliably obtained based on the fact that the general direction of the normal vector of the straight line element is known).
[0012]
In each of the first to third aspects of the present invention, the first edge detecting means is the nearest neighbor of the indicated point based on the position information and gradation information of each pixel included in the image information in the memory. Any detection method may be used as long as it detects edge coordinates that are the coordinates of a point on an edge existing in the first edge. For example, as in the invention according to claim 4, the first edge The detection means (53D1) is arranged on a plurality of edges based on position information and gradation information of pixels existing on a plurality of radial lines in the search direction centered on the designated point designated by the point input means. A point may be detected, and the coordinates of the point having the shortest distance from the indicated point among these points may be detected as edge coordinates. In such a case, points on a plurality of edges are detected based on position information and gradation information of pixels existing on a plurality of radial lines in the search direction centered on the designated point, and among these points, Since the coordinates of the point with the shortest distance to the designated point are detected as edge coordinates, for example, edge detection is performed compared to the case where the edge coordinates are measured by gradually increasing the radius of a concentric circle centered on the designated point. As a result, the number of pixels used in the method is reduced, and rapid edge detection becomes possible. In this case, by increasing the search direction, it becomes possible to detect the coordinates of a point on the edge existing closest to the designated point with higher accuracy.
[0013]
Alternatively, as in the invention described in claim 5, the first edge detecting means (53D1) is arranged in a row direction and a column direction within a predetermined rectangular range (R) centered on a point designated by the point input means. A plurality of lines are set, and for each of the row direction and the column direction, each line included in the image information in the memory for each line for the line including the indicated point and at least two lines other than the line. The coordinates of the points on the edge are detected based on the pixel position information and the gradation information, and the coordinates of the point having the shortest distance from the designated point among these points are used as the edge coordinates. Also good.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to FIGS.
[0020]
FIG. 1 schematically shows the overall configuration of an image measurement apparatus according to an embodiment. The image measurement apparatus of FIG. 1 is an apparatus that measures the shape or the like of an object 10 using image data that is image information obtained by capturing an image of a measurement object (hereinafter referred to as “object”) 10. The imaging unit 20, the light source unit 60, the interface unit 30, and the host computer 40 are provided.
[0021]
The imaging unit 20 is a component for imaging the object 10 (for example, a machine part, a semiconductor chip, a liquid crystal display panel, a biological / biological sample, etc.). The imaging unit 20 is placed on an XY stage 22 on which the object 10 is placed and can be two-dimensionally moved on the base 21, and is disposed above the XY stage 22, and is fixed to a column 23 that is planted on the base 21. And an optical system unit 24.
[0022]
More specifically, the XY stage 22 includes a Y stage 22Y that moves on the base 21 in the Y direction (the direction perpendicular to the plane of FIG. 1), and an X direction (FIG. 1) that intersects the Y stage 22Y with the Y direction. And an X stage 22X movable in the horizontal direction in the drawing. Among these, the target object 10 is placed on the X stage 22X. The Y stage 22Y and the X stage 22X are driven by a drive system including a linear actuator (not shown) controlled by a control unit 31 in the interface unit 30 described later. Further, the positions of the Y stage 22Y and the X stage 22X are measured by a position detection device such as a laser interferometer or an encoder (not shown). Via the host computer 40.
[0023]
In the optical system unit 24, an optical system 25 such as an objective lens that forms an image of the object 10 on the imaging surface, a CCD camera 26 disposed on the imaging surface of the optical system 25, and an epi-illumination optical system 27. Etc. are housed. The CCD camera 26 captures an image of the object 10 imaged on the image plane by the optical system 25 and outputs an imaging signal (electric signal) to an imaging control unit 32 in the interface unit 30 described later. The CCD camera 26 is controlled in an imaging enabled state, an imaging stopped state, and the like by an imaging control unit 32 in the interface unit 30 described later based on a control signal (command) from the host computer 40. In addition to the CCD camera, an imaging tube may be used as the imaging device for the object 10, or a one-dimensional imaging element (so-called line sensor) may be used when imaging an extremely large number of pixels. It is. When the latter line sensor is used, it is necessary to take an image by sequentially moving the XY stage 22 and reading the image of the target one line at a time while relatively moving the target 10 and the line sensor.
[0024]
In the imaging unit 20, a transmission illumination optical system 28 is provided inside the base 21. Then, the object 10 is lowered from the upper side of FIG. 1 via the epi-illumination optical system 27 by the light from the light source (not shown) in the light source unit 60 described later, via the epi-illumination or the transmission illumination optical system 28. The image of the object 10 is formed on the image plane by the optical system 25 in the optical system unit 24.
[0025]
The light source unit 60 outputs incident or transmitted illumination light to the image pickup unit 20 through an optical fiber or the like. The light source unit 60 includes a light source and a light control device capable of adjusting the light amount, and the light from the light control device. And an optical system for guiding to an optical fiber. Selection of epi-illumination and transmission illumination and adjustment of the amount of light of these lights are controlled by a control unit 31 in the interface unit 30 described later.
[0026]
The interface unit 30 includes a control unit 31 and an imaging control unit 32. The control unit 31 receives a control signal from the host computer 40 and controls the linear actuator of the XY stage 22 to move the XY stage 22, select epi-illumination and transmission illumination, or output from the light source unit 60. It is a component for controlling the amount of light, and is composed of a microprocessor and its firmware.
[0027]
As described above, the image pickup control unit 32 controls the image pickup possible state and the image pickup stop state of the CCD camera 26 based on the control signal (command) from the host computer 40 and outputs the image pickup signal from the CCD camera 26 to the 256th floor in black and white. A / D conversion is performed in the key, and is output to the host computer 40 as image data (one byte per pixel).
[0028]
In the present embodiment, the host computer (hereinafter referred to as “computer” as appropriate) 40 is configured using a personal computer that operates with a predetermined operating system that can be operated with a pointing device such as a mouse. The keyboard 42a and the mouse 42b are connected to a display 43 as an image display device.
[0029]
The computer main body 41 includes a microprocessor 41B, a memory 41D, a keyboard interface (keyboard controller) 41H for connecting a keyboard 42a and a mouse 42b, a video interface 41J for connecting a display 43, a serial interface 41L, a hard disk 41P, and image input. A board 41R is provided.
[0030]
The microprocessor 41B loads a control program stored in the hard disk 41P to the memory 41D and starts the program, thereby sending a control signal to the control unit 31 of the interface unit 30 via the serial interface (RS232C) 41L, and the XY stage. Control of the 22 linear actuators, magnification control of the optical system 25, light amount control, and the like are performed, and these settings can be stored in the hard disk 41P. Further, the microprocessor 41B controls the imaging of the CCD camera 26 via the image input board 41R and the imaging control unit 32, and the imaging signal from the CCD camera 26 is obtained by A / D conversion by the imaging control unit 32. The image data 51B is transferred to the memory 41D, and the image data of each pixel is stored as an array element using an array prepared in advance. Therefore, image data as image information including 256 gradation information and position information (array information) of each pixel is stored in the memory 41D.
[0031]
The hard disk 41P stores various programs for performing various image processing / measurement processes on the image data of the measurement object 10 such as edge (contour) detection and pitch measurement. The microprocessor 41B stores these programs. Is loaded into the memory 41D and the program is started to perform image processing / measurement processing.
[0032]
The microprocessor 41B sends a control command to the video interface 41H, and transfers the image data 51B in the memory 41D and information on the result of the image processing / measurement processing to the display 43 via the video interface 41J. And the results of the image processing / measurement processing are displayed in a predetermined area (window) of the display screen of the display 43.
[0033]
In FIG. 1, image data 51B is stored in the memory 41D, and a program 53B for inputting measurement conditions, a program 53D for edge detection, a program 53F for shape recognition, a program 53H for measurement, The state where the program 53J for moving the mark position and the operating system 53L are loaded is shown. The edge detection program 53D includes a first edge detection program 53D1, a second edge detection program 53D2, and a third edge detection program 53D3, the details of which will be described later. Of course, each of the above programs can be composed of one execution module (or execution file), but any number of programs can be composed of one execution module, or all can be composed of a single execution module. Is possible. What kind of configuration is to be determined may be determined based on an operating system, a development language, or the like. When the operating system 53L has management functions such as a display management function and an input / output management function, each program calls this function to perform display, input / output, and the like.
[0034]
Since a feature of this embodiment is that various processes are performed using each of the above programs, these programs will be briefly described below.
[0035]
The measurement condition input program 53B is displayed in a state where a measurement condition menu (displayed by a task bar, a toolbar, a tool box, etc.) and an image of the image data 51B in the memory 41D are displayed on the display screen of the display 43. By detecting the position of the mouse cursor (or graphic cursor or cursor) by operating the mouse 42b (or the keyboard 42a), the measurement conditions such as the magnification of the optical system 25, selection of transmitted illumination / epi-illumination, adjustment of the amount of illumination light, etc. And a program for inputting measurement location instructions, edge detection processing, geometric shape measurement processing instructions, and other measurement conditions on the image displayed on the display screen of the display 43. In this embodiment, the point input unit and the measurement condition input unit are realized by the mouse 42b (and the keyboard 42a) and the program 53B for inputting the measurement condition.
[0036]
The first edge detection program 53D1 is started by instructing an edge detection process in the measurement condition menu displayed on the display screen of the display 43, and a point (measurement) is performed by an input device such as a keyboard 42a and a mouse 42b. When the first detection mode or the second detection mode is selected together with the start point) instruction, and the instructions and selection contents are input by the program 53B for inputting measurement conditions, the mode is selected. Are programs that execute the following processing. That is, when the first detection mode, that is, the vector search mode is selected, the program 53D1 is a point that satisfies a predetermined condition among points on the edge existing in the vicinity of the designated point, for example, The coordinates of a point on the edge (one point on the contour of the image of the object 10; hereinafter referred to as “edge point”, “edge position” or “edge position”) as appropriate are determined by a vector search described later. Detection is performed based on the image data 51B of the object 10 in the memory 41D (this image data includes 256-level gradation information and position information for each pixel), and the second detection mode. That is, when an area search mode is selected, an area search described later is performed within a predetermined range centered on the indicated point, and an object within the predetermined range is detected. Based on 0 image data is a program that detects the coordinates of the edge points existing closest to a point that is the instruction. The predetermined conditions may be conditions such as the nearest edge, the sharpest edge, the edge changing from light to dark, the edge changing from dark to light, the manually specified edge, and the like.
[0037]
In this program 53D1, in the first detection mode, an edge is detected using straight lines in a plurality of detection directions centered on the indicated indication point, and the coordinates of the nearest edge point of the indication point are detected as edge coordinates. (Perform a vector search). Further, in the case of the second detection mode, the coordinates of the edge point nearest to the designated point in the range among the edge points detected and found within the predetermined range centered on the designated point are Edge detection is performed by using edge coordinates. In the case of this embodiment, at the time of this edge detection, the edge information is detected by differentiating the gradation information of each pixel of the image data 51B, or each pixel of the image data 51B is binarized into black and white. It is possible to set whether to detect edge points.
[0038]
The second edge detection program 53D2 is activated when the first edge detection program 53D1 ends. In this program 53D2, regardless of the detection mode and setting, the edge point where the edge coordinates are detected based on the position information and gradation information of each pixel indicated by the image data in the memory 41D is used as a reference point. Set multiple lines in the direction connecting the indicated point and the reference point within the predetermined range including the reference point, find the point on the edge for each line, and use the obtained point as the reference point for each line By obtaining the coordinates of the shortest point, the coordinates of a plurality of adjacent edge points are detected. The program 53D2 recognizes a linear element based on the detected coordinates of the plurality of edge points, and the straight line based on the gradation change of pixels existing on the line in the direction including the linear element and the reference point. A normal vector of the element is obtained, and a caliper (a mark indicating an edge detection target range, position, and direction) oriented in the same direction as the normal vector is set as the position of the reference point. The third edge detection program 53D3 is activated by the end of the second edge detection program 53D2. This program 53D3 detects an edge point based on the gradation change of the pixels included in the set caliper range and obtains the coordinates of the point.
[0039]
Note that the edge points detected by the programs 53D1, 53D2, and 53D3 can be detected from the edge that is optimal for the measurement purpose according to the edge detection processing conditions set by the program 53B for inputting the measurement conditions. ing. Details of this will be described later.
[0040]
In the present embodiment, the first edge detection means is realized by the first edge detection program 53D1 included in the edge detection program 53D, and the second edge detection means is realized by the second edge detection program 53D2. ing.
[0041]
The shape recognition program 53F recognizes the types of edge elements to which the three points belong based on the coordinates of at least three adjacent edge points detected by the edge detection program 53D. This is a program for recognizing at least a part of the shape of the object 10, thereby realizing a shape recognition means. In this embodiment, the program 53F divides the recognized shape of the object 10 into elements that can be expressed geometrically such as straight lines, circles, or arcs (hereinafter referred to as “geometric shapes”). It also has a function of storing the shape information as a file including code and position information of each figure in the memory 41D and the hard disk 41P. The setting of such a function is performed by a program 53B for inputting measurement conditions by selecting a measurement condition menu (displayed by a task bar, a toolbar, a tool box, etc.) displayed on the display screen of the display 43 with the mouse 42b. Done. As described above, the shape of the recognized object 10 is divided into elements, and the information obtained by dividing the element into information is not only reduced in data amount, but also the object 10 is designed / designed by CAD or CAM. When manufactured, it is easy and quick to calculate an error by comparing with a design value on a computer.
[0042]
The measurement program 53H selects a certain geometric shape from a menu on the display screen with the mouse 42b, and when an instruction for the geometric shape is input by the program 53B for inputting measurement conditions, This is a program for executing measurement of the geometric parameter corresponding to the instruction from among the shapes of the object 10 recognized by the program 53F. Examples of the geometric shape include a straight line, a line segment, a circle, and a polygon, and the measurement content includes a length, a distance, an angle, an area, and the like. The measurement result is displayed in a predetermined area (box in the window) on the display screen of the display 43.
[0043]
Further, as will be described later, the program 53H moves the caliper with the mouse 42b or the like in the program 53J for moving the mark position, and the second edge detection program 53D2 and the third edge detection program 53D3. As a child process, the program 53D2 sets a caliper, and the program 53D3 detects the coordinates of the edge point within the target range of edge detection indicated by the caliper in real time, and the edge coordinates are determined on the display screen of the display 43. It has a function to display in the area (box in the window). Furthermore, this program 53H operates in parallel with the program 53J for moving the mark position, and calculates in real time the distance between a plurality of edge points detected within the target range of edge detection indicated by the caliper. Display on a predetermined area (box in the window) of the display screen of the display 43. In the present embodiment, measurement means and real-time detection means for executing measurement of an arbitrary geometric shape are realized by the program 53H.
[0044]
The mark position moving program 53J is a program for moving a caliper, which is a mark indicating the target range, position and direction of edge detection displayed on the screen, to a desired position indicated by the mouse 42b or the like. In the present embodiment, the mark position moving means is realized by the mouse 42b and the program 53J.
[0045]
The details of each processing such as edge detection and normal vector detection, shape recognition, geometric shape measurement, caliper movement, real-time detection / display, etc. executed by the above programs 53D, 53F, 53H, and 53J will be described later. Further details will be described.
[0046]
Next, the operation of the image measuring apparatus according to the present embodiment configured as described above will be described.
[0047]
First, the object 10 is placed on the XY stage 22, the input device of the computer 40 is operated, and after setting the illumination conditions and the like for imaging the object 10, the start of imaging is set. With this imaging start setting, the CCD camera 26 is set in an imaging enabled state by the imaging control unit 32 based on a control signal from the computer 40. An image of the object 10 within the imaging range is captured by the CCD camera 26, and the image signal is A / D converted by the imaging control unit 32 and output to the host computer 40 as image data. Is stored in the memory 41D as described above. Then, the microprocessor 41B displays the image of the object 10 based on the image data 51B in the memory 41D in a predetermined area (window) of the display screen of the display 43 via the video interface 41J.
[0048]
While viewing the image of the target object 10 based on the image data 51B displayed on the display 43, the operator detects the edge detection process in the menu of measurement conditions displayed on the display 43 by the mouse 42b or the like and the detection mode (first mode). The selection of the detection mode or the second detection mode) and the input of measurement conditions such as an indication of a point (a point in the vicinity of the contour of the image of the object 10 displayed on the display screen (measurement start point)) are performed. Thus, the measurement condition is input by the program 53B for inputting the measurement condition. By inputting this measurement condition, a program 53D for edge detection, a program 53H for measurement, and a program 53J for moving the mark position are started. Then, edge detection is started by the program 53D for edge detection.
[0049]
(For vector search settings)
In the edge detection, edge detection is first performed by the first edge detection program 53D1. FIG. 2 is a diagram illustrating a line in the search direction of the first detection mode, that is, the vector search. In FIG. 2, the center point P is a point designated by the mouse 42b.
[0050]
There are twelve search directions from direction 1 to 12, and the directions of the six straight lines 1-7, 2-8, 3-9, 4-10, 5-11 and 6-12 are sequentially set in the positive and negative directions. Edge detection is performed in order. For example, when detecting the straight line 1-7, the first edge detection program 53D1 sequentially stores image data of points (pixels) located on the line in the direction 1 with reference to the point P designated by the mouse 42b or the like. The luminance (gradation) indicated by the image data and the differential value (change rate of luminance (gradation)) are calculated. In this case, if there is a maximum point or a minimum point in the differential value of luminance, the position of that point is set as an edge point. Next, also in the direction 7, the brightness (gradation) indicated by the image data of the point (pixel) located on the line in that direction and the differential value (the rate of change of the brightness (gradation)) are calculated, and the edge point is searched. To do. Then, edge detection is sequentially performed on the straight lines 2-8,.
[0051]
Now, the description will proceed assuming that there is an edge in the direction 4 in FIG. FIG. 3A is a diagram showing a state in which the caliper S is set as will be described later. Hereinafter, based on this figure and FIGS. The principle will be further described in detail. The straight line in the direction 4 in FIG. 2 corresponds to the three lines in FIG.
[0052]
When the search in the direction 4 in FIG. 2, that is, the search is performed along the three lines in FIG. 3A, the change in luminance indicated by the image data as shown in FIG. A change in the differential value is detected. In this case, as is clear from FIG. 3 (b), there is a change that the luminance increases when the object 10 (its image 10 ′) is present, and the differential value of the luminance changes from dark to bright. The maximum point M is sometimes shown, and when the opposite is changed from light to dark, the minimum point M ′ is shown. In this case, a local maximum point M is near the point P (on the left side of FIG. 3A) indicated by the mouse 42b or the like, and the coordinates of this M are detected as edge coordinates.
[0053]
In this way, the distance to the coordinates of the point designated by the mouse 42b or the like is calculated for the coordinates of the edge position obtained for each search direction. Then, the coordinates of the edge point existing at the shortest distance, that is, the nearest point of the point designated by the mouse 42b or the like are detected as edge coordinates. As a result, the position of the edge is obtained with high accuracy in gray scale.
[0054]
As described above, the second edge detection program 53D2 is activated when the edge coordinates, which are the coordinates of the edge points existing closest to the point designated by the mouse or the like, are obtained. The program 53D2 sets a predetermined small rectangular area (edge position detection area) as an edge detection target centered on the edge point. The mark (mark) indicating the range, position and direction of the “edge position detection region” on the image is a caliper, and the search length of one side and the length of the other side The projection length, which is the length, can be set in the program 53B for inputting measurement conditions, and a preset value is used. Simultaneously with the setting of the “edge position detection area”, the caliper S corresponding to the measurement program 53H is displayed on the display screen of the display 43. Since the caliper and the edge position detection area have a one-to-one correspondence, the edge position detection area is also referred to as a caliper as appropriate hereinafter. The angle of the caliper S at this time coincides with the search direction in which the point corresponding to the detected edge coordinate is obtained.
[0055]
When the setting of the caliper S and the edge position detection area displayed by the caliper S is completed as described above, the second edge detection program 53D2 performs normal vector calculation processing as follows.
[0056]
Here, as shown in FIG. 3A, the case where the edge point M is detected in the direction 4 in FIG. 2 and the caliper S is set around the edge point M will be described. In the case of the caliper S shown in FIG. 3A, the length in the left-right direction is the search length, and the vertical direction is the projection length. The second edge detection program 53D2 detects an edge point based on the differential value of the luminance of the pixels on the line set in the search length direction. A plurality of lines can be set in the search length direction, and the projection length corresponds to the number of lines.
[0057]
In this case, as apparent from the change in luminance and the change in the differential value of luminance in FIGS. 3B and 3C, which are search results for the third line in FIG. The approximate direction of the line vector is direction 4. Here, the direction of the normal vector of the edge is defined as going to the bright direction of the edge.
[0058]
For each of the lines 1, 2, 4, and 5 in the area indicated by the caliper S in FIG. 3A, the gradation (luminance) of the image data of each pixel similar to that at the time of detecting the edge coordinate M described above. And edge position detection based on the change in the differential value (change rate) of the gradation. As a result, data indicating the change in luminance and the change in the differential value of the luminance for each of the lines 1, 2, 4, and 5 similar to the case of the three lines in FIGS. 3B and 3C are obtained. The coordinates of the positions m1, m2, m4, m5, m1 ′, m2 ′, m4 ′, m5 ′ are obtained. For each line, by detecting the coordinates of the edge point closest to the origin (reference point) M, the coordinates of the edge points m1, m2, m4, and m5 are obtained. These edge points are minute portions of the contour of the image 10 ′ of the object 10 in the vicinity of the point P indicated by the mouse 42 b or the like, and the least squares are obtained from the obtained coordinates of the edge points m 1, m 2, m 4, m 5 and M. The direction of the correct normal vector V at the edge point M is obtained by calculating a straight line or the like and obtaining the slope of the least square line. Since the coordinates of adjacent (or continuous) edge positions are used when obtaining the normal vector, the processing becomes faster. As described above, when the normal vector at the edge point M is obtained, the caliper S is rotated on the display screen around the point M in accordance with the direction and set in the same direction as the correct normal vector. 43 is displayed on the display screen.
[0059]
When the above processing is completed, the third edge detection program 53D3 is activated. The program 53D3 reads out the image data corresponding to the range of the set caliper S from the memory 41D, calculates the luminance (gradation) indicated by the image data and the differential value thereof, and determines the maximum or minimum point of the differential value. Is detected as an edge point, the coordinate value of that point is obtained, and stored in the memory 41D as edge coordinate data 51D (see FIG. 1). Since the edge point is detected by the caliper S set in the normal direction of the edge, the coordinates of the edge point can be obtained with high accuracy. In this case, since a plurality of local maximum points and local minimum points are detected depending on the shape and surface state of the measurement object, the program 53D3 also has a function of selecting a point on the edge most suitable for the measurement purpose.
[0060]
FIG. 12A shows a plan view of such a measurement object 60, and FIG. 12B shows a differential value of luminance (gradation) indicated by the image data of the measurement object. The measurement object 60 has slope portions 61 and 61 ′ on the left and right ends thereof and a long hole 62. In FIG. 12 (a), reference numerals 61a, 61b, 61a ′, 61b ′ are the end portions of the slope. Reference numerals 62a and 62b are side surfaces of the long hole 62, respectively. Reference numeral 63 denotes a scratch (groove) on the surface. Point M is a reference point detected by the first edge detection program 53D1, vector V is a vector detected by the second edge detection program 53D2, and S indicated by a broken line is a caliper set by the second edge detection program 53D2. . The differential value shown in FIG. 12B shows a maximum value or a minimum value at the positions of the end portions of the inclined surfaces 61 and 61 ′, the side surface of the long hole 62, and the scratch 63. Each local maximum value and local minimum value in FIG. 12 (b) are denoted by reference numerals corresponding to those in FIG. 12 (a). These positions are all edges.
[0061]
In the program 53B for inputting measurement conditions, a condition for selecting the edge point detected by the third edge detection program 53D3 from the positions of these maximum and minimum values can be set according to the measurement purpose. It has become.
[0062]
For example, (1) the edge point at the end of the caliper S closest to the point M (or the end on the opposite side), that is, 61a (61a ′) is detected. (2) The Nth edge point from the point M side end (or the opposite end) of the caliper S, that is, 61b (61b ') is detected when N = 2. (3) Edge points whose differential values are positive (or negative), that is, 61b, 63, 62a, 61a ′ (61a, 63, 62b, 61b ′) are detected. This is an edge point where the image changes from light to dark (dark to light). (4) Only edge points whose differential value is greater than or equal to a predetermined value are detected. As a result, it is possible to prevent detection of edge points of minute scratches having a small contrast, for example, 63. (5) An edge point having a maximum (or minimum) differential value (ie, maximum contrast) is detected. (6) A combination of the above (1) to (5) can be set.
[0063]
The selection of edge points to be detected can also be applied to edge point detection in the first edge detection program 53D1 and the second edge detection program 53D2.
[0064]
Next, a case where the second detection mode (hereinafter referred to as “area search”) is selected as the edge detection mode will be described.
[0065]
(For area search setting)
Also in this case, edge detection is first performed by the first edge detection program 53D1.
[0066]
In the case of area search, the first edge detection program 53D1 first sets a search area having a predetermined area around the point designated by the mouse 42b or the like in the program 53B for inputting measurement conditions. This search area is displayed on the screen of the display 43.
[0067]
FIG. 4 shows an example of the search area R, and the point designated by the mouse 42b or the like is the center point P of the search area R.
[0068]
The first edge detection program 53D1 sets a fine area in the row direction and the column direction (corresponding to an area of one line of the pixel width on the display screen) in the search area R, and subdivided elongated areas. The edge point of the image 10 ′ of the object 10 is detected (hereinafter referred to as “subdivision area” as appropriate).
[0069]
In this case, the edge point detection is first performed for the subdivision area of the straight line (reference line) L in the row direction including the point P. Here, the detection of the edge point is not necessarily performed for the subdivision areas of all the lines in both the row direction and the column direction, and may be performed every predetermined number of pixels. good. When a detection target subdivision area is set every two pixels in the row direction, the subdivision area in the row direction for performing edge detection is shown as a hatched portion in FIG.
[0070]
FIG. 5 is a diagram conceptually showing the state of edge detection by this area search. First, edge detection on the reference line L of the search area R is performed as shown in FIG. The processing at this time is the same as the detection in the case of vector search, and image data of points (pixels) located on the reference line L from the point P with respect to the image 10 ′ of the object are sequentially read from the memory 41D. The luminance indicated by the image data and the differential value thereof are calculated, and the edge position (edge point) m10 is detected from the maximum point or the minimum point of the luminance differential value. Similarly, the edge points m11, m12, m14, and m15 are detected for the subdivision areas in the other row directions. Next, as shown in FIG. 5B, edge detection is performed in the row direction of the search area R to detect edge points m20 and m21.
[0071]
The distance between each edge point thus obtained and the point P is calculated, the edge point having the smallest value (that is, the shortest distance from the point P) is found, and the coordinates of the point are detected as edge coordinates. .
[0072]
As described above, when the edge coordinates which are the coordinates of the edge point existing nearest to the point P designated by the mouse 42b are obtained, the second edge detection program 53D2 is started. The program 53D2 sets an edge position detection area centered on the edge point, and displays a caliper S that is a mark indicating the range, position, and direction of the area corresponding to the edge position detection area by the program 53H for measurement. Display above. The angle of the caliper S at this time is obtained as follows.
[0073]
From the coordinates (edge coordinates) M (x, y) of the edge point found above and the coordinates P (x, y) of the point P that are at the shortest distance from the point P
Vector V (x, y) = M (x, y) −P (x, y) (1)
The vector V is obtained, the inclination of the vector V is obtained, and this is used as the caliper angle. That is, the caliper angle U is
Angle U = ARCTAN (Vx / Vy) (Vy ≠ 0) (2)
When the angle of the vector V is calculated as described above by the edge detection program 53D, the caliper S is displayed on the display 43 with the edge coordinate M as the center position of the caliper S and the angle of the vector V as the inclination. Displayed above. FIG. 6 shows an example of the display.
[0074]
In this case, the above-described area search is not necessarily performed for the subdivision areas of all lines in the row direction and the column direction in the search area R (in the case of FIG. 6, the line search is performed every two pixels in the row direction). Therefore, the direction of the vector V does not always coincide with the normal direction of the edge at the edge point M.
[0075]
When the caliper S is displayed as described above, in the same manner as in the vector search described above, for each line in the same direction as the direction of the caliper S in the edge position detection area indicated by the caliper S, Edge position detection is performed based on changes in the gradation (luminance) of image data and the differential value (change rate) of gradation, and the coordinates of the shortest edge point at point M are obtained for each line. From the coordinates and the coordinates of the point M, the direction of the correct normal vector at the edge point M is obtained based on the least square line. Then, the caliper S is rotated on the display screen around the point M in accordance with the direction of the normal vector, and is displayed in the same direction as the correct normal vector.
[0076]
When the above processing is completed, the third edge detection program 53D3 is started, edge points are detected in the same manner as in the vector search, and the coordinates thereof are obtained with high accuracy.
[0077]
By the way, at the time of detecting an edge, not the setting for detecting the edge point by differentiating the gradation information of each pixel of the image data 51B, but detecting the edge point by binarizing each pixel of the image data 51B. If the setting has been made, the first edge detection program 53D1 first binarizes the image data of the pixels in the search area R. FIG. 7 exemplifies the binarization. In the search area R, the object image 10 ′ is “1”, and the object image 10 ′ is “0”. Then, the distance between each point (pixel) that is “1” and the point P designated by the mouse 42b is calculated, and the coordinates of the point having the shortest distance are detected as edge coordinates. Then, in the second edge detection program 53D2, a least square line is obtained based on the coordinates of the pixel having the shortest distance from the point P among the pixels of "1" in each line, and the point corresponding to the edge coordinates is obtained. An approximate normal vector may be obtained. In this way, the edge can be detected by calculating at higher speed than in the case of the area search that differentiates (change rate) the gradation information of each pixel described above.
[0078]
In any case, the edge search (vector search, area search) described so far determines the edge coordinates nearest to the point designated by the mouse 42b and the normal vector of the edge at the point corresponding to the edge coordinates. In accordance with the direction of the normal vector, a caliper is set around the edge coordinate point and displayed on the screen, and the edge point coordinate is obtained again based on the caliper. By doing so, it is possible to set a caliper in the normal direction of the edge regardless of the shape of the edge, thereby improving the reproducibility of the measurement.
[0079]
Since the range of the edge search is not large, even if the searched portion is an arc other than a straight line, for example, the normal vector obtained based on the above-described linear approximation is almost the same as the correct normal vector of the edge point M. It matches. Information on the shape of the searched portion may be given, a least square curve corresponding to the shape may be obtained, and a normal vector at the detection point M on the curve may be obtained.
[0080]
Next, the details of the program 53F for shape recognition will be described. At the same time as or instead of the third edge detection program 53D3, a shape recognition program 53F is activated so that at least a part of the shape of the object 10 can be recognized. The result of the shape recognition is used in the measurement program 53H.
[0081]
First, based on the coordinates of a total of three or more edge points including the reference point detected by the program 53D1 and at least two points close to the reference point detected by the program 53D2, the shape of the edge element is determined by the least square method or the hough transform method. Recognize the type. As the shape type recognition method, a method based on detecting the magnitude of an error from the least square shape or a method based on hough transform can be selected. That is, in the case of the recognition method based on the least square method, the least square line and the least square circle are obtained based on the coordinates of the three or more edge points and recognized as the shape having the smaller residual with respect to each. .
[0082]
In the case of the hough transform method, the distribution state in the direction of the normal vector of a straight line composed of two points arbitrarily selected from a large number of points is monitored, and if the distribution is aggregated in a specific direction, it is a straight line. And the state of the distribution of the central coordinates of a circle composed of three points arbitrarily selected from a large number of points is monitored, and if the distribution is collected at a specific position, it is recognized as a circle. As the number of edge points used in the processing at this time is larger, the shape is more accurately recognized. Therefore, it is preferable that the number of search lines set by the program 53D2 is larger. For example, when four search lines are set, the geometric shape (for example, straight line, circle, or arc) is recognized from the coordinates of a total of five edge points including the reference point.
[0083]
The shape recognition program 53F further performs processing for accurately obtaining the details of the recognized shape. In the process of recognizing the type of shape, when an edge element in the caliper is recognized as a straight line shape, the recognized straight line parameter is roughly obtained. Therefore, a process for obtaining the parameters of the straight line in detail is performed. When the detection method based on the magnitude of the error by the least square method is selected, an edge position detection area (caliper) to be subjected to edge detection is located at a position spaced apart on one side on a straight line recognized from the reference point. The edge within the range of the caliper and the normal direction thereof are detected. Then, edge detection is performed while sequentially moving the position of edge detection by a certain distance. Then, it is checked whether or not the edge point obtained by the edge detection is on the straight line. If the error from the straight line is less than a predetermined value, it is regarded as a point on the straight line, and the straight line is recalculated including that point. Then, the error is calculated again, and if it is equal to or smaller than the predetermined value, the above processing is repeated for the next edge point. When the error is larger than a predetermined value, the point immediately before is set as a point at one end of the straight line. Then, the above processing is performed on the other end. Thus, parameters of a straight line representing a straight line constituting a part of the shape of the object are obtained including the positions of both end points. The obtained straight line parameters are stored as geometric data 51C (see FIG. 1) in the memory 41D.
[0084]
When the hough transform method is selected, the straight line parameters are obtained as follows.
[0085]
In general, the linear equation “y = ax + b” is obtained by the following equation: “ρ = x · COSθ + y · SINθ where ρ is the length of the perpendicular line drawn from the origin to the straight line, and θ is the angle between the perpendicular line and the x-axis). When the origin is a point P, ρ and θ are approximately the same as the length and angle of the edge normal vector. Here, a two-dimensional array representing a ρ-θ space of an appropriate size in the vicinity of this approximate value is prepared in advance, and the detected edge point (x, y) is substituted into a linear equation using ρ and θ as parameters. Each time the obtained locus showing the relation of ρ-θ passes through the ρ-θ space, a process of adding 1 to the array element of the two-dimensional array is performed. After drawing all trajectories for the detected edge points in the image, the array element having the largest value is extracted. As in the case of the least square method, the edge point is newly detected while sequentially moving the position of the caliper, the number of points is increased, and the process is repeated until the next point does not exist in the vicinity of the extracted point. The array elements having the largest values are ρ and θ, and the last detected points are both end points.
[0086]
In any setting, an edge point sequence on the same straight line can be obtained, and a straight line is detected.
[0087]
FIG. 9 shows an example of detecting a reference point in the first detection mode (vector search) in the first edge detection program 53D1 and extracting a linear shape element in the program 53F for shape recognition. .
[0088]
When the point X in the vicinity of the straight line P1-P2 forming the outline of the object image 10 'surrounded by the points P1, P2, P3 is indicated by the mouse, as shown in FIG. In the first detection mode, edge detection by a vector search is performed radially around the designated point X by the mouse, and the coordinates of the edge point p0 nearest to the designated point X and its normal line are detected by the second edge detection program 53D2. The vector is detected, the caliper is set, and the third edge detection program 53D3 determines the exact coordinates of the edge point by this caliper. Then, the linear element is recognized as described above based on these edge points by the shape recognition program 53F. Next, as shown in FIG. 5B, edge positions are detected in the order of points p1, p2, p3, p4, p5, and p6 that are separated by a predetermined distance in order from the edge coordinate p0 of the nearest point of the designated point X. Similarly, the edge positions are detected in the order of the points p7 and p8 in the opposite directions, and the above-described processing for obtaining a straight line and the processing for detecting the points P1 and P2 at both ends are performed. In this way, the straight line (line segment) P1-P2 forming the outline of the image 10 ′ of the object is recognized, and the parameters of the recognized straight line (linear equation, position of both end points, etc.) are obtained and stored in the memory 41D. Remembered.
[0089]
In this way, both ends of the straight line and the parameters of the straight line can be obtained simply by pointing the vicinity of the contour (edge) of the image 10 ′ of the object with a mouse or the like. The same applies to the second detection mode, and the search area R is set and the edge coordinates are detected by simply pointing the vicinity of the contour (edge) of the image 10 ′ of the object with a mouse or the like, Straight line parameters can be obtained.
[0090]
In the process of recognizing the shape type of the program 53F for shape recognition, when an edge element in the edge position detection area indicated by the caliper is recognized as a circle or arc shape, a process for obtaining a circle parameter is performed. .
[0091]
By the process of recognizing the type of shape, the radius and center position of the circle are roughly determined. First, an edge position detection area (caliper) that is subject to edge detection is set at a certain distance in one direction on the circumference of the circle recognized from the position of the reference point, and the edge in the caliper range and its normal direction Is detected. Then, edge detection is performed while sequentially moving the position of edge detection by a certain distance. It is checked whether or not the edge point obtained by the edge detection is on the circumference. If the error from the circle element is equal to or less than a predetermined value, it is regarded as a point on the same circumference, and the circle including that point is recalculated. The error is calculated again, and if it is equal to or smaller than the predetermined value, the above processing is repeated for the next edge detection location point. When the error is larger than a predetermined value, the point immediately before is set as a point at one end of the arc. Then, the above processing is performed on the other end. Thus, the parameters of the arc representing the arc constituting a part of the shape of the object are obtained including the positions of the points at both ends. If the arc is a closed circle, the process ends when returning to the reference point in the process in one direction. The obtained arc parameters are stored as geometric data 51C in the memory 41D.
[0092]
In this case as well, the method based on the hough transform method can be selected as well as the detection method based on the magnitude of the error from the least square shape described above. In the case of the hough transform method, the details of the circle parameters are obtained by performing the same processing as in the case of a straight line by replacing the straight line formula in the case of the straight line with a circle formula.
[0093]
In the image measuring apparatus of the present embodiment, the contour (edge) of the object to be measured is measured with respect to the image displayed on the display screen of the display 43 from the image data 51B read using the imaging unit 20 as described above. ) By designating the vicinity with the mouse 42b, the coordinates of the edge closest to the position are detected, and the shape of the object 10 is recognized by performing edge detection based on the detected edge coordinates. It has become. And the start point end point coordinate of the straight line or circular arc which makes the outline of the target object 10 can be calculated | required automatically. As described above, the image measuring apparatus according to the present embodiment can recognize the shape of the object with a simple operation of designating one point on the display screen with the mouse 42b or the like.
[0094]
Various information obtained by performing processing by the shape recognition program 53F on each element such as a straight line, a circle, and an arc constituting the measurement object image 10 ′, for example, the nearest position Edge coordinates and normal vectors and shape information including the coordinates (end point coordinates for straight lines, end point coordinates and center coordinates for arcs, etc.) are registered in a predetermined format. The data is stored in the memory 41D (including the case of a virtual memory) as the geometric shape data 51C, and is stored as a file in the hard disk 41P. By reading this file, it is possible to repeat the display and measure as will be described later for the object imaged once.
[0095]
As described above, since the information obtained by dividing the recognized shape into a straight line, circle, or arc is stored, the amount of data related to the shape of the measurement object is reduced, and the measurement of the geometric shape by the measurement program 53H is executed. The processing speed to be increased.
[0096]
Next, measurement using the geometric shape data 51C in the memory 41D by the measurement program 53H will be described. When the measurement program 53H is activated by the mouse 42b or the like, the figure displayed on the screen of the display 43 and the desired calculation / measurement content are instructed, whereby the shape of the object 10 recognized by the above-described processing. And the following arithmetic processing and measurement processing are performed using the information obtained by the element division.
[0097]
The general geometric dimension can be obtained by calculating “Line-Line” or “Circle-Line” or “Circle-Circle”. Therefore, when a straight line and a straight line are designated, intersection point coordinates, perpendicularity, parallelism, a distance between the straight line and the straight line, and the like are automatically calculated. In addition, when a circle and a straight line are specified, the intersection coordinates, the shortest distance between the circle and the straight line, the distance between the central coordinate and the straight line, the coordinates of the foot of the perpendicular line that descends from the central coordinate to the straight line, etc. are automatically calculated. The When a circle is specified, the coordinates of the intersection of the circle and the circle, the distance between the circle centers, and the like are obtained. Further, when the instructed figure is a closed shape composed of a plurality of straight lines, the closed figure is recognized from the information obtained by dividing the element, and according to the number of straight lines constituting the closed figure, three triangles, The four lines are recognized as squares, and the coordinates of the vertices, the barycentric coordinates, and the center coordinates are obtained. If a plurality of closed figures consisting of a predetermined number of circles and straight lines are selected, a specified shape is recognized from the number of circles and straight lines registered in advance, and a predetermined output is calculated.
[0098]
The above calculation / measurement results are displayed in a predetermined area (box in the window) of the display screen of the display 43.
[0099]
FIG. 11 is an example of display on the display 43 when measurement processing for obtaining such a geometric dimension is performed on another measurement object. When the object image 10 ′ as shown in FIG. 11 is displayed in a window on the display screen of the display, the geometrical dimension measurement process is designated by the mouse program 53H using the measurement program 53H. If points 1 and 2 are designated as measurement locations, the geometric shape to which those points belong, that is, straight lines are selected from the geometric shape data 51C, and the above-described straight line-straight line calculation is performed. An angle θ or the like is obtained. Similarly, if the two points 9 and 9 ′ are indicated by the mouse 42b as measurement points, the angle of two straight lines, the parallelism, and the distance L between the two straight lines can be obtained. If four points 3, 4, 5, and 6 are selected in succession, a quadrilateral element component can be obtained. If the two points 7 and 8 are selected in succession, the circle-circle calculation described above is performed, and the coordinates of the intersection A of the circle and the circle are obtained. Similarly, if the two points 11 and 12 are selected in succession, the two circles A center distance D is determined. In either case, the obtained measurement result is displayed in the window 44D on the display screen of the display 43.
[0100]
If the graphic element to which the point designated as the measurement location belongs is not included in the geometric shape data 51C, each processing described above is performed at that time, and the shape type and detailed parameters of the graphic element to which the point belongs are displayed. Is obtained, and processing for obtaining the geometric dimension is performed. The obtained geometric shape data is stored in the memory 41D.
[0101]
The apparatus of this embodiment can also move the caliper S along the edge of the measurement object displayed on the display screen 44, and can obtain the edge coordinates of the measurement object at the position of the caliper S in real time. This will be described below. That is, when real time edge detection processing is instructed by the measurement processing program 53H, the position of the caliper S is moved on the display screen by the mark position movement program 53J in accordance with the operation of the mouse 42b. Each time, a series of processing of edge detection, normal vector detection, and edge coordinate re-detection is performed by the program 53H for measurement using the program 53D for edge detection (programs 53D1, 53D2, 53D3) as a child process. The caliper S is displayed on the display screen so as to face the normal direction, and the coordinates of the detected edge point are obtained based on the position and direction of the moved caliper. At this time, the caliper S is displayed so as to move along the contour of the image 10 ′ of the object 10.
[0102]
FIG. 8 shows an example of the display. In the window 44A in which the image 10 ′ of the object 10 is displayed on the display screen 44 of the display 43, first, the point A in the vicinity of the outline of the image 10 ′ of the object 10 is indicated by the mouse 42b or the like. Thereafter, when the caliper S displayed at the point A is moved to the points B, C, D, E, F, and G, the edge coordinates and the normal direction are obtained at each point, and the caliper S is in the direction indicated by the arrow. The edge point is detected based on the luminance change of the pixels within the caliper range, and the coordinates of the point are obtained. In addition, the luminance distribution in the normal direction passing through the center of the caliper S is displayed in the window 44B and the points A, B, C, D, E, F, and G for each moving position of the caliper S by the measurement program 53H. The coordinates of the edge at each point are displayed in the window 44C. The window 44D is a part for displaying the measurement result, and this point will be described later.
[0103]
In this way, as the caliper S is moved, the coordinates of the edge point are detected in real time and the edge coordinates are displayed on the screen. At this time, since the caliper S is also displayed, the target range of edge detection can be easily grasped and it becomes easy to use. In addition, since the caliper S is displayed in real time on the screen in the same direction as the normal vector, it is possible to confirm in which direction the measurement is performed and the edge based on the caliper S set in the normal direction Since the coordinates are obtained, the coordinates can be obtained with high accuracy.
[0104]
Further, the measurement program 53H of the apparatus according to the present embodiment also has a function of performing real-time measurement processing of dimensions of an arbitrary geometric shape as the caliper is moved by the mouse 42b.
[0105]
FIG. 10A shows the state of measurement in this case. In the window 44A in which the image 10 ′ of the object is displayed on the display screen 44 of the display 43, after the real time measurement process is designated by the measurement program 53H, first, the points K1 and K2 on the outline of the object are displayed. The caliper S is moved by the mouse 42b or the like so as to pass, and the measurement position is indicated. In this case, it is preferable to set the projection length of the caliper S to be long. Then, as shown in FIG. 10B, which is an enlarged view of the measurement target portion in FIG. 10A, a plurality of edge points k1 to kn are detected in the caliper S in the vicinity of the point K1. Similarly, in the caliper S, a plurality of edge points k1 ′ to kn ′ are detected in the vicinity of the point K2.
[0106]
Then, using the detected edge points k1 to kn and k1 'to kn', the shape recognition process by the least square method or the hough transform method is performed, and the shape type of the graphic element to which the points K1 and K2 belong (in this case) Both are recognized as straight lines). In this case, since the points used for the shape recognition process are limited to the points existing in the caliper S, the number of data is small, and the shape recognition is completed in a short time.
[0107]
Then, straight line-straight line calculation is started using the information regarding the straight line element obtained by the shape recognition process, and the calculation / measurement result is displayed. The coordinates of the representative points of the shape in the caliper, for example, the average points (K11, K12) of the detected points k1 to kn and k1 'to kn' are displayed on the window 44C in two straight lines (the contour of the object passing through the point K11, points The parallelism, distance, angle, squareness, etc. of the contour of the object passing through K12 are displayed in the window 44D, and the luminance distribution of the straight lines K11-K12 is displayed in the window 44B. Similarly, when the caliper S is moved so as to pass the points K3 and K4 on the contour of the object 10 and the measurement position is indicated, the same processing is performed for the points K3 and K4, and the result is displayed. Thus, the result of measurement of the geometric shape can be obtained by a simple operation of designating the shape with a mouse or the like. Further, since the distance between the points K1, K2, K3, K4 on the contour of the object 10 is calculated and displayed in real time, the distance between the two points on the contour can be easily determined from the image 10 ′ of the object. Can be measured. Further, since the caliper is displayed in real time on the screen in the same direction as the normal vector, it is easy to grasp in which direction the measurement is performed. In addition, after detecting the points k1 to kn and k1 'to kn', the shape may be recognized by referring to the geometric shape data 41C.
[0108]
As described above, when the measurement location is instructed using the caliper with the mouse, the above-described various measurements based on the image of the object can be automatically performed only by moving the caliper. In addition, the caliper is set so as to pass only one point on the contour, and the length of the perpendicular line from the point detected by the caliper to the arbitrarily selected straight line or the distance between the point and the arbitrarily selected point, or It is also possible to calculate and display an angle with an arbitrarily selected straight line including the arbitrary point as an end point in real time. In such measurement, when the coordinates (x, y) of a certain edge point on the object are detected, the coordinates are converted into polar coordinates (r, θ) having an arbitrarily selected point on the object as an origin, etc. Can be done easily.
[0109]
As described above, according to the image measurement device of the present embodiment, various measurements can be performed based on the image 10 ′ of the object 10 with a simple operation of instructing the measurement location with the mouse 42 b.
[0110]
In the above embodiment, the case where the search direction at the time of vector search is 12 directions has been described. However, the number of search directions is not limited to this, and the number of search directions can be increased. Needless to say, the detection accuracy increases. In addition, although the detected normal vector of the edge has a direction in the bright direction of the edge, it is needless to say that it may be in the opposite direction.
[0111]
Furthermore, in the above-described embodiment, the case where operations such as measurement processing are performed by a microprocessor using a program has been described. However, the present invention is not limited thereto, and processing is performed using a digital signal processor (DSP) or the like. Also good.
[0112]
In the above embodiment, the case where the image data obtained by the CCD camera is directly stored in the memory and various measurement processes are performed using this image information has been described. However, the present invention is not limited to this. For example, image information of an object obtained by imaging in advance is recorded on an information recording medium such as a floppy disk or a magneto-optical disk, and the information recorded on the recording medium is recorded in a memory. It may be used to perform the various measurements described above.
[0113]
【The invention's effect】
As described above, according to the first to fifth aspects of the invention, the edge detection and shape recognition of the measurement object can be performed with a simple operation of inputting a point instruction, which is superior to the prior art. effective.
[0114]
In particular, according to the invention described in claim 2, in addition to the above effect, there is also an effect that a result of measurement of the geometric shape can be obtained by a simple operation of inputting an instruction of an arbitrary geometric shape.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an image measurement apparatus according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating a search direction when a first detection mode is set.
3A is a diagram showing a state in which a caliper S is set, and FIG. 3B is a brightness indicated by image data of pixels on a line when a search in a direction 4 is performed on three lines in FIG. The figure which shows the change of (b), (c) is a figure which shows the change of the differential value of (b) brightness | luminance.
FIG. 4 is a diagram illustrating a search area.
FIGS. 5A and 5B are diagrams illustrating examples of positions of edges found by edge detection, in which FIG. 5A illustrates a state in which a plurality of edge points are obtained in the row direction of the search area R, and FIG. It is a figure which shows a mode that the several edge point was obtained in the row | line | column direction of R.
FIG. 6 is a diagram showing a display example of a caliper set with edge coordinates as a center position.
7 is a diagram illustrating binarization of image data in a search area R. FIG.
FIG. 8 is a diagram illustrating a state in which the caliper S moves along the contour of an image 10 ′ of an object.
FIGS. 9A and 9B are diagrams illustrating a state in which a linear shape element is extracted after edge detection is performed in the first detection mode ((a) and (b)).
FIG. 10A is a diagram for explaining an example of real-time measurement processing of an arbitrary geometric shape by a program for measurement, and FIG. 10B is an enlarged view of a measurement target portion of FIG.
FIG. 11 is a diagram illustrating an example of display on the display when measurement processing for obtaining a geometric dimension is performed on another measurement object;
12A is a plan view showing an example of a measurement object that is an object of edge point detection, and FIG. 12B shows a differential value of luminance (gradation) indicated by image data of the measurement object of FIG. FIG.
[Explanation of symbols]
10 Measurement object
41D memory
42a Keyboard (part of measurement condition input means)
42b mouse (part of point input means, part of measurement condition input means, part of mark position moving means)
43 Display (display device)
51B Image data (image information)
53B Program for inputting measurement conditions (part of point input means, part of measurement condition input means)
53D1 First edge detection program (first edge detection means)
53D2 Second edge detection program (second edge detection means)
53F Shape recognition program (shape recognition means)
53H Measurement program (measuring means, real-time detecting means)
53J Program for mark position movement (part of mark position movement means)
P reference point
S caliper (mark)

Claims (5)

計測対象物の像を撮像して得られた画像情報を用いて前記計測対象物の形状を計測する画像計測装置であって、
前記画像情報を記憶するメモリと;
前記画像情報に対応する画像を表示画面上に表示する画像表示装置と;
前記表示画面上に表示された画像に対して計測箇所の近傍の点の指示を入力するための点入力手段と;
前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいて、前記点入力手段により指示された点の近傍に存在する前記対象物の像のエッジ上の複数点の内所定の条件を満たすエッジ上の点の座標であるエッジ座標を検出する第1のエッジ検出手段と;
前記エッジ座標が検出された前記エッジ上の点を基準点として含む所定範囲内に前記指示された点と前記基準点とを結ぶ方向の複数ラインを設定し、該複数ラインの前記基準点を含むライン以外の少なくとも2ラインについて、各ライン毎に前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標を検出する第2のエッジ検出手段と;
前記第1、第2のエッジ検出手段により検出された相互に近接する少なくとも3点のエッジ上の点の座標に基づき前記3点が属するエッジ要素の種類を認識することにより、前記計測対象物の少なくとも一部の形状を認識する形状認識手段とを有する画像計測装置。
An image measurement device that measures the shape of the measurement object using image information obtained by capturing an image of the measurement object,
A memory for storing the image information;
An image display device for displaying an image corresponding to the image information on a display screen;
Point input means for inputting an instruction of a point in the vicinity of the measurement location on the image displayed on the display screen;
Based on position information and gradation information of each pixel included in the image information in the memory, a plurality of points on the edge of the image of the object existing in the vicinity of the point designated by the point input means First edge detection means for detecting edge coordinates which are coordinates of points on the edge satisfying a predetermined condition;
A plurality of lines in a direction connecting the designated point and the reference point are set within a predetermined range including a point on the edge where the edge coordinates are detected as a reference point, and the reference point of the plurality of lines is included. Second edge detection means for detecting the coordinates of a point on the edge based on position information and gradation information of each pixel included in the image information in the memory for at least two lines other than the line; ;
By recognizing the type of edge element to which the three points belong based on the coordinates of the points on at least three edges close to each other detected by the first and second edge detection means, An image measuring device having shape recognition means for recognizing at least a part of the shape.
任意の幾何形状の指示を入力するための計測条件入力手段と、前記計測条件入力手段により指示された幾何形状を求める計測処理をする計測手段とを更に有し、該計測手段は、前記形状認識手段により認識された形状の中から前記指示に対応する幾何形状のパラメータを求めることを特徴とする請求項1に記載の画像計測装置。  It further comprises measurement condition input means for inputting an instruction for an arbitrary geometric shape, and measurement means for performing measurement processing for obtaining a geometric shape instructed by the measurement condition input means, and the measurement means includes the shape recognition. 2. The image measuring apparatus according to claim 1, wherein a geometric parameter corresponding to the instruction is obtained from shapes recognized by the means. 計測対象物の像を撮像して得られた画像情報を用いて前記計測対象物の形状を計測する画像計測装置であって、
前記画像情報を記憶するメモリと;
前記画像情報に対応する画像を表示画面上に表示する画像表示装置と;
前記表示画面上に表示された画像に対して計測箇所の近傍の点の指示を入力するための点入力手段と;
前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいて、前記点入力手段により指示された点の近傍に存在する前記対象物の像のエッジ上の複数点の内所定の条件を満たすエッジ上の点の座標であるエッジ座標を検出する第1のエッジ検出手段と;
前記エッジ座標が検出された前記エッジ上の点を基準点として含む所定範囲内に前記指示された点と前記基準点とを結ぶ方向の複数ラインを設定し、該複数ラインの前記基準点を含むライン以外の少なくとも2ラインについて、各ライン毎に前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標を検出する第2のエッジ検出手段とを備え、
前記第2のエッジ検出手段は、前記基準点のエッジ座標及びこれに近接する少なくとも2点のエッジ上の座標に基づき直線要素を認識し、該直線要素と、前記基準点を含む前記指示された点と前記基準点とを結ぶ方向のライン上に存在する画素の階調変化とに基づいて前記直線要素の法線ベクトルを求める機能をも更に有することを特徴とする画像計測装置。
An image measurement device that measures the shape of the measurement object using image information obtained by capturing an image of the measurement object,
A memory for storing the image information;
An image display device for displaying an image corresponding to the image information on a display screen;
Point input means for inputting an instruction of a point in the vicinity of the measurement location on the image displayed on the display screen;
Based on position information and gradation information of each pixel included in the image information in the memory, a plurality of points on the edge of the image of the object existing in the vicinity of the point designated by the point input means First edge detection means for detecting edge coordinates which are coordinates of points on the edge satisfying a predetermined condition;
A plurality of lines in a direction connecting the designated point and the reference point are set within a predetermined range including a point on the edge where the edge coordinates are detected as a reference point, and the reference point of the plurality of lines is included. Second edge detection means for detecting the coordinates of a point on the edge based on position information and gradation information of each pixel included in the image information in the memory for at least two lines other than the line; With
The second edge detecting means recognizes a linear element based on the edge coordinates of the reference point and coordinates on at least two edges close to the reference point, and the specified instruction including the linear element and the reference point An image measuring apparatus further comprising a function of obtaining a normal vector of the linear element based on a gradation change of a pixel existing on a line in a direction connecting a point and the reference point.
前記第1のエッジ検出手段は、前記入力手段により指示された指示点を中心とする放射状の複数のサーチ方向のライン上に存在する画素の位置情報と階調情報とに基づいて複数のエッジ上の点を検出し、これらの点の内の前記指示点との距離が最短の点の座標をエッジ座標として検出することを特徴とする請求項1〜3のいずれか一項に記載の画像計測装置。The first edge detection means includes a plurality of edges based on position information and gradation information of pixels present on a plurality of radial lines in the search direction centered on the designated point designated by the point input means. The image according to any one of claims 1 to 3, wherein an upper point is detected, and coordinates of a point having the shortest distance from the designated point among these points are detected as edge coordinates. Measuring device. 前記第1のエッジ検出手段は、点入力手段により指示された点を中心とする所定の矩形範囲内に行方向及び列方向の複数ラインを設定し、前記行方向及び列方向のそれぞれについて、前記指示された点を含むラインと、該ライン以外の少なくとも2ラインについて、各ライン毎に前記メモリ内の画像情報に含まれる各画素の位置情報と階調情報とに基づいてエッジ上の点の座標を検出し、これらの点の内の前記指示された点との距離が最短の点の座標をエッジ座標とする請求項1〜3のいずれか一項に記載の画像計測装置。  The first edge detection means sets a plurality of lines in the row direction and the column direction within a predetermined rectangular range centered on the point designated by the point input means, and The coordinates of the point on the edge based on the position information and gradation information of each pixel included in the image information in the memory for each line for the line including the indicated point and at least two lines other than the line The image measurement apparatus according to claim 1, wherein the coordinates of a point having the shortest distance from the designated point among these points are set as edge coordinates.
JP31005897A 1997-10-24 1997-10-24 Image measuring device Expired - Lifetime JP3887807B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31005897A JP3887807B2 (en) 1997-10-24 1997-10-24 Image measuring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31005897A JP3887807B2 (en) 1997-10-24 1997-10-24 Image measuring device

Publications (2)

Publication Number Publication Date
JPH11132740A JPH11132740A (en) 1999-05-21
JP3887807B2 true JP3887807B2 (en) 2007-02-28

Family

ID=18000667

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31005897A Expired - Lifetime JP3887807B2 (en) 1997-10-24 1997-10-24 Image measuring device

Country Status (1)

Country Link
JP (1) JP3887807B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1230660C (en) * 2000-09-22 2005-12-07 沃思测量技术股份有限公司 Method for measuring the geometry of an object by means of a co-ordination measuring device
JP5649262B2 (en) * 2006-10-31 2015-01-07 株式会社牧野フライス製作所 MEASUREMENT DISPLAY METHOD AND MECHANISM PROVIDED WITH MEASUREMENT DISPLAY DEVICE
JP5361246B2 (en) * 2008-05-23 2013-12-04 オリンパス株式会社 Endoscope apparatus and program
JP5186314B2 (en) * 2008-05-26 2013-04-17 オリンパス株式会社 Endoscope apparatus and program
JP5095644B2 (en) 2009-01-23 2012-12-12 株式会社キーエンス Image measuring apparatus and computer program
US8903144B2 (en) 2010-12-01 2014-12-02 Olympus Corporation Endoscope apparatus and method of measuring object
JP5547105B2 (en) * 2011-02-01 2014-07-09 株式会社キーエンス Dimension measuring apparatus, dimension measuring method and program for dimension measuring apparatus
JP2013036964A (en) * 2011-08-11 2013-02-21 Mitsutoyo Corp Image measurement apparatus and image measurement method
JP6150532B2 (en) * 2013-01-22 2017-06-21 オリンパス株式会社 Measuring device and program
JP6474334B2 (en) 2015-07-30 2019-02-27 株式会社キーエンス Image inspection apparatus, image inspection method, and image inspection program
JP2019174288A (en) * 2018-03-28 2019-10-10 リコーエレメックス株式会社 Inspection system
CN113034485A (en) * 2021-04-09 2021-06-25 浙江欧视电科技有限公司 Circle detection method integrating Hough transformation and caliper clustering

Also Published As

Publication number Publication date
JPH11132740A (en) 1999-05-21

Similar Documents

Publication Publication Date Title
US7394926B2 (en) Magnified machine vision user interface
JP3887807B2 (en) Image measuring device
KR100499764B1 (en) Method and system of measuring an object in a digital
JP5339065B2 (en) Object tracking device
JP2014055864A (en) Image measurement device, manufacturing method of the same and program for image measurement device
JPH11151206A (en) Eyeground image analyzing method and device therefor
JP6599697B2 (en) Image measuring apparatus and control program therefor
JPWO2005096129A1 (en) Method and apparatus for detecting designated position of imaging apparatus, and program for detecting designated position of imaging apparatus
JP6979885B2 (en) 3D shape auto trace method and measuring machine
JP2008116207A (en) Apparatus and method for image measurement, and program
JP2519445B2 (en) Work line tracking method
JP3595014B2 (en) Edge detection method and non-contact image measurement system using the same
JP7207948B2 (en) Appearance inspection method and program
JPH0339603A (en) Contour detecting method for pattern and length measuring instrument using same method
JP4401126B2 (en) Method for registering predetermined part of dimension measuring device
JPH09259289A (en) Method and device for measuring edge posture recognition formula
JP4237348B2 (en) Microspectroscope
JP3508368B2 (en) Image measuring machine
JPH0560539A (en) Size measurement device
JPH0933227A (en) Discrimination method for three-dimensional shape
JP2937918B2 (en) Image measuring device
JP2000249640A (en) Hardness measuring apparatus
JP5577508B2 (en) Image measuring apparatus and drive control method thereof
US20220269061A1 (en) Magnified observation apparatus, magnified observation method, and non-transitory computer-readable storage medium or storage device
WO2022168617A1 (en) Workpiece detection device, workpiece detection method, workpiece detection system, and workpiece detection program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041019

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060424

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060511

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060707

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: 20061106

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061119

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091208

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121208

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121208

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151208

Year of fee payment: 9

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151208

Year of fee payment: 9

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151208

Year of fee payment: 9

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term