JP4101005B2 - Connected component extraction method and program causing computer to execute the method - Google Patents

Connected component extraction method and program causing computer to execute the method Download PDF

Info

Publication number
JP4101005B2
JP4101005B2 JP2002265620A JP2002265620A JP4101005B2 JP 4101005 B2 JP4101005 B2 JP 4101005B2 JP 2002265620 A JP2002265620 A JP 2002265620A JP 2002265620 A JP2002265620 A JP 2002265620A JP 4101005 B2 JP4101005 B2 JP 4101005B2
Authority
JP
Japan
Prior art keywords
run
connection
connected component
color difference
determined
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
JP2002265620A
Other languages
Japanese (ja)
Other versions
JP2004102807A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2002265620A priority Critical patent/JP4101005B2/en
Publication of JP2004102807A publication Critical patent/JP2004102807A/en
Application granted granted Critical
Publication of JP4101005B2 publication Critical patent/JP4101005B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、カラー画像や多値画像から連結成分を抽出する連結成分抽出の技術に関し、連結成分の抽出を安定して行える連結成分抽出方法とその方法をコンピュータに実行させるプログラム、連結成分抽出装置に関する。
【0002】
【従来の技術】
連結成分の抽出は、入力されたカラーのRGB画像を複数のプレーンに分割し、各プレーンについて2値化処理を施し、各プレーンでの連結成分抽出結果を統合するものである(例えば、特許文献1参照。)。
【0003】
また、入力されたカラーのRGB画像を複数のプレーンに分割し、各プレーンについて2値化処理を施し、各プレーンでの連結成分抽出結果を統合する手法に加え、得られた連結成分に対してカラー画像を参照して再2値化処理を施す方法もある(例えば、特許文献2参照。)。
【0004】
また、入力画像中に存在する色が既知の場合に、各色毎に複数の画像を生成し、それぞれの画像から連結成分を抽出した結果に基づいて、帳票色と記入色を判断する方法がある(例えば、特許文献3参照。)。また、非特許文献1には、後述するt検定についての説明が記述されている。
【0005】
【特許文献1】
特開2000−207489号公報
【特許文献2】
特開2001−043312号公報
【特許文献3】
特開2001−195543号公報
【非特許文献1】
“統計学の小部屋”、[online]、[平成14年7月12日検索]、インターネット〈URL:http://homepage1.nifty.com/j-soyo/toukei/t7.htm〉
【0006】
【発明が解決しようとする課題】
しかしながら、カラー画像、あるいは多値画像から連結成分/文字要素の抽出を行う際、入力画像の明度などを用いて画像を2値化し、得られた2値画像から連結成分等の抽出を行っていた。このような手法では入力画像の2値化処理の性能に依存する部分が多く、必ずしも十分な性能が得られない場合があった。
【0007】
上記の特許文献1,2においても、入力画像のRGBに対して重み付けを行って複数の画像に分割するなどの工夫は見られるが、各プレーンの画像に対しては2値化処理を行うので、2値化処理の性能に依存する部分が多い。一般的に、抽出したい連結成分(文字など)の背景に濃度差(グラデーション)などがある場合には、2値化処理が困難な場合が多い。
【0008】
また、複数の画像について連結成分の抽出結果の合成を行っているが、入力デバイスによってはRGBの各色毎に画素ずれなどが生じる場合も多く、これにプレーン毎の2値化/連結成分抽出処理を適用した場合、各プレーンでの結果が微妙に(1〜2画素程度)ずれる可能性が高く、その場合、結果の合成処理は煩雑なものとなりかねない。なお、複数の画像を生成する構成についての記述が不明瞭である。
【0009】
高精度に連結成分を抽出するには、入力画像の性質に応じてRGBに対する重み付けを調整する必要があることは明らかであるが、特許文献1,2においては、色のクラスタリング処理など、入力原稿の色に関する情報を取得する前処理は処理時間がかかるため実用的ではないと記述されている。複数プレーンへの分割方法を(色情報の収集という前処理を行わずに)固定とした場合、プレーン数が少ないと十分に元のカラー画像を表現できないために入力原稿によっては連結成分の抽出漏れが増大する。一方、プレーン数を(全ての色の組み合わせが識別できる程度に)増やした場合には処理時間が問題となる。
【0010】
また、特許文献3は、原稿上の色数が既知の場合の処理について記載されているが、この手法は色数が既知の場合には有効であるものの、一般文書を広く対象とすることはできない。
【0011】
この発明は、上述した従来技術による問題点を解消するため、入力されたカラー画像や多値画像から連結成分の抽出を安定して行える連結成分抽出方法とその方法をコンピュータに実行させるプログラム、連結成分抽出装置を提供することを目的とする。
【0012】
【課題を解決するための手段】
上述した課題を解決し、目的を達成するため、請求項1の発明にかかる連結成分抽出方法は、入力されたカラー画像からエッジを抽出するエッジ抽出工程と、前記入力されたカラー画像からエッジ以外の画素についてランを抽出するラン抽出工程と、前記ラン抽出工程により抽出された前記ランの間の位置関係と、色差によりランの接続の有無を判定するラン接続判定工程とを含むことを特徴とする。
【0013】
また、請求項2の発明にかかる連結成分抽出方法は、請求項1に記載の発明において、前記ラン接続判定工程により接続すると判定されたランの集合を連結成分として抽出する連結成分出力工程を含むことを特徴とする。
【0014】
また、請求項3の発明にかかる連結成分抽出方法は、請求項1または2に記載の発明において、前記ラン接続判定工程は、前記色差によりランの接続を判定する際に、それぞれのランの代表色を求め代表色間の色差が小さい場合にはランが接続すると判断し、代表色間の色差が大きい場合にはランが接続しないと判断することを特徴とする。
【0015】
また、請求項4の発明にかかる連結成分抽出方法は、請求項1または2に記載の発明において、前記ラン接続判定工程は、前記色差によりランの接続を判定する際に、それぞれのランの代表色を求め代表色間の色差とラン周辺のエッジの強度を比較し、代表色間の色差が小さい場合にはランが接続すると判断し、代表色間の色差が大きい場合にはランが接続しないと判断することを特徴とする。
【0016】
また、請求項5の発明にかかる連結成分抽出方法は、請求項4に記載の発明において、前記ラン接続判定工程は、前記色差によりランの接続を判定する際に、それぞれのランの平均色をそのランの代表色として代表色間の色差とラン周辺のエッジの強度を比較し、代表色間の色差が小さい場合にはランが接続すると判断し、代表色間の色差が大きい場合にはランが接続しないと判断することを特徴とする。
【0017】
また、請求項6の発明にかかる連結成分抽出方法は、請求項5に記載の発明において、前記ラン接続判定工程は、前記代表色間の色差がラン周辺のエッジ強度の半分より小さい場合にはランが接続すると判断し、それ以外の場合にはランが接続しないと判断することを特徴とする。
【0018】
また、請求項7の発明にかかる連結成分抽出方法は、請求項1または2に記載の発明において、前記ラン接続判定工程は、前記色差によりランの接続を判定する際に、判定を行う2つのラン内の各画素間についてその色差を算出し、該色差の分布によりラン接続の可否を判断することを特徴とする。
【0019】
また、請求項8の発明にかかる連結成分抽出方法は、請求項7に記載の発明において、前記ラン接続判定工程は、求めた色差の分布が複数のピークを有するときにはランが接続しないと判断することを特徴とする。
【0020】
また、請求項9の発明にかかる連結成分抽出方法は、請求項1または2に記載の発明において、前記ラン接続判定工程は、前記色差によりランの接続を判定する際に、判定を行う2つのラン内の各画素間についてその色差を算出し、その色差の分布とラン周辺のエッジの強度によりラン接続の可否を判断することを特徴とする。
【0021】
また、請求項10の発明にかかる連結成分抽出方法は、請求項9に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最大値とラン周辺のエッジ強度を比較することに基づきラン接続の可否を判断することを特徴とする。
【0022】
また、請求項11の発明にかかる連結成分抽出方法は、請求項9または10に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最大値がラン周辺のエッジ強度の半分より小さい場合にはランが接続すると判定し、それ以外の場合にはランが接続しないと判定することを特徴とする。
【0023】
また、請求項12の発明にかかる連結成分抽出方法は、請求項9に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最小値とラン周辺のエッジ強度を比較することで、ラン接続の可否を判断することを特徴とする。
【0024】
また、請求項13の発明にかかる連結成分抽出方法は、請求項9または10に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最小値がラン周辺のエッジ強度の半分より小さい場合にはランが接続すると判定し、それ以外の場合にはランが接続しないと判定することを特徴とする。
【0025】
また、請求項14の発明にかかる連結成分抽出方法は、請求項1または2に記載の発明において、前記ラン接続判定工程は、前記各ラン中の色の分布を算出し、色の分布の間に有意差が無いと判断される場合にはランが接続すると判定し、それ以外の場合にはランが接続しないと判定することを特徴とする。
【0026】
また、請求項15の発明にかかる連結成分抽出方法は、請求項1に記載の発明において、前記ラン接続判定工程は、入力されたカラー画像のライン毎に順次処理を行ってランの統合を行い、既に統合されているランの集合と次のラインのランとの統合を判定する際には、前記ランの集合に関する連結成分の情報を利用して行うことを特徴とする。
【0027】
また、請求項16の発明にかかる連結成分抽出方法は、請求項15に記載の発明において、前記ラン接続判定工程は、前記色差により連結成分への接続ランの統合を判定する際に、連結成分とそれに接続するランの代表色を求め、代表色間の色差が小さい場合には、接続ランを連結成分に統合し、それ以外の場合には接続ランを連結成分に統合しないと判断することを特徴とする。
【0028】
また、請求項17の発明にかかる連結成分抽出方法は、請求項15に記載の発明において、前記ラン接続判定工程は、前記色差により連結成分への接続ランの統合を判定する際に、連結成分と接続ランそれぞれの代表色を求め、代表色間の色差と連結成分周辺および接続ラン周辺のエッジの強度を比較し、代表色間の色差が小さい場合には接続ランを連結成分に統合し、それ以外の場合には接続ランを連結成分に統合しないと判断することを特徴とする。
【0029】
また、請求項18の発明にかかる連結成分抽出方法は、請求項15に記載の発明において、前記ラン接続判定工程は、前記色差により連結成分への接続ランの統合を判定する際に、連結成分と接続ランそれぞれの平均色を代表色とし、代表色間の色差と連結成分周辺および接続ラン周辺のエッジの強度を比較し、代表色間の色差が小さい場合には接続ランを連結成分に統合し、それ以外の場合には接続ランを連結成分に統合しないと判断することを特徴とする。
【0030】
また、請求項19の発明にかかる連結成分抽出方法は、請求項15に記載の発明において、前記ラン接続判定工程は、前記代表色間の色差がラン周辺のエッジ強度の半分より小さい場合には接続ランを連結成分に統合し、それ以外の場合には接続ランを連結成分に統合しないと判断することを特徴とする。
【0031】
また、請求項20の発明にかかる連結成分抽出方法は、請求項15に記載の発明において、前記ラン接続判定工程は、前記色差により連結成分への統合を判断する際に、連結成分と接続ラン内の各画素間についてその色差を算出し、該色差の分布により連結成分への接続ランの統合を判断することを特徴とする。
【0032】
また、請求項21の発明にかかる連結成分抽出方法は、請求項20に記載の発明において、前記ラン接続判定工程は、求めた色差の分布が複数のピークを有するときには接続ランを連結成分に統合しないと判断することを特徴とする。
【0033】
また、請求項22の発明にかかる連結成分抽出方法は、請求項15に記載の発明において、前記ラン接続判定工程は、前記色差により連結成分への接続ランの統合を判定する際に、連結成分と接続ラン内の各画素間についてその色差を算出し、その色差の分布と連結成分および接続ラン周辺のエッジ強度により連結成分への接続ランの統合を判断することを特徴とする。
【0034】
また、請求項23の発明にかかる連結成分抽出方法は、請求項22に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最大値と連結成分および接続ラン周辺のエッジ強度を比較することで、連結成分への接続ランの統合を判断することを特徴とする。
【0035】
また、請求項24の発明にかかる連結成分抽出方法は、請求項22または23に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最大値が連結成分および接続ラン周辺のエッジ強度の半分より小さい場合には連結成分へ接続ランを統合すると判定し、それ以外の場合には連結成分へ接続ランを統合しないと判定することを特徴とする。
【0036】
また、請求項25の発明にかかる連結成分抽出方法は、請求項22に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最小値と連結成分および接続ラン周辺のエッジ強度を比較し、連結成分への接続ランの統合を判断することを特徴とする。
【0037】
また、請求項26の発明にかかる連結成分抽出方法は、請求項22または23に記載の発明において、前記ラン接続判定工程は、前記色差の分布の最小値が連結成分および接続ラン周辺のエッジ強度の半分より小さい場合には連結成分へ接続ランを統合すると判定し、それ以外の場合には連結成分へ接続ランを統合しないと判定することを特徴とする。
【0038】
また、請求項27の発明にかかる連結成分抽出方法は、請求項15に記載の発明において、前記ラン接続判定工程は、連結成分と接続ラン中の色の分布を算出し、色の分布の間に有意差が無いと判断される場合には連結成分へ接続ランを統合すると判定し、それ以外の場合には連結成分へ接続ランを統合しないと判定することを特徴とする。
【0039】
また、請求項28の発明にかかるプログラムは、前記請求項1〜27のいずれか一つに記載された方法をコンピュータに実行させることができる。
【0040】
また、請求項29の発明にかかる連結成分抽出装置は、入力されたカラー画像からエッジを抽出するエッジ抽出手段と、前記入力されたカラー画像からエッジ以外の画素についてランを抽出するラン抽出手段と、前記ラン抽出手段により抽出された前記ランの間の位置関係と、色差によりランの接続の有無を判定するラン接続判定手段とを備えたことを特徴とする。
【0041】
また、請求項30の発明にかかる連結成分抽出装置は、請求項29に記載の発明において、前記ラン接続判定手段により接続すると判定されたランの集合を連結成分として抽出する連結成分出力手段を備えたことを特徴とする。
【0042】
【発明の実施の形態】
以下に添付図面を参照して、この発明にかかる連結成分抽出装置、連結成分抽出方法およびその方法をコンピュータに実行させるプログラムの好適な実施の形態を詳細に説明する。図1は、この発明の本実施の形態にかかる連結成分抽出装置の構成を示すブロック図である。
【0043】
(実施の形態1)
画像入力部101は、スキャナーなどの画像入力機器(不図示)を用いるなどして、カラーあるいは多値の画像を読み込む。勿論、画像入力機器を用いずに、既に存在する画像を入力する構成にもできる。エッジ抽出部102は、入力画像の各画素についてその濃度勾配を算出し、濃度勾配が局所最大となる画素をエッジ画素として抽出する。ラン抽出部103は、エッジではない画素について、ライン毎にランを生成する。ラン接続判定部104は、前ラインのランと、処理中のラインのランを接続するか否かをランの位置関係と色情報を用いて判断する。連結成分出力部105は、接続されると判断されたランを取りまとめて連結成分として出力する。
【0044】
図2は、実施の形態1における処理内容を示すフローチャートである。この実施の形態1では、画像入力部101は、RGBそれぞれ8ビット値(0〜255)で表現されたカラー画像を入力する。入力されたカラー画像はエッジ抽出部102に送られ、エッジ抽出処理が行われる(ステップS201)。
【0045】
図3は、エッジ抽出処理を説明するための図である。エッジ抽出処理は、RGBプレーン毎に、図示のSobelオペレーターを用いて濃度勾配を算出する。次に、画素毎に最も濃度勾配の大きいプレーンを選択し、そのプレーン上で処理中の画素が濃度勾配最大となっているか否かを判断する。
【0046】
図4は、濃度勾配判断の一例を示す図である。濃度勾配の方向に沿って前後画素の濃度勾配を求め、そのいずれもが注目画素の濃度勾配よりも小さい場合に濃度勾配極大画素と判断し、エッジとして登録する。エッジとして登録された場合には、エッジの強度を算出する。エッジの強度は先に求めた前後画素について、濃度勾配を求めたのと同じ手法で色を算出し、その色差をエッジの強度とする。色差の算出方法には多くの方法があるが、ここでは一例として、(Ra,Ga,Ba)と(Rb,Gb,Bb)の色差Dcを下記式1に示す。
【0047】
Dc=(Ra−Rb)2 +(Ga−Gb)2 +(Ba−Bb)2 …(式1)
【0048】
ラン抽出部103では、エッジ以外の画素についてランを抽出する(ステップS202)。図5は、ラン抽出の一例を示す図である。ラン接続判定部104では、ランの間の接続を判定する。ここでは、まず、8連結により、ラン同士が位置的に接続するか否かを判断する(ステップS203)。8連結する可能性があるのは、隣合うライン間のみであるので、2つのラインの対毎に8連結の判定処理を行えばよい。ここで、位置的に接続されると判断されたラン同士については、ランの色を用いて最終的な接続の判定を行う。
【0049】
本実施の形態では、それぞれのランの代表色を算出し、その色差によりランとランの間の接続判定を行う。最も簡単な方法としては、色差が予め定められたしきい値より小さい場合には接続と判定する方法がある。その場合、しきい値を小さくすると、色差の大きい(色のばらつきの大きい)連結成分が抽出されなくなる(複数の連結成分に分割される)可能性がある。一方、しきい値を大きめに設定すると、本来は異なる連結成分が過統合される恐れがある。
【0050】
そこで、本実施の形態では、ラン両端のエッジの強度によって、このしきい値を動的に設定する。まず、それぞれのランの平均色を求め、各ランの代表色とする。次に、代表色間の色差Dpを上記式1を用いて算出する(ステップS204)。一方、それぞれのランの両端に存在するエッジの強度の最大値を求め(ステップS205)、その1/2の値をしきい値Tとする(ステップS206)。
【0051】
このようにしきい値Tを設定することで、片方のランを基準(前景)に考えた場合、もう一方のランの色が背景と前景のいずれに近いかを判断することができる。そして、下記式2の条件を満たす場合には(ステップS207:Yes)、2つのランは接続する(ステップS208)。但し、位置的に接続しないラン同士、および式2の条件を満たさないラン同士は接続しないと判断する(ステップS207:No)。
【0052】
Dp<T…(式2)
【0053】
上記ステップS203〜ステップS208の処理は、現在のライン内ランのループ(Rc)を行い、上ライン内ランのループ(Rp)を行って終了する。連結成分出力部105では、接続されると判断されたランを取りまとめて連結成分として出力する。図6は、連結成分の抽出例を示す図である。このように出力された連結成分は、OCRにおける文字画像の切り出し等の画像処理装置への入力として用いられる。なお、連結成分の画像処理への応用については数多くの例があり、ここでは説明を割愛する。
【0054】
(実施の形態2)
図7は、実施の形態2における処理内容を示すフローチャートである。実施の形態2は、エッジ抽出(ステップS701)と、ランの抽出(ステップS702)と、8連結によるラン同士が位置的に接続するか否かの判断(ステップS703)までの処理は、実施の形態1と同様でありその説明を割愛する。
【0055】
そして、この実施の形態では、各ランの代表色(平均色)を求める代わりに、各ラン内の画素間の色差を求め、その色差の分布からランの接続を判断する。接続判定を行う2つのランについて、その全ての画素間の色差を算出してヒストグラムを作成する(ステップS704)。図8は、色差ヒストグラムの作成例を説明する概要図である。
【0056】
接続判定を行っている2つのランが異なる色の場合、異なるランに属する画素間の色差は大きくなる。図9は、ランの色が異なる場合の色差ヒストグラム例を説明する図である。色差ヒストグラムは、図に示すように色差の小さい部分と大きい部分で複数のピークを持つことになる。
【0057】
この実施の形態では、このことに注目して、色差ヒストグラムの形状からランの統合を判断する。次の条件を全て満たす場合に、ランが接続しないと判断する。
【0058】
1)色差ヒストグラム(Hg)に複数のピークが存在する(ステップS705:Yes)。
2)ラン内の画素数をN,Mとしたときに、2番目に高いピークBが、最も高いピークAの(2NM/(N2 +M2 −N−M))以上の値である(ステップS706〜ステップS707〜ステップS708:Yes)。
【0059】
上記1),2)の条件を一つでも満たさなかった場合(ステップS705:No,あるいはステップS708:No)には、2つのランを接続する(ステップS709)。
【0060】
(実施の形態3)
図10は、実施の形態3における処理内容を示すフローチャートである。本実施の形態では、色差ヒストグラムの作成(ステップS1004)までの処理は、実施の形態2と同様である。
【0061】
ここでは、色差ヒストグラムの分布の形状を見るのではなく、色差の最大値Hgmax (例えば、図9に示したヒストグラムにおいて、一番右に存在するDF,EF,EGの色差)等を求め(ステップS1005)、ランの左右にあるエッジ強度を算出し(ステップS1006)、これらを比較してランの接続を判定する(ステップS1008)。ヒストグラムから求める比較対象は、簡単な例として色差の最大値Hgmax をあげたが、他にも最小値や平均値,中央値など、さまざまな統計パラメータを対象や用途により使い分けてもよい。
【0062】
左右のエッジの強度を求める処理(ステップS1006,ステップS1007)については、実施の形態1と同様の方法を用いる。色差ヒストグラムの分布の最大値をX(Hgmax ),エッジの強度の最小値をEとしたとき(ステップS1007)、X<E/2の条件を満たす場合に(ステップS1008:Yes)ランが接続すると判断し、2つのランを接続する(ステップS1009)。条件を満たさなかった場合には(ステップS1008:No)、ラン同士は接続しないと判断する。なお、ランの接続判断以降の処理は実施の形態2と同様であり説明を割愛する。
【0063】
(実施の形態4)
図11は、実施の形態4における処理内容を示すフローチャートである。本実施の形態では、ランの抽出と8連結の判定(ステップS1103)までの処理は実施の形態1と同じであり説明を割愛する。
【0064】
本実施の形態では、RGBの各色毎、各ラン毎にヒストグラムを作成する(ステップS1104)。図12は、RGBのヒストグラム例を示す図である。次に、処理対象のランの間で、それぞれのヒストグラムの間で統計的な有意差検定を行う。代表的な検定方法としては、平均値の差の検定(t検定)などが挙げられる。t検定の詳細は、例えば、前述した非特許文献1等に説明が記載されている。
【0065】
そして、R,G,Bそれぞれについて有意差の検定を行う(ステップS1105,ステップS1107,ステップS1109)。その全てにおいて、ヒストグラム間に有意差が無いと判断された場合には(ステップS1106:No,ステップS1108:No,ステップS1110:No)、ランが接続すると判断し、2つのランを接続する(ステップS1111)。RGBいずれかで有意差があると判断された場合には(ステップS1106:Yes,ステップS1108:Yes,ステップS1110:Yes)、ランは接続しないと判断する。なお、ランの接続判断以降の処理については実施の形態1と同様であるので、説明を割愛する。
【0066】
(実施の形態5)
実施の形態5は、ランを順次統合し連結成分を得る処理内容に関するものである。図13は、連結成分抽出処理例を説明するための図である。図13(a)→→(b)→(c)の順番で処理が進むとする。
【0067】
(a)は、現在ラインの処理前の状態で、前ラインまでの処理により、連結成分A,Bが登録されている状態である。図中”E”が記入されている画素はエッジ画素を表す。処理は図中左側から行う。まず、ラン1については、前ラインに接続するランが存在しないので、新しい連結成分(連結成分C)として登録する。
【0068】
(b)は、ラン1の処理が終わった状態である。次にラン2の処理を行う。ラン2は、前ラインのラン3と8連結で連結しているので、ラン3の属している連結成分Aへの統合の可否を判断する。これまでの実施の形態ではランとランの間で接続の判定を行っていたが、ここでは連結成分とランの間で接続の判定を行う。例えば、連結成分A中に含まれる全てのランの平均色とラン2の平均色の色差による判定を行えばよい。ランと連結成分は構成要素(画素と周辺エッジ)が同じであるので、ランに用いた手法(実施の形態1〜4に示した接続判定の手法)はそのまま連結成分の処理に拡張することができる。図では、色差が小さく、ラン2を統合して連結成分Aを更新する場合を示した。
【0069】
(c)は、連結成分更新後の状態である。次に、ラン2はラン4とも連結しているので、この間の接続を判定する。この場合には、ラン2は既に連結成分A’に属しているので、ラン4の属している連結成分Bとの間で接続を判定することになる。つまり、連結成分A’の平均色と、連結成分Bの平均色を算出し、その色差により接続を判定する。接続すると判断された場合には、連結成分A’と連結成分Bを統合して新しい連結成分とする。接続しないと判断された場合には特別な処理は行わない。なお、接続しないと判断された場合で、ラン2がいずれの文字要素にも属さない場合には、新しい連結成分として登録するが、この場合には既に連結成分A’に属しているので処理不要である。
【0070】
以上、実施の形態5においては、順次ランを統合して連結成分を生成する方法について述べた。連結成分とラン、あるいは連結成分と連結成分の接続判定に関しては、前述した実施の形態1〜4に示した方法それぞれについて、ランから連結成分に拡張して同様の処理を行えばよい。
【0071】
なお、本実施の形態で説明した連結成分抽出方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。このプログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。またこのプログラムは、インターネット等のネットワークを介して配布することが可能な伝送媒体であってもよい。
【0072】
【発明の効果】
以上説明したように、本発明によれば、入力されたカラー画像あるいは多値画像からその色や濃度の状態を確認しながら逐次ランの統合を判断するものであるため、カラー画像や多値画像から直接連結成分の抽出を行うことができ、2値化処理の影響を受けることなく安定した連結成分の抽出が可能であるという効果を奏する。
【図面の簡単な説明】
【図1】この発明の本実施の形態にかかる連結成分抽出装置の構成を示すブロック図である。
【図2】実施の形態1における処理内容を示すフローチャートである。
【図3】エッジ抽出処理を説明するための図である。
【図4】濃度勾配判断の一例を示す図である。
【図5】ラン抽出の一例を示す図である。
【図6】連結成分の抽出例を示す図である。
【図7】実施の形態2における処理内容を示すフローチャートである。
【図8】色差ヒストグラムの作成例を説明する概要図である。
【図9】ランの色が異なる場合の色差ヒストグラム例を説明する図である。
【図10】実施の形態3における処理内容を示すフローチャートである。
【図11】実施の形態4における処理内容を示すフローチャートである。
【図12】RGBのヒストグラム例を示す図である。
【図13】連結成分抽出処理例を説明するための図である。
【符号の説明】
101 画像入力部
102 エッジ抽出部
103 ラン抽出部
104 ラン接続判定部
105 連結成分出力部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a connected component extraction technique for extracting a connected component from a color image or a multi-valued image, a connected component extracting method capable of stably extracting a connected component, a program for causing a computer to execute the method, and a connected component extracting device. About.
[0002]
[Prior art]
Extracting connected components divides an input color RGB image into a plurality of planes, binarizes each plane, and integrates the connected component extraction results for each plane (for example, Patent Documents). 1).
[0003]
In addition to the method of dividing the input color RGB image into a plurality of planes, binarizing each plane, and integrating the connected component extraction results in each plane, There is also a method of performing re-binarization processing with reference to a color image (for example, see Patent Document 2).
[0004]
Also, there is a method for generating a plurality of images for each color and determining the form color and entry color based on the result of extracting connected components from each image when the colors existing in the input image are known. (For example, refer to Patent Document 3). Non-Patent Document 1 describes a t-test described later.
[0005]
[Patent Document 1]
JP 2000-2047489 A
[Patent Document 2]
JP 2001-043312 A
[Patent Document 3]
JP 2001-195543 A
[Non-Patent Document 1]
"Small room of statistics", [online], [searched July 12, 2002], Internet <URL: http://homepage1.nifty.com/j-soyo/toukei/t7.htm>
[0006]
[Problems to be solved by the invention]
However, when extracting connected components / character elements from a color image or multi-valued image, the image is binarized using the brightness of the input image and the connected components are extracted from the obtained binary image. It was. In such a method, there are many portions depending on the performance of the binarization processing of the input image, and there are cases where sufficient performance cannot always be obtained.
[0007]
In the above Patent Documents 1 and 2, there are some ideas such as weighting the RGB of the input image to divide it into a plurality of images, but binarization processing is performed on each plane image. There are many parts that depend on the performance of the binarization process. In general, when there is a density difference (gradation) in the background of a connected component (such as characters) to be extracted, binarization processing is often difficult.
[0008]
Also, connected component extraction results are synthesized for a plurality of images, but depending on the input device, there are many cases where pixel shift occurs for each color of RGB, and binarization / connected component extraction processing for each plane occurs. Is applied, there is a high possibility that the results in each plane will be subtly shifted (about 1 to 2 pixels). In this case, the result combining process may be complicated. In addition, the description about the structure which produces | generates a some image is unclear.
[0009]
In order to extract the connected components with high accuracy, it is apparent that the weighting for RGB needs to be adjusted according to the properties of the input image. However, in Patent Documents 1 and 2, the input document such as color clustering is used. It is described that the pre-processing for acquiring information on the color of the image is not practical because it takes a long time. If the division method into multiple planes is fixed (without performing pre-processing for collecting color information), the original color image cannot be expressed sufficiently if the number of planes is small, so the extracted components may not be extracted depending on the input document. Will increase. On the other hand, when the number of planes is increased (so that all color combinations can be identified), the processing time becomes a problem.
[0010]
Patent Document 3 describes processing when the number of colors on a document is known. Although this method is effective when the number of colors is known, it is not widely used for general documents. Can not.
[0011]
In order to solve the above-described problems caused by the prior art, the present invention provides a connected component extraction method capable of stably extracting a connected component from an input color image or multi-valued image, a program for causing a computer to execute the method, and a connection It aims at providing a component extraction device.
[0012]
[Means for Solving the Problems]
In order to solve the above-described problems and achieve the object, the connected component extraction method according to the first aspect of the present invention includes an edge extraction step of extracting an edge from the input color image, and an edge other than the edge from the input color image. A run extraction step of extracting a run for each pixel of the pixel, a positional relationship between the runs extracted by the run extraction step, and a run connection determination step of determining whether or not the run is connected based on a color difference. To do.
[0013]
A connected component extraction method according to a second aspect of the invention includes a connected component output step of extracting the set of runs determined to be connected by the run connection determining step as a connected component in the first aspect of the invention. It is characterized by that.
[0014]
According to a third aspect of the present invention, in the connected component extraction method according to the first or second aspect of the invention, the run connection determination step is a representative of each run when determining the connection of the run based on the color difference. If the color is obtained and the color difference between the representative colors is small, it is determined that the run is connected. If the color difference between the representative colors is large, it is determined that the run is not connected.
[0015]
According to a fourth aspect of the present invention, there is provided the connected component extraction method according to the first or second aspect, wherein the run connection determination step is a representative of each run when determining the connection of the run based on the color difference. Find the color and compare the color difference between the representative colors and the strength of the edge around the run. If the color difference between the representative colors is small, it is judged that the run is connected. If the color difference between the representative colors is large, the run is not connected. It is characterized by judging.
[0016]
According to a fifth aspect of the present invention, in the connected component extraction method according to the fourth aspect of the present invention, when the run connection determination step determines the connection of the run based on the color difference, the average color of each run is determined. Compare the color difference between the representative colors and the edge strength around the run as the representative color of the run. If the color difference between the representative colors is small, the run is determined to be connected. If the color difference between the representative colors is large, the run is determined. Is determined not to be connected.
[0017]
According to a sixth aspect of the present invention, in the connected component extraction method according to the fifth aspect of the present invention, the run connection determination step is performed when the color difference between the representative colors is smaller than half of the edge intensity around the run. It is characterized in that it is determined that the run is connected, and in other cases, it is determined that the run is not connected.
[0018]
According to a seventh aspect of the present invention, there is provided a connected component extraction method according to the first or second aspect of the invention, wherein the run connection determination step includes two determinations when determining the connection of the run based on the color difference. The color difference is calculated for each pixel in the run, and whether or not the run connection is possible is determined based on the distribution of the color difference.
[0019]
Further, in the connected component extraction method according to the invention of claim 8, in the invention of claim 7, the run connection determining step determines that the run is not connected when the obtained color difference distribution has a plurality of peaks. It is characterized by that.
[0020]
According to a ninth aspect of the present invention, there is provided the connected component extraction method according to the first or second aspect, wherein the run connection determining step includes two determinations when determining the connection of the run based on the color difference. The color difference is calculated for each pixel in the run, and whether or not the run connection is possible is determined based on the distribution of the color difference and the strength of the edge around the run.
[0021]
According to a tenth aspect of the present invention, in the connected component extraction method according to the ninth aspect, the run connection determining step is based on comparing the maximum value of the color difference distribution and the edge strength around the run. It is characterized by determining whether or not the run connection is possible.
[0022]
The connected component extraction method according to an invention of claim 11 is the invention according to claim 9 or 10, wherein in the run connection determination step, the maximum value of the color difference distribution is smaller than half of the edge intensity around the run. In this case, it is determined that the run is connected, and in other cases, it is determined that the run is not connected.
[0023]
The connected component extraction method according to a twelfth aspect of the present invention is the invention according to the ninth aspect, wherein the run connection determination step compares the minimum value of the color difference distribution with the edge strength around the run. It is characterized by determining whether or not the run connection is possible.
[0024]
Further, in the connected component extraction method according to the invention of claim 13, in the invention of claim 9 or 10, in the run connection determination step, the minimum value of the color difference distribution is smaller than half of the edge intensity around the run. In this case, it is determined that the run is connected, and in other cases, it is determined that the run is not connected.
[0025]
The connected component extraction method according to a fourteenth aspect of the invention is the invention according to the first or second aspect, wherein the run connection determining step calculates a color distribution in each run, If it is determined that there is no significant difference, it is determined that the run is connected. In other cases, it is determined that the run is not connected.
[0026]
According to a fifteenth aspect of the present invention, in the connected component extraction method according to the first aspect of the invention, the run connection determining step performs a process for each line of the input color image to integrate the runs. The determination of the integration of the already integrated set of runs and the run of the next line is performed by using information on the connected components related to the set of runs.
[0027]
The connected component extraction method according to a sixteenth aspect of the present invention is the connected component extracting method according to the fifteenth aspect of the present invention, wherein the run connection determining step determines the integration of the connected run into the connected component based on the color difference. If the color difference between the representative colors is small, the connection run is integrated into the connected component, and otherwise the connection run is determined not to be integrated into the connected component. Features.
[0028]
According to a seventeenth aspect of the present invention, there is provided a connected component extraction method according to the fifteenth aspect of the present invention, wherein the run connection determining step determines the integration of the connected run into the connected component based on the color difference. And the representative color of each connected run, compare the color difference between the representative colors and the strength of the edge around the connected component and the connected run, and if the color difference between the representative colors is small, integrate the connected run into the connected component, In other cases, it is determined that the connection run is not integrated into the connected component.
[0029]
The connected component extraction method according to an invention of claim 18 is the connected component extraction method according to claim 15, wherein the run connection determining step determines whether the connected run is integrated into the connected component based on the color difference. The average color of each connected run is used as the representative color, and the color difference between the representative colors is compared with the intensity of the edges around the connected component and the connected run. If the color difference between the representative colors is small, the connected run is integrated into the connected component. In other cases, it is determined that the connection run is not integrated into the connected component.
[0030]
According to a nineteenth aspect of the present invention, in the connected component extracting method according to the fifteenth aspect, the run connection determining step is performed when the color difference between the representative colors is smaller than half of the edge intensity around the run. It is characterized in that the connection run is integrated into the connected component, and otherwise it is determined that the connection run is not integrated into the connected component.
[0031]
The connected component extraction method according to a twentieth aspect of the present invention is the connected component extraction method according to the fifteenth aspect of the present invention, wherein the run connection determining step determines whether the connected component is connected to the connected component when determining the integration into the connected component by the color difference. The color difference is calculated for each of the pixels, and the integration of the connection run to the connected component is determined based on the distribution of the color difference.
[0032]
According to a twenty-first aspect of the present invention, in the connected component extraction method according to the twentieth aspect, the run connection determination step integrates the connected runs into the connected components when the obtained color difference distribution has a plurality of peaks. It is characterized by not judging.
[0033]
According to a twenty-second aspect of the present invention, in the connected component extracting method according to the fifteenth aspect of the present invention, the run connection determining step determines whether or not to integrate a connected run into a connected component based on the color difference. The color difference is calculated for each pixel in the connection run, and the integration of the connection run into the connection component is determined based on the distribution of the color difference, the connection component, and the edge strength around the connection run.
[0034]
The connected component extraction method according to a twenty-third aspect of the present invention is the method according to the twenty-second aspect, wherein the run connection determining step compares the maximum value of the color difference distribution with the edge strength around the connected component and the connected run. By doing so, it is characterized by determining the integration of the connection run into the connected component.
[0035]
Further, in the connected component extraction method according to the invention of claim 24, in the invention according to claim 22 or 23, the run connection determination step is such that the maximum value of the color difference distribution is an edge strength around the connected component and the connected run. It is determined that the connection run is integrated into the connected component if it is smaller than half of that, and it is determined that the connection run is not integrated into the connected component in other cases.
[0036]
According to a 25th aspect of the present invention, in the connected component extraction method according to the 22nd aspect, the run connection determination step compares the minimum value of the color difference distribution with the edge strength around the connected component and the connected run. And determining the integration of connection runs into connected components.
[0037]
Further, in the connected component extraction method according to the invention of claim 26, in the invention according to claim 22 or 23, the run connection determination step is such that the minimum value of the color difference distribution is an edge strength around the connected component and the connected run. It is determined that the connection run is integrated into the connected component if it is smaller than half of that, and it is determined that the connection run is not integrated into the connected component in other cases.
[0038]
According to a twenty-seventh aspect of the present invention, in the connected component extracting method according to the fifteenth aspect, the run connection determining step calculates a distribution of colors in the connected component and the connected run, If it is determined that there is no significant difference, it is determined that the connection run is integrated into the connected component, and otherwise, it is determined that the connection run is not integrated into the connected component.
[0039]
A program according to the invention of claim 28 can cause a computer to execute the method described in any one of claims 1 to 27.
[0040]
A connected component extraction apparatus according to a twenty-ninth aspect of the present invention is an edge extraction unit that extracts an edge from an input color image, and a run extraction unit that extracts a run for pixels other than the edge from the input color image. And a run connection determining means for determining whether or not the run is connected based on a color relationship and a positional relationship between the runs extracted by the run extracting means.
[0041]
A connected component extraction apparatus according to a thirty-third aspect of the invention includes a connected component output means for extracting, as a connected component, a set of runs determined to be connected by the run connection determining means. It is characterized by that.
[0042]
DETAILED DESCRIPTION OF THE INVENTION
Exemplary embodiments of a connected component extraction apparatus, a connected component extraction method, and a program for causing a computer to execute the method will be described below in detail with reference to the accompanying drawings. FIG. 1 is a block diagram showing a configuration of a connected component extraction apparatus according to this embodiment of the present invention.
[0043]
(Embodiment 1)
The image input unit 101 reads a color or multi-value image by using an image input device (not shown) such as a scanner. Of course, an image that already exists can be input without using an image input device. The edge extraction unit 102 calculates a density gradient for each pixel of the input image, and extracts a pixel having a local density maximum as an edge pixel. The run extraction unit 103 generates a run for each line for pixels that are not edges. The run connection determination unit 104 determines whether to connect the run of the previous line and the run of the line being processed using the positional relationship of the run and the color information. The connected component output unit 105 collects runs determined to be connected and outputs them as connected components.
[0044]
FIG. 2 is a flowchart showing the processing contents in the first embodiment. In the first embodiment, the image input unit 101 inputs a color image expressed by 8-bit values (0 to 255) for each of RGB. The input color image is sent to the edge extraction unit 102, and edge extraction processing is performed (step S201).
[0045]
FIG. 3 is a diagram for explaining edge extraction processing. In the edge extraction process, a density gradient is calculated for each RGB plane using the illustrated Sobel operator. Next, a plane having the largest density gradient is selected for each pixel, and it is determined whether or not the pixel being processed on the plane has the maximum density gradient.
[0046]
FIG. 4 is a diagram illustrating an example of density gradient determination. The density gradients of the preceding and following pixels are obtained along the direction of the density gradient, and when all of them are smaller than the density gradient of the target pixel, the pixel is determined as the density gradient maximum pixel and registered as an edge. When registered as an edge, the strength of the edge is calculated. For the edge strength, the color is calculated for the previous and subsequent pixels obtained in the same manner as the density gradient, and the color difference is used as the edge strength. There are many methods for calculating the color difference. Here, as an example, the color difference Dc between (Ra, Ga, Ba) and (Rb, Gb, Bb) is expressed by the following formula 1.
[0047]
Dc = (Ra−Rb) 2 + (Ga-Gb) 2 + (Ba-Bb) 2 ... (Formula 1)
[0048]
The run extraction unit 103 extracts runs for pixels other than edges (step S202). FIG. 5 is a diagram illustrating an example of run extraction. The run connection determination unit 104 determines a connection between runs. Here, first, it is determined whether or not the runs are connected in position by the 8-connection (step S203). Since there is a possibility of eight connections only between adjacent lines, the determination process of eight connections may be performed for each pair of two lines. Here, for the runs determined to be connected in position, the final connection is determined using the color of the run.
[0049]
In the present embodiment, the representative color of each run is calculated, and the connection determination between the runs is performed based on the color difference. As the simplest method, there is a method of determining a connection when the color difference is smaller than a predetermined threshold value. In that case, if the threshold value is reduced, connected components having a large color difference (large variation in color) may not be extracted (divided into a plurality of connected components). On the other hand, if the threshold value is set larger, originally different connected components may be overintegrated.
[0050]
Therefore, in this embodiment, this threshold value is dynamically set according to the strength of the edges at both ends of the run. First, the average color of each run is obtained and used as the representative color of each run. Next, the color difference Dp between the representative colors is calculated using Equation 1 (step S204). On the other hand, the maximum value of the strength of the edge existing at both ends of each run is obtained (step S205), and a value half of that is set as the threshold value T (step S206).
[0051]
By setting the threshold value T in this way, when one run is considered as a reference (foreground), it can be determined whether the color of the other run is close to the background or the foreground. If the condition of the following formula 2 is satisfied (step S207: Yes), the two runs are connected (step S208). However, it is determined that the runs that are not connected in position and the runs that do not satisfy the condition of Expression 2 are not connected (step S207: No).
[0052]
Dp <T (Formula 2)
[0053]
The processing from step S203 to step S208 ends with the current in-line run loop (Rc), the upper in-line run loop (Rp). The connected component output unit 105 collects the runs determined to be connected and outputs them as connected components. FIG. 6 is a diagram illustrating an example of extraction of connected components. The connected component output in this way is used as an input to an image processing apparatus such as clipping of a character image in OCR. There are many examples of application of connected components to image processing, and description thereof is omitted here.
[0054]
(Embodiment 2)
FIG. 7 is a flowchart showing the processing contents in the second embodiment. In the second embodiment, processing up to edge extraction (step S701), run extraction (step S702), and determination of whether or not the 8-connected runs are connected in position (step S703) It is the same as that of form 1, and the description is omitted.
[0055]
In this embodiment, instead of obtaining the representative color (average color) of each run, the color difference between pixels in each run is obtained, and the connection of the run is determined from the distribution of the color difference. For the two runs for which connection determination is performed, a color difference between all the pixels is calculated and a histogram is created (step S704). FIG. 8 is a schematic diagram illustrating an example of creating a color difference histogram.
[0056]
When the two runs for which connection determination is performed have different colors, the color difference between pixels belonging to different runs becomes large. FIG. 9 is a diagram for explaining an example of the color difference histogram when the colors of the runs are different. As shown in the figure, the color difference histogram has a plurality of peaks at a portion where the color difference is small and a portion where the color difference is large.
[0057]
In this embodiment, paying attention to this, the integration of the run is determined from the shape of the color difference histogram. If all of the following conditions are met, it is determined that the run is not connected.
[0058]
1) A plurality of peaks exist in the color difference histogram (Hg) (step S705: Yes).
2) When the number of pixels in the run is N and M, the second highest peak B is the highest peak A (2NM / (N 2 + M 2 −N−M)) or more (step S706 to step S707 to step S708: Yes).
[0059]
If even one of the above conditions 1) and 2) is not satisfied (step S705: No, or step S708: No), two runs are connected (step S709).
[0060]
(Embodiment 3)
FIG. 10 is a flowchart showing the processing contents in the third embodiment. In the present embodiment, the processes up to the creation of the color difference histogram (step S1004) are the same as those in the second embodiment.
[0061]
Here, instead of looking at the shape of the distribution of the color difference histogram, the maximum value Hg of the color difference max (For example, in the histogram shown in FIG. 9, the color difference between DF, EF, and EG present on the rightmost side) is obtained (step S1005), edge strengths on the left and right sides of the run are calculated (step S1006), and these are calculated. The connection of the run is determined by comparison (step S1008). The comparison target obtained from the histogram is the maximum color difference Hg as a simple example. max However, various other statistical parameters such as minimum value, average value, and median value may be used depending on the object and application.
[0062]
For the processing for obtaining the strength of the left and right edges (step S1006, step S1007), the same method as in the first embodiment is used. The maximum value of the color difference histogram distribution is X (Hg max ), When the minimum edge strength is E (step S1007), if the condition X <E / 2 is satisfied (step S1008: Yes), it is determined that the runs are connected, and the two runs are connected (step S1007). S1009). If the condition is not satisfied (step S1008: No), it is determined that the runs are not connected. The processing after the determination of the connection of the run is the same as that of the second embodiment, and the description is omitted.
[0063]
(Embodiment 4)
FIG. 11 is a flowchart showing the processing contents in the fourth embodiment. In the present embodiment, the processes up to run extraction and 8-connection determination (step S1103) are the same as those in the first embodiment and will not be described.
[0064]
In this embodiment, a histogram is created for each color of RGB and for each run (step S1104). FIG. 12 is a diagram illustrating an example of an RGB histogram. Next, a statistical significance test is performed between the histograms between the runs to be processed. As a typical test method, a test for a difference between average values (t test) or the like can be given. Details of the t-test are described in, for example, Non-Patent Document 1 described above.
[0065]
Then, a significant difference test is performed for each of R, G, and B (step S1105, step S1107, and step S1109). In all of them, when it is determined that there is no significant difference between the histograms (Step S1106: No, Step S1108: No, Step S1110: No), it is determined that the runs are connected, and the two runs are connected (Step S1106: No). S1111). If it is determined that there is a significant difference between any of RGB (step S1106: Yes, step S1108: Yes, step S1110: Yes), it is determined that the run is not connected. Since the processing after the determination of the connection of the run is the same as that of the first embodiment, the description is omitted.
[0066]
(Embodiment 5)
The fifth embodiment relates to processing contents for sequentially integrating runs to obtain a connected component. FIG. 13 is a diagram for explaining an example of a connected component extraction process. Assume that the processing proceeds in the order of FIG. 13 (a) →→ (b) → (c).
[0067]
(A) is a state before processing of the current line, and is a state in which connected components A and B are registered by processing up to the previous line. Pixels with “E” in the figure represent edge pixels. Processing is performed from the left side of the figure. First, since there is no run connected to the previous line, run 1 is registered as a new connected component (connected component C).
[0068]
(B) is a state in which the processing of run 1 is completed. Next, the process of run 2 is performed. Since run 2 is connected to run 3 on the previous line with 8 connections, it is determined whether or not integration into connected component A to which run 3 belongs is possible. In the embodiments so far, the connection is determined between the runs, but here the connection is determined between the connected component and the runs. For example, the determination may be made based on the color difference between the average color of all runs included in the connected component A and the average color of run 2. Since the run and the connected component have the same components (pixels and peripheral edges), the method used for the run (the connection determination method shown in the first to fourth embodiments) can be directly extended to the process of the connected component. it can. In the figure, the case where the color difference is small and the run 2 is integrated to update the connected component A is shown.
[0069]
(C) is a state after updating the connected components. Next, since run 2 is also connected to run 4, the connection between them is determined. In this case, since the run 2 already belongs to the connected component A ′, the connection with the connected component B to which the run 4 belongs is determined. That is, the average color of the connected component A ′ and the average color of the connected component B are calculated, and the connection is determined based on the color difference. If it is determined to be connected, the connected component A ′ and the connected component B are integrated into a new connected component. If it is determined not to connect, no special processing is performed. If it is determined not to be connected and run 2 does not belong to any character element, it is registered as a new connected component. In this case, since it already belongs to connected component A ′, no processing is required. It is.
[0070]
As described above, in the fifth embodiment, the method for generating the connected component by sequentially integrating the runs has been described. Regarding the connection determination between the connected component and the run or between the connected component and the connected component, the same processing may be performed by expanding from the run to the connected component for each of the methods shown in the first to fourth embodiments.
[0071]
The connected component extraction method described in this embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. This program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read from the recording medium by the computer. The program may be a transmission medium that can be distributed via a network such as the Internet.
[0072]
【The invention's effect】
As described above, according to the present invention, since integration of sequential runs is determined from the input color image or multi-value image while confirming the state of the color or density, the color image or multi-value image is determined. Therefore, it is possible to extract the connected components directly from the image, and it is possible to extract the connected components stably without being affected by the binarization process.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a connected component extraction apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart showing processing contents in the first embodiment.
FIG. 3 is a diagram for explaining edge extraction processing;
FIG. 4 is a diagram illustrating an example of density gradient determination.
FIG. 5 is a diagram illustrating an example of run extraction.
FIG. 6 is a diagram illustrating an example of extraction of connected components.
FIG. 7 is a flowchart showing processing contents in the second embodiment.
FIG. 8 is a schematic diagram illustrating an example of creating a color difference histogram.
FIG. 9 is a diagram illustrating an example of a color difference histogram when the colors of runs are different.
FIG. 10 is a flowchart showing processing contents in the third embodiment.
FIG. 11 is a flowchart showing processing contents in the fourth embodiment.
FIG. 12 is a diagram illustrating an example of an RGB histogram.
FIG. 13 is a diagram for explaining an example of connected component extraction processing;
[Explanation of symbols]
101 Image input unit
102 Edge extraction unit
103 run extractor
104 Run connection determination unit
105 Connected component output section

Claims (12)

入力されたカラー画像からエッジを抽出するエッジ抽出工程と、
前記入力されたカラー画像からエッジ以外の画素についてランを抽出するラン抽出工程と、
前記ラン抽出工程により抽出された前記ランの間の位置関係と、色差によりランの接続の有無を判定するラン接続判定工程と、
を含み、
前記ラン接続判定工程は、
前記色差によりランの接続を判定する際に、それぞれのランの代表色を求め代表色間の色差とラン両端のエッジが有する色差をエッジの強度として比較し、代表色間の色差が小さい場合にはランが接続すると判断し、代表色間の色差が大きい場合にはランが接続しないと判断することを特徴とする連結成分抽出方法。
An edge extraction process for extracting edges from the input color image;
A run extraction step of extracting runs for pixels other than edges from the input color image;
A positional relationship between the runs extracted by the run extraction step, and a run connection determination step of determining the presence or absence of connection of the run by a color difference;
Including
The run connection determination step includes
When determining the connection of a run based on the color difference, the representative color of each run is obtained, the color difference between the representative colors is compared with the color difference of the edges at both ends of the run, and the color difference between the representative colors is small. A connected component extraction method characterized by determining that a run is connected and determining that a run is not connected when a color difference between representative colors is large.
前記ラン接続判定工程は、
前記色差によりランの接続を判定する際に、それぞれのランの平均色をそのランの代表色として代表色間の色差とラン両端のエッジの強度を比較し、代表色間の色差が小さい場合にはランが接続すると判断し、代表色間の色差が大きい場合にはランが接続しないと判断することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When determining the connection of a run based on the color difference, the average color of each run is used as the representative color of the run, and the color difference between the representative colors is compared with the intensity of the edges at both ends of the run. The connected component extraction method according to claim 1, wherein it is determined that the runs are connected, and if the color difference between the representative colors is large, it is determined that the runs are not connected.
前記ラン接続判定工程は、
前記代表色間の色差がラン両端のエッジ強度の半分より小さい場合にはランが接続すると判断し、それ以外の場合にはランが接続しないと判断することを特徴とする請求項2に記載の連結成分抽出方法。
The run connection determination step includes
3. The run is determined to be connected when the color difference between the representative colors is smaller than half of the edge strength at both ends of the run, and the run is determined not to be connected otherwise. Connected component extraction method.
前記ラン接続判定工程は、
前記色差によりランの接続を判定する際に、判定を行う2つのラン内の各画素間についてその色差を算出し、該色差の分布が単一のピークを有するときにはランを接続し、該色差の分布が複数のピークを有するときにはランを接続しないと判断することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When determining the connection of the run based on the color difference, the color difference is calculated for each pixel in the two runs to be determined, and the run is connected when the distribution of the color difference has a single peak . The connected component extraction method according to claim 1, wherein it is determined that the runs are not connected when the distribution has a plurality of peaks .
前記ラン接続判定工程は、
入力されたカラー画像のライン毎に順次処理を行ってランの統合を行い、既に統合されているランの集合と次のラインのランとの統合を判定する際には、前記ランの集合に関する連結成分の情報を利用して行うものであり、前記色差により連結成分への統合を判断する際に、連結成分と接続ランそれぞれの代表色を求め、代表色間の色差と連結成分両端および接続ラン両端のエッジの強度を比較し、代表色間の色差が小さい場合には接続ランを連結成分に統合し、それ以外の場合には接続ランを連結成分に統合しないと判断することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When integrating the run by sequentially processing each line of the input color image and determining the integration of the already integrated run set and the run of the next line, the connection related to the run set is connected. When determining the integration into the connected component based on the color difference, the representative colors of the connected component and the connection run are obtained, and the color difference between the representative colors, the both ends of the connected component, and the connection run are determined. The strengths of the edges at both ends are compared, and when the color difference between the representative colors is small, the connection run is integrated into the connected component, and otherwise, it is determined that the connection run is not integrated into the connected component. The connected component extraction method according to claim 1 .
前記ラン接続判定工程は、
入力されたカラー画像のライン毎に順次処理を行ってランの統合を行い、既に統合されているランの集合と次のラインのランとの統合を判定する際には、前記ランの集合に関する連結成分の情報を利用して行うものであり、前記色差により連結成分への統合を判断する際に、連結成分と接続ランそれぞれの平均色を代表色とし、代表色間の色差と連結成分両端および接続ラン両端のエッジの強度を比較し、代表色間の色差が小さい場合には接続ランを連結成分に統合し、それ以外の場合には接続ランを連結成分に統合しないと判断することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When integrating the run by sequentially processing each line of the input color image and determining the integration of the already integrated run set and the run of the next line, the connection related to the run set is connected. When determining the integration into the connected component based on the color difference, the average color of the connected component and the connected run is set as the representative color, and the color difference between the representative colors and both ends of the connected component and Compare the strength of the edges at both ends of the connection run, and if the color difference between the representative colors is small, it is determined that the connection run is integrated with the connected component, and otherwise the connection run is not integrated with the connected component. The connected component extraction method according to claim 1 .
前記ラン接続判定工程は、
入力されたカラー画像のライン毎に順次処理を行ってランの統合を行い、既に統合されているランの集合と次のラインのランとの統合を判定する際には、前記ランの集合に関する連結成分の情報を利用して行うものであり、前記色差により連結成分への統合を判断する際に、前記代表色間の色差がラン両端のエッジ強度の半分より小さい場合には接続ランを連結成分に統合し、それ以外の場合には接続ランを連結成分に統合しないと判断することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When integrating the run by sequentially processing each line of the input color image and determining the integration of the already integrated run set and the run of the next line, the connection related to the run set is connected. The component information is used, and when determining the integration into the connected component based on the color difference, if the color difference between the representative colors is smaller than half of the edge strength at both ends of the run, the connected run is determined as the connected component. The connected component extraction method according to claim 1, wherein it is determined that the connected run is not integrated into the connected component in other cases .
前記ラン接続判定工程は、
入力されたカラー画像のライン毎に順次処理を行ってランの統合を行い、既に統合されているランの集合と次のラインのランとの統合を判定する際には、前記ランの集合に関する連結成分の情報を利用して行うものであり、前記色差により連結成分への統合を判断する際に、連結成分と接続ラン内の各画素間についてその色差を算出し、該色差の分布により連結成分への接続ランの統合を判断するものであり、色差の分布が複数のピークを有するときには接続ランを連結成分に統合しないと判断することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When integrating the run by sequentially processing each line of the input color image and determining the integration of the already integrated run set and the run of the next line, the connection related to the run set is connected. When determining integration into a connected component based on the color difference, the color difference is calculated between the connected component and each pixel in the connected run, and the connected component is calculated based on the distribution of the color difference. The connected component extraction method according to claim 1, wherein the connection run is determined not to be integrated with the connected component when the distribution of color differences has a plurality of peaks .
前記ラン接続判定工程は、
入力されたカラー画像のライン毎に順次処理を行ってランの統合を行い、既に統合されているランの集合と次のラインのランとの統合を判定する際には、前記ランの集合に関する連結成分の情報を利用して行うものであり、前記色差により連結成分への統合を判断する際に、連結成分と接続ラン内の各画素間についてその色差を算出し、その色差の分布と連結成分および接続ラン両端のエッジ強度により連結成分への接続ランの統合を判断するものであり、前記色差の分布の最大値が連結成分および接続ラン両端のエッジ強度の半分より小さい場合には連結成分へ接続ランを統合すると判定し、それ以外の場合には連結成分へ接続ランを統合しないと判定することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When integrating the run by sequentially processing each line of the input color image and determining the integration of the already integrated run set and the run of the next line, the connection related to the run set is connected. This is performed using the component information, and when determining the integration into the connected component based on the color difference, the color difference is calculated between the connected component and each pixel in the connected run, and the distribution of the color difference and the connected component are calculated. And the integration of the connection run into the connected component based on the edge strength at both ends of the connection run. If the maximum value of the color difference distribution is smaller than half of the edge strength at both ends of the connection component and the connection run, the connection component is determined. The connected component extraction method according to claim 1, wherein it is determined that the connected runs are integrated, and otherwise, it is determined that the connected runs are not integrated into the connected components.
前記ラン接続判定工程は、
前記色差の分布の最小値が連結成分および接続ラン両端のエッジ強度の半分より小さい場合には連結成分へ接続ランを統合すると判定し、それ以外の場合には連結成分へ接続ランを統合しないと判定することを特徴とする請求項9に記載の連結成分抽出方法。
The run connection determination step includes
When the minimum value of the color difference distribution is smaller than half of the edge strengths at both ends of the connected component and the connection run, it is determined that the connection run is integrated into the connection component. Otherwise, the connection run is not integrated into the connection component. The connected component extraction method according to claim 9, wherein the determination is performed.
前記ラン接続判定工程は、
入力されたカラー画像のライン毎に順次処理を行ってランの統合を行い、既に統合されているランの集合と次のラインのランとの統合を判定する際には、前記ランの集合に関する連結成分の情報を利用して行うものであり、前記色差により連結成分への統合を判断する際に、連結成分と接続ラン中の色の分布を算出し、色の分布の間に有意差が無いと判断される場合には連結成分へ接続ランを統合すると判定し、それ以外の場合には連結成分へ接続ランを統合しないと判定することを特徴とする請求項1に記載の連結成分抽出方法。
The run connection determination step includes
When integrating the run by sequentially processing each line of the input color image and determining the integration of the already integrated run set and the run of the next line, the connection related to the run set is connected. The component information is used, and when determining the integration into the connected component based on the color difference, the distribution of the color in the connected component and the connected run is calculated, and there is no significant difference between the color distributions. The connected component extraction method according to claim 1, wherein it is determined that the connected run is integrated into the connected component when it is determined that the connected run is not integrated into the connected component in other cases. .
前記請求項1〜11のいずれか一つに記載された方法をコンピュータに実行させるプログラム。The program which makes a computer perform the method as described in any one of the said Claims 1-11.
JP2002265620A 2002-09-11 2002-09-11 Connected component extraction method and program causing computer to execute the method Expired - Fee Related JP4101005B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002265620A JP4101005B2 (en) 2002-09-11 2002-09-11 Connected component extraction method and program causing computer to execute the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002265620A JP4101005B2 (en) 2002-09-11 2002-09-11 Connected component extraction method and program causing computer to execute the method

Publications (2)

Publication Number Publication Date
JP2004102807A JP2004102807A (en) 2004-04-02
JP4101005B2 true JP4101005B2 (en) 2008-06-11

Family

ID=32264714

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002265620A Expired - Fee Related JP4101005B2 (en) 2002-09-11 2002-09-11 Connected component extraction method and program causing computer to execute the method

Country Status (1)

Country Link
JP (1) JP4101005B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5556504B2 (en) * 2010-08-24 2014-07-23 富士ゼロックス株式会社 Image processing apparatus and program
CN115346162B (en) * 2022-10-19 2022-12-13 南京优佳建筑设计有限公司 Indoor monitoring-based real-time monitoring method for water seepage of underground building wall

Also Published As

Publication number Publication date
JP2004102807A (en) 2004-04-02

Similar Documents

Publication Publication Date Title
CN111709420B (en) Text detection method, electronic device and computer readable medium
EP1146478B1 (en) A method for extracting titles from digital images
US7769206B2 (en) Finger/palm print image processing system and finger/palm print image processing method
JP5501958B2 (en) Method for creating binary mask image, symbol determination method in binary image, image compression method, image compression program, and recording medium for the program
JP4795359B2 (en) Image segmentation
US20060008147A1 (en) Apparatus, medium, and method for extracting character(s) from an image
CN111652218A (en) Text detection method, electronic device and computer readable medium
JP4100885B2 (en) Form recognition apparatus, method, program, and storage medium
JP2001118062A (en) Automatic dynamic range compressing method
KR101076307B1 (en) Skin age estimation method
Harb et al. Improved image magnification algorithm based on Otsu thresholding
JP2002288589A (en) Image processing method, image processor and computer readable recording medium recording program for executing the image processing method by computer
JP2015115067A (en) Method and device for extracting distorted straight line from image
CN106296629B (en) Image processing apparatus and method
JP4101005B2 (en) Connected component extraction method and program causing computer to execute the method
JP3902887B2 (en) Lip extraction method
JP4804382B2 (en) Image processing method, image processing program, and image processing apparatus
KR20130124659A (en) System for detaching object and the method thereof
JP5979008B2 (en) Image processing apparatus, image processing method, and program
KR100880612B1 (en) Forgery analyzer and the method of digital image
JP3533050B2 (en) Image area dividing device
KR100213013B1 (en) A circuit for improving contrast of image
JP2005004470A (en) Image color subtraction apparatus, image color subtraction method and image color subtraction program
US7239748B2 (en) System and method for segmenting an electronic image
Boiangiu et al. Bitonal image creation for automatic content conversion

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050209

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070928

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071002

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071225

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080214

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080318

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

Free format text: PAYMENT UNTIL: 20110328

Year of fee payment: 3

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130328

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140328

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees