JP3967885B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP3967885B2
JP3967885B2 JP2001086785A JP2001086785A JP3967885B2 JP 3967885 B2 JP3967885 B2 JP 3967885B2 JP 2001086785 A JP2001086785 A JP 2001086785A JP 2001086785 A JP2001086785 A JP 2001086785A JP 3967885 B2 JP3967885 B2 JP 3967885B2
Authority
JP
Japan
Prior art keywords
image processing
image
processing
setting
menu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001086785A
Other languages
Japanese (ja)
Other versions
JP2002287963A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2001086785A priority Critical patent/JP3967885B2/en
Publication of JP2002287963A publication Critical patent/JP2002287963A/en
Application granted granted Critical
Publication of JP3967885B2 publication Critical patent/JP3967885B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
この発明は、画像処理に関する各種設定の入力を行って画像処理プログラムを容易に作成するための画像処理プログラム作成方法、および、その画像処理プログラム作成方法が実現できる画像処理装置に関する。
【0002】
【従来の技術】
画像処理技術は、各種製品の製造ラインにおける不良品検査技術や、その他、防犯技術、医療技術等、多彩な分野で応用がなされている。
【0003】
実際に画像処理を行うに当たっては、画像処理の処理内容や複数の画像処理のフローを記述した画像処理プログラムが作成され、コンピュータを含む画像処理装置上でその画像処理プログラムが実行される。この画像処理プログラムは従来、C言語やBASICなどのプログラム言語を用いて作成されていた。
【0004】
しかし、プログラム言語を用いて画像処理プログラムを作成するには、その言語を習得したプログラマーが必要となり、プログラム言語の専門的知識を有しない者が画像処理プログラムを作成することは困難であった。
【0005】
そこで、例えば特開平9−91127号公報に示された画像処理プログラム作成方法のように、プログラム言語の専門的知識を有しない者であっても画像処理プログラムの作成を可能とする技術が提案されている。
【0006】
図18および図19は、上記公報に示された画像処理プログラム作成方法における、画像処理プログラム作成の処理フローを示す図、およびプログラム作成中のモニタ画面を表示した図である。図19のモニタ画面60に示されているように、この画像処理プログラム作成方法によれば、プログラム言語によってではなく、表示された画像処理の各処理項目ごとに各種数値等の設定事項を順次設定し、その処理項目の順序をプロセスとして設定する。このようにすることで、画像処理の処理内容や複数の処理のフローが容易に設定でき、画像処理プログラムが作成される。
【0007】
また、図18のステップSS3に示すように、画像処理の各設定(ステップSS31)、流れ設定(ステップSS32)、およびI/O設定(ステップSS33)を独立に設定するプログラム方法が採用されることによって、従来、C言語やBASICなど記述的なプログラム方式でなければ実現できなかった複雑な画像処理が容易に実現できるようになった。
【0008】
【発明が解決しようとする課題】
しかしながら、上記の特開平9−91127号公報に記載の画像処理プログラム作成方法では、処理対象となる画像を表示しながら画像処理プログラムを視覚的に確認しつつ作成することができないので、濃淡テンプレートマッチング処理(後述)など対象画像を見ながら各種の設定を行う必要のある画像処理プログラムの作成が困難であるという問題点があった。
【0009】
また、上記公報においては、画像の全画面中の一部を画像処理領域とする指定を行うことはなんら記述されていない。そのため、全画面でなく特定の部分領域のみに対する画像処理の各設定および実行が行えない。このような特定の部分領域のみに対する画像処理は、画像処理プログラム作成を行うに当たってユーザから強く要求される点である。
【0010】
また、上記公報に記載の技術では、図19に示した画像処理メニューから所望の処理項目を選択してその処理に必要とされる設定事項を設定するが、そのように単に処理項目を選択して設定事項を設定するだけでは、1つのプログラムのフロー中で同一の画像処理を複数回行う場合に、その処理を登録するたびに設定事項の設定作業が繰り返し必要となり煩雑であるという問題点もあった。
【0011】
また、同一プログラム中だけでなく、異なる画像処理プログラム間であっても同じ画像処理を既設定の設定事項をそのままにして流用したい場合や、同種の画像処理だが設定事項のパラメータの一部を異なる値に変えて使いたい場合などには不便であるという問題点もあった。
【0012】
このように、画像処理の既設定の設定事項の流用が困難であるため、上記公報に記載の技術では、予期していた使い易さが実現できていない。
【0013】
また、上記公報に記載の画像処理プログラム作成方法では、画像処理設定、流れ設定、I/O設定が独立に行えるだけなので、画像処理により得られた処理データへのさらなる加工(例えば、画像中のある領域の面積を求め、その数値データに加減乗除等の演算を行うなど、ユーザ独自のデータ加工)ができず、すこし複雑な画像処理には対応できないという問題点があった。
【0014】
そこで、この発明の課題は、画像処理の対象領域が設定可能で、処理対象となる画像を表示しながら画像処理プログラムを視覚的に確認しつつ作成することができ、画像処理の既設定の設定事項の流用が簡単で、画像処理により得られた処理データへのさらなる加工を行うことが可能な画像処理プログラム作成方法を提供し、さらに、その画像処理プログラム作成方法を実現できる画像処理装置を提供することにある。
【0024】
【課題を解決するための手段】
請求項1に記載の発明は、画像処理を行う対象の画像である対象画像を撮像する画像撮像手段と、前記対象画像に画像処理を行う画像処理手段と、前記画像処理の結果を表示する画像兼グラフィック表示手段と、操作入力手段とを備え、前記画像処理手段は、前記画像処理の各処理項目ごとの設定事項の設定内容の入力を受ける処理と、前記画像処理の各処理項目の実行順の設定内容の入力を受ける処理とを、各々異なる画面を介して行い、前記画像処理の各処理項目ごとの前記設定事項の設定内容の入力においては、前記画像処理手段は、(A)前記画像兼グラフィック表示手段に対して、前記対象画像と前記画像処理の各処理項目毎の前記設定事項を一覧可能に表した画像処理メニューとを表示させ、(B)前記対象画像を前記画像兼グラフィック表示手段に表示させつつ前記操作入力手段を用いた操作を通じて、前記対象画像のうち全部または一部を画像処理領域として決定する内容の入力を受ける処理を行い、(C)前記操作入力手段を用いた前記画像処理メニュー中の項目を選択する視覚的な操作方法を通じて、前記設定事項の設定内容の入力を受ける処理を行い、および(D)前記画像処理領域と前記設定事項の設定内容とを番号もしくは文字列を用いて名前を付けてメモリに記憶させる内容の入力を受ける処理を行い、前記画像処理の各処理項目の前記実行順の設定内容の入力においては、前記画像処理手段は、前記画像兼グラフィック表示手段に対して、前記実行順の設定を一覧可能に表したプログラムメニューを表示させ、前記画像処理手段は、(a)前記操作入力手段を用いた前記プログラムメニュー中の項目を選択する視覚的な操作方法を通じて、前記画像処理の各処理項目で前記メモリに記憶された番号もしくは文字列を用いて前記画像処理の各処理項目の選択指定を行う内容の入力を受ける処理、並び替えを行う内容の入力を受ける処理、(b)先に実施した前記画像処理の処理結果を参照して次に続く前記画像処理を実施させる画像処理結果参照設定の内容の入力を受ける処理、および()前記画像処理の際に前記画像処理によって算出された演算結果である計測値を結果信号として出力させる出力設定の内容の入力を受ける処理を、行う画像処理装置である。
【0025】
請求項2に記載の発明は、画像処理を行う対象の画像である対象画像を撮像する画像撮像手段と、前記対象画像に画像処理を行う画像処理手段と、前記画像処理の結果を表示する画像兼グラフィック表示手段と、操作入力手段とを備え、前記画像処理手段は、前記画像処理の各処理項目ごとの設定事項の設定内容の入力を受ける処理と、前記画像処理の各処理項目の実行順の設定内容の入力を受ける処理とを、各々異なる画面を介して行い、前記画像処理の各処理項目ごとの前記設定事項の設定内容の入力においては、前記画像処理手段は、(A)前記画像兼グラフィック表示手段に対して、前記対象画像と前記画像処理の各処理項目毎の前記設定事項を一覧可能に表した画像処理メニューとを表示させ、(B)前記対象画像を前記画像兼グラフィック表示手段に対して表示させつつ前記操作入力手段を用いたの操作を通じて、前記対象画像のうち全部または一部を画像処理領域として決定する内容の入力を受ける処理を行い、(C)前記操作入力手段を用いた前記画像処理メニュー中の項目を選択する視覚的な操作方法を通じて、前記設定事項の設定内容の入力を受ける処理を行い、および(D)前記画像処理領域と前記設定事項の設定内容とを番号もしくは文字列の名前を持つオブジェクトとして登録する内容の入力を受ける処理を行い、前記画像処理の各処理項目の前記実行順の設定内容の入力においては、前記画像処理手段は、前記画像兼グラフィック表示手段に対して前記実行順の設定を一覧可能に表したプログラムメニューを表示させ、前記画像処理手段は、(a)前記操作入力手段を用いたコマンドを入力する方法、あるいは、前記操作入力手段を用いた高級言語によりプログラムを記述する方法を通じて、前記画像処理の各処理項目で登録した番号もしくは文字列の名前を持つ前記オブジェクトを用いて前記画像処理の各処理項目の選択指定を行う内容の入力を受ける処理、並び替えを行う内容の入力を受ける処理、(b)先に実施した前記画像処理の処理結果を参照して次に続く前記画像処理を実施させる画像処理結果参照設定の内容の入力を受ける処理、および(c)前記画像処理の際に前記画像処理によって算出された演算結果である計測値を結果信号として出力させる出力設定の内容の入力を受ける処理、を行う画像処理装置である。
【0026】
請求項に記載の発明は、請求項に記載の画像処理装置であって、前記画像処理プログラムの前記処理項目の実行後に得られる処理結果に対して、さらなる演算処理を行うことが可能で、前記演算処理は、プログラミング言語で記述される画像処理装置である。
【0027】
請求項に記載の発明は、請求項または請求項に記載の画像処理装置であって、前記画像処理メニューにおいて、前記画像処理の各処理項目について、前記画像処理領域と前記設定事項の設定内容とを、番号もしくは文字列を用いて複数個、登録できる画像処理装置である。
【0028】
請求項に記載の発明は、請求項または請求項に記載の画像処理装置であって、前記プログラムメニューにおいて、設定を終了したプログラムを、番号もしくは文字列を用いて複数個、登録できる画像処理装置である。
【0029】
請求項に記載の発明は、請求項または請求項に記載の画像処理装置であって、前記画像処理メニューを、前記設定事項の一部を設定可能な簡易設定メニューと、前記設定事項の全てを設定可能な詳細設定メニューとで構成する画像処理装置である。
【0030】
請求項に記載の発明は、請求項または請求項に記載の画像処理装置であって、前記画像処理メニューあるいは前記プログラムメニューにおいて、最大3段階までの階層構造とするように構成する画像処理装置である。
【0031】
請求項に記載の発明は、請求項または請求項に記載の画像処理装置であって、前記画像処理メニューにおいて、前記画像処理の各処理項目ごとに試験的実行を行うことが可能な画像処理装置である。
【0032】
請求項に記載の発明は、請求項または請求項に記載の画像処理装置であって、前記プログラムメニューにおいて、設定した前記実行順で画像処理プログラムの試験的実行を行うことが可能な画像処理装置である。
【0033】
【発明の実施の形態】
<実施の形態1>
図1は、この発明の実施の形態1に係る画像処理プログラムの作成方法における処理フローを説明するための図である。図1において、画像兼グラフィック表示手段に表示されたメインメニュー(S1)より、各画像処理毎に用意された画像処理メニュー(S2)の1つ、例えば「2値特徴量」を選択すると、「2値特徴量」に対応した簡易設定メニュー(S21)が現れるので、画像兼グラフィック表示手段によって表示されている対象画像を見ながら、画像処理を行う画像処理領域および、必要最小限の画像処理パラメータを、操作入力手段を用いて設定する。
【0034】
さらに、詳細な画像処理パラメータを設定する必要があれば、詳細設定メニュー(S22)を選択して設定を行うが、詳細設定メニューによる設定はパスすることもできる。このように最初に簡易設定メニューを用いることで設定の手間を大きく省くことができる。
【0035】
次に、画像処理の試行(S23)を行い、望みの画像処理が正しく実行できているかを確認し、できていなければ、簡易設定あるいは詳細設定に戻って画像処理領域あるいは画像処理パラメータを設定し直す。なお、この試行(S23)は必ずしも行う必要はなく、パスすることも可能である。
【0036】
最後に、画像処理領域と画像処理パラメータが正しく設定できたら、番号もしくは文字列で構成された名前をつけて登録(S24)を行い、画像処理の内容を保存する。この際、例えば、最初に登録名を「2値特徴量01」として登録し、次に同じ画像処理で異なるパラメータをもつ処理については「2値特徴量02」として登録できるように構成する。このように、過去に記憶させた登録名に対して、内容に変更を加えた後、再度、記憶させようとしたときに、登録名を別名に変更して記憶させれば、異種の画像処理の設定が保存できるだけでなく、同種の画像処理に関しても複数のパラメータ等の設定が別名で保存できる。すると、後述するプログラムメニューにおいて、既設定の画像処理の利用や以前登録した画像処理を呼び出して変更すること(流用)が可能になり開発効率が向上する。登録後は自動的にメインメニュー(S1)に戻る。
【0037】
なお、この登録に関しては、例えば設定ごとにひとつのファイルとしてファイル名をつけて行うようにしてもよいし、複数の設定をまとめてひとつのファイルとしてファイル名をつけて行うようにしてもよい。また、ファイル形式ではなく、画像処理手段内の記憶領域に全ての設定の登録を行うようにしてもよい。
【0038】
1つ以上の画像処理の設定、登録が完了していた場合、メインメニュー(S1)からプログラムメニュー(S3)を選択することができる。プログラムメニューでは、既に登録されている異種あるいは同種の画像処理を、任意に複数個選択し、その実行順番を設定できる(S311)。
【0039】
例えば、異種の画像処理ならば「2値特徴量01」と「輝度計測01」、同種の画像処理ならば、「2値特徴量01」と「2値特徴量02」などを選択し、並べ替えをすることができる。登録された画像処理の選択、実行順の指定だけでは、希望する処理結果が得られない場合、例えば、画像処理の計算結果に対して、(画像処理Aの結果+画像処理Bの結果)などの数値計算(実施の形態3にて詳述)が必要な場合は、数値計算設定(S312)を選択して、数値計算の手順を設定する。この数値計算設定(S312)は必ずしも行う必要はなく、パスすることも可能である。
【0040】
次に、画像処理を複数行った場合など、画像処理結果が複数得られている場合に、どの処理結果を出力するかを設定する(S313)。
【0041】
次に、プログラムの試行(S314)を行い、選択、順序設定した画像処理が正しく実行できているかを確認し、できていなければ、画像処理のプログラムメニューの設定を見直す、あるいは、画像処理メニューに戻って画像処理の設定を見直す。なお、この試行(S314)も必ずしも行う必要はなく、パスすることも可能である。
【0042】
最後にプログラムが正しく設定できたら、番号もしくは文字列で構成された登録名をつけて登録(S315)を行い、プログラムの内容を保存する。この際、例えば登録名を「プログラム01」として登録し、次に別のプログラムについては「プログラム02」として登録して、複数のプログラムの設定が保存できるように構成する。
【0043】
このように、過去に記憶させた登録データに対して、内容に変更を加えた後、再度、記憶させようとしたときに、登録名を別名に変更して記憶させれば、複数のプログラムが管理でき、また、画像処理実行時にプログラムの切り替えを行うことができて有用である。また、プログラム作成時においても以前登録したプログラムを呼び出して変更すること(流用)が可能になりプログラム開発効率が向上する。登録後は自動的にメインメニュー(S1)に戻る。
【0044】
最低1つの画像処理が登録されていないとプログラムの作成はできないが、一旦、プログラムを作成した後に、画像処理を追加設定し、それをプログラムで追加選択するということも可能である。すなわちプログラムで用いる画像処理の設定が、あらかじめ全て終わっていないとプログラムが作成できないということはなく、画像処理設定とプログラム設定は、交互に、同時進行的に進めることが可能である。
【0045】
また、環境設定メニューなど(S4)は、画像処理装置に接続するカメラの種類の設定など、装置の環境に関係した設定を行うメニューである。このメニューの設定はプログラム作成前に行うのが通常であるが、カメラを変更した時など、プログラム作成後に設定を行ってもかまわない。
【0046】
図2は、実施の形態1の画像処理プログラムの作成方法を適用する画像処理装置を説明するための図である。図2において、1は起動信号、2は画像撮像手段、3は画像処理手段、4は画像兼グラフィック表示手段、5は操作入力手段、6は出力結果信号である。
【0047】
起動信号1は画像処理手段3に対して、処理実行命令を行う信号である。起動信号1は操作入力手段5より発生させることも可能である。画像撮像手段2は、例えばCCDカメラなどにより構成される。
【0048】
画像処理手段3は、ROMおよびRAM等が接続された一般的なCPU内において所定のソフトウェアプログラムによって動作する機能部品であって、本発明による画像処理プログラム作成方法を実行する手段が含まれている。画像処理プログラム作成時には、画像処理手段3がメニューを表示し、画像撮像手段2、画像兼グラフィック表示手段4、操作入力手段5と連携動作して人間のプログラム作成を支援する。
【0049】
プログラム実行時には、画像処理手段3は起動信号1を受けて、プログラムが指定する画像撮像手段2を用いて画像を撮像し、画像処理を実行し、画像処理結果である出力結果信号6を出力する。複数のプログラムが登録されている場合は、どのプログラムを実行するかの情報が含まれている起動信号1を受けて、設定保存されているプログラムのうち正しいプログラムを選んで、プログラムの実行を行う。
【0050】
操作入力手段5は主としてマウスなどのポインティングデバイスのみで構成されるが、キーボードとマウスなどの入力装置で構成する場合もある。出力結果信号6は、同時に画像兼グラフィック表示手段4に出力して結果をグラフィック表示しても良い。
【0051】
また、上記図2では、画像処理プログラム作成方法が画像処理手段3に装備されている場合について説明したが、画像処理プログラム作成方法が必ずしも画像処理手段3に含まれていなくてもかまわない。
【0052】
例えば、図3の様に、画像処理装置に対して、LANケーブル等の接続手段10によってパーソナルコンピュータ7を接続し、パーソナルコンピュータ7上で画像処理プログラム作成方法を実行しても良い。この際はパソコンの操作入力手段9と表示手段8とを用いてプログラミング操作を行う様にしてもよい。あるいは、画像処理装置と画像処理プログラム作成方法を実行する装置が直接に接続されていなくてもかまわない。この際は、作成されたプログラムデータを、例えばフロッピーディスク、MO、フラッシュPCカードなどの記録媒体を用いて画像処理装置に移動すればよい。
【0053】
次に、動作とフローについて詳細に説明する。図4は本発明の画像処理のプログラム作成方法におけるメニューの初期状態の構成例を示すものである。初期状態では、メインメニュー11(ファイル管理11a、画像処理設定11b、プログラム設定11c、環境設定11d、ツール11e、バージョン情報11fの各コマンドが表示されている)と、画像表示部分12と、コマンドメニュー13(オンライン/オフライン切り替え13a、複数カメラ切り替え13b、画像のライブ/フリーズ表示切り替え13c、表示画像上への線画のオーバレイ表示の切り替え13dなどのボタンスイッチなどが並ぶ)と、操作入力手段5によって制御されるポインタ14とが表示されている。また、図4ではXY座標系を示す基準線12aが線画としてオーバレイ表示されている。コマンドメニュー13の画像ライブ/フリーズ表示切替ボタン13cによって、カメラから画像を取りこみ、表示することができる。
【0054】
なお、ここでいう「オンライン/オフライン」とは、起動信号1が受付可能となっているかどうかを指し、この画像処理装置に起動信号1を発する別の装置(図示せず)からの起動信号1を受け付けるかどうか、を示している。
【0055】
また、ここでいう「ライブ/フリーズ」とは、動画表示か静止画表示かを示す。より正確には、画像撮像手段2が現在撮像中の動画を表示させるか、過去に撮像した静止画像データを表示させるか、を表す。
【0056】
図5は、画像撮像手段2から画像を取り込み、画像表示部分12に画像12b(例として野菜の画像)を表示した後、メインメニュー11を表示している状態(図1のS1)から、画像処理メニュー11bを選択した状態を示す(図1のS2)。
【0057】
このとき図5の様に画像処理メニュー一覧15がプルダウンし、複数の画像処理の処理項目が選択できる様になる。図5では、画像処理の処理項目として濃淡テンプレートマッチング、2値特徴量、輝度計測、濃淡エッジ計測、2値エッジ計測の5つが選択できるようになっている。
【0058】
ここでいう濃淡テンプレートマッチングとは、濃淡画像を用いたテンプレートマッチング(テンプレートと呼ばれる基準画像を対象画像から探し出してその場所や一致度(スコア)を出力する画像処理のこと)を指す。また、2値特徴量とは、画像を2値化し、その画像内の白画素あるいは黒画素について塊毎にラベル付けを行い、その各々の画素塊毎に、面積、重心などを計測する画像処理である。輝度計測とは、濃淡画像の輝度を計測し、ある領域内の画素についてその輝度の平均値や分散値などを計算する画像処理のことである。そして、濃淡エッジ計測、2値エッジ計測は、濃淡画像や2値画像に現れるエッジ(輝度勾配が大きい部分)の位置を求める画像処理のことを指す。
【0059】
以下では、2値特徴量が選択された場合を例にとって説明する。上記メニューで2値特徴量を選択すると、図6の様に、設定事項を一覧可能に表した画像処理メニューの1つである2値特徴量メニュー16が表示される(図1のS21)。2値特徴量メニュー16は、簡易設定メニューとなっており、2値特徴量計測についての最低限のパラメータの設定、すなわち、2値化方法設定、および2値化方法に伴うパラメータ(図6に示される「固定しきい値」を用いた2値化方法の場合は2値化レベルがそれに相当する。また、「Pタイル2値化」方法(ある領域に関して、予めPタイル値と呼ばれる全体の画素に対する白画素の割合を指定しておき、白画素の割合が指定したPタイル値になるように2値化のしきい値を計算し、そのしきい値で2値化を行う方法)ならば、画像中に占める白画素の割合がそれに相当する)、と画像処理領域の設定のみが可能である。
【0060】
新規に画像処理を設定する際は、処理Noを指定するドロップダウンリストより、画像処理が未登録であることを示す例えば灰色化された名前(番号)のうちから名前を一つ選択する。既に登録された画像処理プログラムを変更する場合は、ドロップダウンリストより例えば黒色化された名前のうちから画像処理を選択する。
【0061】
2値化方法の設定は、ドロップダウンリストの中から項目を選択できる様になっており、ポインタ14によるボタン操作(クリック操作)だけで簡単に選択できる。また2値化レベルも、スライダあるいはアップダウンボタンの操作で簡単に設定できる。
【0062】
なお、処理領域は既定値として全画面になっているが、2値特徴量メニュー16の「領域」ボタンを押すことで設定できる。「領域」ボタンを押した後の画面の状態である領域設定画面を図7に示す。領域設定画面ではポインタ14を用いて、画像処理領域17を視覚的に容易に設定することができる。また操作入力手段がキーボードなどの場合、コマンドメニュー上で処理領域を示すボックス(始点X、Y、幅X、Y)に値を設定することでも画像処理領域を設定できる。
【0063】
細かな設定の必要がなければ、この簡易設定メニューの設定だけで、2値特徴量の設定を終了することができるが、さらに詳細な設定を行う場合には、簡易設定メニューである2値特徴量メニュー16中の「詳細設定」ボタンを押すと、図8に示される2値特徴量詳細設定メニュー18が表示される(図1のS22)。
【0064】
ここでは、簡易設定では設定できないすべての画像処理パラメータが設定可能である。例えば、測定する2値塊対象を白画素あるいは黒画素にする設定、計測する2値特徴量の種類の設定、3×3膨張フィルタ(注目画素の周囲8画素中での最大の輝度値に注目画素の輝度値を修正する処理)や3×3収縮フィルタ(注目画素の周囲8画素中での最小の輝度値に注目画素の輝度値を修正する処理)に代表される各種ノイズフィルタなど2値特徴量を計算する前の前処理の設定、計算結果の出力順番を指定の項目に応じて整列させる機能である結果ソーティング機能の設定も可能である。
【0065】
野菜の画像12bを用いたここでの例の場合、対象である野菜は背景より暗いので、測定する2値塊を黒画素にすれば良い。設定を完了後、2値特徴量詳細設定メニュー18の「確定」ボタンを押すと、2値特徴量メニュー16に戻る。
【0066】
次に、2値特徴量メニュー16中の「試行」ボタンを押して(図1のS23)、設定したパラメータで画像処理が正しく動作するかを調べる。「試行」ボタンを押すと図9に示すように試行結果の画像19aが表示され、同時に画像処理の試行結果19bも表示される。ここで希望する結果が得られなかった場合、2値特徴量メニュー16あるいは2値特徴量詳細設定メニュー18に戻って設定をやり直す。なお、この「試行」は設定に関して必須の操作ではなく、飛ばしてもかまわない。
【0067】
設定完了後、2値特徴量メニュー16の「登録」ボタンを押すと「処理No」で指定された文字列(この例の場合は「2値特徴量01」)で設定したパラメータが登録できる(S24)。
【0068】
また、2値特徴量詳細設定メニュー18の「コピー」、「ペースト」ボタンを用いると、既存のパラメータ設定のデータを別の登録名で登録できる。例えば、既存の登録データ「2値特徴量02」について、ユーザが、2値特徴量詳細設定メニュー18を開き、「コピー」ボタンを押すと、画像処理手段3は、パラメータ値をいったん画像処理手段3の一時メモリ内に記憶させ、次に「処理No」のドロップダウンリストを表示する。ここでパラメータが設定されていないことを示す灰色表示されたパラメータ設定名「2値特徴量03」をユーザが選択し、「ペースト」ボタンを押すと、コピーされたパラメータ値が表示される。ここでユーザが「設定」ボタンを押すと、自動的に「処理No」は「2値特徴量03」にされ、2値特徴量メニュー16に戻る。
【0069】
ここで「登録」ボタンを押せば、「2値特徴量02」のパラメータ設定を別の登録名「2値特徴量03」で登録できる。登録後は、登録名は例えば黒色表示される。なお、ある画像処理について雛型のパラメータをつくっておき、この雛型の画像処理について上記の方法で別名で登録し、これに変更を行い実験するという使い方も可能である。
【0070】
登録したパラメータ設定の登録データの削除は、次の様に行う。まず2値特徴量メニュー16で、「処理No」のドロップダウンリストで削除したいパラメータ設定の登録名(例えば「2値特徴量03」)を選択する。この操作により過去に登録したパラメータを呼び出して参照したことになる。次に「削除」ボタンを押せばパラメータ設定は削除される。削除されるとパラメータ設定名は例えば灰色化する。
【0071】
以上の様にして、各画像処理毎に操作入力手段5を用いて視覚的にパラメータ設定を行い、番号もしくは文字列で登録名をつけて登録していく。
【0072】
なお他の画像処理の例として、図10に輝度計測メニュー(簡易設定メニュー)20a、図11に領域設定画面、図12に輝度計測詳細設定メニュー20dを示す。輝度計測の場合は、1つのパラメータ設定(例えば「輝度計測01」)で複数の処理領域20b、20cを設定できるように構成している。
【0073】
画像処理を1つ以上登録した後は、メインメニュー11よりプログラムメニュー11cを選択し、画像処理の実行順序等の設定を含むプログラムを規定する。図13は、プログラムメニュー21が表示された図である(図1のS3)。なお、図13では、プログラムメニュー21が表示領域の大部分を覆ってしまっているため見えないが、画像処理の対象画像である画像12bは画像表示部分12に表示され続けている。
【0074】
新規にプログラムを記述する際は、プログラムNoを指定するドロップダウンリストより、プログラムが登録されていないことを示す例えば灰色化された番号のうちからプログラム番号を一つ選択する。既に登録されたプログラムを変更する場合は、ドロップダウンリストより例えば黒色化された番号のうちからプログラム番号を選択する。
【0075】
次に、既に登録した画像処理の処理項目を選択して、その順番、出力設定を規定する(図1のS311)。最初の位置補正とは、濃淡テンプレートマッチングなどの位置ズレ量が計測できる画像処理を用いることで、あらかじめ設定された画像処理領域の位置補正を行う処理である。画像処理の対象の位置決め精度が悪い場合は、まず位置補正に用いる画像処理で位置ズレ量を計測し、その計測結果を参照して、既にパラメータ設定されている画像処理領域の位置を補正する。
【0076】
もちろん画像処理対象の位置決め精度が十分あればこの位置補正は不要である。位置補正処理に用いる画像処理は、例えば、濃淡テンプレートマッチングや濃淡エッジ計測などがあげられる。位置補正処理が必要な場合は、既に登録されている画像処理から適切な画像処理を(例えば濃淡テンプレートマッチング処理における設定「濃淡TM01」など)を選択する。
【0077】
次に、画像処理の処理項目の順番を規定する。「画像処理」という項目中の「選択」ボタンを用いて、既に登録してある画像処理を追加選択する。選択できる画像処理は、ユーザが登録した画像処理だけでなく、パラメータ不要の定型画像処理、例えば3×3ロバーツエッジフィルタ(注目画素の周囲8画素中の所定の画素の輝度値を用いて注目画素の輝度値を修正する処理)なども選択可能である。画像処理の順番の変更は「↑上」、「↓下」ボタンを用いて、画像処理の削除は「削除」ボタンを用いて行うことができる。
【0078】
なお、画像処理のうち2値特徴量における2値化処理や、3×3ロバーツエッジフィルタなどのフィルタ処理は対象画像を加工して、次の画像処理に画像をわたす。したがって画像処理の順番は、画像処理結果に影響を及ぼす。一方、各画像処理設定で存在する前処理はその画像処理を行う際に一時的に画像を加工するだけであり、後続する画像処理に引きわたす画像を加工するわけではない。
【0079】
あらかじめ設定された画像処理の処理項目を選択して並べるだけでは不十分で、画像処理結果を四則演算などで加工する必要がある場合は、「数値計算」を「有」にし、「フロー」で数値計算の処理フローを記述する(図1のS312)。「数値計算」については実施の形態3において記述する。
【0080】
次に、画像処理の出力設定を行う(図1のS313)。画像処理の順番である「1」〜「6」の左横にあるチェックボックスにチェックマークをいれると、その画像処理で計測された計測値を出力結果信号6として出力する。ここでは、必要な画像処理にだけチェックマークを付けることができ、処理のフローとしては必要だが、結果出力は必要でない画像処理についてはチェックしないことで、不要なデータの出力を行わないようにできる。なお、位置補正処理に関しても、位置補正のチェックボックスにマークすることで見つかった位置や位置ずれ量などの出力を行うことができる。
【0081】
その他、使用するカメラの番号、結果出力の座標系を、画像座標で行うのか、それとも外界の世界(ワールド)座標系で行うのか、単位は画素単位であるか、物理単位(mm)であるか、レンズの光学的歪みを補正したデータを参照し、出力を歪み補正して出力するかどうかの選択を行う。ただし、世界座標系の選択、物理単位の選択、歪み補正の利用を行うためには、あらかじめ、外界座標と画像座標の間で変換係数を求めておく操作(キャリブレーション)が必要である。本発明の実施の例では、キャリブレーション操作は、図4のメインメニュー11の「ツール」に含ませておき、「ツール」を選択したときに、キャリブレーション操作、データ登録が可能となるようにすればよい。
【0082】
画像処理の選択、順番決定、画像処理結果出力設定が終了し、プログラムメニュー21の「試行設定」を行なった後、「試行」ボタンを押すと、図14に示される試行画面が表示され、画像処理結果21bを確認することができる(図1のS314)。この試行画面では、選択した既登録の画像処理のパラメータ設定の登録名(例えば「輝度計測01」)で画像処理結果が参照できる。希望する結果が得られなかった場合は、プログラムメニュー21にもどって画像処理の処理項目の選択、並び替えを変更、あるいは、画像処理メニューに戻ってパラメータ設定の変更、画像処理の処理項目の追加設定等を行う。
【0083】
なお、「試行設定」は、「現画像についてテスト(1回)」、「画像取込後テスト(1回)」、「画像取込後テスト(連続)」から選択できるようにしている。「現画像についてテスト(1回)」とは、現在、画像処理手段3中の画像メモリ内にある画像データ(例えば外部から読み込んだ画像データなど)に対して試行動作を行うことを指す。また、「画像取込後テスト(1回)」とは、画像撮像手段2から新しく画像データを取り込んで、その画像データに1回の試行を行うことを指す。また、「画像取込後テスト(連続)」とは、画像撮像手段2から新しく画像データを取り込んで、その画像データに試行を行った後、再び画像撮像手段2から新しく画像データを取り込んで、その画像データに試行を行い、中断するまでこれを繰り返すことを指す。これらの試行は、画像処理プログラムに必須の操作ではないのは、画像処理の設定と同様である。
【0084】
設定完了後、プログラムメニュー21の「登録」ボタンを押すと、「処理No」で指定した登録名(図13の場合は「プログラム01」、あるいは「01」となる)で、プログラムが登録できる(図1のS315)。なお、図13では画像処理の内容を自動的にコメントとして含めて表示している(「プログラム01:輝度計測、2値特徴量」と表示している)。
【0085】
「コピー」「ペースト」ボタンは画像処理メニューと同様の使い方であり、プログラムを別名で登録する場合や、雛型としてプログラムをコピーした後、変更を行う場合などに用いる。また、「削除」ボタンはプログラムの削除に用いる。「取消」ボタンは、設定を行わずにプログラムメニューを閉じる場合に用いる。
【0086】
上記で説明した手順でプログラムを作成後、実際の画像処理プログラムの処理実行は、起動信号1によって行われる。通常、起動信号1には起動するプログラムNoの情報が含まれており、この情報により画像処理手段3は、所定のプログラムを実行し、結果出力手段6に画像処理結果を出力する。
【0087】
本実施の形態に係る画像処理プログラム生成方法および画像処理装置によれば、画像処理装置が、ユーザが画像処理プログラムの作成を行う際に、対象画像を画像兼グラフィックス表示手段4に表示させる。よって、ユーザは、画像処理プログラムを視覚的に確認しつつ作成することができ、濃淡テンプレートマッチング処理など、対象画像を見ながら各種の設定を行う必要のある画像処理プログラムを容易に作成できる。
【0088】
また、画像処理の各処理項目ごとの設定事項には、対象画像のうち全部または一部を画像処理の対象として設定する事項が含まれる。よって、ユーザは全画面でなく特定の部分領域のみに対する画像処理の設定および実行が行える。
【0089】
また、画像処理手段3は、ユーザが行った画像処理の処理項目ごとの設定事項の設定、および/または、ユーザが行った処理項目の実行に関する設定(プログラムの設定)を、登録データとして記憶可能である。よって、1つのプログラムのフロー中で同一の画像処理を複数回行う場合や、異なる画像処理プログラム間で同じ画像処理を既設定の設定事項をそのままにして流用したい場合、同種の画像処理だが設定事項のパラメータの一部を異なる値に変えて使いたい場合などに、ユーザは過去に行った登録データを呼び出して、画像処理プログラム作成に簡単に流用することができる。また、ユーザが、過去に記憶させた登録データに対して、内容に変更を加えて、再度、記憶させようとしたときに、画像処理手段3は、登録データの登録名を別名に変更して記憶する。よって、同種の画像処理だが設定事項のパラメータの一部を異なる値に変えて使う場合に、自動的に過去に行った登録データと区別して新たな登録データとして記憶させることができる。
【0090】
また、画像処理手段3は、処理項目ごとの設定事項をメニュー形式で表示し、メニュー形式には、設定事項の一部を設定可能な簡易設定メニュー形式と、設定事項の全てを設定可能な詳細設定メニュー形式とが含まれる。よって、必要性に応じて、容易に画像処理プログラムを作成することも、詳細に画像処理プログラムを作成することも、可能となる。
【0091】
また、画像処理装置は、画像処理プログラムの作成を行う際に、設定された設定事項に基づく対象画像への画像処理の試行結果、および/または、設定された実行に関する設定(プログラムの設定)に基づく対象画像への画像処理の試行結果、を画像兼グラフィックス表示手段4に表示させることが可能である。よって、ユーザは、設定事項が希望どおりに設定されたか、および/または、画像処理プログラムが希望どおりに実行されるか、について判定することができ、容易に画像処理プログラムの動作を確認することができる。
【0092】
なお、本実施の形態では、画像処理メニューは、画像処理(簡易設定)メニュー、画像処理詳細設定メニューの2段階で構成しているが、これに補助的なメニューを加えて3段階での構成にしてもよい。3段階を超えるメニューは入れ子が深すぎて、ユーザに使いづらい構成となるので避けるのが望ましい。
【0093】
また、本実施の形態では、プログラムメニューは1段階であるが、実施の形態3で詳述する数値計算のメニューを入れると2段階となる。これに補助的なメニューを加えて3段階での構成にしてもよい。3段階を超えるメニューは入れ子が深すぎて、ユーザに使いづらい構成となるので避けるのが望ましい。
【0094】
また、本実施の形態では、画像処理メニュー、およびプログラムメニューに試行の機能を設けているが、これは画像処理の設定およびプログラムの設定に必須のものではなく、必ずしも本発明において具備していなければならない機能ではない。
【0095】
また、本実施の形態では、画像処理パラメータの組み合わせを異なった文字列の名前で複数登録できる様に構成しているが、最低1つ以上、登録できればよい。同様にプログラムも異なった文字列の名前で複数登録できる様に構成しているが、最低1つ以上登録できればよい。
【0096】
<実施の形態2>
本実施の形態では、プログラムが操作入力手段5によるタイピング動作を主としたコマンド入力方法あるいは高級言語によるプログラミング記述方式を用いて、前記プログラムメニューを構成する場合の一例について説明する。
【0097】
図15は、本実施の形態における画像処理プログラム作成方法の処理フローを説明するための図である。なお、本実施の形態においては、画像処理の設定方法に関しては、実施の形態1と全く同様の方法で行うことができるため、実施の形態1と異なる点、すなわちプログラムメニューの構成(S3,S321〜S324)について説明する。
【0098】
図16は本実施の形態におけるプログラムメニューの構成例である。プログラムメニュー23では、コマンド入力、あるいは高級言語プログラミング開発が可能な開発環境が提供される。このプログラムメニュー23は、プロジェクトウィンドウ24、コードウィンドウ25、アウトプットウィンドウ26および各種ボタンで構成され、この例では、プログラム番号1つについて、1つのプロジェクト(ひとつの実行モジュールを作成する際に必要なソースプログラム、コンパイル条件、各種環境設定などを一まとめにしたデータ)が管理されている。そして、プロジェクトを構成するソースファイル名はプロジェクトウィンドウ24に表示され、ソースファイルの内容はコードウィンドウ25に表示される。ソースコードウィンドウ25で表示されているソースファイル名は、プロジェクトウィンドウ24で例えば灰色マーク付きで表示されている。アウトプットウィンドウ26は、デバッグ時の変数の監視や、ソースコードのビルト時のエラーを表示するのに用いられる。
【0099】
次に動作について詳細に説明する。最初にプログラムを作成する場合は、プログラムNoを指定し、「プロジェクト設定」ボタンを押す。「プロジェクト設定」ボタンでは、ソースファイルの追加指定や、開発に用いる高級言語に関する各種設定など、開発に伴う環境設定を行う(図15のS321)。
【0100】
プロジェクトの設定がおわると、プロジェクトウィンドウ23にソースファイル名が表示されるので、そこで編集したいソースファイル名をクリックする。するとコードウィンドウ24にソースコードであるソースファイルの内容が表示されるので、キーボードとマウス等の操作入力手段5を用いてソースコードの編集を行う(図15のS322)。既登録のプログラムに関しては、プログラムNoを指定した段階でプロジェクトの読み込みが行われる。
【0101】
なお、図16では、開発用の言語としてC++を用いて、濃淡テンプレートマッチングを行う例を示している。ここでは、画像処理メニューを用いて既に設定済みの処理項目(濃淡テンプレートマッチング01)を、TM[1]というオブジェクトの配列で用いている。[]内の配列の添字はプログラムNoに一致している。
【0102】
例えば、濃淡テンプレートマッチングの実行はTM[1]に関するメンバ関数呼び出しの形で実現でき(図16の例ではTM[1].Exec()の呼び出し)、実行結果の参照は、TM[1]のオブジェクトのメンバ変数を参照することで実現できる(図16の例では、TM[1].Cand[1].xの参照など。Cand[1]は濃淡テンプレートマッチングの第1候補を指す)。
【0103】
このようにして、既に設定された画像処理を、それに相当した既定のオブジェクトを用いることで、容易に使用できる。さらに、異なるプログラムに対して大域的に用いることのできるオブジェクトまたはオブジェクト配列を準備しておくと、異なるプログラム間で結果のやりとりを行うことも可能になる。すなわち、異なるプログラム間でデータの受け渡しができるように、データを譲渡するプログラムが終了した後も、そのデータを保持して、データを受領するプログラムに受け渡すことが可能な領域を、メモリの中にオブジェクトまたはオブジェクト配列として設けておくのである。
【0104】
例えば、大域的なオブジェクト配列GLOBAL[]を設けておき、「プログラム01」の実行で計算した値をGLOBAL[1]に、「プログラム02」の実行で計算した値をGLOBAL[2]に代入しておくと、「プログラム03」の実行時には、GLOBAL[1]とGLOBAL[2]を参照して、そこに記憶されたデータを計算に用いることができるようにしておく。
【0105】
ソースコードを作成後、プログラムメニュー23の「ビルド」ボタンを押すと、ソースコードをコンパイルしたオブジェクトコード、あるいは中間コードが生成される(図15のS323)。なお使用する言語の種類によってはビルド操作が不要な場合もある。
【0106】
ビルドの際、文法エラーがあると、アウトプットウィンドウ26に、エラーの内容、エラーの生じた行番号などの情報が表示されるので、この情報に基づいてソースコードをデバッグする(図15のS324)。ソースコードが完成すると、プログラムメニュー23の「試行」ボタンを押すと試行が行われ、実行結果が図14のような形で表示されるのは、実施の形態1と全く同様である(図15のS324)。
【0107】
また、試行時においても文法エラーが生じた場合には、プログラムメニューのアウトプットウィンドウ26に、エラーの内容、エラーの生じた行番号などの情報が表示されるので、この情報に基づいてソースコードをデバッグすることが可能である。その他にも、プログラムメニュー23の「デバッグ」ボタンを押してデバッグ設定を行うことで、ソースプログラムにおけるブレークポイント(一時停止点)の指定や、ステップ実行(プログラムの各行の逐次実行)、ウオッチする変数の登録などの各種のデバッグ操作が可能になる。ウオッチする変数は、例えばアウトプットウィンドウ26内に表示することができる。
【0108】
その他のボタン、例えば「プログラムNo」を選択するボタンや、「コピー」、「ペースト」、「登録」、「削除」、「取消」ボタンの使い方は、実施の形態1と同様であり、プログラム作成後は「登録」ボタンを押して画像処理プログラムを登録する(図15のS325)。
【0109】
このように、プログラムメニューを、コマンド入力方法あるいは高級言語によるプログラミング記述方式を用いて構成すると、前記実施の形態1で説明した、ボタン操作を主とした視覚的な操作方法によるプログラミングと比較してプログラムの柔軟性が飛躍的に向上する。
【0110】
例えば、前記実施の形態1で説明した、ボタン操作を主とした視覚的な操作方法によるプログラミングでは、1つの画像処理結果(画像処理で得られた直接のデータ)を参照して、あるいは、画像処理結果の加工後のデータ(画像処理で得られた直接のデータにさらに加減乗除等の数値計算を行うなどして得られたデータ)を参照して次の画像処理を行うことは不可能ではない(前述した「位置補正」では計測した位置ずれ量を用いて、以下に続く画像処理の処理領域を変更することを行っている)。しかし、一般的にはやりにくい。
【0111】
一方、本実施の形態によるプログラム作成方法では、このような制限は一切生じない。なお、この実施の形態で用いられる開発言語は、例にあげたC++に限らず、特別に設計されたコマンド形式でも良いし、他の高級言語、例えば、JAVA, BASICなどでもよい。
【0112】
<実施の形態3>
本実施の形態では、実施の形態1で説明したプログラムメニュー21における「数値計算」の構成について詳細に説明する。実施の形態1では、処理項目の選択や順番の指定は可能であるが、画像処理結果のデータに対する加減乗除など、より複雑な処理の設定は、そのままでは不可能である。「数値計算」はそれを補う機能を有している。
【0113】
図13のプログラムメニュー21において「数値計算」ボタンを「有」に設定し、「フロー」ボタンを押した時に表示される数値計算フローメニュー27の構成例を図17に示す。図17の数値計算フローメニュー27では、選択された画像処理の実行結果について、数種のコマンドを所定のプログラミング言語で記述することにより、加減乗除計算、sin、cos等三角関数の計算、絶対値の計算などの数値計算が行える様になっている。また、簡単な条件分岐も記述できる。図17の数値計算フローメニューのコマンド形式は、例えば、
1.変数 変数(画像処理結果)
2.変数 即値
3.変数 関数[変数、変数、…]
4. 文[変数または即値]
といった文法になっており、変数が左端に現れている場合、その変数を左辺値として、即値、変数、あるいは関数の返す値を左辺値に代入するという意味になっている。例えば、図17の数値計算フローメニュー27中の1行目の、
A01 TM01.S.1
は、A01という一時変数に対して、濃淡テンプレートマッチング01の画像処理結果のうちマッチング対象の第1候補のスコアS.1が入っている変数の値を代入している。すなわち
A01 = TM01.S.1
という意味である。また、5行めの
C01 1.000
は、C01という特別な変数に対して1.000という即値を代入している。つまり、
C01 = 1.000
という意味である。なお、C01などCで始まる変数に代入された値は、画像処理結果として外部に値が出力される。
【0114】
また、3行目の
A03 GTR A01 A02
は、A01 > A02 ならば、一時変数A03に値1を代入し、そうでなければ値0を代入する。GTRはGreaTeR than を略したコマンドである。その他にも、GTE(Grater Than Equal)、LST(LeSs Than)、LSE(LeSs than Equal)などの比較コマンドや、ABS(ABSolute)などの絶対値コマンド、ADD(加算)、SUB(減算)、MUL(乗算)、DIV(除算)、MOD(剰余)の四則演算関数コマンドや、SIN(sin)、COS(cos)、ATN(ArcTaN)、SQR(SQuare Root)などの関数コマンドも存在する。
【0115】
なお、4、6、8行目は、IF 〜 THEN 〜 ENDIFの条件分岐の文コマンド(ステートメント)であり左辺値をとらない。
【0116】
また、「コメントにする」ボタンを用いることで、ある行をコメント行にすることも可能である。その際は、行の先頭にREM(REMark)が表示され、例えば
REM A02 70.000
となる。
【0117】
これらのコマンドの入力は、操作入力手段5のマウスなどのポインティングデバイスを用いて、数値計算フローメニューで視覚的に行うことができる。まず左辺値である変数を選択し、次に関数、結果、変数、即値のうち、いずれか1つを選んで設定する。画像処理結果は例えば、濃淡テンプレートマッチングならTM??(?には数字が入る)、2値特徴量ならBA??、輝度計測ならGM??、濃淡エッジ計測ならGE??、2値エッジ計測ならBE??で参照できる。これらの参照名は、画像処理の登録時の登録名の文字列とリンクした関係になっているので、数値計算の処理フローにおいても容易に画像処理結果を参照することができる。
【0118】
以上の説明より、図17に示した数値計算例は、濃淡テンプレートマッチング01の第1候補のスコアが70より大きければ、結果として値1を出力し、そうでなければ値ゼロを出力するというものであることがわかる。
【0119】
この他にも、例えば2つの物体の位置の中心を計算するという応用もある。この場合、画像処理で2つの物体のそれぞれ位置を求めたあとに、各座標の平均を求めれば良い。すなわち、実施の形態1において記述した(画像処理Aの結果+画像処理Bの結果)に相当する。これは、前記のADD,DIV関数を用いることで容易に実現できる。
【0120】
この数値計算はプログラム間にまたがる画像処理結果の計算にも使用することができる。図13のプログラムメニュー21において、「プログラム03」の設定で、画像処理になにも選択せず、カメラ入力を「無」にし、数値計算だけ設定する。各プログラムが使用する数値計算の変数(例えば前述のA01や、TM01.S.1)が、プログラム終了後も値が保持される様に構成、あるいは設定しておくと、例えば「プログラム01」で値が代入されたA05と「プログラム02」で値が代入されたA01に関して、「プログラム03」の数値計算で
C01 ADD A05 A01
とし、「プログラム01」と「プログラム02」の実行後に「プログラム03」を実行すれば、「プログラム01」の画像処理結果と「プログラム02」の画像処理結果を加工し(この場合は加算)、その結果を変数C01として出力することが可能になる。
【0121】
この様に、実施の形態1において数値計算方法を付加して用いると、画像処理の四則演算ができる。また、そのほかにも例えば、画像処理結果のデータが輝度値等である場合は、設定されたしきい値を超えるかどうかの判定を結果出力することも可能になる。
【0122】
本実施の形態に係る画像処理プログラム生成方法および画像処理装置によれば、画像処理プログラムの処理項目の実行後に得られる処理結果に対して、さらなる演算処理を行うことが可能で、その演算処理は、プログラミング言語で記述される。よって、画像処理により得られた処理結果に対して、所望する演算処理を、プログラミング言語で詳しく正確に記述することができ、複雑な画像処理を行うことも可能となる。
【0132】
【発明の効果】
請求項1に記載の発明によれば、画像処理手段は、画像処理の各処理項目ごとの設定事項の設定内容の入力を受ける処理と、画像処理の各処理項目の実行順の設定内容の入力を受ける処理とを、各々異なる画面を介して行う。そして、画像処理の各処理項目ごとの設定事項の設定内容の入力においては、画像処理手段は、画像兼グラフィック表示手段に対して、対象画像と画像処理の各処理項目毎の設定事項を一覧可能に表した画像処理メニューとを表示させ、対象画像を画像兼グラフィック表示手段に対して表示させつつ操作入力手段を用いた操作を通じて、対象画像のうち全部または一部を画像処理領域として決定する内容の入力を受ける処理を行い、操作入力手段を用いた画像処理メニュー中の項目を選択する視覚的な操作方法を通じて、設定事項の設定内容の入力を受ける処理を行い、画像処理領域と設定事項の設定内容とを番号もしくは文字列を用いて名前を付けてメモリに記憶させる内容の入力を受ける処理を行う。また、画像処理の各処理項目の実行順の設定内容の入力においては、画像処理手段は、画像兼グラフィック表示手段に対して、実行順の設定を一覧可能に表したプログラムメニューを表示させる。さらに、画像処理手段は、操作入力手段を用いたプログラムメニュー中の項目を選択する視覚的な操作方法を通じて、画像処理の各処理項目でメモリに記憶された番号もしくは文字列を用いて画像処理の各処理項目の選択指定を行う内容の入力を受ける処理、並び替えを行う内容の入力を受ける処理、先に実施した画像処理の処理結果を参照して次に続く画像処理を実施させる画像処理結果参照設定の内容の入力を受ける処理、画像処理の際に画像処理によって算出された演算結果である計測値を結果信号として出力させる出力設定の内容の入力を受ける処理を行う。よって、画像処理各処理項目の設定事項の設定、各画像処理領域の設定、および画像処理の実行順の設定などの一連の画像処理のプログラムがマウスなどの操作入力手段を用いて視覚的な簡単操作で容易に作成できるという効果がある。
【0133】
請求項2に記載の発明によれば、画像処理手段は、画像処理の各処理項目ごとの設定事項の設定内容の入力を受ける処理と、画像処理の各処理項目の実行順の設定内容の入力を受ける処理とを、各々異なる画面を介して行う。そして、画像処理の各処理項目ごとの設定事項の設定内容の入力においては、画像処理手段は、画像兼グラフィック表示手段に対して、対象画像と画像処理の各処理項目毎の設定事項を一覧可能に表した画像処理メニューとを表示させ、対象画像を画像兼グラフィック表示手段に対して表示させつつ操作入力手段を用いた操作を通じて、対象画像のうち全部または一部を画像処理領域として決定する内容の入力を受ける処理を行い、操作入力手段を用いた画像処理メニュー中の項目を選択する視覚的な操作方法を通じて、設定事項の設定の内容の入力を受ける処理を行い、画像処理領域と設定事項の設定内容とを番号もしくは文字列の名前を持つオブジェクトとして登録する内容の入力を受ける処理を行う。また、画像処理の各処理項目の実行順の設定内容の入力においては、画像処理手段は、画像兼グラフィック表示手段に対して実行順の設定を一覧可能に表したプログラムメニューが表示させる。さらに、画像処理手段は、操作入力手段を用いたコマンドを入力する方法、あるいは、操作入力手段を用いた高級言語によりプログラムを記述する方法を通じて、画像処理の各処理項目で登録した番号もしくは文字列の名前を持つオブジェクトを用いて画像処理の各処理項目の選択指定を行う内容の入力を受ける処理、並び替えを行う内容の入力を受ける処理、先に実施した画像処理の処理結果を参照して次に続く画像処理を実施させる画像処理結果参照設定の内容の入力を受ける処理、画像処理の際に画像処理によって算出された演算結果である計測値を結果信号として出力させる出力設定の内容の入力を受ける処理を行う。よって、マウスなどの簡単な視覚的な操作で設定を行った画像処理各処理項目の設定事項の設定、各画像処理領域の設定を用いて、複雑な画像処理のプログラムが容易に作成できるという効果がある。
【0134】
請求項に記載の発明によれば、画像処理装置上で、画像処理プログラムの処理項目の実行後に得られる処理結果に対して、さらなる演算処理を行うことが可能で、その演算処理は、プログラミング言語で記述される。よって、画像処理により得られた処理結果に対して、所望する演算処理を、プログラミング言語で詳しく正確に記述することができ、複雑な画像処理を行うことも可能となる。
【0135】
請求項に記載の発明によれば、画像処理メニューにおいて、画像処理の各処理項目について、画像処理領域と設定事項の設定内容とを、番号もしくは文字列を用いて複数個、登録できる。よって、画像処理プログラムにおいて、各処理項目の設定事項の設定内容の利用、および流用が容易になるという効果がある。
【0136】
請求項に記載の発明によれば、プログラムメニューにおいて、設定を終了したプログラムを、番号もしくは文字列で複数個、登録できる。よって、複数の画像処理プログラムを切り替えて実行することや、画像処理プログラムの流用が容易になるという効果がある。
【0137】
請求項に記載の発明によれば、画像処理メニューを、設定事項の一部を設定可能な簡易設定メニューと、設定事項の全てを設定可能な詳細設定メニューとで構成する。よって、必要性に応じて、容易に画像処理プログラムを作成することも、詳細に画像処理プログラムを作成することも、可能となる。
【0138】
請求項に記載の発明によれば、画像処理メニューあるいはプログラムメニューにおいて、最大3段階までの階層構造とするように構成する。よって、メニュー構成が単純でユーザに理解しやすくなり、プログラミング作業が容易になるという効果がある。
【0139】
請求項に記載の発明によれば、画像処理メニューにおいて、画像処理の各処理項目ごとに試験的実行を行うことが可能である。よって、設定した各処理項目の設定事項が適正かどうかをすぐに判定することができ、プログラミング作業が容易になるという効果がある。
【0140】
請求項に記載の発明によれば、プログラムメニューにおいて、設定した実行順で画像処理プログラムの試験的実行を行うことが可能である。よって、作成したプログラムが正しく動作するかをすぐに判定することができ、プログラミング作業が容易になるという効果がある。
【図面の簡単な説明】
【図1】 実施の形態1に係る画像処理プログラム作成方法を示すフローチャートである。
【図2】 実施の形態1に係る画像処理装置の構成例を示す図である。
【図3】 実施の形態1に係る画像処理装置の他の構成例を示す図である。
【図4】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図5】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図6】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図7】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図8】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図9】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図10】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図11】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図12】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図13】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図14】 実施の形態1に係る画像処理装置において表示される画面例を示す図である。
【図15】 実施の形態2に係る画像処理プログラム作成方法を示すフローチャート図である。
【図16】 実施の形態2に係る画像処理装置において表示される画面例を示す図である。
【図17】 実施の形態3に係る画像処理装置において表示される画面例を示す図である。
【図18】 従来の画像処理プログラム作成方法を示すフローチャートである。
【図19】 従来の画像処理プログラム作成方法において表示される画面例を示す図である。
【符号の説明】
1 起動信号、2 画像撮像手段、3 画像処理手段、4 画像兼グラフィック表示手段、5 操作入力手段、6 出力結果信号、7 パーソナルコンピュータ、8 モニタ(画像兼グラフィック表示手段)、9 操作入力手段、10 接続手段、11 メインメニュー、12 画像表示部分、13 コマンドメニュー、14 ポインタ、15 画像処理メニュー一覧、16 2値特徴量簡易設定メニュー、17 画像処理領域、18 2値特徴量詳細設定メニュー、19b 試行結果、20a 輝度計測簡易設定メニュー、20d 輝度計測詳細設定メニュー、21 プログラムメニュー(実施の形態1)、23 プログラムメニュー(実施の形態2)、24 プロジェクトウィンドウ、25 コードウィンドウ、26 アウトプットウインドウ、27 数値計算ウィンドウ。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing program creation method for easily creating an image processing program by inputting various settings related to image processing, and an image processing apparatus capable of realizing the image processing program creation method.
[0002]
[Prior art]
Image processing technology is applied in various fields such as defective product inspection technology in various product production lines, crime prevention technology, medical technology, and the like.
[0003]
In actual image processing, an image processing program describing the processing contents of the image processing and a plurality of image processing flows is created, and the image processing program is executed on an image processing apparatus including a computer. Conventionally, this image processing program has been created using a program language such as C language or BASIC.
[0004]
However, in order to create an image processing program using a program language, a programmer who has mastered the language is required, and it is difficult for a person who does not have specialized knowledge of the program language to create an image processing program.
[0005]
Therefore, for example, a technique that enables creation of an image processing program even by a person who does not have specialized knowledge of a programming language has been proposed, such as an image processing program creation method disclosed in Japanese Patent Laid-Open No. 9-91127. ing.
[0006]
FIG. 18 and FIG. 19 are diagrams showing a processing flow for creating an image processing program in the image processing program creating method disclosed in the above publication, and a diagram showing a monitor screen during program creation. As shown in the monitor screen 60 of FIG. 19, according to the image processing program creation method, setting items such as various numerical values are sequentially set for each processing item of the displayed image processing, not according to the program language. Then, the order of the processing items is set as a process. By doing so, the processing content of the image processing and the flow of a plurality of processing can be easily set, and an image processing program is created.
[0007]
Also, as shown in step SS3 of FIG. 18, a program method for independently setting each setting of image processing (step SS31), flow setting (step SS32), and I / O setting (step SS33) is adopted. As a result, it has become possible to easily realize complex image processing that could not be realized without using a descriptive program system such as C language or BASIC.
[0008]
[Problems to be solved by the invention]
However, in the image processing program creation method described in the above-mentioned Japanese Patent Laid-Open No. 9-91127, it is impossible to create an image processing program while visually confirming the image processing program while displaying an image to be processed. There is a problem that it is difficult to create an image processing program that requires various settings while viewing a target image such as processing (described later).
[0009]
In addition, the above publication does not describe that a part of the entire screen of an image is designated as an image processing area. Therefore, it is not possible to set and execute image processing for only a specific partial area, not the entire screen. Such image processing for only a specific partial area is strongly requested by the user in creating an image processing program.
[0010]
Further, in the technique described in the above publication, a desired processing item is selected from the image processing menu shown in FIG. 19 and setting items necessary for the processing are set. If the same image processing is performed multiple times in the flow of one program, the setting work of the setting items is required repeatedly every time the processing is registered. there were.
[0011]
Also, if you want to use the same image processing without changing the settings that have already been set, not only in the same program but also between different image processing programs, or some of the parameters of the settings that are the same type of image processing There is also a problem that it is inconvenient when you want to change the value.
[0012]
As described above, since it is difficult to divert the setting items already set in the image processing, the technique described in the above publication cannot realize the expected ease of use.
[0013]
In the image processing program creation method described in the above publication, only image processing setting, flow setting, and I / O setting can be performed independently, so that further processing (for example, in an image) There is a problem that it is impossible to handle a complicated image processing because a user's own data processing (such as calculating the area of a certain region and calculating / adding / subtracting / dividing the numerical data) cannot be performed.
[0014]
Accordingly, an object of the present invention is to set a target area for image processing, to create an image processing program while visually confirming an image to be processed, and to set image processing already set. Providing an image processing program creation method that can easily divert matters and that can further process the processing data obtained by image processing, and further provide an image processing apparatus that can realize the image processing program creation method There is to do.
[0024]
[Means for Solving the Problems]
The invention according to claim 1 is an image capturing unit that captures a target image that is an image to be subjected to image processing, an image processing unit that performs image processing on the target image, and an image that displays a result of the image processing. A graphic display unit; and an operation input unit, wherein the image processing unit sets a setting item for each processing item of the image processing. Processing to receive content input And setting the execution order of each processing item of the image processing Processing to receive content input And Each through different screens Setting of the setting items for each processing item of the image processing Enter content In the image processing means, the image processing means displays (A) the image and graphic display means with the target image and an image processing menu representing the setting items for each processing item of the image processing in a listable manner. (B) All or part of the target image is determined as an image processing area through an operation using the operation input unit while the target image is displayed on the image and graphic display unit. Process to receive input , (C) setting of the setting items through a visual operation method of selecting an item in the image processing menu using the operation input means. Processing to receive content input And (D) storing the image processing area and the setting contents of the setting item in a memory with a name using a number or a character string. Process to receive input , Setting the execution order of each processing item of the image processing Enter content The image processing means causes the image and graphic display means to display a program menu representing the execution order settings in a listable manner, and the image processing means includes (a) the operation input means. Selection and designation of each processing item of the image processing using the number or character string stored in the memory for each processing item of the image processing through a visual operation method of selecting the item in the program menu used That receives input of the contents to be performed ,sort That receives input of the contents to be performed (B) An image processing result reference setting for performing the subsequent image processing with reference to the processing result of the image processing performed previously. To receive input of contents ,and( c ) Output setting for outputting a measurement value, which is a calculation result calculated by the image processing at the time of the image processing, as a result signal Processing to receive content input The image processing apparatus to perform.
[0025]
According to a second aspect of the present invention, there is provided an image capturing unit that captures a target image that is an image to be subjected to image processing, an image processing unit that performs image processing on the target image, and an image that displays a result of the image processing. A graphic display unit; and an operation input unit, wherein the image processing unit sets a setting item for each processing item of the image processing. Processing to receive content input And setting the execution order of each processing item of the image processing Processing to receive content input And Each through different screens Setting of the setting items for each processing item of the image processing Enter content In the image processing means, the image processing means displays (A) the image and graphic display means with the target image and an image processing menu representing the setting items for each processing item of the image processing in a listable manner. And (B) determining all or part of the target image as an image processing area through an operation using the operation input unit while displaying the target image on the image and graphic display unit. Process to receive input , (C) setting of the setting items through a visual operation method of selecting an item in the image processing menu using the operation input means. Processing to receive content input And (D) an object having a number or a character string name indicating the image processing area and the setting contents of the setting item. Process to receive input of contents to be registered as , Setting the execution order of each processing item of the image processing Enter content The image processing means displays a program menu representing the execution order settings on the image and graphic display means in a listable manner, and the image processing means uses (a) the operation input means. Using the object having the number or character string name registered in each processing item of the image processing through a method of inputting a command or a method of describing a program in a high-level language using the operation input means. Select and specify each processing item for image processing That receives input of the contents to be performed ,sort That receives input of the contents to be performed (B) An image processing result reference setting for performing the subsequent image processing with reference to the processing result of the image processing performed previously. To receive input of contents And (c) an output setting for outputting, as a result signal, a measurement value that is a calculation result calculated by the image processing during the image processing. Processing to receive input of the contents of An image processing apparatus for performing
[0026]
Claim 3 The invention described in claim 1 It is possible to perform further arithmetic processing on the processing result obtained after execution of the processing items of the image processing program, and the arithmetic processing is described in a programming language. An image processing apparatus.
[0027]
Claim 4 The invention described in claim 1 Or claims 2 In the image processing menu, a plurality of image processing areas and setting contents of the setting items are registered using a number or a character string for each processing item of the image processing in the image processing menu. It is an image processing apparatus that can be used.
[0028]
Claim 5 The invention described in claim 1 Or claims 2 The image processing apparatus according to claim 1, wherein a plurality of programs for which setting has been completed can be registered using a number or a character string in the program menu.
[0029]
Claim 6 The invention described in claim 1 Or claims 2 The image processing apparatus according to claim 1, wherein the image processing menu includes a simple setting menu capable of setting a part of the setting items and a detailed setting menu capable of setting all of the setting items. It is.
[0030]
Claim 7 The invention described in claim 1 Or claims 2 The image processing apparatus according to claim 1, wherein the image processing menu or the program menu is configured to have a hierarchical structure of up to three stages.
[0031]
Claim 8 The invention described in claim 1 Or claims 2 The image processing apparatus according to claim 1, wherein in the image processing menu, the image processing apparatus can perform a trial execution for each processing item of the image processing.
[0032]
Claim 9 The invention described in claim 1 Or claims 2 The image processing apparatus according to claim 1, wherein the image processing program can be experimentally executed in the execution order set in the program menu.
[0033]
DETAILED DESCRIPTION OF THE INVENTION
<Embodiment 1>
FIG. 1 is a diagram for explaining the processing flow in the image processing program creation method according to Embodiment 1 of the present invention. In FIG. 1, when one of the image processing menus (S2) prepared for each image processing, for example, “binary feature amount” is selected from the main menu (S1) displayed on the image and graphic display means, Since the simple setting menu (S21) corresponding to “binary feature amount” appears, the image processing area for performing image processing and the minimum necessary image processing parameters while viewing the target image displayed by the image and graphic display means Is set using the operation input means.
[0034]
Further, if it is necessary to set detailed image processing parameters, the detailed setting menu (S22) is selected and set, but the setting by the detailed setting menu can be passed. In this way, by using the simple setting menu first, it is possible to greatly save the setting work.
[0035]
Next, a trial of image processing (S23) is performed to check whether the desired image processing has been executed correctly. If not, return to the simple setting or detailed setting and set the image processing area or image processing parameters. cure. Note that this trial (S23) is not necessarily performed and can be passed.
[0036]
Finally, when the image processing area and the image processing parameters can be set correctly, registration is performed by assigning a name composed of a number or a character string (S24), and the contents of the image processing are saved. At this time, for example, the registration name is first registered as “binary feature amount 01”, and the processing having different parameters in the same image processing can be registered as “binary feature amount 02”. In this way, when a registered name stored in the past is changed and then stored again, if the registered name is changed to an alias and stored, different kinds of image processing are performed. In addition to saving the settings, a plurality of parameters and the like can be saved with different names for the same type of image processing. Then, in a program menu to be described later, it is possible to use already set image processing or to call and change (registered) previously registered image processing, thereby improving development efficiency. After registration, it automatically returns to the main menu (S1).
[0037]
This registration may be performed with a file name as one file for each setting, for example, or a plurality of settings may be combined into one file with a file name. Further, all settings may be registered in the storage area in the image processing unit instead of the file format.
[0038]
When the setting and registration of one or more image processes have been completed, the program menu (S3) can be selected from the main menu (S1). In the program menu, it is possible to arbitrarily select a plurality of registered or different kinds of image processing and set the execution order (S311).
[0039]
For example, “Binary Feature 01” and “Luminance Measurement 01” are selected for different types of image processing, and “Binary Feature 01” and “Binary Feature 02” are selected and arranged for the same type of image processing. You can change. If the desired processing result cannot be obtained simply by selecting the registered image processing and specifying the execution order, for example, for the calculation result of the image processing (result of image processing A + result of image processing B), etc. If numerical calculation (described in detail in Embodiment 3) is necessary, numerical calculation setting (S312) is selected to set the numerical calculation procedure. This numerical calculation setting (S312) is not necessarily performed and can be passed.
[0040]
Next, when a plurality of image processing results are obtained, such as when a plurality of image processes are performed, which processing result is output is set (S313).
[0041]
Next, a trial of the program (S314) is performed to check whether the selected and ordered image processing is correctly executed. If not, the setting of the image processing program menu is reviewed, or the image processing menu is displayed. Go back and review the image processing settings. Note that this trial (S314) is not necessarily performed, and can be passed.
[0042]
Finally, if the program can be set correctly, registration is performed with a registration name composed of a number or character string (S315), and the contents of the program are saved. At this time, for example, a registration name is registered as “program 01”, and another program is registered as “program 02”, so that settings of a plurality of programs can be stored.
[0043]
In this way, after changing the contents of the registered data stored in the past, when trying to store again, if the registered name is changed to an alias and stored, a plurality of programs can be stored. This is useful because it can be managed and the program can be switched at the time of image processing execution. In addition, when a program is created, a previously registered program can be called and changed (appropriated), and program development efficiency is improved. After registration, it automatically returns to the main menu (S1).
[0044]
A program cannot be created unless at least one image process is registered. However, once a program has been created, it is also possible to additionally set image processing and to select it by the program. In other words, it is not impossible to create a program unless all image processing settings used in the program have been completed in advance, and the image processing setting and the program setting can be performed alternately and simultaneously.
[0045]
The environment setting menu (S4) is a menu for performing settings related to the environment of the apparatus such as setting of the type of camera connected to the image processing apparatus. This menu is usually set before creating the program, but it may be set after creating the program, such as when the camera is changed.
[0046]
FIG. 2 is a diagram for explaining an image processing apparatus to which the image processing program creation method according to the first embodiment is applied. In FIG. 2, 1 is an activation signal, 2 is an image pickup means, 3 is an image processing means, 4 is an image and graphic display means, 5 is an operation input means, and 6 is an output result signal.
[0047]
The start signal 1 is a signal for issuing a process execution command to the image processing means 3. The activation signal 1 can be generated from the operation input means 5. The image pickup means 2 is constituted by, for example, a CCD camera.
[0048]
The image processing means 3 is a functional component that operates according to a predetermined software program in a general CPU to which a ROM, a RAM, and the like are connected, and includes means for executing the image processing program creation method according to the present invention. . At the time of creating an image processing program, the image processing means 3 displays a menu and cooperates with the image capturing means 2, the image and graphic display means 4, and the operation input means 5 to support human program creation.
[0049]
When the program is executed, the image processing means 3 receives the activation signal 1, picks up an image using the image pickup means 2 designated by the program, executes the image processing, and outputs an output result signal 6 that is an image processing result. . When a plurality of programs are registered, the activation signal 1 including information on which program is executed is received, the correct program is selected from the programs stored and set, and the program is executed. .
[0050]
The operation input means 5 is mainly composed of only a pointing device such as a mouse, but may be composed of an input device such as a keyboard and a mouse. The output result signal 6 may be simultaneously output to the image and graphic display means 4 to display the result in graphic form.
[0051]
In FIG. 2, the image processing program creation method is provided in the image processing means 3, but the image processing program creation method may not necessarily be included in the image processing means 3.
[0052]
For example, as shown in FIG. 3, the personal computer 7 may be connected to the image processing apparatus by connection means 10 such as a LAN cable, and the image processing program creation method may be executed on the personal computer 7. In this case, the programming operation may be performed using the operation input means 9 and the display means 8 of the personal computer. Alternatively, the image processing apparatus and the apparatus that executes the image processing program creation method may not be directly connected. In this case, the created program data may be moved to the image processing apparatus using a recording medium such as a floppy disk, an MO, or a flash PC card.
[0053]
Next, the operation and flow will be described in detail. FIG. 4 shows an example of the initial configuration of the menu in the image processing program creation method of the present invention. In an initial state, the main menu 11 (file management 11a, image processing setting 11b, program setting 11c, environment setting 11d, tool 11e, and version information 11f commands are displayed), the image display portion 12, and the command menu 13 (button switches such as online / offline switching 13a, multiple camera switching 13b, image live / freeze display switching 13c, line drawing overlay display switching 13d on the display image, etc.) are controlled by the operation input means 5 The pointer 14 is displayed. In FIG. 4, the reference line 12a indicating the XY coordinate system is displayed as an overlay as a line drawing. An image live / freeze display switching button 13c in the command menu 13 can be used to capture and display an image from the camera.
[0054]
Here, “online / offline” refers to whether or not the activation signal 1 can be accepted, and the activation signal 1 from another device (not shown) that issues the activation signal 1 to the image processing apparatus. Whether to accept or not.
[0055]
Further, “live / freeze” here indicates whether a moving image is displayed or a still image is displayed. More precisely, it represents whether the image capturing unit 2 displays a moving image that is currently captured or whether still image data captured in the past is displayed.
[0056]
FIG. 5 shows a state where the main menu 11 is displayed (S1 in FIG. 1) after the image is captured from the image pickup means 2 and the image 12b (eg, vegetable image) is displayed on the image display portion 12. A state in which the processing menu 11b is selected is shown (S2 in FIG. 1).
[0057]
At this time, the image processing menu list 15 is pulled down as shown in FIG. 5 so that a plurality of image processing items can be selected. In FIG. 5, five items of density template matching, binary feature quantity, luminance measurement, density edge measurement, and binary edge measurement can be selected as processing items for image processing.
[0058]
The light / dark template matching here refers to template matching using a light / dark image (image processing for finding a reference image called a template from a target image and outputting the location and the degree of matching (score)). The binary feature value is an image processing that binarizes an image, labels white pixels or black pixels in the image for each block, and measures the area, the center of gravity, etc. for each pixel block. It is. Luminance measurement is image processing that measures the luminance of a grayscale image and calculates an average value or a variance value of the luminance of pixels in a certain area. The gray edge measurement and binary edge measurement refer to image processing for obtaining the position of an edge (a portion having a large luminance gradient) appearing in a gray image or binary image.
[0059]
Hereinafter, a case where a binary feature amount is selected will be described as an example. When a binary feature value is selected from the above menu, a binary feature value menu 16 that is one of image processing menus that display a list of setting items is displayed as shown in FIG. 6 (S21 in FIG. 1). The binary feature amount menu 16 is a simple setting menu, and the minimum parameter setting for binary feature amount measurement, that is, the binarization method setting and the parameters associated with the binarization method (see FIG. 6). In the case of the binarization method using the “fixed threshold value” shown, the binarization level corresponds to that.In addition, the “P tile binarization” method (for a certain region, the entire P tile value called in advance) If the ratio of white pixels to pixels is specified, a threshold value for binarization is calculated so that the ratio of white pixels becomes the specified P tile value, and binarization is performed with the threshold value) For example, the ratio of white pixels in the image corresponds to that), and only the image processing area can be set.
[0060]
When a new image process is set, a name is selected from, for example, a grayed name (number) indicating that the image process is unregistered from a drop-down list for designating a process No. When changing an already registered image processing program, image processing is selected from, for example, a blackened name from the drop-down list.
[0061]
The setting of the binarization method is such that an item can be selected from a drop-down list, and can be easily selected only by a button operation (click operation) with the pointer 14. The binarization level can also be easily set by operating the slider or the up / down button.
[0062]
The processing area is a full screen as a default value, but can be set by pressing an “area” button in the binary feature amount menu 16. FIG. 7 shows an area setting screen which is a screen state after the “area” button is pressed. On the area setting screen, the image processing area 17 can be easily set visually using the pointer 14. When the operation input means is a keyboard or the like, the image processing area can also be set by setting values in boxes (start point X, Y, width X, Y) indicating the processing area on the command menu.
[0063]
If detailed setting is not required, the setting of the binary feature amount can be completed only by the setting of the simple setting menu. However, in the case of performing more detailed setting, the binary feature which is the simple setting menu is used. When the “detail setting” button in the amount menu 16 is pressed, a binary feature amount detailed setting menu 18 shown in FIG. 8 is displayed (S22 in FIG. 1).
[0064]
Here, all image processing parameters that cannot be set by simple setting can be set. For example, the binary block object to be measured is set to be a white pixel or a black pixel, the type of binary feature value to be measured is set, and a 3 × 3 expansion filter (notice the maximum luminance value in 8 pixels around the pixel of interest Binary processing such as various noise filters represented by processing for correcting the luminance value of the pixel) and 3 × 3 contraction filter (processing for correcting the luminance value of the target pixel to the minimum luminance value in the eight pixels around the target pixel) It is also possible to set a pre-processing before calculating a feature value and a result sorting function which is a function for arranging the output order of calculation results according to specified items.
[0065]
In the case of the example here using the vegetable image 12b, the target vegetable is darker than the background, so the binary block to be measured may be a black pixel. After the setting is completed, when the “Confirm” button of the binary feature amount detailed setting menu 18 is pressed, the binary feature amount menu 16 is displayed again.
[0066]
Next, the “trial” button in the binary feature amount menu 16 is pressed (S23 in FIG. 1) to check whether the image processing operates correctly with the set parameters. When the “trial” button is pressed, a trial result image 19a is displayed as shown in FIG. 9, and an image processing trial result 19b is also displayed. If the desired result is not obtained, the setting is performed again by returning to the binary feature amount menu 16 or the binary feature amount detailed setting menu 18. Note that this “trial” is not an indispensable operation for setting, and may be skipped.
[0067]
When the “Registration” button of the binary feature amount menu 16 is pressed after the setting is completed, the parameter set with the character string designated by “Processing No” (in this example, “binary feature amount 01”) can be registered ( S24).
[0068]
Further, by using the “Copy” and “Paste” buttons of the binary feature amount detailed setting menu 18, the existing parameter setting data can be registered with another registered name. For example, when the user opens the binary feature amount detailed setting menu 18 and presses the “copy” button for the existing registration data “binary feature amount 02”, the image processing means 3 once sets the parameter value to the image processing means. 3 is stored in the temporary memory No. 3, and then a “Process No” drop-down list is displayed. When the user selects the parameter setting name “binary feature 03” displayed in gray indicating that no parameter is set and presses the “Paste” button, the copied parameter value is displayed. Here, when the user presses the “set” button, “processing No.” is automatically set to “binary feature amount 03”, and the processing returns to the binary feature amount menu 16.
[0069]
If the “Register” button is pressed here, the parameter setting of “Binary feature amount 02” can be registered with another registration name “Binary feature amount 03”. After registration, the registration name is displayed in black, for example. It is also possible to create a template parameter for a certain image processing, register the template image processing with another name by the above method, change it, and experiment.
[0070]
Deletion of registered parameter setting registration data is performed as follows. First, in the binary feature menu 16, a parameter setting registration name (for example, “binary feature 03”) to be deleted is selected from the “Process No” drop-down list. By this operation, parameters registered in the past are called and referred to. Next, press the “Delete” button to delete the parameter settings. When deleted, the parameter setting name is grayed out, for example.
[0071]
As described above, the parameters are visually set using the operation input means 5 for each image processing, and the registration name is assigned with a number or a character string.
[0072]
As another example of image processing, FIG. 10 shows a luminance measurement menu (simple setting menu) 20a, FIG. 11 shows an area setting screen, and FIG. 12 shows a luminance measurement detailed setting menu 20d. In the case of luminance measurement, a plurality of processing areas 20b and 20c can be set with one parameter setting (for example, “luminance measurement 01”).
[0073]
After registering one or more image processes, the program menu 11c is selected from the main menu 11, and a program including settings such as the execution order of the image processes is defined. FIG. 13 shows the program menu 21 displayed (S3 in FIG. 1). In FIG. 13, the program menu 21 covers most of the display area and thus cannot be seen, but the image 12 b that is the target image for image processing continues to be displayed on the image display portion 12.
[0074]
When a new program is described, one program number is selected from, for example, grayed numbers indicating that the program is not registered from a drop-down list for designating a program number. When changing an already registered program, a program number is selected from, for example, blackened numbers from a drop-down list.
[0075]
Next, the processing items of the registered image processing are selected, and the order and output setting are defined (S311 in FIG. 1). The first position correction is a process for correcting the position of a preset image processing region by using image processing capable of measuring a positional shift amount such as density template matching. When the positioning accuracy of the target of image processing is poor, first, the amount of positional deviation is measured by image processing used for position correction, and the position of the image processing area where parameters are already set is corrected by referring to the measurement result.
[0076]
Of course, if the positioning accuracy of the image processing target is sufficient, this position correction is unnecessary. Examples of the image processing used for the position correction process include density template matching and density edge measurement. When position correction processing is necessary, appropriate image processing is selected from already registered image processing (for example, setting “dark / dark TM01” in dark / light template matching).
[0077]
Next, the order of processing items for image processing is defined. Using the “select” button in the item “image processing”, an already registered image processing is additionally selected. Image processing that can be selected is not only image processing registered by the user, but also fixed image processing that does not require parameters, for example, a 3 × 3 Roberts edge filter (a pixel of interest using a luminance value of a predetermined pixel among eight pixels around the pixel of interest) The process of correcting the brightness value of the image can be selected. The order of image processing can be changed using the “Up” and “Down” buttons, and the image processing can be deleted using the “Delete” button.
[0078]
Of the image processing, binarization processing with binary feature values and filter processing such as 3 × 3 Roberts edge filter process the target image and pass the image to the next image processing. Therefore, the order of image processing affects the image processing result. On the other hand, the preprocessing existing in each image processing setting merely processes an image temporarily when performing the image processing, and does not process an image that is used for subsequent image processing.
[0079]
If it is not enough to select and arrange the image processing items set in advance, and it is necessary to process the image processing results with four arithmetic operations, set “Numeric calculation” to “Yes” and select “Flow”. A processing flow of numerical calculation is described (S312 in FIG. 1). “Numerical calculation” will be described in the third embodiment.
[0080]
Next, output setting for image processing is performed (S313 in FIG. 1). When a check mark is put in the check box on the left side of “1” to “6” which is the order of image processing, the measurement value measured by the image processing is output as the output result signal 6. Here, only necessary image processing can be checked, and it is necessary as a processing flow, but output of unnecessary data can be prevented by not checking image processing that is not necessary for result output. . In addition, regarding the position correction processing, it is possible to output the position and the amount of displacement that are found by marking the position correction check box.
[0081]
In addition, whether the camera number to be used and the result output coordinate system are image coordinates or the external world (world) coordinate system, whether the unit is a pixel unit or a physical unit (mm) Referring to the data corrected for the optical distortion of the lens, whether to output the distortion after correcting the distortion is selected. However, in order to select a world coordinate system, select a physical unit, and use distortion correction, an operation (calibration) is required in advance to obtain a conversion coefficient between external world coordinates and image coordinates. In the embodiment of the present invention, the calibration operation is included in the “tool” of the main menu 11 in FIG. 4 so that when the “tool” is selected, the calibration operation and data registration can be performed. do it.
[0082]
When the selection of the image processing, the order determination, and the image processing result output setting are completed and the “trial setting” of the program menu 21 is performed and then the “trial” button is pressed, the trial screen shown in FIG. The processing result 21b can be confirmed (S314 in FIG. 1). In this trial screen, the image processing result can be referred to by the registered name (for example, “brightness measurement 01”) of the parameter setting of the selected registered image processing. If the desired result is not obtained, return to the program menu 21 to change the selection and rearrangement of image processing processing items, or return to the image processing menu to change parameter settings and add image processing processing items. Make settings.
[0083]
The “trial setting” can be selected from “test for current image (one time)”, “test after image capture (one time)”, and “test after image capture (continuous)”. “Testing the current image (once)” refers to performing a trial operation on image data (for example, image data read from the outside) currently in the image memory in the image processing means 3. Further, “test after image capture (once)” means that new image data is captured from the image capturing means 2 and one trial is performed on the image data. In addition, “test after image capture (continuous)” means that new image data is captured from the image capturing unit 2 and the image data is tried, and then new image data is captured from the image capturing unit 2 again. This means that the image data is tried and repeated until it is interrupted. These trials are not essential operations for the image processing program, and are the same as the image processing settings.
[0084]
When the “Registration” button on the program menu 21 is pressed after the setting is completed, the program can be registered with the registration name specified in “Processing No” (in the case of FIG. 13, “Program 01” or “01”). S315 in FIG. 1). In FIG. 13, the contents of the image processing are automatically included and displayed as comments (“program 01: luminance measurement, binary feature value” is displayed).
[0085]
The “Copy” and “Paste” buttons are used in the same way as the image processing menu, and are used when registering a program with another name, or when changing a program after copying it as a template. The “delete” button is used to delete a program. The “Cancel” button is used to close the program menu without setting.
[0086]
After creating the program according to the procedure described above, the actual image processing program is executed by the activation signal 1. Normally, the activation signal 1 includes information on the program number to be activated. Based on this information, the image processing means 3 executes a predetermined program and outputs an image processing result to the result output means 6.
[0087]
According to the image processing program generation method and the image processing apparatus according to the present embodiment, the image processing apparatus causes the image / graphics display unit 4 to display the target image when the user creates the image processing program. Therefore, the user can create an image processing program while visually confirming it, and can easily create an image processing program that requires various settings while viewing the target image, such as a light and dark template matching process.
[0088]
In addition, the setting items for each processing item of the image processing include items for setting all or part of the target image as the target of the image processing. Therefore, the user can set and execute image processing for only a specific partial area, not the entire screen.
[0089]
Further, the image processing unit 3 can store setting items for each processing item of image processing performed by the user and / or settings (program settings) related to execution of the processing items performed by the user as registered data. It is. Therefore, if the same image processing is performed multiple times in the flow of one program, or if you want to divert the same image processing between different image processing programs while leaving the set items as they are, the same kind of image processing but the setting items For example, when the user wants to change some of the parameters to different values, the user can call up the registered data made in the past and easily use it for creating an image processing program. Further, when the user changes the contents of the registered data stored in the past and tries to store them again, the image processing means 3 changes the registered name of the registered data to an alias. Remember. Therefore, in the case of using the same kind of image processing but changing some of the parameters of the setting items to different values, it can be automatically stored as new registration data in distinction from the past registration data.
[0090]
The image processing means 3 displays the setting items for each processing item in a menu format. The menu format includes a simple setting menu format in which a part of the setting items can be set, and details in which all the setting items can be set. Configuration menu format is included. Therefore, it is possible to easily create an image processing program or to create an image processing program in detail according to necessity.
[0091]
Further, when the image processing program creates the image processing program, the image processing trial result of the target image based on the set setting items and / or the setting related to the execution (program setting) are set. It is possible to display the result of trial of image processing on the target image based on the image and graphics display means 4. Therefore, the user can determine whether the setting items are set as desired and / or whether the image processing program is executed as desired, and the operation of the image processing program can be easily confirmed. it can.
[0092]
In the present embodiment, the image processing menu is composed of two stages, that is, an image processing (simple setting) menu and an image processing detailed setting menu. It may be. It is desirable to avoid menus with more than three levels because they are too deep and difficult for the user to use.
[0093]
In the present embodiment, the program menu has one stage. However, if the numerical calculation menu described in detail in the third embodiment is inserted, the program menu has two stages. In addition, an auxiliary menu may be added to form a three-stage configuration. It is desirable to avoid menus with more than three levels because they are too deep and difficult for the user to use.
[0094]
In this embodiment, a trial function is provided in the image processing menu and the program menu. However, this is not essential for image processing settings and program settings, and is not necessarily provided in the present invention. It is not a function that must be done.
[0095]
In the present embodiment, a plurality of combinations of image processing parameters can be registered with different character string names. However, it is sufficient that at least one or more combinations can be registered. Similarly, the program is configured so that a plurality of programs can be registered with different character string names, but it is sufficient that at least one program can be registered.
[0096]
<Embodiment 2>
In the present embodiment, an example will be described in which the program menu is configured by using a command input method in which a program mainly uses a typing operation by the operation input means 5 or a programming description method in a high-level language.
[0097]
FIG. 15 is a diagram for explaining the processing flow of the image processing program creation method according to the present embodiment. In the present embodiment, the image processing setting method can be performed in the same manner as in the first embodiment. Therefore, the difference from the first embodiment, that is, the configuration of the program menu (S3, S321). To S324) will be described.
[0098]
FIG. 16 shows a configuration example of a program menu in the present embodiment. The program menu 23 provides a development environment that allows command input or high-level language programming development. The program menu 23 includes a project window 24, a code window 25, an output window 26, and various buttons. In this example, one program number (necessary for creating one execution module) for one program number. Data that collects source programs, compilation conditions, various environment settings, etc.) is managed. The names of source files constituting the project are displayed in the project window 24, and the contents of the source files are displayed in the code window 25. The source file name displayed in the source code window 25 is displayed with a gray mark in the project window 24, for example. The output window 26 is used for monitoring variables during debugging and displaying errors when building source code.
[0099]
Next, the operation will be described in detail. To create a program for the first time, specify the program number and press the “Project Settings” button. With the “project setting” button, environment settings associated with development such as additional specification of source files and various settings relating to high-level languages used for development are performed (S321 in FIG. 15).
[0100]
When the project settings are completed, the source file name is displayed in the project window 23, and the source file name to be edited is clicked there. Then, since the contents of the source file as the source code are displayed in the code window 24, the source code is edited using the operation input means 5 such as a keyboard and a mouse (S322 in FIG. 15). For registered programs, the project is loaded when the program number is specified.
[0101]
FIG. 16 shows an example in which light and dark template matching is performed using C ++ as a development language. Here, processing items already set using the image processing menu (shading template matching 01) are used in an array of objects called TM [1]. The subscript of the array in [] matches the program number.
[0102]
For example, the execution of density template matching can be realized in the form of a member function call related to TM [1] (calling TM [1] .Exec () in the example of FIG. 16). This can be realized by referring to the member variable of the object (in the example of FIG. 16, reference is made to TM [1] .Cand [1] .x, etc. Cand [1] indicates the first candidate for the light and dark template matching).
[0103]
In this way, already set image processing can be easily used by using a predetermined object corresponding to the image processing. Furthermore, if objects or object arrays that can be used globally for different programs are prepared, it is possible to exchange results between different programs. In other words, an area in the memory where the data can be held and transferred to the program receiving the data after the program to transfer the data is completed so that the data can be transferred between different programs. Are provided as objects or object arrays.
[0104]
For example, a global object array GLOBAL [] is provided, and the value calculated by executing “Program 01” is assigned to GLOBAL [1], and the value calculated by executing “Program 02” is assigned to GLOBAL [2]. In other words, when “program 03” is executed, GLOBAL [1] and GLOBAL [2] are referred to so that the data stored therein can be used for calculation.
[0105]
When the “build” button in the program menu 23 is pressed after creating the source code, an object code or intermediate code obtained by compiling the source code is generated (S323 in FIG. 15). Depending on the type of language used, the build operation may not be necessary.
[0106]
If there is a grammatical error during the build, information such as the error content and the line number where the error occurred is displayed in the output window 26. Based on this information, the source code is debugged (S324 in FIG. 15). ). When the source code is completed, when the “trial” button in the program menu 23 is pressed, an attempt is made and the execution result is displayed in the form as shown in FIG. 14 as in the first embodiment (FIG. 15). S324).
[0107]
If a grammatical error occurs even during the trial, information such as the error content and the line number where the error occurred is displayed in the output window 26 of the program menu. Based on this information, the source code is displayed. Can be debugged. In addition, by pressing the “Debug” button in the program menu 23 to perform debugging settings, you can specify breakpoints (pause points) in the source program, step execution (sequential execution of each line of the program), and watch variables Various debugging operations such as registration are possible. The variable to be watched can be displayed in the output window 26, for example.
[0108]
The use of other buttons, for example, a button for selecting “Program No.” and “Copy”, “Paste”, “Register”, “Delete”, and “Cancel” buttons are the same as in the first embodiment, and a program is created. After that, the “register” button is pressed to register the image processing program (S325 in FIG. 15).
[0109]
As described above, when the program menu is configured using a command input method or a programming description method using a high-level language, it is compared with programming based on a visual operation method mainly including button operations described in the first embodiment. Program flexibility is greatly improved.
[0110]
For example, in the programming based on the visual operation method mainly including button operations described in the first embodiment, referring to one image processing result (direct data obtained by image processing) or an image It is impossible to perform the next image processing with reference to the processed data of the processing result (data obtained by performing numerical calculation such as addition / subtraction / multiplication / division to the direct data obtained by image processing). No (in the above-described “position correction”, the processing area of the image processing that follows is changed using the measured displacement amount). However, it is generally difficult to do.
[0111]
On the other hand, in the program creation method according to the present embodiment, no such restriction occurs. Note that the development language used in this embodiment is not limited to C ++ as an example, and may be a specially designed command format or another high-level language such as JAVA or BASIC.
[0112]
<Embodiment 3>
In the present embodiment, the configuration of “numerical calculation” in the program menu 21 described in the first embodiment will be described in detail. In the first embodiment, processing items can be selected and the order can be specified, but more complicated processing settings such as addition, subtraction, multiplication, and division with respect to image processing result data cannot be performed as they are. “Numerical calculation” has a function to compensate for it.
[0113]
FIG. 17 shows a configuration example of the numerical calculation flow menu 27 displayed when the “numerical calculation” button is set to “present” in the program menu 21 of FIG. 13 and the “flow” button is pressed. In the numerical calculation flow menu 27 of FIG. 17, by describing several commands in a predetermined programming language for the selected image processing execution result, addition / subtraction / multiplication / division calculation, calculation of trigonometric functions such as sin and cos, absolute value Numerical calculation such as calculation of can be performed. In addition, simple conditional branches can be described. The command format of the numerical calculation flow menu in FIG.
1. Variable Variable (image processing result)
2. Variable immediate
3. Variable function [variable, variable, ...]
4). Statement [variable or immediate]
This means that if a variable appears at the left end, the variable is set as the left-side value, and the immediate value, variable, or value returned by the function is assigned to the left-side value. For example, the first line in the numerical calculation flow menu 27 of FIG.
A01 TM01.S.1
Substitutes the value of the variable containing the score S.1 of the first candidate to be matched among the image processing results of the light and dark template matching 01 for the temporary variable A01. Ie
A01 = TM01.S.1
It means that. The fifth line
C01 1.000
Assigns an immediate value of 1.000 to a special variable called C01. That means
C01 = 1.000
It means that. Note that values assigned to variables such as C01 that start with C are output to the outside as image processing results.
[0114]
The third line
A03 GTR A01 A02
If A01> A02, the value 1 is assigned to the temporary variable A03, otherwise the value 0 is assigned. GTR is an abbreviation for GreaTeR than. In addition, comparison commands such as GTE (Grater Than Equal), LST (LeSs Than), LSE (LeSs than Equal), absolute value commands such as ABS (ABSolute), ADD (addition), SUB (subtraction), MUL There are four arithmetic operation function commands such as (multiplication), DIV (division), and MOD (remainder), and function commands such as SIN (sin), COS (cos), ATN (ArcTaN), and SQR (SQuare Root).
[0115]
The fourth, sixth, and eighth lines are IF-THEN-ENDIF conditional branch statement commands (statements) and do not take values on the left side.
[0116]
It is also possible to make a line a comment line by using a “comment” button. In that case, REM (REMark) is displayed at the beginning of the line.
REM A02 70.000
It becomes.
[0117]
These commands can be input visually using a numerical calculation flow menu using a pointing device such as a mouse of the operation input means 5. First, a variable that is an lvalue is selected, and then one of a function, a result, a variable, and an immediate value is selected and set. For example, TM ?? (? Is a number) for binary template matching, BA ?? for binary feature, GM ?? for luminance measurement, GE ?? for binary edge measurement, binary edge measurement Then you can refer to BE ?? Since these reference names are linked to the character string of the registered name at the time of registration of the image processing, the image processing result can be easily referred to in the numerical calculation processing flow.
[0118]
From the above description, the numerical calculation example shown in FIG. 17 outputs the value 1 as a result if the score of the first candidate of the light and dark template matching 01 is greater than 70, and outputs the value zero otherwise. It can be seen that it is.
[0119]
In addition, there is an application in which the center of the position of two objects is calculated, for example. In this case, after obtaining the positions of the two objects by image processing, the average of the coordinates may be obtained. That is, this corresponds to (result of image processing A + result of image processing B) described in the first embodiment. This can be easily realized by using the ADD and DIV functions.
[0120]
This numerical calculation can also be used to calculate image processing results across programs. In the program menu 21 of FIG. 13, with the setting of “program 03”, nothing is selected for image processing, camera input is set to “no”, and only numerical calculation is set. If the numerical calculation variables (for example, A01 and TM01.S.1) used by each program are configured or set so that the values are retained even after the program ends, for example, “Program 01” As for A05 where the value is assigned and A01 where the value is assigned in "Program 02", the numerical calculation of "Program 03"
C01 ADD A05 A01
If “Program 03” is executed after “Program 01” and “Program 02” are executed, the image processing result of “Program 01” and the image processing result of “Program 02” are processed (in this case, addition) The result can be output as a variable C01.
[0121]
As described above, when the numerical calculation method is added in the first embodiment, four arithmetic operations for image processing can be performed. In addition, for example, when the data of the image processing result is a luminance value or the like, it is possible to output the determination as to whether or not the set threshold value is exceeded.
[0122]
According to the image processing program generation method and the image processing apparatus according to the present embodiment, it is possible to perform further arithmetic processing on the processing results obtained after the execution of the processing items of the image processing program. Written in a programming language. Therefore, the desired arithmetic processing can be described in detail in a programming language with respect to the processing result obtained by the image processing, and complicated image processing can be performed.
[0132]
【The invention's effect】
According to the first aspect of the present invention, the image processing means sets the setting items for each processing item of the image processing. Processing to receive content input And setting the execution order of each processing item for image processing Processing to receive content input And , Each through a different screen . And setting of setting items for each processing item of image processing Enter content The image processing means causes the image / graphic display means to display the target image and an image processing menu showing a list of setting items for each processing item of the image processing so that the target image is displayed as the image / graphic display. Through the operation using the operation input means while displaying on the display means, all or part of the target image is determined as the image processing area. Process to receive input Setting items through visual operation methods for selecting items in the image processing menu using operation input means Processing to receive content input And save the image processing area and the setting contents of the setting item in the memory with a name using a number or character string. To receive the input of the content to be executed. Also, setting the execution order of each processing item of image processing Enter content In this case, the image processing means causes the image / graphic display means to display a program menu showing the list of execution order settings. Furthermore, the image processing means can process each processing item of the image processing through a visual operation method of selecting an item in the program menu using the operation input means. In Select and specify each processing item for image processing using numbers or character strings stored in memory That receives input of the contents to be performed ,sort That receives input of the contents to be performed An image processing result reference setting for performing the next image processing with reference to the processing result of the previous image processing To receive input of contents Output setting that outputs the measurement value, which is the calculation result calculated by image processing, as a result signal during image processing To receive input of the contents of Do. Therefore, a series of image processing programs such as setting of setting items for each image processing item, setting of each image processing region, and setting of execution order of image processing can be visually simplified using an operation input means such as a mouse. There is an effect that it can be easily created by operation.
[0133]
According to the second aspect of the present invention, the image processing means sets the setting items for each processing item of the image processing. Processing to receive content input And setting the execution order of each processing item for image processing Processing to receive content input And , Each through a different screen . And setting of setting items for each processing item of image processing Enter content The image processing means causes the image / graphic display means to display the target image and an image processing menu showing a list of setting items for each processing item of the image processing so that the target image is displayed as the image / graphic display. Through the operation using the operation input means while displaying on the display means, all or part of the target image is determined as the image processing area. Process to receive input Setting items through visual operation methods for selecting items in the image processing menu using operation input means To receive input of contents Object with number or character string name for image processing area and setting contents The process of receiving the input of the contents to be registered. Also, setting the execution order of each processing item of image processing Enter content In this case, the image processing means causes the image menu and graphic display means to display a program menu that displays a list of execution order settings. Further, the image processing means is a number or character string registered in each processing item of the image processing through a method of inputting a command using the operation input means or a method of describing a program in a high-level language using the operation input means. Selection of each processing item for image processing using an object with a name That receives input of the contents to be performed ,sort That receives input of the contents to be performed An image processing result reference setting for performing the next image processing with reference to the processing result of the previous image processing To receive input of contents Output setting that outputs the measurement value, which is the calculation result calculated by image processing, as a result signal during image processing To receive input of contents I do. Therefore, it is possible to easily create a complicated image processing program by using the setting items for each image processing item set by a simple visual operation such as a mouse and the setting for each image processing region. There is.
[0134]
Claim 3 According to the invention described in the above, it is possible to perform further arithmetic processing on the processing result obtained after execution of the processing items of the image processing program on the image processing apparatus, and the arithmetic processing is described in a programming language. Is done. Therefore, the desired arithmetic processing can be described in detail in a programming language with respect to the processing result obtained by the image processing, and complicated image processing can be performed.
[0135]
Claim 4 According to the invention described above, in the image processing menu, a plurality of image processing areas and setting contents of setting items can be registered for each processing item of image processing using a number or a character string. Therefore, in the image processing program, there is an effect that the setting contents of the setting items of each processing item can be easily used and diverted.
[0136]
Claim 5 In the program menu, a plurality of programs whose settings have been completed can be registered by number or character string in the program menu. Therefore, there are effects that a plurality of image processing programs are switched and executed, and diversion of the image processing programs is facilitated.
[0137]
Claim 6 According to the invention described in (1), the image processing menu is configured by a simple setting menu that can set a part of the setting items and a detailed setting menu that can set all of the setting items. Therefore, it is possible to easily create an image processing program or to create an image processing program in detail according to necessity.
[0138]
Claim 7 According to the invention described in (1), the image processing menu or the program menu is configured to have a hierarchical structure of up to three stages. Therefore, the menu structure is simple and easy for the user to understand, and the programming work is facilitated.
[0139]
Claim 8 According to the invention described in the above, it is possible to perform a trial execution for each processing item of the image processing in the image processing menu. Therefore, it is possible to immediately determine whether the set items of the set processing items are appropriate, and there is an effect that the programming work becomes easy.
[0140]
Claim 9 According to the invention described in the above, it is possible to perform a trial execution of the image processing program in the execution order set in the program menu. Therefore, it is possible to immediately determine whether the created program operates correctly, and the programming work is facilitated.
[Brief description of the drawings]
FIG. 1 is a flowchart showing an image processing program creation method according to a first embodiment.
FIG. 2 is a diagram illustrating a configuration example of an image processing apparatus according to the first embodiment.
FIG. 3 is a diagram illustrating another configuration example of the image processing apparatus according to the first embodiment.
4 is a diagram showing an example of a screen displayed in the image processing apparatus according to Embodiment 1. FIG.
FIG. 5 is a diagram showing an example of a screen displayed in the image processing apparatus according to the first embodiment.
6 is a diagram showing an example of a screen displayed in the image processing apparatus according to Embodiment 1. FIG.
7 is a diagram showing an example of a screen displayed in the image processing apparatus according to Embodiment 1. FIG.
8 is a diagram showing an example of a screen displayed on the image processing apparatus according to Embodiment 1. FIG.
FIG. 9 is a diagram showing an example of a screen displayed on the image processing apparatus according to the first embodiment.
10 is a diagram showing an example of a screen displayed in the image processing apparatus according to Embodiment 1. FIG.
FIG. 11 is a diagram showing an example of a screen displayed in the image processing apparatus according to the first embodiment.
12 is a diagram showing an example of a screen displayed in the image processing apparatus according to Embodiment 1. FIG.
13 is a diagram showing an example of a screen displayed in the image processing apparatus according to Embodiment 1. FIG.
14 is a diagram showing an example of a screen displayed in the image processing apparatus according to Embodiment 1. FIG.
FIG. 15 is a flowchart showing an image processing program creation method according to the second embodiment.
FIG. 16 is a diagram showing an example of a screen displayed in the image processing apparatus according to the second embodiment.
FIG. 17 is a diagram illustrating an example of a screen displayed in the image processing apparatus according to the third embodiment.
FIG. 18 is a flowchart illustrating a conventional image processing program creation method.
FIG. 19 is a diagram showing an example of a screen displayed in a conventional image processing program creation method.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Start signal, 2 Image imaging means, 3 Image processing means, 4 Image and graphic display means, 5 Operation input means, 6 Output result signal, 7 Personal computer, 8 Monitor (image and graphic display means), 9 Operation input means, DESCRIPTION OF SYMBOLS 10 Connection means, 11 Main menu, 12 Image display part, 13 Command menu, 14 Pointer, 15 Image processing menu list, 16 Binary feature amount simple setting menu, 17 Image processing area, 18 Binary feature amount detailed setting menu, 19b Trial result, 20a Brightness measurement simple setting menu, 20d Brightness measurement detailed setting menu, 21 Program menu (Embodiment 1), 23 Program menu (Embodiment 2), 24 Project window, 25 Code window, 26 Output window, 27 Numerical calculation window.

Claims (9)

画像処理を行う対象の画像である対象画像を撮像する画像撮像手段と、
前記対象画像に画像処理を行う画像処理手段と、
前記画像処理の結果を表示する画像兼グラフィック表示手段と、
操作入力手段と
を備え、
前記画像処理手段は、
前記画像処理の各処理項目ごとの設定事項の設定内容の入力を受ける処理と、前記画像処理の各処理項目の実行順の設定内容の入力を受ける処理とを、各々異なる画面を介して行い
前記画像処理の各処理項目ごとの前記設定事項の設定内容の入力においては、前記画像処理手段は、
(A)前記画像兼グラフィック表示手段に対して、前記対象画像と前記画像処理の各処理項目毎の前記設定事項を一覧可能に表した画像処理メニューとを表示させ、
(B)前記対象画像を前記画像兼グラフィック表示手段に表示させつつ前記操作入力手段を用いた操作を通じて、前記対象画像のうち全部または一部を画像処理領域として決定する内容の入力を受ける処理を行い
(C)前記操作入力手段を用いた前記画像処理メニュー中の項目を選択する視覚的な操作方法を通じて、前記設定事項の設定内容の入力を受ける処理を行い、および
(D)前記画像処理領域と前記設定事項の設定内容とを番号もしくは文字列を用いて名前を付けてメモリに記憶させる内容の入力を受ける処理を行い
前記画像処理の各処理項目の前記実行順の設定内容の入力においては、前記画像処理手段は、
前記画像兼グラフィック表示手段に対して、前記実行順の設定を一覧可能に表したプログラムメニューを表示させ、
前記画像処理手段は、
(a)前記操作入力手段を用いた前記プログラムメニュー中の項目を選択する視覚的な操作方法を通じて、前記画像処理の各処理項目で前記メモリに記憶された番号もしくは文字列を用いて前記画像処理の各処理項目の選択指定を行う内容の入力を受ける処理、並び替えを行う内容の入力を受ける処理
(b)先に実施した前記画像処理の処理結果を参照して次に続く前記画像処理を実施させる画像処理結果参照設定の内容の入力を受ける処理、および
(c)前記画像処理の際に前記画像処理によって算出された演算結果である計測値を結果信号として出力させる出力設定の内容の入力を受ける処理を、行う
画像処理装置。
Image capturing means for capturing a target image which is an image to be subjected to image processing;
Image processing means for performing image processing on the target image;
Image and graphic display means for displaying the result of the image processing;
Operation input means,
The image processing means includes
Performs said a process of receiving an input of setting contents of the setting items for each processing item in the image processing, and processing for receiving an input of setting contents of the execution order of each processing item in the image processing, through each different screen,
In the input of the setting contents of the setting items for each processing item of the image processing, the image processing means,
(A) causing the image and graphic display means to display the target image and an image processing menu that displays a list of the setting items for each processing item of the image processing;
(B) A process of receiving input of content for determining all or part of the target image as an image processing area through an operation using the operation input unit while displaying the target image on the image and graphic display unit. Done
(C) performing a process of receiving an input of setting contents of the setting items through a visual operation method of selecting an item in the image processing menu using the operation input means; and (D) the image processing area and performs a process of receiving an input of reports that originate stored in the memory with a name using the set number or string and the content of the setting item,
In inputting the execution order setting contents of each processing item of the image processing, the image processing means includes:
On the image and graphic display means, a program menu showing the list of execution order settings is displayed,
The image processing means includes
(A) Through the visual operation method of selecting an item in the program menu using the operation input means, the image processing is performed using the number or character string stored in the memory for each processing item of the image processing. Processing to receive input of content to select and specify each processing item, processing to receive input of content to sort,
(B) a process of referring to the processing result of the image processing performed previously and receiving the input of the content of the image processing result reference setting for executing the subsequent image processing ; and (c) the processing at the time of the image processing. An image processing apparatus that performs a process of receiving an input of the content of an output setting that outputs a measurement value that is a calculation result calculated by image processing as a result signal.
画像処理を行う対象の画像である対象画像を撮像する画像撮像手段と、
前記対象画像に画像処理を行う画像処理手段と、
前記画像処理の結果を表示する画像兼グラフィック表示手段と、
操作入力手段と
を備え、
前記画像処理手段は、
前記画像処理の各処理項目ごとの設定事項の設定内容の入力を受ける処理と、前記画像処理の各処理項目の実行順の設定内容の入力を受ける処理とを、各々異なる画面を介して行い
前記画像処理の各処理項目ごとの前記設定事項の設定内容の入力においては、前記画像処理手段は、
(A)前記画像兼グラフィック表示手段に対して、前記対象画像と前記画像処理の各処理項目毎の前記設定事項を一覧可能に表した画像処理メニューとを表示させ、
(B)前記対象画像を前記画像兼グラフィック表示手段に対して表示させつつ前記操作入力手段の操作を通じて、前記対象画像のうち全部または一部を画像処理領域として決定する内容の入力を受ける処理を行い
(C)前記操作入力手段を用いた前記画像処理メニュー中の項目を選択する視覚的な操作方法を通じて、前記設定事項の設定内容の入力を受ける処理を行い、および
(D)前記画像処理領域と前記設定事項の設定内容とを番号もしくは文字列の名前を持つオブジェクトとして登録する内容の入力を受ける処理を行い
前記画像処理の各処理項目の前記実行順の設定内容の入力においては、前記画像処理手段は、
前記画像兼グラフィック表示手段に対して前記実行順の設定を一覧可能に表したプログラムメニューを表示させ、
前記画像処理手段は、
(a)前記操作入力手段を用いたコマンドを入力する方法、あるいは、前記操作入力手段を用いた高級言語によりプログラムを記述する方法を通じて、前記画像処理の各処理項目で登録した番号もしくは文字列の名前を持つ前記オブジェクトを用いて前記画像処理の各処理項目の選択指定を行う内容の入力を受ける処理、並び替えを行う内容の入力を受ける処理
(b)先に実施した前記画像処理の処理結果を参照して次に続く前記画像処理を実施させる画像処理結果参照設定の内容の入力を受ける処理、および
(c)前記画像処理の際に前記画像処理によって算出された演算結果である計測値を結果信号として出力させる出力設定の内容の入力を受ける処理、を行う
画像処理装置。
Image capturing means for capturing a target image which is an image to be subjected to image processing;
Image processing means for performing image processing on the target image;
Image and graphic display means for displaying the result of the image processing;
Operation input means,
The image processing means includes
Performs said a process of receiving an input of setting contents of the setting items for each processing item in the image processing, and processing for receiving an input of setting contents of the execution order of each processing item in the image processing, through each different screen,
In the input of the setting contents of the setting items for each processing item of the image processing, the image processing means,
(A) causing the image and graphic display means to display the target image and an image processing menu that displays a list of the setting items for each processing item of the image processing;
(B) Processing for receiving input of content for determining all or part of the target image as an image processing area through the operation of the operation input unit while displaying the target image on the image and graphic display unit. Done
(C) performing a process of receiving an input of setting contents of the setting items through a visual operation method for selecting an item in the image processing menu using the operation input means; and (D) the image processing area and Perform the process of receiving the input of the contents to be registered as an object having a number or character string name and the setting contents of the setting items
In inputting the execution order setting contents of each processing item of the image processing, the image processing means includes:
Display a program menu that displays a list of the execution order settings on the image and graphic display means,
The image processing means includes
(A) Through a method of inputting a command using the operation input means or a method of describing a program in a high-level language using the operation input means, the number or character string registered in each processing item of the image processing processing for receiving an input of the content by using the object with the name make a selection designation of each processing item of the image processing, processing for receiving an input of content that rearranges,
(B) a process of referring to the processing result of the image processing performed previously and receiving the input of the content of the image processing result reference setting for executing the subsequent image processing ; and (c) the processing at the time of the image processing. An image processing apparatus that performs a process of receiving input of output setting contents for outputting a measurement value, which is a calculation result calculated by image processing, as a result signal.
請求項1に記載の画像処理装置であって、The image processing apparatus according to claim 1,
前記画像処理プログラムの前記処理項目の実行後に得られる処理結果に対して、さらなる演算処理を行うことが可能で、Further calculation processing can be performed on the processing result obtained after execution of the processing items of the image processing program,
前記演算処理は、プログラミング言語で記述されるThe arithmetic processing is described in a programming language
画像処理装置。Image processing device.
請求項1または請求項2に記載の画像処理装置であって、The image processing apparatus according to claim 1 or 2,
前記画像処理メニューにおいて、前記画像処理の各処理項目について、前記画像処理領域と前記設定事項の設定内容とを、番号もしくは文字列を用いて複数個、登録できるIn the image processing menu, a plurality of image processing areas and setting contents of the setting items can be registered for each processing item of the image processing using a number or a character string.
画像処理装置。Image processing device.
請求項1または請求項2に記載の画像処理装置であって、The image processing apparatus according to claim 1 or 2,
前記プログラムメニューにおいて、設定を終了したプログラムを、番号もしくは文字列を用いて複数個、登録できるIn the program menu, multiple programs that have been set can be registered using numbers or character strings.
画像処理装置。Image processing device.
請求項1または請求項2に記載の画像処理装置であって、The image processing apparatus according to claim 1 or 2,
前記画像処理メニューを、前記設定事項の一部を設定可能な簡易設定メニューと、前記設定事項の全てを設定可能な詳細設定メニューとで構成するThe image processing menu includes a simple setting menu that can set a part of the setting items and a detailed setting menu that can set all of the setting items.
画像処理装置。Image processing device.
請求項1または請求項2に記載の画像処理装置であって、The image processing apparatus according to claim 1 or 2,
前記画像処理メニューあるいは前記プログラムメニューにおいて、最大3段階までの階層構造とするように構成するThe image processing menu or the program menu is configured to have a hierarchical structure of up to three levels.
画像処理装置。Image processing device.
請求項1または請求項2に記載の画像処理装置であって、The image processing apparatus according to claim 1 or 2,
前記画像処理メニューにおいて、前記画像処理の各処理項目ごとに試験的実行を行うことが可能なIn the image processing menu, a trial execution can be performed for each processing item of the image processing.
画像処理装置。Image processing device.
請求項1または請求項2に記載の画像処理装置であって、The image processing apparatus according to claim 1 or 2,
前記プログラムメニューにおいて、設定した前記実行順で画像処理プログラムの試験的実行を行うことが可能なIn the program menu, it is possible to perform a trial execution of the image processing program in the set execution order.
画像処理装置。Image processing device.
JP2001086785A 2001-03-26 2001-03-26 Image processing device Expired - Fee Related JP3967885B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001086785A JP3967885B2 (en) 2001-03-26 2001-03-26 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001086785A JP3967885B2 (en) 2001-03-26 2001-03-26 Image processing device

Publications (2)

Publication Number Publication Date
JP2002287963A JP2002287963A (en) 2002-10-04
JP3967885B2 true JP3967885B2 (en) 2007-08-29

Family

ID=18942114

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001086785A Expired - Fee Related JP3967885B2 (en) 2001-03-26 2001-03-26 Image processing device

Country Status (1)

Country Link
JP (1) JP3967885B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006323045A (en) * 2005-05-18 2006-11-30 Seiko Epson Corp Image processing method, and image display device and projector using method
JP4687432B2 (en) * 2005-12-08 2011-05-25 富士ゼロックス株式会社 Data reproduction method and apparatus
JP2009059203A (en) * 2007-08-31 2009-03-19 Omron Corp Customization device for image processing function, customization method for image processing function, and program for customizing image processing function
JP5060675B2 (en) * 2007-11-13 2012-10-31 株式会社キーエンス Program creation device for image processing controller
JP5060674B2 (en) * 2007-11-13 2012-10-31 株式会社キーエンス Program creation device for image processing controller
JP2013016013A (en) * 2011-07-04 2013-01-24 Omron Corp Development support device and development support method

Also Published As

Publication number Publication date
JP2002287963A (en) 2002-10-04

Similar Documents

Publication Publication Date Title
EP1582948A2 (en) Development aid device
JP2011165208A (en) Method and system for developing image processing application
US8234591B1 (en) Undo and redo using thumbnails generated from a specific area of the image
JP2016224599A (en) Guide file creation program
JP4242361B2 (en) Development support equipment
JP3967885B2 (en) Image processing device
JP4366605B2 (en) Development support apparatus, program, and processing method
US6243858B1 (en) Program construction assisting system
JP2017138901A (en) Inspection support device, inspection support method, and inspection support program
JP2009146075A (en) Image processing controller and test support system
CN111158669A (en) Graphical programming visual system and industrial control method
JP4517302B2 (en) Control method and program for development support apparatus and recording medium
JP2006146955A (en) Development support device
JP2720807B2 (en) Scenario editing device
JP4767309B2 (en) Information processing apparatus, information processing method, and computer program
JP3137855B2 (en) Compound document editing method and compound document editing processing device
JP2010244507A (en) Information processing apparatus, method of controlling the same, and program
JP2021140270A (en) Image processing apparatus, control method of image processing apparatus, and program
JP3971915B2 (en) Measuring instrument control program, measuring instrument, and computer-readable storage medium storing measuring instrument control program
KR100591354B1 (en) Apparatus for writing a program using a computer
WO2024085123A1 (en) Development system, method, and program
Eckstein et al. Interactive data inspection and program development for computer vision
JP2019106107A (en) Program, information processing apparatus, and screen test system
US7683902B1 (en) Method to visualize performance data of a multi-layered state diagram
JP2003109027A (en) Circuit, method and program for designating image processing area and computer readable recording medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060619

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060627

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060825

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061114

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061227

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070220

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070406

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070601

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110608

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees