JP3565551B2 - Image binarization device - Google Patents

Image binarization device Download PDF

Info

Publication number
JP3565551B2
JP3565551B2 JP12666599A JP12666599A JP3565551B2 JP 3565551 B2 JP3565551 B2 JP 3565551B2 JP 12666599 A JP12666599 A JP 12666599A JP 12666599 A JP12666599 A JP 12666599A JP 3565551 B2 JP3565551 B2 JP 3565551B2
Authority
JP
Japan
Prior art keywords
pixel
image
binarization
change
predetermined amount
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
JP12666599A
Other languages
Japanese (ja)
Other versions
JP2000322554A (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.)
Funai Electric Co Ltd
Original Assignee
Funai Electric 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 Funai Electric Co Ltd filed Critical Funai Electric Co Ltd
Priority to JP12666599A priority Critical patent/JP3565551B2/en
Publication of JP2000322554A publication Critical patent/JP2000322554A/en
Application granted granted Critical
Publication of JP3565551B2 publication Critical patent/JP3565551B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Input (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、デジタルカメラ等の撮像機器に用いられ、m行×n列のマトリクス状の画素から成る画像を2値化処理する画像2値化装置に関する。
【0002】
【従来の技術】
撮像機器であるデジタルカメラ等には、撮像した画像に、所望のタイトルを重ねることができるタイトル機能と呼ばれる特殊機能が設けられている。これは、準備しておいたタイトル画像を別途撮像し、このタイトル画像を画像2値化装置により2値化処理してタイトル文字やタイトル画の部分のみを抽出し、抽出したタイトル文字やタイトル画を重畳すべき画像に重ねるというものである。
【0003】
そして、このような画像2値化装置による2値化処理は、m行×n列のマトリクス状の画素から成る画像について、各画素の輝度を一定の2値化レベルを基準としてこの基準値より高いか低いかを比較判断することにより行われるのが一般的である。
【0004】
【発明が解決しようとする課題】
しかし、タイトル画像を撮像する際に、光の当たり具合によっていわゆるハレーションが起きて、得られたタイトル画像において同じ背景色であっても明るさの異なる箇所が生じることがあり、このような場合に上記した従来の画像2値化装置では、2値化レベルが固定であることから、タイトル文字やタイトル画でないにも拘わらず、その部分がタイトル文字やタイトル画の一部であると判断され、ユーザが考えていたタイトル文字やタイトル画とは異なるものが重畳されてしまうという不都合が生じるおそれがあった。
【0005】
これを解消するには、2値化レベルを複数設定し、光の当たり具合に応じて2値化レベルを適宜選択することが考えられるが、処理が非常に複雑になるという問題があった。
【0006】
ところで、画像の2値化に関して、例えば特開昭62−133587号公報や特開平8−46860号公報に記載の装置がある。前者の公報に記載のものは、背景のみの画像とこれに対象物を加えた画像を取得し、背景のみの画像から得た一画素の輝度及び補正係数から2値化のしきい値を定めることで、対象物のみを抽出しようとするものであるが、この場合、背景のみの画像とこれに対象物を加えた画像の2つの画像が必要になり、撮像の手間がかかるという問題がある。
【0007】
一方、後者の公報に記載のものは、撮影された1つの光学画像を輝度レベルが異なる複数に分割し、分割した各領域毎に適正露光を算出し、各領域の画像を各々の適正露光量で撮影し、これにより輝度差の大きい複数の被写体を適正な露出条件下で撮影できるようにするというものであるが、この場合、1つの画像を分割するなど繁雑な処理が必要になるという問題がある。
【0008】
この発明が解決しようとする課題は、光の当り具合によって明るさが部分的に異なる画像であっても、精度よく2値化できるようにすることにある。
【0009】
【課題を解決するための手段】
上記した課題を解決するために、本発明は、撮像機器に用いられ、m行×n列のマトリクス状の画素から成る画像を2値化処理する画像2値化装置において、各行の第1列から第n列の画素についてその輝度がその前の画素よりも所定量以上変化するかどうかを順次判定する判定部と、第1列から第n列の画素を順次、基準画素に設定し、判定部により、基準画素の次の画素が所定量以上変化すると判定される場合に、その変化が減少方向への変化のときには、前記次の画素を黒に設定し、その変化が増加方向への変化のときには、次の画素を白に設定することにより2値化し、前記基準画素の次の画素が所定量以上変化しないと判定される場合に、前記基準画素の色と同一に設定する処理部とを備えている。
【0010】
このように構成すれば、各行の第1列から第n列の画素について、その輝度がその前の画素よりも所定量以上変化するかどうかが順次判断され、第1列から第n列の画素を順次、基準画素に設定し、基準画素の次の画素が所定量以上減少方向へ変化するときには、次の画素を黒に設定し、所定量以上増加方向へ変化するときには、次の画素を白に設定し、前記基準画素の次の画素が所定量以上変化しないと判定される場合に、前記基準画素の色と同一に設定することにより2値化することができる。
【0011】
そのため、光の当り具合によって明るさが部分的に異なる画像であっても、従来のように一定レベルで2値化したときに、例えばタイトル文字やタイトル画でないにも拘わらず、その部分がタイトル文字やタイトル画の一部であると判断されてしまうことを防止でき、複数の2値化レベルを設定することもなく、精度よく2値化することが可能になる。
【0012】
また、本発明は、画像の2値化処理に先立ち、前記判定部による全画素についての判定の結果、前記所定量以上その輝度が変化する画素が存在するかどうかによってその画素が2値化すべき画像かどうかを判断する判断部を備え、前記判断部により2値化処理すべき画像であると判断されたときに、前記判定部による全画素についての判定を繰り返して前記処理部による2値化処理を行うことを特徴としている。
【0013】
こうすると、判断部により、その画像が背景のみで2値化処理すべきものでないと判断されたときには、その画像の2値化は行われず、その画像が2値化処理すべきものであると判断されたときには、処理部によりその画像の2値化処理が行われるため、不要な処理を行わずに済む。
【0014】
また、本発明は、画像の2値化処理に先立ち、前記判定部により輝度が前記所定量以上変化すると判定される最初の画素におけるその変化が、減少方向への変化のときにはその行頭の状態を白、増加方向への変化のときにはその行頭の状態を黒に設定する設定部を備え、前記処理部が、前記設定部により設定された各行頭の状態に基づき、前記設定部により判定される前記基準画素とその輝度の変化により白から黒、或いは黒から白に変化する、若しくは直前の画素の色と同一の状態にする、として2値化処理することを特徴としている。
【0015】
こうすれば、設定部により設定された各行の先頭画素の白或いは黒の状態を基に、その行における各画素の輝度変化から2値化することができ、光の当り具合によって明るさが部分的に異なる画像であっても、従来のように、例えばタイトル文字やタイトル画でないにも拘わらず、その部分がタイトル文字やタイトル画の一部であると判断されることを防止でき、精度よく2値化処理することが可能になる。
【0016】
また、本発明は、前記所定量が、光の当たり具合に関係なく白と黒とを区別できる程度の輝度の変化量であることを特徴としている。この場合、所定量として、光の当たり具合に関係なく白と黒とを区別できる程度の輝度の変化量を予め実験的に求めておけばよく、これにより精度のよい2値化処理が可能になる。
【0017】
また、本発明は、前記撮像機器が、デジタルカメラであることを特徴としている。こうすると、デジタルカメラにおける特殊機能であるタイトル機能等に対応することができ、ユーザが希望するタイトル文字やタイトル画を精度よく重畳することが可能になる。
【0018】
【発明の実施の形態】
この発明をデジタルカメラに適用した場合の一実施形態について図1ないし図5を参照して説明する。但し、図1はブロック図、図2は動作説明図、図3ないし図5は動作説明用フローチャートである。
【0019】
図1に示すように、m行×n列のマトリクス状の2次元CCDユニット1により撮像された画像データは、A/Dコンバータ2によりデジタル変換され、このデジタル変換された画像データはDSP(Digital Signal Processor)3により画素補間処理等の必要な処理が施され、その後CPU4により画像メモリ5に蓄積される。
【0020】
そして、図示しないキーの操作により、例えばタイトル機能が選択されると、CCDユニット1により別途撮像されたタイトル画像について、CPU4により、各行の第1列から第n列の画素について、256階調の輝度がその前の画素よりも所定量以上変化するかどうかが順次判定される。この判定処理が、判定部に相当する。
【0021】
尚、このときの所定量とは、光の当たり具合に関係なく白と黒とを区別できる程度の輝度の変化量であり、予め実験的に求めておくのが望ましく、例えば10〜20階調の輝度変化量であるのが好ましい。
【0022】
更に、CPU4により、タイトル画像の全画素についての上記したような判定の結果、所定量以上その輝度が変化する画素が存在するかどうかによって、その画像が2値化処理すべきタイトル画像であるかどうかの判断がなされる。この判断処理が、判断部に相当する。
【0023】
このように、2値化処理すべきタイトル画像であると判断されると、CPU4により、輝度が所定量以上変化する画素におけるその変化が減少方向への変化のときには、その行頭の状態は白、増加方向への変化のときにはその行頭の状態は黒に設定される。この設定処理が、設定部に相当する。
【0024】
また、このようにタイトル画像の各行頭の白、黒の状態に基づき、CPU4により、各行についてその輝度が所定量以上変化する画素が存在するかどうかの判定がなされ、存在すればその画素を基準画素として、基準画素の輝度が減少していれば白から黒、増加していれば黒から白に変化するとして2値化処理される。この2値化処理が、処理部に相当する。
【0025】
従って、ある行の輝度変化曲線が、例えば図2(a)に示すようになった場合、輝度値が所定量以上変化する画素P1が検出され、この画素P1における輝度変化が減少方向であることから、この行の先頭の状態は“白”に設定され、図2(b)に示すように、行頭から画素P1までの間は“白”に保持され、画素P1において“黒”に反転処理される。
【0026】
続いて、図2(c)に示すように、画素P1以後の画素の輝度は、所定量以上減少する区間と所定量以上の変化をしない区間とが続くが、所定量以上減少する区間では画素の値を“黒”に設定し続け、所定量以上変化しない区間では前の画素と同じ“黒”を設定し続けるので、これらの区間では画素は“黒”に保持される。図2(d)に示すように、輝度値が所定値以上増加する画素P2が検出されると、画素P2において“白”に反転処理され、図2(e)に示すように、画素P2以後の画素の輝度は、所定量以上増加する区間と所定量以上の変化をしない区間とが続くが、所定量以上増加する区間では画素の値を“白”に設定し続け、所定量以上変化しない区間では前の画素と同じ“白”を設定し続けるので、これらの区間では画素は白に保持される。
【0027】
次に、動作について図3ないし図5のフローチャートを参照して説明する。まず、2値化処理すべきタイトル画像かどうかを判断する画像判定の処理手順について説明すると、図3に示すように、第1行、第1列の第1画素の輝度が基準値に設定され(ステップS1)、次の画素の輝度が基準値よりも所定量以上大きいか否かの判定がなされ(ステップS2)、この判定結果がYESであれば、その基準値の画素の状態が“黒”に設定され(ステップS3)、その画像が2値化すべき画像であると判断されて正常応答が返され(ステップS4)、動作は終了する。
【0028】
一方、上記したステップS2の判定結果がNOであれば、その画素の輝度が基準値よりも所定量以上小さいか否かの判定がなされ(ステップS5)、この判定結果がYESであれば、その基準値の画素の状態が“白”に設定され(ステップS6)、その画像が2値化すべき画像であると判断されて正常応答が返され(ステップS7)、動作は終了する。
【0029】
また、ステップS5の判定結果がNOであれば、その行の最後の画素か否かの判定がなされ(ステップS8)、この判定結果がNOであれば上記したステップS2に戻り、判定結果がYESであれば、その行が最後の行か否かの判定がなされ(ステップS9)、この判定結果がNOであれば、次の行の先頭画素に移動され(ステップS10)、その先頭画素の輝度が新たな基準値に設定され(ステップS11)、その後上記したステップS2に戻る。
【0030】
ところで、ステップS9の判定結果がYESであれば、その画像が2値化処理すべき画像ではないと判断されて異常応答が返され(ステップS12)、その後動作は終了する。このような処理により、正常応答が返されればそのタイトル画像は2値化すべき画像であり、異常応答が返されれば、そのタイトル画像は、例えば背景のみで2値化すべき画像ではないということが把握できる。
【0031】
続いて、各行の先頭画素の状態が白か黒かを設定する行頭状態設定の処理手順について説明すると、図4に示すように、その行の先頭画素の輝度が、上記したステップS1やS11における基準値とは別の基準値に設定され(ステップS21)、その行の次の画素の輝度が基準値よりも所定量以上大きいか否かの判定がなされ(ステップS22)、この判定結果がYESであれば、その基準値の画素の状態が“黒”に設定され(ステップS23)、正常応答が返された後(ステップS24)、動作は終了する。
【0032】
一方、ステップS22の判定結果がNOであれば、その画素の輝度が基準値よりも所定量以上小さいか否かの判定がなされ(ステップS25)、この判定結果がYESであれば、その基準値の画素の状態が“白”に設定され(ステップS26)、正常応答が返された後(ステップS27)、動作は終了する。
【0033】
また、ステップS25の判定結果がNOであれば、その行の最後の画素か否かの判定がなされ(ステップS28)、この判定結果がNOであれば上記したステップS2に戻り、判定結果がYESであれば、その行において輝度値が変化する画素はないと判断できるため、その行の先頭画素の輝度値そのものが予め定めたしきい値を基準にして“白”か“黒”かの判断が行われ、その行の先頭画素の状態が決定された後(ステップS29)、正常応答が返され(ステップS30)、その後動作は終了する。
【0034】
次に、2値化処理の手順について説明すると、図5に示すように、まず上記したような2値化すべき画像かどうかの画像判定処理(図3参照)が行われ(ステップS41)、異常応答があるか否かの判定がなされ(ステップS42)、この判定結果がYESであれば2値化処理しても無駄であるため、そのまま動作は終了する。
【0035】
一方、ステップS42の判定結果がNOであれば、第1行、第1列の第1画素の輝度が基準値に設定され(ステップS43)、次の画素の輝度が基準値よりも所定量以上大きいか否かの判定がなされ(ステップS44)、この判定結果がYESであれば、次の画素を“白”に設定する(ステップS45)。
【0036】
また、ステップS44での判定結果がNOであれば、その画素の輝度が基準値よりも所定量以上小さいか否かの判定がなされ(ステップS46)、この判定結果がYESであれば、その画素が“黒”に設定され(ステップS47)、その後、ステップS45の処理を経た後、ステップS46の判定結果がNOの場合と共にステップS48に移行する。
【0037】
そして、ステップS48において、現在処理中の画素の輝度が新たに基準値に設定され(ステップS48)、ステップS49に移行する。ステップS49では、その画素の状態が画像メモリ5に書き込まれる。ここで、画素を反転するように輝度が所定量以上変化していない場合には、その画素の状態は前画素の状態と同じ状態に書き込む(黒から黒、白から白)。その後、その画素がその行の最後の画素か否かの判定がなされ(ステップS50)、この判定結果がNOであれば上記したステップS44に戻り、判定結果がYESであれば、その行が最後の行か否かの判定がなされ(ステップS51)、この判定結果がNOであれば、上記した行頭状態設定処理が行われ(ステップS52)、その行の先頭画素の輝度が新たに基準値に設定された後(ステップS53)、上記したステップS44に戻り、ステップS51の判定結果がYESであればそのまま処理を終了する。
【0038】
このように、2値化処理すべきタイトル画像であると判断されると、各行の第1列から第n列の画素について、その輝度がその前の画素よりも所定量以上変化するかどうかが判定され、輝度が所定量以上変化すると判定される画素におけるその変化が、減少方向への変化のときにはその行頭の状態が“白”、増加方向への変化のときにはその行頭の状態が“黒”に設定され、設定された各行の先頭の白或いは黒の状態を基に、その行における各画素の輝度が所定量以上変化すると判定される画素を基準画素として、基準画素とその輝度の変化より“白”から“黒”、或いは“黒”から“白”に変化するとして2値化処理される。
【0039】
従って、上記した実施形態によれば、光の当り具合によって明るさが部分的に異なる画像であっても、従来のように一定レベルで2値化する場合のように、タイトル文字やタイトル画でないにも拘わらず、その部分がタイトル文字やタイトル画の一部であると判断されてしまうことを防止でき、複数の2値化レベルを設定しなくても精度よく2値化することが可能になり、所望のタイトル画像を重畳することができる。
【0040】
また、その画像が2値化処理すべきものであると判断されたときにのみ、その画像の2値化処理が行われるため、その画像が背景のみで2値化処理すべきものでないと判断されたときには不要な処理を行わずに済み、処理効率の向上を図ることができる。
【0041】
なお、上記した実施形態では、各行の先頭画素の状態が“白”か“黒”かを設定するようにした場合について説明したが、特にこのような設定を行う必要はなく、各行の第1列から第n列の画素について、その輝度がその前の画素よりも所定量以上変化するかどうかを順次判定していき、輝度が所定量以上変化すると判定される画素を基準画素として、その変化が減少方向への変化のときにその基準画素より以前の画素を白、増加方向への変化のときにその基準画素より以前の画素を黒として2値化するようにしても構わない。
【0042】
また、上記した実施形態では、タイトル画像について、それが2値化処理すべきものかどうかを判断するようにしているが、このような判断を必ずしも行う必要はない。
【0043】
更に、上記した実施形態では、デジタルカメラのタイトル機能を例にして説明したが、タイトル機能以外の画像2値化処理を必要とする場合にも、本発明を適用することが可能であるのはいうまでもない。
【0044】
また、上記した実施形態では、デジタルカメラに適用した場合について説明したが、特にデジタルカメラのみに限定されるものではなく、2値化処理を必要とする撮像機器であれば本発明を適用することが可能で、上記した実施形態と同等の効果を得ることができる。
【0045】
更に、本発明は上記した実施形態に限定されるものではなく、その趣旨を逸脱しない限りにおいて上述したもの以外に種々の変更を行うことが可能である。
【0046】
【発明の効果】
以上のように、請求項1に記載の発明によれば、各画素の輝度がその前の画素よりも所定量以上変化するかどうか判定し、輝度が所定量以上変化する画素を基準画素として、その変化が減少方向への変化のときにその基準画素より以降の画素を黒、増加方向への変化のときにその基準画素より以降の画素を白として2値化するため、光の当り具合によって明るさが部分的に異なる画像であっても、2値化の際のしきいレベルを変えることなく精度よく2値化することができ、高精度な2値化画像を得ることが可能になる。また、設定された各行の先頭の白或いは黒の状態を基に、その行における各画素の輝度変化から2値化することができ、光の当り具合によって明るさが部分的に異なる画像であっても、2値化の際のしきいレベルを変えることもなく、精度よく2値化処理することができる
【0047】
また、請求項2に記載の発明によれば、その画像が2値化処理すべきものであると判断されたときにのみ、処理部によりその画像の2値化処理が行われるため、その画像が背景のみで2値化処理すべきものでないときには、不要な処理を行わずに済み、処理効率の向上を図ることができる。
【0049】
また、請求項に記載の発明によれば、所定量として、光の当たり具合に関係なく白と黒とを区別できる程度の輝度の変化量を予め実験的に求めておけばよく、これにより精度のよい2値化処理が可能になる。
【0050】
また、請求項に記載の発明によれば、デジタルカメラにおける特殊機能であるタイトル機能等に対応することができ、ユーザが希望するタイトル文字やタイトル画を精度よく重畳することが可能になる。
【図面の簡単な説明】
【図1】この発明の一実施形態のブロック図である。
【図2】この発明の一実施形態の動作説明図である。
【図3】この発明の一実施形態の動作説明用フローチャートである。
【図4】この発明の一実施形態の動作説明用フローチャートである。
【図5】この発明の一実施形態の動作説明用フローチャートである。
【符号の説明】
1 CCDユニット
2 A/Dコンバータ
3 DSP
4 CPU(判定部、処理部、判断部、設定部)
5 画像メモリ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image binarizing apparatus used for an image pickup device such as a digital camera and for performing binarization processing on an image composed of pixels in a matrix of m rows × n columns.
[0002]
[Prior art]
2. Description of the Related Art A digital camera or the like as an imaging device is provided with a special function called a title function that allows a desired title to be superimposed on a captured image. This means that the prepared title image is separately imaged, and this title image is binarized by an image binarizing device to extract only the title characters and title image portions, and the extracted title characters and title images are extracted. Is superimposed on the image to be superimposed.
[0003]
Then, the binarization processing by such an image binarization device is such that, for an image composed of pixels in a matrix of m rows × n columns, the brightness of each pixel is determined based on a constant binarization level. It is generally performed by comparing and judging whether it is high or low.
[0004]
[Problems to be solved by the invention]
However, when capturing a title image, a so-called halation occurs depending on how light hits, and in the obtained title image, portions having different brightness may occur even with the same background color. In the above-described conventional image binarization apparatus, since the binarization level is fixed, it is determined that the part is a title character or a part of the title image although it is not a title character or a title image, There is a possibility that inconvenience may occur in which a title character or a title image different from the title thought by the user is superimposed.
[0005]
To solve this, it is conceivable to set a plurality of binarization levels and appropriately select the binarization level according to the degree of light hit. However, there is a problem that the processing becomes extremely complicated.
[0006]
By the way, regarding binarization of an image, for example, there are devices described in JP-A-62-133587 and JP-A-8-46860. In the former publication, an image of only a background and an image obtained by adding an object to the image are acquired, and a threshold value for binarization is determined from the luminance and correction coefficient of one pixel obtained from the image of only the background. Thus, only the target object is to be extracted. In this case, however, two images, an image including only the background and an image obtained by adding the target object to the background image, are required, and there is a problem that it takes time and effort to capture the image. .
[0007]
On the other hand, in the case of the latter publication, one taken optical image is divided into a plurality of images having different luminance levels, an appropriate exposure is calculated for each of the divided areas, and an image of each area is divided into an appropriate exposure amount. In this case, a plurality of subjects having a large difference in luminance can be photographed under appropriate exposure conditions. However, in this case, complicated processing such as dividing one image is required. There is.
[0008]
A problem to be solved by the present invention is to enable accurate binarization of an image whose brightness is partially different depending on how light hits.
[0009]
[Means for Solving the Problems]
According to an embodiment of the present invention, there is provided an image binarizing apparatus for binarizing an image formed of m rows × n columns of pixels in a matrix. And a determination unit for sequentially determining whether the luminance of the pixels in the to the n-th column changes by a predetermined amount or more than the previous pixel, and sequentially setting the pixels in the first to n-th columns as reference pixels and determining When the next pixel of the reference pixel is determined to change by a predetermined amount or more, if the change is a change in the decreasing direction, the next pixel is set to black, and the change is changed in the increasing direction. In the case of, the processing unit sets the same color as that of the reference pixel when it is determined that the next pixel does not change by a predetermined amount or more by setting the next pixel to white and then the next pixel of the reference pixel does not change by a predetermined amount. And
[0010]
With such a configuration, it is sequentially determined whether or not the luminance of the pixels in the first to n-th columns of each row changes by a predetermined amount or more than the previous pixel, and the pixels in the first to n-th columns are determined. Are sequentially set as reference pixels, and when the next pixel of the reference pixel changes in a decreasing direction by a predetermined amount or more, the next pixel is set to black. And when it is determined that the pixel next to the reference pixel does not change by a predetermined amount or more, binarization can be performed by setting the same color as that of the reference pixel .
[0011]
For this reason, even if the brightness of an image is partially different depending on how light hits, when the image is binarized at a certain level as in the related art, for example, even if the image is not a title character or a title image, the portion is not the title. It can be prevented from being determined as a part of a character or a title image, and it is possible to binarize with high accuracy without setting a plurality of binarization levels.
[0012]
Further, according to the present invention , prior to the binarization processing of the image, as a result of the determination of all pixels by the determination unit, the pixel should be binarized depending on whether or not there is a pixel whose luminance changes by the predetermined amount or more. A determination unit for determining whether the image is an image, and when the determination unit determines that the image is an image to be subjected to the binarization process, the determination unit repeats the determination for all pixels to perform the binarization by the processing unit. Processing is performed.
[0013]
In this case, when the determination unit determines that the image is not the one to be subjected to the binarization processing only on the background, the image is not subjected to the binarization processing, and the image is determined to be the one to be subjected to the binarization processing. In such a case, since the image is binarized by the processing unit, unnecessary processing need not be performed.
[0014]
In addition, according to the present invention, prior to the image binarization processing, when the change in the first pixel in which the luminance is determined to change by the predetermined amount or more by the determination unit is a change in a decreasing direction, the state at the beginning of the line is changed. White, when a change in the increasing direction, a setting unit that sets the state of the head of the line to black, the processing unit, based on the state of each line set by the setting unit, the setting unit determines the The binarization processing is characterized in that the reference pixel and its luminance change to change from white to black, or from black to white, or to make the same state as the color of the immediately preceding pixel .
[0015]
In this way, based on the white or black state of the first pixel of each row set by the setting unit, it is possible to binarize the change in luminance of each pixel in that row, and the brightness may be partially changed depending on how light hits. Even if the images are different from each other, it is possible to prevent that the part is determined to be a part of the title character or the title image, even though the image is not the title character or the title image, as in the related art. Binary processing can be performed.
[0016]
Further, the present invention is characterized in that the predetermined amount is a change amount of luminance that can distinguish white and black regardless of how light hits. In this case, it is sufficient that an amount of change in luminance that can distinguish white and black is experimentally determined in advance as the predetermined amount regardless of the degree of light hit, thereby enabling accurate binarization processing. Become.
[0017]
Further, the invention is characterized in that the imaging device is a digital camera. This makes it possible to cope with a title function or the like, which is a special function of the digital camera, and allows a title character or a title image desired by the user to be superimposed with high accuracy.
[0018]
BEST MODE FOR CARRYING OUT THE INVENTION
One embodiment in which the present invention is applied to a digital camera will be described with reference to FIGS. 1 is a block diagram, FIG. 2 is an operation explanatory diagram, and FIGS. 3 to 5 are operation explanatory flowcharts.
[0019]
As shown in FIG. 1, image data captured by a two-dimensional CCD unit 1 in a matrix of m rows × n columns is digitally converted by an A / D converter 2, and the digitally converted image data is processed by a DSP (Digital). A necessary process such as a pixel interpolation process is performed by a signal processor 3, and then stored in an image memory 5 by a CPU 4.
[0020]
When the title function is selected by operating a key (not shown), for example, the title image separately captured by the CCD unit 1 is used by the CPU 4 for the pixels from the first column to the n-th column of each row. It is sequentially determined whether the luminance changes by a predetermined amount or more than the previous pixel. This determination process corresponds to a determination unit.
[0021]
Note that the predetermined amount at this time is a change amount of luminance that can distinguish white and black irrespective of the degree of light hit, and is desirably experimentally obtained in advance. Is preferable.
[0022]
Further, as a result of the above-described determination for all the pixels of the title image by the CPU 4, whether or not there is a pixel whose luminance changes by a predetermined amount or more is determined as to whether the image is a title image to be binarized. A determination is made as to whether or not. This determination process corresponds to a determination unit.
[0023]
As described above, when it is determined that the title image should be subjected to the binarization processing, when the change in the pixel whose luminance changes by a predetermined amount or more changes in the decreasing direction, the state of the head of the line is white, At the time of change in the increasing direction, the state at the beginning of the line is set to black. This setting process corresponds to a setting unit.
[0024]
Further, based on the white and black states at the head of each line of the title image, the CPU 4 determines whether or not there is a pixel whose luminance changes by a predetermined amount or more for each line. The pixel is subjected to a binarization process assuming that the luminance of the reference pixel changes from white to black if it decreases, and from black to white if it increases. This binarization processing corresponds to a processing unit.
[0025]
Therefore, when the luminance change curve of a certain row is as shown in FIG. 2A, for example, the pixel P1 whose luminance value changes by a predetermined amount or more is detected, and the luminance change in this pixel P1 is in the decreasing direction. Therefore, the state at the head of this row is set to "white", and as shown in FIG. 2B, the area from the beginning of the row to the pixel P1 is maintained at "white", and the pixel P1 is inverted to "black". Is done.
[0026]
Subsequently, as shown in FIG. 2C, the luminance of the pixels after the pixel P1 includes a section in which the luminance decreases by a predetermined amount or more and a section in which the luminance does not change by a predetermined amount or more. Is continuously set to "black", and the same "black" as that of the previous pixel is continuously set in a section where the value does not change by a predetermined amount or more. Therefore, the pixel is held in "black" in these sections. As shown in FIG. 2D, when a pixel P2 whose luminance value increases by a predetermined value or more is detected, the pixel P2 is inverted to “white”, and as shown in FIG. The luminance of the pixel has a section that increases by a predetermined amount or more and a section that does not change by a predetermined amount or more. In the section that increases by a predetermined amount or more, the pixel value continues to be set to “white” and does not change by a predetermined amount. Since the same “white” as the previous pixel is continuously set in the section, the pixel is kept white in these sections.
[0027]
Next, the operation will be described with reference to the flowcharts of FIGS. First, a description will be given of an image determination processing procedure for determining whether or not a title image should be binarized. As shown in FIG. 3, the brightness of the first pixel in the first row and first column is set to a reference value. (Step S1) It is determined whether or not the luminance of the next pixel is larger than the reference value by a predetermined amount or more (Step S2). If the determination result is YES, the state of the pixel having the reference value is “black” (Step S3), it is determined that the image is an image to be binarized, a normal response is returned (step S4), and the operation ends.
[0028]
On the other hand, if the decision result in the above step S2 is NO, it is decided whether or not the luminance of the pixel is smaller than the reference value by a predetermined amount or more (step S5). The state of the pixel having the reference value is set to "white" (step S6), the image is determined to be an image to be binarized, a normal response is returned (step S7), and the operation ends.
[0029]
If the decision result in the step S5 is NO, it is decided whether or not the pixel is the last pixel in the row (step S8). If the decision result is NO, the process returns to the step S2 and the decision result is YES. If so, it is determined whether the row is the last row (step S9). If the determination result is NO, the row is moved to the first pixel of the next row (step S10), and the brightness of the first pixel is The new reference value is set (step S11), and the process returns to step S2.
[0030]
By the way, if the decision result in the step S9 is YES, it is determined that the image is not an image to be subjected to the binarization processing, an abnormal response is returned (step S12), and the operation is thereafter ended. According to such processing, if a normal response is returned, the title image is an image to be binarized, and if an abnormal response is returned, the title image is not an image to be binarized only with the background, for example. I can understand that.
[0031]
Next, a description will be given of a processing procedure for setting a head state of a line for setting whether the state of the head pixel of each row is white or black. As shown in FIG. 4, the brightness of the head pixel of the row is determined in steps S1 and S11 described above. A reference value different from the reference value is set (step S21), and it is determined whether or not the luminance of the next pixel in the row is larger than the reference value by a predetermined amount or more (step S22). If, the state of the pixel having the reference value is set to "black" (step S23), and after a normal response is returned (step S24), the operation ends.
[0032]
On the other hand, if the decision result in the step S22 is NO, it is decided whether or not the luminance of the pixel is smaller than the reference value by a predetermined amount or more (step S25). If the decision result is YES, the reference value Is set to "white" (step S26), and after a normal response is returned (step S27), the operation ends.
[0033]
If the decision result in the step S25 is NO, it is decided whether or not the pixel is the last pixel in the row (step S28). If the decision result is NO, the process returns to the step S2, and the decision result is YES. Then, it can be determined that there is no pixel whose luminance value changes in the row, so that it is determined whether the luminance value of the first pixel in the row itself is “white” or “black” based on a predetermined threshold value. Is performed, and after the state of the first pixel of the row is determined (step S29), a normal response is returned (step S30), and the operation is thereafter terminated.
[0034]
Next, the procedure of the binarization processing will be described. As shown in FIG. 5, first, the image determination processing (see FIG. 3) for determining whether or not the image should be binarized as described above is performed (step S41). It is determined whether or not there is a response (step S42). If the determination result is YES, the binarization processing is useless, and the operation ends as it is.
[0035]
On the other hand, if the decision result in the step S42 is NO, the luminance of the first pixel in the first row and the first column is set to the reference value (step S43), and the luminance of the next pixel is more than the reference value by a predetermined amount or more. It is determined whether or not it is larger (step S44), and if this determination is YES, the next pixel is set to "white" (step S45).
[0036]
Further, if the determination result is NO in step S44, the than the reference value is the luminance of the pixel determination is made whether a predetermined amount or more small (step S46), if the determination result is YES, the pixel Is set to "black" (step S47), and after the process of step S45, the process proceeds to step S48 together with the case where the determination result of step S46 is NO.
[0037]
Then, in step S48, the luminance of the pixel currently being processed is newly set to the reference value (step S48), and the process proceeds to step S49. In step S49, the state of the pixel is written in the image memory 5. Here, if the luminance has not changed by a predetermined amount or more so as to invert the pixel, the state of the pixel is written in the same state as the state of the previous pixel (black to black, white to white). Thereafter, it is determined whether or not the pixel is the last pixel in the row (step S50). If this determination is NO, the process returns to step S44. If the determination is YES, the row is last. Is determined (step S51). If the determination result is NO, the above-described line head state setting processing is performed (step S52), and the luminance of the first pixel of the line is newly set to the reference value. After that (step S53), the process returns to step S44, and if the result of the determination in step S51 is YES, the process ends.
[0038]
As described above, when it is determined that the title image is to be binarized, it is determined whether or not the luminance of the pixels in the first to n-th columns of each row changes by a predetermined amount or more than the previous pixel. The state at the beginning of the line is “white” when the change in the pixel that is determined and the luminance is determined to change by a predetermined amount or more is a change in the decreasing direction, and the state at the beginning of the line is “black” when the change is in the increasing direction. Based on the white or black state at the beginning of each set row, based on the pixels determined to have the brightness of each pixel in the row changing by a predetermined amount or more, the reference pixel and the change in the brightness are determined as the reference pixels. Binarization processing is performed assuming that the color changes from “white” to “black” or “black” to “white”.
[0039]
Therefore, according to the above-described embodiment, even if the brightness of an image is partially different depending on how light hits, it is not a title character or a title image as in the case of binarization at a constant level as in the related art. Nevertheless, it is possible to prevent that part from being determined to be a part of a title character or a title picture, and to perform binarization with high accuracy without setting a plurality of binarization levels. Thus, a desired title image can be superimposed.
[0040]
Further, the binarization processing of the image is performed only when it is determined that the image should be subjected to the binarization processing. Therefore, it is determined that the image is not the one to be subjected to the binarization processing only in the background. Sometimes, unnecessary processing is not performed, and the processing efficiency can be improved.
[0041]
In the above-described embodiment, a case has been described in which the state of the first pixel in each row is set to “white” or “black”. However, it is not necessary to perform such a setting, and the first pixel in each row is not set. It is sequentially determined whether or not the luminance of the pixels in the columns from the column to the n-th column changes by a predetermined amount or more than that of the previous pixel. The pixel before the reference pixel may be binarized as white when the change in the decreasing direction, and black before the reference pixel when the change in the increase direction.
[0042]
In the above-described embodiment, it is determined whether or not the title image should be subjected to the binarization process. However, such a determination is not necessarily performed.
[0043]
Further, in the above-described embodiment, the title function of the digital camera has been described as an example. However, the present invention can be applied to a case where image binarization processing other than the title function is required. Needless to say.
[0044]
In the above-described embodiment, the case where the present invention is applied to a digital camera has been described. However, the present invention is not particularly limited to a digital camera, and the present invention may be applied to any imaging device that requires binarization processing. Is possible, and the same effect as the above-described embodiment can be obtained.
[0045]
Furthermore, the present invention is not limited to the above-described embodiment, and various changes other than those described above can be made without departing from the gist of the present invention.
[0046]
【The invention's effect】
As described above, according to the invention described in claim 1, it is determined whether the brightness of each pixel changes by a predetermined amount or more than the previous pixel, and a pixel whose brightness changes by a predetermined amount or more is set as a reference pixel. When the change is in the decreasing direction, the pixels subsequent to the reference pixel are black, and when the change is in the increasing direction, the pixels subsequent to the reference pixel are white and are binarized. Even if the brightness of the image is partially different, the image can be accurately binarized without changing the threshold level in the binarization, and a highly accurate binarized image can be obtained. . Further, based on the set white or black state at the head of each row, binarization can be performed based on a change in luminance of each pixel in the row, and an image whose brightness is partially different depending on how light hits. However, the binarization processing can be performed with high accuracy without changing the threshold level at the time of binarization.
According to the second aspect of the present invention, only when it is determined that the image should be binarized, the image is binarized by the processing unit. When the binarization processing is not to be performed only on the background, unnecessary processing is not performed, and the processing efficiency can be improved.
[0049]
According to the third aspect of the present invention, as the predetermined amount, it is sufficient to experimentally determine in advance the amount of change in luminance that can distinguish white and black irrespective of how light hits. Accurate binarization processing becomes possible.
[0050]
Further, according to the invention described in claim 4 , it is possible to cope with a title function or the like which is a special function in the digital camera, and it becomes possible to accurately superimpose a title character or a title image desired by the user.
[Brief description of the drawings]
FIG. 1 is a block diagram of one embodiment of the present invention.
FIG. 2 is an operation explanatory diagram of one embodiment of the present invention.
FIG. 3 is a flowchart for explaining the operation of the embodiment of the present invention;
FIG. 4 is a flowchart for explaining the operation of the embodiment of the present invention;
FIG. 5 is a flowchart for explaining the operation of the embodiment of the present invention;
[Explanation of symbols]
1 CCD unit 2 A / D converter 3 DSP
4 CPU (determination unit, processing unit, determination unit, setting unit)
5 Image memory

Claims (4)

撮像機器に用いられ、m行×n列のマトリクス状の画素から成る画像を2値化処理する画像2値化装置において、
各行の第1列から第n列の画素についてその輝度がその前の画素よりも所定量以上変化するかどうかを順次判定する判定部と、
前記第1列から第n列の画素を順次、基準画素に設定し、前記判定部により、前記基準画素の次の画素が所定量以上変化すると判定される場合に、その変化が減少方向への変化のときには、前記次の画素を黒に設定し、その変化が増加方向への変化のときには、前記次の画素を白に設定し、前記基準画素の次の画素が所定量以上変化しないと判定される場合に、前記基準画素の色と同一に設定することにより2値化する処理部と、
画像の2値化処理に先立ち、前記判定部により輝度が前記所定量以上変化すると判定される最初の画素におけるその変化が、減少方向への変化のときにはその行頭の状態を白、増加方向への変化のときにはその行頭の状態を黒に設定する設定部と、を備え、
前記処理部が、前記設定部により設定された各行頭の状態に基づき、前記判定部により判定される前記基準画素とその輝度の変化により白から黒、或いは黒から白に変化する、若しくは直前の画素の色と同一の状態にする、として2値化処理することを特徴とする画像2値化装置。
In an image binarization device used for an imaging device, which binarizes an image composed of m rows × n columns of pixels in a matrix,
A determining unit for sequentially determining whether the luminance of a pixel in a first column to an n-th column in each row changes by a predetermined amount or more than that of a previous pixel;
The pixels in the first to n-th columns are sequentially set as reference pixels, and when the determination unit determines that a pixel next to the reference pixel changes by a predetermined amount or more, the change is reduced in a decreasing direction. When the change occurs, the next pixel is set to black, and when the change is an increase, the next pixel is set to white, and it is determined that the next pixel of the reference pixel does not change by a predetermined amount or more. A processing unit that binarizes by setting the same as the color of the reference pixel ,
Prior to the binarization processing of the image, when the change in the first pixel in which the luminance is determined to change by the predetermined amount or more by the determination unit is a change in the decreasing direction, the state at the beginning of the line is white, and the state in the increasing direction is A setting unit that sets the state at the beginning of the line to black when it changes,
The processing unit, based on the state of each line head set by the setting unit, from white to black, or from black to white due to a change in the luminance and the reference pixel determined by the determination unit, or immediately before An image binarization device, wherein a binarization process is performed to set the same state as the color of a pixel.
画像の2値化処理に先立ち、前記判定部による全画素についての判定の結果、前記所定量以上その輝度が変化する画素が存在するかどうかによって、その画素が2値化処理すべき画像かどうかを判断する判断部をさらに備え、
前記判断部により2値化処理すべき画像であると判断されたときに、前記判定部による全画素についての判定を繰り返して、前記処理部による2値化処理を行うことを特徴とする請求項1に記載の画像2値化装置。
Prior to the binarization processing of the image, as a result of the determination for all the pixels by the determination unit, whether or not the pixel is an image to be subjected to the binarization processing is determined based on whether or not there is a pixel whose luminance changes by the predetermined amount or more Further comprising a determination unit for determining
When the determination unit determines that the image is an image to be subjected to the binarization process, the determination unit repeats the determination for all pixels, and performs the binarization process by the processing unit. 2. The image binarization device according to 1.
前記所定量が、光の当たり具合に関係なく白と黒とを区別できる程度の輝度の変化量であることを特徴とする請求項1ないしのいずれかに記載の画像2値化装置。Wherein the predetermined amount, the image binarization apparatus according to any one of claims 1 to 2, characterized in that a variation in luminance enough to distinguish between white and black regardless degree of lighting. 前記撮像機器が、デジタルカメラであることを特徴とする請求項1ないしのいずれかに記載の画像2値化装置。The imaging device, an image binarization system according to any one of claims 1, characterized in that a digital camera 3.
JP12666599A 1999-05-07 1999-05-07 Image binarization device Expired - Fee Related JP3565551B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12666599A JP3565551B2 (en) 1999-05-07 1999-05-07 Image binarization device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12666599A JP3565551B2 (en) 1999-05-07 1999-05-07 Image binarization device

Publications (2)

Publication Number Publication Date
JP2000322554A JP2000322554A (en) 2000-11-24
JP3565551B2 true JP3565551B2 (en) 2004-09-15

Family

ID=14940852

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12666599A Expired - Fee Related JP3565551B2 (en) 1999-05-07 1999-05-07 Image binarization device

Country Status (1)

Country Link
JP (1) JP3565551B2 (en)

Also Published As

Publication number Publication date
JP2000322554A (en) 2000-11-24

Similar Documents

Publication Publication Date Title
US20020159650A1 (en) Image processing apparatus and recording medium, and image processing apparatus
JP2007143120A (en) Noise eliminating device, noise eliminating method, noise eliminating program and recording medium
JP2009189005A (en) Effective method of reducing noise and shake in combined still image from rolling shutter camera
JP2010057114A (en) Device and method for detecting/correcting defect
JP2010016798A (en) Imaging apparatus, control method thereof, and program
JP2000235617A (en) Data reader
JP2009218994A (en) Imaging apparatus and defective pixel correction method implemented therein
US6603509B1 (en) Digital camera controllable by a program
US6999621B2 (en) Text discrimination method and related apparatus
JP5082884B2 (en) Imaging apparatus and image effect addition program
JP3565551B2 (en) Image binarization device
JP4541859B2 (en) Camera and luminance distribution display method
JPH10322592A (en) Method and device for controlling electronic camera
WO2005022915A1 (en) Image capture and projection device and image capture and projection method
JP2000101924A (en) Defect detection correction device in image input device
JP2004029105A (en) Autofocus device and af evaluated value acquiring method
JP2009267803A (en) Image processor
JP2004201207A (en) Noise-reducing device, imaging device, and noise-reducing program
JP2005063036A (en) Object-tracking device
JP4918903B2 (en) Decoding processing program, decoding processing method, and decoding processing apparatus
JP2005202834A (en) Character recognition system, character recognition method and character recognition program
US11715185B2 (en) Image processing apparatus, image processing method, and storage medium for obtaining image evaluation value distribution corresponding to an image
JP3485975B2 (en) Specific color area extraction method and specific color area removal method
JP2010067125A (en) Image processing apparatus, method for processing image, and program
JP2008017037A (en) Solid imaging apparatus, and defective pixel correcting method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040421

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040607

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20080618

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090618

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100618

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110618

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110618

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120618

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120618

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130618

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees