JP4188707B2 - An image processing procedure design expert system with features in evaluation processing. - Google Patents

An image processing procedure design expert system with features in evaluation processing. Download PDF

Info

Publication number
JP4188707B2
JP4188707B2 JP2003007513A JP2003007513A JP4188707B2 JP 4188707 B2 JP4188707 B2 JP 4188707B2 JP 2003007513 A JP2003007513 A JP 2003007513A JP 2003007513 A JP2003007513 A JP 2003007513A JP 4188707 B2 JP4188707 B2 JP 4188707B2
Authority
JP
Japan
Prior art keywords
sample
region
original image
image
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2003007513A
Other languages
Japanese (ja)
Other versions
JP2004220363A (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
Kagawa Prefectural Government
Original Assignee
Sharp Corp
Kagawa Prefectural Government
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, Kagawa Prefectural Government filed Critical Sharp Corp
Priority to JP2003007513A priority Critical patent/JP4188707B2/en
Publication of JP2004220363A publication Critical patent/JP2004220363A/en
Application granted granted Critical
Publication of JP4188707B2 publication Critical patent/JP4188707B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、複数の画像処理アルゴリズムを組合せて1つの処理手順を構成する画像処理手順設計エキスパートシステムに関し、さらに詳しくは、処理手順を評価するときの評価処理を処理手順の構成の安定性に反映させて、より信頼性の高い図形を抽出する処理手順を構成することができる評価処理に特長をもつ画像処理手順設計エキスパートシステムに関する。
【0002】
【従来の技術】
カメラを使って工業製品の外観検査などを自動化する場合、撮像した画像をコンピュータで処理した結果によって良否を判断することになる。このような場合に用いる画像処理は、複数の画像処理アルゴリズムを組合せて1つの処理手順として利用する必要がある。しかし、処理手順の設計には、処理対象および検査項目に応じて専門家が試行錯誤を繰り返しながら注意深く設計する必要があるため、誰でも簡単に処理手順が作れるというものではない。この問題を解決し、処理手順を誰でも簡単に設計することを可能とするために、処理手順の設計を支援するための画像処理手順設計エキスパートシステムの開発が進められている。
【0003】
図23は、先行技術の画像処理手順設計エキスパートシステムのアルゴリズムを概略的に示す図である。以後、画像処理手順設計エキスパートシステムを単にエキスパートシステムと記載する。エキスパートシステムは、複数の原画像1および各原画像1に対応する複数のサンプル図形2が入力され、原画像1に対して平滑化処理および差分処理などの前処理を行う前処理手段3と、前処理手段3によって前処理された原画像1を2値化する2値化処理手段4と、2値化処理手段4によって2値化された原画像1のノイズを除去しまたは凹凸をなくす処理を行う図形融合処理手段5とを有する。
【0004】
エキスパートシステムでは、原画像1とそれに対応するサンプル図形2とを入力とし、原画像1からサンプル図形2に対応する図形を抽出する手順の構成を実行する。エキスパートシステムでは、サンプル図形2に対応する原画像1上の濃度値情報を基本にして、前処理手段3、2値化処理手段4および図形融合処理手段5において最適と考えられる具体的な処理を決定する。
【0005】
このように先行技術のエキスパートシステムでは、原画像1から抽出したい画像の特徴を、言葉ではなく、直接画像の形であるサンプル図形2によって計算機に伝えることによって、原画像1からサンプル図形2になるべく近い図形を抽出する処理手順を自動的に構成する(たとえば、非特許文献1〜4参照)。
【0006】
【非特許文献1】
長谷川純一、久保田浩明、鳥脇純一郎、「サンプル図形提示方式による画像処理エキスパートシステムIMPRESS」、電子情報通信学会論文誌(D)、1987年11月、Vol.J70−D、No.11、pp.2147−2153
【非特許文献2】
長谷川純一、久保田浩明、高須晶英、鳥脇純一郎、「画像処理エキスパートシステムIMPRESSにおける画像処理手順集約化機能について」、情報処理学会論文誌、昭和63年2月発行、第29巻、第2号別刷、pp.126−133
【非特許文献3】
高須晶英、長谷川純一、鳥脇純一郎、「サンプル図形提示方式による面図形抽出手順の自動構成法について」、情報処理学会論文誌、昭和63年2月発行、第29巻、第2号別刷、pp.134−141
【非特許文献4】
濱田敏弘、清水昭伸、長谷川純一、鳥脇純一郎、「ビジョンエキスパートシステムIMPRESSにおける画像処理手順の逐次的集約法とその性能評価」、電子情報通信学会論文誌(D−II)、1999年11月、Vol.J82−D−II、No.11、pp.1982−1989
【0007】
【発明が解決しようとする課題】
このようなエキスパートシステムでは、構成した具体的処理手順および最終的な処理手順の良否を評価する尺度として、原画像1の抽出したい領域の画像とその近傍領域との輝度差を用いている。エキスパートシステムが、原画像1の抽出したい領域の画像とその近傍領域との輝度差を用いて手順の良否を判断して、処理手順を構成するために、サンプル図形2の周囲に近傍領域が作成される。
【0008】
図24は、原画像1のサンプル図形2に対応する領域の周囲に作成される近傍領域8を概略的に示す図である。近傍領域8は、原画像1のサンプル図形2に対応する領域7の周囲に隣接して形成される。したがって、サンプル図形2が抽出したい領域の画像を正確に表していない場合と、サンプル図形2が抽出したい領域の画像を正確に表している場合とにおいて、処理手順の評価の結果が異なってしまう。つまり、サンプル図形2が抽出したい領域の画像に一致するように高精度に作成されないと、処理手順を正しく評価できない結果となる。
【0009】
このように先行技術のエキスパートシステムでは、サンプル図形2の精度が手順評価に直結する。したがって、サンプル図形2を精度よく作成する必要があり、サンプル図形2の作成に多大な労力と時間とを要している。このために、実際の画像処理装置に組み込まれるには至っておらず、実用化されていないのが現状である。また近年、グラフィカルに画像処理アルゴリズムを組合せることが可能な製品も存在するが、最適な処理手順の組合せを見つけることを支援しているものではないため、試行錯誤の繰り返しをユーザに強いる状況は、何ら改善されていない。
【0010】
本発明の目的は、サンプル図形が原画像の抽出したい領域の画像と完全に同一でなく、前記画像および輪郭線よりも多少大きいまたは小さい場合であっても、処理手順の評価の結果が異ならず、処理手順の構成に対する安定性を向上することができる評価処理に特長をもつ画像処理手順設計エキスパートシステムを提供することである。
【0011】
【課題を解決するための手段】
本発明は、原画像および原画像に対応するサンプル図形が入力され、複数の画像処理手段を組合せて、原画像からサンプル図形に近い図形を抽出する処理手順を構成する画像処理手順設計エキスパートシステムであって、
原画像のサンプル図形に対応する領域の周囲に近傍領域を作成するとともに、原画像のサンプル図形に対応する領域とその近傍領域との境界部よりも外側および内側のうち少なくともいずれか一方に、処理対象から除外される不感帯領域を作成する不感帯領域作成手段を含み、
前記不感帯領域作成手段は、前記不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成する手段を含むことを特徴とする評価処理に特長をもつ画像処理手順設計エキスパートシステムである。
【0012】
本発明に従えば、不感帯領域作成手段は、原画像のサンプル図形に対応する領域の周囲に近傍領域を作成する。また不感帯領域作成手段は、原画像のサンプル図形に対応する領域と前記近傍領域との境界部よりも外側および外側のうちの少なくともいずれか一方に、処理対象から除外される不感帯領域を作成する。
【0013】
たとえば、電子カメラなどの撮像手段によって撮像した画像を原画像として入力する場合、原画像では輝度の異なる領域の間で輝度勾配が発生する。この輝度勾配が発生する領域では、輝度値が不安定となる。サンプル図形は、原画像の抽出したい領域の画像に対応し、前述した輝度の異なる領域の間を輪郭とするので、輝度値が不安定な部分を含む。したがってサンプル図形を、原画像の抽出したい領域に正確に合わせなければ、画像処理手順設計エキスパートシステムが構成する処理手順が異なる結果となってしまう。したがって、手順を正しく評価することができない。
【0014】
不感帯領域を作成することによって、サンプル図形が原画像から抽出したい領域の画像と同一でなく、この原画像から抽出したい領域の画像よりも多少大きくなる場合または小さくなる場合であっても、画像処理手順設計エキスパートシステムにおいて構成される処理手順が、サンプル図形が抽出したい領域の画像と同一である場合に構成される処理手順と等しくなる。
また、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成する手段を備えることで、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が大きくなり過ぎるのを防ぎ、原画像から精度の良くサンプル図形に近い図形を抽出する処理手順を構成することができる。
【0015】
したがって、原画像から抽出したい領域の画像にあわせて、たとえば1画素単位で正確にサンプル図形を作成できない場合であっても、原画像から抽出したい領域にあわせて1画素単位で正確にサンプル図形を作成した場合と同様の評価の結果を得ることができ、処理手順を正しく評価することができる。言い換えるとサンプル図形の精度が多少粗い場合であっても、手順を正しく評価することができる。このため処理手順の構成に対する安定性を向上することができ、エキスパートシステムの評価精度を落とさず、より信頼性の高い図形を抽出する処理手順を構成することができる。
【0018】
また本発明は、原画像および原画像に対応するサンプル図形が入力され、複数の画像処理手段を組合せて、原画像からサンプル図形に近い図形を抽出する処理手順を構成する画像処理手順設計エキスパートシステムであって、
原画像のサンプル図形に対応する領域の周囲に近傍領域を作成するとともに、原画像のサンプル図形に対応する領域とその近傍領域との境界部よりも外側および内側のうち少なくともいずれか一方に、処理対象から除外される不感帯領域を作成する不感帯領域作成手段を含み、
前記不感帯領域作成手段は、原画像のサンプル図形に対応する領域とその近傍領域との輝度分布が重なる場合、輝度分布の重なる領域を除いて近傍領域を作成することを特徴とする評価処理に特長をもつ画像処理手順設計エキスパートシステムである。
【0019】
本発明に従えば、不感帯領域作成手段は、原画像のサンプル図形に対応する領域とその近傍領域の輝度分布が重なる場合には、輝度分布の重なる領域を除いて近傍領域を作成する。これによって、原画像のサンプル図形に対応する領域とその近傍領域との輝度差を大きくすることができる。したがって、原画像からサンプル図形に近い図形を抽出するための処理手順を構成するときに、原画像のサンプル図形に対応する領域とその近傍領域とを分離しやすくなるので、より信頼性の高い画像を生成する処理手順を構成することができる。また、原画像のサンプル図形に対応する領域を除いて近傍領域を作成することによって、処理手順を構成する際の計算処理を低減することができ、処理手順を構成する時間を低減することができる。
【0020】
また本発明は、原画像および原画像に対応するサンプル図形が入力され、複数の画像処理手段を組合せて、原画像からサンプル図形に近い図形を抽出する処理手順を構成する画像処理手順設計エキスパートシステムの評価処理方法であって、
原画像のサンプル図形に対応する領域の周囲に近傍領域を作成するとともに、原画像のサンプル図形に対応する領域とその近傍領域との境界部よりも外側および内側のうち少なくともいずれか一方に、処理対象から除外される不感帯領域を作成し、
前記不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成することを特徴とする評価処理に特長をもつ画像処理手順設計エキスパートシステムの処理方法である。
【0021】
本発明に従えば、原画像のサンプル図形に対応する領域の周囲に近傍領域を作成する。また不感帯領域作成手段は、原画像のサンプル図形に対応する領域と前記近傍領域との境界部よりも外側および外側のうちの少なくともいずれか一方に、処理対象から除外される不感帯領域を作成し、前記不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成する。
【0022】
不感帯領域を作成することによって、サンプル図形が原画像から抽出したい領域の画像と同一でなく、この原画像から抽出したい領域の画像よりも多少大きくなる場合または小さくなる場合であっても、画像処理手順設計エキスパートシステムにおいて構成される処理手順が、サンプル図形が抽出したい領域の画像と同一である場合に構成される処理手順と等しくなる。
【0023】
したがって、原画像から抽出したい領域の画像にあわせて、たとえば1画素単位で正確にサンプル図形を作成できない場合であっても、原画像から抽出したい領域にあわせて1画素単位で正確にサンプル図形を作成した場合と同様の評価の結果を得ることができ、処理手順を正しく評価することができる。言い換えるとサンプル図形の精度が多少粗い場合であっても、手順を正しく評価することができる。このため処理手順の構成に対する安定性を向上することができ、画像処理手順設計エキスパートシステムの評価精度を落とさず、より信頼性の高い画像を生成する処理手順を構成することができる。
また、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成することで、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が大きくなり過ぎるのを防ぎ、原画像から精度の良くサンプル図形に近い図形を抽出する処理手順を構成することができる。
【0024】
また本発明は、前記画像処理手順設計エキスパートシステムの評価処理方法をコンピュータによって実行させるためのプログラムである。
【0025】
本発明に従えば、前記プログラムをコンピュータによって実行させることによって、コンピュータは、前述の画像処理手順設計エキスパートシステムの評価処理方法に従って動作し、前述のような作用を達成することができる。また前記評価処理方法を、短時間で行うことができる。
【0026】
また本発明は、前記画像処理手順設計エキスパートシステムの評価処理方法をコンピュータによって実行させるためのプログラムが記録された記録媒体である。
【0027】
本発明に従えば、前記記録媒体に記録されたプログラムを、コンピュータに読取らせて実行させることによって、コンピュータを、前述の画像処理手順設計エキスパートシステムの評価処理方法に従って動作させることができる。また前記評価処理方法を、短時間で行うことができる。また記録媒体を介して、複数のコンピュータにプログラムを容易に供給することができるので、本発明の利用範囲が拡大する。
【0028】
【発明の実施の形態】
図1は、本発明の実施の一形態の評価処理に特長をもつ画像処理手順設計エキスパートシステムのアルゴリズムを概略的に示す図である。以後、評価処理に特長をもつ画像処理手順設計エキスパートシステムを単にエキスパートシステムと記載する。本実施の形態のエキスパートシステムは、コンピュータによって実行可能なプログラムによって実現される。前記プログラムは、コンピュータのメモリに記憶され、中央演算処理装置(Central Processing Unit;略称CPU)によって実行される。
【0029】
エキスパートシステムは、原画像11と原画像11に対応するサンプル図形12とを入力し、複数の画像処理手段13を組合せて、原画像11からサンプル図形12に近い図形を抽出する処理手順を構成する。本実施の形態において、エキスパートシステムにサンプル図形12を入力することは、すなわちサンプル図形12を作成するための情報を入力することを意味する。エキスパートシステムは、複数の原画像11と、サンプル図形12を作成するための情報とに基づいて、各原画像11に対応するサンプル図形12をそれぞれ作成し、各原画像11および各サンプル図形12に基づいて1つの処理手順を構成する。
【0030】
本実施の形態において、原画像11は、たとえば電荷結合素子(Charge Coupled Device;略称CCD)カメラで撮像した大規模集積回路(Large Scale Integration;略称LSI)のパッケージおよび胸部X線像などである。原画像11は、たとえば256階調の輝度で表される。
【0031】
本実施の形態において、サンプル図形12は、原画像11において抽出したい領域の画像を2値化して得られる画像、またはこの画像の一部に等しい。以後、原画像11とサンプル図形12との組を設計標本と記載する場合がある。本実施の形態において、サンプル図形12は、原画像11において抽出したい領域の画像を2値化して得られる図形に等しいものとして説明する。
【0032】
エキスパートシステムは、サンプル作成手段14と、不感帯領域作成手段15と、輝度変換判定手段16と、前処理選択手段17と、2値化処理選択手段18と、図形融合処理生成手段19と、フィルター処理生成手段20と、安定度検証手段21とを含む。前記処理手順は、輝度値変換手段16による判定結果40に基づく輝度変換処理と、前処理選択手段17、2値化処理選択手段18、図形融合処理生成手段19およびフィルター処理生成手段20とにおいて、選択または生成される処理を順番に並べて構成される。輝度変換判定手段16と、前処理選択手段17と、2値化処理選択手段18と、図形融合処理生成手段19と、フィルター処理生成手段20とは、それぞれ画像処理手段13である。
【0033】
図2は、エキスパートシステムの基本的な構成を示す機能ブロック図である。エキスパートシステムは、領域指定情報入力手段23、サンプル作成手段14、補正情報入力手段24、画像処理手順設計手段25および安定度検証手段21を含む。
【0034】
領域指定情報入力手段23は、原画像11の全領域のうちの予め定める対象領域27を指定する領域指定情報をサンプル作成手段14に入力する。サンプル作成手段14は、領域指定情報入力手段23から入力された領域指定情報によって指定された対象領域27からサンプル図形12を抽出して、このサンプル図形12を含むサンプル26を作成する。サンプル図形12を作成するための情報は、少なくとも領域指定情報を含む。
【0035】
サンプル作成手段14は、前記対象領域27に対して決定される輝度のしきい値thdに基づいて、対象領域27を2値化処理する。前記輝度のしきい値thdは、たとえば判別分析法によって決定される。以後、対象領域27を2値化処理することによって抽出される図形を、抽出図形と記載することがある。前記2値化処理によって、操作者の期待どおりの抽出図形が抽出されたときには、その抽出図形がサンプル図形12である。
【0036】
補正情報入力手段24は、補正情報をサンプル作成手段14に入力する。補正情報は、修正情報および除去情報を含む。修正情報は、抽出図形の形状が操作者の期待とは異なるときに、抽出図形の形状を修正するための情報である。除去情報は、前記2値化によって複数の抽出図形が抽出されたときに、不要な抽出図形を除去するための情報である。
【0037】
サンプル作成手段14は、補正情報入力手段24から入力される補正情報に基づいて、抽出図形を補正する。前記2値化処理によって抽出された抽出図形が操作者の期待とは異なるときには、補正された抽出図形がサンプル図形12である。これによって操作者の期待どおりのサンプル図形12が得られる。
【0038】
図3は、サンプル作成手段14によるサンプル図形12を含むサンプル26の作成を説明するための図であり、図3(a)は対象領域27が指定された状態を示し、図3(b)はサンプル図形12が抽出された状態を示す。図4は、対象領域27の近傍輪郭線の一例を示す図である。図5は、対象領域27の近傍輪郭線の他の例を示す図である。
【0039】
まず、たとえばコンピュータの表示画面上で、原画像11のうち、サンプル図形12として抽出すべき部分28が、図3(a)に示されるように外囲される。前記サンプル図形12として抽出すべき部分28は、図3(a)において、斜線で示される。原画像11のうちのどこがサンプル図形12として抽出すべき部分28であるかは、操作者によって判断される。
【0040】
前記サンプル図形12として抽出すべき部分28を外囲する曲線29は、図3(a)において、仮想線で示される。前記曲線29は、操作者がたとえばタッチペンなどを操作することによって指定される。このように前記曲線29が指定されることによって、対象領域27が指定される。本実施の形態においては、前記曲線29に関する情報が、領域指定情報である。また本実施の形態においては、原画像11の全領域のうち、前記曲線29上の画素と、前記曲線29よりも内側の画素とから成る領域が、対象領域27である。
【0041】
対象領域27が指定されると、この対象領域27に対して輝度のしきい値thdが決定される。輝度のしきい値thd以上の輝度値を有する画素から成る部分を抽出図形とするか、それとも、輝度のしきい値thd以下の輝度値を有する画素から成る部分を抽出図形とするかは、対象領域27の近傍輪郭線上における輝度値の平均値Avと輝度のしきい値thdとの関係によって決定される。
【0042】
本実施の形態においては、対象領域27の近傍輪郭線とは、図4に網点で示される部分27a、すなわち対象領域27の8連結の輪郭線のことである。したがって前記対象領域27の近傍輪郭線上における輝度値の平均値Avとは、対象領域27の8連結の輪郭線上の各画素の輝度値の平均値のことである。本発明の実施の他の形態においては、対象領域27の近傍輪郭線とは、図5に網点で示される部分27b、すなわち対象領域27の4連結の輪郭線のことである。したがってこの実施の形態では、前記対象領域27の近傍輪郭線上における輝度値の平均値Avとは、対象領域27の4連結の輪郭線上の各画素の輝度値の平均値のことである。
【0043】
前記輝度値の平均値Avおよび輝度のしきい値thdの関係が、Av>thdであるときには、輝度のしきい値thd以下の輝度値を有する画素から成る部分を抽出図形とする。すなわち、対象領域27のうち、前記輝度のしきい値thd以下の輝度値を有する画素から成る部分の輝度値を1とし、対象領域27のうち、前記輝度のしきい値thd以下の輝度値を有する画素から成る部分を除く残余の部分の輝度値を0とする。さらに原画像11の全領域のうち、対象領域27を除く残余の部分の輝度値を0とする。前記輝度値の平均値Avおよび輝度のしきい値thdの関係が、Av≦thdであるときには、輝度のしきい値thd以上の輝度値を有する画素から成る部分を抽出図形とする。すなわち、対象領域27のうち、前記輝度のしきい値thd以上の輝度値を有する画素から成る部分の輝度値を1とし、対象領域27のうち、前記輝度のしきい値thd以上の輝度値を有する画素から成る部分を除く残余の部分の輝度値を0とする。さらに原画像11の全領域のうち、対象領域27を除く残余の部分の輝度値を0とする。
【0044】
抽出図形の形状が操作者の期待とは異なるときには、修正情報に基づいて、抽出図形の形状が修正される。抽出図形は、図形融合処理による方法、対象領域27を再度2値化する方法、または操作者が手入力する方法によって、形状が修正される。前記図形融合処理は、図形の整形処理であって、抽出図形を拡散または収縮する処理である。前記再度2値化する方法では、輝度のしきい値thdが変更される。この輝度のしきい値thdは、操作者によって変更されてもよい。前記手入力する方法では、操作者が1画素単位で手入力する。
【0045】
前記2値化によって複数の抽出図形が抽出されたときには、除去情報に基づいて、不要な抽出図形が除去される。不要な抽出図形は、最大面積抽出法、最小面積除去法、大小領域除去法またはマニュアル指定除去法によって、除去される。最大面積抽出法では、複数の抽出図形のうちで、面積が最大の抽出図形だけが残され、他の抽出図形は、全て除去される。最小面積除去法では、複数の抽出図形のうちで、面積が最小の抽出図形だけが除去される。大小領域除去法では、複数の抽出図形のうちで、予め定める面積範囲内の抽出図形は残され、他の抽出図形は除去される。すなわち大小領域除去法では、面積が予め定める面積範囲の上限よりも大きい抽出図形と、面積が予め定める面積範囲の下限よりも小さい抽出図形とが除去される。マニュアル指定除去法では、操作者によってマニュアル操作で指定された抽出図形が除去される。
【0046】
図6は、サンプル作成手段14の動作処理を説明するためのフローチャートである。原画像11がサンプル作成手段14に入力され、かつ領域指定情報入力手段23に領域指定情報が入力されるとステップs0からステップs1に移り、サンプル図形12を含むサンプル26の作成が開始される。ステップs1では、領域指定情報入力手段23から領域指定情報を入力してステップs2に移る。これによって原画像11の全領域のうちの対象領域27が指定される。
【0047】
ステップs2では、対象領域27に対して輝度のしきい値thdを決定して、ステップs3に移る。
【0048】
ステップs3では、輝度のしきい値thdが対象領域27の近傍輪郭線上における輝度値の平均値Avよりも小さいか否かを判定する。ステップs3で、輝度のしきい値thdが輝度値の平均値Avよりも小さい(Av>thd)と判断した場合は、ステップs4に移り、輝度のしきい値thdが輝度値の平均値Av以上(Av≦thd)であると判断した場合には、ステップs5に移る。
【0049】
ステップs4では、対象領域27内の画像を2値化して、輝度のしきい値thd以下の輝度値を有する画素から成る部分を抽出図形として、ステップs6に移る。
【0050】
ステップs5では、対象領域27内の画像を2値化して、輝度のしきい値thd以上の輝度値を有する画素から成る部分を抽出図形として、ステップs6に移る。
【0051】
ステップs6では、補正情報入力手段24による修正情報の入力があるか否かを判定する。操作者によって補正情報入力手段24に修正情報が与えられている場合、修正情報の入力があると判断してステップs7に移る。一方、ステップs6で、修正情報の入力がないと判断すると、ステップs8に移る。
【0052】
ステップs7では、修正情報に基づいて抽出図形の形状を修正して、ステップs8に移る。このステップs7では、前述の、図形融合処理による方法、対象領域27を再度2値化する方法、または操作者が手入力する方法によって、抽出図形の形状を修正する。こうして抽出図形の形状を修正すると、ステップs8に移る。
【0053】
ステップs8では、補正情報入力手段24による除去情報の入力があるか否かを判定する。操作者によって補正情報入力手段24に除去情報が与えられている場合、サンプル作成手段14は、除去情報の入力があると判断して、ステップs9に移る。一方、ステップs8で、除去情報の入力がないと判断した場合、ステップs10に移り、動作処理を終了する。
【0054】
ステップs9では、除去情報に基づいて不要な抽出図形を除去する。このステップs9では、前述の、最大面積抽出法、最小面積除去法、大小領域除去法またはマニュアル指定除去法によって、不要な抽出図形を除去する。こうして不要な抽出図形を除去すると、ステップs10に移り、動作処理を終了する。これによって、サンプル26が作成される。
【0055】
本実施の形態では、領域指定情報入力手段23から入力した領域指定情報によって、原画像11の全領域のうちの予め定める対象領域27が指定される。サンプル作成手段14は、前記対象領域27からサンプル図形12を抽出して、このサンプル図形12を含むサンプル26を作成する。
【0056】
前述のようにサンプル作成手段14が対象領域27からサンプル図形12を抽出するので、サンプル26を作成するにあたって、操作者がサンプル図形12の各画素を1画素単位で手入力する必要がない。したがって先行技術に比べて、サンプル図形12の作成に要する手間を低減することができる。
【0057】
また本実施の形態では、輝度のしきい値thdが対象領域27に対して決定され、かつ前記輝度のしきい値thdに基づいて対象領域27が2値化されるので、対象領域27中の、サンプル図形12とその近傍とを確実に区別することができる。したがって対象領域27からサンプル図形12を確実に抽出することができる。
【0058】
画像処理手順設計手段25は、不感帯領域作成手段15と、輝度変換判定手段16と、前処理選択手段17と、2値化処理選択手段18と、図形融合処理生成手段19と、フィルター処理生成手段20とを含む。画像処理設計手段25は、複数の原画像11およびこれらに対応するサンプル図形12に基づいて、1つの処理手順を構成する。つまり画像処理手順設計手段25は、前記複数の原画像11に類似する画像から、サンプル図形12に近い図形を抽出するための処理手順を構成する。
【0059】
図7は、不感帯領域作成手段1によって原画像11のサンプル図形12に対応する領域31の周囲に作成される近傍領域32および不感帯領域33を示す図である。図8は、前記近傍領域32および不感帯領域33を説明する図である。以後、原画像11のサンプル図形12に対応する領域31をサンプル領域31と記載する場合がある。
【0060】
不感帯領域作成手段15は、サンプル領域31の周囲に近傍領域32を作成する。また不感帯領域作成手段15は、サンプル領域31と近傍領域32との境界部34よりも外側および内側の両方、つまりサンプル領域31の輪郭線の外側および内側の両方に、処理対象から除外される不感帯領域33を作成する。不感帯領域33は、サンプル領域31と近傍領域32との境界部34よりも内側に形成される収縮不感帯領域35と、サンプル領域31と近傍領域32との境界部34の外側に形成される膨張不感帯領域36とを含む。
【0061】
さらに不感帯領域作成手段15は、サンプル領域31および近傍領域32の輝度が重なる場合、輝度の重なる領域を除いて近傍領域32を作成する。つまり、サンプル領域31の画素の輝度と、近傍領域32の画素の輝度とが等しい場合、この等しい輝度を有する画素を、近傍領域32から除外する。
【0062】
本実施の形態では、サンプル領域31と近傍領域32との境界部34の両側に不感帯領域33を作成するが、本発明の実施の他の形態では、サンプル領域31と近傍領域32との境界部34の内側および外側のいずれか一方にのみ不感帯領域を作成してもよい。
【0063】
図9は、不感帯領域作成手段15の動作処理を示すフローチャートである。原画像11および原画像11に対応するサンプル図形12が不感帯領域作成手段15に入力されると、ステップa0からステップa1に移る。
【0064】
ステップa1では、原画像11のサンプル図形12に対応する領域であるサンプル領域31の周囲に近傍領域32を作成して、ステップa2に移る。不感帯領域作成手段15は、サンプル図形12に図形成分の膨張処理を複数回施し、この膨張処理によって作成された領域に対応する原画像11の領域を近傍領域32とする。膨張処理は、収縮処理とは逆に、図形成分の境界画素から図形の外部に向かって増殖させてひと皮太らせる。
【0065】
近傍領域32は、たとえばサンプル領域31の周囲から、3〜30画素程度、好ましくは8画素程度離反した領域を含む。前記近傍領域32は、後述する設定部45によって設定される。
【0066】
サンプル図形12が原画像11から抽出したい領域の一部を示している場合には、サンプル領域31の周辺部の全てに近傍領域および不感帯領域を設けるのではなく、エッジ部分に不感帯領域を設ける。
【0067】
ステップa2では、不感帯領域33のうち、収縮不感帯領域35を形成して、ステップa3に移る。不感帯領域作成手段15は、サンプル図形12に図形成分の収縮処理を複数回施し、この収縮処理によって作成された領域に対応する原画像11の領域を収縮不感帯領域35とする。収縮処理は、与えられた図形成分の境界画素を全て削除して、ひと皮分取り除く。
【0068】
不感帯領域作成手段15による前記収縮処理は、サンプル図形12から削る画素数を指定することによって設定される。サンプル図形12から削る画素数の設定は、後述する設定部45によって設定される。前記画素数は、収縮処理の回数に等しく、たとえば1〜5の範囲に設定される。
【0069】
ステップa3では、ステップa2において収縮不感帯領域35を形成した結果、サンプル領域31が消滅してしまうか否かを判断する。つまり、サンプル領域31の全てが収縮不感帯領域35に含まれるか否か、ここではサンプル領域31の画素数と、収縮不感帯領域35の画素数とを比較し、収縮不感帯領域35の画素数がサンプル領域31の画素数に等しくなるか否かを判断する。
【0070】
ステップa3で、サンプル領域31が消滅しないと判断した場合には、ステップa4に移る。一方、ステップa3において、サンプル領域31が消滅すると判断した場合には、ステップa10に移る。ステップa3の処理によって、サンプル領域31がすべて不感帯領域33に含まれることを防止して、サンプル領域31のすべてが処理対象から除かれることを防止することができる。
【0071】
前記ステップa3では、収縮不感帯領域35を形成した結果、サンプル領域31が消滅してしまうか否かを判断しているが、本発明の他の実施の形態において、前記ステップa3において、サンプル領域31の画素数に対する収縮不感帯領域35の画素数の比率が予め定める比率以上となるか否か判断してもよい。前記予め定める比率は、1〜20%の間に選ばれ、好ましくは5%に選ばれる。サンプル領域31の画素数に対する収縮不感帯領域35の画素数の比率が前記予め定める比率以上にはならないと判断した場合、ステップa4に移る。一方、サンプル領域31の画素数に対する収縮不感帯領域35の画素数の比率が前記予め定める比率以上になると判断すると、ステップa10に移る。これによって、処理対象となるサンプル領域31が小さくなりすぎることを防止することができる。
【0072】
ステップa4では、不感帯領域33のうち、膨張不感帯領域36を形成して、ステップa5に移る。不感帯領域作成手段15は、サンプル図形12に図形成分の膨張処理を複数回施し、この膨張処理によって作成された領域に対応する原画像11の領域を膨張不感帯領域36とする。不感帯領域作成手段15による前記膨張処理は、サンプル図形12から太らせる画素数を指定することによって設定される。サンプル図形12から太らせる画素数の設定は、後述する設定部45によって設定される。前記画素数は、膨張処理の回数に等しく、たとえば1〜5の範囲に設定される。
【0073】
ステップa5では、ステップa4において膨張不感帯領域36を形成した結果、膨張不感帯領域36が近傍領域32を越えてしてしまうか否かを判断する。つまり、近傍領域32の全てが膨張不感帯領域36に含まれるか否かを判断する。
【0074】
ステップa5で、膨張不感帯領域36が近傍領域32を越えないと判断した場合には、ステップa6に移る。一方、ステップa5において、膨張不感帯領域36が近傍領域32を越えると判断した場合には、ステップa11に移る。ステップa5の処理によって、近傍領域32がすべて不感帯領域33に含まれることを防止し、近傍領域32のすべてが処理対象から除かれることを防止することができる。
【0075】
前記ステップa5では、膨張不感帯領域36が近傍領域32を越えてしまうか否かを判断しているが、本発明の他の実施の形態において、前記ステップa5において、近傍領域32の画素数に対する膨張不感帯領域36の画素数の比率が予め定める比率以上となるか否か判断してもよい。前記予め定める比率は、1〜30%の間に選ばれ、好ましくは8%に選ばれる。近傍領域32の画素数に対する膨張不感帯領域36の画素数の比率が前記予め定める比率以上にはならないと判断した場合、ステップa6に移る。一方、近傍領域35の画素数に対する膨張不感帯領域36の画素数の比率が前記予め定める比率以上になると判断すると、ステップa11に移る。これによって、処理対象となる近傍領域が小さくなりすぎることを防止することができる。
【0076】
ステップa6では、サンプル領域31の各画素の輝度を検出し、近傍領域32の各画素の輝度を検出して、サンプル領域31および近傍領域32の輝度分布を作成して、ステップa7に移る。ステップa6において、輝度を検出するときに、不感帯領域33の画素は処理対象から除外される。
【0077】
図10は、ステップa7で、不感帯領域作成手段15によって作成されたサンプル領域31の輝度分布31aおよび近傍領域32の輝度分布32aとの一例を示す図である。図10において、縦軸は画素数を表し、横軸は輝度値を表す。つまり図10は、縦軸に画素数を取り、横軸に輝度値を取る輝度ヒストグラムを概略的に示す図である。また図10では、サンプル領域31の輝度分布31aと、近傍領域32の輝度分布32aとに重なりがある状態を示す。また図10では、サンプル領域31の輝度分布31aの最大値が近傍領域32の輝度分布32aの最大値よりも大きな場合について示している。
【0078】
ステップa7では、サンプル領域31の輝度分布31aと近傍領域32の輝度分布32aとが重なっているか否かを判断する。ステップa7において、輝度分布が重なっていると判断した場合には、ステップa8に移り、輝度が重なっていないと判断した場合には、ステップa9に移り、動作処理を終了する。
【0079】
サンプル領域31の輝度分布31aと、近傍領域32の輝度分布32aとが重なるか否かは、以下のようにして判断する。サンプル領域31のうち最小の輝度値をA1とし、最大の輝度値をA2とする。近傍領域32のうち最小の輝度値をB1とし、最大の輝度値をB2とする。このとき、サンプル領域31の最小の輝度値から近傍領域32の最大の輝度値を減算した値、つまり(A1−B2)の値が正の値となる場合には、サンプル領域31の輝度分布31aと、近傍領域32の輝度分布32aとが重ならないと判断する。また近傍領域32の最小の輝度値からサンプル領域31の最大の輝度値を減算した値、つまり(B1−A2)が正の値となる場合には、サンプル領域31の輝度分布31aと、近傍領域32の輝度分布32aとが重ならないと判断する。
【0080】
一方、サンプル領域31の最小の輝度値から近傍領域32の最大の輝度値を減算した値、つまり(A1−B2)の値が正の値とならず、かつ近傍領域の最小の輝度値からサンプル領域31の最大の輝度値を減算した値、つまり(B1−A2)が正の値とならない場合には、サンプル領域31の輝度分布31aと、近傍領域32の輝度分布32aとが重なると判断する。
【0081】
ステップa8では、サンプル領域31の輝度分布31aと重なっている領域を除いて近傍領域32を形成して、ステップa6に移る。
【0082】
図11は、ステップa8で、サンプル領域31の輝度分布32aと重なっている領域を除いて、近傍領域32を作成したときの、サンプル領域31の輝度分布31aおよび近傍領域32の輝度分布32bとの一例を示す図である。図11において、縦軸は画素数を表し、横軸は輝度値を表す。つまり図11は、縦軸に画素数を取り、横軸に輝度値を取る輝度ヒストグラムを概略的に示す図である。図11では、図10に示す輝度分布を有するサンプル領域31および近傍領域32について、近傍領域32の輝度の重なっている領域を除いた状態の輝度分布を示している。
【0083】
ステップa7の処理によって、サンプル領域31および近傍領域32の輝度差を大きくすることができるので、原画像11からサンプル図形12に対応する領域を抽出するための処理手順の構成を安定させることができる。したがって、後述する各画像処理手段13によって、信頼性の高い図形を抽出する処理手順を構成することができ、また余分な計算処理を低減することができる。
【0084】
ステップa10では、第1警告情報を出力して、ステップa2に移る。またステップa11では、第2警告情報を出力して、ステップa4に移る。前記第1警告情報は、サンプル領域31のすべてが処理対象から除かれてしまうことを示す。また第2警告情報は、近傍領域32の全てが処理対象から除かれてしまうことを示す。
【0085】
不感帯領域作成手段15が、前述した処理を実行することによって、判定結果40が得られる。判定結果40は、近傍領域32および不感帯領域33を設定した原画像11である。
【0086】
前述した画像処理手順設計手段25は、設定部45を含む。設定部45は、たとえばマウスおよびキーボードなどから入力される操作者からの指示に基づいて、図9に示す処理手順のステップa2およびステップa4において設定される画素数を不感帯領域作成15に入力する。
【0087】
また設定部45は、操作者からの指示に基づいて、サンプル図形12が、原画像11において抽出した領域の画像を2値化して得られる画像の一部であることを入力することができる。設定部45によって、サンプル図形12が、原画像11において抽出したい領域の2値化して得られる画像の一部であることが入力されると、不感帯領域作成手段15は、原画像11においてサンプル領域31と近傍領域32との輝度差が予め定める範囲内となる領域を除いて、サンプル領域31の周囲の一部に近傍領域32を作成する。
【0088】
不感帯領域作成手段15は、複数の原画像11に対して前述した処理を実行する。
【0089】
たとえば、電子カメラなどの撮像手段によって撮像した画像を原画像11として入力する場合、原画像11では輝度の異なる領域の間で輝度勾配が発生する。この輝度勾配が発生する領域では、輝度値が不安定となる。サンプル図形12は、原画像11の抽出したい領域の画像に対応し、前述した輝度の異なる領域の間を輪郭とするので、輝度値が不安定な部分を含む。したがって、サンプル図形12を、原画像11の抽出したい領域に正確に合わせなければ、エキスパートシステムが構成する処理手順が、異なる結果となってしまう。したがって、手順を正しく評価することができない。
【0090】
本実施の形態のエキスパートシステムでは、原画像11に処理対象から除外される不感帯領域33を作成して、画像処理手段13において処理を実行すると、サンプル図形12が、原画像11から抽出したい領域の画像と同一でなく、この原画像11から抽出したい領域の画像よりも多少大きくなる場合または小さくなる場合であっても、サンプル図形12が抽出したい領域の画像と同一である場合に構成される場合と比較して、構成される処理手順が異なることがない。
【0091】
つまり、原画像11から抽出したい領域の画像にあわせて、たとえば1画素単位で正確にサンプル図形12を作成できない場合であっても、原画像11から抽出したい領域にあわせて1画素単位で正確にサンプル図形12を作成した場合と同じ処理手順が構成される。したがって、サンプル図形12の精度が多少粗い場合であっても、手順を正しく評価することができる。これによって、エキスパートシステムの評価精度を落とさず、より信頼性の高い図形を抽出する処理手順を構成することができる。
【0092】
このようにサンプル図形12の精度が手順評価に直結しないので、サンプル図形12をたとえば1画素単位で正確に作成する手間を省くことができる。つまり、エキスパートシステムに入力されるサンプル図形12の作成に多大な労力と時間をかける必要がなくなる。したがって、エキスパートシステムを実際の画像処理装置に組み込むことが容易となり、エキスパートシステムの実用化を実現することができる。
【0093】
輝度変換判定手段16は、複数の画像処理手段13の1つを構成する。輝度変換判定手段16は、サンプル領域31内の最小輝度および最大輝度をそれぞれしきい値TL1およびTH1とし、最小輝度のしきい値TL1以上の輝度を有する原画像11内の画素の数NL1、および最大輝度のしきい値TH1以下の輝度を有する原画像11内の画素の数NH1に対する評価値PL,PHをそれぞれ算出する。輝度変換判定手段16は、これらの評価値PL,PHに基づいて、原画像11の輝度分布を輝度値全体に拡大する予め定める輝度変換処理が必要か否かを判定する。
【0094】
前記予め定める輝度変換処理は、たとえば線形変換および中間強調などである。線形変換は、線形変換前の原画像11において、各画素の輝度をX、最小輝度をXmin、最大輝度をXmaxとし、線形変換後の原画像11において、各画素の輝度をY、最小輝度Ymin、最大輝度をYmaxとするとき、次式(1)に基づいて行われる。
Y={(Ymax−Ymin)/(Xmax−Xmin)}
・(X−Xmin)+Ymin …(1)
【0095】
中間強調は、中間強調前の原画像11の各画素の輝度をXとし、中間強調後の原画像11の各画素の輝度をYとするとき、0以上127以下の輝度範囲のXに対しては、次式(2)に基づいて行われ、128以上255以下の輝度範囲のXに対しては、次式(3)に基づいて行われる。
Y=(X/127)・127 …(2)
Y={(X−128)/127}1/2・127}+127 …(3)
【0096】
本実施の形態においては、前述したようにサンプル領域31は、原画像11のサンプル図形12に対応する領域であり、背景領域は、原画像11の前記サンプル領域31を除く残余の領域である。
【0097】
図12および図13は、サンプル領域31および背景領域の輝度分布31a,37aを示す図である。図12および図13において、縦軸は画素数を表し、横軸は輝度値を表す。つまり図12および図13は、縦軸に画素数を取り、横軸に輝度値を取る輝度ヒストグラムを概略的に示す図である。図12は、サンプル領域31の輝度分布31aと背景領域の輝度分布37aとが離反している状態の一例を示す図である。図13は、サンプル領域31の輝度分布31aと背景領域の輝度分布37とが近接している状態の一例を示す図である。
【0098】
前記評価値PL,PHは、最小輝度側評価値PLおよび最大輝度側評価値PHを含む。最小輝度側評価値PLは、サンプル領域31内の最小輝度のしきい値TL1以上の輝度を有する原画像11内の画素の数NL1と、サンプル領域31内の最小輝度のしきい値TL1よりも予め定める値αLだけ低い最小輝度側しきい値TL2以上の輝度を有する原画像11内の画素の数NL2との比である。
【0099】
最大輝度側評価値PHは、サンプル領域31内の最大輝度のしきい値TH1以下の輝度を有する原画像11内の画素の数NH1と、サンプル領域31内の最大輝度のしきい値TH1よりも予め定める値αHだけ高い最大輝度側しきい値TH2以下の輝度を有する原画像11内の画素の数NH2との比である。本件発明者の実験結果から、前記予め定める値αLは、5〜30の間に選ばれ、たとえば10に選ばれ、また前記予め定める値αHは、5〜30の間に選ばれ、たとえば10に選ばれる。
【0100】
具体的には、最小輝度側評価値PLは、前記最小輝度のしきい値TL1以上の輝度を有する原画像11内の画素の数NL1をNL1とし、前記最小輝度側しきい値TL2以上の輝度を有する原画像11内の画素の数NL2をNL2とし、前記最小輝度側評価値PLをPLとするとき、次式(4)によって求められる。
PL=NL2/NL1 …(4)
【0101】
最大輝度側評価値PHは、前記最大輝度のしきい値TH1以下の輝度を有する原画像11内の画素の数NH1をNH1とし、前記最大輝度側しきい値TH2以下の輝度を有する原画像11内の画素の数NH2をNH2とし、前記最大輝度側評価値PHをPHとするとき、次式(5)によって求められる。
PH=NH2/NH1 …(5)
【0102】
輝度変換判定手段16は、最小輝度側評価値PLが予め定める最小輝度側基準値ηL以下であり、かつ最大輝度側評価値PHが予め定める最大輝度側基準値ηH以下であるときには、輝度変換処理が不要であると判定する。また輝度変換判定手段16は、最小輝度側評価値PLが予め定める最小輝度側基準値ηLを超えるとき、または最大輝度側評価値PHが予め定める最大輝度側基準値ηHを超えるときには、輝度変換処理が必要であると判定する。本件発明者の実験結果から前記最小輝度側基準値ηLは、1.1〜1.5の間に選ばれ、たとえば1.3に選ばれ、また前記最大輝度側基準値ηHは、1.1〜1.5の間に選ばれ、たとえば1.3に選ばれる。
【0103】
図14は、輝度変換判定手段16の動作処理を示すフローチャートである。原画像13が入力されると、ステップb0からステップb1移り、輝度変換処理が必要か否かを判定するための動作処理を開始する。ステップb1では、前記最小輝度のしきい値TL1以上の輝度を有する原画像11内の画素の数NL1と、前記最小輝度側しきい値TL2以上の輝度を有する原画像11内の画素の数NL2とを算出し、ステップb2に移る。
【0104】
ステップb2では、前記最大輝度のしきい値TH1以下の輝度を有する原画像11内の画素の数NH1と、前記最大輝度側しきい値TH2以下の輝度を有する原画像11内の画素の数NH2とを算出して、ステップb3に移る。
【0105】
ステップb3では、前記ステップb1で算出した各画素数NL1,NL2に基づいて、最小輝度側評価値PLを算出し、前記ステップb2で算出した各画素数NH1,NH2に基づいて最大輝度側評価値PHを算出して、ステップb4に移る。
【0106】
ステップb4では、最小輝度側評価値PLが最小輝度側基準値ηL以下であり、かつ最大輝度側評価値PHが予め定める最大輝度側基準値ηH以下であるか否かを判断する。ステップb4において、最小輝度側評価値PLが最小輝度側基準値ηL以下であり、かつ最大輝度側評価値PHが最大輝度側基準値ηH以下であるときには、ステップb5に移る。ステップb5では、輝度変換が不要であると判定して、ステップb6に移り、動作処理を終了する。
【0107】
一方、ステップb4において、最小輝度側評価値PLが予め定める最小輝度側基準値ηLを超えるとき、または最大輝度側評価値PHが予め定める最大輝度側基準値ηHを超えるときには、ステップb7に移る。ステップb7では、輝度変換の処理が必要であると判定して、ステップb6に移り、動作処理を終了する。
【0108】
このように輝度変換判定手段16は、前記最小輝度のしきい値TL1以上の輝度を有する原画像11内の画素の数NL1および前記最大輝度のしきい値TH1以下の輝度を有する原画像11内の画素の数NH1に対する評価値PL,PHをそれぞれ算出する。各評価値PL,PHは、原画像11の輝度分布に依存する。これらの各評価値PL,PHに基づいて、輝度変換判定手段16は、輝度変換処理が必要か否かを判定する。したがって輝度変換判定手段16は、原画像11の輝度分布に応じて、輝度変換処理が必要か否かを判定することができる。
【0109】
前記輝度変換判定手段16が算出する評価値PL,PHは、最小輝度側評価値PLおよび最大輝度側評価値PHを含む。前記最小輝度側評価値PLは、前記最小輝度のしきい値TL1と前記最小輝度側しきい値TL2との間の輝度範囲の輝度を有する原画像11内の画素の数(NL2−NL1)が、前記最小輝度のしきい値TL1以上の輝度を有する原画像11内の画素の数NL1に対してどの程度であるかを示す。前記最大輝度側評価値PHは、前記最大輝度のしきい値TH1と前記最大輝度側しきい値TH2との間の輝度範囲の輝度を有する原画像11内の画素の数(NH2−NH1)が、前記最大輝度のしきい値TH1以上の輝度を有する原画像11内の画素の数NH1に対してどの程度であるかを示す。
【0110】
このような各評価値PL、PHに基づいて前述のように判定するので、輝度変換判定手段16は、サンプル領域31内の全画素の数に対して、サンプル領域31の各画素の輝度に近い輝度を有する原画像11内の画素の数が少ないときには、輝度変換処理が不要であると判定することができる。また輝度変換判定手段16は、サンプル領域31内の全画素の数に対して、サンプル領域31の各画素の輝度に近い輝度を有する原画像11内の画素の数が多いときには、輝度変換処理が必要であると判定することができる。
【0111】
エキスパートシステムは、輝度変換判定手段16によって輝度変換処理が必要であると判定されたときには、輝度変換処理を含む処理手順を構成し、輝度変換判定手段16によって輝度変換処理が不要であると判定されたときには、輝度変換処理を含まない処理手順を構成する。これによってエキスパートシステムは、原画像11の輝度分布に応じて、その原画像11に適した処理手順を構成することができる。
【0112】
原画像11が撮影によって得られる画像である場合、原画像11の輝度分布は、原画像11の撮影時における照明などの光学系環境によって異なる。このように原画像11の輝度分布と、原画像11の撮影時における光学系環境とは、相互に関連するので、原画像11の輝度分布に基づいて、光学系環境を診断することが可能である。前述のように輝度変換判定手段16の判定は、原画像11の輝度分布に基づいている。したがって輝度変換判定手段16の判定は、光学系環境の診断に用いることができる。
【0113】
図15は、前処理選択手段17の動作処理を示すフローチャートである。複数組の設計標本が入力されると、ステップc0からステップc1に移る。ステップc1では、複数の原画像11のうち1つの原画像11に、複数のノイズ除去処理のうちの1つのノイズ除去処理を実行して処理して、ステップc2に移る。ステップc1では、原画像11に対してノイズ除去処理を実行して処理するときに、同時にこのノイズ除去処理にかかる処理時間を算出する。
【0114】
前処理選択手段17は、実行可能な全てのノイズ除去処理を実行して、原画像11からノイズを除去する。前処理選択手段17には、複数のノイズ除去処理として複数の処理モジュールが用意されている。前記処理モジュールとは、移動平均処理およびメディアンフィルターなどである。本実施の形態では、たとえばノイズ除去処理としては、移動平均処理(1〜5回)およびメディアンフィルター(1〜5回)の2つの処理モジュールがあり、この場合、ステップc1では、合計10種類のノイズ除去処理を実行して、原画像11のノイズを除去する。
【0115】
ステップc2では、ステップc1で処理された原画像11のサンプル図形12に対応する領域の輝度を算出し、輝度分布を求めて、ステップc3に移る。以後、前記ノイズ除去処理後の原画像11を、第1処理画像と記載する場合がある。また第1処理画像において、サンプル図形12に対応する領域を第1サンプル領域と記載する場合がある。第1サンプル領域は、前述したサンプル領域に対応する。
【0116】
ステップc3では、ステップc2において輝度を算出した第1処理画像の第1サンプル領域の近傍の領域の輝度を算出し、輝度分布を求めて、ステップc4に移る。以後、第1処理画像において第1サンプル領域の周囲に設けられる近傍の領域を第1近傍領域と記載する。第1近傍領域は、前述した近傍領域32に対応する。
【0117】
ステップc4では、ステップc2で求めた第1サンプル領域の輝度分布38、およびステップc3で求めた第1近傍領域の輝度分布39から、第1サンプル領域の輝度分布38と第1近傍領域との輝度分布39とに重なりがあるか否か算出する。
【0118】
図16および図17は、第1サンプル領域の輝度分布38および第1近傍領域の輝度分布39との一例を示す図である。図16および図17において、縦軸は画素数を表し、横軸は輝度値を表す。つまり図16および図17は、縦軸に画素数を取り、横軸に輝度値を取る輝度ヒストグラムを概略的に示す図である。また図16は、第1サンプル領域の輝度分布38と、第1近傍領域の輝度分布39とに重なりが無い状態の一例を示す図である。図17は、第1サンプル領域38の輝度分布と、第1近傍領域の輝度分布39とに重なりがある状態の一例を示す図である。
【0119】
第1サンプル領域の輝度分布38と、第1近傍領域の輝度分布39とが重なるか否かは、以下のようにして判断する。第1サンプル領域のうち最小の輝度値をC1とし、最大の輝度値をC2とする。第1近傍領域の輝度のうち最小の輝度値をD1とし、最大の輝度値をD2とする。このとき、第1サンプル領域の最小の輝度値から第1近傍領域の最大の輝度値を減算した値、つまり(C1−D2)の値が正の値となる場合には、第1サンプル領域の輝度分布38と、第1近傍領域の輝度分布39とが重ならないと判断する。また第1近傍領域の最小の輝度値から第1サンプル領域の最大の輝度値を減算した値、つまり(D1−C2)が正の値となる場合には、第1サンプル領域の輝度分布38と、第1近傍領域の輝度分布39とが重ならないと判断する。
【0120】
一方、第1サンプル領域の最小の輝度値から近傍領域の最大の輝度値を減算した値、つまり(C1−D2)の値が正の値とならず、かつ第1近傍領域の最小の輝度値から第1サンプル領域の最大の輝度値を減算した値、つまり(D1−C2)が正の値とならない場合には、第1サンプル領域の輝度分布38と、第1近傍領域39の輝度分布とが重なると判断する。
【0121】
ステップc5では、1つの原画像11に複数のノイズ除去処理の全てを実行して、輝度分布の重なりを算出したか否かを判断する。ステップc5で、1つの原画像11に複数のノイズ除去処理の全てを実行して、輝度分布の重なりを算出したと判断した場合は、ステップc6に移る。一方、ステップc5で、1つの原画像11に複数のノイズ除去処理の全てを実行して、輝度分布の重なりを算出してはいないと判断した場合は、ステップc1に移り、1つの原画像11について、複数のノイズ除去処理の全てを実行して、第1サンプル領域と第1近傍領域との輝度分布の重なりを算出するまでステップc1〜ステップc4までの処理を繰り返す。
【0122】
ステップc6では、全ての第1処理画像について、前記ステップc1〜ステップc5までの各処理を実行したか否かを判断する。ステップc6で、各第1処理画像について前記ステップc1〜ステップc5までの各処理を実行したと判断した場合、ステップc7に移る。一方、ステップc6で、全ての第1処理画像について、前記ステップc1〜ステップc5までの各処理を実行してはいないと判断した場合、ステップc1に移り、ステップc1〜ステップc5における各処理を行っていない第1処理画像に対する処理を実行する。
【0123】
ステップc7では、ステップc4で第1処理画像の第1サンプル領域の輝度分布38と第1近傍領域の輝度分布39との重なりを算出した結果を参照して、全てのノイズ除去処理のうちで、全ての第1処理画像において第1サンプル領域の輝度分布38と第1近傍領域との輝度分布39とが重ならないノイズ除去処理があるか否かを判断する。前記第1サンプル領域の輝度分布38と第1近傍領域の輝度分布39とが重ならないノイズ除去処理を、重なり無のノイズ除去処理と記載する場合がある。
【0124】
ステップc6において、全ての第1処理画像において前記重なり無しのノイズ除去処理があると判断した場合には、ステップc8に移る。
【0125】
ステップc8では、重なり無のノイズ除去処理のうち最速処理、つまりノイズ除去処理を実行して処理する時間が最も短いノイズの除去処理を選択して、ステップc13に移り、動作処理を終了する。重なり無のノイズ除去処理によって原画像11を処理する場合、いずれのノイズ除去処理を実行しても、第1サンプル領域と第1近傍領域とを精度よく分離することができる。つまり、第1サンプル領域を精度よく抽出することができる。したがってこのような場合では、処理速度が最も速くなるノイズ除去処理を選択することによって、時間がかかるノイズ除去処理における処理時間を短くすることができる。また、前記ノイズ除去処理を実行して処理する時間は、全ての原画像11に対する処理時間の平均値が用いられる。
【0126】
一方、ステップc7において、全ての第1処理画像において前記重なり無しのノイズ除去処理がないと判断した場合には、ステップc9に移る。ステップc9では、複数のノイズ除去処理のうち1つのノイズ除去処理を実行して処理された原画像11の分離度を算出して、ステップc10に移る。前記分離度をPとすると、分離度は、第1サンプル領域の平均輝度をμ0とし、第1近傍領域の平均輝度をMiとし、第1サンプル領域および第1近傍領域の輝度の標準偏差をσとすると、次式(6)によって表される。
P=(μ0−Mi)/σ×100% …(6)
【0127】
分離度は、第1サンプル領域と第1近傍領域との分離のしやすさを示す尺度である。この分離度が大きくなるほど、第1サンプル領域と第1近傍領域との分離がよい、つまり第1サンプル領域の抽出精度がよい。分離度を式(6)のように定義することによって、複数のノイズ除去処理のうちから、前記ノイズ除去処理後の原画像11のサンプル図形12に対応する領域の輝度と、その近傍領域の輝度との差が最も大きくなるようなノイズ除去処理を効率よく選択することができる。
【0128】
ステップc10では、複数の原画像11に全てのノイズ除去処理をそれぞれ実行して得られる全ての第1処理画像について、分離度の算出を行ったか否かを判断する。ここで、全ての第1処理画像について、分離度の算出を行ったと判断した場合、ステップc11に移る。一方、ステップc10で、全ての第1処理画像について、分離度の算出を行ってはいないと判断した場合、ステップc9に移り、分離度を算出していない第1処理画像の分離度を算出する。
【0129】
ステップc11では、複数のノイズ除去処理のうち、同じノイズ除去処理を実行して得られる各第1処理画像における輝度の分離度の平均を算出して、ステップc12に移る。以下、前記分離度の平均を平均分離度と記載する。
【0130】
ステップc12では、ステップc11で算出した平均分離度に基づいて、各処理モジュールごとに、平均分離度が最も大きくなるノイズ除去処理を選択して、ステップc13に移り、動作処理を終了する。たとえばノイズ除去処理が、前述した移動平均処理およびメディアンフィルターからなる場合、移動平均処理を実行して処理された原画像11のうち平均分離度が最も大きくなるものをノイズ除去処理として選択し、メディアンフィルターを実行して処理された原画像11のうち最も平均分離度が大きくなるものをノイズ除去処理として選択する。
【0131】
たとえば、前処理選択手段17によって選択されたノイズ除去処理を実行して処理された原画像11を、2値化するための2値化処理を選択する場合、全てのノイズ除去処理のうちで、分離度が最大となるノイズ除去処理によって処理された原画像11を用いて2値化処理を選択するよりも、全てのノイズ除去処理のうちで分離度が最大ではないが前記分離度が最大となるノイズ除去処理の処理モジュールとは異なる処理モジュールによるノイズ除去処理のうち、分離度が最大となるノイズ除去処理を用いて2値化処理を選択する方が、結果として原画像11のサンプル図形12に対応する領域の抽出精度が向上する場合がある。
【0132】
ステップc12では、各処理モジュールごとに、分離度が最も大きくなるノイズ除去処理を選択するので、前処理選択手段17によって選択されたノイズ除去処理を実行した原画像11を用いて、後述する2値化処理選択手段18が2値化処理を選択することによって、構成される処理手順の精度を向上させることができる。
【0133】
このように前処理選択手段17は、ノイズ除去処理を実行して処理された原画像11のサンプル図形12に対応する領域の輝度分布38と、その近傍領域との輝度分布39とに基づいて、処理速度を優先する、または分離度を優先するノイズ除去処理を選択することができ、精度を落とさずに、処理時間の短い処理手順を構成することができる。これによってエキスパートシステムにおいて、ノイズを除去するノイズ除去処理の処理速度を調整して処理手順を構成することができ、処理手順の生成後に、ノイズ除去処理の処理速度の調整をできるだけ少なくすることができる。
【0134】
本実施の形態では、ステップc2で第1サンプル領域の輝度分布38を算出した後、ステップc3で第2近傍領域の輝度分布39を算出しているが、本発明の実施の他の形態において、前記ステップc2とステップc3とは、順序が逆になってもよい。
【0135】
また本実施の形態では、ステップc10で、各処理モジュールごとに、分離度が最も大きくなるノイズ除去処理を選択しているが、本発明の他の実施の形態では、平均分離度が最も大きくなるノイズ除去処理を1つ選択してもよい。この場合、後述する2値化処理選択手段18における処理時間を短縮することができる。
【0136】
また本実施の形態では、不感帯領域作成手段15によって、処理対象から除外される不感帯領域33を設けるので、図13に示すフローチャートのステップc4において算出される第1サンプル領域の輝度分布38と第1近傍領域の輝度分布39との重なりを抑制することができる。したがって前処理選択手段17において、最速の処理が選択される可能性が高くなり、構成された処理手順に従う処理を実行するときの処理時間を可及的に短縮することができる。
【0137】
2値化処理選択手段18は、前記複数の画像処理手段13の1つを構成する。2値化処理選択手段18は、第1処理画像を2値画像にする複数の2値化処理を実行し、前記複数の2値化処理を実行して処理した第1処理画像のサンプル図形12に対応する領域とサンプル図形12との一致度をそれぞれ算出して、複数の2値化処理から前記一致度が最大となるような2値化処理を選択する。以後、2値化処理を実行して処理した第1処理画像を、第2処理画像と記載する場合がある。以後、第2処理画像のサンプル図形12に対応する領域を、第2サンプル領域と記載する場合がある。第2サンプル領域は、前述したサンプル領域31に対応する。
【0138】
まず2値化処理選択手段18は、前処理選択手段17によって選択されたノイズ除去処理を実行して処理した複数の原画像11、つまり複数の第1処理画像を2値化するためのしきい値を、段階的に代えて2値化処理を実行する。たとえば、原画像11の輝度が256(8ビット)段階であれば、しきい値を1〜255に段階的に変化させて、2値化処理を実行する。前処理選択手段17によって選択されたノイズ除去処理が複数ある場合、それぞれのノイズ除去処理を実行して得られる第1処理画像に対して、2値化処理を実行する。
【0139】
2値化処理選択手段18は、第1処理画像の第1サンプル領域の輝度が第1近傍領域の輝度よりも大きい場合は、しきい値以上を1とする2値化処理を行い、第1サンプル領域の輝度が第1近傍領域の輝度未満である場合は、しきい値以下を1とする2値化処理を行う。これによって、2値画像である第2処理画像が得られる。
【0140】
第2値化処理選択手段18は、第2サンプル領域とサンプル図形12との一致度Pevが最大となるような2値化処理を選択する。ここで、第2サンプル領域、つまり前記第2処理画像中でサンプル図形12と共通部分をもつ抽出図形の全体と、サンプル図形12との一致度Pevは、次式(7)で与えられる。
Pev=S0/S1 …(7)
ここに、S0=両図形の共通部分の面積
S1=両図形の和集合の面積
【0141】
一致度は、比較する図形が一致する度合いを示す尺度である。2値化処理選択手段18は、前記一致度が最大となるようなしきい値を決定する。前記一致度が最大となるしきい値が多数存在する場合には、同じ一致度となるしきい値の範囲を求め、この範囲の中央値をしきい値とする。つまり、たとえばしきい値が80から100の全ての範囲で一致度が同じ場合、2値化処理選択手段18は、前記しきい値を90に決定する。
【0142】
2値化処理選択手段18は、同じ2値化処理を実行して得られる各第2処理画像における一致度の平均を算出して、この算出された平均一致度が最大となる2値処理を選択する。
【0143】
前述した前処理選択手段17によって選択されたノイズ除去処理が複数ある場合、2値化処理選択手段18は、それぞれのノイズ除去処理を実行して処理した原画像11に対して、複数の2値化処理を実行して、前述した一致度が最大となる1つの2値化処理を選択する。これによって、2値化処理選択手段18によって選択された2値化処理を実行して一致度が最大となるときに、この2値化処理を実行した第1処理画像を得るノイズ除去処理が、エキスパートシステムにおける処理手順を構成する処理とする。
【0144】
図形融合処理生成手段19は、前記複数の画像処理手段13の1つを構成する。図形融合処理生成手段19は、第2処理画像に複数の図形融合処理を実行し、前記複数の図形融合処理を実行して得られる画像のサンプル図形12に対応する領域とサンプル図形12との一致度を算出する。図形融合処理生成手段19は、前記一致度が、前記図形融合処理前の第2処理画像のサンプル図形12に対応する領域とサンプル図形12との一致度よりも大きくなる場合には、複数の図形融合処理の中から最も一致度が大きくなる図形融合処理を選択し、一致度が変わらない、または一致度が小さくなる場合には、図形融合処理を行わないことを選択する。
【0145】
まず図形融合処理生成手段19は、前処理選択手段17によって選択されたノイズ除去処理のうち、2値化処理選択手段18によって用いられた第1処理画像を原画像11から得ることができるノイズ除去処理と、2値化処理選択手段18によって選択された2値化処理とを実行して処理した複数の原画像11、つまり複数の第2処理画像に、それぞれ図形融合処理を行う。図形融合処理は、言い換えれば連結成分処理であって、雑音を除去する処理である。図形融合処理は、収縮処理および膨張処理の順番とその組合せによって定まる。まず、図形融合処理生成手段19は、複数の図形融合処理のすべてを実行して第2処理画像を処理する。
【0146】
本実施の形態では図形融合処理生成手段19は、図形融合処理として、たとえば「膨張処理→収縮処理」の膨張処理(1回〜2回)と収縮処理(1回〜5回)の組合せによる4つの処理を実行する。図形融合処理生成手段19は、第2処理画像に対して前記4つの処理を実行して得られる画像のサンプル図形12に対応する領域とサンプル図形12との一致度が、前記図形融合処理前の第2処理画像のサンプル図形12に対応する領域とサンプル図形12との一致度よりも大きくなる場合には、複数の図形融合処理の中から最も一致度が大きくなる図形融合処理を選択する。前記一致度は、上述した式(7)によって同様に求められる。
【0147】
図形融合処理生成手段19は、各第2処理画像に対して同じ図形融合処理を実行して得られる図形における一致度の平均を算出して、この算出された一致度が最大となる図形融合処理を選択する。
【0148】
また図形融合処理生成手段19は、前記4つの処理を実行して得られる画像のサンプル図形12に対応する領域とサンプル図形12との一致度が、前記図形融合処理前の第2処理画像のサンプル図形12に対応する領域とサンプル図形12との一致度よりも大きくなる場合に、図形融合処理を選択するのであり、前記4つの処理を実行して算出された一致度が同じ場合は、図形融合処理の処理回数が少ないものを選択する。これによって、構成される処理手順に従う処理を実行したときの計算量を低減することができ、処理時間を可及的に短くすることができる。
【0149】
フィルター処理生成手段20は、前記複数の画像処理手段13の1つを構成する。フィルター処理生成手段20は、原画像11に処理手順に従う複数の処理を実行して得られる画像から、この画像のサンプル図形12に対応する成分の特徴量よりも大きな特徴量および小さな特徴量を有する成分を除去するフィルター処理を生成する。原画像11に処理手順に従う複数の処理を実行して得られる画像とは、原画像11に上述した前処理選択手段17によって選択されたノイズ除去処理、2値化処理選択手段18によって選択された2値化処理、および図形融合処理生成手段19によって選択された図形融合処理を実行して得られる画像、または原画像11に上述した前処理選択手段17によって選択されたノイズ除去処理、2値化処理選択手段18によって選択された2値化処理を実行して得られる画像であり、以後、原画像11に処理手順に従う複数の処理を実行して得られる画像を対象画像と記載する場合がある。
【0150】
フィルター処理生成手段20の動作処理を概略的に述べる。フィルター処理生成手段20は、対象画像のサンプル図形12に対応する成分の最小特徴量および最大特徴量を算出し、また対象画像に含まれる各成分の特徴量を算出する。またフィルター処理生成手段20は、前記最小特徴量に予め定める定数を乗算した値を下限評価値とし、対象画像に含まれる成分のうち少なくとも1つの成分の特徴量が前記下限評価値よりも小さな場合に、前記下限評価値を下限しきい値として、この下限しきい値よりも小さな特徴量を有する成分を対象画像から除去するフィルター処理を生成する。
【0151】
またフィルター処理生成手段20は、前記最大特徴量に予め定める定数を乗算した値を上限評価値とし、対象画像に含まれる成分のうち少なくとも1つの成分の特徴量が前記上限評価値よりも大きな場合に、前記上限評価値を上限しきい値としてこの上限しきい値よりも大きな特徴量を有する成分を対象画像から除去するフィルター処理を生成する。
【0152】
図18は、フィルター処理生成手段20の動作処理を示すフローチャートである。ステップd0において、対象画像が入力されると、ステップd1に移る。ステップd1では、サンプル図形12のラベリング処理を行って、ステップd2に移る。サンプル図形12のラベリング処理とは、サンプル図形12においてつながっている成分、つまり連結成分に同じラベルを付し、1つの連結成分とは異なる連結成分には、異なるラベルを付すことである。前記ラベルは、たとえば番号である。
【0153】
ステップd2では、ステップd1でラベルを付したサンプル図形12の各ラベルの成分に対応する対象画像の連結成分の特徴量を算出して、ステップd3に移る。本実施の形態において、前記特徴量は、面積を表す画素数である。本実施の形態では、特徴量を画素数とするが、本発明の実施の他の形態では、前記特徴量は成分の周囲長などであってもよい。
【0154】
ステップd3では、エキスパートシステムに入力される複数の原画像11を処理して得られる全ての対象画像と、前記複数原画像11に対応する複数のサンプル図形12とについて、ステップd1およびステップd2の処理を行ったか否かを判断する。ステップd3で、エキスパートシステムに入力される複数の原画像11を処理して得られる全ての対象画像と、前記原画像11に対応するサンプル図形12とについて、ステップd1およびステップd2の処理を行ったと判断した場合には、ステップd4に移る。一方、ステップd3で、エキスパートシステムに入力される複数の原画像11を処理して得られる全ての対象画像と、前記複数の原画像11に対応する複数サンプル図形12とについて、ステップd1およびステップd2の処理を行っていないと判断した場合には、ステップd1に移る。
【0155】
ステップd4では、対象画像のサンプル図形12に対応する成分の最大特徴量および最小特徴量とを求め、下限評価値と上限評価値とを算出して、ステップd5に移る。ここではまず、各対象画像の各サンプル図形12に対応する成分の特徴量を算出し、この中から最大特徴量と最小特徴量とを算出する。最小特徴量および最大特徴量は、たとえば特徴量が面積を表す画素数であるとすると、最大面積を表す最大画素数および最小面積を表す最小画素数である。
【0156】
図19は、対象画像に含まれる成分の特徴量の分布の一例を示す図である。図19において、横軸は特徴量を表し、縦軸は成分の数を表す。つまり図19は、横軸に特徴量を取り、縦軸に成分の数を取る特徴量ヒストグラムを概略的に示す図である。図19では、対象画像のサンプル図形12に対応する成分の特徴量よりも小さな特徴量を有する成分および大きな特徴量を有する成分が対象画像に含まれている場合の特徴量の分布を示す。具体的には、対象画像のサンプル図形12に対応する成分の特徴量の分布41と、対象画像のサンプル図形12に対応する成分の特徴量よりも小さな特徴量を有する成分の特徴量の分布42と、対象画像のサンプルに対応する領域の特徴量よりも大きな特徴量を有する成分の特徴量の分布43とを示している。
【0157】
下限評価値は、最小特徴量に予め定める定数を乗算した値である。下限評価値をP1とし、対象画像のサンプル図形12に対応する領域の最小特徴量をSminとし、予め定める定数をβLとすると、下限評価値P1は、式(8)によって算出される。
P1=Smin×βL …(8)
【0158】
また上限評価値は、最大特徴量に予め定める定数を乗算した値である。上限評価値をP2とし、対象画像のサンプル図形12に対応する領域の最大特徴量をSmaxとし、予め定める定数をβHとすると、上限評価値P2は、式(9)によって算出される。
P2=Smax×βH …(9)
【0159】
式(8)のβLおよび式(9)のβHは、本件発明者の実験結果から、たとえばβL=1/5、βH=5とする。
【0160】
ステップd5では、複数の対象画像のうちで、1つの対象画像の全領域にラベリング処理を行って、ステップd6に移る。ラベリング処理は、上述したサンプル図形12のラベリング処理と同様な処理であり、対象画像の全領域の各連結成分にラベルを付す。
【0161】
ステップd6では、ステップd5においてラベリング処理された各ラベルに対応する成分の特徴量を算出して、ステップd7に移る。
【0162】
ステップd7では、ステップd6で算出された各ラベルに対応する成分の特徴量と、上述したステップd4において算出された下限評価値とを比較し、下限評価値よりも小さな特徴量があるか否かを判断する。ステップd7において下限評価値よりも小さな特徴量があると判断した場合、ステップd8に移る。下限評価値よりも小さな特徴量がある場合とは、対象画像が、図19に示す特徴量の分布42を含むような場合である。一方ステップd7において、下限評価値よりも小さな特徴量が無いと判断した場合、ステップd9に移る。
【0163】
ステップd8では、下限評価値を下限しきい値として設定し、ステップd9に移る。
【0164】
ステップd9では、ステップd6で算出された各ラベルの対応する成分の特徴量と、上述したステップd4において算出された上限評価値とを比較し、上限評価値よりも大きな特徴量があるか否かを判断する。ステップd9において上限評価値よりも大きな特徴量があると判断した場合、ステップd10に移る。上限評価値よりも大きな特徴量がある場合とは、対象画像が、図19に示す特徴量の分布43を含むような場合である。一方ステップd9において、上限評価値よりも大きな特徴量が無いと判断した場合、ステップd11に移る。
【0165】
ステップd10では、上限評価値を上限しきい値として設定し、ステップd11に移る。
【0166】
ステップd11では、全ての対象画像についてステップd5からステップd10の処理を行ったか否かを判断する。ステップd11で、全ての対象画像に対してステップd5からステップd10までの処理を行ったと判断した場合には、ステップd12に移る。一方、ステップd11で、全ての対象画像に対して、ステップd5からステップd10までの処理を行っていないと判断した場合には、ステップd5に戻り、全ての対象画像に対してステップd5からステップd10までの処理が終了するまで、ステップd5からステップd10までの動作を繰り返す。
【0167】
ステップd12では、下限しきい値または上限しきい値が設定されているか否かを判断する。ステップd12において、上限しきい値または下限しきい値が設定されていると判断した場合、ステップd13に移る。
【0168】
ステップd13では、フィルター処理有りの処理設定を行い、ステップd15に移り動作処理を終了する。つまりステップd13では、エキスパートシステムにおいてフィルター処理が含まれる処理手順を構成するために、フィルター処理を生成する。ステップd13では、下限しきい値が設定されている場合、前記下限しきい値よりも小さな特徴量を有する成分を除去するフィルター処理を生成する。また上限しきい値が設定されている場合、前記上限しきい値よりも大きな特徴量を有する成分を除去するフィルター処理を生成する。また下限しきい値および上限しきい値の両者が設定されている場合、前記下限しきい値よりも小さな特徴量を有する成分を除去するフィルター処理と前記上限しきい値よりも大きな特徴量を有する成分を除去するフィルター処理とを生成する。これによって、フィルター処理生成手段20によって生成されるフィルター処理を、原画像11からサンプル図形12に近い図形を抽出する処理手順に従う処理の1つとするときに、前記処理手順に従う処理に不必要なフィルター処理が含まれることがない。
【0169】
これによって、エキスパートシステムが構成する処理手順にフィルター処理を含むことができ、2値化処理の後、または図形融合処理の後に、フィルター処理を行う処理手順が構成することができる。
【0170】
一方、ステップd12において、上限しきい値または下限しきい値が設定されていないと判断した場合、ステップd14に移る。ステップd14では、フィルター処理無しの処理設定を行い、ステップd15に移り、動作処理を終了する。つまりステップd14では、フィルター処理を行わないように設定する。
【0171】
以上のように、フィルター処理生成手段20を設けることによって、対象画像におけるノイズ成分を識別して、このノイズ成分を除去することができるフィルター処理を生成することができる。このフィルター処理では、対象画像に含まれる成分のうち予め設定したしきい値を超える特徴量を有する成分がある場合には、拾いすぎ成分と判断して、前記成分を除去する。
【0172】
対象画像には、サンプル図形12に近い特徴量をもつ成分とともに、サンプル図形12よりも大きな特徴量をもつ成分およびサンプル図形12よりも小さな特徴量をもつ成分が含まれる場合がある。サンプル図形12よりも大きな特徴量および小さな特徴量をもつ成分とはノイズ成分であると考えられる。前述したフィルター処理生成手段20によって生成されたフィルター処理を実行して、処理手順に従って複数の処理を実行して得られる画像を処理すると、この画像に含まれる成分のうちサンプル図形12とは全く異なる特徴を有するノイズ成分を取り除くことができる。
【0173】
したがって、フィルター処理生成手段20によって生成されるフィルター処理を、原画像11からサンプル図形12に近い図形を抽出する処理手順に従う複数処理の1つとすることによって、より信頼性の高い図形を抽出する処理手順を構成することができる。
【0174】
また、対象画像に含まれるサンプル図形12に近い図形は、完全にサンプル図形12と一致しているとは限らない。フィルター処理生成手段20は、前述の最小特徴量Sminに予め定める定数βLを乗算した値とし、また前記上限評価値を前述の最大特徴量Smaxに予め定める定数βHを乗算した値とするので、サンプル図形12に近い図形を除去することなく、このサンプル図形12に近い図形を確実に原画像11から抽出するフィルター処理を生成することができる。
【0175】
またフィルター処理生成手段20は、前述したように、前記下限しきい値よりも小さな特徴量を有する成分を除去するフィルター処理を生成する、前記上限しきい値よりも大きな特徴量を有する成分を除去するフィルター処理を生成する、または前記下限しきい値よりも小さな特徴量を有する成分を除去するフィルター処理と前記上限しきい値よりも大きな特徴量を有する成分を除去するフィルター処理とを生成することができる。
【0176】
したがって、フィルター処理生成手段20によって生成されるフィルター処理を含んで処理手順を構成することによって、処理手順に従う処理を実行して原画像11を処理したときに、処理時間の延長を可及的に少なくし、かつノイズ成分の少ないサンプル図形12に近い図形を得ることができる。
【0177】
安定度検証手段21は、複数の原画像11の輝度が変化しても、前記画像処理手順設計手段25によって構成された処理手順に従う複数の処理を実行することによって、原画像11からサンプル図形12に近い図形を安定して抽出することができるか否かを示す安定度を出力する。
【0178】
安定度検証手段21は、前記処理手順に従う複数の処理を実行して得られる基処理画像51の抽出画素数と、前記処理手順に従う複数の処理のうち、予め定める処理を変更した変更処理手順に従う複数の処理を実行して得られる変更処理画像52の抽出画素数とを算出し、基処理画像51の抽出画素数と変更処理画像52の抽出画素数との比率から安定度を算出する。前記抽出画素数とは、基処理画像51および変更処理画像52の輝度が予め定めるしきい値以上の画素数または予め定めるしきい値未満の画素数である。
【0179】
基処理画像51は、前述した前処理選択手段17、2値化処理選択手段18、図形融合処理生成手段19およびフィルター処理生成手段20によって選択および生成された各処理を実行して得られる。
【0180】
変更処理画像52は、処理手順に従う複数の処理のうち、前記2値化処理選択手段18によって選択された2値化処理を、この2値化処理におけるしきい値を予め定める値だけ変更した2値化処理に代えて各処理を実行することによって、得られる。
【0181】
図20は、安定度検証手段21における処理手順を示すフローチャートである。また図21は、安定度検証手段21によって処理される原画像11と、基処理画像51および変更処理画像52とを示す図である。図21には、異なる2つの変更処理画像52aおよび52bを示す。以後、これらの変更処理画像52a,52bをまとめて変更処理画像52と記載する場合がある。またここでは、サンプル領域31の輝度の平均が近傍領域32の輝度の平均よりも高い場合について説明する。
【0182】
エキスパートシステムにおいて、複数の原画像11からサンプル図形12に近い図形を抽出する1つの処理手順が構成されると、ステップe0からステップe1に移る。ステップe1では、1つの原画像11に前記処理手順に従う処理を実行して得られる基処理画像51の総抽出画素数Area1iを求め、ステップ2に移る。ここで、基処理画像51の総抽出画素数Area1iとは、2値化処理においてしきい値以上を1とした場合には、画素値が1の画素数であり、2値化処理においてしきい値以下を1とした場合には、画素値が0の画素数である。また、基処理画像51の総抽出画素数を表すArea1iのiは、0からNまでのいずれか1つの値とする。前記Nは、エキスパートシステムに入力される原画像11の総数から1を減算した数である。前記しきい値は、たとえば基処理画像51のサンプル図形12に対応する領域の輝度値の平均値と、その近傍領域の輝度値の平均値との中間値に選ばれる。
【0183】
ステップe2では、上述した2値化処理選択手段18によって選択された2値化処理を、この2値化処理で用いられるしきい値を+γだけ変更した変更2値化処理に代えて、処理手順に従う処理を実行して得られる第1変更処理画像52の総抽出画素数Area2iと、2値化処理選択手段18によって選択された2値化処理を、この2値化処理で用いられるしきい値を−γだけ変更した変更2値化処理に代えて、処理手順に従う処理を実行して得られる第2変更処理画像52の総抽出画素数Area3iを求めて、ステップe3に移る。本件発明者の実験結果から、前述の値γは、しきい値×0.01〜しきい値×0.20の間に選ばれ、好ましくはしきい値×0.05に選ばれる。
【0184】
ステップe3では、しきい値を+γだけ変更した変更2値化処理を処理手順に従う複数の処理の1つとする場合の安定度と、しきい値を−γだけ変更した変更2値化処理を処理手順に従う複数の処理の1つとする場合の安定度を算出する。安定度は、前述したArea1iおよびArea2iの比率と、Area1iおよびArea3iと比率から算出される。安定度は、次式(10)および(11)によって算出される。ここで、P2iは、しきい値を+γだけ変更した変更2値化処理を処理手順に従う複数の処理の1つとする場合の安定度を示す。P3iは、しきい値を−γだけ変更した変更2値化処理を処理手順に従う複数の処理の1つとする場合の安定度を示す。
P2i=Area2i/Area1i×100% …(10)
P3i=Area3i/Area1i×100% …(11)
【0185】
次にステップe4に移り、ステップe4では、全ての原画像11を処理して安定度を算出したか否かを判断する。ステップe4で、全ての原画像11を処理して安定度を算出したと判断した場合は、ステップe5に移る。一方、ステップe4で、全ての原画像11を処理して安定度を求めていないと判断すると、ステップe1に移り、ステップe1からステップe3までの動作処理を繰り返す。
【0186】
ステップe5では、式(10)によって算出した安定度P2iのうち最小値と、式(11)によって算出した安定度P3iのうち最大値を求める。式(10)によって算出した安定度P2iのうち最小値をP2minとし、式(11)によって算出した安定度P3iのうち最大値をP3maxとする。
【0187】
次にステップe6に移り、ステップe5で算出したP2minおよびP3maxが、以下(12)の式を満たすか否かを判断する。
{P2min≧η1}&{P3max≦η2} …(12)
【0188】
式(12)において、η1は、安定基準下限値を示し、η2は、安定基準上限値を示す。本件発明者の実験結果から、安全基準下限値η1は、70〜100%の間に選ばれ、好ましくは、95%に選ばれる。安定基準上限値η2は、100〜130%の間に選ばれ、好ましくは105%に選ばれる。
【0189】
ステップe6において、式(12)を満たすと判断した場合には、ステップe7に移る。ステップe6において、式(12)を満たすと判断する場合には、たとえば図21に示す変更処理画像52bが得られる。
【0190】
一方ステップe6において、式(12)満たさないと判断した場合は、ステップe8に移る。ステップe6において、式(12)を満たさないと判断した場合には、たとえば図21に示す変更処理画像52aが得られる。
【0191】
ステップe7では、最小安定度P2minおよび最大安定度P3maxを出力するとともに、前記処理手順に従う複数の処理は、複数の原画像11の輝度の変化に対して安定であることを示す情報を出力して、ステップe9に移り、動作処理を終了する。
【0192】
ステップe8では、最小安定度P2minおよび最大安定度P3maxを出力するとともに、前記処理手順に従う複数の処理は、複数の原画像11の輝度の変化に対して不安定であることを示す情報を出力して、ステップe9に移り、動作処理を終了する。
【0193】
以上のように安定度検証手段21は、複数の原画像11の輝度が変化しても、処理手順に従う複数の処理を実行することによって原画像11からサンプル図形12に近い図形を安定して抽出することができるか否かを示す安定度を出力する。したがって、前記処理手順に従う複数の処理を実行して得られる画像が、輝度の変化に対して安定した処理手順に従う複数の処理によって得られる画像であるのか否かを知ることができる。また前記安定度の高い処理手順に従う複数の処理によって得られる画像であれば、この画像に不具合が生じている場合に、この不具合の原因が被写体にあることを限定することができる。
【0194】
また安定度検証手段21は、安定度を算出するために、原画像11とこの原画像11の輝度を変更した前記原画像11とは異なる原画像11とに、実際に処理手順に従う複数の処理を実行して得られる画像を比較するといった処理を行わない。したがって、1つの原画像11について、この原画像11の輝度を変更した複数の原画像11を入力する必要が無く、1つの原画像11から処理手順の安定度を容易に算出することができ、安定度算出の処理時間を可及的に短くすることができる。
【0195】
また安定度検証手段21は、2値化処理のしきい値を予め定める値だけ変更して変更処理手順を生成する。したがって、2値化処理のしきい値を変更するという極めて容易な処理によって、変更処理手順を作成することができ、安定度を効率よく算出することができる。
【0196】
電子カメラなどの撮像手段によって撮像される画像を原画像11として入力する場合、原画像11の輝度は、撮像手段が撮像する被写体を照らす照明によって決まる。照明は、時間によって微妙に変動することが知られている。このため、同じ被写体を撮像手段によって撮像する場合であっても、入力される原画像11の輝度が異なる場合がある。先行技術では、構成された処理手順に従う処理を実行して得られた画像に不具合が生じている場合、照明に原因があるのか、あるいは被写体に原因があるのか、いずれに問題があるのかを特定することが難しい。
【0197】
本発明では、安定度検証手段21によって出力される安定度が上述した式(12)を満たす場合、時間とともに微妙に変化する照明などの環境の変化に対して頑強であるので、照明などが変動してもサンプル図形12に対応する領域を安定して抽出できる。したがって、エキスパートシステムが抽出する処理手順の信頼性が保証され、エキスパートシステムを画像処理装置に組み込んで使用することができる。また、安定度検証手段21によって出力される安定度が上述した式(12)を満たす場合で、処理された画像に不具合がある場合、照明が原因でないので、原因の究明の対象を被写体に限定することができる。
【0198】
前述したエキスパートシステムによって構成された処理手順に従う複数の処理を実行して、原画像11と同様な画像を処理することによって、この画像からサンプル図形12に近い図形を抽出することができる。
【0199】
前述した本実施の形態のエキスパートシステムでは、複数の設計標本、つまり複数の原画像11および原画像11に対応するサンプル図形12から、処理手順を構成することによって、複数の原画像11およびそれに対応するサンプル図形12間の処理手順の変動が吸収され、より安定した処理手順を構成することができる。
【0200】
画像の全体的な輝度値レベルや抽出する対象の大きさなどの特徴が個々の原画像11およびそれに対応するサンプル図形12間で少しずつ異なっている場合、一組の原画像11およびサンプル図形12によって構成された処理手順は、他の原画像11に対しては良好に働かないことがある。これに対して、多数組の原画像11およびそれに対応するサンプル図形12を用いた手順構成では、それらの画像間の平均的な輝度値の変化や対象の大きさの変化などの影響を緩和することができるように、パラメータの値や処理の種類を組込むことができる。
【0201】
これによって、エキスパートシステムがユーザの意図をより正確に理解することができる。すなわちエキスパートシステムは、ユーザの処理の目的をより明確に把握することができ、その結果を処理手順の中に反映することができる。
【0202】
上述したエキスパートシステムでは、複数の原画像11を入力しているが、入力する原画像11は、1つであってもよい。
【0203】
本発明の実施の他の形態のエキスパートシステムでは、前述した実施の形態のエキスパートシステムにおいて、前処理選択手段17、2値化処理選択手段18、図形融合処理生成手段19における動作処理が異なり、他の構成は同様である。本実施の形態のエキスパートシステムは、入力する原画像11が1つである場合に特化した処理を行う。また、本実施の形態において、前記実施の形態のエキスパートシステムに対応する構成には、同一の符号を付す。
【0204】
図22は、本発明の他の実施の形態のエキスパートシステムにおける前処理選択手段17の動作処理を示すフローチャートである。図22に示す本実施の形態のエキスパートシステムにおける前処理選択手段17の動作処理は、基本的には図15に示す前述の実施の形態のエキスパートシステムにおける前処理選択手段17の動作処理からステップc6およびステップc12を除いて構成される。
【0205】
1組の設計標本が入力されると、ステップf0からステップf1に移る。ステップf1では、原画像11に複数のノイズ除去処理を実行して処理して、ステップf2に移る。ステップf2では、原画像11に対して全てのノイズ除去処理を実行して処理するときに、同時に各ノイズ除去処理による処理時間を算出する。
【0206】
前処理選択手段17は、実行可能な全てのノイズ除去処理を実行して、原画像11からノイズを除去する。前処理選択手段17には、ノイズ除去処理として複数の処理モジュールが用意されている。前記処理モジュールとは、移動平均処理およびメディアンフィルターなどである。本実施の形態では、たとえばノイズ除去処理としては、移動平均処理(1〜5回)およびメディアンフィルター(1〜5回)の2つの処理モジュールがあり、この場合、ステップf1では、合計10種類のノイズ除去処理を実行して、原画像11のノイズを除去する。
【0207】
ステップf2では、複数のノイズ除去処理のうち、1つのノイズ除去処理を実行して処理した原画像11のサンプル図形12に対応する領域の輝度を算出し、輝度分布を求めて、ステップf3に移る。以後、前記ノイズ除去処理後の原画像11を、第1処理画像と記載する場合がある。またノイズ除去処理後の原画像11において、サンプル図形12に対応する領域のことをサンプル領域と記載する場合がある。
【0208】
ステップf3では、ステップf2において輝度を算出した第1処理画像の、近傍領域の輝度を算出し、輝度分布を求めて、ステップf4に移る。
【0209】
ステップf4では、ステップf2で求めたサンプル領域の輝度分布、およびステップf3で求めた近傍領域の輝度分布から、サンプル領域の輝度分布とその近傍領域との輝度分布とに重なりがあるか否かを算出する。
【0210】
ステップf5では、全ての第1処理画像について、前記ステップf2〜ステップf4までの各処理を実行したか否かを判断する。ステップf4で、各第1処理画像について前記ステップf2〜ステップf4までの各処理を実行したと判断した場合、ステップf6に移る。一方、ステップf5で、全ての第1処理画像について、前記ステップf2〜ステップf4までの各処理を実行してはいないと判断した場合、ステップf2に移り、ステップf2およびステップf4における各処理を行っていない第1処理画像に対する処理を実行する。
【0211】
ステップf6では、ステップf4でサンプル領域の輝度分布と近傍領域の輝度分布とが重なるか否かを求めた結果を参照して、全てのノイズ除去処理のうち、サンプル領域の輝度分布と、近傍領域の輝度分布とが重ならないノイズ除去処理があるか否かを判断する。サンプル領域の輝度分布と近傍領域の輝度分布と重ならないノイズ除去処理を、重なり無のノイズ除去処理と記載する場合がある。ステップf6において、前記重なり無しのノイズ除去処理があると判断した場合には、ステップf7に移る。
【0212】
ステップf7では、重なり無のノイズ除去処理のうち最速処理、つまりノイズ除去処理を実行して処理する時間が最も短いノイズの除去処理を選択して、ステップf11に移り、フローを終了する。重なり無のノイズ除去処理によって原画像11を処理する場合、いずれのノイズ除去処理を実行しても、サンプル領域と近傍領域とを精度よく分離することができる。つまり、サンプル領域を精度よく抽出することができる。したがってこのような場合では、処理速度が最も速くなるノイズ除去処理を選択することによって、時間がかかるノイズ除去処理における処理時間を短くすることができる。
【0213】
一方、ステップf6において、前記重なり無しのノイズ除去処理がないと判断した場合には、ステップf8に移る。ステップf8では、複数のノイズ除去処理のうち1つのノイズ除去処理を実行して処理された原画像11の分離度を算出して、ステップf9に移る。
【0214】
ステップf9では、全ての第1処理画像について分離度の算出を行ったか否かを判断する。ここで、全ての第1処理画像について、分離度の算出を行ったと判断した場合、ステップf10に移る。一方、ステップf9で、全ての第1処理画像について、分離度の算出を行ってはいないと判断した場合、ステップf7に移り、分離度を算出していない第1処理画像の分離度を算出する。
【0215】
ステップf10では、ステップf8で算出した分離度に基づいて、各処理モジュールごとに、分離度が最も大きくなるノイズ除去処理を選択して、ステップf10に移り、動作処理を終了する。たとえばノイズ除去処理が、前述した移動平均処理およびメディアンフィルターからなる場合、移動平均処理を実行して処理された原画像11のうち分離度が最も大きくなるものをノイズ除去処理として選択し、メディアンフィルターを実行して処理された原画像11のうち最も分離度が大きくなるものをノイズ除去処理として選択する。
【0216】
ステップf10では、各処理モジュールごとに、分離度が最も大きくなるノイズ除去処理を選択するので、前処理選択手段17によって選択されたノイズ除去処理を実行した原画像を用いて、後述する2値化処理選択手段18が2値化処理を選択することによって、生成された処理手順の精度を向上させることができる。
【0217】
このように前処理選択手段17は、ノイズ除去処理を実行して処理された原画像11のサンプル図形に対応する領域の輝度分布と、その近傍領域との輝度分布とに基づいて、処理速度を優先する、または分離度を優先するノイズ除去処理を選択することができ、精度を落とさずに、処理時間の短い処理手順を構成することができる。これによってエキスパートシステムにおいて、ノイズを除去するノイズ除去処理の処理速度を調整して処理手順を構成することができ、処理手順の生成後に、ノイズ除去処理の処理速度の調整をできるだけ少なくすることができる。
【0218】
本実施の形態では、ステップf2でサンプル領域の輝度分布を算出した後、ステップf3で近傍領域の輝度分布を算出しているが、本発明の実施のさらに他の形態において、前記ステップf2とステップf3とは、順序が逆になってもよい。
【0219】
また本実施の形態では、ステップf10で、各処理モジュールごとに、分離度が最も大きくなるノイズ除去処理を選択しているが、本発明の他の実施の形態では、分離度が最も大きくなるノイズ除去処理を1つ選択してもよい。この場合、後述する2値化処理選択手段18における処理時間を短縮することができる。
【0220】
本実施の形態の2処理処理選択手段18は、前処理選択手段17によって選択されたノイズ除去処理を実行して処理した原画像11、つまり第1処理画像を2値化するためのしきい値を、段階的に代えて2値化処理を実行する。2値化処理選択手段18は、前述した第2処理画像とサンプル図形12との一致度が最大と成るようなしきい値を決定し、これをしきい値とする2値化処理を選択する。前記一致度が最大となるしきい値が多数存在する場合には、同じ一致度となるしきい値の範囲を求め、この範囲の中央値をしきい値とする。
【0221】
前処理選択手段17によって選択されたノイズ除去処理が複数ある場合、2値化処理選択手段18は、それぞれのノイズ除去処理を実行して処理した原画像11に対して、複数の2値化処理を実行して、前述した一致度が最大となる1つの2値化処理を選択する。これによって、2値化処理選択手段18によって選択された2値化処理を実行して一致度が最大となるときに、この2値化処理する前の第1処理画像を得るノイズ除去処理が、エキスパートシステムにおける処理手順の1つとなる。
【0222】
図形融合処理生成手段19は、第2処理画像に複数の図形融合処理を実行し、前記複数の図形融合処理を実行して得られ画像のサンプル図形に対応する領域とサンプル図形12との一致度を算出する。図形融合処理生成手段19は、前記一致度が、前記図形融合処理前の第2処理画像のサンプル図形12に対応する領域とサンプル図形12との一致度よりも大きくなる場合には、複数の図形融合処理の中から最も一致度が大きくなる図形融合処理を選択し、一致度が変わらない、または一致度が小さくなる場合には、図形融合処理を行わないことを選択する。
【0223】
まず図形融合処理生成手段19は、前処理選択手段17によって選択されたノイズ除去処理のうち、2値化処理選択手段18によって用いられた第1処理画像を原画像11から得ることができるノイズ除去処理と、2値化処理選択手段18によって選択された2値化処理とを実行して処理した1つの原画像11、つまり1つの第2処理画像に、それぞれ図形融合処理を行う。図形融合処理生成手段19は、複数の図形融合処理のすべてを実行して第2処理画像を処理する。
【0224】
本実施の形態では図形融合処理生成手段19は、図形融合処理として、たとえば「膨張処理→収縮処理」の膨張処理(1回〜2回)と収縮処理(1回〜2回)の組合せによる4つの処理を実行する。図形融合処理生成手段19は、第2処理画像に前記4つの処理を実行して得られる画像のサンプル図形12に対応する領域とサンプル図形12との一致度が、前記図形融合処理前の第2処理画像のサンプル図形12に対応する領域とサンプル図形12との一致度よりも大きくなる場合には、複数の図形融合処理の中から最も一致度が大きくなる図形融合処理を選択する。前記一致度は、上述した式(7)によって同様に求められる。
【0225】
また、図形融合処理生成手段19は、前記4つの処理を実行して得られる画像のサンプル図形12に対応する領域とサンプル図形12との一致度が、前記図形融合処理前の第2処理画像のサンプル図形12に対応する領域とサンプル図形12との一致度よりも大きくなる場合に、図形融合処理を選択するのであり、前記4つの処理を実行して算出された一致度が同じ場合は、図形融合処理の処理回数が少ないものを選択する。これによって、構成される処理手順に従う処理を実行したときの計算量を低減することができ、処理時間を可及的に短くすることができる。
【0226】
本実施の形態のエキスパートシステムでは、図1に示す前述の実施の形態のエキスパートシステムよりも動作処理が少ないので、1組の設計標本から処理手順をより短時間で構成することができる。
【0227】
本実施の形態のエキスパートシステムは、コンピュータによって実行可能なプログラムによって実現されるので、前記プログラムをコンピュータによって実行させることによって、コンピュータは、前述の各フローチャートに従って動作し、前述のような作用を達成することができる。またこのような処理を、短時間で行うことができる。
【0228】
また本発明の実施の他の形態のエキスパートシステムは、前記プログラムを記録した記録媒体によって実現されてもよい。前記記録媒体に記録されたプログラムを、コンピュータに読取らせて実行させることによって、前述の各フローチャートに従って動作し、前述のような作用を達成することができる。また、前述した処理を短時間で行うことができる。また記録媒体を介して、複数のコンピュータにプログラムを容易に供給することができるので、本発明の利用範囲が拡大する。
【0229】
上述した各実施の形態では、エキスパートシステムにサンプル図形12を作成するための情報を入力することによって、サンプル作成手段14によってサンプル図形12を作成しているが、本発明の実施の他の形態において、エキスパートシステムにサンプル作成手段14を設けないで、図3に示すようなサンプル図形12を別途に作成して、このサンプル図形12そのものを入力してもよい。
【0230】
【発明の効果】
本発明によれば、不感帯領域を作成することによって、サンプル図形が原画像から抽出したい領域の画像と同一でなく、この原画像から抽出したい領域の画像よりも多少大きくなる場合、または小さくなる場合であっても、画像処理エキスパートシステムにおいて構成される処理手順が、サンプル図形が抽出したい領域の画像と同一である場合に構成される処理手順と等しくなる。
また、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成する手段を備えることで、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が大きくなり過ぎるのを防ぎ、原画像から精度の良くサンプル図形に近い図形を抽出する処理手順を構成することができる。
【0231】
したがって、原画像から抽出したい領域の画像にあわせて、たとえば1画素単位で正確にサンプル図形を作成できない場合であっても、原画像から抽出したい領域にあわせて1画素単位で正確にサンプル図形を作成した場合と同様の評価の結果を得ることができ、処理手順を正しく評価することができる。言い換えるとサンプル図形の精度が多少粗い場合であっても、手順を正しく評価することができる。このため処理手順の構成に対する安定性を向上することができ、エキスパートシステムの評価精度を落とさず、より信頼性の高い図形を抽出する処理手順を構成することができる。これによって、画像処理手順設計エキスパートシステムを画像処理装置に組込むことが可能になる。
【0233】
また本発明によれば、不感帯領域作成手段は、サンプル図形および近傍領域の輝度分布が重なる場合には、輝度分布の重なる領域を除いて近傍領域を作成する。これによって、原画像のサンプル図形に対応する領域とその近傍領域との輝度差を大きくすることができる。したがって、原画像からサンプル図形に近い図形を抽出するための処理手順を構成するときに、原画像のサンプル図形に対応する領域とその近傍領域とを分離しやすくなるので、より信頼性の高い図形を抽出する処理手順を構成することができる。また、原画像のサンプル図形に対応する領域を除いて近傍領域を作成することによって、処理手順を構成する際の計算処理を低減することができ、処理手順を構成する時間を低減することができる。
【0234】
また本発明によれば、原画像のサンプル図形に対応する領域の周囲に近傍領域を作成する。また不感帯領域作成手段は、原画像のサンプル図形に対応する領域と前記近傍領域との境界部よりも外側および外側のうちの少なくともいずれか一方に、処理対象から除外される不感帯領域を作成する。
【0235】
不感帯領域を作成することによって、サンプル図形が原画像から抽出したい領域の画像と同一でなく、この原画像から抽出したい領域の画像よりも多少大きくなる場合または小さくなる場合であっても、画像処理手順設計エキスパートシステムにおいて構成される処理手順が、サンプル図形が抽出したい領域の画像と同一である場合に構成される処理手順と等しくなる。
また、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成することで、不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が大きくなり過ぎるのを防ぎ、原画像から精度の良くサンプル図形に近い図形を抽出する処理手順を構成することができる。
【0236】
したがって、原画像から抽出したい領域の画像にあわせて、たとえば1画素単位で正確にサンプル図形を作成できない場合であっても、原画像から抽出したい領域にあわせて1画素単位で正確にサンプル図形を作成した場合と同様の評価の結果を得ることができ、処理手順を正しく評価することができる。言い換えるとサンプル図形の精度が多少粗い場合であっても、手順を正しく評価することができる。このため処理手順の構成に対する安定性を向上することができ、画像処理手順設計エキスパートシステムの評価精度を落とさず、より信頼性の高い図形を抽出する処理手順を構成することができる。
【0237】
また本発明によれば、前記プログラムをコンピュータによって実行させることによって、コンピュータは、前述の評価処理方法に従って動作し、前述のような作用を達成することができる。また前記評価処理方法を、短時間で行うことができる。
【0238】
また本発明によれば、前記記録媒体に記録されたプログラムを、コンピュータに読取らせて実行させることによって、コンピュータを、前述の評価処理方法に従って動作させることができる。また前記評価処理方法を、短時間で行うことができる。また記録媒体を介して、複数のコンピュータにプログラムを容易に供給することができるので、本発明の利用範囲が拡大する。
【図面の簡単な説明】
【図1】本発明の実施の一形態の評価処理に特長をもつ画像処理手順設計エキスパートシステムのアルゴリズムを概略的に示す図である。
【図2】エキスパートシステムの基本的な構成を示す機能ブロック図である。
【図3】サンプル作成手段14によるサンプル26の作成を説明するための図である。
【図4】対象領域27の近傍輪郭線の一例を示す図である。
【図5】対象領域27の近傍輪郭線の他の例を示す図である。
【図6】サンプル作成手段14の動作処理を説明するためのフローチャートである。
【図7】不感帯作成手段14によって原画像11のサンプル図形12に対応する領域21の周囲に作成される近傍領域32および不感帯領域33を示す図である。
【図8】近傍領域32および不感帯領域33を説明する図である。
【図9】不感帯領域作成手段15の動作処理を示すフローチャートである。
【図10】不感帯領域作成手段15によって作成された、サンプル領域31の輝度分布31aおよび近傍領域32の輝度分布32aとの一例を示す図である。
【図11】サンプル領域31の輝度分布32aと重なっている領域を除いて、近傍領域32を作成したときの、サンプル領域31の輝度分布31aおよび近傍領域32の輝度分布32bとの一例を示す図である。
【図12】サンプル領域31の輝度分布31aおよび背景領域の輝度分布37aを示す図である。
【図13】サンプル領域31の輝度分布31aおよび背景領域の輝度分布37aを示す図である。
【図14】輝度変換判定手段16の動作処理を示すフローチャートである。
【図15】前処理選択手段17の動作処理を示すフローチャートである。
【図16】第1サンプル領域の輝度分布38および第1近傍領域の輝度分布39との一例を示す図である。
【図17】第1サンプル領域の輝度分布38および第1近傍領域の輝度分布39との一例を示す図である。
【図18】フィルター処理生成手段20の動作処理を示すフローチャートである。
【図19】対象画像に含まれる成分の特徴量の分布の一例を示す図である。
【図20】安定度検証手段21における処理手順を示すフローチャートである。
【図21】安定度検証手段21によって処理される原画像11と、基処理画像51および変更処理画像52とを示す図である。
【図22】本発明の他の実施の形態のエキスパートシステムにおける前処理選択手段17の動作処理を示すフローチャートである。
【図23】先行技術の画像処理手順設計エキスパートシステムのアルゴリズムを概略的に示す図である。
【図24】原画像11のサンプル図形12に対応する領域の周囲に作成される近傍領域8を概略的に示す図である。
【符号の説明】
11 原画像
12 サンプル図形
13 画像処理手段
15 不感帯領域作成手段
31 サンプル領域
32 近傍領域
33 不感帯領域
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing procedure design expert system that configures one processing procedure by combining a plurality of image processing algorithms. More specifically, the evaluation processing for evaluating a processing procedure is reflected in the stability of the configuration of the processing procedure. The present invention relates to an image processing procedure design expert system characterized by an evaluation process that can constitute a processing procedure for extracting a more reliable figure.
[0002]
[Prior art]
When automating the appearance inspection of an industrial product using a camera, the quality is determined based on the result of processing a captured image by a computer. The image processing used in such a case needs to be used as one processing procedure by combining a plurality of image processing algorithms. However, since it is necessary for an expert to design carefully by repeating trial and error according to the object to be processed and inspection items, it is not easy for anyone to create a procedure. In order to solve this problem and enable anyone to easily design a processing procedure, an image processing procedure design expert system for supporting the design of the processing procedure is being developed.
[0003]
FIG. 23 is a diagram schematically showing an algorithm of a prior art image processing procedure design expert system. Hereinafter, the image processing procedure design expert system is simply referred to as an expert system. The expert system receives a plurality of original images 1 and a plurality of sample figures 2 corresponding to the respective original images 1, and performs preprocessing means 3 for performing preprocessing such as smoothing processing and difference processing on the original image 1, A binarization processing unit 4 for binarizing the original image 1 preprocessed by the preprocessing unit 3 and a process for removing noise or eliminating the unevenness of the original image 1 binarized by the binarization processing unit 4 Graphic fusion processing means 5 for performing
[0004]
In the expert system, the original image 1 and the sample graphic 2 corresponding to the original image 1 are input, and the configuration of the procedure for extracting the graphic corresponding to the sample graphic 2 from the original image 1 is executed. In the expert system, based on the density value information on the original image 1 corresponding to the sample graphic 2, the preprocessing means 3, the binarization processing means 4, and the graphic fusion processing means 5 perform specific processing considered to be optimal. decide.
[0005]
As described above, in the prior art expert system, the feature of the image to be extracted from the original image 1 is transmitted to the computer by the sample graphic 2 which is not the word but directly the shape of the image, so that the original image 1 becomes the sample graphic 2 A processing procedure for extracting close figures is automatically configured (see, for example, Non-Patent Documents 1 to 4).
[0006]
[Non-Patent Document 1]
Junichi Hasegawa, Hiroaki Kubota, Junichiro Toriwaki, “Image processing expert system IMPRESS with sample graphic presentation method”, IEICE Transactions (D), November 1987, Vol. J70-D, no. 11, pp. 2147-2153
[Non-Patent Document 2]
Junichi Hasegawa, Hiroaki Kubota, Akihide Takasu, Junichiro Toriwaki, “About the Image Processing Procedure Integration Function in the Image Processing Expert System IMPRESS”, IPSJ Transactions, February 1988, Vol. 29, No. 2 Pp. 126-133
[Non-Patent Document 3]
Akihide Takasu, Junichi Hasegawa, Junichiro Toriwaki, “Automatic configuration method of surface figure extraction procedure by sample figure presentation method”, IPSJ Journal, Vol. 29, No. 2, reprint, pp . 134-141
[Non-Patent Document 4]
Toshihiro Hamada, Akinobu Shimizu, Junichi Hasegawa, Junichiro Toriwaki, “Sequential Aggregation Method of Image Processing Procedures in Vision Expert System IMPRESS and its Performance Evaluation”, IEICE Transactions (D-II), November 1999, Vol. . J82-D-II, no. 11, pp. 1982-1989
[0007]
[Problems to be solved by the invention]
In such an expert system, as a scale for evaluating the quality of the configured specific processing procedure and the final processing procedure, the brightness difference between the image of the region to be extracted from the original image 1 and its neighboring region is used. The expert system determines the quality of the procedure using the luminance difference between the image of the area to be extracted from the original image 1 and its neighboring area, and creates a neighboring area around the sample figure 2 in order to construct the processing procedure. Is done.
[0008]
FIG. 24 is a diagram schematically showing the neighboring area 8 created around the area corresponding to the sample graphic 2 of the original image 1. The neighboring area 8 is formed adjacent to the periphery of the area 7 corresponding to the sample figure 2 of the original image 1. Accordingly, the evaluation result of the processing procedure differs between the case where the sample graphic 2 does not accurately represent the image of the region desired to be extracted and the case where the sample graphic 2 accurately represents the image of the region desired to be extracted. That is, unless the sample figure 2 is created with high accuracy so as to match the image of the region to be extracted, the processing procedure cannot be evaluated correctly.
[0009]
Thus, in the prior art expert system, the accuracy of the sample figure 2 is directly linked to the procedure evaluation. Therefore, it is necessary to create the sample figure 2 with high accuracy, and much labor and time are required to create the sample figure 2. For this reason, it has not yet been incorporated into an actual image processing apparatus, and has not been put into practical use. In addition, there are products that can graphically combine image processing algorithms in recent years, but it does not support finding the optimal combination of processing procedures, so the situation that forces users to repeat trial and error is No improvement has been made.
[0010]
The object of the present invention is that the evaluation result of the processing procedure does not differ even when the sample figure is not exactly the same as the image of the region to be extracted of the original image and is slightly larger or smaller than the image and the contour line. Another object of the present invention is to provide an image processing procedure design expert system characterized by evaluation processing that can improve the stability of the processing procedure configuration.
[0011]
[Means for Solving the Problems]
  The present invention is an image processing procedure design expert system that constitutes a processing procedure in which an original image and a sample graphic corresponding to the original image are input and a plurality of image processing means are combined to extract a graphic close to the sample graphic from the original image. There,
  Create a neighboring area around the area corresponding to the sample figure of the original image, and process the area corresponding to the sample figure of the original image and at least one of the outside and the inside of the boundary between the neighboring areas Includes dead zone creation means to create dead zone excluded from the target.See
  The dead zone region creating means includes means for creating the dead zone region again when the ratio of the dead zone region to the region corresponding to the sample figure of the original image or the neighboring region exceeds a predetermined rate.It is an image processing procedure design expert system characterized by evaluation processing characterized by
[0012]
According to the present invention, the dead zone creation means creates a neighborhood area around the area corresponding to the sample graphic of the original image. The dead zone creation means creates a dead zone that is excluded from the processing target on at least one of the outer side and the outer side of the boundary between the region corresponding to the sample graphic of the original image and the neighboring region.
[0013]
For example, when an image captured by an imaging unit such as an electronic camera is input as an original image, a luminance gradient is generated between regions having different luminances in the original image. In the region where the luminance gradient occurs, the luminance value becomes unstable. The sample figure corresponds to the image of the region to be extracted from the original image, and includes a portion where the luminance value is unstable because the contour is between the above-described regions having different luminances. Therefore, if the sample figure is not exactly matched to the region to be extracted from the original image, the processing procedure constituted by the image processing procedure design expert system will be different. Therefore, the procedure cannot be correctly evaluated.
[0014]
  By creating a dead zone region, image processing is possible even if the sample figure is not the same as the image of the region that you want to extract from the original image and is slightly larger or smaller than the image of the region that you want to extract from this original image. The processing procedure configured in the procedure design expert system is equal to the processing procedure configured when the sample graphic is the same as the image of the region to be extracted.
  In addition, when the ratio of the dead zone area to the area corresponding to the sample figure of the original image or the neighboring area exceeds a predetermined ratio, the dead zone area is provided with means for re-creating the dead zone area so that the dead zone area is a sample figure of the original image. Therefore, it is possible to prevent the ratio of the area corresponding to or near the area from becoming too large, and to configure a processing procedure for extracting a figure close to the sample figure with high accuracy from the original image.
[0015]
Therefore, even if it is not possible to accurately create a sample figure in units of one pixel in accordance with the image of the area desired to be extracted from the original image, for example, the sample figure can be accurately designated in units of one pixel in accordance with the area to be extracted from the original image The result of evaluation similar to the case of creating can be obtained, and the processing procedure can be correctly evaluated. In other words, the procedure can be correctly evaluated even if the accuracy of the sample figure is somewhat rough. For this reason, the stability with respect to the structure of a processing procedure can be improved, and the processing procedure which extracts a more reliable figure can be comprised, without reducing the evaluation precision of an expert system.
[0018]
  The present invention also providesAn image processing procedure design expert system that constitutes a processing procedure in which an original image and a sample graphic corresponding to the original image are input and a plurality of image processing means are combined to extract a graphic close to the sample graphic from the original image,
  Create a neighboring area around the area corresponding to the sample figure of the original image, and process the area corresponding to the sample figure of the original image and at least one of the outside and the inside of the boundary between the neighboring areas A dead zone region creating means for creating a dead zone region excluded from the target,
  The dead zone region creating means creates an adjacent region excluding the overlapping region of the luminance distribution when the luminance distribution of the region corresponding to the sample figure of the original image and its neighboring region overlap. This is an image processing procedure design expert system.
[0019]
According to the present invention, when the area corresponding to the sample graphic of the original image and the luminance distribution of the neighboring area overlap, the dead zone area creating means creates a neighboring area excluding the overlapping area of the luminance distribution. As a result, the luminance difference between the area corresponding to the sample graphic of the original image and its neighboring area can be increased. Therefore, when constructing a processing procedure for extracting a graphic close to the sample graphic from the original image, it becomes easier to separate the area corresponding to the sample graphic of the original image and its neighboring area, so a more reliable image Can be configured. In addition, by creating a neighboring region excluding the region corresponding to the sample figure of the original image, it is possible to reduce the calculation processing when configuring the processing procedure, and to reduce the time for configuring the processing procedure. .
[0020]
  The present invention also provides an image processing procedure design expert system configured to input a source graphic and a sample graphic corresponding to the original image, and combine a plurality of image processing means to extract a graphic close to the sample graphic from the original image. The evaluation processing method of
  Create a neighboring area around the area corresponding to the sample figure of the original image, and process the area corresponding to the sample figure of the original image and at least one of the outside and the inside of the boundary between the neighboring areas Create dead zone area to be excludedAnd
  It has a feature in an evaluation process characterized in that when the ratio of the dead zone area to the area corresponding to the sample figure of the original image or the neighboring area exceeds a predetermined ratio, the dead zone area is created again.This is a processing method of an image processing procedure design expert system.
[0021]
  According to the present invention, the neighborhood region is created around the region corresponding to the sample graphic of the original image. The dead zone creation means creates a dead zone that is excluded from the processing target at least one of the outer side and the outer side of the boundary between the region corresponding to the sample graphic of the original image and the neighboring region.If the ratio of the dead zone area to the area corresponding to the sample figure of the original image or the neighboring area exceeds a predetermined ratio, the dead zone area is created again.To do.
[0022]
By creating a dead zone region, image processing is possible even if the sample figure is not the same as the image of the region that you want to extract from the original image and is slightly larger or smaller than the image of the region that you want to extract from this original image. The processing procedure configured in the procedure design expert system is equal to the processing procedure configured when the sample graphic is the same as the image of the region to be extracted.
[0023]
  Therefore, even if it is not possible to accurately create a sample figure in units of one pixel in accordance with the image of the area desired to be extracted from the original image, for example, the sample figure can be accurately designated in units of one pixel in accordance with the area to be extracted from the original image The result of evaluation similar to the case of creating can be obtained, and the processing procedure can be correctly evaluated. In other words, the procedure can be correctly evaluated even if the accuracy of the sample figure is somewhat rough. Therefore, it is possible to improve the stability with respect to the configuration of the processing procedure, and it is possible to configure a processing procedure for generating a more reliable image without degrading the evaluation accuracy of the image processing procedure design expert system.
  Further, when the ratio of the dead zone area to the area corresponding to the sample figure of the original image or the neighboring area exceeds a predetermined ratio, the dead zone area corresponds to the sample figure of the original image by creating the dead zone area again. It is possible to prevent the proportion of the area or the neighboring area from becoming too large, and to configure a processing procedure for extracting a figure close to the sample figure from the original image with high accuracy.
[0024]
Further, the present invention is a program for causing a computer to execute the evaluation processing method of the image processing procedure design expert system.
[0025]
According to the present invention, by causing the computer to execute the program, the computer operates according to the evaluation processing method of the image processing procedure design expert system described above, and can achieve the above-described operation. Moreover, the said evaluation processing method can be performed in a short time.
[0026]
Further, the present invention is a recording medium on which a program for causing a computer to execute the evaluation processing method of the image processing procedure design expert system is recorded.
[0027]
According to the present invention, the computer can be operated according to the evaluation processing method of the above-described image processing procedure design expert system by causing the computer to read and execute the program recorded on the recording medium. Moreover, the said evaluation processing method can be performed in a short time. In addition, since the program can be easily supplied to a plurality of computers via the recording medium, the scope of use of the present invention is expanded.
[0028]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a diagram schematically showing an algorithm of an image processing procedure design expert system characterized by evaluation processing according to an embodiment of the present invention. Hereinafter, an image processing procedure design expert system having features in evaluation processing is simply referred to as an expert system. The expert system of this embodiment is realized by a program that can be executed by a computer. The program is stored in a memory of a computer and executed by a central processing unit (abbreviated as CPU).
[0029]
The expert system inputs an original image 11 and a sample graphic 12 corresponding to the original image 11, and combines a plurality of image processing means 13 to constitute a processing procedure for extracting a graphic close to the sample graphic 12 from the original image 11. . In the present embodiment, inputting the sample graphic 12 to the expert system means inputting information for creating the sample graphic 12. The expert system creates a sample figure 12 corresponding to each original image 11 based on the plurality of original images 11 and information for creating the sample figure 12, and creates each original image 11 and each sample figure 12. One processing procedure is configured based on this.
[0030]
In the present embodiment, the original image 11 is, for example, a large scale integrated circuit (abbreviated as LSI) package and a chest X-ray image captured by a charge coupled device (abbreviated as CCD) camera. The original image 11 is represented by, for example, a luminance of 256 gradations.
[0031]
In the present embodiment, the sample figure 12 is equal to an image obtained by binarizing an image of a region to be extracted from the original image 11 or a part of this image. Hereinafter, a set of the original image 11 and the sample figure 12 may be described as a design specimen. In the present embodiment, the sample figure 12 will be described as being equivalent to a figure obtained by binarizing an image of an area desired to be extracted in the original image 11.
[0032]
The expert system includes a sample creation unit 14, a dead zone creation unit 15, a luminance conversion determination unit 16, a preprocessing selection unit 17, a binarization processing selection unit 18, a figure fusion processing generation unit 19, and a filter process. A generation unit 20 and a stability verification unit 21 are included. The processing procedure is as follows: luminance conversion processing based on the determination result 40 by the luminance value conversion means 16, preprocessing selection means 17, binarization processing selection means 18, figure fusion processing generation means 19, and filter processing generation means 20. The processes to be selected or generated are arranged in order. The luminance conversion determination unit 16, the preprocessing selection unit 17, the binarization processing selection unit 18, the figure fusion processing generation unit 19, and the filter processing generation unit 20 are the image processing unit 13, respectively.
[0033]
FIG. 2 is a functional block diagram showing a basic configuration of the expert system. The expert system includes an area designation information input unit 23, a sample creation unit 14, a correction information input unit 24, an image processing procedure design unit 25, and a stability verification unit 21.
[0034]
The area designation information input means 23 inputs area designation information for designating a predetermined target area 27 among all areas of the original image 11 to the sample creation means 14. The sample creation means 14 extracts the sample graphic 12 from the target area 27 designated by the area designation information input from the area designation information input means 23 and creates a sample 26 including the sample graphic 12. The information for creating the sample graphic 12 includes at least area designation information.
[0035]
The sample creation means 14 binarizes the target area 27 based on the threshold value thd of luminance determined for the target area 27. The luminance threshold thd is determined by, for example, a discriminant analysis method. Hereinafter, a graphic extracted by binarizing the target area 27 may be referred to as an extracted graphic. When the extracted graphic as extracted by the operator is extracted by the binarization process, the extracted graphic is the sample graphic 12.
[0036]
The correction information input unit 24 inputs correction information to the sample creation unit 14. The correction information includes correction information and removal information. The correction information is information for correcting the shape of the extracted graphic when the shape of the extracted graphic is different from the expectation of the operator. The removal information is information for removing unnecessary extracted figures when a plurality of extracted figures are extracted by the binarization.
[0037]
The sample creation unit 14 corrects the extracted figure based on the correction information input from the correction information input unit 24. When the extracted graphic extracted by the binarization process is different from the operator's expectation, the corrected extracted graphic is the sample graphic 12. As a result, the sample graphic 12 as expected by the operator is obtained.
[0038]
FIG. 3 is a diagram for explaining the creation of the sample 26 including the sample graphic 12 by the sample creation means 14, FIG. 3 (a) shows a state in which the target area 27 is designated, and FIG. 3 (b) The state where the sample figure 12 is extracted is shown. FIG. 4 is a diagram illustrating an example of the vicinity contour line of the target region 27. FIG. 5 is a diagram illustrating another example of the vicinity contour line of the target region 27.
[0039]
First, for example, on the display screen of a computer, a portion 28 to be extracted as the sample graphic 12 in the original image 11 is surrounded as shown in FIG. The portion 28 to be extracted as the sample graphic 12 is indicated by hatching in FIG. The operator determines which part of the original image 11 is the portion 28 to be extracted as the sample graphic 12.
[0040]
A curve 29 surrounding the portion 28 to be extracted as the sample graphic 12 is indicated by a virtual line in FIG. The curve 29 is designated by the operator operating, for example, a touch pen. By specifying the curve 29 in this way, the target area 27 is specified. In the present embodiment, the information regarding the curve 29 is area designation information. Further, in the present embodiment, among the entire area of the original image 11, an area composed of pixels on the curve 29 and pixels on the inner side of the curve 29 is the target area 27.
[0041]
When the target area 27 is designated, a luminance threshold thd is determined for the target area 27. Whether the portion consisting of pixels having a luminance value equal to or greater than the threshold value thd of the luminance is used as the extracted graphic or whether the portion including pixels having the luminance value equal to or lower than the threshold value thd of the luminance is used as the extracted graphic This is determined by the relationship between the average value Av of the luminance values on the neighboring outline of the region 27 and the threshold value thd of the luminance.
[0042]
In the present embodiment, the neighborhood contour line of the target region 27 is a portion 27a indicated by a halftone dot in FIG. Therefore, the average value Av of the luminance values on the neighboring contour line of the target region 27 is the average value of the luminance values of the pixels on the eight connected contour lines of the target region 27. In another embodiment of the present invention, the vicinity contour line of the target region 27 is a portion 27b indicated by a halftone dot in FIG. Therefore, in this embodiment, the average value Av of the luminance values on the neighboring contour line of the target area 27 is the average value of the luminance values of the pixels on the four connected contour lines of the target area 27.
[0043]
When the relationship between the average value Av of the luminance values and the threshold value thd of luminance is Av> thd, a portion composed of pixels having luminance values equal to or lower than the threshold value thd of luminance is set as the extracted figure. That is, the luminance value of a portion made up of pixels having a luminance value equal to or lower than the luminance threshold thd in the target area 27 is set to 1, and the luminance value equal to or lower than the luminance threshold thd in the target area 27 is set. The luminance value of the remaining part excluding the part composed of the pixels having 0 is set to 0. Further, the luminance value of the remaining part of the original image 11 excluding the target area 27 is set to 0. When the relationship between the average value Av of the brightness values and the threshold value thd of brightness is Av ≦ thd, a portion composed of pixels having a brightness value equal to or higher than the brightness threshold value thd is set as an extracted figure. That is, a luminance value of a portion made up of pixels having a luminance value equal to or higher than the luminance threshold thd in the target area 27 is set to 1, and a luminance value equal to or higher than the luminance threshold thd in the target area 27 is set. The luminance value of the remaining part excluding the part composed of the pixels having 0 is set to 0. Further, the luminance value of the remaining part of the original image 11 excluding the target area 27 is set to 0.
[0044]
When the shape of the extracted figure is different from the expectation of the operator, the shape of the extracted figure is corrected based on the correction information. The shape of the extracted graphic is corrected by a method using graphic fusion processing, a method of binarizing the target area 27 again, or a method of manual input by the operator. The figure fusion process is a figure shaping process and is a process for diffusing or shrinking an extracted figure. In the binarization method, the luminance threshold thd is changed. The brightness threshold thd may be changed by the operator. In the manual input method, the operator manually inputs in units of one pixel.
[0045]
When a plurality of extracted figures are extracted by the binarization, unnecessary extracted figures are removed based on the removal information. Unnecessary extracted figures are removed by a maximum area extraction method, a minimum area removal method, a large / small area removal method, or a manually designated removal method. In the maximum area extraction method, only the extracted figure with the largest area is left among a plurality of extracted figures, and all other extracted figures are removed. In the minimum area removal method, only the extracted figure with the smallest area is removed from the plurality of extracted figures. In the large / small area removal method, among the plurality of extracted figures, the extracted figure within the predetermined area range is left, and the other extracted figures are removed. That is, in the large / small region removal method, an extracted figure whose area is larger than the upper limit of the predetermined area range and an extracted figure whose area is smaller than the lower limit of the predetermined area range are removed. In the manual designation removal method, the extracted figure designated by the operator manually is removed.
[0046]
FIG. 6 is a flowchart for explaining the operation process of the sample creation means 14. When the original image 11 is input to the sample creation unit 14 and the region designation information is input to the region designation information input unit 23, the process proceeds from step s0 to step s1, and the creation of the sample 26 including the sample figure 12 is started. In step s1, the region designation information is input from the region designation information input means 23, and the process proceeds to step s2. As a result, the target area 27 of the entire area of the original image 11 is designated.
[0047]
In step s2, the brightness threshold thd is determined for the target area 27, and the process proceeds to step s3.
[0048]
In step s 3, it is determined whether or not the luminance threshold thd is smaller than the average value Av of luminance values on the neighboring contour line of the target region 27. When it is determined in step s3 that the luminance threshold thd is smaller than the average luminance value Av (Av> thd), the process proceeds to step s4, where the luminance threshold thd is equal to or higher than the average luminance value Av. If it is determined that (Av ≦ thd), the process proceeds to step s5.
[0049]
In step s4, the image in the target region 27 is binarized, and the process proceeds to step s6 with a portion including pixels having a luminance value equal to or lower than the luminance threshold thd as an extracted figure.
[0050]
In step s5, the image in the target region 27 is binarized, and the process proceeds to step s6 using a portion composed of pixels having a luminance value equal to or higher than the luminance threshold thd as an extracted figure.
[0051]
In step s6, it is determined whether or not correction information is input by the correction information input means 24. If correction information is given to the correction information input means 24 by the operator, it is determined that correction information has been input, and the process proceeds to step s7. On the other hand, if it is determined in step s6 that correction information has not been input, the process proceeds to step s8.
[0052]
In step s7, the shape of the extracted figure is corrected based on the correction information, and the process proceeds to step s8. In this step s7, the shape of the extracted figure is corrected by the above-described method using the graphic fusion process, the method of binarizing the target area 27 again, or the method of manual input by the operator. When the shape of the extracted figure is corrected in this way, the process proceeds to step s8.
[0053]
In step s8, it is determined whether or not removal information is input by the correction information input means 24. If removal information is given to the correction information input means 24 by the operator, the sample creation means 14 determines that there is input of removal information, and proceeds to step s9. On the other hand, when it is determined in step s8 that no removal information is input, the process proceeds to step s10 and the operation process is terminated.
[0054]
In step s9, unnecessary extracted figures are removed based on the removal information. In this step s9, unnecessary extracted figures are removed by the above-described maximum area extraction method, minimum area removal method, large / small region removal method or manual designation removal method. When unnecessary extracted figures are removed in this way, the process proceeds to step s10 and the operation process is terminated. As a result, a sample 26 is created.
[0055]
In the present embodiment, a predetermined target area 27 among the entire areas of the original image 11 is designated by the area designation information input from the area designation information input unit 23. The sample creation means 14 extracts the sample graphic 12 from the target area 27 and creates a sample 26 including the sample graphic 12.
[0056]
Since the sample creation means 14 extracts the sample graphic 12 from the target area 27 as described above, it is not necessary for the operator to manually input each pixel of the sample graphic 12 in units of one pixel when creating the sample 26. Therefore, compared with the prior art, it is possible to reduce the labor required for creating the sample figure 12.
[0057]
In the present embodiment, the luminance threshold thd is determined for the target area 27 and the target area 27 is binarized based on the luminance threshold thd. The sample figure 12 and its vicinity can be reliably distinguished. Therefore, the sample figure 12 can be reliably extracted from the target area 27.
[0058]
The image processing procedure design unit 25 includes a dead zone creation unit 15, a luminance conversion determination unit 16, a preprocessing selection unit 17, a binarization processing selection unit 18, a figure fusion processing generation unit 19, and a filter processing generation unit. 20 and so on. The image processing design means 25 constitutes one processing procedure based on the plurality of original images 11 and the sample figures 12 corresponding to them. That is, the image processing procedure design means 25 constitutes a processing procedure for extracting a graphic close to the sample graphic 12 from an image similar to the plurality of original images 11.
[0059]
  Figure 7 shows the dead zoneregionCreation means 15FIG. 6 is a diagram showing a neighborhood area 32 and a dead zone area 33 created around the area 31 corresponding to the sample figure 12 of the original image 11. FIG. 8 is a diagram for explaining the vicinity region 32 and the dead zone region 33. Hereinafter, the region 31 corresponding to the sample figure 12 of the original image 11 may be described as the sample region 31.
[0060]
The dead zone creation means 15 creates a neighborhood area 32 around the sample area 31. In addition, the dead zone creation means 15 is a dead zone that is excluded from the processing target both outside and inside the boundary 34 between the sample region 31 and the neighboring region 32, that is, both outside and inside the outline of the sample region 31. An area 33 is created. The dead zone 33 is a contraction dead zone 35 formed inside the boundary 34 between the sample region 31 and the neighboring region 32, and an expansion dead zone formed outside the boundary 34 between the sample region 31 and the neighboring region 32. Region 36.
[0061]
Further, when the luminance of the sample area 31 and the neighboring area 32 overlap, the dead zone area creating means 15 creates the neighboring area 32 except for the area where the luminance overlaps. That is, when the luminance of the pixel in the sample area 31 is equal to the luminance of the pixel in the neighboring area 32, the pixel having the same luminance is excluded from the neighboring area 32.
[0062]
In the present embodiment, the dead zone region 33 is created on both sides of the boundary portion 34 between the sample region 31 and the neighboring region 32. However, in another embodiment of the present invention, the boundary portion between the sample region 31 and the neighboring region 32 is created. The dead zone region may be created only on either the inside or the outside of 34.
[0063]
FIG. 9 is a flowchart showing the operation process of the dead zone region creating means 15. When the sample image 12 corresponding to the original image 11 and the original image 11 is input to the dead zone region creating means 15, the process proceeds from step a0 to step a1.
[0064]
In step a1, a neighborhood region 32 is created around a sample region 31 that is a region corresponding to the sample figure 12 of the original image 11, and the process proceeds to step a2. The dead zone region creating means 15 performs the expansion process of the graphic component on the sample graphic 12 a plurality of times, and sets the region of the original image 11 corresponding to the region created by the expansion processing as the neighborhood region 32. In contrast to the contraction process, the expansion process is multiplied from the boundary pixel of the graphic component toward the outside of the graphic to thicken the skin.
[0065]
The neighborhood region 32 includes, for example, a region separated from the periphery of the sample region 31 by about 3 to 30 pixels, preferably about 8 pixels. The neighborhood region 32 is set by a setting unit 45 described later.
[0066]
When the sample graphic 12 shows a part of the region desired to be extracted from the original image 11, the neighborhood region and the dead zone region are not provided in the entire peripheral portion of the sample region 31, but the dead zone region is provided in the edge portion.
[0067]
In step a2, a contraction dead zone region 35 is formed in the dead zone 33, and the process proceeds to step a3. The dead zone region creating unit 15 performs the contraction process of the graphic component on the sample graphic 12 a plurality of times, and sets the region of the original image 11 corresponding to the region created by the shrinkage process as the shrinkage dead zone region 35. In the contraction process, all the boundary pixels of a given graphic component are deleted to remove a human skin.
[0068]
The contraction process by the dead zone creating means 15 is set by designating the number of pixels to be cut from the sample graphic 12. The number of pixels to be trimmed from the sample figure 12 is set by a setting unit 45 described later. The number of pixels is equal to the number of times of contraction processing, and is set to a range of 1 to 5, for example.
[0069]
In step a3, it is determined whether or not the sample region 31 disappears as a result of forming the shrinkage dead zone region 35 in step a2. That is, whether or not the entire sample region 31 is included in the contraction dead zone region 35, here, the number of pixels in the sample region 31 is compared with the number of pixels in the contraction dead zone region 35, and the number of pixels in the contraction dead zone region 35 is determined as a sample. It is determined whether or not the number of pixels in the region 31 is equal.
[0070]
If it is determined in step a3 that the sample region 31 does not disappear, the process proceeds to step a4. On the other hand, if it is determined in step a3 that the sample region 31 disappears, the process proceeds to step a10. By the process of step a3, it is possible to prevent the sample area 31 from being included in the dead zone 33 and to prevent the entire sample area 31 from being removed from the processing target.
[0071]
In step a3, it is determined whether or not the sample region 31 disappears as a result of forming the shrinkage dead zone region 35. In another embodiment of the present invention, in step a3, the sample region 31 is determined. It may be determined whether the ratio of the number of pixels in the contraction dead zone region 35 to the number of pixels is equal to or greater than a predetermined ratio. The predetermined ratio is selected between 1 and 20%, preferably 5%. If it is determined that the ratio of the number of pixels in the contraction dead zone region 35 to the number of pixels in the sample region 31 does not exceed the predetermined ratio, the process proceeds to step a4. On the other hand, if it is determined that the ratio of the number of pixels in the contraction dead zone 35 to the number of pixels in the sample area 31 is equal to or greater than the predetermined ratio, the process proceeds to step a10. This can prevent the sample region 31 to be processed from becoming too small.
[0072]
In step a4, the expansion dead zone region 36 is formed in the dead zone 33, and the process proceeds to step a5. The dead zone region creating unit 15 performs the expansion process of the graphic component on the sample graphic 12 a plurality of times, and sets the region of the original image 11 corresponding to the region created by the expansion processing as the expansion dead zone region 36. The expansion processing by the dead zone region creating unit 15 is set by designating the number of pixels to be thickened from the sample graphic 12. The setting of the number of pixels to be thickened from the sample figure 12 is set by a setting unit 45 described later. The number of pixels is equal to the number of expansion processes, and is set to a range of 1 to 5, for example.
[0073]
In step a5, it is determined whether or not the expansion dead zone region 36 exceeds the neighboring region 32 as a result of forming the expansion dead zone region 36 in step a4. That is, it is determined whether or not all of the neighboring regions 32 are included in the expansion dead zone region 36.
[0074]
If it is determined in step a5 that the expansion dead zone region 36 does not exceed the neighboring region 32, the process proceeds to step a6. On the other hand, if it is determined in step a5 that the expansion dead zone region 36 exceeds the neighboring region 32, the process proceeds to step a11. By the process of step a5, it is possible to prevent all the neighboring areas 32 from being included in the dead zone 33 and to prevent all the neighboring areas 32 from being excluded from the processing target.
[0075]
In step a5, it is determined whether or not the expansion dead zone region 36 exceeds the neighboring region 32. In another embodiment of the present invention, in step a5, the expansion relative to the number of pixels in the neighboring region 32 is determined. It may be determined whether or not the ratio of the number of pixels in the dead zone 36 is equal to or greater than a predetermined ratio. The predetermined ratio is selected between 1 and 30%, preferably 8%. If it is determined that the ratio of the number of pixels in the expansion dead zone region 36 to the number of pixels in the neighboring region 32 does not exceed the predetermined ratio, the process proceeds to step a6. On the other hand, if it is determined that the ratio of the number of pixels in the expansion dead zone region 36 to the number of pixels in the neighboring region 35 is equal to or greater than the predetermined ratio, the process proceeds to step a11. Thereby, it is possible to prevent the neighborhood area to be processed from becoming too small.
[0076]
In step a6, the luminance of each pixel in the sample region 31 is detected, the luminance of each pixel in the neighboring region 32 is detected, the luminance distribution of the sample region 31 and the neighboring region 32 is created, and the process proceeds to step a7. In step a6, when detecting the luminance, the pixels in the dead zone 33 are excluded from the processing target.
[0077]
FIG. 10 is a diagram illustrating an example of the luminance distribution 31a of the sample region 31 and the luminance distribution 32a of the neighboring region 32 created by the dead zone region creating unit 15 in step a7. In FIG. 10, the vertical axis represents the number of pixels, and the horizontal axis represents the luminance value. That is, FIG. 10 is a diagram schematically showing a luminance histogram in which the vertical axis represents the number of pixels and the horizontal axis represents the luminance value. FIG. 10 shows a state in which the luminance distribution 31a of the sample area 31 and the luminance distribution 32a of the neighboring area 32 are overlapped. FIG. 10 shows a case where the maximum value of the luminance distribution 31a in the sample area 31 is larger than the maximum value of the luminance distribution 32a in the neighboring area 32.
[0078]
In step a7, it is determined whether or not the luminance distribution 31a of the sample area 31 and the luminance distribution 32a of the neighboring area 32 overlap. If it is determined in step a7 that the luminance distributions overlap, the process proceeds to step a8. If it is determined that the luminances do not overlap, the process proceeds to step a9, and the operation process is terminated.
[0079]
Whether the luminance distribution 31a of the sample area 31 and the luminance distribution 32a of the neighboring area 32 overlap is determined as follows. In the sample area 31, the minimum luminance value is A1, and the maximum luminance value is A2. The minimum luminance value in the neighborhood region 32 is B1, and the maximum luminance value is B2. At this time, when the value obtained by subtracting the maximum luminance value of the neighboring region 32 from the minimum luminance value of the sample region 31, that is, the value of (A1-B2) becomes a positive value, the luminance distribution 31a of the sample region 31 And the luminance distribution 32a of the neighboring region 32 are determined not to overlap. When the value obtained by subtracting the maximum luminance value of the sample area 31 from the minimum luminance value of the adjacent area 32, that is, (B1-A2) is a positive value, the luminance distribution 31a of the sample area 31 and the adjacent area It is determined that the luminance distribution 32a of 32 does not overlap.
[0080]
On the other hand, the value obtained by subtracting the maximum luminance value of the neighboring region 32 from the minimum luminance value of the sample region 31, that is, the value of (A1-B2) is not a positive value, and the sample is obtained from the minimum luminance value of the neighboring region. If the value obtained by subtracting the maximum luminance value of the region 31, that is, (B1-A2) does not become a positive value, it is determined that the luminance distribution 31a of the sample region 31 and the luminance distribution 32a of the neighboring region 32 overlap. .
[0081]
In step a8, the neighboring region 32 is formed except for the region overlapping the luminance distribution 31a of the sample region 31, and the process proceeds to step a6.
[0082]
FIG. 11 shows the relationship between the luminance distribution 31a of the sample region 31 and the luminance distribution 32b of the neighboring region 32 when the neighboring region 32 is created except for the region overlapping the luminance distribution 32a of the sample region 31 in step a8. It is a figure which shows an example. In FIG. 11, the vertical axis represents the number of pixels, and the horizontal axis represents the luminance value. That is, FIG. 11 is a diagram schematically showing a luminance histogram in which the vertical axis represents the number of pixels and the horizontal axis represents the luminance value. FIG. 11 shows the luminance distribution of the sample region 31 and the neighboring region 32 having the luminance distribution shown in FIG. 10 except for the region where the luminance of the neighboring region 32 overlaps.
[0083]
Since the luminance difference between the sample region 31 and the neighboring region 32 can be increased by the processing of step a7, the configuration of the processing procedure for extracting the region corresponding to the sample graphic 12 from the original image 11 can be stabilized. . Therefore, it is possible to configure a processing procedure for extracting highly reliable graphics by each image processing means 13 described later, and to reduce unnecessary calculation processing.
[0084]
In step a10, the first warning information is output and the process proceeds to step a2. In step a11, the second warning information is output and the process proceeds to step a4. The first warning information indicates that all of the sample area 31 is excluded from the processing target. Further, the second warning information indicates that all of the vicinity region 32 is excluded from the processing target.
[0085]
The dead zone region creating means 15 executes the processing described above, whereby the determination result 40 is obtained. The determination result 40 is the original image 11 in which the neighborhood area 32 and the dead zone area 33 are set.
[0086]
The image processing procedure design means 25 described above includes a setting unit 45. The setting unit 45 inputs the number of pixels set in step a2 and step a4 of the processing procedure shown in FIG. 9 to the dead zone generation 15 based on an instruction from the operator input from a mouse and a keyboard, for example.
[0087]
The setting unit 45 can input that the sample figure 12 is a part of an image obtained by binarizing the image of the region extracted from the original image 11 based on an instruction from the operator. When the setting unit 45 inputs that the sample figure 12 is a part of an image obtained by binarizing a region desired to be extracted in the original image 11, the dead zone region creating means 15 causes the sample region in the original image 11 to be sampled. The neighborhood region 32 is created in a part of the periphery of the sample region 31 except for a region where the luminance difference between the region 31 and the neighborhood region 32 is within a predetermined range.
[0088]
The dead zone region creating means 15 performs the above-described processing on the plurality of original images 11.
[0089]
For example, when an image captured by an imaging unit such as an electronic camera is input as the original image 11, a luminance gradient is generated between regions having different luminances in the original image 11. In the region where the luminance gradient occurs, the luminance value becomes unstable. Since the sample figure 12 corresponds to the image of the region to be extracted from the original image 11 and has an outline between the regions having different luminances described above, the sample graphic 12 includes a portion whose luminance value is unstable. Therefore, unless the sample figure 12 is accurately matched with the region to be extracted of the original image 11, the processing procedure constituted by the expert system will be different. Therefore, the procedure cannot be correctly evaluated.
[0090]
In the expert system of the present embodiment, when the dead zone region 33 to be excluded from the processing target is created in the original image 11 and the processing is executed by the image processing means 13, the sample figure 12 is the region to be extracted from the original image 11. When the sample figure 12 is the same as the image of the region to be extracted, even if the image is not the same as the image and is slightly larger or smaller than the image of the region to be extracted from the original image 11 Compared with, the configured procedure does not differ.
[0091]
In other words, even if the sample figure 12 cannot be created accurately in units of pixels, for example, in accordance with the image of the region desired to be extracted from the original image 11, it is accurately determined in units of pixels in accordance with the region desired to be extracted from the original image 11. The same processing procedure as when the sample figure 12 is created is configured. Therefore, even if the accuracy of the sample figure 12 is somewhat rough, the procedure can be correctly evaluated. Thus, it is possible to configure a processing procedure for extracting a more reliable figure without reducing the evaluation accuracy of the expert system.
[0092]
Thus, since the accuracy of the sample figure 12 is not directly related to the procedure evaluation, it is possible to save the trouble of accurately creating the sample figure 12 in units of one pixel, for example. That is, it is not necessary to spend a great deal of labor and time for creating the sample graphic 12 input to the expert system. Therefore, it becomes easy to incorporate the expert system into an actual image processing apparatus, and the practical application of the expert system can be realized.
[0093]
The luminance conversion determination unit 16 constitutes one of the plurality of image processing units 13. The luminance conversion determination means 16 sets the minimum luminance and the maximum luminance in the sample region 31 as threshold values TL1 and TH1, respectively, and the number NL1 of pixels in the original image 11 having luminance equal to or higher than the minimum luminance threshold value TL1, and Evaluation values PL and PH are calculated for the number NH1 of pixels in the original image 11 having a luminance equal to or less than the maximum luminance threshold TH1. The luminance conversion determination unit 16 determines whether or not a predetermined luminance conversion process for expanding the luminance distribution of the original image 11 to the entire luminance value is necessary based on the evaluation values PL and PH.
[0094]
The predetermined luminance conversion process includes, for example, linear conversion and intermediate enhancement. In the original image 11 before linear conversion, the linear conversion is performed such that the luminance of each pixel is X, the minimum luminance is Xmin, and the maximum luminance is Xmax. In the original image 11 after linear conversion, the luminance of each pixel is Y and the minimum luminance Ymin. When the maximum luminance is Ymax, the calculation is performed based on the following equation (1).
Y = {(Ymax−Ymin) / (Xmax−Xmin)}
(X−Xmin) + Ymin (1)
[0095]
In the intermediate enhancement, X is the luminance of each pixel of the original image 11 before intermediate enhancement, and Y is the luminance of each pixel of the original image 11 after intermediate enhancement. Is performed based on the following equation (2), and is performed based on the following equation (3) for X in the luminance range of 128 to 255.
Y = (X / 127)2127 (2)
Y = {(X−128) / 127}1/2・ 127} +127 (3)
[0096]
In the present embodiment, as described above, the sample area 31 is an area corresponding to the sample figure 12 of the original image 11, and the background area is a remaining area excluding the sample area 31 of the original image 11.
[0097]
12 and 13 are diagrams showing the luminance distributions 31a and 37a of the sample area 31 and the background area. 12 and 13, the vertical axis represents the number of pixels, and the horizontal axis represents the luminance value. That is, FIG. 12 and FIG. 13 are diagrams schematically showing a luminance histogram in which the vertical axis represents the number of pixels and the horizontal axis represents the luminance value. FIG. 12 is a diagram illustrating an example of a state in which the luminance distribution 31a of the sample region 31 and the luminance distribution 37a of the background region are separated from each other. FIG. 13 is a diagram illustrating an example of a state in which the luminance distribution 31a of the sample region 31 and the luminance distribution 37 of the background region are close to each other.
[0098]
The evaluation values PL and PH include a minimum luminance side evaluation value PL and a maximum luminance side evaluation value PH. The minimum luminance side evaluation value PL is larger than the number NL1 of pixels in the original image 11 having a luminance equal to or higher than the minimum luminance threshold TL1 in the sample region 31 and the minimum luminance threshold TL1 in the sample region 31. This is a ratio to the number NL2 of pixels in the original image 11 having a luminance equal to or higher than the minimum luminance side threshold value TL2 that is lower by a predetermined value αL.
[0099]
The maximum luminance side evaluation value PH is larger than the number NH1 of pixels in the original image 11 having a luminance equal to or lower than the maximum luminance threshold TH1 in the sample region 31 and the maximum luminance threshold TH1 in the sample region 31. This is a ratio to the number NH2 of pixels in the original image 11 having a luminance equal to or lower than the maximum luminance side threshold value TH2 that is higher by a predetermined value αH. From the experimental results of the present inventors, the predetermined value αL is selected between 5 and 30, for example, 10 and the predetermined value αH is selected between 5 and 30, for example, 10. To be elected.
[0100]
Specifically, the minimum luminance side evaluation value PL is the luminance that is equal to or greater than the minimum luminance side threshold TL2, where NL1 is the number of pixels NL1 in the original image 11 having luminance equal to or greater than the minimum luminance threshold TL1. When the number NL2 of pixels in the original image 11 having NL is NL2 and the minimum luminance side evaluation value PL is PL, the following expression (4) is obtained.
PL = NL2 / NL1 (4)
[0101]
For the maximum luminance side evaluation value PH, the number NH1 of pixels in the original image 11 having a luminance equal to or smaller than the maximum luminance threshold TH1 is NH1, and the original image 11 having a luminance equal to or smaller than the maximum luminance side threshold TH2. When the number NH2 of the pixels is NH2 and the maximum luminance side evaluation value PH is PH, the following equation (5) is obtained.
PH = NH2 / NH1 (5)
[0102]
The luminance conversion determination unit 16 performs luminance conversion processing when the minimum luminance side evaluation value PL is equal to or smaller than a predetermined minimum luminance side reference value ηL and the maximum luminance side evaluation value PH is equal to or smaller than a predetermined maximum luminance side reference value ηH. Is determined to be unnecessary. Further, the luminance conversion determination unit 16 performs luminance conversion processing when the minimum luminance side evaluation value PL exceeds a predetermined minimum luminance side reference value ηL, or when the maximum luminance side evaluation value PH exceeds a predetermined maximum luminance side reference value ηH. Is determined to be necessary. From the experiment result of the present inventors, the minimum luminance side reference value ηL is selected between 1.1 and 1.5, for example, 1.3, and the maximum luminance side reference value ηH is 1.1. It is chosen between -1.5, for example 1.3.
[0103]
FIG. 14 is a flowchart showing an operation process of the luminance conversion determination unit 16. When the original image 13 is input, the process proceeds from step b0 to step b1, and operation processing for determining whether or not luminance conversion processing is necessary is started. In step b1, the number NL1 of pixels in the original image 11 having a luminance equal to or higher than the minimum luminance threshold TL1, and the number NL2 of pixels in the original image 11 having a luminance equal to or higher than the minimum luminance side threshold TL2. And the process proceeds to step b2.
[0104]
In step b2, the number NH1 of pixels in the original image 11 having a luminance equal to or less than the maximum luminance threshold TH1, and the number NH2 of pixels in the original image 11 having a luminance equal to or less than the maximum luminance side threshold TH2. And the process proceeds to step b3.
[0105]
In step b3, the minimum luminance side evaluation value PL is calculated based on the pixel numbers NL1 and NL2 calculated in step b1, and the maximum luminance side evaluation value is calculated based on the pixel numbers NH1 and NH2 calculated in step b2. PH is calculated and the process proceeds to step b4.
[0106]
In step b4, it is determined whether or not the minimum luminance side evaluation value PL is equal to or less than the minimum luminance side reference value ηL and the maximum luminance side evaluation value PH is equal to or less than a predetermined maximum luminance side reference value ηH. In step b4, when the minimum luminance side evaluation value PL is not more than the minimum luminance side reference value ηL and the maximum luminance side evaluation value PH is not more than the maximum luminance side reference value ηH, the process proceeds to step b5. In step b5, it is determined that luminance conversion is not necessary, the process proceeds to step b6, and the operation process is terminated.
[0107]
On the other hand, when the minimum luminance side evaluation value PL exceeds the predetermined minimum luminance side reference value ηL in step b4, or when the maximum luminance side evaluation value PH exceeds the predetermined maximum luminance side reference value ηH, the process proceeds to step b7. In step b7, it is determined that the luminance conversion process is necessary, the process proceeds to step b6, and the operation process is terminated.
[0108]
In this way, the luminance conversion determining means 16 includes the number NL1 of pixels in the original image 11 having a luminance equal to or higher than the minimum luminance threshold TL1 and the original image 11 having a luminance equal to or lower than the maximum luminance threshold TH1. Evaluation values PL and PH for the number of pixels NH1 are calculated. Each evaluation value PL, PH depends on the luminance distribution of the original image 11. Based on these evaluation values PL and PH, the luminance conversion determination means 16 determines whether or not luminance conversion processing is necessary. Therefore, the luminance conversion determination unit 16 can determine whether or not luminance conversion processing is necessary according to the luminance distribution of the original image 11.
[0109]
The evaluation values PL and PH calculated by the luminance conversion determination means 16 include a minimum luminance side evaluation value PL and a maximum luminance side evaluation value PH. The minimum luminance side evaluation value PL is the number of pixels in the original image 11 (NL2−NL1) having a luminance in a luminance range between the minimum luminance threshold value TL1 and the minimum luminance side threshold value TL2. , How much is the number NL1 of pixels in the original image 11 having a luminance equal to or higher than the minimum luminance threshold TL1. The maximum luminance side evaluation value PH is the number of pixels (NH2-NH1) in the original image 11 having a luminance in a luminance range between the maximum luminance threshold value TH1 and the maximum luminance side threshold value TH2. , How much is the number NH1 of pixels in the original image 11 having a luminance equal to or greater than the maximum luminance threshold TH1.
[0110]
Since the determination is made based on the evaluation values PL and PH as described above, the luminance conversion determination unit 16 is close to the luminance of each pixel in the sample region 31 with respect to the number of all pixels in the sample region 31. When the number of pixels in the original image 11 having luminance is small, it can be determined that luminance conversion processing is unnecessary. The luminance conversion determination means 16 performs the luminance conversion processing when the number of pixels in the original image 11 having luminance close to the luminance of each pixel in the sample area 31 is larger than the number of all pixels in the sample area 31. It can be determined that it is necessary.
[0111]
When it is determined by the luminance conversion determination means 16 that the luminance conversion processing is necessary, the expert system constitutes a processing procedure including the luminance conversion processing, and the luminance conversion determination means 16 determines that the luminance conversion processing is not necessary. If there is, the processing procedure not including the luminance conversion processing is configured. Accordingly, the expert system can configure a processing procedure suitable for the original image 11 according to the luminance distribution of the original image 11.
[0112]
When the original image 11 is an image obtained by photographing, the luminance distribution of the original image 11 varies depending on the optical system environment such as illumination at the time of photographing the original image 11. Thus, since the luminance distribution of the original image 11 and the optical system environment at the time of photographing the original image 11 are related to each other, the optical system environment can be diagnosed based on the luminance distribution of the original image 11. is there. As described above, the determination by the luminance conversion determination unit 16 is based on the luminance distribution of the original image 11. Therefore, the determination by the luminance conversion determination unit 16 can be used for diagnosis of the optical system environment.
[0113]
FIG. 15 is a flowchart showing the operation process of the preprocessing selection means 17. When a plurality of sets of design samples are input, the process proceeds from step c0 to step c1. In step c1, one of the plurality of original images 11 is processed by performing one noise removal process of the plurality of noise removal processes, and the process proceeds to step c2. In step c1, when the noise removal process is performed on the original image 11, the processing time required for the noise removal process is calculated at the same time.
[0114]
The preprocessing selection means 17 performs all the executable noise removal processing to remove noise from the original image 11. The preprocessing selection means 17 is provided with a plurality of processing modules as a plurality of noise removal processes. The processing module includes a moving average process and a median filter. In the present embodiment, for example, as noise removal processing, there are two processing modules of moving average processing (1-5 times) and median filter (1-5 times). In this case, in step c1, a total of 10 types of processing modules are provided. Noise removal processing is executed to remove noise from the original image 11.
[0115]
In step c2, the luminance of the area corresponding to the sample graphic 12 of the original image 11 processed in step c1 is calculated, the luminance distribution is obtained, and the process proceeds to step c3. Hereinafter, the original image 11 after the noise removal process may be referred to as a first processed image. In the first processed image, an area corresponding to the sample figure 12 may be described as a first sample area. The first sample region corresponds to the sample region described above.
[0116]
In step c3, the luminance of the region in the vicinity of the first sample region of the first processed image whose luminance is calculated in step c2 is calculated, the luminance distribution is obtained, and the process proceeds to step c4. Hereinafter, a neighboring area provided around the first sample area in the first processed image is referred to as a first neighboring area. The first neighborhood region corresponds to the neighborhood region 32 described above.
[0117]
In step c4, the luminance distribution 38 of the first sample region and the luminance of the first neighboring region are calculated from the luminance distribution 38 of the first sample region obtained in step c2 and the luminance distribution 39 of the first neighboring region obtained in step c3. It is calculated whether or not there is an overlap with the distribution 39.
[0118]
FIGS. 16 and 17 are diagrams illustrating examples of the luminance distribution 38 of the first sample region and the luminance distribution 39 of the first neighboring region. 16 and 17, the vertical axis represents the number of pixels, and the horizontal axis represents the luminance value. That is, FIGS. 16 and 17 are diagrams schematically showing a luminance histogram in which the vertical axis represents the number of pixels and the horizontal axis represents the luminance value. FIG. 16 is a diagram illustrating an example of a state in which the luminance distribution 38 in the first sample region and the luminance distribution 39 in the first neighboring region do not overlap. FIG. 17 is a diagram illustrating an example of a state where the luminance distribution of the first sample region 38 and the luminance distribution 39 of the first neighboring region are overlapped.
[0119]
Whether or not the luminance distribution 38 of the first sample region and the luminance distribution 39 of the first neighboring region overlap is determined as follows. In the first sample area, the minimum luminance value is C1, and the maximum luminance value is C2. Of the luminance values in the first neighboring area, the minimum luminance value is D1, and the maximum luminance value is D2. At this time, when the value obtained by subtracting the maximum luminance value of the first neighboring region from the minimum luminance value of the first sample region, that is, the value of (C1-D2) is a positive value, It is determined that the luminance distribution 38 and the luminance distribution 39 in the first neighboring region do not overlap. When the value obtained by subtracting the maximum luminance value of the first sample region from the minimum luminance value of the first neighboring region, that is, (D1-C2) is a positive value, the luminance distribution 38 of the first sample region is , It is determined that the luminance distribution 39 in the first neighboring region does not overlap.
[0120]
On the other hand, a value obtained by subtracting the maximum luminance value of the neighboring region from the minimum luminance value of the first sample region, that is, the value of (C1-D2) is not a positive value, and the minimum luminance value of the first neighboring region is If the value obtained by subtracting the maximum luminance value of the first sample area from (ie, (D1-C2)) is not a positive value, the luminance distribution 38 of the first sample area and the luminance distribution of the first neighboring area 39 Are determined to overlap.
[0121]
In step c5, all of a plurality of noise removal processes are executed on one original image 11, and it is determined whether or not an overlap of luminance distributions has been calculated. If it is determined in step c5 that all of a plurality of noise removal processes have been performed on one original image 11 and the overlap of luminance distributions has been calculated, the process proceeds to step c6. On the other hand, if it is determined in step c5 that all of the plurality of noise removal processes have not been performed on one original image 11 and the overlap of luminance distributions has not been calculated, the process proceeds to step c1 and one original image 11 is moved. For all, the plurality of noise removal processes are executed, and the processes from step c1 to step c4 are repeated until the overlap of the luminance distributions of the first sample area and the first neighboring area is calculated.
[0122]
In step c6, it is determined whether or not each process from step c1 to step c5 has been executed for all the first processed images. If it is determined in step c6 that the processes from step c1 to step c5 have been executed for each first processed image, the process proceeds to step c7. On the other hand, if it is determined in step c6 that the processes from step c1 to step c5 have not been executed for all the first processed images, the process proceeds to step c1 and the processes in steps c1 to c5 are performed. The process for the first processed image that has not been performed is executed.
[0123]
In step c7, with reference to the result of calculating the overlap between the luminance distribution 38 of the first sample area and the luminance distribution 39 of the first neighboring area in step c4, It is determined whether or not there is a noise removal process in which the luminance distribution 38 of the first sample region and the luminance distribution 39 of the first neighboring region do not overlap in all the first processed images. Noise removal processing in which the luminance distribution 38 of the first sample region and the luminance distribution 39 of the first neighboring region do not overlap may be referred to as non-overlapping noise removal processing.
[0124]
If it is determined in step c6 that all the first processed images have the noise removal process without overlap, the process proceeds to step c8.
[0125]
In step c8, the fastest process among the noise elimination processes without overlap, that is, the noise removal process for which the noise removal process is performed for the shortest time is selected, the process proceeds to step c13, and the operation process is terminated. When the original image 11 is processed by the noise elimination process without overlapping, the first sample area and the first neighboring area can be accurately separated regardless of which noise elimination process is executed. That is, the first sample region can be extracted with high accuracy. Therefore, in such a case, it is possible to shorten the processing time in the time-consuming noise removal processing by selecting the noise removal processing that provides the fastest processing speed. Moreover, the average value of the processing time with respect to all the original images 11 is used for the time which processes by performing the said noise removal process.
[0126]
On the other hand, if it is determined in step c7 that there is no noise removal processing without overlap in all the first processed images, the process proceeds to step c9. In step c9, the degree of separation of the processed original image 11 is calculated by executing one noise removal process among the plurality of noise removal processes, and the process proceeds to step c10. Assuming that the degree of separation is P, the degree of separation is defined as the average luminance of the first sample region is μ0, the average luminance of the first neighboring region is Mi, and the standard deviation of the luminance of the first sample region and the first neighboring region is σ. Then, it is represented by the following equation (6).
P = (μ0−Mi) / σ × 100% (6)
[0127]
The degree of separation is a measure indicating the ease of separation between the first sample region and the first neighboring region. As the degree of separation increases, the separation between the first sample region and the first neighboring region is better, that is, the extraction accuracy of the first sample region is better. By defining the degree of separation as shown in Expression (6), the brightness of the area corresponding to the sample figure 12 of the original image 11 after the noise removal process and the brightness of the vicinity area among the plurality of noise removal processes It is possible to efficiently select a noise removal process that maximizes the difference between the two.
[0128]
In step c10, it is determined whether or not the degree of separation has been calculated for all the first processed images obtained by executing all the noise removal processes on the plurality of original images 11, respectively. If it is determined that the degree of separation has been calculated for all the first processed images, the process proceeds to step c11. On the other hand, if it is determined in step c10 that the separation degree has not been calculated for all the first processed images, the process proceeds to step c9 to calculate the separation degree of the first processed image for which the separation degree has not been calculated. .
[0129]
In step c11, the average of the luminance separation in each first processed image obtained by executing the same noise removal process among the plurality of noise removal processes is calculated, and the process proceeds to step c12. Hereinafter, the average of the degree of separation is referred to as average degree of separation.
[0130]
In step c12, based on the average degree of separation calculated in step c11, a noise removal process that maximizes the average degree of separation is selected for each processing module, the process proceeds to step c13, and the operation process ends. For example, when the noise removal process includes the moving average process and the median filter described above, the image having the highest average separation degree is selected as the noise removal process from the original images 11 processed by executing the moving average process, and the median is selected. Of the original images 11 processed by executing the filter, the image having the highest average separation degree is selected as the noise removal process.
[0131]
For example, when the binarization process for binarizing the original image 11 processed by executing the noise removal process selected by the preprocessing selection unit 17 is selected, among all the noise removal processes, Rather than selecting the binarization process using the original image 11 processed by the noise removal process that maximizes the separation degree, the separation degree is not the largest among all the noise removal processes, but the separation degree is the largest. Of the noise removal processing by a processing module different from the processing module of the noise removal processing, the binarization processing is selected using the noise removal processing that maximizes the degree of separation. As a result, the sample figure 12 of the original image 11 is selected. In some cases, the extraction accuracy of the region corresponding to the is improved.
[0132]
In step c12, a noise removal process with the highest degree of separation is selected for each processing module. Therefore, using the original image 11 that has been subjected to the noise removal process selected by the preprocessing selection unit 17, a binary that will be described later is used. When the binarization process selection means 18 selects the binarization process, the accuracy of the processing procedure configured can be improved.
[0133]
In this way, the preprocessing selection unit 17 performs the noise removal processing based on the luminance distribution 38 of the area corresponding to the sample graphic 12 of the original image 11 and the luminance distribution 39 of the neighboring area. It is possible to select a noise removal process that prioritizes the processing speed or the separation degree, and it is possible to configure a processing procedure with a short processing time without reducing accuracy. Thus, in the expert system, the processing procedure can be configured by adjusting the processing speed of the noise removal processing for removing noise, and the adjustment of the processing speed of the noise removal processing can be reduced as much as possible after the processing procedure is generated. .
[0134]
In the present embodiment, the luminance distribution 38 of the first sample region is calculated in step c2, and then the luminance distribution 39 of the second neighboring region is calculated in step c3. However, in another embodiment of the present invention, The order of step c2 and step c3 may be reversed.
[0135]
In the present embodiment, the noise removal process that maximizes the degree of separation is selected for each processing module in step c10. However, in the other embodiments of the present invention, the average degree of separation is the largest. One noise removal process may be selected. In this case, the processing time in the binarization process selection means 18 mentioned later can be shortened.
[0136]
In the present embodiment, since the dead zone region 33 that is excluded from the processing target is provided by the dead zone creation unit 15, the luminance distribution 38 of the first sample region calculated in step c4 of the flowchart shown in FIG. The overlap with the luminance distribution 39 in the vicinity region can be suppressed. Therefore, there is a high possibility that the fastest processing is selected in the preprocessing selection means 17, and the processing time when executing the processing according to the configured processing procedure can be shortened as much as possible.
[0137]
The binarization processing selection unit 18 constitutes one of the plurality of image processing units 13. The binarization process selection means 18 executes a plurality of binarization processes for converting the first process image into a binary image, and executes the plurality of binarization processes to process the sample graphic 12 of the first process image. The degree of coincidence between the region corresponding to 1 and the sample figure 12 is calculated, and a binarization process that maximizes the degree of coincidence is selected from a plurality of binarization processes. Hereinafter, the first processed image processed by performing the binarization process may be referred to as a second processed image. Hereinafter, an area corresponding to the sample graphic 12 of the second processed image may be referred to as a second sample area. The second sample region corresponds to the sample region 31 described above.
[0138]
First, the binarization processing selection unit 18 executes a noise removal process selected by the preprocessing selection unit 17 and thresholds for binarizing the plurality of original images 11, that is, the plurality of first processing images. The binarization process is executed by changing values in stages. For example, if the luminance of the original image 11 is 256 (8 bits), the threshold value is changed stepwise from 1 to 255, and binarization processing is executed. When there are a plurality of noise removal processes selected by the preprocessing selection unit 17, a binarization process is performed on the first processed image obtained by executing each noise removal process.
[0139]
When the luminance of the first sample area of the first processed image is larger than the luminance of the first neighboring area, the binarization processing selection unit 18 performs binarization processing that sets the threshold value to 1 or more. When the luminance of the sample area is less than the luminance of the first neighboring area, binarization processing is performed with 1 being equal to or less than the threshold value. Thus, a second processed image that is a binary image is obtained.
[0140]
The second binarization process selection means 18 selects a binarization process that maximizes the degree of matching Pev between the second sample area and the sample figure 12. Here, the second sample area, that is, the degree of coincidence Pev between the sample graphic 12 and the whole extracted graphic having the common part with the sample graphic 12 in the second processed image is given by the following equation (7).
Pev = S0 / S1 (7)
Where S0 = area of common part of both figures
S1 = area of union of both figures
[0141]
The degree of coincidence is a scale indicating the degree of coincidence of the figures to be compared. The binarization processing selection means 18 determines a threshold value that maximizes the degree of coincidence. When there are a large number of threshold values with the highest degree of coincidence, a range of threshold values with the same degree of coincidence is obtained, and the median value of this range is set as the threshold value. In other words, for example, when the degree of coincidence is the same in all the ranges from 80 to 100, the binarization processing selection means 18 determines the threshold as 90.
[0142]
The binarization process selection means 18 calculates the average of the degree of coincidence in each second processed image obtained by executing the same binarization process, and performs the binary process that maximizes the calculated average degree of coincidence. select.
[0143]
When there are a plurality of noise removal processes selected by the preprocessing selection means 17 described above, the binarization process selection means 18 performs a plurality of binary values on the original image 11 processed by executing the respective noise removal processes. The binarization process is executed to select one binarization process that maximizes the degree of matching described above. As a result, when the binarization process selected by the binarization process selection unit 18 is executed and the degree of coincidence is maximized, the noise removal process for obtaining the first processed image that has been subjected to the binarization process is performed as follows: It is assumed that the processing procedure in the expert system is configured.
[0144]
The figure fusion processing generation unit 19 constitutes one of the plurality of image processing units 13. The figure fusion process generating means 19 executes a plurality of figure fusion processes on the second processed image, and the region corresponding to the sample figure 12 of the image obtained by executing the plurality of figure fusion processes matches the sample figure 12 Calculate the degree. If the degree of coincidence is greater than the degree of coincidence between the sample figure 12 and the area corresponding to the sample figure 12 of the second processed image before the figure fusion process, the figure fusion processing generating unit 19 A graphic fusion process that maximizes the matching degree is selected from the fusion processes, and if the matching degree does not change or the matching degree decreases, it is selected not to perform the graphic fusion process.
[0145]
First, the graphic fusion processing generating unit 19 is able to obtain a first processed image used by the binarization processing selecting unit 18 from the original image 11 among the noise removing processing selected by the preprocessing selecting unit 17. The graphic fusion processing is performed on each of the plurality of original images 11 processed by executing the processing and the binarization processing selected by the binarization processing selection means 18, that is, the plurality of second processing images. In other words, the figure fusion process is a connected component process and a process for removing noise. The figure fusion process is determined by the order and combination of the contraction process and the expansion process. First, the figure fusion process generating means 19 executes all of the plurality of figure fusion processes to process the second processed image.
[0146]
In the present embodiment, the figure fusion processing generating means 19 is, for example, 4 by combining the expansion processing (1 to 2 times) and the contraction processing (1 to 5 times) of “expansion processing → shrinkage processing” as the graphic fusion processing. Perform one process. The figure fusion processing generation means 19 has a matching degree between the area corresponding to the sample figure 12 of the image obtained by executing the four processes on the second processed image and the sample figure 12 before the figure fusion process. When the degree of matching between the area corresponding to the sample graphic 12 of the second processed image and the sample graphic 12 is larger, a graphic fusion process with the highest degree of matching is selected from a plurality of graphic fusion processes. The degree of coincidence is similarly obtained by the above-described equation (7).
[0147]
The figure fusion process generating means 19 calculates the average of the matching degrees in the figure obtained by executing the same figure fusion process for each second processed image, and the figure fusion process that maximizes the calculated degree of matching. Select.
[0148]
The graphic fusion process generating means 19 is a sample of the second processed image before the graphic fusion process in which the degree of coincidence between the area corresponding to the sample graphic 12 of the image obtained by executing the four processes and the sample graphic 12 is the same. When the degree of coincidence between the area corresponding to the figure 12 and the sample figure 12 is larger, the figure fusion process is selected. If the degree of coincidence calculated by executing the four processes is the same, the figure fusion is performed. Select the one with the few processing times. As a result, the amount of calculation when processing according to the configured processing procedure is executed can be reduced, and the processing time can be shortened as much as possible.
[0149]
The filter processing generation unit 20 constitutes one of the plurality of image processing units 13. The filter processing generation unit 20 has a feature quantity larger and smaller than the feature quantity of the component corresponding to the sample figure 12 of the image from an image obtained by executing a plurality of processes according to the processing procedure on the original image 11. Generate filtering to remove components. The image obtained by executing a plurality of processes according to the processing procedure on the original image 11 is selected by the noise removal process and the binarization process selecting means 18 selected by the preprocessing selecting means 17 described above for the original image 11. An image obtained by executing the binarization processing and the graphic fusion processing selected by the graphic fusion processing generation unit 19, or the noise removal processing selected by the preprocessing selection unit 17 described above for the original image 11 and the binarization An image obtained by executing the binarization process selected by the process selection unit 18, and thereafter, an image obtained by executing a plurality of processes according to the processing procedure may be described as the target image in the original image 11. .
[0150]
An operation process of the filter process generation unit 20 will be schematically described. The filter processing generation unit 20 calculates the minimum feature amount and the maximum feature amount of the component corresponding to the sample graphic 12 of the target image, and calculates the feature amount of each component included in the target image. The filter processing generation unit 20 uses a value obtained by multiplying the minimum feature amount by a predetermined constant as a lower limit evaluation value, and the feature amount of at least one component among components included in the target image is smaller than the lower limit evaluation value. In addition, the lower limit evaluation value is set as a lower limit threshold value, and a filter process for removing a component having a feature quantity smaller than the lower limit threshold value from the target image is generated.
[0151]
The filter processing generation unit 20 uses a value obtained by multiplying the maximum feature amount by a predetermined constant as the upper limit evaluation value, and the feature amount of at least one component among the components included in the target image is larger than the upper limit evaluation value. In addition, a filter process for removing a component having a feature quantity larger than the upper threshold value from the target image using the upper evaluation value as an upper threshold value is generated.
[0152]
FIG. 18 is a flowchart showing the operation process of the filter process generation means 20. When the target image is input in step d0, the process proceeds to step d1. In step d1, the sample graphic 12 is labeled, and the process proceeds to step d2. The labeling process of the sample graphic 12 is to attach the same label to components connected in the sample graphic 12, that is, connected components, and to apply different labels to connected components different from one connected component. The label is, for example, a number.
[0153]
In step d2, the feature quantity of the connected component of the target image corresponding to the component of each label of the sample graphic 12 labeled in step d1 is calculated, and the process proceeds to step d3. In the present embodiment, the feature amount is the number of pixels representing an area. In the present embodiment, the feature amount is the number of pixels. However, in another embodiment of the present invention, the feature amount may be a peripheral length of a component.
[0154]
In step d3, the processing in steps d1 and d2 is performed for all target images obtained by processing the plurality of original images 11 input to the expert system and the plurality of sample figures 12 corresponding to the plurality of original images 11. It is determined whether or not. In step d3, the processing of step d1 and step d2 is performed for all target images obtained by processing the plurality of original images 11 input to the expert system and the sample figure 12 corresponding to the original image 11. If it is determined, the process proceeds to step d4. On the other hand, for all target images obtained by processing the plurality of original images 11 input to the expert system in step d3 and the plurality of sample figures 12 corresponding to the plurality of original images 11, step d1 and step d2 If it is determined that the process is not performed, the process proceeds to step d1.
[0155]
In step d4, the maximum feature value and the minimum feature value of the component corresponding to the sample graphic 12 of the target image are obtained, the lower limit evaluation value and the upper limit evaluation value are calculated, and the process proceeds to step d5. Here, first, the feature amount of the component corresponding to each sample graphic 12 of each target image is calculated, and the maximum feature amount and the minimum feature amount are calculated therefrom. The minimum feature amount and the maximum feature amount are, for example, the maximum pixel number representing the maximum area and the minimum pixel number representing the minimum area, where the feature amount is the number of pixels representing the area.
[0156]
FIG. 19 is a diagram illustrating an example of the distribution of feature amounts of components included in the target image. In FIG. 19, the horizontal axis represents the feature amount, and the vertical axis represents the number of components. That is, FIG. 19 is a diagram schematically showing a feature amount histogram in which the horizontal axis represents feature amounts and the vertical axis represents the number of components. FIG. 19 shows a distribution of feature amounts when a component having a feature amount smaller than a feature amount of a component corresponding to the sample graphic 12 of the target image and a component having a large feature amount are included in the target image. Specifically, the feature quantity distribution 41 of the component corresponding to the sample graphic 12 of the target image, and the feature quantity distribution 42 of the component having a smaller feature quantity than the feature quantity of the component corresponding to the sample graphic 12 of the target image. And a feature amount distribution 43 of components having a feature amount larger than the feature amount of the region corresponding to the sample of the target image.
[0157]
The lower limit evaluation value is a value obtained by multiplying the minimum feature amount by a predetermined constant. When the lower limit evaluation value is P1, the minimum feature amount of the region corresponding to the sample figure 12 of the target image is Smin, and the predetermined constant is βL, the lower limit evaluation value P1 is calculated by Expression (8).
P1 = Smin × βL (8)
[0158]
The upper limit evaluation value is a value obtained by multiplying the maximum feature amount by a predetermined constant. When the upper limit evaluation value is P2, the maximum feature amount of the region corresponding to the sample figure 12 of the target image is Smax, and the predetermined constant is βH, the upper limit evaluation value P2 is calculated by Expression (9).
P2 = Smax × βH (9)
[0159]
Based on the experimental results of the present inventors, βL in Equation (8) and βH in Equation (9) are, for example, βL = 1/5 and βH = 5.
[0160]
In step d5, a labeling process is performed on the entire region of one target image among the plurality of target images, and the process proceeds to step d6. The labeling process is the same process as the labeling process of the sample graphic 12 described above, and labels each connected component in the entire area of the target image.
[0161]
In step d6, the feature amount of the component corresponding to each label subjected to the labeling process in step d5 is calculated, and the process proceeds to step d7.
[0162]
In step d7, the feature amount of the component corresponding to each label calculated in step d6 is compared with the lower limit evaluation value calculated in step d4 described above, and whether or not there is a feature amount smaller than the lower limit evaluation value. Judging. If it is determined in step d7 that there is a feature quantity smaller than the lower limit evaluation value, the process proceeds to step d8. The case where there is a feature amount smaller than the lower limit evaluation value is a case where the target image includes the feature amount distribution 42 shown in FIG. On the other hand, if it is determined in step d7 that there is no feature quantity smaller than the lower limit evaluation value, the process proceeds to step d9.
[0163]
In step d8, the lower limit evaluation value is set as the lower limit threshold value, and the process proceeds to step d9.
[0164]
In step d9, the feature amount of the component corresponding to each label calculated in step d6 is compared with the upper limit evaluation value calculated in step d4 described above, and whether or not there is a feature amount larger than the upper limit evaluation value. Judging. If it is determined in step d9 that there is a feature amount larger than the upper limit evaluation value, the process proceeds to step d10. The case where there is a feature amount larger than the upper limit evaluation value is a case where the target image includes the feature amount distribution 43 shown in FIG. On the other hand, when it is determined in step d9 that there is no feature quantity larger than the upper limit evaluation value, the process proceeds to step d11.
[0165]
In step d10, the upper limit evaluation value is set as the upper limit threshold value, and the process proceeds to step d11.
[0166]
In step d11, it is determined whether or not the processing from step d5 to step d10 has been performed for all target images. If it is determined in step d11 that the processing from step d5 to step d10 has been performed on all target images, the process proceeds to step d12. On the other hand, if it is determined in step d11 that the processing from step d5 to step d10 has not been performed on all target images, the process returns to step d5, and steps d5 to d10 are performed on all target images. The operations from step d5 to step d10 are repeated until the above processes are completed.
[0167]
In step d12, it is determined whether a lower threshold or an upper threshold is set. If it is determined in step d12 that the upper threshold or the lower threshold is set, the process proceeds to step d13.
[0168]
In step d13, a process setting with a filter process is performed, and the process proceeds to step d15 to end the operation process. That is, in step d13, filter processing is generated in order to configure a processing procedure including filter processing in the expert system. In step d13, when the lower limit threshold is set, a filter process for removing a component having a feature amount smaller than the lower limit threshold is generated. When an upper limit threshold is set, a filter process for removing a component having a feature quantity larger than the upper limit threshold is generated. In addition, when both the lower threshold and the upper threshold are set, a filtering process for removing a component having a feature amount smaller than the lower threshold and a feature amount larger than the upper threshold. And filtering to remove components. As a result, when the filter processing generated by the filter processing generation means 20 is one of the processing according to the processing procedure for extracting a graphic close to the sample graphic 12 from the original image 11, a filter unnecessary for the processing according to the processing procedure. Processing is not included.
[0169]
As a result, the processing procedure configured by the expert system can include the filtering process, and the processing procedure for performing the filtering process can be configured after the binarization process or the figure fusion process.
[0170]
On the other hand, if it is determined in step d12 that the upper threshold or the lower threshold is not set, the process proceeds to step d14. In step d14, a process setting without filtering is performed, the process proceeds to step d15, and the operation process is terminated. That is, in step d14, setting is made not to perform the filter processing.
[0171]
As described above, by providing the filter processing generation unit 20, it is possible to identify a noise component in the target image and generate a filter processing that can remove this noise component. In this filter processing, when there is a component having a feature amount exceeding a preset threshold value among components included in the target image, the component is determined as an excessively picked-up component and the component is removed.
[0172]
The target image may include a component having a feature amount close to that of the sample graphic 12, a component having a feature amount larger than that of the sample graphic 12, and a component having a feature amount smaller than that of the sample graphic 12. A component having a feature quantity larger and smaller than the sample figure 12 is considered to be a noise component. When the filter processing generated by the filter processing generation means 20 described above is executed and an image obtained by executing a plurality of processes according to the processing procedure is processed, the components included in the image are completely different from the sample figure 12. Noise components having characteristics can be removed.
[0173]
Therefore, a process of extracting a graphic with higher reliability by making the filter process generated by the filter process generation means 20 one of a plurality of processes according to a process procedure of extracting a graphic close to the sample graphic 12 from the original image 11. The procedure can be configured.
[0174]
In addition, a graphic close to the sample graphic 12 included in the target image does not necessarily match the sample graphic 12 completely. The filter processing generation means 20 uses a value obtained by multiplying the aforementioned minimum feature quantity Smin by a predetermined constant βL, and sets the upper limit evaluation value as a value obtained by multiplying the aforementioned maximum feature quantity Smax by a predetermined constant βH. A filter process for reliably extracting a graphic close to the sample graphic 12 from the original image 11 can be generated without removing the graphic close to the graphic 12.
[0175]
Further, as described above, the filter processing generation unit 20 generates a filter process for removing a component having a feature amount smaller than the lower limit threshold, and removes a component having a feature amount larger than the upper limit threshold. Generating a filtering process to be performed, or generating a filtering process for removing a component having a feature quantity smaller than the lower threshold value and a filtering process for removing a component having a feature quantity larger than the upper threshold value. Can do.
[0176]
Therefore, by configuring the processing procedure including the filter processing generated by the filter processing generation means 20, when processing the original image 11 by executing processing according to the processing procedure, the processing time can be extended as much as possible. A figure close to the sample figure 12 with fewer noise components can be obtained.
[0177]
The stability verification unit 21 executes the plurality of processes according to the processing procedure configured by the image processing procedure design unit 25 even if the luminances of the plurality of original images 11 change, so that the sample graphic 12 is extracted from the original image 11. A degree of stability indicating whether or not a figure close to can be extracted stably is output.
[0178]
The stability verification means 21 follows the number of extracted pixels of the base process image 51 obtained by executing a plurality of processes according to the process procedure and a change process procedure in which a predetermined process is changed among the plurality of processes according to the process procedure. The number of extracted pixels of the modified image 52 obtained by executing a plurality of processes is calculated, and the stability is calculated from the ratio between the number of extracted pixels of the base image 51 and the number of extracted pixels of the modified image 52. The number of extracted pixels is the number of pixels in which the luminance of the base process image 51 and the change process image 52 is equal to or greater than a predetermined threshold value or less than the predetermined threshold value.
[0179]
The base processing image 51 is obtained by executing the processes selected and generated by the preprocessing selection unit 17, the binarization processing selection unit 18, the figure fusion processing generation unit 19, and the filter processing generation unit 20 described above.
[0180]
The change process image 52 is obtained by changing the binarization process selected by the binarization process selection means 18 among a plurality of processes according to the processing procedure by changing the threshold value in the binarization process by a predetermined value 2 It is obtained by executing each processing instead of the value processing.
[0181]
FIG. 20 is a flowchart showing a processing procedure in the stability verification means 21. FIG. 21 is a diagram showing the original image 11 processed by the stability verification means 21, the base processing image 51, and the change processing image 52. FIG. 21 shows two different modified images 52a and 52b. Hereinafter, the change processed images 52a and 52b may be collectively referred to as a change processed image 52. Here, a case where the average luminance of the sample area 31 is higher than the average luminance of the neighboring area 32 will be described.
[0182]
In the expert system, when one processing procedure for extracting a graphic close to the sample graphic 12 from the plurality of original images 11 is configured, the process proceeds from step e0 to step e1. In step e1, the total number of extracted pixels Area1i of the base processed image 51 obtained by executing the processing according to the above processing procedure on one original image 11 is obtained, and the process proceeds to step 2. Here, the total number of extracted pixels Area1i of the base processing image 51 is the number of pixels having a pixel value of 1 when the threshold value or more is set to 1 in the binarization process, and the threshold in the binarization process. When the value below the value is 1, the number of pixels is 0. In addition, i of Area1i representing the total number of extracted pixels of the base processing image 51 is any one of 0 to N. N is a number obtained by subtracting 1 from the total number of original images 11 input to the expert system. The threshold value is selected, for example, as an intermediate value between the average value of the luminance values of the area corresponding to the sample graphic 12 of the basic processed image 51 and the average value of the luminance values of the neighboring areas.
[0183]
In step e2, the binarization process selected by the binarization process selection means 18 described above is replaced with a change binarization process in which the threshold value used in the binarization process is changed by + γ. And the binarization processing selected by the binarization processing selection means 18 are the threshold values used in the binarization processing. Instead of the change binarization process in which is changed by −γ, the total number of extracted pixels Area3i of the second change processed image 52 obtained by executing the process according to the process procedure is obtained, and the process proceeds to step e3. From the experiment results of the present inventors, the above-mentioned value γ is selected between threshold value × 0.01 and threshold value × 0.20, preferably threshold value × 0.05.
[0184]
In step e3, the stability when changing the binarization process in which the threshold value is changed by + γ to one of a plurality of processes according to the processing procedure and the change binarization process in which the threshold value is changed by −γ are processed. The stability is calculated when one of a plurality of processes according to the procedure. The stability is calculated from the above-described ratio of Area1i and Area2i and the ratio of Area1i and Area3i. The stability is calculated by the following equations (10) and (11). Here, P2i indicates the stability when the changed binarization process in which the threshold value is changed by + γ is one of a plurality of processes according to the processing procedure. P3i indicates the stability when the changed binarization process in which the threshold value is changed by −γ is one of a plurality of processes according to the processing procedure.
P2i = Area2i / Area1i × 100% (10)
P3i = Area3i / Area1i × 100% (11)
[0185]
Next, the process proceeds to step e4. In step e4, it is determined whether or not all the original images 11 have been processed to calculate the stability. If it is determined in step e4 that all the original images 11 have been processed to calculate the stability, the process proceeds to step e5. On the other hand, if it is determined in step e4 that all the original images 11 have not been processed and the stability has not been obtained, the process proceeds to step e1 and the operation process from step e1 to step e3 is repeated.
[0186]
In step e5, the minimum value of the stability P2i calculated by the equation (10) and the maximum value of the stability P3i calculated by the equation (11) are obtained. The minimum value among the stability P2i calculated by the equation (10) is P2min, and the maximum value among the stability P3i calculated by the equation (11) is P3max.
[0187]
Next, the process proceeds to step e6, and it is determined whether or not P2min and P3max calculated in step e5 satisfy the following expression (12).
{P2min ≧ η1} & {P3max ≦ η2} (12)
[0188]
In Expression (12), η1 represents the stability reference lower limit value, and η2 represents the stability reference upper limit value. From the experiment results of the present inventors, the safety reference lower limit value η1 is selected between 70% and 100%, preferably 95%. The stability reference upper limit value η2 is selected between 100 and 130%, preferably 105%.
[0189]
If it is determined in step e6 that the expression (12) is satisfied, the process proceeds to step e7. When it is determined in step e6 that the expression (12) is satisfied, for example, a change processed image 52b shown in FIG. 21 is obtained.
[0190]
On the other hand, if it is determined in step e6 that Expression (12) is not satisfied, the process proceeds to step e8. If it is determined in step e6 that Expression (12) is not satisfied, for example, a change processed image 52a shown in FIG. 21 is obtained.
[0191]
In step e7, the minimum stability P2min and the maximum stability P3max are output, and information indicating that the plurality of processes according to the processing procedure are stable with respect to changes in luminance of the plurality of original images 11 is output. Then, the process proceeds to step e9, and the operation process is terminated.
[0192]
In step e8, the minimum stability P2min and the maximum stability P3max are output, and information indicating that the plurality of processes according to the processing procedure are unstable with respect to changes in luminance of the plurality of original images 11 is output. Then, the process proceeds to step e9, and the operation process is terminated.
[0193]
As described above, the stability verification unit 21 stably extracts a figure close to the sample figure 12 from the original image 11 by executing a plurality of processes according to the processing procedure even if the luminance of the plurality of original images 11 changes. Outputs a degree of stability indicating whether or not Therefore, it is possible to know whether or not an image obtained by executing a plurality of processes according to the processing procedure is an image obtained by a plurality of processes following a stable processing procedure with respect to a change in luminance. In addition, if the image is obtained by a plurality of processes according to the processing procedure with high stability, it is possible to limit the cause of the malfunction to the subject when the malfunction occurs in the image.
[0194]
Further, the stability verification means 21 performs a plurality of processes according to the actual processing procedure on the original image 11 and the original image 11 different from the original image 11 in which the luminance of the original image 11 is changed in order to calculate the stability. The process of comparing the images obtained by executing is not performed. Therefore, it is not necessary to input a plurality of original images 11 in which the luminance of the original image 11 is changed for one original image 11, and the stability of the processing procedure can be easily calculated from one original image 11. The processing time for calculating the stability can be shortened as much as possible.
[0195]
Further, the stability verification means 21 changes the threshold value of the binarization process by a predetermined value to generate a change process procedure. Therefore, the change process procedure can be created by an extremely easy process of changing the threshold value of the binarization process, and the stability can be calculated efficiently.
[0196]
When an image captured by an imaging unit such as an electronic camera is input as the original image 11, the luminance of the original image 11 is determined by illumination that illuminates a subject imaged by the imaging unit. It is known that illumination varies slightly with time. For this reason, even when the same subject is imaged by the imaging means, the luminance of the input original image 11 may be different. In the prior art, if there is a defect in the image obtained by executing the process according to the configured processing procedure, identify whether there is a problem with the lighting or the subject Difficult to do.
[0197]
In the present invention, when the stability output by the stability verifying means 21 satisfies the above-described formula (12), it is robust against changes in the environment such as illumination that slightly changes with time, so that the illumination changes. Even so, the region corresponding to the sample figure 12 can be stably extracted. Therefore, the reliability of the processing procedure extracted by the expert system is guaranteed, and the expert system can be used by being incorporated in the image processing apparatus. Further, when the stability output by the stability verification means 21 satisfies the above-described equation (12) and there is a defect in the processed image, the illumination is not the cause, so the subject of investigation of the cause is limited to the subject. can do.
[0198]
A graphic similar to the sample graphic 12 can be extracted from this image by executing a plurality of processes according to the processing procedure configured by the expert system and processing an image similar to the original image 11.
[0199]
In the above-described expert system of the present embodiment, a plurality of original images 11 and corresponding to them are configured by configuring a processing procedure from a plurality of design specimens, that is, a plurality of original images 11 and sample figures 12 corresponding to the original images 11. Variations in the processing procedure between sample figures 12 to be absorbed are absorbed, and a more stable processing procedure can be configured.
[0200]
When features such as the overall luminance value level of the image and the size of the object to be extracted are slightly different between each original image 11 and the corresponding sample graphic 12, a set of the original image 11 and the sample graphic 12. The processing procedure configured by may not work well for other original images 11. On the other hand, the procedural configuration using a large number of sets of original images 11 and corresponding sample figures 12 alleviates the influence of an average luminance value change and a target size change between the images. Parameter values and processing types can be incorporated.
[0201]
This allows the expert system to understand the user's intention more accurately. That is, the expert system can more clearly grasp the purpose of the user's processing, and can reflect the result in the processing procedure.
[0202]
In the expert system described above, a plurality of original images 11 are input. However, the number of input original images 11 may be one.
[0203]
The expert system according to another embodiment of the present invention is different from the expert system according to the above-described embodiment in the operation processing in the preprocessing selection unit 17, the binarization processing selection unit 18, and the figure fusion processing generation unit 19. The configuration of is the same. The expert system according to the present embodiment performs specialized processing when only one original image 11 is input. In the present embodiment, the same reference numerals are assigned to the components corresponding to the expert system of the above embodiment.
[0204]
FIG. 22 is a flowchart showing an operation process of the preprocessing selection unit 17 in the expert system according to another embodiment of the present invention. The operation processing of the preprocessing selection means 17 in the expert system of the present embodiment shown in FIG. 22 is basically the same as the operation processing of the preprocessing selection means 17 in the expert system of the above-described embodiment shown in FIG. And step c12 is excluded.
[0205]
When one set of design samples is input, the process proceeds from step f0 to step f1. In step f1, a plurality of noise removal processes are performed on the original image 11, and the process proceeds to step f2. In step f2, when all the noise removal processes are executed on the original image 11, the processing time for each noise removal process is calculated at the same time.
[0206]
The preprocessing selection means 17 performs all the executable noise removal processing to remove noise from the original image 11. The preprocessing selection means 17 is provided with a plurality of processing modules as noise removal processing. The processing module includes a moving average process and a median filter. In the present embodiment, for example, as noise removal processing, there are two processing modules of moving average processing (1 to 5 times) and median filter (1 to 5 times). In this case, in step f1, a total of 10 types of processing modules are provided. Noise removal processing is executed to remove noise from the original image 11.
[0207]
In step f2, the luminance of the area corresponding to the sample figure 12 of the original image 11 processed by executing one noise removal process among the plurality of noise removal processes is calculated, the luminance distribution is obtained, and the process proceeds to step f3. . Hereinafter, the original image 11 after the noise removal process may be referred to as a first processed image. In addition, in the original image 11 after the noise removal process, an area corresponding to the sample figure 12 may be described as a sample area.
[0208]
In step f3, the brightness of the vicinity region of the first processed image whose brightness has been calculated in step f2 is calculated, the brightness distribution is obtained, and the process proceeds to step f4.
[0209]
In step f4, it is determined whether or not there is an overlap between the luminance distribution of the sample area and the luminance distribution of the neighboring area from the luminance distribution of the sample area obtained in step f2 and the luminance distribution of the neighboring area obtained in step f3. calculate.
[0210]
In step f5, it is determined whether or not each process from step f2 to step f4 has been executed for all the first processed images. If it is determined in step f4 that the processes from step f2 to step f4 have been executed for each first processed image, the process proceeds to step f6. On the other hand, if it is determined in step f5 that the processes from step f2 to step f4 have not been executed for all the first processed images, the process proceeds to step f2, and the processes in steps f2 and f4 are performed. The process for the first processed image that has not been performed is executed.
[0211]
In step f6, referring to the result of determining whether or not the luminance distribution in the sample area and the luminance distribution in the neighboring area overlap in step f4, the luminance distribution in the sample area and the neighboring area in all the noise removal processes It is determined whether or not there is a noise removal process that does not overlap with the luminance distribution. Noise removal processing that does not overlap the luminance distribution of the sample region and the luminance distribution of the neighboring region may be described as noise removal processing without overlap. If it is determined in step f6 that there is a noise removal process without overlap, the process proceeds to step f7.
[0212]
In step f7, the fastest process among the noise elimination processes without overlap, that is, the noise removal process for which the noise removal process is performed the shortest is selected, the process proceeds to step f11, and the flow is terminated. When the original image 11 is processed by the noise elimination process without overlapping, the sample area and the neighboring area can be separated with high accuracy regardless of which noise elimination process is executed. That is, the sample region can be extracted with high accuracy. Therefore, in such a case, it is possible to shorten the processing time in the time-consuming noise removal processing by selecting the noise removal processing that provides the fastest processing speed.
[0213]
On the other hand, if it is determined in step f6 that there is no noise removal processing without overlapping, the process proceeds to step f8. In step f8, the degree of separation of the processed original image 11 is calculated by executing one noise removal process among the plurality of noise removal processes, and the process proceeds to step f9.
[0214]
In step f9, it is determined whether or not the degree of separation has been calculated for all the first processed images. If it is determined that the degree of separation has been calculated for all the first processed images, the process proceeds to step f10. On the other hand, if it is determined in step f9 that the calculation of the degree of separation has not been performed for all the first processed images, the process proceeds to step f7 to calculate the degree of separation of the first processed image for which the degree of separation has not been calculated. .
[0215]
In step f10, based on the degree of separation calculated in step f8, a noise removal process that maximizes the degree of separation is selected for each processing module, the process proceeds to step f10, and the operation process ends. For example, when the noise removal process includes the moving average process and the median filter described above, the image having the highest degree of separation is selected as the noise removal process from the original images 11 processed by executing the moving average process, and the median filter is selected. Among the original images 11 processed by executing the above, the image having the highest degree of separation is selected as the noise removal process.
[0216]
In step f10, since the noise removal process with the highest degree of separation is selected for each processing module, binarization described later is performed using the original image that has been subjected to the noise removal process selected by the preprocessing selection unit 17. When the process selection unit 18 selects the binarization process, the accuracy of the generated process procedure can be improved.
[0217]
As described above, the preprocessing selection unit 17 determines the processing speed based on the luminance distribution of the region corresponding to the sample figure of the original image 11 processed by performing the noise removal processing and the luminance distribution of the neighboring region. It is possible to select a noise removal process that prioritizes or prioritizes the degree of separation, and a processing procedure with a short processing time can be configured without degrading accuracy. Thus, in the expert system, the processing procedure can be configured by adjusting the processing speed of the noise removal processing for removing noise, and the adjustment of the processing speed of the noise removal processing can be reduced as much as possible after the processing procedure is generated. .
[0218]
In the present embodiment, after calculating the luminance distribution of the sample area in step f2, the luminance distribution of the neighboring area is calculated in step f3. However, in still another embodiment of the present invention, the steps f2 and The order of f3 may be reversed.
[0219]
In the present embodiment, the noise removal process with the highest degree of separation is selected for each processing module in step f10. However, in the other embodiments of the present invention, the noise with the highest degree of separation is selected. One removal process may be selected. In this case, the processing time in the binarization process selection means 18 mentioned later can be shortened.
[0220]
The two-process processing selection means 18 of the present embodiment is a threshold for binarizing the original image 11 processed by executing the noise removal process selected by the pre-processing selection means 17, that is, the first processed image. Are changed in stages and binarization processing is executed. The binarization processing selection means 18 determines a threshold value that maximizes the degree of coincidence between the above-described second processed image and the sample graphic 12, and selects the binarization processing using this as a threshold value. When there are a large number of threshold values with the highest degree of coincidence, a range of threshold values with the same degree of coincidence is obtained, and the median value of this range is set as the threshold value.
[0221]
When there are a plurality of noise removal processes selected by the preprocessing selection unit 17, the binarization process selection unit 18 performs a plurality of binarization processes on the original image 11 processed by executing the respective noise removal processes. To select one binarization process that maximizes the degree of coincidence described above. Thereby, when the binarization process selected by the binarization process selection unit 18 is executed and the degree of coincidence is maximized, the noise removal process for obtaining the first processed image before the binarization process is performed. This is one of the processing procedures in the expert system.
[0222]
The figure fusion process generating means 19 executes a plurality of figure fusion processes on the second processed image, and the degree of coincidence between the area corresponding to the sample figure of the image obtained by executing the plurality of figure fusion processes and the sample figure 12 Is calculated. If the degree of coincidence is greater than the degree of coincidence between the sample figure 12 and the area corresponding to the sample figure 12 of the second processed image before the figure fusion process, the figure fusion processing generating unit 19 A graphic fusion process that maximizes the matching degree is selected from the fusion processes, and if the matching degree does not change or the matching degree decreases, it is selected not to perform the graphic fusion process.
[0223]
First, the graphic fusion processing generating unit 19 is able to obtain a first processed image used by the binarization processing selecting unit 18 from the original image 11 among the noise removing processing selected by the preprocessing selecting unit 17. The graphic fusion processing is performed on one original image 11 processed by executing the processing and the binarization processing selected by the binarization processing selection means 18, that is, one second processing image. The figure fusion process generation means 19 executes all of the plurality of figure fusion processes to process the second processed image.
[0224]
In the present embodiment, the figure fusion process generating means 19 is, for example, 4 by combining the expansion process (1 to 2 times) and the contraction process (1 to 2 times) of “expansion process → shrink process” as the figure fusion process. Perform one process. The graphic fusion process generating means 19 is configured such that the degree of coincidence between the sample graphic 12 and the area corresponding to the sample graphic 12 of the image obtained by executing the four processes on the second processed image is the second before the graphic fusion process. When the degree of matching between the region corresponding to the sample figure 12 of the processed image and the sample figure 12 is larger, the figure fusion process that maximizes the degree of matching is selected from a plurality of figure fusion processes. The degree of coincidence is similarly obtained by the above-described equation (7).
[0225]
In addition, the graphic fusion processing generation unit 19 determines that the degree of coincidence between the sample graphic 12 and the region corresponding to the sample graphic 12 of the image obtained by executing the four processes is that of the second processed image before the graphic fusion processing. When the degree of matching between the area corresponding to the sample figure 12 and the sample figure 12 is greater, the figure fusion process is selected. If the degree of coincidence calculated by executing the four processes is the same, Select the one with the fewest number of fusion processes. As a result, the amount of calculation when processing according to the configured processing procedure is executed can be reduced, and the processing time can be shortened as much as possible.
[0226]
Since the expert system of the present embodiment has less operation processing than the expert system of the above-described embodiment shown in FIG. 1, the processing procedure can be configured in a shorter time from a set of design samples.
[0227]
Since the expert system according to the present embodiment is realized by a program executable by a computer, by causing the computer to execute the program, the computer operates according to each of the flowcharts described above and achieves the above-described operation. be able to. Such processing can be performed in a short time.
[0228]
An expert system according to another embodiment of the present invention may be realized by a recording medium on which the program is recorded. By causing the computer to read and execute the program recorded on the recording medium, the program operates according to each of the flowcharts described above, and the above-described operation can be achieved. In addition, the above-described processing can be performed in a short time. In addition, since the program can be easily supplied to a plurality of computers via the recording medium, the scope of use of the present invention is expanded.
[0229]
In each of the above-described embodiments, the sample graphic 12 is created by the sample creation means 14 by inputting information for creating the sample graphic 12 to the expert system. However, in other embodiments of the present invention, Instead of providing the sample creation means 14 in the expert system, a sample figure 12 as shown in FIG. 3 may be created separately and the sample figure 12 itself may be input.
[0230]
【The invention's effect】
  According to the present invention, when the dead zone region is created, the sample figure is not the same as the image of the region to be extracted from the original image, and is slightly larger or smaller than the image of the region to be extracted from the original image Even so, the processing procedure configured in the image processing expert system is equal to the processing procedure configured when the sample graphic is the same as the image of the region to be extracted.
  In addition, when the ratio of the dead zone area to the area corresponding to the sample figure of the original image or the neighboring area exceeds a predetermined ratio, the dead zone area is provided with means for re-creating the dead zone area so that the dead zone area is a sample figure of the original image. Therefore, it is possible to prevent the ratio of the area corresponding to or near the area from becoming too large, and to configure a processing procedure for extracting a figure close to the sample figure with high accuracy from the original image.
[0231]
Therefore, even if it is not possible to accurately create a sample figure in units of one pixel in accordance with the image of the area desired to be extracted from the original image, for example, the sample figure can be accurately designated in units of one pixel in accordance with the area to be extracted from the original image The result of evaluation similar to the case of creating can be obtained, and the processing procedure can be correctly evaluated. In other words, the procedure can be correctly evaluated even if the accuracy of the sample figure is somewhat rough. For this reason, the stability with respect to the structure of a processing procedure can be improved, and the processing procedure which extracts a more reliable figure can be comprised, without reducing the evaluation precision of an expert system. This makes it possible to incorporate the image processing procedure design expert system into the image processing apparatus.
[0233]
Further, according to the present invention, the dead zone creating means creates a neighboring region excluding a region where the luminance distribution overlaps when the luminance distribution of the sample figure and the neighboring region overlap. As a result, the luminance difference between the area corresponding to the sample graphic of the original image and its neighboring area can be increased. Therefore, when constructing a processing procedure for extracting a figure close to the sample figure from the original image, it becomes easier to separate the area corresponding to the sample figure of the original image and its neighboring area, so that a more reliable figure Can be configured. In addition, by creating a neighboring region excluding the region corresponding to the sample figure of the original image, it is possible to reduce the calculation processing when configuring the processing procedure, and to reduce the time for configuring the processing procedure. .
[0234]
According to the present invention, a neighborhood region is created around the region corresponding to the sample graphic of the original image. The dead zone creation means creates a dead zone that is excluded from the processing target on at least one of the outer side and the outer side of the boundary between the region corresponding to the sample graphic of the original image and the neighboring region.
[0235]
  By creating a dead zone region, image processing is possible even if the sample figure is not the same as the image of the region that you want to extract from the original image and is slightly larger or smaller than the image of the region that you want to extract from this original image. The processing procedure configured in the procedure design expert system is equal to the processing procedure configured when the sample graphic is the same as the image of the region to be extracted.
  Further, when the ratio of the dead zone area to the area corresponding to the sample figure of the original image or the neighboring area exceeds a predetermined ratio, the dead zone area corresponds to the sample figure of the original image by creating the dead zone area again. It is possible to prevent the proportion of the area or the neighboring area from becoming too large, and to configure a processing procedure for extracting a figure close to the sample figure from the original image with high accuracy.
[0236]
Therefore, even if it is not possible to accurately create a sample figure in units of one pixel in accordance with the image of the area desired to be extracted from the original image, for example, the sample figure can be accurately designated in units of one pixel in accordance with the area to be extracted from the original image The result of evaluation similar to the case of creating can be obtained, and the processing procedure can be correctly evaluated. In other words, the procedure can be correctly evaluated even if the accuracy of the sample figure is somewhat rough. For this reason, the stability with respect to the configuration of the processing procedure can be improved, and the processing procedure for extracting a more reliable figure can be configured without degrading the evaluation accuracy of the image processing procedure design expert system.
[0237]
Further, according to the present invention, by causing the computer to execute the program, the computer can operate according to the above-described evaluation processing method and achieve the above-described operation. Moreover, the said evaluation processing method can be performed in a short time.
[0238]
According to the present invention, the computer can be operated according to the above-described evaluation processing method by causing the computer to read and execute the program recorded on the recording medium. Moreover, the said evaluation processing method can be performed in a short time. In addition, since the program can be easily supplied to a plurality of computers via the recording medium, the scope of use of the present invention is expanded.
[Brief description of the drawings]
FIG. 1 is a diagram schematically showing an algorithm of an image processing procedure design expert system characterized by evaluation processing according to an embodiment of the present invention.
FIG. 2 is a functional block diagram showing a basic configuration of an expert system.
FIG. 3 is a diagram for explaining creation of a sample 26 by the sample creation means 14;
FIG. 4 is a diagram illustrating an example of a neighborhood contour line of a target region 27;
FIG. 5 is a diagram showing another example of the vicinity contour line of the target region 27;
FIG. 6 is a flowchart for explaining an operation process of the sample creation means 14;
7 is a diagram showing a neighborhood area 32 and a dead zone area 33 created around the area 21 corresponding to the sample figure 12 of the original image 11 by the dead zone creating means 14. FIG.
FIG. 8 is a diagram for explaining a neighborhood region 32 and a dead zone region 33;
FIG. 9 is a flowchart showing an operation process of the dead zone region creating unit 15;
10 is a diagram showing an example of a luminance distribution 31a of a sample region 31 and a luminance distribution 32a of a neighboring region 32 created by the dead zone region creating unit 15. FIG.
11 is a diagram showing an example of the luminance distribution 31a of the sample region 31 and the luminance distribution 32b of the neighboring region 32 when the neighboring region 32 is created except for the region overlapping the luminance distribution 32a of the sample region 31. FIG. It is.
12 is a diagram showing a luminance distribution 31a of a sample region 31 and a luminance distribution 37a of a background region. FIG.
13 is a diagram showing a luminance distribution 31a of a sample area 31 and a luminance distribution 37a of a background area. FIG.
FIG. 14 is a flowchart showing an operation process of the luminance conversion determination unit 16;
FIG. 15 is a flowchart showing an operation process of the preprocessing selection unit 17;
FIG. 16 is a diagram illustrating an example of a luminance distribution 38 of a first sample region and a luminance distribution 39 of a first neighboring region.
FIG. 17 is a diagram illustrating an example of a luminance distribution 38 of a first sample region and a luminance distribution 39 of a first neighboring region.
FIG. 18 is a flowchart showing an operation process of the filter process generation unit 20;
FIG. 19 is a diagram illustrating an example of a distribution of feature amounts of components included in a target image.
20 is a flowchart showing a processing procedure in stability verification means 21. FIG.
21 is a diagram showing an original image 11, a base process image 51, and a change process image 52 processed by the stability verification means 21. FIG.
FIG. 22 is a flowchart showing an operation process of the preprocessing selection unit 17 in the expert system according to another embodiment of the present invention.
FIG. 23 is a diagram schematically showing an algorithm of a prior art image processing procedure design expert system.
FIG. 24 is a diagram schematically showing a neighboring region 8 created around a region corresponding to a sample figure 12 of an original image 11;
[Explanation of symbols]
11 Original image
12 Sample figures
13 Image processing means
15 Dead zone creation means
31 sample area
32 Neighborhood
33 Dead zone area

Claims (5)

原画像および原画像に対応するサンプル図形が入力され、複数の画像処理手段を組合せて、原画像からサンプル図形に近い図形を抽出する処理手順を構成する画像処理手順設計エキスパートシステムであって、
原画像のサンプル図形に対応する領域の周囲に近傍領域を作成するとともに、原画像のサンプル図形に対応する領域とその近傍領域との境界部よりも外側および内側のうち少なくともいずれか一方に、処理対象から除外される不感帯領域を作成する不感帯領域作成手段を含み、
前記不感帯領域作成手段は、前記不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成する手段を含むことを特徴とする評価処理に特長をもつ画像処理手順設計エキスパートシステム。
An image processing procedure design expert system that constitutes a processing procedure in which an original image and a sample graphic corresponding to the original image are input and a plurality of image processing means are combined to extract a graphic close to the sample graphic from the original image,
Create a neighboring area around the area corresponding to the sample figure of the original image, and process the area corresponding to the sample figure of the original image and at least one of the outside and the inside of the boundary between the neighboring areas Including a dead zone creation means for creating a dead zone excluded from the target,
The dead zone region creating means includes means for creating the dead zone region again when the ratio of the dead zone region to the region corresponding to the sample graphic of the original image or the neighboring region exceeds a predetermined rate. An image processing procedure design expert system with features in evaluation processing.
原画像および原画像に対応するサンプル図形が入力され、複数の画像処理手段を組合せて、原画像からサンプル図形に近い図形を抽出する処理手順を構成する画像処理手順設計エキスパートシステムであって、
原画像のサンプル図形に対応する領域の周囲に近傍領域を作成するとともに、原画像のサンプル図形に対応する領域とその近傍領域との境界部よりも外側および内側のうち少なくともいずれか一方に、処理対象から除外される不感帯領域を作成する不感帯領域作成手段を含み、
前記不感帯領域作成手段は、原画像のサンプル図形に対応する領域とその近傍領域との輝度分布が重なる場合、輝度分布の重なる領域を除いて近傍領域を作成することを特徴とする評価処理に特長をもつ画像処理手順設計エキスパートシステム。
An image processing procedure design expert system that constitutes a processing procedure in which an original image and a sample graphic corresponding to the original image are input and a plurality of image processing means are combined to extract a graphic close to the sample graphic from the original image,
Create a neighboring area around the area corresponding to the sample figure of the original image, and process the area corresponding to the sample figure of the original image and at least one of the outside and the inside of the boundary between the neighboring areas Including a dead zone creation means for creating a dead zone excluded from the target,
The dead zone region creating means creates an adjacent region excluding the region where the luminance distribution overlaps when the luminance distribution of the region corresponding to the sample figure of the original image and its neighboring region overlap. An image processing procedure design expert system.
原画像および原画像に対応するサンプル図形が入力され、複数の画像処理手段を組合せて、原画像からサンプル図形に近い図形を抽出する処理手順を構成する画像処理手順設計エキスパートシステムの評価処理方法であって、
原画像のサンプル図形に対応する領域の周囲に近傍領域を作成するとともに、原画像のサンプル図形に対応する領域とその近傍領域との境界部よりも外側および内側のうち少なくともいずれか一方に、処理対象から除外される不感帯領域を作成し、
前記不感帯領域が原画像のサンプル図形に対応する領域もしくは近傍領域に対して占める割合が予め定める割合を超える場合、不感帯領域を再度作成することを特徴とする評価処理に特長をもつ画像処理手順設計エキスパートシステムの処理方法。
An evaluation processing method of an image processing procedure design expert system that constitutes a processing procedure in which an original image and a sample graphic corresponding to the original image are input and a plurality of image processing means are combined to extract a graphic close to the sample graphic from the original image. There,
Create a neighboring area around the area corresponding to the sample figure of the original image, and process the area corresponding to the sample figure of the original image and at least one of the outside and the inside of the boundary between the neighboring areas Create a dead zone area to be excluded from the target,
Image processing procedure design characterized by an evaluation process characterized by re-creating a dead zone when the proportion of the dead zone to the area corresponding to the sample figure of the original image or the neighboring area exceeds a predetermined ratio Expert system processing method.
請求項記載の画像処理手順設計エキスパートシステムの評価処理方法をコンピュータによって実行させるためのプログラム。A program for causing a computer to execute the evaluation processing method of the image processing procedure design expert system according to claim 3 . 請求項記載の画像処理手順設計エキスパートシステムの評価処理方法をコンピュータによって実行させるためのプログラムが記録された記録媒体。A recording medium on which a program for causing a computer to execute the evaluation processing method of the image processing procedure design expert system according to claim 3 is recorded.
JP2003007513A 2003-01-15 2003-01-15 An image processing procedure design expert system with features in evaluation processing. Expired - Lifetime JP4188707B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003007513A JP4188707B2 (en) 2003-01-15 2003-01-15 An image processing procedure design expert system with features in evaluation processing.

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003007513A JP4188707B2 (en) 2003-01-15 2003-01-15 An image processing procedure design expert system with features in evaluation processing.

Publications (2)

Publication Number Publication Date
JP2004220363A JP2004220363A (en) 2004-08-05
JP4188707B2 true JP4188707B2 (en) 2008-11-26

Family

ID=32897587

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003007513A Expired - Lifetime JP4188707B2 (en) 2003-01-15 2003-01-15 An image processing procedure design expert system with features in evaluation processing.

Country Status (1)

Country Link
JP (1) JP4188707B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7010783B2 (en) * 2018-07-23 2022-01-26 株式会社東芝 Image processing equipment, image processing system, image processing method and program

Also Published As

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

Similar Documents

Publication Publication Date Title
JP6936958B2 (en) Data generator, data generation method and data generation program
JP4154374B2 (en) Pattern matching device and scanning electron microscope using the same
JP4206723B2 (en) Image processing method and image processing apparatus
JP2007207009A (en) Image processing method and image processor
US11747284B2 (en) Apparatus for optimizing inspection of exterior of target object and method thereof
JP6448065B2 (en) Image processing system, image processing method, and image processing program
JP2010082245A (en) Hair information measuring method
JP2006208339A (en) Region-extracting device, microscope system and region-extracting program
CN109544571A (en) A kind of metallic phase image edge detection method based on mathematical morphology
JP2022003495A (en) Inspection device, unit selection device, inspection method, and inspection program
JP4599110B2 (en) Image processing apparatus and method, imaging apparatus, and program
JP2006279442A (en) Image processing method, apparatus, and program
JP4801697B2 (en) Image forming method, image forming apparatus, and computer program
JPH07210655A (en) Image processor for ophthalmology
JP4098098B2 (en) An image processing procedure design expert system characterized by stability verification.
JP4188707B2 (en) An image processing procedure design expert system with features in evaluation processing.
JP7392368B2 (en) Image processing device, system, program
JP4188708B2 (en) An image processing procedure design expert system with features for sample preparation
JP4098097B2 (en) An image processing procedure design expert system with features in luminance evaluation.
JP4101663B2 (en) An image processing procedure design expert system featuring pre-processing evaluation.
CN107851303B (en) Histopathological image registration method and device
JP2004220367A (en) Image processing procedure design expert system having feature in filtering processing by feature amount
CN114359279A (en) Image processing method, image processing device, computer equipment and storage medium
JP4630106B2 (en) Corneal endothelial cell image processing device
JP2711649B2 (en) Surface scratch detection method for inspection object

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080226

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080610

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080801

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

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

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120919

Year of fee payment: 4