JP3705414B2 - Binarization threshold determination method - Google Patents

Binarization threshold determination method Download PDF

Info

Publication number
JP3705414B2
JP3705414B2 JP2000161838A JP2000161838A JP3705414B2 JP 3705414 B2 JP3705414 B2 JP 3705414B2 JP 2000161838 A JP2000161838 A JP 2000161838A JP 2000161838 A JP2000161838 A JP 2000161838A JP 3705414 B2 JP3705414 B2 JP 3705414B2
Authority
JP
Japan
Prior art keywords
value
threshold value
pixel
density
calculated
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
JP2000161838A
Other languages
Japanese (ja)
Other versions
JP2001346040A (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.)
Graphtec Corp
Original Assignee
Graphtec 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 Graphtec Corp filed Critical Graphtec Corp
Priority to JP2000161838A priority Critical patent/JP3705414B2/en
Publication of JP2001346040A publication Critical patent/JP2001346040A/en
Application granted granted Critical
Publication of JP3705414B2 publication Critical patent/JP3705414B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、スキャナ等において原稿に印刷された文字や画像等のイメージデータを2値化する方法に関するもので、更に詳しくは、イメージセンサにより光学的に検出したイメージデータを2値化する場合に用いる閾値の決定方法に関するものである。
【0002】
【従来の技術】
図7は、この種の画像読取装置であるスキャナの構成の一例を示す図であり、図において10は図の主走査方向に複数の読み取り画素が配列されるイメージセンサ、11はイメージセンサ10の出力信号をデジタル信号に変換するA/D変換器、12はイメージセンサ10の出力を主走査方向について1ライン毎のデータとして順次保持するラインバッファ、2はラインバッファ12のデータより閾値を算出する閾値演算部、3は閾値演算部2とラインバッファ12のデータより着目画素における2値データを出力する2値化処理部、4はメモリ、5は処理回路、6は原稿である。
【0003】
この種の画像読み取り装置において、イメージセンサ10からの読み取りデータを白黒の2値に量子化する場合は、この読み取りデータ(IMGD)と所定の閾値(Th)とを比較して、着目画素における画像が黒データか或いは白データかを決定するよう構成されている。
この2値化を行う基準となる閾値を一定のレベルとすると、例えば原稿6の下地、即ち画像が形成されていない余白部分の濃度が変化するような場合は、本来読み取るべき画像を抽出することができなくなるという不具合が生じる。
そこで、2値化を行うための閾値を一定とせず、下地の濃度に応じてその都度決定すること(動的閾値)により、読み取るべき画像を良好に抽出する方法が知られている。この方法としては、例えば図8に示すように、閾値演算部2において、ラインバッファ12より読み取るべき着目画素(図の×印)を中心とし、その前後のラインデータを含む周辺画素(3×3マトリクス上の9画素分)のデータを読み出し、得られたデータの平均値を求めてこれを閾値(Th)とし、2値化処理部3において算出した閾値Thと着目画素における読み取りデータIMGDとを比較して、着目画素における白黒2値データの決定を行う、等が考えられている。
【0004】
【発明が解決しようとする課題】
上述の着目画素周辺のデータより平均値を求め、これを閾値とする方法においては、下地濃度と抽出した画像との濃度差が少ない場合、或いは図9に示すように、細線等の濃度の低い画像の近辺に太線等の濃度の高い画像がある場合は、閾値として算出されるデータの平均値が抽出すべき画像の濃度に近似或いはこれを越えてしまうこととなり、これにより抽出すべき画像(細線)を抽出できなくなるといった不具合を生じていた。
【0005】
上記のような不具合を解決するために、抽出すべき画像データ部分を取り除いて原稿等の下地濃度に追従した閾値を算出し、これにより正確な2値化を行うことができるよう、本出願人は特願平11−172145号に次の2値化閾値決定方法を提案した。
すなわち、この先の出願に関わる2値化閾値決定方法は、2値化すべき着目画素(N)およびその周辺画素における画像データより、着目画素(N)における平均濃度値を算出し、この平均濃度値と2値化すべき着目画素(N)の直前画素(N−1)における閾値の差を求めてこれを変化値とし、この変化値に基づいて着目画素(N)における閾値の変化度を示す追従値を算出し、この追従値と平均濃度を加算することにより、着目画素(N)における閾値を求めるよう構成し、これにより画像データ(黒データ)の存在により閾値の変化量が大きくなるという影響を低減させ、閾値の変化を下地の濃度の変化のみに追従させて、画像データの抽出を良好に行うことができるようにした。
【0006】
しかしながら、この2値化閾値決定方法においては、閾値の変化を下地の濃度の変化のみに追従させているので、抽出すべき画像がない背景部分で且つ下地の濃度が抽出すべき画像と近似した濃度にまで変化する箇所においては、これを画像データとして出力し、これがノイズとなる場合が生じていた。すなわち、先の出願の2値化閾値決定方法においては、閾値の変化を下地濃度の変化に追従させるために、変化値ΔTMnをその直前画素(N−1)における閾値Th(N−1)に基づいて算出し、この変化値により着目画素(N)における閾値を決定するため、図10に示されるように抽出すべき画像がない背景部分で且つ下地の濃度が抽出すべき画像と近似した濃度にまで変化する箇所においては、下地の濃度変化に対して閾値の変化が遅れてしまい、この結果、図のAに示すように入力画像データが閾値を超えて画像データが出力され、これがノイズとなるといった場合があった。
【0007】
本発明は、これらの不具合を解決するためになされたもので、抽出すべき画像データ部分を取り除いて原稿等の下地濃度に追従した閾値を算出し、これにより正確な2値化を行うことができるとともに、抽出すべき画像がない背景部分で且つ下地の濃度が抽出すべき画像と近似した濃度にまで変化する箇所であってもノイズを生じないよう閾値を決定するものである。
【0008】
【課題を解決するための手段】
上記課題を解決するために、本発明の2値化閾値決定方法においては、2値化すべき着目画素(N)およびその周辺画素における画像データより、着目画素(N)における平均濃度値を算出し、この平均濃度値と2値化すべき着目画素(N)の直前画素(N−1)における閾値の差を求めてこれを変化値とし、この変化値に基づいて着目画素(N)における閾値の変化度を示す追従値を算出し、この追従値と平均濃度を加算し、更に所定の加算値を加算して、着目画素(N)における閾値を求めるよう構成した。
また、加算値は、2値化すべき着目画素(N)を含む主走査方向の画素データ列における平均濃度と、その直前の主走査方向の画素データ列における平均濃度の差を求め、これに基づいて副走査方向の平均濃度の変化度を示す副走査濃度追従値を算出し、この算出した副走査濃度追従値と予め設定される固定加算値とを加算することにより決定されるよう構成した。
【0009】
【発明の実施の形態】
以下、図面に基づいて本発明の2値化閾値決定方法を詳細に説明する。
本発明の2値化閾値決定方法が適用される画像読み取り装置の構成は、図7に示される従来の装置と同様な構成でよいので、従来の装置と同等な構成は同符号をもって記載する。
【0010】
図1は本願発明の閾値決定方法を行う閾値演算部2の構成を示す図で、平均値演算部21,変化値演算部22,追従値演算部23,和演算部24,閾値保持部25および加算値設定保持部26により構成されている。
【0011】
次に、図2に基づいて、本発明の閾値決定方法を説明する。本発明の画像読み取り装置において画像データの取り込みを行う場合も、上述の従来の装置と同様にラインバッファ12に1ライン毎のデータとして格納されている画素データを順次読み出し、2値に量子化しようとする単位画素(着目画素)およびその周辺画素の画像データより閾値演算部2において閾値Thを算出し、この算出した閾値Thと着目画素における画像データIMGDとを2値化処理部3で比較することにより2値データを作成するよう構成されている。
【0012】
閾値演算部2において閾値Thを算出する場合、先ず、平均値演算部21において、着目画素(N)の画像データIMGD(N)と、この着目画素(N)を中心とした複数の周辺画素における画像データを、ラインバッファ12より読み出す。(STEP1)
次に読み出したこれらn個の画像データより、着目画素(N)における平均濃度値Mn(N)を下記の数式1により算出する。(STEP2)
Mn(N) = Σ(IMGD) / n ・・・数式1
【0013】
続いて変化値演算部22において、着目画素(N)の主走査方向における直前画素(N−1)の閾値Th(N−1)とSTEP2において算出した着目画素(N)における平均濃度値Mn(N)との差を算出(下記数式2)し、これを変化値ΔTMn(N)とする。(STEP3)
ΔTMn(N) = Th(N−1) − MnN(N) ・・・数式2
【0014】
この算出した変化値ΔTMn(N)に、任意の係数である追従係数fkを乗算して、追従値F(N)を算出(下記数式3)する。(STEP4)
F(N) = ΔTMn(N) × fk ・・・数式3
【0015】
以上のSTEP4までは、先の出願における2値化閾値決定方法と同等である。
次に、STEP4で算出した追従値F(N)と平均値演算部21において算出した着目画素(N)における平均濃度値Mn(N)、並びに予め加算値設定保持部に格納されている加算値Skを加算して、着目画素(N)における閾値Th(N)を算出(下記数式4)する。(STEP5)
Th(N) = F(N) + Mn(N) + Sk ・・・数式4
【0016】
算出した閾値Th(N)は、2値化処理部3に出力されて、着目画素(N)における画像データの2値化処理に供される。同時に、閾値Th(N)は閾値演算部2の閾値保持部25に格納され、続く着目画素(N+1)における閾値の算出に利用される。
算出した閾値Th(N)を2値化処理部3に出力すると、STEP6において続く着目画素、即ち読み込むべき画像があるか否かを判断し、続く画像がある場合はSTEP1に復帰して閾値決定処理を行い、続く画像がない場合には、閾値決定処理を終了する。
【0017】
この2値化閾値決定方法によれば、着目画素の閾値を決定する場合に、この着目画素とその周辺画素の画像データの平均濃度値と、着目画素に隣接する直前画素における閾値との差を変化値として算出するようにしたので、画像データ(黒データ)の存在により閾値の変化量が大きくなるという影響を低減することができ、下地の濃度の変化のみに追従させ、画像データの抽出を良好に行うことができる。
即ち、下地部分から画像領域に移る部分であっても、その濃度変化値が、着目画素の周辺の平均濃度値と直前画素(即ち下地部分)における閾値の差を求めて、さらにこの変化値に任意の係数である追従係数を適正な値に設定して乗算することにより、閾値の変化分を小さくすることができる。
この追従係数fkは、0<fk≦1の任意の数値で、図3に示すように、追従係数fkを1に近い値に設定して追従値F(N)を大きくすることにより、閾値Thの変化量を小さくすることができ、画像データが現れることにより平均値濃度Mnの変化が大きくなっても、閾値Thの変化量を抑えることができ、閾値を原稿の下地濃度のみに追従させることができる。
また、この追従係数fkを適正に設定することにより、閾値を平均値濃度Mnの変化に追従させ、これにより例えば細線が密となるような画像データ領域においても良好に2値化することができる。
即ち、追従係数fkを0に近い値に設定すると追従値F(N)は小さくなって、算出される閾値Th(N)は平均値濃度Mnに近い値となり、これによりその変化に追従することとなる。従って、原稿の画像が白と黒のデータが狭い範囲で多数存在するような場合は、追従係数を1に近い値に設定し、逆の場合は0に近い値に設定することにより、画像データに応じた閾値Thの変化量を適宜設定することができる。
【0018】
更に本発明の2値化閾値決定方法においては、予め設定した所定の加算値Skを加算することにより、各画素毎に決定した動的閾値を増減することにより、抽出すべき画像がない背景部分で且つ下地濃度が抽出すべき画像と近似した濃度まで変化する箇所であっても、不要な画像データを出力してノイズを発生することがない。
即ち、図4の場合は、抽出すべきではない部分を除去するため、加算値Skを負の値(その絶対値は図に示すa)として設定,加算し、閾値を「黒」方向にシフトする。これにより、抽出すべき画像だけを読み取り、ノイズを除去することが出来る。逆に、画像がかすれる等、抽出すべき画像部の画素数が少ない場合は、加算値Skを正の値として設定,加算し、閾値を「白」方向にシフトする。これにより、抽出すべき画像部の画素数を増加させることが出来る。
この加算値Skは、上記数式4で算出されるTh(N)が
濃度最小値≦Th(N)≦濃度最大値
を満足させる範囲において、予め下地濃度に応じてその値を設定しておき、操作者が読み取るべき原稿の画像状態や下地の濃度を確認して、追従係数fkと同様に、適宜加算値設定保持部26を操作して選択,決定するよう構成する。
【0019】
以上の実施例においては、操作者が予め選択,決定した加算値Skを原稿の読み取り範囲全域に対して一定の値として加算するよう構成しているが、例えば、青焼きコピー図面の如く、その全域にわたって下地濃度にムラのある原稿、即ち副走査方向(原稿の搬送方向)について下地濃度が大局的に変化するような場合には、加算値Skを一定値として加算すると、下地濃度の変化具合に依存して抽出すべき画像でない不要部分をノイズとして発生させたり、逆に抽出すべき画像部の画素数が少なくなり、画像がかすれてしまうといった不具合を生じることとなる。
この不具合を解決するために、本発明の第2実施例においては、上記加算値Skを原稿の副走査方向についての濃度変化に追従させて変化するよう構成した。
【0020】
図5は、本発明の第2実施例を示す閾値演算部2の構成を示す図で、上述の第1実施例と同等な構成については同一符号をもって示されている。
この第2実施例において、27はラインバッファ12より2値化すべき着目画素(N)が含まれる1ライン分の画像データLINEIMGD(N)を読み出してその平均値を演算する平均濃度値演算部、28は2値化すべき着目画素(N)が含まれる副走査方向についての直前のラインにおける平均濃度値を格納,保持する平均濃度値保持部、29は2値化すべき着目画素(N)が含まれるラインにおける加算値Sk_Line(N)を算出する加算値演算部である。
なお、この第2実施例においても、原稿の下地濃度の変化に対する閾値Th(N)の変化(追従)の度合いを決める追従係数fkおよび固定加算値Skは、上述の第1実施例と同様に予め操作者により選択,設定されているものとする。
【0021】
次に図6に基づいて、本発明の第2実施例における閾値決定方法を説明する。この第2実施例においても、閾値Th(N)を算出する際の処理方法について、上述の第1実施例と同等な部分については、図2に示す処理方法と同一の符号をもって示されている。
本発明の第2実施例における閾値決定方法においては、2値化すべき着目画素(N)の閾値を算出する前に、この着目画素(N)が含まれる1ライン(即ち主走査方向の画素データ列)における平均濃度値を算出すると共に、この算出した平均濃度値とその直前ラインにおける平均濃度値とに基づいて、副走査方向の下地濃度変化に応じた加算値Sk_Line(N)を算出するよう構成した。
即ち、閾値演算部2において閾値Thを算出する前に、平均値演算部27は2値化すべき着目画素(N)が含まれる1ライン分の画像データLINEIMGD(N)をラインバッファ12より読み出し(STEP11)、これらn個のデータより読み取りラインにおける平均濃度Line_Av(N)を下記数式5により算出する。(STEP12)
Line_Av(N) = Σ(LINEIMGD(N)) / n ・・・数式5
【0022】
次に、加算値演算部29において、上記平均濃度値演算部27により算出したLine_Av(N)と平均濃度値保持部28に格納保持されている直前ラインの平均濃度Line_Av(N−1)(読み取りラインが第1ライン(N=1)の場合、即ち初期状態においては、Line_Av(N)=Line_Av(N−1)とする(N=N−1))より、当該1ラインにおける平均濃度の副走査方向の変化度を示す値を算出し、これに予め設定されている追従係数fkを乗算して副走査濃度追従値を算出し、更に固定加算値Skを加算して、副走査方向の平均濃度の変化度に応じた加算値Sk_Line(N)を次式により算出する。(STEP13)
Sk_Line(N)={Line_Av(N)−Line_Av(N-1)}×fk+Sk ・・・数式6
また、当該ラインにおける加算値Sk_Line(N)を算出するとともに、平均濃度値保持部28の値をSTEP12により算出した平均濃度値Line_Av(N)に更新してこれをLine_Av(N−1)とし、着目画素(N)の2値化閾値決定動作(STEP1〜STEP5)に移行する。このSTEP1〜STEP5の2値化閾値決定動作については、上述した第1実施例と同様であるので説明は省略するが、この第2実施例においては、加算値としてSTEP13により算出したSk_Line(N)を用いるので、STEP5においては次式により閾値を算出することとなる。
Th(N) = F(N) + Mn(N) + Sk_Line(N) ・・・数式7
【0023】
2値化閾値決定動作において、着目画素における閾値を算出する(STEP5)と、STEP14に移行して1ライン分の2値化閾値決定動作が完了したか否かの検出を行う。
ここで、当該1ラインにおいて続く読み取るべき着目画素があると判断した場合は、STEP1に復帰して次の画素についての2値化閾値決定動作を行う。また、読み取るべき着目画素がないと判断した場合は、STEP15に移行して続くラインがあるか否かの検出を行う。
STEP15において続くラインデータが存在すると判断した場合は、STEP11に復帰して、次の1ライン分のデータをラインバッファ12より読み込み、当該ラインにおける加算値Sk_Line(N)の算出と2値化閾値決定動作を行う。
また、STEP15において続くラインデータがないと判断した場合は、2値化閾値決定動作を終了する。
【0024】
以上のように、本発明の第2実施例に関わる2値化閾値決定方法においては、各読み取りライン毎の平均濃度の変化率、即ち原稿の副走査方向についての濃度変化に追従させて加算値を変化するよう構成したので、副走査方向について下地濃度が大局的に変化するような場合であってもノイズの発生或いは抽出画素数の減少等を生じることがない。
また、上述の本発明の第2実施例においては、副走査濃度追従値を算出する際に、主走査方向の濃度変化追従に関わる追従係数fkを用いた例を説明したが、副走査方向の追従係数を主走査方向の追従係数とは別に設定するよう構成しても良い。
【0025】
【発明の効果】
以上詳述したとおり、本発明の2値化閾値決定方法においては、2値化すべき着目画素(N)およびその周辺画素における画像データより、着目画素(N)における平均濃度値を算出し、この平均濃度値と2値化すべき着目画素(N)の直前画素(N−1)における閾値の差を求めてこれを変化値とし、この変化値に基づいて着目画素(N)における閾値の変化度を示す追従値を算出し、この追従値と平均濃度を加算し、更に所定の加算値を加算することにより、着目画素(N)における閾値を求めるようなしたので、これにより正確な2値化を行うことができるとともに、抽出すべき画像がない背景部分で且つ下地の濃度が抽出すべき画像と近似した濃度にまで変化する箇所であってもノイズを生じないよう閾値を決定することができるという効果を奏する。
また、加算値を、2値化すべき着目画素(N)を含む主走査方向の画素データ列における平均濃度と、その直前の主走査方向の画素データ列における平均濃度の差を求め、これに基づいて副走査方向の平均濃度の変化度を示す副走査濃度追従値を算出し、この算出した副走査濃度追従値と予め設定される固定加算値とを加算するよう構成したので、副走査方向について下地濃度が大局的に変化するような場合であってもノイズの発生或いは抽出画素数の減少等を生じることがないという効果を奏する。
【図面の簡単な説明】
【図1】本発明の閾値決定方法を行う閾値演算部の構成を示す図である。
【図2】本発明の閾値決定方法を示すフローチャートである。
【図3】本発明の閾値決定方法における閾値,平均濃度値,追従値,変化値を示す図である。
【図4】本発明の閾値決定方法により得られる閾値を示す図である。
【図5】本発明の第2実施例の閾値決定方法を行う閾値演算部の構成を示す図である。
【図6】本発明の第2実施例の閾値決定方法を示すフローチャートである。
【図7】画像読み取り装置の構成を示す図である。
【図8】従来の閾値決定方法を示す説明図である。
【図9】従来の閾値決定方法により得られる閾値を示す図である。
【図10】先の出願の閾値決定方法により得られる閾値を示す図である。
【符号の説明】
10 イメージセンサ
11 A/D変換器
2 閾値演算部
3 2値化処理部
4 メモリ
5 処理回路
6 原稿
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a method for binarizing image data such as characters and images printed on a document in a scanner or the like, and more specifically, in the case of binarizing image data optically detected by an image sensor. The present invention relates to a method for determining a threshold value to be used.
[0002]
[Prior art]
FIG. 7 is a diagram showing an example of the configuration of a scanner which is this type of image reading apparatus. In FIG. 7, reference numeral 10 denotes an image sensor in which a plurality of reading pixels are arranged in the main scanning direction of the figure, and 11 denotes the image sensor 10. An A / D converter that converts an output signal into a digital signal, 12 is a line buffer that sequentially holds the output of the image sensor 10 as data for each line in the main scanning direction, and 2 is a threshold value calculated from the data of the line buffer 12 A threshold calculation unit 3 is a binarization processing unit that outputs binary data of the pixel of interest from the data of the threshold calculation unit 2 and the line buffer 12, 4 is a memory, 5 is a processing circuit, and 6 is a document.
[0003]
In this type of image reading apparatus, when the read data from the image sensor 10 is quantized into black and white binary values, the read data (IMGD) is compared with a predetermined threshold (Th), and the image at the pixel of interest is compared. Is configured to determine whether the data is black data or white data.
If the threshold value used as a reference for binarization is set to a certain level, for example, when the density of the background of the original 6, that is, the density of a blank portion where no image is formed, an image to be originally read is extracted. The problem that it becomes impossible to occur occurs.
In view of this, there is known a method of satisfactorily extracting an image to be read by making the threshold for binarization constant and determining each time according to the background density (dynamic threshold). As this method, for example, as shown in FIG. 8, in the threshold value calculation unit 2, a peripheral pixel (3 × 3) including the line data before and after the pixel of interest (marked with × in the figure) to be read from the line buffer 12 is the center. (9 pixels on the matrix) is read out, the average value of the obtained data is obtained and this is used as the threshold value (Th), and the threshold value Th calculated in the binarization processing unit 3 and the read data IMGD at the target pixel are obtained. In comparison, it is considered to determine monochrome binary data in the target pixel.
[0004]
[Problems to be solved by the invention]
In the method in which the average value is obtained from the above-mentioned data around the target pixel and this is used as a threshold value, when the density difference between the background density and the extracted image is small, or as shown in FIG. When there is an image with high density such as a thick line near the image, the average value of the data calculated as the threshold value approximates or exceeds the density of the image to be extracted. There was a problem that it was impossible to extract the thin line).
[0005]
In order to solve the above-described problems, the present applicant has calculated a threshold value that follows the background density of a manuscript or the like by removing the image data portion to be extracted, thereby enabling accurate binarization. Proposed the following binarization threshold value determination method in Japanese Patent Application No. 11-172145.
That is, the binarization threshold value determining method related to the earlier application calculates an average density value in the target pixel (N) from the image data in the target pixel (N) to be binarized and its surrounding pixels, and this average density value And the difference between the threshold values of the pixel (N−1) immediately before the target pixel (N) to be binarized is used as a change value, and the follow-up indicating the degree of change in the threshold value of the target pixel (N) based on the change value. By calculating the value and adding the follow-up value and the average density, the threshold value for the pixel of interest (N) is obtained, and the change amount of the threshold value increases due to the presence of the image data (black data). Image data can be extracted satisfactorily by making the change in threshold value follow only the change in the background density.
[0006]
However, in this binarization threshold value determination method, since the change in the threshold value is made to follow only the change in the background density, the background density where there is no image to be extracted and the background density approximated the image to be extracted. At locations where the density changes, this is output as image data, which may be noise. That is, in the binarization threshold value determination method of the previous application, the change value ΔTMn is set to the threshold value Th (N−1) in the immediately preceding pixel (N−1) in order to make the change in the threshold value follow the change in the background density. Based on this change value, the threshold value for the pixel of interest (N) is determined. Therefore, as shown in FIG. 10, the density of the background portion where there is no image to be extracted and the background density approximated to the image to be extracted As shown in A of the figure, the input image data exceeds the threshold value, and the image data is output at the location where the input image data changes to the background. There was a case.
[0007]
The present invention has been made to solve these problems, and it is possible to calculate a threshold value that follows the background density of a document or the like by removing an image data portion to be extracted, thereby performing accurate binarization. In addition, the threshold value is determined so that noise is not generated even in a background portion where there is no image to be extracted and even where the background density changes to a density approximate to the image to be extracted.
[0008]
[Means for Solving the Problems]
In order to solve the above-described problem, in the binarization threshold value determination method of the present invention, an average density value in the target pixel (N) is calculated from the image data in the target pixel (N) to be binarized and its surrounding pixels. The difference between the average density value and the threshold value of the pixel (N−1) immediately before the target pixel (N) to be binarized is obtained as a change value, and the threshold value of the target pixel (N) is determined based on the change value. A follow-up value indicating the degree of change is calculated, the follow-up value and the average density are added, and a predetermined addition value is added to obtain a threshold value for the pixel of interest (N).
Further, the added value is obtained based on the difference between the average density in the pixel data string in the main scanning direction including the pixel of interest (N) to be binarized and the average density in the pixel data string in the main scanning direction immediately before. The sub-scanning density follow-up value indicating the degree of change in average density in the sub-scanning direction is calculated, and the calculated sub-scan density follow-up value is added to a preset fixed addition value.
[0009]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the binarization threshold value determining method of the present invention will be described in detail with reference to the drawings.
Since the configuration of the image reading apparatus to which the binarization threshold value determining method of the present invention is applied may be the same as the configuration of the conventional apparatus shown in FIG. 7, the configuration equivalent to that of the conventional apparatus is described with the same symbol.
[0010]
FIG. 1 is a diagram showing a configuration of a threshold value calculation unit 2 that performs the threshold value determination method of the present invention. An average value calculation unit 21, a change value calculation unit 22, a follow-up value calculation unit 23, a sum calculation unit 24, a threshold value holding unit 25, and The addition value setting holding unit 26 is configured.
[0011]
Next, the threshold value determination method of the present invention will be described based on FIG. Even when image data is captured by the image reading apparatus of the present invention, pixel data stored as data for each line in the line buffer 12 is sequentially read out and quantized into binary values as in the conventional apparatus described above. The threshold value calculation unit 2 calculates a threshold value Th from the unit pixel (target pixel) and the peripheral pixel image data, and the binarization processing unit 3 compares the calculated threshold value Th with the image data IMGD of the target pixel. Thus, it is configured to create binary data.
[0012]
When calculating the threshold value Th in the threshold value calculation unit 2, first, in the average value calculation unit 21, the image data IMGD (N) of the target pixel (N) and a plurality of peripheral pixels centered on the target pixel (N). Image data is read from the line buffer 12. (STEP1)
Next, an average density value Mn (N) at the target pixel (N) is calculated from the n pieces of image data read out by the following Equation 1. (STEP2)
Mn (N) = Σ (IMGD) / n Expression 1
[0013]
Subsequently, in the change value calculation unit 22, the threshold value Th (N-1) of the immediately preceding pixel (N-1) in the main scanning direction of the pixel of interest (N) and the average density value Mn () of the pixel of interest (N) calculated in STEP2. N) is calculated (Equation 2 below), and this is defined as a change value ΔTMn (N). (STEP3)
ΔTMn (N) = Th (N−1) −MnN (N) Equation 2
[0014]
The calculated change value ΔTMn (N) is multiplied by a tracking coefficient fk, which is an arbitrary coefficient, to calculate a tracking value F (N) (Formula 3 below). (STEP4)
F (N) = ΔTMn (N) × fk Equation 3
[0015]
Up to the above STEP 4 is equivalent to the binarization threshold value determination method in the previous application.
Next, the follow-up value F (N) calculated in STEP 4, the average density value Mn (N) in the target pixel (N) calculated in the average value calculation unit 21, and the addition value stored in advance in the addition value setting holding unit Sk is added to calculate a threshold Th (N) for the pixel of interest (N) (Formula 4 below). (STEP5)
Th (N) = F (N) + Mn (N) + Sk Equation 4
[0016]
The calculated threshold Th (N) is output to the binarization processing unit 3 and used for the binarization processing of the image data in the pixel of interest (N). At the same time, the threshold value Th (N) is stored in the threshold value holding unit 25 of the threshold value calculation unit 2 and used for calculating the threshold value in the subsequent pixel of interest (N + 1).
When the calculated threshold value Th (N) is output to the binarization processing unit 3, it is determined whether or not there is a subsequent pixel of interest, that is, an image to be read in STEP6. If there is a subsequent image, the process returns to STEP1 to determine the threshold value. When the process is performed and there is no subsequent image, the threshold value determination process is terminated.
[0017]
According to this binarization threshold value determination method, when determining the threshold value of the target pixel, the difference between the average density value of the image data of the target pixel and its surrounding pixels and the threshold value of the immediately preceding pixel adjacent to the target pixel is calculated. Since it is calculated as a change value, it is possible to reduce the influence that the change amount of the threshold value increases due to the presence of the image data (black data), and to follow only the change in the density of the background, and to extract the image data. It can be done well.
That is, even in the portion that moves from the background portion to the image region, the density change value is obtained by calculating the difference between the average density value around the pixel of interest and the threshold value in the immediately preceding pixel (that is, the background portion), and further to this change value. By setting and multiplying the tracking coefficient, which is an arbitrary coefficient, to an appropriate value, the amount of change in the threshold can be reduced.
This follow-up coefficient fk is an arbitrary value of 0 <fk ≦ 1, and as shown in FIG. 3, by setting the follow-up coefficient fk to a value close to 1 and increasing the follow-up value F (N), the threshold Th The amount of change in the threshold value Th can be suppressed even if the change in the average density Mn increases due to the appearance of the image data, and the threshold value can be made to follow only the background density of the document. Can do.
Further, by appropriately setting the follow-up coefficient fk, the threshold value can be made to follow the change of the average value density Mn, so that, for example, even in an image data region where fine lines are dense, binarization can be favorably performed. .
That is, when the follow-up coefficient fk is set to a value close to 0, the follow-up value F (N) becomes small, and the calculated threshold value Th (N) becomes a value close to the average value concentration Mn, thereby following the change. It becomes. Accordingly, when there are a large number of white and black data in a document in a narrow range, the tracking coefficient is set to a value close to 1, and vice versa, the image data is set to a value close to 0. The amount of change in the threshold value Th can be set as appropriate.
[0018]
Further, in the binarization threshold value determination method of the present invention, a background portion where there is no image to be extracted by adding or decreasing a dynamic threshold value determined for each pixel by adding a predetermined addition value Sk set in advance. Even if the background density changes to a density approximate to the image to be extracted, unnecessary image data is not output and noise is not generated.
That is, in the case of FIG. 4, in order to remove a portion that should not be extracted, the addition value Sk is set as a negative value (the absolute value is a shown in the figure) and added, and the threshold value is shifted in the “black” direction. To do. Thereby, only the image to be extracted can be read and noise can be removed. Conversely, when the number of pixels in the image portion to be extracted is small, such as when the image is faint, the addition value Sk is set and added as a positive value, and the threshold value is shifted in the “white” direction. Thereby, the number of pixels of the image portion to be extracted can be increased.
This added value Sk is set in advance in accordance with the background density in a range where Th (N) calculated by the above equation 4 satisfies the minimum density value ≦ Th (N) ≦ maximum density value. The operator confirms the image state of the document to be read and the background density, and selects and determines the addition value setting holding unit 26 as appropriate, similarly to the tracking coefficient fk.
[0019]
In the above embodiment, the addition value Sk selected and determined in advance by the operator is added as a constant value over the entire reading range of the document. When the background density changes globally in the sub-scanning direction (original transport direction) of the original with uneven background density throughout the entire area, if the addition value Sk is added as a constant value, Depending on the image quality, an unnecessary portion that is not an image to be extracted is generated as noise, or conversely, the number of pixels in the image portion to be extracted is reduced, and the image is blurred.
In order to solve this problem, in the second embodiment of the present invention, the addition value Sk is changed so as to follow the density change in the sub-scanning direction of the document.
[0020]
FIG. 5 is a diagram showing the configuration of the threshold value calculation unit 2 according to the second embodiment of the present invention. Components equivalent to those in the first embodiment are denoted by the same reference numerals.
In the second embodiment, an average density value calculating unit 27 reads out image data LINEIMGD (N) for one line including the target pixel (N) to be binarized from the line buffer 12 and calculates an average value thereof. Reference numeral 28 denotes an average density value holding unit that stores and holds an average density value in the immediately preceding line in the sub-scanning direction including the target pixel (N) to be binarized, and 29 includes the target pixel (N) to be binarized. This is an addition value calculation unit for calculating the addition value Sk_Line (N) in the line to be processed.
In the second embodiment, the tracking coefficient fk and the fixed addition value Sk that determine the degree of change (following) of the threshold Th (N) with respect to the change in the background density of the document are the same as in the first embodiment. It is assumed that the operator has selected and set in advance.
[0021]
Next, based on FIG. 6, a threshold value determining method in the second embodiment of the present invention will be described. Also in the second embodiment, the processing method for calculating the threshold Th (N) is indicated by the same reference numerals as those in the processing method shown in FIG. .
In the threshold value determining method according to the second embodiment of the present invention, before calculating the threshold value of the target pixel (N) to be binarized, one line (that is, pixel data in the main scanning direction) including the target pixel (N) is calculated. The average density value in the column) is calculated, and the addition value Sk_Line (N) corresponding to the background density change in the sub-scanning direction is calculated based on the calculated average density value and the average density value in the immediately preceding line. Configured.
That is, before the threshold value calculation unit 2 calculates the threshold value Th, the average value calculation unit 27 reads out one line of image data LINEIMGD (N) including the pixel of interest (N) to be binarized from the line buffer 12 ( (Step 11), the average density Line_Av (N) in the reading line is calculated from the n pieces of data according to the following formula 5. (STEP12)
Line_Av (N) = Σ (LINEIMGD (N)) / n ... Formula 5
[0022]
Next, in the addition value calculation unit 29, Line_Av (N) calculated by the average density value calculation unit 27 and the average density Line_Av (N−1) of the immediately preceding line stored and held in the average density value holding unit 28 (read) When the line is the first line (N = 1), that is, in the initial state, Line_Av (N) = Line_Av (N−1) (N = N−1)), the average density sub-line of the one line is obtained. A value indicating the degree of change in the scanning direction is calculated, and a sub-scanning density follow-up value is calculated by multiplying this by a preset follow-up coefficient fk. Further, a fixed addition value Sk is added, and an average in the sub-scan direction is calculated. An added value Sk_Line (N) corresponding to the degree of change in density is calculated by the following equation. (STEP 13)
Sk_Line (N) = {Line_Av (N) −Line_Av (N−1)} × fk + Sk Equation 6
Further, the addition value Sk_Line (N) in the line is calculated, the value of the average density value holding unit 28 is updated to the average density value Line_Av (N) calculated in STEP 12, and this is set as Line_Av (N−1). The operation proceeds to the binarization threshold value determining operation (STEP 1 to STEP 5) of the pixel of interest (N). Since the binarization threshold value determination operation in STEP 1 to STEP 5 is the same as that in the first embodiment described above, description thereof will be omitted. In this second embodiment, Sk_Line (N) calculated by STEP 13 as an added value. Therefore, in STEP 5, the threshold value is calculated by the following equation.
Th (N) = F (N) + Mn (N) + Sk_Line (N) Equation 7
[0023]
In the binarization threshold value determining operation, when the threshold value for the pixel of interest is calculated (STEP 5), the process proceeds to STEP 14 to detect whether or not the binarization threshold value determining operation for one line is completed.
Here, if it is determined that there is a pixel of interest to be read in the one line, the process returns to STEP 1 to perform a binarization threshold value determining operation for the next pixel. If it is determined that there is no target pixel to be read, the process proceeds to STEP 15 to detect whether there is a subsequent line.
If it is determined in STEP 15 that the following line data exists, the process returns to STEP 11, the next one line of data is read from the line buffer 12, and the addition value Sk_Line (N) for the line is calculated and the binarization threshold is determined. Perform the action.
If it is determined in STEP 15 that there is no subsequent line data, the binarization threshold value determining operation is terminated.
[0024]
As described above, in the binarization threshold value determining method according to the second embodiment of the present invention, the addition value is made to follow the change rate of the average density for each reading line, that is, the density change in the sub-scanning direction of the document. Therefore, even if the background density changes globally in the sub-scanning direction, no noise is generated or the number of extracted pixels is not reduced.
In the second embodiment of the present invention described above, an example in which the tracking coefficient fk related to density change tracking in the main scanning direction is used when calculating the sub-scanning density tracking value has been described. The tracking coefficient may be set separately from the tracking coefficient in the main scanning direction.
[0025]
【The invention's effect】
As described above in detail, in the binarization threshold value determination method of the present invention, the average density value in the target pixel (N) is calculated from the image data in the target pixel (N) to be binarized and its surrounding pixels, The difference between the average density value and the threshold value of the pixel (N-1) immediately before the target pixel (N) to be binarized is obtained as a change value, and the change degree of the threshold value in the target pixel (N) based on this change value Since the threshold value for the pixel of interest (N) is obtained by calculating the tracking value indicating the value, adding the tracking value and the average density, and further adding a predetermined additional value, this enables accurate binarization. And a threshold value can be determined so that noise is not generated even in a background portion where there is no image to be extracted and where the background density changes to a density approximate to the image to be extracted. When Achieve the cormorant effect.
Further, the difference between the average density in the pixel data string in the main scanning direction including the pixel of interest (N) to be binarized and the average density in the pixel data string in the main scanning direction immediately before the addition value is obtained, and based on this The sub-scanning density follow-up value indicating the degree of change in the average density in the sub-scan direction is calculated, and the calculated sub-scan density follow-up value is added to the preset fixed addition value. Even if the background density changes globally, there is an effect that no noise is generated or the number of extracted pixels is not reduced.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a configuration of a threshold value calculation unit that performs a threshold value determination method according to the present invention.
FIG. 2 is a flowchart showing a threshold value determining method according to the present invention.
FIG. 3 is a diagram showing a threshold value, an average density value, a tracking value, and a change value in the threshold value determining method of the present invention.
FIG. 4 is a diagram showing threshold values obtained by the threshold value determining method of the present invention.
FIG. 5 is a diagram illustrating a configuration of a threshold value calculation unit that performs the threshold value determination method according to the second embodiment of the present invention;
FIG. 6 is a flowchart showing a threshold value determining method according to the second embodiment of the present invention.
FIG. 7 is a diagram illustrating a configuration of an image reading apparatus.
FIG. 8 is an explanatory diagram showing a conventional threshold value determining method.
FIG. 9 is a diagram showing threshold values obtained by a conventional threshold value determining method.
FIG. 10 is a diagram showing threshold values obtained by the threshold value determination method of the previous application.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 Image sensor 11 A / D converter 2 Threshold calculation part 3 Binarization process part 4 Memory 5 Processing circuit 6 Original

Claims (2)

主走査方向に複数の画素データを配列して格納することによりラインデータを構成し、更に副走査方向に複数のラインデータを格納することにより、画像のデータを2次元的に格納し、この格納した各画素のデータを2値化するための閾値の決定方法において、
2値化すべき着目画素(N)およびその周辺画素のデータより、着目画素(N)における平均濃度を算出し、
この平均濃度値と2値化すべき着目画素(N)の直前画素(N−1)における閾値との差を求めてこれを変化値とし、
算出した変化値に基づいて、着目画素(N)における閾値の変化度を示す追従値を算出し、
この追従値と上記平均濃度値を加算し、更に所定の加算値を加算して、着目画素(N)における閾値を求めることを特徴とする2値化閾値決定方法。
Line data is configured by arranging and storing a plurality of pixel data in the main scanning direction, and further storing image data two-dimensionally by storing a plurality of line data in the sub-scanning direction. In the method for determining a threshold value for binarizing the data of each pixel,
From the data of the target pixel (N) to be binarized and its surrounding pixels, the average density at the target pixel (N) is calculated,
The difference between this average density value and the threshold value of the pixel (N−1) immediately before the pixel of interest (N) to be binarized is determined as a change value,
Based on the calculated change value, a tracking value indicating the degree of change of the threshold value in the pixel of interest (N) is calculated,
A binarization threshold value determining method characterized by adding the follow-up value and the average density value and further adding a predetermined added value to obtain a threshold value for the pixel of interest (N).
上記加算値は、2値化すべき着目画素(N)を含む主走査方向の画素データ列における平均濃度と、その直前の主走査方向の画素データ列における平均濃度の差を求め、これに基づいて副走査方向の平均濃度の変化度を示す副走査濃度追従値を算出し、この算出した副走査平均追従値と予め設定される固定加算値とを加算することにより決定することを特徴とする請求項1記載の2値化閾値決定方法。The added value is obtained based on the difference between the average density in the pixel data string in the main scanning direction including the pixel of interest (N) to be binarized and the average density in the pixel data string in the main scanning direction immediately before. The sub-scanning density follow-up value indicating the degree of change in the average density in the sub-scanning direction is calculated, and the sub-scanning density follow-up value is determined by adding the calculated sub-scanning average follow-up value and a preset fixed addition value. Item 2. The binarization threshold value determining method according to Item 1.
JP2000161838A 2000-05-31 2000-05-31 Binarization threshold determination method Expired - Fee Related JP3705414B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000161838A JP3705414B2 (en) 2000-05-31 2000-05-31 Binarization threshold determination method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000161838A JP3705414B2 (en) 2000-05-31 2000-05-31 Binarization threshold determination method

Publications (2)

Publication Number Publication Date
JP2001346040A JP2001346040A (en) 2001-12-14
JP3705414B2 true JP3705414B2 (en) 2005-10-12

Family

ID=18665796

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000161838A Expired - Fee Related JP3705414B2 (en) 2000-05-31 2000-05-31 Binarization threshold determination method

Country Status (1)

Country Link
JP (1) JP3705414B2 (en)

Also Published As

Publication number Publication date
JP2001346040A (en) 2001-12-14

Similar Documents

Publication Publication Date Title
JP3003799B2 (en) Image sharpness enhancement method and apparatus
JPS62118676A (en) Picture processing system
JP3031994B2 (en) Image processing device
JP3568732B2 (en) Image processing device
JP3989341B2 (en) Image processing device
JP3705414B2 (en) Binarization threshold determination method
JPH0950519A (en) Picture processor and its method
JP3705405B2 (en) Binarization threshold determination method
JP4553297B2 (en) Image processing device
JP3748366B2 (en) Binarization and binarization threshold determination method
JP3792402B2 (en) Image processing apparatus, binarization method, and machine-readable recording medium recording a program for causing a computer to execute the binarization method
JP3451490B2 (en) Image information processing method
JP2002290727A (en) Image processing method, its apparatus, its storage medium, and its program
JP2002368998A (en) Method for determining binary threshold
JP2007312233A (en) Image processor and program
JPH04281671A (en) Picture processor
JP3036244B2 (en) Image signal processing device
JPH0561677B2 (en)
JP2023008183A (en) Imaging apparatus, control method, program, and storage medium
JP2527481B2 (en) Image binarization processing device
JP3178077B2 (en) Binarization processing method
JPH07226840A (en) Binarization device
JPH07121063B2 (en) Image processing device
JPH09307765A (en) Image processing method and device
JPH1011572A (en) Picture processing method and its device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050714

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050720

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090805

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100805

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110805

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120805

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130805

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees