JP4210126B2 - Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded - Google Patents

Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded Download PDF

Info

Publication number
JP4210126B2
JP4210126B2 JP2003007530A JP2003007530A JP4210126B2 JP 4210126 B2 JP4210126 B2 JP 4210126B2 JP 2003007530 A JP2003007530 A JP 2003007530A JP 2003007530 A JP2003007530 A JP 2003007530A JP 4210126 B2 JP4210126 B2 JP 4210126B2
Authority
JP
Japan
Prior art keywords
circle
pixels
image processing
detected
great
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003007530A
Other languages
Japanese (ja)
Other versions
JP2004220370A (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
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP2003007530A priority Critical patent/JP4210126B2/en
Publication of JP2004220370A publication Critical patent/JP2004220370A/en
Application granted granted Critical
Publication of JP4210126B2 publication Critical patent/JP4210126B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、撮像装置などから入力された画像データに対して図形処理を行う画像処理方法および画像処理装置に関し、特に画像データに含まれる円形画像の中心検出を行う画像処理方法および画像処理装置ならびに画像処理プログラムおよび画像処理プログラムを記録した記録媒体に関する。
【0002】
【従来の技術】
製品組立ての自動化および検品作業の自動化などを高精度で実現するために、製品および部品などをカメラで撮像し、得られた画像データに対して各種画像処理を行う画像処理装置が必要となっている。
【0003】
特に製品の筐体や部品が円形状の部分を有し、この部分を組立て時の位置合わせ用マークや検査部品として用いる場合は、画像処理によって円形状の中心を検出し、検出した中心を基準として部品の移動および検査を行う。
【0004】
筐体や部品には、欠けやバリが存在し、図6に示すように、円形状の部分にこれらが存在すると、円中心の検出精度が大きく低下してしまう。そのため、画像データの円中心を高精度で検出する技術が、数多く開発されている。
【0005】
たとえば、特許文献1記載の円中心位置測定方法は、図7の円中心位置検出フローチャートに示すように、ステップA1で、カメラで撮像した画像について、微分フィルタによってエッジ点を検出し、ステップA2で、求めたエッジ点の集合から、平均四乗誤差最小法により円弧近似を行い円中心の位置を推定し、ステップA3で、推定された円の円周から離れた点を除いたエッジ点の集合について、平均四乗誤差最小法により再度円近似を行い円中心の位置を推定する。
【0006】
この方法の特徴は、2回の円近似を行うことで、円周上にゴミや欠けがある場合にも高精度で円中心を検出できることである。
【0007】
また、特許文献2記載の円形状パターン計測・位置認識装置は、検出したエッジ点から円の近似式を算出し、近似式による円中心から所定の範囲内で基準点を設ける。各基準点からエッジ点までの距離を算出して、距離と度数のヒストグラムを作成し、最頻度数をもつヒストグラムを構成した基準点を円中心とする。
【0008】
この装置の特徴は、ヒストグラムを用いることにより、エッジとして検出されたノイズを除去することで、ノイズが存在する場合であっても、高精度で円中心を検出できることである。
【0009】
【特許文献1】
特開平7−225843号公報
【特許文献2】
特開平7−210654号公報
【0010】
【発明が解決しようとする課題】
上記の従来技術では、1つの円形状について円周上の欠けやノイズの影響を無くして、高精度で円中心を検出することができる。しかし、実際には2以上の円形状について円中心を検出する場合がある。たとえば、部品の位置合わせにおいて、基準面および部品に備えられる位置合わせ用のマークが、それぞれ半径の異なる円形状であって、部品を移動させて、これらの円中心を一致させる場合がある。このとき、部品を移動させている途中で、基準面の円周上に部品の円が重なると、従来の技術では部品の円を欠けとして円中心を算出してしまい、円周上の円の円中心を算出することができないという問題がある。さらに、ノイズや欠けなどに加え異物が混在し、この異物のため円が分断されると、従来の技術では精度よく円中心を検出することは困難である。
【0011】
本発明の目的は、画像データで表示される複数の円についてそれぞれの中心位置を高精度で検出する画像処理方法および画像処理装置ならびに画像処理プログラムおよび画像処理プログラムを記録した記録媒体を提供することである。
【0012】
【課題を解決するための手段】
本発明は、画像データで表示される、他の円と大きさが異なる円を含む複数の円に対して、各円の中心位置を検出する画像処理方法であって、
複数の円のうち最も大きな円である大円を含む領域を特定する大円領域特定ステップと、
大円領域内のエッジ画素を検出し、検出したエッジ画素を大円の円周を構成する大円周候補画素として検出する大円周候補画素検出ステップと、
検出された大円周候補画素に対して多段階の円近似を行い、大円の中心位置および半径を検出する大円検出ステップと、
検出された中心位置および半径に基づき大円エッジを含まないよう大円内でラベリングし、1つの小円を含む領域を1または複数特定する小円領域特定ステップと、
小円領域内のエッジ画素を検出し、検出したエッジ画素を小円の円周を構成する小円周候補点画素として検出する小円周候補画素検出ステップと、
検出された小円周候補画素に対して多段階の円近似を行い、小円の中心位置および半径を検出する小円検出ステップとを有することを特徴とする画像処理方法である。
【0013】
本発明に従えば、まず、大円領域特定ステップで、複数の円のうち最も大きな円である大円を含む領域を特定する。大円周候補画素検出ステップで、大円領域内のエッジ画素を検出し、検出したエッジ画素を大円の円周を構成する大円周候補画素として検出する。
【0014】
この検出された大円周候補画素に対して、大円検出ステップでは、多段階の円近似を行い、大円の中心位置および半径を検出する。このステップで大円の中心位置が決定する。
【0015】
次に、小円領域特定ステップでは、検出された中心位置および半径に基づき大円エッジを含まないよう大円内でラベリングし、1つの小円を含む領域を1または複数特定する。小円周候補画素検出ステップでは、特定された小円領域内のエッジ画素を検出し、検出したエッジ画素を小円の円周を構成する小円周候補点画素として検出する。
【0016】
検出された小円周候補画素に対して、小円検出ステップで多段階の円近似を行い、小円の中心位置および半径を検出する。このステップで小円の中心位置が決定する。
【0017】
このように、まず大円の中心位置および半径を検出し、検出された中心位置および半径から大円を決定し、決定した大円内で小円の中心位置を検出するので、大円の円周上に小円が重なっている場合でもそれぞれを高精度で検出することができる。
【0018】
また本発明は、前記大円領域特定ステップでは、2値化処理によって下地を構成する画素と下地以外を構成する画素とを分離し、
下地以外を構成する画素の集合の特徴量に基づいて、大円領域を特定することを特徴とする。
【0019】
本発明に従えば、大円は、たとえば部品に備えられているマーカーであったり、螺子穴であったりするので、大円以外の部分、いわゆる下地部分とは色や表面状態が大きく異なっているので、これを撮像した場合の画像データでも、画素値が大きく異なっている。したがって、閾値を適切に設定することで2値化処理によって精度良く分離することができる。下地以外を構成する画素には、円を構成する画素の他に、ゴミなどの異物やノイズに起因する画素もある。円を構成する画素は、複数の画素からなる集合を形成するので、この集合の特徴量から大円が存在する領域を特定する。
【0020】
このように、2値化処理による画素の分離と、画素集合の特徴量とから大円領域を特定するので、容易かつ高精度で領域特定ができる。
【0021】
また本発明は、前記小円領域特定ステップでは、2値化処理することによって大円を構成する画素と大円以外を構成する画素とを分離し、
大円以外を構成する画素の集合の特徴量に基づいて、小円領域を特定することを特徴とする。
【0022】
本発明に従えば、小円は、大円とは異なるマーカーであったり、螺子であったりするので、これを撮像した場合の画像データでも、濃度が大きく異なっている。したがって、閾値を適切に設定することで、大円内を2値化ラベリングすることによって精度良く分離することができる。小円を構成する画素は、複数の画素からなる集合を形成するので、この集合の特徴量から小円が存在する領域を特定する。
【0023】
このように、2値化処理による画素の分離と、画素集合の特徴量とから大円領域を特定するので、容易かつ高精度で領域特定ができる。
【0024】
また本発明は、前記特徴量は、画素の集合に含まれる画素数および画素の集合のフェレ径であることを特徴とする。
【0025】
本発明に従えば、大円または小円を特定するための特徴量として、画素の集合に含まれる画素数または画素の集合のフェレ径を用いる。ゴミなどの異物やノイズに起因する画素は、円に比べて小さい場合が多いので、画素の集合に含まれる画素数、すなわち面積が比較的大きい集合を円として特定する。また、大きな異物が撮像されてしまった場合は、画素の集合に含まれる画素数だけでは円を特定できない場合がある。しかし、異物の場合、形状が定まっていないので、フェレ径を用い、水平フェレ径と垂直フェレ径の比が1に近い集合を円として特定すればよい。
【0026】
このように、画素の集合の面積およびフェレ径によって円の存在する領域を特定するので、異物やノイズを円として検出する誤検出を防止することができる。
【0027】
また本発明は、前記多段階の円近似は、円周候補画素に基づいて中心位置および半径を検出する処理と、円周候補画素のうち検出した中心位置および半径に基づく円の円周からの距離が所定の距離より近い画素を新たな円周候補画素とする処理とを1段階とし、これを複数回繰り返すことを特徴とする。
【0028】
本発明に従えば、多段階の円近似は、次のような1段階の処理を複数繰り返すことによって行う。1段階の処理は、2つの処理からなり、まず、第1の処理として、円周候補画素に基づいて中心位置および半径を検出する。次に第2の処理として、円周候補画素のうち検出された中心位置および半径から決まる近似円の円周からの距離が所定の距離より近い画素を新たな円周候補画素とする。再び第1の処理に戻り、第2の処理で得られた新たな円周候補画素から新たな近似円を検出する。これらの処理を繰り返すことによって、円周が欠けていたり、他の円周が重なっている場合でも、高精度で円の中心位置を検出することができる。なお、段階の繰り返しは、3〜5回が望ましい。
【0029】
また本発明は、前記小円検出ステップで検出された中心位置および半径に基づく小円内の全画素のうち、大円を構成する画素および下地を構成する画素を除く画素の割合に基づいて、小円の妥当性を検証する検証ステップをさらに有することを特徴とする。
【0030】
本発明に従えば、小円検出ステップで検出された中心位置および半径に基づく小円内の全画素を計数する。たとえば、異物の一部が円弧状であるため、この円弧を円周の一部として検出してしまうような誤検出があった場合、小円内で円弧を除く部分は、大円か下地を構成する画素である場合が多い。したがって、大円を構成する画素および下地を構成する画素を除く画素の割合が小さい場合、たとえば50%以下のような場合は、誤検出として判定する。
【0031】
このように、一旦検出された小円に対して妥当性を検証することで、より高精度に円の中心位置を検出することができる。
【0032】
また本発明は、上記の画像処理方法をコンピュータに実行させるための画像処理プログラムである。
【0033】
本発明に従えば、上記の画像処理方法をコンピュータに実行させるための画像処理プログラムとして提供することができる。
【0034】
また本発明は、上記の画像処理方法をコンピュータに実行させるための画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体。
【0035】
本発明に従えば、上記の画像処理方法をコンピュータに実行させるための画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体として提供することができる。
【0036】
また本発明は、画像データで表示される、他の円と大きさが異なる円を含む複数の円に対して、各円の中心位置を検出する画像処理装置であって、
複数の円のうち最も大きな円である大円を含む領域を特定する大円領域特定手段と、
大円領域内のエッジ画素を検出し、検出したエッジ画素を大円の円周を構成する大円周候補画素として検出する大円周候補画素検出手段と、
検出された大円周候補画素に対して多段階の円近似を行い、大円の中心位置および半径を検出する大円検出手段と、
検出された中心位置および半径に基づき大円エッジを含まないよう大円内でラベリングし、1つの小円を含む領域を1または複数特定する小円領域特定手段と、
小円領域内のエッジ画素を検出し、検出したエッジ画素を小円の円周を構成する小円周候補点画素として検出する小円周候補画素検出手段と、
検出された小円周候補画素に対して多段階の円近似を行い、小円の中心位置および半径を検出する小円検出手段とを有することを特徴とする画像処理装置である。
【0037】
本発明に従えば、まず、大円領域特定手段が、複数の円のうち最も大きな円である大円を含む領域を特定する。大円周候補画素検出手段は、大円領域内のエッジ画素を検出し、検出したエッジ画素を大円の円周を構成する大円周候補画素として検出する。
【0038】
この検出された大円周候補画素に対して、大円検出手段が、多段階の円近似を行い、大円の中心位置および半径を検出する。この大円検出手段の処理によって大円の中心位置が決定する。
【0039】
次に、小円領域特定手段が、検出された中心位置および半径に基づき大円エッジを含まないよう大円内でラベリングし、1つの小円を含む領域を1または複数特定する。小円周候補画素検出手段は、特定された小円領域内のエッジ画素を検出し、検出したエッジ画素を小円の円周を構成する小円周候補点画素として検出する。
【0040】
検出された小円周候補画素に対して、小円検出手段が多段階の円近似を行い、小円の中心位置および半径を検出する。この小円検出手段の処理によって小円の中心位置が決定する。
【0041】
このように、まず大円の中心位置および半径を検出し、検出された中心位置および半径から大円を決定し、決定した大円内で小円の中心位置を検出するので、大円の円周上に小円が重なっている場合でもそれぞれを高精度で検出することができる。
【0042】
また本発明は、前記小円検出手段で検出された中心位置および半径に基づく小円内の全画素のうち、大円を構成する画素および下地を構成する画素を除く画素の割合に基づいて、小円の妥当性を検証する検証手段をさらに有することを特徴とする。
【0043】
本発明に従えば、小円検出手段によって検出された中心位置および半径に基づく小円内の全画素を計数する。小円内の画素のうち、大円を構成する画素および下地を構成する画素を除く画素の割合が小さい場合は、誤検出として判定する。
【0044】
このように、一旦検出された小円に対して妥当性を検証することで、より高精度に円の中心位置を検出することができる。
【0045】
【発明の実施の形態】
図1は、本発明の画像処理方法を示すフローチャートである。
【0046】
本実施形態では、たとえば、製品の組立ておよび検査の際に、基準となる面に対して部品を正しい位置に移動させる位置合わせを行う場合について説明する。
【0047】
具体的には、基準面に円形状の基準マーカー(固定)を設け、これを固定カメラで撮像する。位置合わせする部品の一部に円形状の部品マーカーを設け、部品を移動装置によって基準面上に載置する。この初期時点では、図2(a)に示すように、基準マーカーM1と部品マーカーM2の位置がずれている画像がカメラで撮像される。
【0048】
位置合わせの目的は、基準マーカーM1の中心位置と部品マーカーM2の中心位置とを一致させることである。したがって、初期時点での画像に画像処理を行い、各マーカーの中心位置を検出し、一致させるために部品を移動させる方向と距離とを算出する。算出されたパラメータに基づいて移動装置が部品を移動させる。移動後に再度マーカーを撮像し、ずれていれば中心位置の検出、移動パラメータの算出、部品の移動を行い、基準マーカーM1の円中心と部品マーカーM2の円の中心位置が一致するまでこれを繰り返す。
【0049】
初期時点および部品を移動させた時点において、図2(b)に示すように、基準マーカーM1の円周上に部品マーカーM2が重なる場合がある。本発明では、このような場合に、それぞれのマーカーの中心位置を精度良く検出する。
【0050】
まず、ステップS1では、大円である基準マーカーM1の画像データにおける領域(大円領域)を特定する。基準マーカーM1は、基準面の他の部分と色などを異ならせて、設けられているので、撮像した画像データに2値化処理を施し、下地と大きく異なる画素値を有する画素を大円を構成する画素として検出する。検出された画素の集合領域の面積またはフェレ径などに基づいて大円の存在する領域を特定する。たとえば、面積に基づく場合は、面積(集合に含まれる画素数)が所定の値以上の領域を大円領域として特定する。フェレ径に基づく場合は、水平フェレ径および垂直フェレ径が所定の値以上であって、その比が1に近い領域を大円領域として特定する。これによって、ゴミやノイズなどによる小さな領域および細長い領域は、大円領域から除外される。
【0051】
なお、撮像した画像データ内に複数の大円を含む場合は、大円領域を複数特定し、以下のステップS2〜S8については大円領域ごとに処理を行えばよい。
【0052】
次にステップS2では、大円の円周を構成する画素の候補を検出する。大円の円周は、基準マーカーM1と下地との境界であるので、ステップS1で特定した大円領域内のエッジ画素を円周候補点として検出する。
【0053】
エッジ画素は、隣接画素との濃度差が大きいので、隣接画素との濃度差を算出して、濃度差が所定の値を越える画素をエッジ画素とする“エッジ検出法”、またはソーベルフィルタなどにより1次微分した後に2値化する“微分2値化法”などで検出することができる。
【0054】
ステップS3では、ステップS2で検出された円周候補点に対して多段階の円近似を行い、大円の中心位置および半径を検出する。
【0055】
多段階の円近似について、図3を用いて詳細に説明する。
図2(b)に示したように、基準マーカーM1の円周上に部品マーカーM2が重なった場合、撮像された画像データはステップS2の時点で図3(a)のような円周候補点からなる画像が得られる。
【0056】
この円周候補点に対して円近似を行うと、図3(b)のように、小円部分の影響により、正しい大円の円中心C1からずれた位置が近似円の円中心C1’として検出され、半径も大円の半径より小さな半径として検出される。
【0057】
次に、図3(c)のように、近似円の円周に所定の幅を持たせた円環Rを設定し、円周候補点のうち、この円環外に位置する円周候補点を除外する。
【0058】
円環内の円周候補点を新たな円周候補点とし、これに基づいて、円近似を行う。このとき、大円の円周から大きく外れた候補点は除外されているので、第1の近似円に比べて大円に近い第2の近似円が検出される。第2の近似円に対して円環を設定し、円環外に位置する円周候補点を除外する。
【0059】
このような、円周候補点に基づく円近似および円環外の候補点の除外を1段階とし、複数回繰り返すことによって、大円を決定する。正確な大円を検出するには、少なくとも2回以上の繰り返しが必要であり、精度と処理量との関係から3〜5回が望ましい。
【0060】
ステップS4では、ステップS3で決定した大円内において、小円である部品マーカーM2の領域(小円領域)を特定する。
【0061】
検出された画素の集合領域の面積またはフェレ径などに基づいて小円の存在する領域を特定する。小円領域内には1つの小円を含むようにし、小円が複数ある場合は、小円領域を複数特定する。
【0062】
ステップS5では、ステップS4で特定した小円領域内のエッジ画素を小円の円周候補点として検出する。
【0063】
ステップS6では、ステップS5で検出された小円の円周候補点に対して多段階の円近似を行い、小円の中心位置および半径を検出する。多段階円近似については、ステップS3の大円の円近似と同様に行う。
【0064】
ステップS7では、全ての小円領域について中心位置の検出を行ったか否かを判断し、全て検出していればステップS8に進み、検出していない小円領域が残っていればステップS5に戻る。
【0065】
ステップS8では、検出された小円が複数あるか否かを判断する。複数あればステップS9に進み、1つであればステップS10に進む。
【0066】
ステップS9では、ステップS6で検出された小円が妥当であるかどうかを検証する。本実施形態のように、大円と小円が各1つあることが予めわかっている場合に、2以上の小円領域が特定され、2以上の小円が検出されると、1つを除く他の小円は、実際には小円ではなく、大円の欠けや異物を誤って小円として検出した誤検出と考えられる。
【0067】
なお、1つの小円領域が特定され、1つの小円が検出されたとしても、その小円が誤検出であることも考えられる。したがって、1つの小円であっても、その妥当性を検証するようにしてもよい。
【0068】
検証方法は、ステップS4で検出された小円を構成する画素が、ステップS6で検出された小円内に占める割合を算出し、所定の割合以下(たとえば50%以下)であれば誤検出と判断する。これは、図4に示すように、実際の小円と異物との間で小円を検出したような場合、検出された小円内に含まれる画素は、円周部分に少量存在するだけであって、大部分は大円を構成する画素である。したがって、大円を構成する画素を除く画素が、小円内に占める割合は小さくなるので、この小円が誤検出であることがわかる。また、所定の割合より大きな小円が複数ある場合は、割合が最も大きいものを小円として判断する。小円の数が複数ある場合には、割合の大きいものから順に小円として判断する。
【0069】
ステップS10では、全ての大円領域について中心位置の検出を行ったか否かを判断し、全て検出していれば処理を終了し、検出していない大円領域が残っていればステップS2に戻る。
【0070】
以上のように、予め大円の中心位置を検出した後、この大円の領域内で小円の中心位置を検出するので、大円の円周上に小円が重なったような場合であっても、高精度で2つの円中心を検出することができる。
【0071】
図5は、画像処理システム100の構成を示すブロック図である。画像処理システム100は、撮像装置1、画像処理装置2、表示装置3を有し、前述のような部品の位置合わせシステムを構成する。
【0072】
撮像装置1は、CCD(電荷結合素子)カメラ11、A/D(アナログ/デジタル)変換器12、カメラコントローラ13、D/A変換器14およびフレームメモリ15からなる。CCDカメラ11が、被写体、上記の実施形態では基準面および部品を撮像し、受光量をアナログ画像信号として出力する。A/D変換器12は、CCDカメラ11から出力されたアナログ画像信号をデジタルデータに変換し、デジタル画像データとして出力する。カメラコントローラ14は、デジタル画像データを1フレームごとにフレームメモリ15に格納するとともに、表示装置3に表示させるために、D/A変換器14に出力する。D/A変換器は、カメラコントローラ14から出力されたデジタル画像データを表示装置3に応じたアナログ画像信号に変換して表示装置3に出力する。表示装置3は、LCD(Liquid Crystal Display)やCRT(Cathode Ray Tube)ディスプレイなどで実現され、撮像装置1から出力されたアナログ画像信号を表示する。
【0073】
画像処理装置2は、CPU(中央演算処理装置)21、RAM(Random Access Memory)22、ROM(Read Only Memory)23およびI/O(Input/Output)コントローラ24からなる。CPU21は、ROM23に記憶されている制御プログラムに基づいて画像処理装置2の動作を制御する。処理中の画像データや演算中のデータなどは一時的にRAM22に記憶される。I/Oコントローラ24は、キーボードやマウスなどの入力装置や部品の移動装置などが接続され、これらの入出力データの制御を行う。
【0074】
CPU21およびROM23は、大円領域特定手段、大円周候補画素検出手段、大円検出手段、小円領域特定手段、小円周候補画素検出手段、小円検出手段および検証手段を構成し、撮像装置2のカメラコントローラ14を介してフレームメモリ15から画像データを取得し、前述のフローチャートで示した画像処理を実行する。画像処理によって、2つの円の中心位置が検出され、たとえば、部品の移動距離および移動方向が算出されると、これらのパラメータが移動装置に出力される。移動装置は、取得したパラメータに基づいて部品を移動させて位置合わせを行う。
【0075】
また、本発明の実施の他の形態は、コンピュータを画像処理装置2として機能させるための画像処理プログラム、および画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体である。これによって、画像処理プログラムおよび画像処理プログラムを記録した記録媒体を持ち運び自在に提供することができる。
【0076】
記録媒体は、プリンタやコンピュータシステムに備えられるプログラム読み取り装置により読み取られることで、画像処理プログラムが実行される。
【0077】
コンピュータシステムの入力手段としては、フラットベッドスキャナ・フィルムスキャナ・デジタルカメラなどを用いてもよい。コンピュータシステムは、これらの入力手段と、所定のプログラムがロードされることにより画像処理などを実行するコンピュータと、コンピュータの処理結果を表示するCRTディスプレイ・液晶ディスプレイなどの画像表示装置と、コンピュータの処理結果を紙などに出力するプリンタより構成される。さらには、ネットワークを介してサーバーなどに接続するための通信手段としてのモデムなどが備えられる。
【0078】
なお、記録媒体としては、プログラム読み取り装置によって読み取られるものには限らず、マイクロコンピュータのメモリ、たとえばROMであっても良い。記録されているプログラムはマイクロプロセッサがアクセスして実行しても良いし、あるいは、記録媒体から読み出したプログラムを、マイクロコンピュータのプログラム記憶エリアにダウンロードし、そのプログラムを実行してもよい。このダウンロード機能は予めマイクロコンピュータが備えているものとする。
【0079】
記録媒体の具体的な例としては、磁気テープやカセットテープなどのテープ系、フレキシブルディスクやハードディスクなどの磁気ディスクやCD−ROM(Compact Disc-Read Only Memory)/MO(Magneto Optical)ディスク/MD(Mini Disc)/DVD(Digital Versatile Disc)などの光ディスクのディスク系、IC(Integrated Circuit)カード(メモリカードを含む)/光カードなどのカード系、あるいはマスクROM、EPROM(Erasable Programmable Read Only Memory)、EEPROM(Electrically Erasable Programmable Read Only Memory)、フラッシュROMなどの半導体メモリを含めた固定的にプログラムを担持する媒体である。
【0080】
また、本実施形態においては、コンピュータはインターネットを含む通信ネットワークに接続可能なシステム構成とし、通信ネットワークを介して画像処理プログラムをダウンロードしても良い。なお、このように通信ネットワークからプログラムをダウンロードする場合には、そのダウンロード機能は予めコンピュータに備えておくか、あるいは別な記録媒体からインストールされるものであっても良い。また、ダウンロード用のプログラムはユーザーインターフェースを介して実行されるものであっても良いし、決められたURL(Uniform Resource
Locater)から定期的にプログラムをダウンロードするようなものであっても良い。
【0081】
【発明の効果】
以上のように本発明によれば、まず大円の中心位置および半径を検出し、検出された中心位置および半径から大円を決定し、決定した大円内で小円の中心位置を検出するので、大円の円周上に小円が重なっている場合でもそれぞれを高精度で検出することができる。
【0082】
また本発明によれば、2値化処理による画素の分離と、画素集合の特徴量とから大円領域を特定するので、容易かつ高精度で領域特定ができる。
【0083】
また本発明によれば、画素の集合の面積およびフェレ径によって円の存在する領域を特定するので、異物やノイズを円として検出する誤検出を防止することができる。
【0084】
また本発明によれば、中心位置および半径の検出と、新たな円周候補画素の決定とを繰り返すことで、円周が欠けていたり、他の円周が重なっている場合でも、高精度で円の中心位置を検出することができる。
【0085】
また本発明によれば、一旦検出された小円に対して妥当性を検証することで、より高精度に円の中心位置を検出することができる。
【0086】
また本発明によれば、上記の画像処理方法をコンピュータに実行させるための画像処理プログラム、および画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体として提供することができる。
【図面の簡単な説明】
【図1】本発明の画像処理方法を示すフローチャートである。
【図2】位置合わせ用マーカーの概略図である。
【図3】多段階の円近似の手順を示す図である。
【図4】誤検出した小円の例を示す図である。
【図5】画像処理システム100の構成を示すブロック図である。
【図6】欠けやバリを伴う部品の例を示す図である。
【図7】従来の円中心位置検出処理を示すフローチャートである。
【符号の説明】
1 撮像装置
2 画像処理装置
3 表示装置
11 CCDカメラ
12 A/D変換器
13 カメラコントローラ
14 D/A変換器
15 フレームメモリ
21 CPU
22 RAM
23 ROM
24 I/Oコントローラ
100 画像処理システム
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing method and an image processing device that perform graphic processing on image data input from an imaging device or the like, and in particular, an image processing method and an image processing device that detect the center of a circular image included in image data, and The present invention relates to an image processing program and a recording medium on which the image processing program is recorded.
[0002]
[Prior art]
In order to realize automation of product assembly and inspection work with high accuracy, an image processing apparatus that captures images of products and parts with a camera and performs various image processing on the obtained image data is required. Yes.
[0003]
In particular, when a product case or part has a circular part and this part is used as an alignment mark or inspection part during assembly, the center of the circle is detected by image processing, and the detected center is used as a reference. Move and inspect parts.
[0004]
The casing and parts have chips and burrs, and as shown in FIG. 6, if these are present in a circular portion, the detection accuracy at the center of the circle is greatly reduced. Therefore, many techniques for detecting the circle center of image data with high accuracy have been developed.
[0005]
For example, in the circle center position measurement method described in Patent Document 1, as shown in the circle center position detection flowchart of FIG. 7, in step A1, an edge point is detected by a differential filter for an image captured by the camera, and in step A2, From the obtained set of edge points, circular arc approximation is performed by the mean square error minimum method to estimate the position of the center of the circle, and in step A3, the set of edge points excluding the points away from the estimated circle circumference For, the circle approximation is again performed by the mean square error minimum method to estimate the position of the circle center.
[0006]
The feature of this method is that the center of the circle can be detected with high accuracy even if there is dust or a chip on the circumference by performing the circle approximation twice.
[0007]
The circular pattern measurement / position recognition device described in Patent Document 2 calculates an approximate expression of a circle from the detected edge point, and provides a reference point within a predetermined range from the center of the circle based on the approximate expression. The distance from each reference point to the edge point is calculated, a histogram of distance and frequency is created, and the reference point constituting the histogram having the highest frequency is set as the center of the circle.
[0008]
The feature of this apparatus is that it is possible to detect the center of a circle with high accuracy even when noise is present by removing noise detected as an edge by using a histogram.
[0009]
[Patent Document 1]
Japanese Patent Laid-Open No. 7-225843
[Patent Document 2]
JP-A-7-210654
[0010]
[Problems to be solved by the invention]
With the above-described conventional technology, it is possible to detect the center of a circle with high accuracy by eliminating the influence of chipping and noise on one circle. However, in practice, the center of the circle may be detected for two or more circular shapes. For example, in the alignment of parts, the alignment marks provided on the reference plane and the parts may have circular shapes with different radii, and the parts may be moved to match the centers of the circles. At this time, if the part circle overlaps the circumference of the reference plane while moving the part, the conventional technique calculates the center of the circle with the part circle missing, and the circle on the circumference There is a problem that the center of the circle cannot be calculated. Furthermore, in addition to noise and chipping, foreign matters are mixed, and if the circle is divided due to the foreign matters, it is difficult to accurately detect the center of the circle with the conventional technology.
[0011]
An object of the present invention is to provide an image processing method, an image processing apparatus, an image processing program, and a recording medium on which the image processing program is recorded, which detects each center position with high accuracy for a plurality of circles displayed as image data. It is.
[0012]
[Means for Solving the Problems]
The present invention is an image processing method for detecting the center position of each circle with respect to a plurality of circles including a circle having a size different from that of other circles displayed as image data,
A great circle region identification step for identifying a region including a great circle which is the largest circle among a plurality of circles;
A great circle candidate pixel detecting step of detecting edge pixels in the great circle region and detecting the detected edge pixels as great circle candidate pixels constituting the circumference of the great circle;
A great circle detection step for performing a multi-stage circle approximation on the detected great circle circumference candidate pixels and detecting the center position and radius of the great circle;
A small circle region specifying step of labeling within the great circle so as not to include the great circle edge based on the detected center position and radius, and specifying one or a plurality of regions including one small circle;
A small circle candidate pixel detecting step for detecting edge pixels in the small circle region, and detecting the detected edge pixels as small circle candidate point pixels constituting the circumference of the small circle;
A small circle detection step of performing multi-stage circle approximation on the detected small circle candidate pixels and detecting a center position and a radius of the small circle.
[0013]
According to the present invention, first, in the great circle region specifying step, a region including the great circle which is the largest circle among the plurality of circles is specified. In the great circle candidate pixel detection step, an edge pixel in the great circle region is detected, and the detected edge pixel is detected as a great circle candidate pixel constituting the circumference of the great circle.
[0014]
In the great circle detection step, multi-stage circle approximation is performed on the detected great circle candidate pixels, and the center position and radius of the great circle are detected. At this step, the center position of the great circle is determined.
[0015]
Next, in the small circle region specifying step, one or a plurality of regions including one small circle are specified by labeling within the large circle so as not to include the large circular edge based on the detected center position and radius. In the small circle candidate pixel detection step, an edge pixel in the specified small circle region is detected, and the detected edge pixel is detected as a small circle candidate point pixel constituting the circumference of the small circle.
[0016]
Multi-stage circle approximation is performed on the detected small circle candidate pixels in the small circle detection step to detect the center position and radius of the small circle. In this step, the center position of the small circle is determined.
[0017]
In this way, the center position and radius of the great circle are first detected, the great circle is determined from the detected center position and radius, and the center position of the small circle is detected within the determined great circle. Even when small circles overlap on the circumference, each can be detected with high accuracy.
[0018]
Further, in the great circle region specifying step, the present invention separates pixels constituting the background and pixels constituting other than the background by binarization processing,
A great circle region is specified based on a feature amount of a set of pixels constituting a portion other than the background.
[0019]
According to the present invention, the great circle is, for example, a marker provided in a part or a screw hole, so that the color and the surface state of the great circle are significantly different from those other than the great circle, so-called ground portions. Therefore, even in the image data when this is imaged, the pixel values are greatly different. Therefore, it is possible to accurately separate by binarization processing by appropriately setting the threshold value. In addition to the pixels constituting the circle, there are also pixels caused by foreign matters such as dust and noise. Since the pixels forming the circle form a set of a plurality of pixels, the region where the great circle exists is specified from the feature amount of the set.
[0020]
As described above, since the great circle region is specified from the pixel separation by the binarization processing and the feature amount of the pixel set, the region can be specified easily and with high accuracy.
[0021]
Further, in the small circle region specifying step, the present invention separates pixels constituting the great circle and pixels constituting other than the great circle by binarization processing,
A small circle region is specified based on a feature amount of a set of pixels constituting a portion other than the great circle.
[0022]
According to the present invention, the small circle is a marker or a screw different from the great circle, and therefore the density is greatly different even in image data when the small circle is imaged. Therefore, by appropriately setting the threshold value, the inside of the great circle can be separated with high accuracy by binarizing labeling. Since the pixels forming the small circle form a set of a plurality of pixels, the region where the small circle exists is specified from the feature amount of the set.
[0023]
As described above, since the great circle region is specified from the pixel separation by the binarization processing and the feature amount of the pixel set, the region can be specified easily and with high accuracy.
[0024]
In the invention, it is preferable that the feature amount is the number of pixels included in a set of pixels and a ferret diameter of the set of pixels.
[0025]
According to the present invention, the number of pixels included in the pixel set or the ferret diameter of the pixel set is used as the feature amount for specifying the great circle or the small circle. Pixels caused by foreign matters such as dust or noise are often smaller than circles, and therefore a set having a relatively large number of pixels, that is, a large area, is specified as a circle. In addition, when a large foreign object has been imaged, a circle may not be specified only by the number of pixels included in the pixel set. However, in the case of a foreign substance, since the shape is not fixed, a ferret diameter is used, and a set in which the ratio of the horizontal ferret diameter to the vertical ferret diameter is close to 1 may be specified as a circle.
[0026]
As described above, since the region where the circle exists is specified by the area of the set of pixels and the diameter of the ferret, it is possible to prevent erroneous detection of detecting foreign matter or noise as a circle.
[0027]
Further, according to the present invention, the multi-stage circle approximation includes a process for detecting a center position and a radius based on a circumference candidate pixel, and a circle from a circumference based on the detected center position and radius among the circumference candidate pixels. The process of making a pixel whose distance is closer than a predetermined distance as a new circumference candidate pixel is one step, and this is repeated a plurality of times.
[0028]
According to the present invention, the multi-stage circle approximation is performed by repeating the following one-stage process. The one-stage process consists of two processes. First, as the first process, the center position and the radius are detected based on the circumference candidate pixels. Next, as a second process, a pixel whose distance from the circumference of the approximate circle determined from the detected center position and radius among the circumference candidate pixels is closer than a predetermined distance is set as a new circumference candidate pixel. Returning to the first process again, a new approximate circle is detected from the new circumference candidate pixels obtained in the second process. By repeating these processes, the center position of the circle can be detected with high accuracy even when the circumference is missing or other circumferences overlap. In addition, it is desirable that the steps are repeated 3 to 5 times.
[0029]
Further, the present invention is based on the ratio of the pixels excluding the pixels constituting the great circle and the pixels constituting the background out of all the pixels in the small circle based on the center position and radius detected in the small circle detection step. The method further includes a verification step for verifying the validity of the small circle.
[0030]
According to the present invention, all the pixels in the small circle based on the center position and the radius detected in the small circle detection step are counted. For example, if a foreign object is partly arc-shaped, and there is a false detection that would detect this arc as part of the circumference, In many cases, the pixel is a constituent pixel. Therefore, when the ratio of the pixels excluding the pixels constituting the great circle and the pixels constituting the background is small, for example, 50% or less, it is determined as a false detection.
[0031]
Thus, by verifying the validity of the small circle once detected, the center position of the circle can be detected with higher accuracy.
[0032]
The present invention is also an image processing program for causing a computer to execute the above image processing method.
[0033]
According to the present invention, an image processing program for causing a computer to execute the above-described image processing method can be provided.
[0034]
The present invention also provides a computer-readable recording medium on which an image processing program for causing a computer to execute the above image processing method is recorded.
[0035]
According to the present invention, it can be provided as a computer-readable recording medium on which an image processing program for causing a computer to execute the above-described image processing method is recorded.
[0036]
Further, the present invention is an image processing apparatus that detects the center position of each circle with respect to a plurality of circles including circles that are different in size from other circles that are displayed as image data,
A great circle region specifying means for specifying a region including a great circle which is the largest circle among a plurality of circles;
Great circle candidate pixel detecting means for detecting edge pixels in the great circle region and detecting the detected edge pixels as great circle candidate pixels constituting the circumference of the great circle;
A great circle detection means for performing multi-stage circle approximation on the detected great circle circumference candidate pixels, and detecting the center position and radius of the great circle;
A small circle region specifying means for labeling within the great circle so as not to include the great circle edge based on the detected center position and radius, and specifying one or a plurality of regions including one small circle;
Small circle candidate pixel detecting means for detecting edge pixels in the small circle region and detecting the detected edge pixels as small circle candidate point pixels constituting the circumference of the small circle;
An image processing apparatus comprising: a small circle detecting unit that performs multi-stage circle approximation on the detected small circle candidate pixels and detects a center position and a radius of the small circle.
[0037]
According to the present invention, first, the great circle region specifying means specifies a region including the great circle which is the largest circle among the plurality of circles. The great circle candidate pixel detecting means detects edge pixels in the great circle region, and detects the detected edge pixels as great circle candidate pixels constituting the circumference of the great circle.
[0038]
The great circle detection means performs multi-stage circle approximation on the detected great circle candidate pixel, and detects the center position and radius of the great circle. The center position of the great circle is determined by the processing of the great circle detection means.
[0039]
Next, the small circle region specifying means performs labeling within the large circle so as not to include the great circle edge based on the detected center position and radius, and specifies one or a plurality of regions including one small circle. The small circle candidate pixel detecting means detects edge pixels in the specified small circle region, and detects the detected edge pixels as small circle candidate point pixels constituting the circumference of the small circle.
[0040]
The small circle detection means performs multi-stage circle approximation on the detected small circle candidate pixels, and detects the center position and radius of the small circle. The center position of the small circle is determined by the processing of the small circle detecting means.
[0041]
In this way, the center position and radius of the great circle are first detected, the great circle is determined from the detected center position and radius, and the center position of the small circle is detected within the determined great circle. Even when small circles overlap on the circumference, each can be detected with high accuracy.
[0042]
Further, the present invention is based on the ratio of the pixels excluding the pixels constituting the great circle and the pixels constituting the ground, out of all the pixels in the small circle based on the center position and radius detected by the small circle detecting means, It further has verification means for verifying the validity of the small circle.
[0043]
According to the present invention, all pixels in the small circle based on the center position and the radius detected by the small circle detecting means are counted. If the ratio of the pixels in the small circle excluding the pixels constituting the great circle and the pixels constituting the background is small, it is determined as erroneous detection.
[0044]
Thus, by verifying the validity of the small circle once detected, the center position of the circle can be detected with higher accuracy.
[0045]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a flowchart showing an image processing method of the present invention.
[0046]
In the present embodiment, for example, a description will be given of a case where alignment is performed to move a component to a correct position with respect to a reference surface during product assembly and inspection.
[0047]
Specifically, a circular reference marker (fixed) is provided on the reference surface, and this is imaged with a fixed camera. A circular part marker is provided on a part of the part to be aligned, and the part is placed on the reference plane by the moving device. At this initial time point, as shown in FIG. 2A, an image in which the positions of the reference marker M1 and the component marker M2 are shifted is captured by the camera.
[0048]
The purpose of alignment is to make the center position of the reference marker M1 coincide with the center position of the component marker M2. Therefore, image processing is performed on the image at the initial time point, the center position of each marker is detected, and the direction and distance in which the component is moved to match are calculated. Based on the calculated parameters, the moving device moves the component. After the movement, the marker is imaged again. If it is deviated, the center position is detected, the movement parameter is calculated, and the part is moved. This is repeated until the center of the circle of the reference marker M1 and the center of the circle of the part marker M2 match. .
[0049]
As shown in FIG. 2B, the component marker M2 may overlap the circumference of the reference marker M1 at the initial point and when the component is moved. In the present invention, the center position of each marker is detected with high accuracy in such a case.
[0050]
First, in step S1, a region (great circle region) in the image data of the reference marker M1 that is a great circle is specified. Since the reference marker M1 is provided in a different color from the other parts of the reference surface, the imaged image data is subjected to binarization processing, and pixels having pixel values that are significantly different from the background are changed to a great circle. It is detected as a constituent pixel. A region where a great circle exists is identified based on the area of the aggregate region of the detected pixels or the ferret diameter. For example, when the area is based on an area, an area having an area (the number of pixels included in the set) of a predetermined value or more is specified as a great circle area. When based on the ferret diameter, an area in which the horizontal ferret diameter and the vertical ferret diameter are equal to or larger than a predetermined value and the ratio is close to 1 is specified as a great circle area. As a result, a small area and a long and narrow area due to dust or noise are excluded from the great circle area.
[0051]
When a plurality of great circles are included in the captured image data, a plurality of great circle regions are specified, and the following steps S2 to S8 may be performed for each great circle region.
[0052]
Next, in step S2, the candidate of the pixel which comprises the circumference of a great circle is detected. Since the circumference of the great circle is the boundary between the reference marker M1 and the background, the edge pixels in the great circle area identified in step S1 are detected as circumference candidate points.
[0053]
The edge pixel has a large density difference with the adjacent pixel, so the edge difference is calculated by calculating the density difference with the adjacent pixel, and the edge pixel is a pixel whose density difference exceeds a predetermined value, or a Sobel filter, etc. Can be detected by a “differential binarization method” or the like that binarizes after first differentiation.
[0054]
In step S3, multi-stage circle approximation is performed on the circumference candidate point detected in step S2, and the center position and radius of the great circle are detected.
[0055]
The multi-stage circle approximation will be described in detail with reference to FIG.
As shown in FIG. 2B, when the component marker M2 overlaps the circumference of the reference marker M1, the captured image data is a circumference candidate point as shown in FIG. 3A at the time of step S2. An image consisting of
[0056]
When circle approximation is performed on the circumference candidate point, as shown in FIG. 3B, the position deviated from the correct circle center C1 of the great circle due to the influence of the small circle portion is set as the circle center C1 ′ of the approximate circle. The radius is detected as a radius smaller than the radius of the great circle.
[0057]
Next, as shown in FIG. 3C, a ring R having a predetermined width around the circumference of the approximate circle is set, and among the circle candidate points, the circle candidate points located outside the ring. Is excluded.
[0058]
The circumference candidate point in the ring is set as a new circumference candidate point, and circle approximation is performed based on this. At this time, since candidate points that deviate significantly from the circumference of the great circle are excluded, a second approximate circle closer to the great circle than the first approximate circle is detected. A ring is set for the second approximate circle, and circumferential candidate points located outside the ring are excluded.
[0059]
Such circle approximation based on circumference candidate points and exclusion of candidate points outside the ring are set as one stage, and a great circle is determined by repeating a plurality of times. In order to detect an accurate great circle, it is necessary to repeat at least 2 times, and 3 to 5 times are desirable from the relationship between accuracy and throughput.
[0060]
In step S4, the region (small circle region) of the component marker M2 that is a small circle is specified in the great circle determined in step S3.
[0061]
A region where a small circle exists is specified based on the area of the aggregate region of the detected pixels or the ferret diameter. One small circle is included in the small circle region, and when there are a plurality of small circles, a plurality of small circle regions are specified.
[0062]
In step S5, edge pixels in the small circle area specified in step S4 are detected as circumference candidate points for the small circle.
[0063]
In step S6, multi-stage circle approximation is performed on the circumference candidate points of the small circle detected in step S5, and the center position and radius of the small circle are detected. The multistage circle approximation is performed in the same manner as the great circle approximation in step S3.
[0064]
In step S7, it is determined whether or not the center position has been detected for all the small circle regions. If all the small circle regions have been detected, the process proceeds to step S8. If any small circle region that has not been detected remains, the process returns to step S5. .
[0065]
In step S8, it is determined whether there are a plurality of detected small circles. If there is more than one, the process proceeds to step S9, and if there is one, the process proceeds to step S10.
[0066]
In step S9, it is verified whether the small circle detected in step S6 is valid. As in the present embodiment, when it is known in advance that there is one large circle and one small circle, when two or more small circle regions are specified and two or more small circles are detected, one is selected. The other small circles other than the circle are not actually small circles, but are considered to be false detections in which a large circle chip or a foreign object is erroneously detected as a small circle.
[0067]
Even if one small circle region is specified and one small circle is detected, it is conceivable that the small circle is erroneously detected. Therefore, the validity of even one small circle may be verified.
[0068]
The verification method calculates the ratio of the pixels constituting the small circle detected in step S4 in the small circle detected in step S6. If the ratio is less than a predetermined ratio (for example, 50% or less), false detection is detected. to decide. As shown in FIG. 4, when a small circle is detected between an actual small circle and a foreign object, only a small amount of pixels are included in the detected small circle in the circumferential portion. Most of them are pixels constituting a great circle. Therefore, since the ratio of the pixels excluding the pixels constituting the great circle to the small circle is small, it can be understood that the small circle is erroneously detected. If there are a plurality of small circles larger than the predetermined ratio, the one with the largest ratio is determined as a small circle. When there are a plurality of small circles, the small circles are determined in descending order of proportion.
[0069]
In step S10, it is determined whether or not the center position has been detected for all the great circle regions. If all the great circle regions have been detected, the process is terminated, and if there are any undetected great circle regions, the process returns to step S2. .
[0070]
As described above, after detecting the center position of the great circle in advance, the center position of the small circle is detected in the area of the great circle, so that the small circle overlaps the circumference of the great circle. However, the two circle centers can be detected with high accuracy.
[0071]
FIG. 5 is a block diagram illustrating a configuration of the image processing system 100. The image processing system 100 includes an imaging device 1, an image processing device 2, and a display device 3, and constitutes a component positioning system as described above.
[0072]
The imaging device 1 includes a CCD (charge coupled device) camera 11, an A / D (analog / digital) converter 12, a camera controller 13, a D / A converter 14, and a frame memory 15. The CCD camera 11 images a subject, the reference plane and parts in the above-described embodiment, and outputs the received light amount as an analog image signal. The A / D converter 12 converts the analog image signal output from the CCD camera 11 into digital data and outputs it as digital image data. The camera controller 14 stores the digital image data in the frame memory 15 frame by frame and outputs it to the D / A converter 14 for display on the display device 3. The D / A converter converts the digital image data output from the camera controller 14 into an analog image signal corresponding to the display device 3 and outputs the analog image signal to the display device 3. The display device 3 is realized by an LCD (Liquid Crystal Display), a CRT (Cathode Ray Tube) display, or the like, and displays an analog image signal output from the imaging device 1.
[0073]
The image processing apparatus 2 includes a CPU (Central Processing Unit) 21, a RAM (Random Access Memory) 22, a ROM (Read Only Memory) 23, and an I / O (Input / Output) controller 24. The CPU 21 controls the operation of the image processing device 2 based on a control program stored in the ROM 23. The image data being processed and the data being calculated are temporarily stored in the RAM 22. The I / O controller 24 is connected to an input device such as a keyboard and a mouse and a component moving device, and controls these input / output data.
[0074]
The CPU 21 and the ROM 23 constitute a great circle region specifying unit, a great circle candidate pixel detecting unit, a great circle detecting unit, a small circle region specifying unit, a small circle candidate pixel detecting unit, a small circle detecting unit, and a verification unit. Image data is acquired from the frame memory 15 via the camera controller 14 of the apparatus 2 and the image processing shown in the above-described flowchart is executed. When the center positions of the two circles are detected by image processing and, for example, the moving distance and moving direction of the component are calculated, these parameters are output to the moving device. The moving device performs positioning by moving the parts based on the acquired parameters.
[0075]
Another embodiment of the present invention is an image processing program for causing a computer to function as the image processing apparatus 2, and a computer-readable recording medium on which the image processing program is recorded. Accordingly, the image processing program and the recording medium on which the image processing program is recorded can be provided in a portable manner.
[0076]
The recording medium is read by a program reading device provided in a printer or a computer system, whereby an image processing program is executed.
[0077]
As an input means of the computer system, a flat bed scanner, a film scanner, a digital camera, or the like may be used. The computer system includes these input means, a computer that executes image processing and the like by loading a predetermined program, an image display device such as a CRT display and a liquid crystal display that displays the processing results of the computer, and computer processing It consists of a printer that outputs the results to paper. Furthermore, a modem or the like as a communication means for connecting to a server or the like via a network is provided.
[0078]
The recording medium is not limited to be read by the program reading device, and may be a microcomputer memory, for example, a ROM. The recorded program may be accessed and executed by the microprocessor, or the program read from the recording medium may be downloaded to the program storage area of the microcomputer and executed. This download function is assumed to be provided in the microcomputer in advance.
[0079]
Specific examples of the recording medium include a tape system such as a magnetic tape and a cassette tape, a magnetic disk such as a flexible disk and a hard disk, a CD-ROM (Compact Disc-Read Only Memory) / MO (Magneto Optical) disk / MD ( Optical discs such as Mini Disc) / DVD (Digital Versatile Disc), IC (Integrated Circuit) cards (including memory cards) / optical cards, etc., mask ROM, EPROM (Erasable Programmable Read Only Memory), This is a medium that carries a fixed program including a semiconductor memory such as an EEPROM (Electrically Erasable Programmable Read Only Memory) and a flash ROM.
[0080]
In the present embodiment, the computer may have a system configuration that can be connected to a communication network including the Internet, and the image processing program may be downloaded via the communication network. In the case of downloading a program from the communication network in this way, the download function may be provided in advance in the computer or installed from another recording medium. The download program may be executed via a user interface, or a predetermined URL (Uniform Resource
The program may be downloaded periodically from Locater).
[0081]
【The invention's effect】
As described above, according to the present invention, first, the center position and radius of the great circle are detected, the great circle is determined from the detected center position and radius, and the center position of the small circle is detected within the determined great circle. Therefore, even when small circles overlap on the circumference of the great circle, each can be detected with high accuracy.
[0082]
Further, according to the present invention, since the great circle region is specified from the pixel separation by the binarization process and the feature amount of the pixel set, the region can be specified easily and with high accuracy.
[0083]
Further, according to the present invention, the region where the circle exists is specified by the area of the set of pixels and the diameter of the ferret, so that it is possible to prevent erroneous detection of detecting a foreign object or noise as a circle.
[0084]
In addition, according to the present invention, by repeating the detection of the center position and radius and the determination of a new circumference candidate pixel, even when the circumference is missing or other circumferences overlap, with high accuracy. The center position of the circle can be detected.
[0085]
Further, according to the present invention, the center position of the circle can be detected with higher accuracy by verifying the validity of the small circle once detected.
[0086]
Further, according to the present invention, it is possible to provide an image processing program for causing a computer to execute the above image processing method, and a computer-readable recording medium on which the image processing program is recorded.
[Brief description of the drawings]
FIG. 1 is a flowchart showing an image processing method of the present invention.
FIG. 2 is a schematic view of an alignment marker.
FIG. 3 is a diagram showing a procedure of multi-stage circle approximation.
FIG. 4 is a diagram illustrating an example of a small circle that is erroneously detected.
5 is a block diagram showing a configuration of an image processing system 100. FIG.
FIG. 6 is a diagram illustrating an example of a component with a chip or a burr.
FIG. 7 is a flowchart showing a conventional circle center position detection process.
[Explanation of symbols]
1 Imaging device
2 Image processing device
3 display devices
11 CCD camera
12 A / D converter
13 Camera controller
14 D / A converter
15 frame memory
21 CPU
22 RAM
23 ROM
24 I / O controller
100 Image processing system

Claims (10)

画像データで表示される、他の円と大きさが異なる円を含む複数の円に対して、各円の中心位置を検出する画像処理方法であって、
複数の円のうち最も大きな円である大円を含む領域を特定する大円領域特定ステップと、
大円領域内のエッジ画素を検出し、検出したエッジ画素を大円の円周を構成する大円周候補画素として検出する大円周候補画素検出ステップと、
検出された大円周候補画素に対して多段階の円近似を行い、大円の中心位置および半径を検出する大円検出ステップと、
検出された中心位置および半径に基づき大円エッジを含まないよう大円内でラベリングし、1つの小円を含む領域を1または複数特定する小円領域特定ステップと、
小円領域内のエッジ画素を検出し、検出したエッジ画素を小円の円周を構成する小円周候補点画素として検出する小円周候補画素検出ステップと、
検出された小円周候補画素に対して多段階の円近似を行い、小円の中心位置および半径を検出する小円検出ステップとを有することを特徴とする画像処理方法。
An image processing method for detecting a center position of each circle with respect to a plurality of circles including a circle having a size different from that of other circles displayed as image data,
A great circle region identification step for identifying a region including a great circle which is the largest circle among a plurality of circles;
A great circle candidate pixel detecting step of detecting edge pixels in the great circle region and detecting the detected edge pixels as great circle candidate pixels constituting the circumference of the great circle;
A great circle detection step for performing a multi-stage circle approximation on the detected great circle circumference candidate pixels and detecting the center position and radius of the great circle;
A small circle region specifying step of labeling within the great circle so as not to include the great circle edge based on the detected center position and radius, and specifying one or a plurality of regions including one small circle;
A small circle candidate pixel detecting step for detecting edge pixels in the small circle region, and detecting the detected edge pixels as small circle candidate point pixels constituting the circumference of the small circle;
An image processing method comprising: a small circle detecting step of performing multi-stage circle approximation on the detected small circle candidate pixels and detecting a center position and a radius of the small circle.
前記大円領域特定ステップでは、2値化処理によって下地を構成する画素と下地以外を構成する画素とを分離し、
下地以外を構成する画素の集合の特徴量に基づいて、大円領域を特定することを特徴とする請求項1記載の画像処理方法。
In the great circle region specifying step, the pixels constituting the background and the pixels other than the background are separated by binarization processing,
The image processing method according to claim 1, wherein a great circle region is specified based on a feature amount of a set of pixels constituting a portion other than the background.
前記小円領域特定ステップでは、2値化処理によって大円を構成する画素と大円以外を構成する画素とを分離し、
大円以外を構成する画素の集合の特徴量に基づいて、小円領域を特定することを特徴とする請求項1または2記載の画像処理方法。
In the small circle region specifying step, pixels constituting the great circle and pixels constituting other than the great circle are separated by binarization processing,
3. The image processing method according to claim 1, wherein a small circle region is specified based on a feature amount of a set of pixels constituting a portion other than the great circle.
前記特徴量は、画素の集合に含まれる画素数および画素の集合のフェレ径であることを特徴とする請求項2または3記載の画像処理方法。4. The image processing method according to claim 2, wherein the feature amount is the number of pixels included in a set of pixels and a Ferre diameter of the set of pixels. 前記多段階の円近似は、円周候補画素に基づいて中心位置および半径を検出する処理と、円周候補画素のうち検出した中心位置および半径に基づく円の円周からの距離が所定の距離より近い画素を新たな円周候補画素とする処理とを1段階とし、これを複数回繰り返すことを特徴とする請求項1〜4のいずれか1つに記載の画像処理方法。The multi-stage circle approximation includes a process of detecting a center position and a radius based on a circumference candidate pixel, and a distance from the circumference of the circle based on the detected center position and radius among the circumference candidate pixels is a predetermined distance. The image processing method according to any one of claims 1 to 4, wherein a process of setting a closer pixel as a new circumference candidate pixel is made one step and is repeated a plurality of times. 前記小円検出ステップで検出された中心位置および半径に基づく小円内の全画素のうち、大円を構成する画素および下地を構成する画素を除く画素の割合に基づいて、小円の妥当性を検証する検証ステップをさらに有することを特徴とする請求項1〜5のいずれか1つに記載の画像処理方法。The validity of the small circle based on the ratio of the pixels excluding the pixels constituting the great circle and the pixels constituting the background out of all the pixels in the small circle based on the center position and radius detected in the small circle detection step The image processing method according to claim 1, further comprising a verification step of verifying. 請求項1〜6のいずれかに記載の画像処理方法をコンピュータに実行させるための画像処理プログラム。An image processing program for causing a computer to execute the image processing method according to claim 1. 請求項1〜6のいずれかに記載の画像処理方法をコンピュータに実行させるための画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体。A computer-readable recording medium recording an image processing program for causing a computer to execute the image processing method according to claim 1. 画像データで表示される、他の円と大きさが異なる円を含む複数の円に対して、各円の中心位置を検出する画像処理装置であって、
複数の円のうち最も大きな円である大円を含む領域を特定する大円領域特定手段と、
大円領域内のエッジ画素を検出し、検出したエッジ画素を大円の円周を構成する大円周候補画素として検出する大円周候補画素検出手段と、
検出された大円周候補画素に対して多段階の円近似を行い、大円の中心位置および半径を検出する大円検出手段と、
検出された中心位置および半径に基づき大円エッジを含まないよう大円内でラベリングし、1つの小円を含む領域を1または複数特定する小円領域特定手段と、
小円領域内のエッジ画素を検出し、検出したエッジ画素を小円の円周を構成する小円周候補点画素として検出する小円周候補画素検出手段と、
検出された小円周候補画素に対して多段階の円近似を行い、小円の中心位置および半径を検出する小円検出手段とを有することを特徴とする画像処理装置。
An image processing device that detects the center position of each circle with respect to a plurality of circles including a circle having a size different from that of other circles displayed as image data,
A great circle region specifying means for specifying a region including a great circle which is the largest circle among a plurality of circles;
Great circle candidate pixel detecting means for detecting edge pixels in the great circle region and detecting the detected edge pixels as great circle candidate pixels constituting the circumference of the great circle;
A great circle detection means for performing multi-stage circle approximation on the detected great circle circumference candidate pixels, and detecting the center position and radius of the great circle;
A small circle region specifying means for labeling within the great circle so as not to include the great circle edge based on the detected center position and radius, and specifying one or a plurality of regions including one small circle;
Small circle candidate pixel detecting means for detecting edge pixels in the small circle region and detecting the detected edge pixels as small circle candidate point pixels constituting the circumference of the small circle;
An image processing apparatus, comprising: a small circle detecting unit that performs multi-stage circle approximation on the detected small circle candidate pixels and detects a center position and a radius of the small circle.
前記小円検出手段で検出された中心位置および半径に基づく小円内の全画素のうち、大円を構成する画素および下地を構成する画素を除く画素の割合に基づいて、小円の妥当性を検証する検証手段をさらに有することを特徴とする請求項9記載の画像処理装置。The validity of the small circle based on the ratio of the pixels excluding the pixels constituting the great circle and the pixels constituting the ground out of all the pixels in the small circle based on the center position and radius detected by the small circle detection means The image processing apparatus according to claim 9, further comprising verification means for verifying.
JP2003007530A 2003-01-15 2003-01-15 Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded Expired - Fee Related JP4210126B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003007530A JP4210126B2 (en) 2003-01-15 2003-01-15 Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003007530A JP4210126B2 (en) 2003-01-15 2003-01-15 Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded

Publications (2)

Publication Number Publication Date
JP2004220370A JP2004220370A (en) 2004-08-05
JP4210126B2 true JP4210126B2 (en) 2009-01-14

Family

ID=32897600

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003007530A Expired - Fee Related JP4210126B2 (en) 2003-01-15 2003-01-15 Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded

Country Status (1)

Country Link
JP (1) JP4210126B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022134809A (en) * 2021-03-04 2022-09-15 株式会社リコー Image inspection device and image forming apparatus

Also Published As

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

Similar Documents

Publication Publication Date Title
Zhou et al. A surface defect detection framework for glass bottle bottom using visual attention model and wavelet transform
CN101464418B (en) Flaw detection method and apparatus
JP5225297B2 (en) Method for recognizing array region in die formed on wafer, and setting method for such method
US20130202188A1 (en) Defect inspection method, defect inspection apparatus, program product and output unit
JP4931476B2 (en) Image processing method and image processing apparatus characterized by method for measuring roundness
JP3329805B2 (en) Automatic visual inspection device and visual inspection method
JP2002039962A (en) Method for inspecting electronic substrate and apparatus using the same
CN105911065B (en) Inspection apparatus for pattern and pattern checking mehtod
WO2014103617A1 (en) Alignment device, defect inspection device, alignment method, and control program
CN114332012A (en) Defect detection method, device, equipment and computer readable storage medium
JP4730895B2 (en) Needle mark detection device and needle mark detection method
JP4210126B2 (en) Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded
JP2006266943A (en) Apparatus and method for inspecting defect
JP4550559B2 (en) Appearance inspection apparatus, appearance inspection method, and program for causing computer to function as appearance inspection apparatus
CN110199173B (en) Position deviation amount acquisition device, inspection device, position deviation amount acquisition method, and inspection method
US6757421B1 (en) Method and apparatus for detecting defects
JP2003279319A (en) Dimension inspection method and its device and production
JP4327653B2 (en) Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded
JP4327654B2 (en) Image processing method, image processing apparatus, image processing program, and recording medium on which image processing program is recorded
JP3675543B2 (en) Image position measurement method
JP2023535005A (en) Method and system or apparatus for recognizing objects in electronic images
US6571006B1 (en) Methods and apparatuses for measuring an extent of a group of objects within an image
JP2017133868A (en) Pattern inspection device and pattern inspection method
JP2001284422A (en) Contact failure defect detection method and computer readable recording medium
JP2006133884A (en) Image processing method characterized by verification method, image processing apparatus, image processing program, and recording medium with the program recorded thereon

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050810

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080729

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

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

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121031

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees