JP4094435B2 - Image processing method and image processing apparatus characterized by automatically adjusting environment of optical system - Google Patents

Image processing method and image processing apparatus characterized by automatically adjusting environment of optical system Download PDF

Info

Publication number
JP4094435B2
JP4094435B2 JP2003007537A JP2003007537A JP4094435B2 JP 4094435 B2 JP4094435 B2 JP 4094435B2 JP 2003007537 A JP2003007537 A JP 2003007537A JP 2003007537 A JP2003007537 A JP 2003007537A JP 4094435 B2 JP4094435 B2 JP 4094435B2
Authority
JP
Japan
Prior art keywords
optical system
density
monitoring
adjustment variable
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2003007537A
Other languages
Japanese (ja)
Other versions
JP2004221988A (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.)
Sharp Corp
Technos Co Ltd
Original Assignee
Sharp Corp
Technos Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp, Technos Co Ltd filed Critical Sharp Corp
Priority to JP2003007537A priority Critical patent/JP4094435B2/en
Publication of JP2004221988A publication Critical patent/JP2004221988A/en
Application granted granted Critical
Publication of JP4094435B2 publication Critical patent/JP4094435B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、画像処理の対象とされる被写体を撮影する条件である光学系の環境設定を行なう画像処理方法および画像処理装置に関する。
【0002】
【従来の技術】
従来、工場の生産ラインでは、製品や部品等を対象に固体識別、検査、位置計測などを行なう場合、たとえばカメラなどの撮像手段を用いて前記製品や部品等の被写体の画像を入力し、入力された画像を処理することによって、前述の固体識別、検査、位置計測などの目的を達成する画像処理装置が用いられている。
【0003】
前述の被写体の固体識別、検査、位置計測などのために必要とされる被写体の画像を入力する際の撮影条件、すなわち画像処理装置に備わる光学系の環境設定の項目には、撮像手段であるカメラのレンズの焦点合わせ(以後、フォーカスと呼ぶ)および絞り、カメラのシャッタ速度、照明手段の照射光量がある。レンズのフォーカスや絞りの設定は、被写体の形状や被写体に対する照射光量によってそれぞれ異なる。カメラのシャッタ速度の設定は、被写体が移動しているか静止しているかによって異なり、移動している場合にはシャッタ速度を余り遅くすることができないという制約がある。照明手段の照射光量は、被写体の形状、材質および画像入力の対象とする部分によって適正量が異なる。
【0004】
従来、被写体の状態に応じて照射光量ならびにフォーカス、絞りおよびシャッタ速度を組合せるという複雑な光学系の環境設定は、操作者がモニタ画面を目視することによって行なわれるので、経験と熟練とが必要とされている。したがって、照明手段の経年劣化や外乱光の影響などの外的要因によって、一旦設定された光学系の環境の変更を余儀なくされるとき、経験が浅くまた練度の低い操作者では対応することが不可能であり、熟練者が現場で調整して再設定しなければならないのが実情である。また操作者が経験の深い熟練者であっても、適切と判断される光学系の環境設定が操作者毎に異なるので、同一の被写体であっても、設定される光学系の環境が操作者毎に異なるという問題もある。
【0005】
光学系の環境設定項目のうち、撮像手段に備わるレンズのフォーカスおよび絞りは、一度設定するとたとえばねじロック機構などによって固定される場合が多いので、自動調整(設定)の対象とするには困難がある。一方光学系の環境設定項目のうち、撮像手段のシャッタ速度と照明手段の照射光量とは、設定した状態で固定されることがないので、自動調整(設定)の対象として扱い易い。
【0006】
このようなことから、従来技術では、カメラで今回撮像された画像の濃度平均値と前回撮像された画像の濃度平均値との差、すなわち濃度の変化量を求め、その変化量が予め設定されている閾値を超える場合、その変化量に基づいてシャッタ速度を決定するというカメラのシャッタ速度の自動設定方法が提案されている(特許文献1参照)。
【0007】
またもう一つの従来技術では、カメラで撮影された画像の濃度のヒストグラムを作成し、被写体から切り出すべき画像の形成画素数を基に得られる2値化閾値と、暗部の山と明部の山との間部分の度数分布が最も小さい部分の濃度値である2値化閾値とが一致するように、外部調光機能を有する照明装置の照射光量を自動調整する方法が提案されている(特許文献2参照)。
【0008】
【特許文献1】
特開2001−230967号公報
【特許文献2】
特開平6−139341号公報
【0009】
【発明が解決しようとする課題】
しかしながら、特許文献1に開示される方法では、濃度変化量に対応するシャッタ速度の設定するべき値は自動で求められるけれども、求められた値にシャッタ速度を実際に設定するには、操作者が求められた値を入力しなければならない。また撮像手段の仕様として準備されているシャッタ速度のすべてに対応する濃度変化量のデータを予め作成しておかなければならないという問題がある。
【0010】
また特許文献2に開示される方法は、その適用が画像情報を2値化処理できる被写体に限定され、たとえばフラットパネルのような被写体と背景との区別が無い場合や被写体の照度と背景の照度とが分離できない場合などには、適用できないという問題がある。
【0011】
本発明の目的は、光学系の環境設定項目のうちシャッタ速度および照射光量から選択される光学系調整変数と画像濃度とが線形関係にあることに基づいて、操作者の操作によることなく光学系調整変数すなわち光学系の環境を自動調整することを特徴とする画像処理方法および画像処理装置を提供することである。
【0012】
【課題を解決するための手段】
本発明は、撮像されるべき被写体を撮影し、撮影された被写体の画像処理を行なうに際し、撮影条件である光学系の環境設定を行なう画像処理方法であって、
被写体を撮影することによって得られる撮像画面全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、
前記監視ウインドウ毎に画像濃度の平均値である平均濃度davを求め、
前記監視ウインドウ毎の前記平均濃度davが予め定める監視濃度範囲内であるか否かを判断し、
前記監視ウインドウ毎の前記平均濃度davが予め定める監視濃度範囲外である前記監視ウインドウが少なくとも1つ存在するとき、前記被写体を撮影する撮像手段のシャッタ速度または前記被写体を光照射する照明手段の照射光量の少なくともいずれか一方を光学系調整変数として選択し、
選択された光学系調整変数を変動させ、光学系調整変数の変動に伴って変動する前記監視ウインドウの画像の濃度を求めて、光学系調整変数と監視ウインドウの画像の濃度との関係として与えられる線形変換式を前記監視ウインドウ毎に作成し、
線形変換式に基づいて、前記平均濃度davに対応して定められる光学系調整変数の値を求め、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を設定することによって光学系の環境を自動調整することを特徴とする画像処理方法である。
【0013】
本発明に従えば、被写体を撮影することによって得られる撮像画面全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、監視ウインドウ毎に画像濃度の平均値である平均濃度davが予め定める監視濃度範囲内であるか否かを判断し、平均濃度davが予め定める監視濃度範囲外である前記監視ウインドウが少なくとも1つ存在するときには、シャッタ速度または照射光量の少なくともいずれか一方を光学系調整変数として選択し、選択された光学系調整変数と監視ウインドウの画像の濃度との関係として与えられる線形変換式を前記監視ウインドウ毎に作成し、この線形変換式に基づいて、平均濃度davに対応して定められる光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を自動で調整設定する。このように、光学系の環境であるシャッタ速度または照射光量が、線形変換式という定量化手段によって定量的かつ自動的に適正な値に設定されるので、操作者の操作によることなく、したがって操作者の技能に熟練を必要とせず、再現性よく光学系の環境設定を行なうことが可能になる。
【0014】
また本発明は、撮像されるべき被写体を撮影し、撮影された被写体の画像処理を行なうに際し、撮影条件である光学系の環境設定を行なう画像処理方法であって、
前記被写体を撮影する撮像手段のシャッタ速度と、前記被写体を光照射する照明手段の照射光量とを予め定める値に仮設定した状態で、前記撮像手段に備わるレンズのフォーカスと絞りとを設定し、
設定されたレンズのフォーカスおよび絞りの環境で、前記撮像手段のシャッタ速度と前記照明手段の照射光量とを所望の値に設定し、
前記撮像手段による撮像画面全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、監視ウインドウ毎に画像濃度の平均値である平均濃度davを求め、
前記監視ウインドウ毎の前記平均濃度davが予め定める監視濃度範囲内であるか否かを判断し、
前記監視ウインドウ毎の前記平均濃度davが前記監視濃度範囲外である前記監視ウインドウが少なくとも1つ存在するとき、シャッタ速度または照射光量の少なくともいずれか一方を光学系調整変数として選択し、
選択された光学系調整変数を変動させ、光学系調整変数の変動に伴って変動する前記監視ウインドウの画像の濃度を求めて、光学系調整変数と監視ウインドウの画像の濃度との関係として与えられる線形変換式を前記監視ウインドウ毎に作成し、
線形変換式に基づいて、前記平均濃度davに対応して定められる光学系調整変数の値を求め、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を設定することによって光学系の環境を自動調整することを特徴とする画像処理方法である。
【0015】
本発明に従えば、撮像手段による撮像画面全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、監視ウインドウ毎の画像濃度の平均値である平均濃度davが、光学系の環境の適否を判別するための基準となる監視濃度範囲内であるか否かによって、光学系の環境の適否を診断することができる。さらに診断結果が不適であるときには、シャッタ速度または照射光量の少なくともいずれか一方を光学系調整変数として選択し、選択された光学系調整変数と監視ウインドウの画像の濃度との関係として与えられる線形変換式を監視ウインドウ毎に作成し、この線形変換式に基づいて、平均濃度davに対応して定められる光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を自動で調整設定する。このように、光学系の環境であるシャッタ速度または照射光量が、線形変換式という定量化手段によって定量的かつ自動的に適正な値に設定されるので、操作者の操作によることなく、したがって操作者の技能に熟練を必要とせず、再現性よく光学系の環境設定を行なうことが可能になる。
【0016】
また、光学系の環境の適否を診断することによって、画像処理によるたとえば固体識別や検査における検出不良の原因が、光学系環境の不適に起因するものか、被写体の不良に起因するものかを明らかにすることができる。したがって、前述の固体識別や検査における検出不良原因の解析に要する時間を短縮することが可能になる。
【0017】
また本発明は、撮像されるべき被写体を撮影し、撮影された被写体の画像処理を行なうに際し、撮影条件である光学系の環境設定をすることのできる画像処理装置において、
前記被写体を光量可変に照射することのできる照明手段と、
被写体を撮影する撮像手段であって、シャッタ速度、絞りおよびフォーカス調整の可能な撮像手段と、
前記撮像手段によって撮影される画像全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、前記監視ウインドウの画像の濃度を求める画像処理を行ない、前記監視ウインドウ毎に画像濃度の平均値である平均濃度davを演算するとともに、前記監視ウインドウ毎に平均濃度davに基づいて監視濃度範囲を設定する画像処理手段と、
前記平均濃度davおよび前記監視濃度範囲がストアされる記憶手段と、
前記監視濃度範囲を記憶手段から読出し、前記撮像手段によって撮影される前記監視ウインドウの画像の濃度が、前記監視濃度範囲内であるか否かを判断する判断手段と、
前記シャッタ速度または前記照射光量の少なくともいずれか一方を光学系調整変数として選択する選択手段と、
選択手段によって選択される光学系調整変数を変動させ、光学系調整変数の変動に伴って変動する画像の濃度を求めて、光学系調整変数と画像の濃度との関係として与えられる線形変換式を前記監視ウインドウ毎に作成する線形変換式作成手段と、
線形変換式に基づいて、前記平均濃度davに対応して定められる光学系調整変数の値を求め、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を制御する制御手段とを含み、光学系の環境を自動調整することを特徴とする画像処理装置である。
【0018】
本発明に従えば、画像処理装置は、撮像手段によって撮影される画像全域のうち監視するべき部位に設定される監視ウインドウの画像の濃度が、たとえば画像の濃度の平均値である平均濃度davに基づいて設定される監視濃度範囲内にあるか否かによって、光学系の環境の適否を診断することができる。さらに光学系の環境診断の結果が不適であるとき、画像処理装置は、光学系の環境設定項目であるシャッタ速度または照射光量の少なくともいずれか一方を光学系調整変数として選択し、選択される光学系調整変数と画像の濃度との関係として与えられる線形変換式を監視ウインドウ毎に作成し、この線形変換式に基づいて、画像の平均濃度davに対応して定められる光学系調整変数の値になるように、シャッタ速度または照射光量を制御手段によって自動で設定することができる。このようにして、操作者の操作によることなく、したがって操作者の技能に熟練を必要とせず、再現性よく光学系の環境を自動調整することの可能な画像処理装置が実現される。
【0019】
【発明の実施の形態】
図1は、本発明の実施の一形態である画像処理装置1の構成を簡略化して示すブロック図である。本実施の形態の画像処理装置1は、撮像されるべき被写体2を撮影し、撮影された被写体2の画像処理を行なうに際し、撮影条件である光学系の環境設定をすることが可能であり、工場の生産ラインなどに設けられて製品や部品等を対象に固体識別、検査、位置計測等に用いられる。
【0020】
画像処理装置1は、被写体2を光量可変に照射することのできる照明手段3と、被写体2を撮影する撮像手段4であって、シャッタ速度、絞りおよびフォーカス調整の可能な撮像手段4と、操作者が、撮像手段4のシャッタ速度および照明手段3の照射光量を仮設定する場合、設定値を入力するために用いられる入力手段5と、撮像手段4によって撮影される画像の濃度を求める画像処理を行ない、画像濃度の平均値である平均濃度davを演算するとともに、平均濃度davに基づいて監視濃度範囲を設定する画像処理手段6と、画像処理手段6による平均濃度davおよび監視濃度範囲がストアされる記憶手段であるRandom Access Memory7(略称RAM)と、監視濃度範囲をRAM7から読出し、撮像手段4によって撮影される画像の濃度が監視濃度範囲内であるか否かを判断する判断手段8と、シャッタ速度または照射光量の少なくともいずれか一方を光学系調整変数として選択する選択手段9と、選択手段9によって選択される光学系調整変数を変動させ、光学系調整変数の変動に伴って変動する画像の濃度を求めて、光学系調整変数と画像の濃度との関係として与えられる線形変換式を作成する線形変換式作成手段10と、線形変換式作成手段10によって作成される線形変換式に基づいて、前述の平均濃度davに対応して定められる光学系調整変数の値を求め、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を制御する制御手段11とを含む。
【0021】
被写体2は、前述のように固体識別、検査、位置計測などの対象とされる製品または部品等であり、半導体チップその他種々の物が挙げられる。照明手段3は、光の出射源である光源12と、光源12に対して電力量を可変に供給できる電源13とを含む。光源12には、たとえば発光ダイオード(略称LED)やタングステンランプが好適に用いられ、電源13から供給される電力量に応じて、被写体2を照射する光が光量可変に出射される。
【0022】
撮像手段4は、Charge Coupled Device(略称CCD)素子を備えるCCDカメラ14と、CCDカメラ14に対する入出力信号をアナログ/デジタルに相互変換するアナログ/デジタル(略称A/D)変換器15と、CCDカメラ14からの画像情報を信号処理して後述の処理回路20へ出力するとともに、処理回路20からの出力に応答してCCDカメラ14の動作制御を行なう信号を出力する撮像表示制御器16と、撮像表示制御器16に接続されてCCDカメラ14による画像情報の随時書込み/読出しが可能な記憶手段であるフレームメモリ17とを含む。
【0023】
CCDカメラ14には、図示を省くけれども、レンズが備えられ、レンズまわりには、レンズの焦点を調整するためのフォーカス機構、露出調整のための絞り機構および速度を可変に設定できるシャッタ機構が設けられる。これらの各機構は、撮像表示制御器16を介して処理回路20からの制御信号によって調整可能であり、また手動で調整することも可能なように構成される。また撮像手段4には、モニタ18が含まれてもよい。モニタ18は、液晶や陰極線管などによって構成され、本実施の形態では、デジタル/アナログ(略称D/A)変換器19を介して撮像表示制御器16に接続されて、CCDカメラ14による画像情報を可視像として表示する。
【0024】
処理回路20は、Central Processing Unit(略称CPU)を搭載するたとえばマイクロコンピュータなどによって実現される。この処理回路20が、前述の画像処理手段6、判断手段8、選択手段9、線形変換式作成手段10および制御手段11を含む構成である。処理回路20は、Read Only Memory21(略称ROM)に予めストアされてあるプログラムに従って動作し、前述の各手段として機能するとともに画像処理装置1全体の動作を制御する。
【0025】
入力手段5は、リモート設定キーである。入力手段はキーボードなどであってもよく、キーボードから各種の設定値を入力するように構成されてもよい。しかしながら、キーボードから各種の設定値をすべて数値入力すると操作が繁雑になり入力所要時間も長くなるので、本実施の形態では、入力手段5をリモート設定キーとし、前述のRAM7に、たとえばテーブルデータとして予めストアされる各種の設定値を処理回路20によって読出し、読出された設定値をモニタ18に表示し、表示された設定値からキー操作により選択して入力する構成とした。入力手段5は、入出力(I/O)インターフェイス22を介して、処理回路20を初めとする装置の各手段に接続される。なお入出力インターフェイス22には、前述の照明手段3の電源13が接続される。
【0026】
以下処理回路20に含まれる画像処理手段6、判断手段8、選択手段9、線形変換式作成手段10および制御手段11の動作について説明する。
【0027】
画像処理手段6は、撮像手段4による撮像画面に形成または撮像画面を区分することによって形成される領域である監視ウインドウを設定し、各監視ウインドウについて画像濃度の平均値である平均濃度davを求め、光学系の環境の適否を判別するための基準となる監視濃度範囲を平均濃度davに基づいて定める。監視濃度範囲を定める方法は、特に限定されることはないけれども、たとえば平均濃度davのプラスマイナス(±)10%を初期値として定められることが好ましい。また画像処理手段6は、監視ウインドウ内の画像にとどまらず、撮像画面全域および撮像画面内において任意に定められる領域の画像濃度および平均濃度davを求めることができる。画像処理手段6によって求められた各監視ウインドウについての平均濃度davと監視濃度範囲とは、前述のようにRAM7にストアされる。
【0028】
判断手段8は、設定された光学系環境において、画像処理手段6によって求められる各監視ウインドウの画像濃度を、RAM7から読出される各監視ウインドウ毎に定められた監視濃度範囲と比較して監視濃度範囲内にあるか否かを判断、すなわち光学系の環境を診断し、判断結果を選択手段9、モニタ18、出力手段24に出力する。出力手段24には、たとえば警報ブザーが用いられる。
【0029】
選択手段9は、判断手段8の判断結果に応答し、画像濃度が監視濃度範囲外である監視ウインドウが1つでも存在、すなわち光学系の環境が不適であると診断されるとき、シャッタ速度または照射光量のいずれか一方を光学系調整変数として選択する。この選択は、シャッタ速度と照射光量とに優先順位を付けておくことなどによって実行することができる。
【0030】
図2は、監視ウインドウ設定の状態と線形変換式とを例示する図である。図2を参照して線形変換式作成手段10の動作について説明する。図2では、被写体に金属端子25の出ているコネクタ26をとりあげた場合について示す。本実施の形態では、監視濃度範囲を設定して画像濃度を監視するとともに、線形変換式を作成するべき監視ウインドウが4つ設定される。第1監視ウインドウ27は、金属端子25を含んで設定され、第2および第3監視ウインドウ28,29は、コネクタ26の白色樹脂部分にそれぞれ設定され、第4監視ウインドウ30は、コネクタ26が載置される搬送台の表面に対して設定され、この搬送台の表面を背景と呼ぶことがある。
【0031】
それぞれ設定された各監視ウインドウに対し、光学系調整変数がたとえば照明手段3による照射光量の場合、入力手段5からの入力操作によって最小から最大まで(たとえば8ビット調光の場合零(0)から255まで)変化させる。変化の各段階における各照射光量に対する監視ウインドウの濃度を画像処理手段6によって求める。線形変換式作成手段10は、照射光量のボリュウム値と濃度との関係を、第1〜第4監視ウインドウ27,28,29,30のそれぞれについて求める。照射光量のボリュウム値と濃度との関係は、ほぼ線形式として得られる。この線形式および線形式をグラフ化したものを含めて、ここでは線形変換式と呼ぶ。
【0032】
光学系調整変数がたとえば撮像手段4のシャッタ速度の場合、入力手段5からの入力操作によって最小から最大まで(たとえば1/10000から1/30まで)変化させる。変化の各段階における各シャッタ速度に対する監視ウインドウの濃度を画像処理手段6によって求める。線形変換式作成手段10は、シャッタ速度値と濃度との関係を、第1〜第4監視ウインドウ27,28,29,30のそれぞれについて求める。前述と同様シャッタ速度値と濃度との関係は、ほぼ線形式として得られる。
【0033】
図2(b)には、光学系調整変数が照射光量の場合についての線形変換式を示す。図2(b)に示すライン31が、第1監視ウインドウ27すなわち金属端子部の画像の線形変換式であり、ライン32およびライン33が、第2および第3監視ウインドウ28,29すなわち白色樹脂部の画像の線形変換式であり、ライン34が、第4監視ウインドウ30すなわち背景画像の線形変換式である。ライン32およびライン33には、高濃度側において、照射光量ボリュウム値が変化しているにも関らず濃度の変化しない部分があり、この部分を便宜上「平坦部」と呼ぶ。一方、ライン32およびライン33の前記「平坦部」を除く部分、ならびにライン31およびライン34は、1次の線形関係にあり、照射光量ボリュウム値と濃度とを互いに変換できるので、この部分を便宜上「変換部」と呼ぶ。線形変換式作成手段10によって、各環境ウインドウ27,28,29,30について得られる線形変換式は、RAM7にストアされる。
【0034】
制御手段11は、設定されている光学系の環境下で画像処理手段6によって求められる各監視ウインドウの画像の平均濃度davを用い、平均濃度davに対応して線形変換式から定められる光学系調整変数の値を求める。次に、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を制御する。このように、制御手段11は、線形変換式と監視ウインドウの画像について得られる平均濃度davとを用いて、光学系の環境である光学系調整変数を自動調整することができる。
【0035】
前述のように光学系の環境のうち、光学系調整変数として選択されるシャッタ速度と照射光量とは自動調整される。次に光学系の環境のうち、残るレンズのフォーカスおよび絞りの設定について説明する。レンズのフォーカスおよび絞りは、被写体2を撮像手段4で撮影して得られる画像をモニタ18に表示し、操作者が、モニタ18画面を目視しながらフォーカスつまみおよび絞りつまみをそれぞれ調整することによって、設定される。レンズのフォーカスおよび絞りは、操作者の目視判断によることなく、以下に述べるような定量化された指標に基づいて設定されてもよい。
【0036】
レンズのフォーカスは、前述の画像処理手段6に以下のような機能を持たせることによって、定量化して設定することができる。画像処理手段6によって、撮像手段4で撮影された画像の濃度を1次微分し、1次微分によって得られる濃度の差分の和である差分和を演算する画像処理を行なう。画像濃度の1次微分による差分和は、フォーカスつまみを回して所定範囲内の各値に設定した状態で求められる。フォーカスつまみの各設定値毎に求められる差分和のうち、最大差分和を示したフォーカスつまみの位置をフォーカスの最適値として選択し設定する。
【0037】
レンズの絞りは、画像処理手段6にさらに以下の機能を持たせることによって、定量化して設定することができる。画像処理手段6は、撮像手段4によって撮影された画像の濃度分布を求め、さらに濃度分布に基づいて濃度の最大値Dmaxと最小値Dminとの絶対値差分である濃度幅Dwを求める演算を行なう。図3は、画像処理手段6によって画像の濃度分布を求めた例を示す図である。図3では、濃度を横軸に、当該濃度の頻度を画素数で縦軸に示す。濃度幅Dwは、濃度分布を示すライン35によって与えられる濃度最大値Dmaxと濃度最小値Dminとの絶対値差分(|Dmax−Dmin|)で与えられる。画像濃度分布における濃度幅Dwは、CCDカメラ14に備わるレンズの絞りつまみを回して所定範囲内の各値に設定した状態で求められる。絞りつまみの各設定値毎に求められる濃度幅Dwのうち、最大濃度幅を示した絞りつまみの位置を絞りの最適値として選択する。
【0038】
前述のように本実施の形態では、フォーカスつまみおよび絞りつまみを操作者が人手によって調整するけれども、フォーカスつまみおよび絞りつまみ値をテーブルデータとしてモニタ18に表示し、入力手段5でそれぞれの値を選択して入力することによって、処理回路20および撮像表示制御器16を介して調整するように構成されてもよい。
【0039】
図4は、本発明の実施の態様である画像処理方法を説明するフローチャートである。図4を参照し、図1に示す画像処理装置1を用いた画像処理方法について説明する。ステップs0では、図1に示す画像処理装置1と、被写体2とを準備し、被写体2の撮像を開始できる状態にある。ステップs1では、固定環境を設定する。ここで固定環境とは、撮像手段4に備わるレンズのフォーカスと絞りとを意味する。本実施の態様では、レンズのフォーカスと絞りとは、操作者によって一旦設定された後、画像処理装置1において自動調整されることなく、設定された条件に固定されたまま用いられるので、固定環境と呼ぶ。
【0040】
図5は、固定環境設定動作を説明するフローチャートである。図5を参照して先の図4に示すステップs1の固定環境設定動作を説明する。ステップs11では、CCDカメラ14のシャッタ速度を仮設定する。シャッタ速度は、被写体2が静止状態であれば、たとえば60分の1(1/60)秒または100分の1(1/100)秒に設定され、被写体2が移動状態であれば、移動速度に応じた値に設定される。ステップs12では、照明手段3の照射光量が仮設定される。本実施の態様では、操作者が、モニタ18に表示される被写体2の画像を観察しながら照射光量を仮設定する。
【0041】
ステップs13では、固定環境の一つであるレンズのフォーカスが設定される。本実施の態様では、レンズのフォーカス設定、すなわちピント調整は、操作者が、モニタ18に表示される被写体2の画像を観察しながらフォーカスつまみを回して好適なピントになるように行なわれる。なおピント調整は、操作者がモニタ18を観察しながら行なう方法に限定されることなく、前述のように被写体2を含む画像を画像処理手段6によって1次微分して濃度の差分和を算出し、差分和が最大になるフォーカスつまみ値を最適フォーカスとして設定する方法によってもよい。
【0042】
ステップs14では、固定環境の一つであるレンズの絞りが設定される。本実施の態様では、レンズの絞り設定、すなわち画像の明るさおよびコントラストの調整は、操作者が、モニタ18に表示される被写体2の画像を観察しながら絞りつまみを回して好適な画像の明るさとコントラストとになるように行なわれる。なお絞り調整は、操作者がモニタ18を観察しながら行なう方法に限定されることなく、前述のように被写体2を含む画像を画像処理手段6によって濃度分布および濃度幅Dwを求める演算を行い、濃度幅Dwが最大になる絞りつまみ値を最適絞りとして設定する方法によってもよい。
【0043】
図4に戻って、ステップs2では、調整環境を設定する。ここで調整環境とは、撮像手段4に備わるCCDカメラ14のシャッタ速度と照明手段3による照射光量とを意味する。シャッタ速度と照射光量とは、設定した環境下において画像濃度が監視濃度範囲外であるとき、前述の線形変換式作成手段10による線形変換式に基づいて、画像処理装置1において自動調整されるので、調整環境と呼ぶ。しかしながら、このステップs2では、シャッタ速度と照射光量とは、まだ自動調整によることなく操作者によって設定される。
【0044】
図6は、調整環境設定動作を説明するフローチャートである。図6を参照して図4に示すステップs2の調整環境設定動作を説明する。ステップs21では、固定環境が設定された状態で、先のステップs1において仮設定されたシャッタ速度を、操作者が微調整して再設定する。このとき、被写体2が移動状態であれば、画像がぶれることを防止するために、被写体2の移動速度に対してシャッタ速度の遅い方の限界を超えないように留意する必要がある。ステップs22では、固定環境が設定された状態で、先のステップs1において仮設定された照射光量を、操作者がモニタ18に表示される画像を観察しながら再調整して設定する。
【0045】
図4に戻って、ステップs3では、環境監視設定を行なう。本ステップでは、ステップs1およびs2において設定した光学系の環境を、固体識別や検査などの実稼働時に監視するために監視ウインドウと監視濃度とを設定する。図7は、環境監視設定動作を説明するフローチャートである。図7を参照して図4に示すステップs3の環境監視設定動作を説明する。
【0046】
ステップs31では、被写体2を含んで得られる撮像画面内において、光学系の環境を監視するべき部位に前述の図2(a)に例示するような監視ウインドウを設ける。ステップs32では、画像処理手段6によって、設定した監視ウインドウの平均濃度davを求める。ステップs33では、監視ウインドウについて得られた平均濃度davに基づいて監視濃度範囲を設定する。本実施の態様では、監視濃度範囲を、監視ウインドウについて得られた平均濃度davの±10%、すなわち0.90dav以上、1.10dav以下の範囲に設定した。
【0047】
ステップs34では、被写体2の種類によって予め定められる数の監視ウインドウを設定したか否かが判断される。この判断は、被写体2の種類毎に設定するべき監視ウインドウの数を、テーブルデータとしてRAM7にストアしておくとともに、初期値「0」として設定し、前述の監視ウインドウを1つ設けるごとに、初期値に「1」を加算するようにし、画像処理手段6が、この加算結果と前述のRAM7から読出した監視ウインドウの数と比較することによって、行なうことができる。判断結果が否定で、設定した監視ウインドウの数が、RAM7から読出した値未満であるとき、ステップs31へ戻り、監視ウインドウの設定以降のステップを繰返す。判断結果が肯定で、設定した監視ウインドウの数が、RAM7から読出した値に一致するとき、メインのフローへ進む。
【0048】
図4へ戻って、ステップs4では、光学系環境の自動調整および設定を行う。このステップにおいて自動調整の対象とされる光学系の環境は、前述のステップs2において述べた調整環境であるシャッタ速度と照射光量とである。本ステップでは、シャッタ速度または照射光量のうちからいずれかを光学系調整変数として選択し、選択した光学系調整変数と画像濃度との線形変換式を作成するとともに、監視ウインドウの画像濃度を監視し、画像濃度が監視濃度範囲外である監視ウインドウが存在する場合、光学系調整変数として選択されたシャッタ速度または照射光量を、線形変換式に基づいて自動調整して設定する。
【0049】
図8は、線形変換式を作成する動作を説明するフローチャートである。図8を参照して図4のステップs4における光学系環境の自動調整設定動作のうち、線形変換式作成動作を説明する。ステップs411では、選択手段9が、光学系の環境因子のうち、調整環境であるシャッタ速度または照射光量のいずれかを光学系調整変数として選択する。
【0050】
なお照明手段3に、照射光量を手動調整する機能しか備えられていない場合、光学系調整変数は、必然的にシャッタ速度が選択される。また被写体の移動速度が速い場合、シャッタ速度は移動速度に応じた短い時間に設定され、調整範囲をほとんど設定することができないので、光学系調整変数には、必然的に照射光量が選択される。
【0051】
ステップs412では、選択された光学系調整変数がシャッタ速度であるか否かが判断される。判断結果が肯定でシャッタ速度が選択されているとき、ステップs413へ進み、判断結果が否定で照射光量が選択されているとき、ステップs414へスキップする。ステップs413では、被写体が移動状態である場合、シャッタ速度に下限値(遅い方の限界値)を設定する。これにより処理時間オーバーと映像ぶれとを防止する。撮像手段4の仕様として定められるシャッタ速度の下限値以上の範囲内で調整できず、処理時間や画像ぶれを考慮した移動状態で調整する場合は、「調整無」を選択する。静止させて調整変数を求める場合は、「調整有」を選択する。
【0052】
ステップs414では、再度光学系調整変数がシャッタ速度であるか否かが判断される。判断結果が肯定で、光学系調整変数がシャッタ速度であるとき、ステップs415へ進み、判断結果が否定で、光学系調整変数が照射光量であるとき、ステップs416へ進む。ステップs415では、シャッタ速度を予め定める変動範囲内の全シャッタ速度に変動させ、各シャッタ速度における監視ウインドウ内の画像濃度を求める。一方ステップs416では、照射光量を予め定める変動範囲内の全照射光量に変動させ、各照射光量における監視ウインドウ内の画像濃度を求める。
【0053】
ステップs417では、シャッタ速度と画像濃度、または照射光量と画像濃度との関係から、線形変換式を作成する。ステップs418では、作成された線形変換式における「平坦部」と「変換部」との境界値を求めて、線形変換式とともに境界値もRAM7へストアする。なお線形変換式に「平坦部」が生じない場合には、境界値がなくてもよい。ステップs419では、被写体2の種類によって予め定められる数の監視ウインドウについて、線形変換式を作成したか否かが判断される。判断結果が否定であるとき、ステップs414へ戻り以降のステップを行なう。判断結果が肯定であるとき、メインのフローへ進む。
【0054】
図9は、線形変換式に基づいて光学系調整変数を自動調整して設定する動作を説明するフローチャートである。ステップs420のスタートでは、メインのフローにおけるステップs0と重複する形でスタートステップが設けられる。監視ウインドウ内の画像濃度を監視して診断し、診断結果に応答して光学系調整変数を自動調整する動作は、ラインの生産稼働中に常時実行されてもよいけれども、その実行中、ラインは生産稼働ではなく調整稼働の状態におかれるので、生産効率の観点からは好ましくない。光学系環境の診断および自動調整は、ラインを長時間停止した後に立上げ稼働させるとき、また画像処理装置を用いた固体識別不良や検査不良などが発生し、ラインの稼働条件を調整した後に立上げ稼働させるときなどに限定して実行されることが好ましい。したがって、実行開始を指示するためのステップを設けることとした。ステップs420では、入力手段5に予め定めるキーを操作することによって、光学系環境の監視および自動調整動作開始を指示する信号が入力された状態である。
【0055】
ステップs421では、撮像手段4によって被写体を含む画像を取込む。ステップs422では、監視ウインドウ内の画像の濃度(監視用画像濃度)を求める。この監視用画像濃度は、監視ウインドウ内の画像の平均濃度davである。ステップs423では、判断手段8は、監視用画像濃度とRAM7から読出された監視濃度範囲とを比較すなわち画像濃度を診断し、診断結果をRAM7にストアする。ステップs424では、被写体の種類によって予め定められる数の監視ウインドウについて画像濃度診断を行なったか否かが判断される。判断結果が否定で、診断した監視ウインドウの数が、予め定められる数未満であるとき、ステップs422へ戻り以降のステップを行なう。判断結果が肯定で、診断した監視ウインドウの数が、予め定められる数に一致するとき、ステップs425へ進む。
【0056】
ステップs425では、判断手段8は、予め定められる数の監視ウインドウすべてについての診断結果をRAM7から読出し、監視用画像濃度が監視濃度範囲外である監視ウインドウが存在するか否かを判断する。判断結果が否定で、すべての監視ウインドウの監視用画像濃度が、監視濃度範囲内であるとき、光学系環境は適正であるのでステップs431へ進む。ステップs431では、判断手段8は、「監視OK」をモニタ18に表示させるとともに出力手段24に出力させ、ステップs432(s5)へ進み光学系環境の自動調整動作が終了する。
【0057】
一方判断結果が肯定で、監視用画像濃度が監視濃度範囲外である監視ウインドウが、1つでも存在するとき、判断手段8からの出力信号によって、「監視NG(No Good)」をモニタ18に表示させるとともに出力手段24に出力する。なお、このとき監視用画像濃度の監視濃度範囲外であった監視ウインドウの数が同時に表示される。
【0058】
ステップs427では、制御手段11が、RAM7にストアされている当該監視ウインドウに対応する線形変換式を読出し、線形変換式に基づいて監視用画像濃度である平均濃度davに対応する光学系調整変数の値を求める。ステップs428では、制御手段11は、さらに前ステップで求めた光学系調整変数の値になるように、選択された光学系調整変数を自動調整し設定する。
【0059】
ステップs429では、光学系調整変数すなわち照射光量とシャッタ速度との両方について、監視用画像濃度が監視濃度範囲外であった監視ウインドウに対する光学系調整変数の調整が完了したか否かが判断される。なお照射光量が手動調整である場合、また被写体の移動速度が速くシャッタ速度の設定可能な範囲が狭い場合などのように、光学系調整変数として用いることのできるものが、照射光量またはシャッタ速度のいずれか一方しか無いとき、このステップs429は実行されることなく次のステップへ進む。
【0060】
判断結果が否定であるとき、ステップs421へ戻り以降のステップを繰返す。判断結果が肯定であるとき、すなわち監視用画像濃度が監視濃度範囲外である監視ウインドウについて調整が完了したけれども、「監視OK」の出力が得られなかったとき、ステップs430へ進む。ステップs430では、判断手段8が、「光学系環境異常」をモニタ18に表示するとともに出力手段24に出力して、ステップs432(s5)へ進み、光学系環境の自動調整動作を完了する。
【0061】
なお「光学系環境異常」が出力された場合、「監視NG」である監視ウインドウの数によって、撮像画面の全エリアが異常であるのか、または特定エリアが異常であるのかを判別し、光源12の玉切れ、シャッタ速度異常、その他外部環境の異常などの項目順に従って点検を行なう。点検の結果、たとえば光源12の玉切れが異常原因であれば、玉を交換した後、光学系の環境を再構築して診断および自動調整動作を実行する。
【0062】
【発明の効果】
本発明によれば、光学系の環境設定項目のうち、シャッタ速度または照射光量が、線形変換式という定量化手段によって定量的かつ自動的に適正な値に設定されるので、操作者の操作によることなく、したがって操作者の技能に熟練を必要とせず、再現性よく光学系の環境設定を行なうことが可能になる。
【0063】
また、光学系の環境の適否を診断することによって、画像処理によるたとえば固体識別や検査における検出不良の原因が、光学系環境の不適に起因するものか、被写体の不良に起因するものかを明らかにすることができる。したがって、前述の固体識別や検査における検出不良原因の解析に要する時間を短縮することが可能になる。
【図面の簡単な説明】
【図1】本発明の実施の一形態である画像処理装置1の構成を簡略化して示すブロック図である。
【図2】監視ウインドウ設定の状態と線形変換式とを例示する図である。
【図3】画像処理手段6によって画像の濃度分布を求めた例を示す図である。
【図4】本発明の実施の態様である画像処理方法を説明するフローチャートである。
【図5】固定環境設定動作を説明するフローチャートである。
【図6】調整環境設定動作を説明するフローチャートである。
【図7】環境監視設定動作を説明するフローチャートである。
【図8】線形変換式を作成する動作を説明するフローチャートである。
【図9】線形変換式に基づいて光学系調整変数を自動調整して設定する動作を説明するフローチャートである。
【符号の説明】
1 画像処理装置
2 被写体
3 照明手段
4 撮像手段
5 入力手段
6 画像処理手段
7 RAM
8 判断手段
9 選択手段
10 線形変換式作成手段
11 制御手段
12 光源
13 電源
14 CCDカメラ
15 A/D変換器
16 撮像表示制御器
17 フレームメモリ
18 モニタ
19 D/A変換器
20 処理回路
21 ROM
22 I/Oインターフェイス
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing method and an image processing apparatus for setting an environment of an optical system, which is a condition for photographing a subject to be subjected to image processing.
[0002]
[Prior art]
Conventionally, in a factory production line, when performing solid identification, inspection, position measurement, etc. for products or parts, for example, an image of a subject such as the product or parts is input and input using an imaging means such as a camera. An image processing apparatus that achieves the above-described objects such as solid identification, inspection, and position measurement by processing the processed image is used.
[0003]
The imaging conditions when inputting an image of a subject required for solid identification, inspection, position measurement, etc. of the subject, that is, the environment setting item of the optical system provided in the image processing apparatus is an imaging means. There are camera lens focusing (hereinafter referred to as focus) and diaphragm, camera shutter speed, and illumination light quantity of the illumination means. Lens focus and aperture settings differ depending on the shape of the subject and the amount of light applied to the subject. The setting of the shutter speed of the camera differs depending on whether the subject is moving or stationary, and there is a restriction that the shutter speed cannot be reduced too much when moving. The appropriate amount of light emitted from the illuminating means varies depending on the shape and material of the subject and the portion that is the target of image input.
[0004]
Conventionally, the environment setting of a complex optical system that combines the amount of irradiation light and the focus, aperture, and shutter speed according to the state of the subject is performed by the operator viewing the monitor screen, so experience and skill are required. It is said that. Therefore, when the environment of the optical system once set is forced to change due to external factors such as aging deterioration of the illumination means and the influence of ambient light, it is possible for an inexperienced and less skilled operator to respond. It is impossible, and the actual situation is that an expert has to adjust and re-set in the field. Even if the operator is an experienced operator, the environment setting of the optical system that is determined to be appropriate differs for each operator. There is also a problem that it is different for each.
[0005]
Of the environment setting items of the optical system, the focus and diaphragm of the lens provided in the imaging means are often fixed once by, for example, a screw lock mechanism, so that it is difficult to make a target for automatic adjustment (setting). is there. On the other hand, among the environment setting items of the optical system, the shutter speed of the imaging unit and the irradiation light amount of the illuminating unit are not fixed in the set state, and thus are easy to handle as targets for automatic adjustment (setting).
[0006]
For this reason, in the prior art, the difference between the average density value of the image captured this time by the camera and the average density value of the previously captured image, that is, the amount of change in density is obtained, and the amount of change is preset. A method of automatically setting the shutter speed of a camera is proposed in which the shutter speed is determined based on the amount of change when the threshold value exceeds the threshold value (see Patent Document 1).
[0007]
In another conventional technique, a density histogram of an image taken by a camera is created, a binarization threshold value obtained based on the number of pixels formed in an image to be cut out from a subject, and a dark peak and a bright peak. Has been proposed that automatically adjusts the amount of light emitted from a lighting device having an external dimming function so that the binarization threshold value, which is the density value of the portion with the smallest frequency distribution between the two, coincides (patent) Reference 2).
[0008]
[Patent Document 1]
JP 2001-230967 A
[Patent Document 2]
JP-A-6-139341
[0009]
[Problems to be solved by the invention]
However, in the method disclosed in Patent Document 1, the value to be set for the shutter speed corresponding to the density change amount is automatically obtained. However, in order to actually set the shutter speed to the obtained value, the operator needs You must enter the value that was found. In addition, there is a problem that density change amount data corresponding to all shutter speeds prepared as specifications of the imaging means must be created in advance.
[0010]
In addition, the method disclosed in Patent Document 2 is applied only to a subject that can binarize image information. For example, when there is no distinction between a subject and a background such as a flat panel, or the illuminance of the subject and the illuminance of the background There is a problem that it cannot be applied to cases where and cannot be separated.
[0011]
An object of the present invention is based on the fact that the optical system adjustment variable selected from the shutter speed and the irradiation light quantity among the environment setting items of the optical system and the image density are in a linear relationship, so that the optical system is not operated by the operator. It is an object to provide an image processing method and an image processing apparatus characterized by automatically adjusting an adjustment variable, that is, an environment of an optical system.
[0012]
[Means for Solving the Problems]
  The present invention is an image processing method for photographing an object to be imaged and performing environment setting of an optical system as a photographing condition when performing image processing of the photographed object.
  Obtained by shooting the subjectSet one or more monitoring windows for the part to be monitored in the entire imaging screen,
  The monitoring windowEveryAn average density dav which is an average value of image density is obtained,
  For each monitoring windowDetermining whether the average concentration dav is within a predetermined monitoring concentration range;
  For each monitoring windowThe average density dav is outside a predetermined monitoring density rangeThere is at least one monitoring windowWhen selecting at least one of the shutter speed of the imaging means for photographing the subject or the irradiation light amount of the illumination means for illuminating the subject as an optical system adjustment variable,
  The selected optical system adjustment variable is changed, the image density of the monitoring window that varies with the change of the optical system adjustment variable is obtained, and given as the relationship between the optical system adjustment variable and the image density of the monitoring window. Linear transformation formulaFor each monitoring windowmake,
  Based on the linear conversion formula, the value of the optical system adjustment variable determined corresponding to the average density dav is obtained, and the shutter speed selected as the optical system adjustment variable so as to be the value of the obtained optical system adjustment variable Alternatively, the image processing method is characterized in that the environment of the optical system is automatically adjusted by setting the irradiation light quantity.
[0013]
  According to the present invention, it is obtained by photographing a subject.Set one or more monitoring windows for the part to be monitored in the entire imaging screen,Surveillance windowEveryIt is determined whether or not the average density dav that is the average value of the image density is within a predetermined monitoring density range, and the average density dav is outside the predetermined monitoring density range.There is at least one monitoring windowSometimes, at least one of the shutter speed and the irradiation light quantity is selected as an optical system adjustment variable, and a linear conversion formula given as a relationship between the selected optical system adjustment variable and the image density of the monitoring window is obtained.For each monitoring windowBased on this linear conversion formula, the shutter speed or irradiation light amount selected as the optical system adjustment variable is automatically adjusted and set so that the value of the optical system adjustment variable is determined in accordance with the average density dav. . In this way, the shutter speed or the amount of irradiation light, which is the environment of the optical system, is quantitatively and automatically set to an appropriate value by the quantification means called the linear conversion formula, so that the operation is not performed by the operator. Therefore, it is possible to set the environment of the optical system with high reproducibility without requiring any skill in the person's skill.
[0014]
  The present invention is also an image processing method for photographing an object to be imaged and performing an environment setting of an optical system as a photographing condition when performing image processing of the photographed object.
  In a state where the shutter speed of the imaging means for photographing the subject and the irradiation light amount of the illuminating means for irradiating the subject with light are provisionally set to predetermined values, the focus and diaphragm of the lens provided in the imaging means are set,
  Set the shutter speed of the imaging unit and the irradiation light amount of the illumination unit to desired values in the set lens focus and aperture environment,
  By the imaging meansSet one or more monitoring windows for the part to be monitored in the entire imaging screen,Surveillance windowEveryAn average density dav which is an average value of image density is obtained,
  For each monitoring windowDetermining whether the average concentration dav is within a predetermined monitoring concentration range;
  For each monitoring windowThe average concentration dav is outside the monitored concentration rangeThere is at least one monitoring windowWhen selecting at least one of the shutter speed and the irradiation light amount as an optical system adjustment variable,
  The selected optical system adjustment variable is changed, the image density of the monitoring window that varies with the change of the optical system adjustment variable is obtained, and given as the relationship between the optical system adjustment variable and the image density of the monitoring window. Linear transformation formulaFor each monitoring windowmake,
  Based on the linear conversion formula, the value of the optical system adjustment variable determined corresponding to the average density dav is obtained, and the shutter speed selected as the optical system adjustment variable so as to be the value of the obtained optical system adjustment variable Alternatively, the image processing method is characterized in that the environment of the optical system is automatically adjusted by setting the irradiation light quantity.
[0015]
  According to the invention, by the imaging meansSet one or more monitoring windows for the part to be monitored in the entire imaging screen,Surveillance windowEveryThe suitability of the optical system environment can be diagnosed based on whether or not the average density dav, which is the average value of the image density, is within the monitoring density range that serves as a reference for determining the suitability of the optical system environment. Further, when the diagnosis result is inappropriate, at least one of the shutter speed and the irradiation light amount is selected as an optical system adjustment variable, and linear conversion is given as a relationship between the selected optical system adjustment variable and the image density of the monitoring window. The expressionFor each monitoring windowBased on this linear conversion formula, the shutter speed or irradiation light amount selected as the optical system adjustment variable is automatically adjusted and set so that the value of the optical system adjustment variable is determined in accordance with the average density dav. . In this way, the shutter speed or the amount of irradiation light, which is the environment of the optical system, is quantitatively and automatically set to an appropriate value by the quantification means called the linear conversion formula, so that the operation is not performed by the operator. Therefore, it is possible to set the environment of the optical system with high reproducibility without requiring any skill in the person's skill.
[0016]
In addition, by diagnosing the suitability of the environment of the optical system, it is clear whether the cause of a detection failure in, for example, solid identification or inspection by image processing is due to an inappropriate optical system environment or a subject failure Can be. Therefore, it is possible to reduce the time required for analyzing the cause of the detection failure in the above-described individual identification and inspection.
[0017]
  The present invention also provides an image processing apparatus capable of setting an environment of an optical system, which is a shooting condition, when shooting a subject to be imaged and performing image processing of the shot subject.
  Illumination means capable of irradiating the subject with a variable amount of light;
  An imaging means for photographing a subject, the imaging means capable of shutter speed, aperture and focus adjustment;
  Photographed by the imaging meansOne or more monitoring windows are set for the part to be monitored in the entire image, and the monitoring windowPerform image processing to obtain image density,For each monitoring windowWhile calculating an average density dav which is an average value of image density,For each monitoring windowImage processing means for setting a monitoring density range based on the average density dav;
  Storage means for storing the average concentration dav and the monitored concentration range;
  The monitored concentration range is read from the storage means and photographed by the imaging meansOf the monitoring windowDetermining means for determining whether the density of the image is within the monitored density range;
  Selecting means for selecting at least one of the shutter speed and the irradiation light quantity as an optical system adjustment variable;
  The optical system adjustment variable selected by the selection means is changed, the density of the image that fluctuates with the change of the optical system adjustment variable is obtained, and a linear conversion formula given as the relationship between the optical system adjustment variable and the image density is obtained.For each monitoring windowA linear transformation formula creation means to create;
  Based on the linear conversion formula, the value of the optical system adjustment variable determined corresponding to the average density dav is obtained, and the shutter speed selected as the optical system adjustment variable so as to be the value of the obtained optical system adjustment variable Alternatively, the image processing apparatus includes a control unit that controls the amount of irradiation light, and automatically adjusts the environment of the optical system.
[0018]
  According to the present invention, the image processing apparatus is photographed by the imaging means.Of the monitoring window set for the part to be monitored in the entire imageThe suitability of the environment of the optical system can be diagnosed based on whether or not the image density is within a monitoring density range set based on, for example, an average density dav which is an average value of the image density. Further, when the result of the environmental diagnosis of the optical system is inappropriate, the image processing apparatus selects at least one of the shutter speed and the irradiation light amount, which are the environment setting items of the optical system, as the optical system adjustment variable, and the selected optical The linear conversion formula given as the relationship between the system adjustment variable and the image density isFor each monitoring windowThe shutter speed or the amount of irradiation light can be automatically set by the control means so as to be the value of the optical system adjustment variable that is created and determined in accordance with the average density dav of the image based on this linear conversion formula. In this way, an image processing apparatus is realized that can automatically adjust the environment of the optical system with high reproducibility without depending on the operator's operation, and therefore without requiring skill in the operator's skill.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a block diagram showing a simplified configuration of an image processing apparatus 1 according to an embodiment of the present invention. The image processing apparatus 1 according to the present embodiment can photograph the subject 2 to be imaged and set the environment of the optical system, which is a photographing condition, when performing image processing of the photographed subject 2. It is provided in a production line of a factory and used for solid identification, inspection, position measurement, etc. for products and parts.
[0020]
The image processing apparatus 1 includes an illuminating unit 3 that can irradiate a subject 2 with a variable amount of light, an imaging unit 4 that captures an image of the subject 2, and an imaging unit 4 that can adjust shutter speed, aperture, and focus, When the person temporarily sets the shutter speed of the image pickup means 4 and the irradiation light quantity of the illumination means 3, the input means 5 used for inputting the set value and the image processing for obtaining the density of the image taken by the image pickup means 4 The image processing means 6 for setting the monitoring density range based on the average density dav, the average density dav and the monitoring density range by the image processing means 6 are stored. Random Access Memory 7 (abbreviated as RAM) which is a storage means to be read out, and the monitor density range is read from the RAM 7 and the density of an image taken by the imaging means 4 is determined. Determination means 8 for determining whether or not it is within the visual density range, selection means 9 for selecting at least one of the shutter speed and the irradiation light quantity as an optical system adjustment variable, and optical system adjustment selected by the selection means 9 A linear conversion formula creating means 10 for creating a linear conversion formula given as a relationship between the optical system adjustment variable and the image density by varying the variable, obtaining the density of the image that fluctuates with the fluctuation of the optical system adjustment variable, and Based on the linear transformation formula created by the linear transformation formula creation means 10, the value of the optical system adjustment variable determined corresponding to the above-mentioned average density dav is obtained, and the value of the obtained optical system adjustment variable is obtained. The control means 11 for controlling the shutter speed or the irradiation light quantity selected as the optical system adjustment variable.
[0021]
The subject 2 is a product or a part that is a target of solid identification, inspection, position measurement, etc. as described above, and includes a semiconductor chip and various other objects. The illumination unit 3 includes a light source 12 that is a light emission source and a power source 13 that can variably supply power to the light source 12. For example, a light-emitting diode (abbreviated LED) or a tungsten lamp is preferably used as the light source 12, and light irradiating the subject 2 is emitted in a variable amount of light according to the amount of power supplied from the power supply 13.
[0022]
The image pickup means 4 includes a CCD camera 14 having a Charge Coupled Device (abbreviated as CCD) element, an analog / digital (abbreviated as A / D) converter 15 that converts an input / output signal to / from the CCD camera 14 into analog / digital, and a CCD. An image display controller 16 that processes image information from the camera 14 and outputs the signal to a processing circuit 20 described later, and outputs a signal for controlling the operation of the CCD camera 14 in response to an output from the processing circuit 20; And a frame memory 17 which is connected to the imaging display controller 16 and is a storage means capable of writing / reading image information at any time by the CCD camera 14.
[0023]
Although not shown, the CCD camera 14 is provided with a lens. Around the lens, a focus mechanism for adjusting the focus of the lens, an aperture mechanism for adjusting exposure, and a shutter mechanism capable of variably setting the speed are provided. It is done. Each of these mechanisms can be adjusted by a control signal from the processing circuit 20 via the imaging display controller 16 and can also be adjusted manually. The imaging unit 4 may include a monitor 18. The monitor 18 is composed of a liquid crystal, a cathode ray tube, or the like. In this embodiment, the monitor 18 is connected to the imaging display controller 16 via a digital / analog (abbreviated as D / A) converter 19, and image information from the CCD camera 14. Is displayed as a visible image.
[0024]
The processing circuit 20 is realized by, for example, a microcomputer equipped with a Central Processing Unit (abbreviated CPU). The processing circuit 20 includes the above-described image processing means 6, determination means 8, selection means 9, linear transformation formula creation means 10 and control means 11. The processing circuit 20 operates according to a program stored in advance in a Read Only Memory 21 (abbreviated ROM), functions as the above-described means, and controls the entire operation of the image processing apparatus 1.
[0025]
The input means 5 is a remote setting key. The input means may be a keyboard or the like, and may be configured to input various setting values from the keyboard. However, if all of the various setting values are entered numerically from the keyboard, the operation becomes complicated and the time required for input becomes longer. In this embodiment, the input means 5 is used as a remote setting key and stored in the RAM 7 as table data, for example. Various setting values stored in advance are read by the processing circuit 20, the read setting values are displayed on the monitor 18, and the selected setting values are selected and input by key operation. The input means 5 is connected to each means of the apparatus including the processing circuit 20 via an input / output (I / O) interface 22. The input / output interface 22 is connected to the power source 13 of the illumination means 3 described above.
[0026]
Hereinafter, operations of the image processing means 6, the determination means 8, the selection means 9, the linear transformation formula creation means 10 and the control means 11 included in the processing circuit 20 will be described.
[0027]
The image processing means 6 sets a monitoring window which is an area formed by forming or dividing the imaging screen on the imaging screen by the imaging means 4, and obtains an average density dav which is an average value of image density for each monitoring window. A monitoring density range serving as a reference for determining the suitability of the environment of the optical system is determined based on the average density dav. The method of determining the monitoring concentration range is not particularly limited, but it is preferable that the initial value is, for example, plus or minus (±) 10% of the average concentration dav. Further, the image processing means 6 can determine the image density and the average density dav of not only the image in the monitoring window but also the entire imaging screen and a region arbitrarily defined in the imaging screen. The average density dav and the monitoring density range for each monitoring window obtained by the image processing means 6 are stored in the RAM 7 as described above.
[0028]
The determining means 8 compares the image density of each monitoring window obtained by the image processing means 6 with the monitoring density range determined for each monitoring window read from the RAM 7 in the set optical system environment. It is determined whether or not it is within the range, that is, the environment of the optical system is diagnosed, and the determination result is output to the selection means 9, the monitor 18, and the output means 24. For the output means 24, for example, an alarm buzzer is used.
[0029]
The selection means 9 responds to the determination result of the determination means 8 and when it is diagnosed that there is even one monitoring window whose image density is outside the monitoring density range, that is, the environment of the optical system is inappropriate, the shutter speed or Either one of the irradiation light amounts is selected as an optical system adjustment variable. This selection can be executed by assigning priorities to the shutter speed and the irradiation light quantity.
[0030]
FIG. 2 is a diagram illustrating a monitoring window setting state and a linear conversion formula. The operation of the linear transformation formula creation means 10 will be described with reference to FIG. FIG. 2 shows a case where the connector 26 with the metal terminal 25 protruding is taken up as a subject. In the present embodiment, the monitoring density range is set to monitor the image density, and four monitoring windows for creating a linear conversion equation are set. The first monitoring window 27 is set to include the metal terminal 25, the second and third monitoring windows 28 and 29 are set to the white resin portion of the connector 26, and the fourth monitoring window 30 has the connector 26 mounted thereon. It is set with respect to the surface of the transfer table to be placed, and the surface of the transfer table is sometimes called the background.
[0031]
For each set monitoring window, when the optical system adjustment variable is, for example, the amount of light irradiated by the illumination means 3, from the minimum to the maximum by the input operation from the input means 5 (for example, from zero (0) in the case of 8-bit dimming) Up to 255). The image processing means 6 determines the density of the monitoring window for each irradiation light quantity at each stage of change. The linear conversion formula creating means 10 obtains the relationship between the volume value of the irradiation light quantity and the concentration for each of the first to fourth monitoring windows 27, 28, 29, 30. The relationship between the volume value of the irradiation light quantity and the concentration can be obtained almost in a linear form. This linear format and a graph of the linear format are referred to herein as a linear conversion formula.
[0032]
When the optical system adjustment variable is, for example, the shutter speed of the image pickup means 4, it is changed from the minimum to the maximum (for example, from 1/10000 to 1/30) by the input operation from the input means 5. The density of the monitoring window for each shutter speed at each stage of change is obtained by the image processing means 6. The linear conversion equation creating means 10 obtains the relationship between the shutter speed value and the density for each of the first to fourth monitoring windows 27, 28, 29, and 30. As described above, the relationship between the shutter speed value and the density can be obtained in a substantially linear form.
[0033]
FIG. 2B shows a linear conversion formula when the optical system adjustment variable is the irradiation light amount. A line 31 shown in FIG. 2B is a linear conversion formula of the image of the first monitoring window 27, that is, the metal terminal portion, and a line 32 and a line 33 indicate the second and third monitoring windows 28, 29, that is, the white resin portion. The line 34 is the fourth monitoring window 30, that is, the linear conversion formula of the background image. The line 32 and the line 33 have a portion where the density does not change on the high concentration side even though the irradiation light amount volume value changes, and this portion is referred to as a “flat portion” for convenience. On the other hand, the portions of the line 32 and the line 33 excluding the “flat portion”, and the lines 31 and 34 are in a linear relationship, and the irradiation light quantity volume value and the density can be converted to each other. This is called a “conversion unit”. The linear conversion formula obtained for each of the environment windows 27, 28, 29, 30 by the linear conversion formula creation means 10 is stored in the RAM 7.
[0034]
The control means 11 uses the average density dav of the image of each monitoring window obtained by the image processing means 6 under the set optical system environment, and adjusts the optical system determined from the linear conversion equation corresponding to the average density dav. Find the value of a variable. Next, the shutter speed or irradiation light amount selected as the optical system adjustment variable is controlled so as to be the value of the obtained optical system adjustment variable. In this way, the control means 11 can automatically adjust the optical system adjustment variable, which is the environment of the optical system, using the linear conversion formula and the average density dav obtained for the image of the monitoring window.
[0035]
As described above, the shutter speed and the irradiation light amount selected as the optical system adjustment variables in the optical system environment are automatically adjusted. Next, the remaining lens focus and aperture setting in the environment of the optical system will be described. The focus and aperture of the lens are obtained by displaying an image obtained by photographing the subject 2 with the imaging unit 4 on the monitor 18 and the operator adjusting the focus knob and the aperture knob while viewing the screen of the monitor 18. Is set. The focus and stop of the lens may be set based on a quantified index as described below, without relying on an operator's visual judgment.
[0036]
The focus of the lens can be quantified and set by giving the above-mentioned image processing means 6 the following functions. The image processing means 6 performs image processing for first-order differentiation of the density of the image photographed by the imaging means 4 and calculating a difference sum that is a sum of density differences obtained by the first-order differentiation. The difference sum by the first derivative of the image density is obtained in a state where the focus knob is turned and each value is set within a predetermined range. Among the difference sums obtained for each setting value of the focus knob, the position of the focus knob showing the maximum difference sum is selected and set as the optimum focus value.
[0037]
The lens aperture can be quantified and set by providing the image processing means 6 with the following functions. The image processing means 6 obtains the density distribution of the image photographed by the imaging means 4 and further performs an operation for obtaining a density width Dw that is an absolute value difference between the maximum density value Dmax and the minimum value Dmin based on the density distribution. . FIG. 3 is a diagram showing an example in which the image density distribution is obtained by the image processing means 6. In FIG. 3, the density is shown on the horizontal axis, and the frequency of the density is shown on the vertical axis in terms of the number of pixels. The density width Dw is given by the absolute value difference (| Dmax−Dmin |) between the density maximum value Dmax and the density minimum value Dmin given by the line 35 indicating the density distribution. The density width Dw in the image density distribution is obtained in a state where the lens aperture knob of the CCD camera 14 is turned and set to each value within a predetermined range. Among the density widths Dw obtained for each setting value of the aperture knob, the position of the aperture knob showing the maximum density width is selected as the optimum value of the aperture.
[0038]
As described above, in the present embodiment, the focus knob and diaphragm knob are manually adjusted by the operator, but the focus knob and diaphragm knob values are displayed on the monitor 18 as table data, and the input means 5 selects each value. The input may be adjusted via the processing circuit 20 and the imaging display controller 16.
[0039]
FIG. 4 is a flowchart for explaining an image processing method according to an embodiment of the present invention. An image processing method using the image processing apparatus 1 shown in FIG. 1 will be described with reference to FIG. In step s0, the image processing apparatus 1 shown in FIG. 1 and the subject 2 are prepared, and the imaging of the subject 2 can be started. In step s1, a fixed environment is set. Here, the fixed environment means the focus and stop of the lens provided in the image pickup means 4. In the present embodiment, the focus and aperture of the lens are set once by the operator, and then are used without being automatically adjusted by the image processing apparatus 1 and fixed to the set conditions. Call it.
[0040]
FIG. 5 is a flowchart for explaining the fixed environment setting operation. The fixed environment setting operation in step s1 shown in FIG. 4 will be described with reference to FIG. In step s11, the shutter speed of the CCD camera 14 is temporarily set. The shutter speed is set to, for example, 1/60 (1/60) second or 1/100 (1/100) second if the subject 2 is stationary, and the moving speed if the subject 2 is moving. It is set to a value according to. In step s12, the irradiation light quantity of the illumination means 3 is temporarily set. In the present embodiment, the operator temporarily sets the irradiation light amount while observing the image of the subject 2 displayed on the monitor 18.
[0041]
In step s13, the focus of the lens, which is one of the fixed environments, is set. In the present embodiment, the focus setting of the lens, that is, the focus adjustment is performed so that the operator turns the focus knob while observing the image of the subject 2 displayed on the monitor 18 to achieve a suitable focus. The focus adjustment is not limited to a method performed by the operator while observing the monitor 18, and the image including the subject 2 is first-order differentiated by the image processing unit 6 as described above to calculate a density difference sum. Alternatively, a method of setting the focus knob value that maximizes the difference sum as the optimum focus may be used.
[0042]
In step s14, the lens aperture, which is one of the fixed environments, is set. In the present embodiment, the lens aperture setting, that is, the adjustment of image brightness and contrast, is performed by the operator turning the aperture knob while observing the image of the subject 2 displayed on the monitor 18 to obtain a suitable image brightness. And contrast. The aperture adjustment is not limited to a method performed by the operator while observing the monitor 18, and the image processing means 6 calculates the density distribution and the density width Dw of the image including the subject 2 as described above. A method of setting an aperture stop value that maximizes the density width Dw as an optimum aperture may be used.
[0043]
Returning to FIG. 4, in step s2, an adjustment environment is set. Here, the adjustment environment means the shutter speed of the CCD camera 14 provided in the imaging unit 4 and the amount of light irradiated by the illumination unit 3. Since the shutter speed and the irradiation light amount are automatically adjusted in the image processing apparatus 1 based on the linear conversion formula by the above-described linear conversion formula creation means 10 when the image density is outside the monitoring density range under the set environment. Called the adjustment environment. However, in this step s2, the shutter speed and the amount of irradiation light are set by the operator without any automatic adjustment yet.
[0044]
FIG. 6 is a flowchart for explaining the adjustment environment setting operation. The adjustment environment setting operation in step s2 shown in FIG. 4 will be described with reference to FIG. In step s21, in a state where the fixed environment is set, the operator finely adjusts and resets the shutter speed temporarily set in the previous step s1. At this time, if the subject 2 is in a moving state, care must be taken not to exceed the limit of the slower shutter speed with respect to the moving speed of the subject 2 in order to prevent the image from blurring. In step s22, in a state where the fixed environment is set, the irradiation light amount temporarily set in the previous step s1 is adjusted and set while the operator observes the image displayed on the monitor 18.
[0045]
Returning to FIG. 4, in step s3, environmental monitoring is set. In this step, a monitoring window and a monitoring concentration are set in order to monitor the environment of the optical system set in steps s1 and s2 during actual operation such as solid identification and inspection. FIG. 7 is a flowchart for explaining the environment monitoring setting operation. The environment monitoring setting operation in step s3 shown in FIG. 4 will be described with reference to FIG.
[0046]
In step s31, in the imaging screen obtained including the subject 2, a monitoring window as illustrated in FIG. 2A is provided at a site where the environment of the optical system is to be monitored. In step s32, the image processing means 6 obtains the set average density dav of the monitoring window. In step s33, a monitoring density range is set based on the average density dav obtained for the monitoring window. In the present embodiment, the monitoring concentration range is set to ± 10% of the average concentration dav obtained for the monitoring window, that is, a range of 0.90 dav to 1.10 dav.
[0047]
In step s34, it is determined whether or not a predetermined number of monitoring windows are set according to the type of subject 2. In this determination, the number of monitoring windows to be set for each type of subject 2 is stored in the RAM 7 as table data, and is set as an initial value “0”, and each time one monitoring window is provided, This can be done by adding “1” to the initial value and comparing the result of the addition with the number of monitoring windows read from the RAM 7 described above. When the determination result is negative and the number of set monitoring windows is less than the value read from the RAM 7, the process returns to step s31, and the steps after setting the monitoring window are repeated. When the determination result is affirmative and the number of set monitoring windows matches the value read from the RAM 7, the process proceeds to the main flow.
[0048]
Returning to FIG. 4, in step s4, automatic adjustment and setting of the optical system environment are performed. The environment of the optical system that is subject to automatic adjustment in this step is the shutter speed and the amount of irradiation light, which are the adjustment environment described in step s2. In this step, either shutter speed or irradiation light quantity is selected as an optical system adjustment variable, a linear conversion formula between the selected optical system adjustment variable and the image density is created, and the image density in the monitoring window is monitored. When there is a monitoring window in which the image density is outside the monitoring density range, the shutter speed or irradiation light amount selected as the optical system adjustment variable is automatically adjusted and set based on the linear conversion formula.
[0049]
FIG. 8 is a flowchart for explaining the operation of creating a linear transformation equation. With reference to FIG. 8, the linear transformation formula creation operation in the optical system environment automatic adjustment setting operation in step s4 of FIG. 4 will be described. In step s411, the selection unit 9 selects, as an optical system adjustment variable, one of the environmental factors of the optical system, which is the shutter speed or the irradiation light amount, which is the adjustment environment.
[0050]
When the illumination unit 3 has only a function of manually adjusting the amount of irradiation light, the shutter speed is inevitably selected as the optical system adjustment variable. When the moving speed of the subject is high, the shutter speed is set to a short time according to the moving speed, and the adjustment range can hardly be set. Therefore, the irradiation light quantity is necessarily selected as the optical system adjustment variable. .
[0051]
In step s412, it is determined whether or not the selected optical system adjustment variable is a shutter speed. When the determination result is affirmative and the shutter speed is selected, the process proceeds to step s413. When the determination result is negative and the irradiation light amount is selected, the process skips to step s414. In step s413, when the subject is in a moving state, a lower limit value (slower limit value) is set for the shutter speed. This prevents over processing time and video blur. When adjustment is not possible within a range equal to or higher than the lower limit value of the shutter speed defined as the specification of the imaging means 4 and adjustment is performed in a moving state taking into account processing time and image blurring, “no adjustment” is selected. Select “with adjustment” to obtain an adjustment variable by making it stand still.
[0052]
In step s414, it is determined again whether or not the optical system adjustment variable is the shutter speed. When the determination result is affirmative and the optical system adjustment variable is the shutter speed, the process proceeds to step s415. When the determination result is negative and the optical system adjustment variable is the irradiation light amount, the process proceeds to step s416. In step s415, the shutter speed is changed to all shutter speeds within a predetermined change range, and the image density in the monitoring window at each shutter speed is obtained. On the other hand, in step s416, the irradiation light amount is changed to the total irradiation light amount within a predetermined fluctuation range, and the image density in the monitoring window at each irradiation light amount is obtained.
[0053]
In step s417, a linear conversion formula is created from the relationship between the shutter speed and the image density, or the relationship between the irradiation light quantity and the image density. In step s418, a boundary value between the “flat part” and “conversion unit” in the created linear conversion equation is obtained, and the boundary value is stored in the RAM 7 together with the linear conversion equation. In the case where a “flat part” does not occur in the linear transformation equation, there may be no boundary value. In step s419, it is determined whether or not a linear conversion formula has been created for a number of monitoring windows that are predetermined according to the type of subject 2. If the determination result is negative, the process returns to step s414 to perform the subsequent steps. When the determination result is affirmative, the process proceeds to the main flow.
[0054]
FIG. 9 is a flowchart for explaining the operation of automatically adjusting and setting the optical system adjustment variable based on the linear conversion equation. At the start of step s420, a start step is provided so as to overlap with step s0 in the main flow. The operation of monitoring and diagnosing the image density in the monitoring window and automatically adjusting the optical system adjustment variable in response to the diagnosis result may be performed at all times during the production operation of the line. It is not preferable from the viewpoint of production efficiency because it is in a state of adjusted operation rather than production operation. Diagnosis and automatic adjustment of the optical system environment can be performed after the line has been stopped for a long period of time, and after the line operating conditions have been adjusted due to solid identification defects or inspection defects using the image processing device. It is preferable to be executed only when raising the machine. Therefore, a step for instructing the execution start is provided. In step s420, a signal instructing the monitoring of the optical system environment and the start of the automatic adjustment operation is input by operating a predetermined key on the input means 5.
[0055]
In step s421, the image including the subject is captured by the imaging unit 4. In step s422, the density of the image in the monitoring window (monitoring image density) is obtained. This monitoring image density is the average density dav of the image in the monitoring window. In step s423, the determination unit 8 compares the monitoring image density with the monitoring density range read from the RAM 7, that is, diagnoses the image density, and stores the diagnosis result in the RAM 7. In step s424, it is determined whether image density diagnosis has been performed for a predetermined number of monitoring windows depending on the type of subject. If the determination result is negative and the number of diagnosed monitoring windows is less than a predetermined number, the process returns to step s422 to perform the subsequent steps. If the determination result is affirmative and the number of diagnosed monitoring windows matches the predetermined number, the process proceeds to step s425.
[0056]
In step s425, the determination means 8 reads the diagnosis results for all the predetermined number of monitoring windows from the RAM 7, and determines whether there is a monitoring window whose monitoring image density is outside the monitoring density range. If the determination result is negative and the monitoring image density of all the monitoring windows is within the monitoring density range, the optical system environment is appropriate, and the process proceeds to step s431. In step s431, the determination unit 8 displays “monitoring OK” on the monitor 18 and outputs it to the output unit 24. The process proceeds to step s432 (s5), and the automatic adjustment operation of the optical system environment ends.
[0057]
On the other hand, when the determination result is affirmative and there is at least one monitoring window whose monitoring image density is outside the monitoring density range, “monitoring NG (No Good)” is displayed on the monitor 18 by the output signal from the determination means 8. It is displayed and output to the output means 24. At this time, the number of monitoring windows that are outside the monitoring density range of the monitoring image density is displayed at the same time.
[0058]
In step s427, the control unit 11 reads the linear conversion formula corresponding to the monitoring window stored in the RAM 7, and based on the linear conversion formula, the optical system adjustment variable corresponding to the average density dav that is the monitoring image density. Find the value. In step s428, the control unit 11 further automatically adjusts and sets the selected optical system adjustment variable so that the value of the optical system adjustment variable obtained in the previous step is obtained.
[0059]
In step s429, it is determined whether or not the adjustment of the optical system adjustment variable for the monitoring window in which the monitoring image density is outside the monitoring density range is completed for both the optical system adjustment variable, that is, the irradiation light amount and the shutter speed. . Note that when the irradiation light quantity is manually adjusted, or when the subject moving speed is fast and the shutter speed setting range is narrow, what can be used as an optical system adjustment variable is the irradiation light quantity or shutter speed. When only one of them is present, this step s429 is not executed and the process proceeds to the next step.
[0060]
When the determination result is negative, the process returns to step s421 and the subsequent steps are repeated. When the determination result is affirmative, that is, when the adjustment is completed for the monitoring window whose monitoring image density is outside the monitoring density range, but the output of “monitoring OK” is not obtained, the process proceeds to step s430. In step s430, the determination unit 8 displays “optical system environment abnormality” on the monitor 18 and outputs it to the output unit 24, and proceeds to step s432 (s5) to complete the optical system environment automatic adjustment operation.
[0061]
When “optical system environment abnormality” is output, it is determined whether the entire area of the imaging screen is abnormal or the specific area is abnormal depending on the number of monitoring windows that are “monitoring NG”. Check the items according to the order of items such as ball breakage, shutter speed abnormality, and other external environment abnormality. As a result of the inspection, for example, if the light source 12 is out of the ball, the lens is replaced, and then the environment of the optical system is reconstructed to execute diagnosis and automatic adjustment.
[0062]
【The invention's effect】
According to the present invention, among the environment setting items of the optical system, the shutter speed or the amount of irradiation light is set to an appropriate value quantitatively and automatically by a quantification means called a linear conversion formula. Therefore, it is possible to set the environment of the optical system with high reproducibility without requiring skill in the operator's skill.
[0063]
In addition, by diagnosing the suitability of the environment of the optical system, it is clear whether the cause of a detection failure in, for example, solid identification or inspection by image processing is due to an inappropriate optical system environment or a subject failure Can be. Therefore, it is possible to reduce the time required for analyzing the cause of the detection failure in the above-described individual identification and inspection.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a simplified configuration of an image processing apparatus 1 according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating a monitoring window setting state and a linear conversion equation;
FIG. 3 is a diagram illustrating an example in which an image density distribution is obtained by the image processing unit 6;
FIG. 4 is a flowchart illustrating an image processing method according to an embodiment of the present invention.
FIG. 5 is a flowchart illustrating a fixed environment setting operation.
FIG. 6 is a flowchart illustrating an adjustment environment setting operation.
FIG. 7 is a flowchart illustrating an environment monitoring setting operation.
FIG. 8 is a flowchart illustrating an operation for creating a linear transformation equation.
FIG. 9 is a flowchart for explaining an operation of automatically adjusting and setting an optical system adjustment variable based on a linear conversion equation.
[Explanation of symbols]
1 Image processing device
2 Subject
3 lighting means
4 Imaging means
5 input means
6 Image processing means
7 RAM
8 Judgment means
9 Selection means
10 Linear transformation formula creation means
11 Control means
12 Light source
13 Power supply
14 CCD camera
15 A / D converter
16 Imaging display controller
17 frame memory
18 Monitor
19 D / A converter
20 Processing circuit
21 ROM
22 I / O interface

Claims (3)

撮像されるべき被写体を撮影し、撮影された被写体の画像処理を行なうに際し、撮影条件である光学系の環境設定を行なう画像処理方法であって、
被写体を撮影することによって得られる撮像画面全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、
前記監視ウインドウ毎に画像濃度の平均値である平均濃度davを求め、
前記監視ウインドウ毎の前記平均濃度davが予め定める監視濃度範囲内であるか否かを判断し、
前記監視ウインドウ毎の前記平均濃度davが予め定める監視濃度範囲外である前記監視ウインドウが少なくとも1つ存在するとき、前記被写体を撮影する撮像手段のシャッタ速度または前記被写体を光照射する照明手段の照射光量の少なくともいずれか一方を光学系調整変数として選択し、
選択された光学系調整変数を変動させ、光学系調整変数の変動に伴って変動する前記監視ウインドウの画像の濃度を求めて、光学系調整変数と監視ウインドウの画像の濃度との関係として与えられる線形変換式を前記監視ウインドウ毎に作成し、
線形変換式に基づいて、前記平均濃度davに対応して定められる光学系調整変数の値を求め、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を設定することによって光学系の環境を自動調整することを特徴とする画像処理方法。
An image processing method for setting an environment of an optical system that is a shooting condition when shooting a subject to be imaged and performing image processing of the shot subject,
One or more monitoring windows are set in the part to be monitored in the entire imaging screen obtained by photographing the subject ,
An average density dav which is an average value of image density is obtained for each monitoring window,
Determining whether the average density dav for each monitoring window is within a predetermined monitoring density range;
When there is at least one monitoring window in which the average density dav for each monitoring window is outside a predetermined monitoring density range, the shutter speed of the imaging unit that captures the subject or the illumination unit that irradiates the subject with light Select at least one of the light quantities as the optical system adjustment variable,
The selected optical system adjustment variable is changed, the image density of the monitoring window that varies with the change of the optical system adjustment variable is obtained, and given as the relationship between the optical system adjustment variable and the image density of the monitoring window. Create a linear transformation formula for each monitoring window ,
Based on the linear conversion formula, the value of the optical system adjustment variable determined corresponding to the average density dav is obtained, and the shutter speed selected as the optical system adjustment variable so as to be the value of the obtained optical system adjustment variable An image processing method characterized by automatically adjusting the environment of an optical system by setting an irradiation light quantity.
撮像されるべき被写体を撮影し、撮影された被写体の画像処理を行なうに際し、撮影条件である光学系の環境設定を行なう画像処理方法であって、
前記被写体を撮影する撮像手段のシャッタ速度と、前記被写体を光照射する照明手段の照射光量とを予め定める値に仮設定した状態で、前記撮像手段に備わるレンズのフォーカスと絞りとを設定し、
設定されたレンズのフォーカスおよび絞りの環境で、前記撮像手段のシャッタ速度と前記照明手段の照射光量とを所望の値に設定し、
前記撮像手段による撮像画面全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、監視ウインドウ毎に画像濃度の平均値である平均濃度davを求め、
前記監視ウインドウ毎の前記平均濃度davが予め定める監視濃度範囲内であるか否かを判断し、
前記監視ウインドウ毎の前記平均濃度davが前記監視濃度範囲外である前記監視ウインドウが少なくとも1つ存在するとき、シャッタ速度または照射光量の少なくともいずれか一方を光学系調整変数として選択し、
選択された光学系調整変数を変動させ、光学系調整変数の変動に伴って変動する前記監視ウインドウの画像の濃度を求めて、光学系調整変数と監視ウインドウの画像の濃度との関係として与えられる線形変換式を前記監視ウインドウ毎に作成し、
線形変換式に基づいて、前記平均濃度davに対応して定められる光学系調整変数の値を求め、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を設定することによって光学系の環境を自動調整することを特徴とする画像処理方法。
An image processing method for setting an environment of an optical system that is a shooting condition when shooting a subject to be imaged and performing image processing of the shot subject,
In a state where the shutter speed of the imaging means for photographing the subject and the irradiation light amount of the illuminating means for irradiating the subject with light are provisionally set to predetermined values, the focus and diaphragm of the lens provided in the imaging means are set,
Set the shutter speed of the imaging unit and the irradiation light amount of the illumination unit to desired values in the set lens focus and aperture environment,
One or two or more monitoring windows are set in a region to be monitored in the entire imaging screen by the imaging unit, and an average density dav that is an average value of image density is obtained for each monitoring window,
Determining whether the average density dav for each monitoring window is within a predetermined monitoring density range;
When there is at least one monitoring window in which the average density dav for each monitoring window is outside the monitoring density range, at least one of the shutter speed and the irradiation light amount is selected as an optical system adjustment variable,
The selected optical system adjustment variable is changed, the image density of the monitoring window that varies with the change of the optical system adjustment variable is obtained, and given as the relationship between the optical system adjustment variable and the image density of the monitoring window. Create a linear transformation formula for each monitoring window ,
Based on the linear conversion formula, the value of the optical system adjustment variable determined corresponding to the average density dav is obtained, and the shutter speed selected as the optical system adjustment variable so as to be the value of the obtained optical system adjustment variable An image processing method characterized by automatically adjusting the environment of an optical system by setting an irradiation light quantity.
撮像されるべき被写体を撮影し、撮影された被写体の画像処理を行なうに際し、撮影条件である光学系の環境設定をすることのできる画像処理装置において、
前記被写体を光量可変に照射することのできる照明手段と、
被写体を撮影する撮像手段であって、シャッタ速度、絞りおよびフォーカス調整の可能な撮像手段と、
前記撮像手段によって撮影される画像全域のうち監視するべき部位に監視ウインドウを1または2以上設定し、前記監視ウインドウの画像の濃度を求める画像処理を行ない、前記監視ウインドウ毎に画像濃度の平均値である平均濃度davを演算するとともに、前記監視ウインドウ毎に平均濃度davに基づいて監視濃度範囲を設定する画像処理手段と、
前記平均濃度davおよび前記監視濃度範囲がストアされる記憶手段と、
前記監視濃度範囲を記憶手段から読出し、前記撮像手段によって撮影される前記監視ウインドウの画像の濃度が、前記監視濃度範囲内であるか否かを判断する判断手段と、
前記シャッタ速度または前記照射光量の少なくともいずれか一方を光学系調整変数として選択する選択手段と、
選択手段によって選択される光学系調整変数を変動させ、光学系調整変数の変動に伴って変動する画像の濃度を求めて、光学系調整変数と画像の濃度との関係として与えられる線形変換式を前記監視ウインドウ毎に作成する線形変換式作成手段と、
線形変換式に基づいて、前記平均濃度davに対応して定められる光学系調整変数の値を求め、求められた光学系調整変数の値になるように、光学系調整変数として選択されたシャッタ速度または照射光量を制御する制御手段とを含み、光学系の環境を自動調整することを特徴とする画像処理装置。
In an image processing apparatus capable of setting an environment of an optical system, which is a photographing condition, when photographing a subject to be imaged and performing image processing of the photographed subject,
Illumination means capable of irradiating the subject with a variable amount of light;
An imaging means for photographing a subject, the imaging means capable of shutter speed, aperture and focus adjustment;
One or two or more monitoring windows are set in a region to be monitored in the entire image captured by the imaging means, image processing for obtaining the image density of the monitoring window is performed, and an average value of image density for each monitoring window Image processing means for calculating an average density dav and setting a monitoring density range based on the average density dav for each monitoring window ;
Storage means for storing the average concentration dav and the monitored concentration range;
Determining means for reading out the monitoring density range from the storage means and determining whether or not the density of the image of the monitoring window imaged by the imaging means is within the monitoring density range;
Selecting means for selecting at least one of the shutter speed and the irradiation light quantity as an optical system adjustment variable;
The optical system adjustment variable selected by the selection means is changed, the density of the image that fluctuates with the change of the optical system adjustment variable is obtained, and a linear conversion formula given as the relationship between the optical system adjustment variable and the image density is obtained. A linear conversion formula creating means for creating each monitoring window ;
Based on the linear conversion formula, the value of the optical system adjustment variable determined corresponding to the average density dav is obtained, and the shutter speed selected as the optical system adjustment variable so as to be the value of the obtained optical system adjustment variable Alternatively, an image processing apparatus comprising: a control unit that controls the amount of irradiation light, and automatically adjusting the environment of the optical system.
JP2003007537A 2003-01-15 2003-01-15 Image processing method and image processing apparatus characterized by automatically adjusting environment of optical system Expired - Lifetime JP4094435B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003007537A JP4094435B2 (en) 2003-01-15 2003-01-15 Image processing method and image processing apparatus characterized by automatically adjusting environment of optical system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003007537A JP4094435B2 (en) 2003-01-15 2003-01-15 Image processing method and image processing apparatus characterized by automatically adjusting environment of optical system

Publications (2)

Publication Number Publication Date
JP2004221988A JP2004221988A (en) 2004-08-05
JP4094435B2 true JP4094435B2 (en) 2008-06-04

Family

ID=32897604

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003007537A Expired - Lifetime JP4094435B2 (en) 2003-01-15 2003-01-15 Image processing method and image processing apparatus characterized by automatically adjusting environment of optical system

Country Status (1)

Country Link
JP (1) JP4094435B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007196301A (en) * 2006-01-24 2007-08-09 Denso Corp Automatic operating apparatus and automatic operating method using image

Also Published As

Publication number Publication date
JP2004221988A (en) 2004-08-05

Similar Documents

Publication Publication Date Title
US8289382B2 (en) Method for producing high-quality reproductions of the front and/or rear sections of the eye
JP2006319534A (en) Imaging apparatus, method and program
US20090066805A1 (en) Video camera
JP4551270B2 (en) Image processing apparatus, image processing method, image processing program, and camera
JP4608089B2 (en) Open loop light intensity calibration method and apparatus
JP2000134610A (en) Endoscope device
US20050270398A1 (en) Electronic camera
JP4094435B2 (en) Image processing method and image processing apparatus characterized by automatically adjusting environment of optical system
KR101396342B1 (en) Digital photographing apparatus and method for controlling the same
WO2020049688A1 (en) Light source control device, endoscopy system, and dimming control method
JP5609459B2 (en) Binarization processing method and image processing apparatus
JP4477782B2 (en) Illumination adjustment apparatus and method for a portion corresponding to a plurality of selection areas in an image of an object to be measured
JP4080897B2 (en) Image processing method and image processing apparatus
JP2003015211A (en) Photographing device, photographing method and photographing system
US7145733B2 (en) Projector and exposure adjustment method
JP2010122623A (en) Microscope control device and microscope system
US5710841A (en) Method for improving the contrast in photographic film materials
JP2009273676A (en) Endoscope apparatus capable of detecting color unevenness
JP5587083B2 (en) Imaging apparatus and control method thereof
JP2001230967A (en) Device and method for processing image
JP2005221708A (en) Microscope photographing apparatus, method and program for adjusting brightness
JP4131007B2 (en) Automatic dimming device for endoscope and electronic endoscope device
CN117278867B (en) Image sensor chip imaging system, exposure method and device thereof and storage medium
JPH08122726A (en) Liquid crystal panel inspecting device
JP3534788B2 (en) Exposure control device for video camera and video camera using the same

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050701

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071203

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071211

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080212

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080305

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

Free format text: PAYMENT UNTIL: 20110314

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

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

Free format text: PAYMENT UNTIL: 20110314

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20110314

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110314

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120314

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130314

Year of fee payment: 5