JP3724148B2 - Color discrimination device - Google Patents

Color discrimination device Download PDF

Info

Publication number
JP3724148B2
JP3724148B2 JP26744797A JP26744797A JP3724148B2 JP 3724148 B2 JP3724148 B2 JP 3724148B2 JP 26744797 A JP26744797 A JP 26744797A JP 26744797 A JP26744797 A JP 26744797A JP 3724148 B2 JP3724148 B2 JP 3724148B2
Authority
JP
Japan
Prior art keywords
color
data
discrimination
black
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP26744797A
Other languages
Japanese (ja)
Other versions
JPH11110551A (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.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
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 Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP26744797A priority Critical patent/JP3724148B2/en
Priority to US09/163,266 priority patent/US6480624B1/en
Publication of JPH11110551A publication Critical patent/JPH11110551A/en
Application granted granted Critical
Publication of JP3724148B2 publication Critical patent/JP3724148B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、赤、緑、青等の色成分の画像データに分離して取り込まれている画像の色を当該色成分の画像データを用いて判別する色判別装置に関するものである。
【0002】
【従来の技術】
従来、電気信号からなる画像の色を判別する方法が種々、提案されている。例えば特開平5−137011号公報には、R,G,Bの各色成分の画像データXr,Xg,Xbの最大値と最小値との差を演算し、その演算結果が予め設定された所定の閾値より小さい場合は、無彩色と判別し、所定の閾値以上の場合は、R,G,Bの各色成分の画像データXr,Xg,Xbの大小の組合わせによって有彩色の色を判別する方法が示されている。そして、無彩色と判別された場合は、更に輝度データで白と黒との判別が行われている。また、一度、色判別した判別結果に対しては周辺画素の色判別結果との関係を調べ、多数決により各画素位置の誤判別が修正されるようになっている。
【0003】
【発明が解決しようとする課題】
画像データからカラー画像の色判別を行う場合、色再現性を考量して有彩色部分の色判別を重視した判別基準が設定されると、黒色と有彩色とを判別する判別基準が緩くなり、黒色の画素位置が有彩色と誤判別され易くなる。例えばデジタルカメラでホワイトボードに描かれた文字、図形等を記録資料として撮影した場合、ボードーの照明条件、ペンの汚れ具合、カメラの性能などによって黒領域の画素にR,G,Bの色成分の画像データに偏差を生じ、その画素が有彩色と誤判別されることがある。この結果、撮影画像の黒領域に有彩色がノイズとして混在するという不具合が生じる。
【0004】
撮影画像の黒領域に有彩色が混在すると、文字等が見辛くなり、画質が著しく低下するので、できる限り、色判別処理において黒領域に有彩色がノイズとして混在しないようにすることが望ましい。しかし、黒色と有彩色との判別基準を厳しくすれば、逆に、有彩色に無彩色がノイズとして混在するようになるので、色判別処理のみで黒領域のノイズ発生を防止することは困難である。
【0005】
従って、有彩色部分の色判別を重視した色判別処理を行う場合は、色判別結果に対して黒領域内に含まれている有彩色を除去する処理(以下、ノイズ除去処理という。)が必要となる。
【0006】
上記従来の色判別方法におけるノイズ除去処理は、周辺画素の色判別結果との多数決によりノイズ除去を行うようにしているので、黒領域内のノイズが点在している場合には有効であるが、黒領域の色判別結果が斑模様のように多数のノイズで占められている場合は、正しく黒と判別された画素が有彩色と誤判別された周辺画素の影響で有彩色に誤修正される可能性が高く、黒領域を黒色に修正することは困難となる。特に、上述のデジタルカメラでホワイトボートを撮影した画像では、照明やペンの汚れ等の条件が影響して黒領域が斑模様に誤判別され易い画像となるので、このような画像に対して従来のノイズ除去方法を適用しても十分な効果を得ることは困難である。
【0007】
本発明は、上記課題に鑑みてなされたものであり、色判別によって黒領域に生じたノイズを有効に除去することのできる色判別装置を提供するものである。
【0008】
【課題を解決するための手段】
本発明は、複数の色成分の画像データからなるカラー画像の色を判別する色判別装置であって、各画素位置毎に、上記画像データを用いて色の判別を行う色判別手段と、予め設定された画素数単位で、上記色判別手段で判別された色のデータを抽出し、その抽出された領域に含まれる色の分散の度合いを示す分散度を演算する演算手段と、上記演算手段で算出された分散度を予め設定された所定の閾値と比較して色の分散が大きいか否かを判別する判別手段と、上記判別手段で色の分散が大きいと判別されたとき、上記抽出領域の中心の画素位置の色のデータを黒色のデータに置換する色データ置換手段とを備えたものである(請求項1)。
【0009】
上記構成によれば、カラー画像は、その画像を構成する色成分の画像データを用いて各画素位置の色判別が行われる。更に、色判別結果に対して、予め設定された画素数単位で、カラー画像の一部の領域の色のデータが抽出され、その抽出領域に含まれる色の分散度が演算され、その分散度を予め設定された所定の閾値と比較して色の分散が大きいか否かが判別される。そして、色の分散が大きいと判別されたときは、抽出領域の中心の画素位置の色のデータが黒色のデータに置換される。
【0010】
上記データの置換処理は、カラー画像内の抽出領域を変化させて各画素について順次、行われ、これにより黒領域内にノイズとして生じている有彩色が黒色に修正される。
【0013】
【発明の実施の形態】
本発明について、本発明に係る色判別装置を備えたデジタルカメラを例に説明する。
【0014】
図1は、本発明に係る色判別装置を備えたデジタルカメラの一実施の形態の外観を示す斜視図、図2は、同デジタルカメラの背面図である。
【0015】
同図において、デジタルカメラ1は、前面の略中央にズームレンズからなる撮影レンズ2が配設され、その上部にアクティブ測距方式により被写体距離を測定するための投光窓4と受光窓5とが配設され、両窓の間に被写体の輝度を測定するための測光窓3が配設されている。また、投光窓4の左側にファインダー対物窓6が配設されている。
【0016】
投光窓4は、被写体に対して赤外光を照射する窓であり、受光窓5は、この赤外光の被写体からの反射光を受光する窓である。なお、本実施の形態では測距方式としてアクティブ測距方式を採用しているが、パッシブ測距方式でもよい。
【0017】
デジタルカメラ1の側面にはハードディスクカード10(以下、HDカード10と略称する。)が装着脱されるカード挿入口7が設けられ、このカード挿入口7の上部にHDカード10をイジェクトするためのカード取出ボタン8が設けられている。また、デジタルカメラ1の上面左端部にシャッタボタン9が設けられている。
【0018】
撮影結果をプリントアウトする場合、カード取出ボタン8を押してHDカード10をデジタルカメラ1から取り外し、HDカード10が装着可能なプリンタにこのHDカード10を装着してプリントアウトすることができる。
【0019】
なお、デジタルカメラ1にSCSIケーブルのインターフェースを設け、デジタルカメラ1とプリンタとをSCSIケーブルで接続し、デジタルカメラ1からプリンタに画像データを転送して直接、撮影画像をプリントアウトさせるようにしてもよい。
【0020】
また、本実施の形態では画像データの記録媒体としてPCMCIA準拠のハードディスクカードを採用しているが、撮影結果を画像データとして記憶できるものであれば、メモリカードやミニディスク(MD)等の他の記録媒体でもよい。
【0021】
デジタルカメラ1の背面には、図2に示すように、その上部の左端部に電源投入用のメインスイッチ11が設けられ、略中央にファインダー接眼窓12が設けられている。また、メインスイッチ11の下部には、色補正スイッチ13、ノイズ修正スイッチ14及び濃度設定スイッチ15が設けられている。
【0022】
更に、デジタルカメラ1の背面右端部に、モード変更スイッチ16、色登録確認表示部17、色選択ボタン18、セットボタン19及びデフォルトボタン20が設けられている。
【0023】
ホワイトボードに書かれた文字や図表などを直接、撮影して記録資料とする場合、その撮影画像については通常の写真撮影のような描写性の高い画質よりも文字等が明瞭な情報性の高い画質が要求される。色補正スイッチ13は、このような撮影画像に対して文字、線図等の濃度を明瞭にするとともに、色分けを明確にする所定の画像処理を指示するためのスイッチである。
【0024】
この画像処理では、ホワイトボードには通常、赤、青、緑、橙、黒等の数種類のカラーペンで文字、図表等が書かれること、また、この文字、図表等を撮影した画像では色再現性よりも撮影画像の文字等の情報性(見易さ、判り易さ等)が重視されることから、撮影された画像内の文字等が赤、青、緑、橙、黒等のいずれの色に着色されているかを判別し、その文字等に判別結果に応じた予め設定された所定の色を割り付ける処理(その文字等を構成する領域の画像データを予め設定された色の画像データで置換する処理)が行われる。
【0025】
色補正スイッチ13がオンであれば、撮影画像に対する上記画像処理が行われ、オフであれば、撮影画像に対する上記画像処理は行われず、通常の写真撮影に対する画像処理が行われる。従って、通常の写真撮影を行う撮影モードを「ノーマルモード」、ホワイトボードに書かれた文字等の記録撮影を行う撮影モードを「ドキュメントモード」とすると、色補正スイッチ13はノーマルモードとドキュメントモードとを切換設定するスイッチとなっている。
【0026】
ノイズ修正スイッチ14は、ドキュメントモードにおける上記画像処理において、撮影画像の文字等にノイズとして発生した偽色を修正するためのスイッチである。ノイズ修正スイッチ14をオンにすると、後述するように撮影画像の文字等に発生した偽色の修正処理が行われ、オフにすると、その修正処理は行われない。ノイズ修正スイッチ14はドキュメントモードで機能するため、色補正スイッチ13がオフになっているときにノイズ修正スイッチ14をオンにしても、偽色修正処理の指示は無視される。
【0027】
濃度設定スイッチ15は、ドキュメントモードの画像処理において、例えば線の細い文字や濃度の淡い図形等が明瞭な画像となるようにするために、被写体の濃度情報を設定するものである。濃度設定スイッチ15で設定された濃度情報は、ドキュメントモードの画像処理の色判別における判別閾値を被写体の濃度に応じて切り換える際に用いられる。本実施の形態では、濃度設定スイッチ15により「濃」,「淡」、2種類の濃度情報が切換設定される。濃度設定スイッチ15もドキュメントモードにおいて機能するため、色補正スイッチ13がオフになっているときに濃度設定スイッチ15をオンにしても、文字等の濃度の修正処理の指示は無視される。なお、濃度設定は、連続的に設定できるようにしていてもよい。
【0028】
モード変更スイッチは、写真撮影を行う撮影モードと色判別の際の判別色の登録を行う色登録モードとを切換設定するものである。色登録モードは、色見本(ホワイトボード上にカラーペンで作成されたカラーパッチ等)を実際に撮影して上述の色判別処理及び色置換処理で使用される色の画像データを設定、登録する処理を行うためのモードである。なお、デジタルカメラ1には予め色データのデフォルト値が設定されており、ユーザーが色登録モードにおいて、色データを登録設定しなかった場合は、このデフォルト値が色判別及び色データ置換の処理に利用される。
【0029】
本実施の形態では、図3に示すように、赤、青、橙、緑の4つの色について登録することができるようになっている。従って、モード変更スイッチ16が「色登録」に設定されていると、赤、青、橙、緑の4つの色について、色見本を撮影して所望の色データを登録することができ、モード変更スイッチ16が「撮影」に設定されていると、写真撮影が可能になる。
【0030】
色登録確認表示部17は、色登録の内容や色データ置換処理における使用色を表示するものである。色登録確認表示部17は、色登録モードにおいては、登録すべき色の選択を行うための表示部として、また、撮影モードにおいては、色データ置換処理に使用する色の選択を行うための表示部としても機能する。図3において、「赤」、「青」、「橙」及び「緑」の表示は、登録可能な色の種類を示すものである。本実施例では、4種類の色を登録可能にしているが、4種類以上の色を登録可能にしてもよく、また、上記4種類の色以外の色(例えば黄、茶等の色)を登録可能にするようにしてもよい。
【0031】
上部にバー表示171が付されている色は、色登録又は色使用の選択を行う際、その色が選択されていることを示している。図3では、「青」が選択されている。このバー表示171は、色選択ボタン18の操作により左右に移動し、ユーザーは、色登録モードにおいて色選択ボタン18を操作することにより所望の色を選択することができるようになっている。なお、右側の色選択ボタン18を押す毎に、バー表示171は「赤→青→橙→緑→赤」と右方向に移動し、左側の色選択ボタン18を押す毎に、バー表示171は「緑←赤←青←橙←緑」と左方向に移動する。
【0032】
また、色登録欄の○印表示171で囲まれている色は、その色が登録されていることを示し、○印表示171で囲まれていない色は、その色が登録されていないことを示している。色登録は、色登録モードを設定し、バー表示171で所望の色、例えば「赤」を選択した後、ホワイトボード上の適当な大きさの領域を赤ペンで塗り潰す等して作成した色見本を撮影することにより行われる。この場合、ファインダー内には、図4に示すように、中央部に色データ取込範囲を示す枠21が表示され、この枠21内の一定の領域以上に色見本22が含まれるようにフレームを調整して撮影すると、色データの登録処理が行われる。色登録モードでの撮影では、撮影画像内の枠21内に含まれる画像データを用いて、その枠内の色(図4の例では赤)を構成するR,G,Bの色成分のデータとこれらのデータを用いて生成された2次の正規化データ(後述する)とが登録される(メモリに記憶される)。
【0033】
色使用欄は、色補正モードにおける色判別及び色データ置換の処理において、登録色又はデフォルト色が使用されるか否かを示す表示である。○印表示173で「ON」が囲まれている色は、使用されることを示し、「OFF」が囲まれている色は使用されないことを示す。図3の表示例では、橙を除く赤、青、緑の3色が色データ置換処理に使用されることを示している。
【0034】
色使用欄のON/OFF設定は、色登録モードにおいて、色選択ボタン18により色を選択した後、セットボタン20を操作して行われる。色使用欄の○印表示173の位置は、セットボタン20を押す毎にONとOFFとが交互に切り換わり、ユーザーは、○印表示173の表示位置を見ながらセットボタン20を操作することで色の使用/不使用を設定することができる。
【0035】
デフォルトボタン20は、色登録した色をデフォルト色に戻すための操作ボタンである。色登録モードにおいて、バー表示171で所望の色に設定した後、デフォルトボタン20を押すと、○印表示172の表示が消え、色登録が抹消される。
【0036】
図5は、本発明に係るデジタルカメラのドキュメントモードにおける撮影画像の画像処理に関するブロック構成図である。
同図において、図1,図2に示した部材と同一の部材には同一番号を付している。また、撮像部23は、撮影レンズ2により撮像素子の撮像面に結像された被写体光像を画像信号に変換して出力するものである。撮像部23には、例えばCCDカラーエリアセンサからなる撮像素子とこの撮像素子(以下、CCDという。)の駆動を制御するCCD駆動制御回路とCCDから出力される画像信号(アナログ信号)のノイズ低減、レベル調整等の所定の信号処理を行うアナログ信号処理回路が含まれている。
【0037】
CCDカラーエリアセンサは、被写体光像をR,G,Bの色成分の画像データに分離して出力するものであり、単板式エリアセンサ、3板式エリアセンサのいずれであってもよい。撮像部23は、カメラの撮影動作を集中制御する制御部34から入力される露出制御値(シャッタスピード)に基づきCCDの撮影動作(電荷蓄積及び蓄積電荷の読出)が制御される。すなわち、制御部34からの露光開始信号に基づきCCDの露光(電荷蓄積)が開始され、所定時間経過後に露光が終了すると、その蓄積電荷がR,G,Bの色成分毎にCCDから読み出され、アナログ信号処理回路で所定の信号処理が行われた後、A/D変換器24を介して画像処理部26に読み出される。
【0038】
A/D変換器24は撮像部23から読み出されたアナログの画像信号を、例えば8ビットのデジタルの画像信号(以下、画像データという。)に変換するものである。
【0039】
画像処理部25は、A/D変換器24から入力された画像データに、ノーマルモードにおいてはホワイトバランス、γ補正、シェーディング補正等の所定の画像処理を施し、ドキュメントモードにおいては後述する下地飛ばし、色補正、黒領域補正及色データ置換等の所定の画像処理を施し、所定の圧縮処理をした後、HDカード10に出力するものである。
【0040】
HDカード10は、撮影画像を構成する画像データを記録する記録媒体である。また、カード駆動制御部26は、HDカードの駆動を制御するものである。
【0041】
RAM(Random Access Memory)27は、制御部34が撮影や色登録その他の機能に関する処理を行うためのメモリである。ROM(Read Only Memory)28は、撮像駆動の制御に必要なデータや処理プログラム、後述するドキュメンモードにおける下地飛ばし、色判別、黒領域補正、偽色消去等の各種処理を行うための必要なデータや処理プログラムが記憶されたメモリである。
【0042】
また、測距部29は、投光窓4及び受光窓5の後方位置に設けられた被写体距離を検出するものである。測光部30は、測光窓3の後方位置に設けられたSPC等の受光素子を有し、被写体輝度を検出するものである。
【0043】
設定色正規化演算部31は、色登録モードにおいて、取り込まれた色見本の画像データを用いて、後述する正規化データを演算するものである。この正規化データは、R,G,Bの各色成分の画像データのレベルをXr,Xg,Xbとし、正規化データをxr,xg,xbとすると、xr=Xr2/(Xr2+Xg2+Xb2),xg=Xg2/(Xr2+Xg2+Xb2),xb=Xb2/(Xr2+Xg2+Xb2)で算出され、xb-xg平面における正規化データの座標位置により色判別を行う際の色領域分割に利用される。なお、正規化データの座標位置による色判別方法の詳細は、後述する。
【0044】
設定色正規化演算部31は、色登録モードにおいて取り込まれた色見本の画像データの内、撮影画面内の枠21に含まれる画像データを抽出し、更にその抽出データから予め設定された所定レベル以下の画像データを抽出する。この抽出処理は、図4において、枠21内の赤の色見本に相当する画像データを抽出するものである。そして、設定色正規化演算部31は、抽出された色見本の画像データを用いて2次の正規化データを演算する。この演算結果は、制御部34を介してRAM27に記憶される。
【0045】
色領域設定演算部32は、上述したxb-xg平面における正規化データの座標位置により色判別を行う際の色領域を分割するものである。すなわち、例えば有彩色を青,緑,橙,赤の4色に色判別する場合、xb-xg平面における正規化データの座標位置による色判別では、xb-xg平面を青,緑,橙,赤の4つの色領域に分割し、正規化データの座標位置がいずれの色領域にあるかで色判別が行われるが、色領域設定演算部32は、xb-xg平面を青,緑,橙,赤の4つの色領域に分割するための境界線を演算するものである。この境界線の演算結果もRAM27に記憶される。なお、色領域の設定についても後述する。
【0046】
制御部34は、デジタルカメラ1の撮影動作を集中制御するもので、マイクロコンピュータで構成されている。制御部34は、撮像部23の駆動を制御して被写体光像を撮像し、画像処理部25の駆動を制御して撮像画像に所定の画像処理を施すとともに、カード駆動制御部26の駆動を制御して画像処理後の撮像画像をHDカードに記録する。
【0047】
図6は、画像処理部25のドキュメントモードにおける画像処理(色補正処理)に関するブロック構成図である。
【0048】
画像処理部25には、ドキュメントモードにおける色補正処理を行うための回路ブロックとして、画像メモリ251、第1ノイズ消去部252、下地飛ばし演算部253、γ特性設定部254、色判別部255、黒領域補正部256、第2ノイズ消去部257及び色置換部258が含まれている。
【0049】
ドキュメントモードにおいては、図7に示すように、画像処理部25に入力にされた画像データは、まず、下地を白く飛ばす前処理が行われた後(処理A)、各画素位置の画像データ(R,G,Bの画像データ)の2次の冪乗値について正規化データが作成され(処理B)、この正規化データを用いて色判別が行われる(処理C)。そして、文字等を構成する画像データのうち、誤って色判別された画像データが修正されるとともに、黒色領域の画像データのうち、有彩色に着色された画像データが修正された後(処理D)、各画素位置の画像データが色判別結果に基づく所定の色データに置換されてHDカード10に出力される(処理E)。
【0050】
画像メモリ251は、A/D変換器24から入力されるR,G,Bの各色成分の画像データを一時的に記憶するものである。第1ノイズ消去部252は、例えば各画素位置の画像データを隣接する画素位置の8個の画像データとの平均値に置換することによって画像メモリ251に入力された画像データのノイズを低減するものである。
【0051】
下地飛ばし演算部253は、画像データの下地部分と文字部分とを分離し、下地部分に相当する領域を所定の白レベルデータに変換するものである。すなわち、例えばホワイトボードに文字や図形が描かれた被写体を撮影した画像(以下、ホワイトボード撮影画像という。)の場合、図8に示すように、ホワイトボード35のボード部分351の画像を一律に白くし、文字部分352の画像を見易くするものである。下地飛ばし演算部253は、γ特性設定部254から入力されるγ特性に従って各画素位置の画像データのγ補正を行うことにより下地飛ばし処理を行う。
【0052】
γ特性設定部254は、下地飛ばし処理のためのγ特性を設定するものである。γ特性設定部254は、入力された画像データのヒストグラムを作成し、このヒストグラムに基づいてγ特性を決定する。図9は、ホワイトボード撮影画像の典型的なヒストグラムであるが、このような文字画像では、一般に大小2つの山U1,U2が生じる。明領域に生じる大きい山U1は、ボード部分351に相当し、暗領域に生じる小さい山U2は、文字部分352の明瞭な文字や図形に相当している。そして、大きい山U1と小さい山U2との谷の部分Rは、ボード部分351の汚れや文字部分352の色の薄い或いは線の細い文字や図形の部分である。
【0053】
γ特性設定部254は、例えば大きい山U1のピークに対応する画像データのレベルwを算出し、図10に示すように、このレベルwを白飽和レベルとするγ特性▲1▼を決定する。なお、図10は、画像データが8ビットデータの場合のγ特性で、レベル「255」は、白レベルであり、レベル「0」は、黒レベルである。同図に示すγ特性▲1▼では、レベルw以上の画像データは、すべて一律に白レベルに変換され、レベルwより小さい画像データは、そのレベルに応じて所定の変換比率(γ値)でリニアにレベル変換される。なお、文字部分352の黒を強調するため、所定の低レベルbを黒飽和レベルとするγ特性▲2▼を用いるようにしてもよい。γ特性▲2▼では、レベルb以下の画像データは、すべて一律に黒レベルに変換される。
【0054】
従って、γ特性設定部254で設定されたγ特性▲1▼(又は▲2▼)を用いて下地飛ばし演算部253で画像データのγ補正が行われると、図8に示すように、ボード部分351の画像データが略均等に白データに変換され、撮影画像の下地が白く飛ばされることになる。
【0055】
色判別部255は、各画素位置の色を判別するものである。色判別部255は、色判別処理を行うための回路として正規化演算回路255a、輝度演算回路255b、形状認識回路255c及び色判別回路255dを有している。
【0056】
R,G,Bの色成分の画像データを用いた色判別方法としては、特開平6−105091号公報に示されるように、3個の色成分の内、2個の色成分を選択し、選択された色成分の正規化データの座標平面における2個の色成分の正規化データの位置により色判別する方法が知られている。本実施の形態でも、2個の色成分の正規化データの位置により色判別が行われるが、上記公報が1次の正規化データ、すなわち、R,G,Bの各色成分の画像データの混合比率を表す正規化データxr=Xr/(Xr+Xg+Xb),xg=Xg/(Xr+Xg+Xb),xb=Xb/(Xr+Xg+Xb)を用いて色判別を行うのに対して、本実施の形態は、2次の冪乗値についての正規化データxi=Xi2/(Xr2+Xg2+Xb2)(i=r,g,b)を用いる点で異なる。
【0057】
本実施の形態で2次の正規化データを用いるのは、ドキュメントモードでの撮影では、文字等を見易くする観点から色分類性が重視され、以下に説明するように、2次の正規化データを用いた方が色判別処理に有利だからである。
【0058】
図11は、一次の正規化データxb,xgを用いて色判別する場合のxb-xg平面における青、緑、橙、赤の各系統の色分布を示す図であり、図12は、2次の正規化データxb,xgを用いて色判別する場合のxb-xg平面における青、緑、橙、赤の各系統の色分布を示す図である。
【0059】
両図において、(xb,xg)=(1/3,1/3)のQ点は、理想的なホワイトバランスを有するカメラで撮影した場合の完全に無彩色と判別される位置である。また、(xb,xg)=(1,0),(0,1),(0,0)の各点は、それぞれ完全な青色、緑色、赤色と判別される位置である。実際のカメラでは理想的なホワイトバランスを有していないので、例えば青色の純色を撮影してもその撮影画像の正規化データ(xb,xg)は、(xb,xg)=(1,0)にはならず、一般にQ点側に偏ったある領域内に位置する。
【0060】
例えば標準的な青色、緑色、橙色、赤色の4つカラーペンでホワイトボード上に作成された色見本を撮影した場合の各色の正規化データ(xb,xg)は、それぞれ楕円Sb,Sg,So,Srで示す領域内に分布する。また、白又は黒の無彩色についてもQ点の近傍のある領域Sw内に分布する。
【0061】
両図の楕円Sb,Sg,So,Srを比較すれば明らかなように、2次の正規化データ(xb,xg)を用いると、楕円Sb,Sg,So,Srがより偏平になり、同一の有彩色の画像データから生成された正規化データ(xb,xg)の位置は、理想的な無彩色点Qから遠くなることが分かる(図11,図12の青色領域内のプロットされたP点,P′点を比較参照)。従って、2次の正規化データを用いる方が1次の正規化データを用いるよりも容易かつ正確に色判別を行うことができる。
【0062】
正規化演算回路255aは、各画素位置のR,G,Bの各色成分の画像データを2次の冪乗値による正規化データxr=Xr2/(Xr2+Xg2+Xb2),xg=Xg2/(Xr2+Xg2+Xb2),xb=Xb2/(Xr2+Xg2+Xb2)に変換するものである。
【0063】
正規化演算回路255aは、図13のフローチャートに従って各画素位置の画像データXr,Xg,Xbを2次の正規化データxr,xg,xbに変換する。
【0064】
すなわち、各色成分の画像データXr,Xg,Xbをそれぞれ2乗し、その演算結果をそれぞれレジスタRr1,Rg1,Rb1に格納する(#2)。続いて、レジスタRr1,Rg1,Rb1に格納された画像データXr,Xg,Xbの2乗値Xr2,Xg2,Xb2を加算し、その結果をレジスタSUMに格納する(#4)。続いて、レジスタRr1,Rg1,Rb1に格納された画像データXr,Xg,Xbの2乗値Xr2,Xg2,Xb2をそれぞれレジスタSUMに格納された加算値(Xr2+Xg2+Xb2)で除し、その結果をそれぞレジスタRr2,Rg2,Rb2に格納して処理を終了する(#6)。
【0065】
なお、2次より大きい次数の正規化データ(xb,xg)を用いると、xb-xg平面における正規化データ(xb,xg)の位置の無彩色点Qから遠くなる傾向はより強くなり、その画像データの有する色味の特徴(すなわち、青、緑、橙、赤のいずれに偏っているか)がより明確となるので、正規化データとして、
xr=Xrk/(Xrk+Xgk+Xbk
xg=Xgk/(Xrk+Xgk+Xbk
xb=Xbk/(Xrk+Xgk+Xbk
の演算式により算出されるk次(k>2)の正規化データを用いてもよい。
【0066】
また、本実施の形態では、R,G,Bの色成分の画像データについて説明したが、他の色成分の画像データの正規化データX(1),X(2),…X(n)を用いる場合にも2次以上の冪乗値に対する正規化データx(1)k=X(1)k/ΣX(i)k,x(2)k=X(2)k/ΣX(i)k,…x(n)k=X(n)k/ΣX(i)k(i=1,2,…n、k≧2)を用いることできる。
【0067】
ところで、色判別では、有彩色の色の判別とともに、有彩色と無彩色の白及び黒との判別を行う必要がある。有彩色と無彩色の白及び黒との判別も、上述のようにxg-xb平面内における正規化データの位置を調べることにより行うことができる。
【0068】
しかし、R,G,Bの色成分の画像データから生成された正規化データは、画像内のR,G,Bの色成分の偏差のみを抽象し、明暗の情報は捨象されているので、正規化データのみを用いて色判別を行うと、低輝度の黒色や高輝度の白色が赤や青等の有彩色と誤判別される場合が生じる。すなわち、例えばR,G,Bの色成分の画像データ(Xr,Xg,Xb)が(20,5,5)の黒い画素位置に対する2次の正規化データ(xb,xg)は(0.06,0.06)で、画像データ(Xr,Xg,Xb)=(200,50,50)の赤い画素位置に対する2次の正規化データ(xb,xg)と同一となるので、黒色が赤色に誤判別される。
【0069】
そこで、このような誤判別を防止するため、本実施の形態では、各画素位置の輝度データと上述の正規化データとを用いて色判別(無彩色の判別を含む。)を行うようにしている。また、線幅の広狭の色判別への影響を低減するため、後述するように、文字、図形等の幾何学的形状を加味して色判別を行うようにしている。
【0070】
輝度演算回路255bは、上述の色判別処理に使用する各画素位置の輝度データを演算するものである。輝度演算回路255bは、例えばR,G,Bの色成分の画像データXr,Xg,Xbの平均値Y(=(Xr+Xg+Xb)/3)を、各画素位置の色判別用の輝度データとして算出する。
【0071】
また、形状認識回路255cは、文字、図形等を構成する領域が線状であるか、面状であるかを認識するものである。形状認識回路255cは、5×5画素又は7×7画素のブロック毎に、そのブロック内の画像データのレベルを最大値が「255」となるように補正した後、「0」及び「255」のレベルの画像データ或いは「0」〜「255」の数種類のレベルの画像データを有するテンプレートとの2乗誤差計算等によるパターンマッチングにより、図14に示すように、細線部分のパターンαと太線部分のパターンβとを検出する。この検出結果は、色判別回路255dに入力される。なお、パターンマッチングに代えて高周波成分検出処理により形状判別を行うようにしてもよい。
【0072】
色判別回路255dは、正規化演算回路255aで算出された正規化データ(xb,xg)、輝度演算回路255bで算出された輝度データY及び形状認識回路255cで認識されたパターン結果に基づき、図15〜図18に示す所定の閾値プロファイルを用いて各画素位置の色判別(例えば白、黒、青、緑、橙、赤の色判別)を行うものである。
【0073】
図15は、色判別用の輝度データにより有彩色と無彩色との色判別を行うための閾値プロファイルの第1の実施形態を示す図である。また、図16〜図18は、色判別用の輝度データにより有彩色と無彩色との色判別を行うための閾値プロファイルの変形例で、それぞれ第2〜第4の実施形態を示す図である。
【0074】
図15〜図18において、横軸は、xb-xg平面における無彩色点Qからの距離情報を示し、縦軸は、色判別用の輝度レベルを示している。
【0075】
なお、距離情報は、xb-xg平面での点Qから正規化データ(xb,xg)の位置までの実際の距離を示すものではなく、xr-xg-xb空間において無彩色点(1/3,1/3,1/3)から等距離にある閉曲面をxb-xg平面に射影して得られる等距離線(無彩色点Q(1/3,1/3)を含む閉曲線)を特定するための距離の情報である。
【0076】
ここで、距離情報について、簡単に説明すると、xb-xg平面における等距離線上の任意の正規化データ(xb,xg)を同一距離にある一群のデータとして扱う場合、等距離線が無彩色点Q(1/3,1/3)を中心とする円になるのであれば、距離情報としてxb-xg平面における点Qから正規化データ(xb,xg)の位置までの実際の距離を採用することができる。
【0077】
しかし、等距離線は、上述のようにxr-xg-xb空間における無彩色点(1/3,1/3,1/3)から等距離にある閉曲面をxb-xg平面に射影したもので、無彩色点Q(1/3,1/3)を中心とする円でない同心状の閉曲線となるから、点Qから正規化データ(xb,xg)の位置までの実際の距離を距離情報とすることはできない。
【0078】
そこで、本実施の形態では、等距離線上にある正規化データ(xb,xg)について同一の距離情報を与えるため、正規化データ(xb,xg)とそれが属する等距離線が一対一に対応することから、xb-xg平面における等距離線の位置を定義する距離情報をその等距離線上の正規化データ(xb,xg)の距離情報としている。
【0079】
正規化データ(xb,xg)が与えられた場合、その正規化データ(xb,xg)に対する距離情報を決定するには、その正規化データ(xb,xg)が属する等距離線を決定する必要がある。しかし、必ずしもxr-xg-xb空間における無彩色点(1/3,1/3,1/3)を中心に同心状に形成される複数の等距離面をxb-xg平面に射影してなる複数の等距離線の中の正規化データ(xb,xg)が属する等距離線を決定する必要はない。なぜなら、正規化データ(xb,xg)の距離情報は、所定の閾値との相対比較による色判別に使用するものであるから、相対的な距離情報で無彩色点Q(1/3,1/3)からの正規化データ(xb,xg)の位置が特定できればよいからである。
【0080】
与えられた正規化データ(xb,xg)に対して等距離線から相対的な距離情報を決定するとすれば、等距離線としては、その正規化データ(xb,xg)とこれ以外の等距離線上にある複数の正規化データ(xb,xg)とにより決定される特定形状の閉曲線を採用することができる。
【0081】
一方、xr-xb-xg空間において、成分を相互に入れ換えた6個の正規化データ(xr,xb,xg),(xb,xg,xr),…は、無彩色点(1/3,1/3,1/3)から等距離にあり、これらの正規化データをxb-xg平面に射影した点は、xb-xg平面において等距離線を構成するから、等距離線として採用し得る形状は、少なくとも与えられた正規化データ(xb,xg)とこの正規化データの成分を相互に入れ換えて生成される他の5個の正規化データ(xr,xb),(xr,xg),(xb,xr),(xg,xr),(xg,xb)とにより構成されるものでなければならない。
【0082】
従って、xb-xg平面上おいては、3個の成分を相互に入れ換えて生成されるxb-xg平面上の6個の正規化データ(xb,xg),(xr,xb),(xr,xg),(xb,xr),(xg,xr),(xg,xb)を通る任意の形状を等距離線の特定形状とすることができる。
【0083】
図19は、成分を相互に入れ換えた6個の正規化データのxb-xg平面上の位置関係の一例を示す図である。
【0084】
同図に示すP1(1/2,1/3),P2(1/2,1/6),P3(1/3,1/6),P1′(1/3,1/2),P2′(1/6,1/2),P3′(1/6,1/3)の各点は、点P1に対する正規化データxr(=1/6),xg(=1/2),xb(=1/3)の成分を相互に入れ換えて生成される5個の正規化データをxb-xg平面上にプロットしたものである。同図から明らかなように、点P1′,P2′,P3′は、それぞれ点P1,P2,P3の直線L(原点と点Qとを結ぶ直線)に対する線対称点となっている。また、点P3,P3′は、それぞれ点P1,P1′の直線L′(点Qを通る直線Lに直交する直線)に対する線対称点となっている。このような点P1〜P3,P1′〜P3′の対称性は、xr+xb+xg=1の関係を有する成分を相互に入れ換えて各点の正規化データが決定されていることに基づくものである。
【0085】
従って、点P1の属する等距離線は、点P1〜P3,P1′〜P3′を通り、かつ、直線L,L′に対して対称性を有する形状でなければならないが、このような形状としては、例えば図20に示す楕円C1、図21に示す二等辺三角形C2、又は図22に示す六角形C3などが考えられる。
【0086】
等距離線の形状が特定されると、その形状の等距離線について無彩色点Q(1/3,1/3)からの距離の算出方法を決定しておけば、正規化データ(xb,xg)からその正規化データ(xb,xg)が属する特定形状の等距離線を算出し、更にその等距離線について無彩色点Q(1/3,1/3)からの距離を算出することにより、与えられた正規化データ(xb,xg)に対する距離情報を決定することができる。
【0087】
図20〜図22の例では、各等距離線の無彩色点Q(1/3,1/3)からの距離として、例えば直線Lと等距離線C1,C2,C3との交点P4と点Qとの距離dを取ることができる。この距離dは、閉曲線として楕円C1を採用した場合は、楕円C1の中心Qから最近接点までの距離(短軸長の1/2)であり、閉曲線として二等辺三角形C2を採用した場合は、点Qから斜辺の中点までの距離である。
【0088】
なお、等距離線C2とC3とは形状は異なるが、点P3,P3′を通る斜辺は同一であるから、点Qからの距離dは同一となる。従って、距離情報を考える上では等距離線C2とC3とは実施的に同一である。
【0089】
本実施の形態では、正規化データ(xb,xg)から距離情報dを直接、算出する演算テーブルを設け、正規化データ(xb,xg)が算出されると、この演算テーブル用いて直接、距離情報dを算出するようにしている。
【0090】
図15に戻り、同図に示す閾値プロファイルは、無彩色位置から距離情報d1内の近傍領域を無彩色領域Swとし、この領域Sw内では白色と黒色との判別閾値を固定値Y2とし、無彩色領域外では有彩色と黒色との判別閾値を固定値Y1、有彩色と白色との判別閾値を固定値Y3(Y1<Y2<Y3)としたものである。
【0091】
この閾値プロファイルでは、正規化データ(xb,xg)の位置が距離情報d1の等距離線の内部に位置しているときは(d≦d1)、輝度レベルYと閾値Y2とを比較し、Y≧Y2であれば、白色と判別され、Y<Y2であれば、黒色と判別される。また、正規化データ(xb,xg)の位置が距離情報d1の等距離線より外側に位置しているときは(d>d1)、輝度レベルYと閾値Y1,Y3とを比較し、Y>Y3であれば、白色と判別され、Y<Y1であれば、黒色と判別され、Y3≧Y≧Y1であれば、有彩色と判別される。そして、有彩色の場合は、更に上述した正規化データ(xb,xg)の位置により、例えば青,緑,橙,赤の4色の色判別が行われる。
【0092】
図16に示す閾値プロファイルは、図15において、正規化データ(xb,xg)の位置が距離情報d1の等距離線より外側にあるときの有彩色と白色又は黒色との判別閾値をY1,Y3からY1,Y3,Y4,Y5(Y3>Y4>Y1>Y5>Y2)にそれぞれ2段階に増加させたものである。この閾値プロフィルでは、正規化データ(xb,xg)の位置が距離情報d1の等距離線と距離情報d2の等距離線との間にあるとき(d2>d>d1)、Y>Y4であれば、白色と判別され、Y<Y5であれば、黒色と判別され、Y4≧Y≧Y5であれば、有彩色と判別される。また、正規化データ(xb,xg)の位置が距離情報d2の等距離線と距離情報d3の等距離線との間にあるとき(d3>d>d2)、Y>Y3であれば、白色と判別され、Y<Y5であれば、黒色と判別され、Y3≧Y≧Y5であれば、有彩色と判別される。更に、正規化データ(xb,xg)の位置が距離情報d2の等距離線と距離情報d3の等距離線との間にあるとき(d>d3)、Y>Y3であれば、白色と判別され、Y<Y2であれば、黒色と判別され、Y3≧Y≧Y2であれば、有彩色と判別される。
【0093】
図17に示す閾値プロファイルは、図16において、正規化データ(xb,xg)の位置が距離情報d1の等距離線と距離情報d2の等距離線との間にあるときの有彩色と白色の判別閾値をY4からY3までリニアに変化させ、正規化データ(xb,xg)の位置が距離情報d1の等距離線と距離情報d3の等距離線との間にあるときの有彩色と黒色の判別閾値をY5からY2までリニアに変化させたものである。
【0094】
また、図18に示す閾値プロファイルは、図16において、正規化データ(xb,xg)の位置が距離情報d1の等距離線と距離情報d2の等距離線との間にあるときの有彩色と白色の判別閾値をY4からY3までノンリニア(単調増加)に変化させ、正規化データ(xb,xg)の位置が距離情報d1の等距離線と距離情報d3の等距離線との間にあるときの有彩色と黒色の判別閾値をY5からY2までノンリニア(単調減少)に変化させたものである。
【0095】
なお、図15〜図18は閾値プロファイルの代表例を示したもので、これ以外の閾値プロファイルを任意に採用することができるものである。
【0096】
図15〜図18に示す閾値プロファイルにおいて、xb-xg平面における正規化データ(xb,xg)の位置から、青,緑,橙,赤の4色の色判別を行う場合は、図23に示すように、楕円Sb,Sg,So,Srを基にして分割線m1,m2,m3,m4を設けて三角形のxg-xb平面を4つの領域Ab,Ag,Ao,Arに分割し、正規化データ(xb,xg)の位置が4つの領域Ab,Ag,Ao,Ar(領域Swを除く。)のいずれに入っているかで、色判別が行われる。例えば正規化データの座標(xb,xg)が領域Ab内に入っていれば、その画素位置は青系統の色と判別され、領域Ag内に入っていれば、その画素位置は緑系統の色と判別される。
【0097】
分割線m1,m2,m3,m4は、色領域設定演算部32で設定され、図23における点Pb,Pg,Po,Prを、それぞれ色登録された、或いは予め設定された青,緑,橙,赤の画像データ(デフォルト値)の正規データの座標位置とすると、例えば∠PbQPg,∠PgQPo,∠PoQPr,∠PrQPbの二等分線や△PbQPg,△PgQPo,△PoQPr,△PrQPbの点Qと対辺の中点とを結ぶ中線として設定される。なお、上述のように、本実施の形態に係るデジタルカメラ1では、判別すべき色を青,緑,橙,赤の4色の範囲で任意に設定できるようになっているので、例えば図3に示す例のように、色認識表示部17の色使用欄で橙色が「OFF」に設定されている場合は、「ON」に設定されている青,緑,赤の3色について分割線m1,m2,m3が設定され、3色について色判別が行われる。この場合、分割線m3は、∠PgQPrの二等分線や△PgQPrの点Qと対辺の中点とを結ぶ中線として設定される。
【0098】
色判別回路225dは、形状認識回路255cから入力されるパターン結果が一定であれば、予め設定された閾値プロファイルを固定的に利用して色判別を行うが、形状認識回路255cから入力されるパターン結果が変化する場合は、以下に説明するように、パターン結果の変化に応じて閾値プロファイルを全体的に、或いは部分的に上下させるように補正した閾値プロファイルを用いて対応する領域の色判別を行う。これは、文字等を構成する線幅の広狭に応じて閾値プロファイルを全体的又は部分的に上下させることにより、線幅の変化に関らず好適な線幅の画像が得られるようにするためである。
【0099】
図24は、線幅の広狭の相違に基づく濃度レベルの変化の一例を示す図である。
【0100】
同図は、ホワイトボード撮影画像の四角形で囲まれた数字の「1」の文字部分36の直線M上の画像データの濃度レベルを示すものである。文字部分36の上部に描かれたグラフは、濃度レベルを示している。直線MのA,Cの部分は、四角形の線幅に相当する部分(細線部分)であり、Bは、数字「1」の線幅に相当する部分(太線部分)である。A,Cは細線部分であり、Bは太線部分であるから、A,Cの濃度レベルは、Bの濃度レベルより高くなっている。すなわち、細線部分は、太線部分より白っぽくなっている。
【0101】
図25は、図24の直線M上の画像データに対して閾値プロファイルを用いて白黒判別を行ったものである。
【0102】
例えば図18に示す形の閾値プロファイルを用いたとして、同図(a)は、図26の閾値レベルの高い閾値プロフィル▲1▼を用いて白黒判別を行ったものであり、同図(b)は、図26の閾値レベルの低い閾値プロフィル▲2▼を用いて白黒判別を行ったものである。また、同図(c)は、線幅に応じて閾値プロフィル▲1▼,▲2▼を使い分けて白黒判別を行ったものである。
【0103】
閾値レベルの高い閾値プロフィル▲1▼を用いた場合は、太線部分Bは好適な線幅となるが、細線部分A,Cは閾値レベルY1より高くなるので、白色に誤判別され、四角形の図形が飛んでしまうことになる。一方、閾値レベルの低い閾値プロフィル▲2▼を用いた場合は、細線部分A,Cは好適な線幅となるが、太線部分Bは、輪郭部分の画像データも閾値レベルY1′より低くなり、線幅が必要以上に太くなってしまうことになる。このように、線幅の広狭がある場合、固定的な閾値プロフィルでは一方の線幅に対しては適切であっても他方の線幅に対しては不適切となることが多く、線幅に関係なく適切な白黒判別を行うことは困難となる。
【0104】
そこで、本実施の形態では、同図(c)に示すように、線幅を判別し、その判別結果に応じて閾値プロフィル▲1▼,▲2▼を切り換えることにより好適な線幅が得られるようにしている。従って、色判別回路225dは、形状認識回路255cから入力される判別結果がパターンαのときは、閾値プロフィル▲1▼を用いて白黒判別を行い、判別結果がパターンβのときは、閾値プロフィル▲1▼を閾値プロフィル▲2▼に切り換えて白黒判別を行う。
【0105】
なお、この白黒判別における閾値プロフィルの補正は、上述のように、予め設定された複数の閾値プロファイルを線幅の判別結果に応じて切換設定するようにしてもよいが、標準の閾値プロフィルを線幅の判別結果に応じた所定レベルだけ全体的に、或いは部分的に上下にシフトさせて設定するようにしてもよい。
【0106】
図6に戻り、黒領域補正部256は、色の誤判別により有彩色が含まれる黒領域を有彩色を含まない黒一色に補正するものである。
【0107】
図15〜図18に示す閾値プロファイルを用いて色判別を行う場合、無彩色と有彩色との判別閾値である距離情報d1を高く設定すると、比較的色の濃い有彩色(すなわち、輝度の低い有彩色)は黒色に、また、比較的色の淡い有彩色(すなわち、輝度の高い有彩色)は白色に誤判別され易くなる。このため、このような誤判別を防止するため、距離情報d1は低めに設定するのが望ましい。
【0108】
しかし、距離情報d1を低めに設定した閾値プロファイルを用いた場合は、黒色が有彩色に誤判別され、図27に示すように、黒一色の領域が有彩色の混じった斑模様の領域となることがある。黒色領域が斑模様の領域となり易くなる原因は、黒色の画像データはレベルが低いため、正規化データxb,xgがxb/xg=1となることは少なく、正規化データ(xb,xg)の位置が無彩色領域Sw外になり易いということ、また、ある程度大きな領域で画像データの平均では黒色となる場合、その領域内に、例えば黒色を青色と誤判別した画素位置の近傍には黒色を赤や緑や橙等と誤判別した画素位置が存在する可能性が高いということに基づくものである。
【0109】
文字、図形等を構成する比較的広い黒領域が斑模様の領域になると、著しく見辛い画像となる。黒領域補正部256は、斑模様の領域を黒領域に変換し、斑模様に起因する画質不良を低減するもので、同色画素数計数回路256a、分散度演算回256b及び黒判別回路256cを備えている。
【0110】
同色画素数計数回路256aは、ブロック内の同一色の画素数をカウントする回路である。ブロックサイズを5×5画素とし、各画素位置の色分布が、例えば図28に示すようになっている場合、同色画素数計数回路256aは、赤,青,橙,緑,黒の各色についてブロック内に存在する画素数をカウントする。赤,青,橙,緑,黒の各色の画素数をNr,Nb,No,Ng,Nbk、これらの合計をNtをとすると、同図(a)の例では、Nr=17,Nb=2,No=3,Ng=1,Nbk=2,Nt=25がカウントされ、同図(b)の例では、Nr=4,Nb=4,No=5,Ng=6,Nbk=4,Nt=23がカウントされる。なお、(b)の例では、ブロック内に白色の画素が2個含まれているが、これらの画素は黒領域補正処理では無視される。
【0111】
分散度演算回路256bは、赤,青,橙,緑,黒の各色の画素数Nr,Nb,No,Ng,Nbk及びこれらの合計Ntを用いて、各ブロックの色の分散度pを演算するものである。分散度pは、p=(白以外の色の画素数)/Σ(各色の画素数)2=Nt/(Nr2+Nb2+No2+Ng2+Nbk2)の演算式で算出される。なお、この分散度pは、分散の演算式の逆数である。図28(a)の例では、p=23/(42+42+52+62+42)=0.211が算出され、同図(b)の例では、p=25/(172+22+32+12+22)=0.081が算出される。
【0112】
黒判別回路256cは、分散度演算回路256bで算出された分散度pを用いて各ブロックの中心位置の画素が黒色であるか否かを判別するものである。すなわち、黒判別回路256cは、予め設定された閾値K1と分散度pとを比較し、p>K1であれば、黒色と判別し、p≦K1であれば、有彩色と判別する。例えばK1=0.1とすると、図28(a)の例は、黒色と判別され、同図(b)の例は、有彩色と判別される。なお、図28(b)の例では、各色の画素数から圧倒的に赤が多いので、中心位置の画素は「赤」と判別することができる。
【0113】
図29は、黒領域補正部256の補正処理の手順を示すフローチャートである。
【0114】
色判別部255から出力される色判別結果は、黒領域補正部256内の図略のメモリに格納され、図29のフローチャートに従って黒領域の補正処理が行われる。すなわち、まず、メモリから左上隅の1ブロック分(5×5画素分)の色判別データが読み出され(#10)、そのブロック内に含まれる白色以外の各色の画素数とその合計数がカウントされる(#12)。判別色を赤,青,橙,緑,黒とすると、各色の画素数Nr,Nb,No,Ng,Nbkとこれらの合計数Ntがカウントされる。
【0115】
続いて、分散度p(=Nt/(Nr2+Nb2+No2+Ng2+Nbk2))が演算され(#14)、この分散度pと所定の閾値K1とを比較してそのブロックの中心の画素が黒色である否かが判別される(#16)。p>K1であれば(#16でYES)、ブロック中心の画素位置(そのブロックの3行3列目の画素位置)の色判別データを黒色のデータに変更することが記憶される(#18)。一方、p≦K1であれば(#16でYES)、上述のデータ変更の指示は行われない。
【0116】
続いて、色判別データ全体に対する上記処理が終了したか否かが判別され(#20)、処理が終了していなければ(#20でNO)、ブロックの読出位置を1画素分だけ横方向にシフトして(#22)、ステップ#10に戻り、上述の黒判別処理が行われる(#10〜#20)。以下、ブロックの読出位置をラスタ方向に1画素分ずつシフトしつつ、各画素位置の色判別データについて黒判別処理が行われ(#10〜#22のループ)、色判別データ全体に対する黒判別処理が終了すると(#20でYES)、色判別データを黒色のデータに変更するように指示された画素位置の色判別データが黒色のデータに変更され(#24)、処理を終了する。
【0117】
なお、本実施の形態では、黒領域補正処理の1ブロックの大きさを5×5画素としたが、1ブロックのサイズはこれに限定されるものではなく、処理精度や処理速度を考慮して任意の適宜のサイズを設定することができる。また、色の分散具合を計るものとして分散度pを定義したが、色のバラツキを表し得るものであれば、他の演算式を定義してもよい。例えば標準偏差σ=1/√(p)を用いてもよい。
【0118】
また、青,緑,橙,赤,黒の各色を、例えばそれぞれ(0,1,0,0)、(0,0,1,0)、(0,0,0,1)、(1,0,0,0)、(1,1,1,1)のようにベクトル表現した場合、ブロック内のベクトル平均のベクトル長の逆数を分散の度合いを示すものとしてもよい。なお、ベクトル表現は、各色独立でも、「赤と橙は近似した色」というように情報を加味したものでもよい。また、4次元に限定されず、任意の次元を考えることができる。
【0119】
また、簡単な方法として、ブロックの中心位置に隣接する8個の画素位置に何個の色が存在するか、その異なる色の数で斑の程度を判断するようにしてもよい。
【0120】
第2ノイズ消去部257は、色判別された黒領域内に含まれる有彩色や白色(誤判別された色)を黒色に補正するものである。すなわち、黒領域補正部256により斑模様の領域を黒領域に補正する処理を行っても、なお、黒領域内に有彩色が島状に残る場合があり、第2ノイズ消去部257は、この偽色を黒色に変換して消去するものである。
【0121】
図30は、文字等の黒領域内に有彩色が島状に残っている状態の一例を示す図である。
【0122】
同図は、数字「2」を構成する黒色領域に有彩色の画素37,38が残っている場合を示すものであるが、第2ノイズ消去部257では、黒色領域内の画素37が黒色に補正されて偽色が消去される。なお、数字「2」を構成する黒領域の輪郭位置にある画素38については、黒色補正は行われない。黒領域内に島状に黒以外の色が混じっている場合は、その色が目立って文字が見辛くなるが、境界部分に黒以外の色が混じっている場合は、その偽色による弊害は少ないので、黒領域の補正処理による処理速度の遅延を考慮して、黒領域内部についてのみ補正処理を行うものである。なお、黒領域の輪郭位置の偽色に対しても黒補正を行うようにしてもよい。
【0123】
図31は、第2ノイズ消去部257の偽色消去の処理手順を示すフローチャートである。
【0124】
同図に示すフローチャートは、図32に示すように、中心位置GAとそれに隣接する8個の画素位置の色を調べ、同一色が所定数K2を超えていれば、中心の画素位置GAの色を所定数K2を超えている色に変更するのものである。図32は、所定数K2を6個としたもので、中心と右下隅を除く7個の画素が黒となっているので、中心位置の画素GAの色が黒色に変更されることを示している。
【0125】
黒領域補正部256から出力された色判別データは、第2ノイズ消去部257内の図略のメモリに格納され、図31のフローチャートに従って黒領域の補正処理が行われる。すなわち、まず、メモリから左上済の1ブロック分(3×3画素分)の色判別データが読み出され(#30)、そのブロック内に含まれる各色の画素数がカウントされる(#32)。
【0126】
続いて、最も多い画素数Nmaxと所定の閾値K2とを比較し、Nmax>K2であるか否かが判別される(#34)。Nmax>K2であれば(#34でYES)、ブロック中心の画素位置(そのブロックの2行2列目の画素位置)の色判別データを画素数Nmaxの色のデータに変更することが記憶される(#36)。一方、Nmax≦K2であれば(#34でYES)、上述のデータ変更の指示は行われない。
【0127】
続いて、色判別データ全体に対する偽色修正処理が終了したか否かが判別され(#38)、処理が終了していなければ(#38でNO)、ブロックの読出位置を1画素分だけ横方向にシフトして(#40)、ステップ#30に戻り、上述の偽色修正処理が行われる(#30〜#38)。以下、ブロックの読出位置をラスタ方向に1画素分ずつシフトしつつ、各画素位置の色判別データについて偽色修正処理が行われ(#30〜#40のループ)、色判別データ全体に対する偽色修正処理が終了すると(#38でYES)、色判別データを画素数Nmaxの色のデータに変更するように指示された画素位置の色判別データが指示された色のデータに変更され(#42)、処理を終了する。
【0128】
図6に戻り、色置換部258は、各画素位置の画像データを、色判別部255、黒領域補正部256及び第2ノイズ消去部257で設定された色のデータに基づいて予め設定された、或いは色登録で設定された対応する色の画像データ(R,G,Bの色成分の画像データ)に置換するものである。そして、色置換部258で置換された画像データは、HDカードに出力され、記録される(図5参照)。
【0129】
次に、図33〜図35のフローチャートに従って、デジタルカメラ1の撮影動作について説明する。
【0130】
図33は、ドキュメントモードに関する撮影動作手順を示すフローチャートである。
【0131】
メインスイッチ11がオンになると(#50でYES)、デジタルカメラ1が起動し、撮影可能状態となる。まず、モード変更スイッチ16が撮影モードに設定されているか否かが判別され(#52)、撮影モードが設定されていなければ、すなわち、色登録モードが設定されていれば(#52でNO)、図34に示すフローチャートに従って色登録処理が行われ(#54)、撮影モードが設定されていれば(#52でYES)、ステップ#54に移行し、撮影処理が行われる。
【0132】
色登録処理に移行すると、まず、色選択ボタン18により指定されている色が登録処理対象の色として設定される(#80)。この色設定処理では、バー表示171の表示位置により登録対象の色が判別、設定される。続いて、その設定された色が未登録であるか否かが○印表示172の有無により判別され(#82)、未登録であれば(#82でNO)、更にデフォルトボタン20により登録色のデータ消去が指示されているか否かが判別される(#84)。
【0133】
登録色のデータ消去が指示されていれば(#84でYES)、RAM27に記憶されている登録色の2次の正規化データが予め設定されているその色のデフォルト値に書き換えられ(#84)、ステップ#82に戻る。一方、登録色のデータ消去が指示されていなければ(#84でNO)、ステップ#88に移行する。
【0134】
ステップ#82で、設定された色が未登録であれば(#82でYES)、シャッタボタン9のレリース操作により色見本(図4参照)の撮像が指示されているか否かが判別され(#88)、撮像が指示されていれば(#88でYES)、測光部30により被写体輝度が検出されるとともに(#90)、測距部29により被写体距離が検出され(#92)、この被写体距離に基づいて焦点調節が行われる(#94)。また、検出された被写体輝度を用いて露出制御値(絞り値とCCDの積分時間)が設定される(#96)。
【0135】
続いて、設定された露出制御値に基づいて色見本の撮像が行われる(#98)。撮像部23で取り込まれた画像データは、設定色正規化演算部31で撮影画面中央の枠21内の画像データが抽出され、更にこの画像データの内、色見本部分のみの画像データが抽出される(#100)。そして、この色見本の画像データについて2次の正規化データが算出され(#102)、その算出結果がRAM27の所定の記憶領域に記憶される(#104)。
【0136】
色見本の2次の正規化データのRAM27への記憶(色登録)が終了すると、続いて、セットボタン19の操作により色使用が指示されているか否かが判別され(#106)、色使用が指示されていれば(#106でYES)、登録色の色判別における色使用が設定され(#108)、リターンする。このとき、色登録確認表示部17では色使用「on」の表示が行われる。また、色使用が指示されていなければ(#106でNO)、登録色の色判別における色使用が解除され(#110)、リターンする。このとき、色登録確認表示部17では色使用「off」の表示が行われる。
【0137】
一方、ステップ#88で、撮像が指示されていなければ(#88でNO)、ステップ#90〜#104をジャンプし、上述の色見本の2次の正規化データの登録処理を行うことなくステップ#106に移行する。
【0138】
上述のように、色登録モードにおいては、デフォルトボタン20が操作されると、設定された色に対して、既に登録されている色見本の画像データ(R,G,Bの色成分の画像データ)及び2次の正規化データが消去され、それに代えて予め設定された画像データ及び2次の正規化データ(デフォルト値)が設定される。また、セットボタン19が操作されると、設定された色に対して、色使用の設定又は解除が行われる。また、未登録又は登録済に関係なく、色見本の撮影が行われると、撮影された色見本の2次の正規化データが算出され、この算出値と取り込まれた画像データとが新規に又は更新的に登録される。
【0139】
図33に戻り、ステップ52で、撮影モードが設定されていると(#52でYES)、続いて、シャッタボタン9のレリーズ操作により撮像が指示されているか否かが判別され(#56)、撮像が指示されていなければ(#56でNO)、ステップ#52に戻り、撮像が指示されていると(#56でYES)、更に色補正補正スイッチ13がONに設定されているか(すなわち、ドキュメントモードが設定されているか)否かが判別される(#58)。
【0140】
ドキュメントモードが設定されていなければ、すなわち、ノーマルモードが設定されていれば(#58でNO)、通常の写真撮影の処理が行われる。すなわち、被写体輝度及び被写体距離が検出され、これらの検出値に基づき焦点調節と露出制御値設定とが行われた後、被写体の撮影が行われる。そして、撮像部23で取り込まれた画像データは、画像処理部25で所定の画像処理(描写性の高い画質が得られる画像処理)が行われ、圧縮された後、HDカード10に記録される。
【0141】
一方、ドキュメントモードが設定されていれば(#58でYES)、まず、濃度設定スイッチ15の設定位置により濃度データ(濃/淡のデータ)が取り込まれる(#62)。続いて、画像処理部25がドキュメントモードの画像処理に設定されるとともに、濃度データが色判別部255に設定される(#64)。
【0142】
続いて、測光部30により被写体輝度が検出されるとともに(#66)、測距部29により被写体距離が検出され(#68)、この被写体距離に基づいて焦点調節が行われる(#70)。また、検出された被写体輝度を用いて露出制御値(絞り値とCCDの積分時間)が設定される(#72)。
【0143】
続いて、設定された露出制御値に基づき撮像部23で被写体の撮像が行われ(#74)、その撮像動作で取り込まれた画像データは、図35に示すフローチャートに従って画像処理部25で所定の色補正処理が行われた後(#76)、HDカード10に記録される(#78)。そして、これにより1枚の撮影が終了し、次の撮影を行うべく、ステップ#52に戻る。
【0144】
色補正処理に移行すると、まず、γ特性設定部254で画像メモリ251に格納された画像データを用いて下地飛ばし処理のためのγ特性が設定される(#120)。続いて、画像メモリ251に格納された画像データが第1ノイズ消去部252でノイズ低減処理がなされた後、下地飛ばし演算部253で上記γ特性を用いてγ補正を行うことにより下地飛ばしの処理(背景の白地部分を一律に白色に変換する処理)が行われる(#122)。
【0145】
続いて、色判別部255の正規化演算回路255aで画像メモリ251に格納された画像データを用いて色判別処理のための2次の正規化データが演算される(#124)。また、色判別部255の輝度演算色255bで画像メモリ251に格納された画像データを用いて各画素位置毎に色判別用の輝度データが演算される(#126)。更に、色判別部255の形状認識回路255cで画像メモリ251に格納された画像データを用いて、所定ブロック単位で文字、図形等の形状認識処理(パターンマッチングによるパターン認識処理)が行われる(#128)。そして、色判別部255の色判別回路255dで、2次の正規化データ、輝度データ及び形状認識結果に基づき予め設定された閾値プロファイル(図15〜図18参照)を用いて上述の色判別方法により各画素位置の色判別が行われる(#128)。
【0146】
続いて、黒領域補正部256で、色判別データに対して斑模様を修正する処理が行われるとともに(#132)、第2ノイズ消去部257で、色判別データに対して島状に発生している偽色を消去する処理が行われた後(#257)、色置換部258で、色判別データに基づき各画素位置の画像データ(撮影時の画像データ)が所定の色データ(予め設定されたR,G,Bの色成分の画像データ(デフォルト値)又は登録処理で登録されたR,G,Bの色成分の画像データ)に置換され(#136)、これにより色補正処理を終了し、リターンする。
【0147】
なお、上記実施の形態では、デジタルカメラを例に説明したが、本発明は、例えばコンピュータによる色判別処理等の他のカラー画像処理装置においても適用することができる。
【0148】
【発明の効果】
以上説明したように、本発明によれば、カラー画像を構成する色成分の画像データを用いて色判別された各画素位置の色判別結果に対して、所定の画素数単位で、色のデータを抽出するとともに、その抽出領域の色の分散度を演算し、この分散度に基づき色の分散が大きいと判別されたときは、抽出領域の中心の画素位置の色のデータを黒色のデータに置換するようにしたので、色判別処理での誤判別により黒領域にノイズとして生じた有彩色を好適に除去することができる。
【図面の簡単な説明】
【図1】本発明に係る色判別装置を備えたデジタルカメラの一実施の形態の外観を示す斜視図である。
【図2】本発明に係る色判別装置を備えたデジタルカメラの背面図である。
【図3】色登録確認表示部の表示の一例を示す図である。
【図4】色登録モードでファインダー内に色データ取込範囲を示す枠が表示された状態を示す図である。
【図5】本発明に係るデジタルカメラのドキュメントモードにおける撮像画像の画像処理に関するブロック構成図である。
【図6】画像処理部のドキュメントモードにおける画像処理に関するブロック構成図である。
【図7】ドキュメントモードにおける画像処理手順の概要を示す図である。
【図8】下地飛ばし処理の内容を示す図である。
【図9】ホワイトボード撮影画像を構成する画像データのヒストグラムの典型例を示す図である。
【図10】下地飛ばし用に設定されるγ特性の一例を示す図である。
【図11】1次の正規化データxb,xgを用いて色判別する場合のxb-xg平面における青、緑、橙、赤の各系統の色分布を示す図である。
【図12】2次の正規化データxb,xgを用いて色判別する場合のxb-xg平面における青、緑、橙、赤の各系統の色分布を示す図である。
【図13】画像データXr,Xg,Xbを2次の正規化データxr,xg,xbに変換するフローチャートである。
【図14】パターンマッチングにより細線部分と太線部分とを検出する方法を示す図である。
【図15】色判別用の輝度データにより有彩色と無彩色との色判別を行うための閾値プロファイルの第1の実施形態を示す図である。
【図16】色判別用の輝度データにより有彩色と無彩色との色判別を行うための閾値プロファイルの第2の実施形態を示す図である。
【図17】色判別用の輝度データにより有彩色と無彩色との色判別を行うための閾値プロファイルの第3の実施形態を示す図である。
【図18】色判別用の輝度データにより有彩色と無彩色との色判別を行うための閾値プロファイルの第4の実施形態を示す図である。
【図19】成分を相互に入れ換えた6個の正規化データのxb-xg平面上の位置関係の一例を示す図である。
【図20】成分を相互に入れ換えた6個の正規化データにより生成される等距離線の形状を楕円とした図である。
【図21】成分を相互に入れ換えた6個の正規化データにより生成される等距離線の形状を二等辺三角形とした図である。
【図22】成分を相互に入れ換えた6個の正規化データにより生成される等距離線の形状を六角形とした図である。
【図23】xb-xg平面を青、緑、橙、赤の色領域に分割した状態を示す図である。
【図24】文字等の線幅と輝度レベルとの関係を示す図である。
【図25】文字等の線幅の異なる部分を閾値プロファイルを用いて白黒判別を行ったときの判別結果を示すもので、(a)は閾値レベルの高い閾値プロフィルを用いて場合、(b)は閾値レベルの低い閾値プロフィルを用いた場合、(c)は線幅に応じて閾値レベルを変更した場合、の判別結果である。
【図26】線幅に応じて補正される閾値プロファイルの補正例を示す図である。
【図27】色判別結果が斑模様となった場合の一例を示す図である。
【図28】分散度の演算例を示す図で、(a)は、斑模様の領域の分散度を示す図、(b)は、赤領域の分散度を示す図である。
【図29】黒領域補正部の補正処理の手順を示すフローチャートである。
【図30】文字等の黒領域内に有彩色が島状に残っている状態の一例を示す図である。
【図31】第2ノイズ消去部の偽色消去の処理手順を示すフローチャートである。
【図32】隣接する8個の画素位置の色判別結果を用いて中心画素の色修正を行う方法を示す図である。
【図33】本発明に係るデジタルカメラのドキュメントモードに関する撮影動作手順を示すフローチャートである。
【図34】色登録処理の処理手順を示すフローチャートである。
【図35】色補正処理の処理手順を示すフローチャートである。
【符号の説明】
1 デジタルカメラ
2 撮影レンズ
3 測光窓
4 投光窓
5 受光窓
6 ファインダー対物窓
7 カード挿入口
8 カード取出ボタン
9 シャッタボタン
10 HDカード
11 メインスイッチ
12 ファインダー接眼窓
13 色補正スイッチ
14 ノイズ修正スイッチ
15 濃度設定スイッチ
16 モード変更スイッチ
17 色登録確認表示部
18 色選択ボタン
19 セットボタン
20 デフォルトボタン
21 枠
22 色見本
23 撮像部
24 A/D変換器
25 画像処理部(色判別装置)
251 画像メモリ
252 第1ノイズ消去部
253 下地飛ばし演算部
254 γ特性設定部
255 色判別部(色判別手段)
255a 正規化演算回路
255b 輝度演算回路
255c 形状認識回路
255d 色判別回路
256 黒領域補正部
256a 同色画素数計数回路(演算手段)
256b 分散度演算回路(演算手段)
256c 黒判別回路(色データ置換手段)
257 第2ノイズ消去部
258 色置換部
26 カード駆動制御部
27 RAM
28 ROM
29 測距部
30 測光部
31 設定色正規化演算部
32 色領域設定演算部
34 制御部
35 ホワイトボード
36 文字部分
37,38 誤判別された画素
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a color discriminating apparatus that discriminates the color of an image that is separated and captured into image data of color components such as red, green, and blue using the image data of the color component.
[0002]
[Prior art]
Conventionally, various methods for discriminating the color of an image composed of electrical signals have been proposed. For example, Japanese Patent Laid-Open No. 5-137011 calculates the difference between the maximum value and the minimum value of the image data Xr, Xg, and Xb of each color component of R, G, and B, and the calculation result is a predetermined value set in advance. A method of discriminating an achromatic color when it is smaller than the threshold value, and a method of discriminating a chromatic color by combining the magnitudes of the image data Xr, Xg, and Xb of the R, G, and B color components when the threshold value is greater than the predetermined threshold value. It is shown. When it is determined that the color is achromatic, white and black are further determined based on the luminance data. In addition, once the color is determined, the relationship with the color determination result of the surrounding pixels is examined, and the erroneous determination of each pixel position is corrected by majority vote.
[0003]
[Problems to be solved by the invention]
When performing color discrimination from a color image from image data, if the discrimination criteria that consider color reproducibility and place importance on color discrimination of the chromatic color part are set, the discrimination criteria for discriminating between black and chromatic colors will be relaxed, Black pixel positions are easily misidentified as chromatic colors. For example, when characters, figures, etc. drawn on a whiteboard are photographed as recording materials with a digital camera, R, G, and B color components are added to the black pixels depending on board lighting conditions, pen dirt, camera performance, etc. Deviations may occur in the image data, and the pixel may be misidentified as a chromatic color. As a result, there arises a problem that chromatic colors are mixed as noise in the black region of the photographed image.
[0004]
If chromatic colors are mixed in the black area of the photographed image, characters and the like are difficult to see and the image quality is remarkably reduced. Therefore, it is desirable to prevent chromatic colors from being mixed as noise in the black area as much as possible. However, if the criteria for discriminating between black and chromatic colors are tightened, on the contrary, since achromatic colors will be mixed as noise in chromatic colors, it is difficult to prevent the occurrence of noise in the black area only by color discrimination processing. is there.
[0005]
Therefore, when performing color discrimination processing that places importance on color discrimination of the chromatic color portion, processing for removing chromatic colors included in the black region from the color discrimination result (hereinafter referred to as noise removal processing) is required. It becomes.
[0006]
The noise removal processing in the above conventional color discrimination method is effective when noise in the black region is scattered because noise removal is performed by majority vote with the color discrimination result of surrounding pixels. If the color discrimination result of the black area is occupied by a lot of noise like a spotted pattern, the pixel correctly identified as black is erroneously corrected to a chromatic color due to the influence of surrounding pixels that are misclassified as chromatic. Therefore, it is difficult to correct the black area to black. In particular, an image obtained by photographing a white boat with the above-described digital camera is an image in which a black area is easily misidentified as a spotted pattern due to influences such as illumination and dirt on a pen. Even if this noise removal method is applied, it is difficult to obtain a sufficient effect.
[0007]
The present invention has been made in view of the above problems, and provides a color discrimination device that can effectively remove noise generated in a black region by color discrimination.
[0008]
[Means for Solving the Problems]
The present invention is a color discrimination device for discriminating the color of a color image composed of image data of a plurality of color components, and a color discrimination means for discriminating colors using the image data for each pixel position, Calculating means for extracting data of the color discriminated by the color discriminating means in a set number of pixels and calculating a degree of dispersion indicating the degree of dispersion of the colors included in the extracted area; and the calculating means The degree of dispersion calculated in step (b) is compared with a predetermined threshold value set in advance to determine whether or not the color dispersion is large. When the determination means determines that the color dispersion is large, the extraction is performed. And color data replacement means for replacing the color data of the pixel position at the center of the region with black data (claim 1).
[0009]
According to the above configuration, the color image is subjected to color discrimination at each pixel position using the image data of the color components constituting the image. Further, color data of a partial area of the color image is extracted from the color discrimination result in units of a preset number of pixels, and the degree of dispersion of the color included in the extracted area is calculated. Is compared with a predetermined threshold value set in advance to determine whether or not the color dispersion is large. When it is determined that the color dispersion is large, the color data at the pixel position at the center of the extraction region is replaced with black data.
[0010]
The data replacement process is performed sequentially for each pixel by changing the extraction area in the color image, and the chromatic color generated as noise in the black area is corrected to black.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
The present invention will be described using a digital camera equipped with the color discrimination device according to the present invention as an example.
[0014]
FIG. 1 is a perspective view showing the appearance of an embodiment of a digital camera equipped with a color discrimination device according to the present invention, and FIG. 2 is a rear view of the digital camera.
[0015]
In the figure, a digital camera 1 is provided with a photographing lens 2 made up of a zoom lens in the approximate center of the front surface, and a light projection window 4 and a light receiving window 5 for measuring a subject distance by an active distance measuring method at the upper part thereof. And a photometric window 3 for measuring the luminance of the subject is arranged between the windows. A finder objective window 6 is disposed on the left side of the light projection window 4.
[0016]
The light projection window 4 is a window that irradiates the subject with infrared light, and the light receiving window 5 is a window that receives the reflected light from the subject of the infrared light. In this embodiment, the active distance measurement method is adopted as the distance measurement method, but a passive distance measurement method may be used.
[0017]
A card insertion slot 7 into which a hard disk card 10 (hereinafter abbreviated as HD card 10) is inserted and removed is provided on the side surface of the digital camera 1, and the HD card 10 is ejected above the card insertion slot 7. A card removal button 8 is provided. Further, a shutter button 9 is provided on the upper left end portion of the digital camera 1.
[0018]
When printing out the shooting result, the card eject button 8 can be pressed to remove the HD card 10 from the digital camera 1, and the HD card 10 can be attached to a printer to which the HD card 10 can be attached.
[0019]
The digital camera 1 may be provided with a SCSI cable interface, the digital camera 1 and the printer may be connected by a SCSI cable, and the image data may be transferred from the digital camera 1 to the printer to directly print out the photographed image. Good.
[0020]
In this embodiment, a PCMCIA-compliant hard disk card is used as a recording medium for image data. However, as long as the photographing result can be stored as image data, another memory card, mini disk (MD), or the like can be used. It may be a recording medium.
[0021]
On the back of the digital camera 1, as shown in FIG. 2, a main switch 11 for turning on the power is provided at the upper left end portion, and a viewfinder eyepiece window 12 is provided at substantially the center. In addition, a color correction switch 13, a noise correction switch 14, and a density setting switch 15 are provided below the main switch 11.
[0022]
Furthermore, a mode change switch 16, a color registration confirmation display unit 17, a color selection button 18, a set button 19, and a default button 20 are provided at the right rear end of the digital camera 1.
[0023]
If you directly shoot characters and diagrams written on the whiteboard and use them as recording materials, the captured images will have more clear information, such as text, than the image quality with high descriptiveness as in normal photography. Image quality is required. The color correction switch 13 is a switch for instructing predetermined image processing for clarifying the color classification while clarifying the density of characters, diagrams, and the like for such a photographed image.
[0024]
In this image processing, characters, charts, etc. are usually written on the whiteboard with several types of color pens such as red, blue, green, orange, black, etc., and color reproduction is performed on images shot with these letters, charts, etc. Since the information nature (easiness to see, understandability, etc.) of the characters etc. of the photographed image is more important than the nature, the characters etc. in the photographed image can be any of red, blue, green, orange, black, etc. A process of determining whether a color is colored and assigning a predetermined color according to the determination result to the character or the like (the image data of the area constituting the character is the image data of the preset color (Replacement process) is performed.
[0025]
If the color correction switch 13 is on, the image processing for the photographed image is performed. If the color correction switch 13 is off, the image processing for the photographed image is not performed, and image processing for normal photography is performed. Accordingly, if the shooting mode for performing normal photography is “normal mode” and the shooting mode for recording and shooting characters or the like written on the whiteboard is “document mode”, the color correction switch 13 is switched between the normal mode and the document mode. It is a switch that switches between and set.
[0026]
The noise correction switch 14 is a switch for correcting a false color generated as noise in characters or the like of a captured image in the image processing in the document mode. When the noise correction switch 14 is turned on, correction processing for false colors generated in characters or the like of the captured image is performed as described later, and when the noise correction switch 14 is turned off, the correction processing is not performed. Since the noise correction switch 14 functions in the document mode, the false color correction processing instruction is ignored even if the noise correction switch 14 is turned on while the color correction switch 13 is turned off.
[0027]
The density setting switch 15 is for setting the density information of the subject so that, for example, a character with a thin line or a figure with a low density becomes a clear image in the image processing in the document mode. The density information set by the density setting switch 15 is used when switching the discrimination threshold in the color discrimination of the image processing in the document mode according to the density of the subject. In this embodiment, the density setting switch 15 switches between “dark” and “light” and two types of density information. Since the density setting switch 15 also functions in the document mode, even if the density setting switch 15 is turned on while the color correction switch 13 is turned off, the instruction for correcting the density of characters and the like is ignored. The density setting may be set continuously.
[0028]
The mode change switch is used to switch between a shooting mode for taking a picture and a color registration mode for registering a discrimination color at the time of color discrimination. In the color registration mode, a color sample (such as a color patch created with a color pen on a whiteboard) is actually photographed, and image data of colors used in the above-described color discrimination processing and color replacement processing is set and registered. This is a mode for processing. Note that a default value of color data is set in advance in the digital camera 1, and when the user does not register and set color data in the color registration mode, this default value is used for color discrimination and color data replacement processing. Used.
[0029]
In the present embodiment, as shown in FIG. 3, four colors of red, blue, orange, and green can be registered. Therefore, when the mode change switch 16 is set to “color registration”, it is possible to shoot a color sample and register desired color data for four colors of red, blue, orange, and green. If the switch 16 is set to “shoot”, a picture can be taken.
[0030]
The color registration confirmation display unit 17 displays color registration contents and colors used in color data replacement processing. The color registration confirmation display unit 17 is a display unit for selecting a color to be registered in the color registration mode, and a display for selecting a color to be used for color data replacement processing in the photographing mode. It also functions as a part. In FIG. 3, the display of “red”, “blue”, “orange”, and “green” indicates the types of colors that can be registered. In this embodiment, four types of colors can be registered. However, four or more types of colors may be registered, and colors other than the four types of colors (for example, colors such as yellow and brown) may be registered. Registration may be made possible.
[0031]
A color having a bar display 171 at the top indicates that the color is selected when color registration or color use is selected. In FIG. 3, “blue” is selected. The bar display 171 moves left and right by operating the color selection button 18, and the user can select a desired color by operating the color selection button 18 in the color registration mode. Each time the right color selection button 18 is pressed, the bar display 171 moves to the right as “red → blue → orange → green → red”. Every time the left color selection button 18 is pressed, the bar display 171 changes. Move to the left as “Green ← Red ← Blue ← Orange ← Green”.
[0032]
Further, a color surrounded by a circle display 171 in the color registration field indicates that the color is registered, and a color not surrounded by the circle display 171 indicates that the color is not registered. Show. Color registration is a color created by setting a color registration mode, selecting a desired color, for example, “red” on the bar display 171, and then painting an area of an appropriate size on the whiteboard with a red pen. This is done by taking a sample. In this case, as shown in FIG. 4, a frame 21 indicating the color data capture range is displayed in the center of the finder, and the frame is such that the color sample 22 is included in a certain area or more in the frame 21. When the image is adjusted and the color data is registered, color data registration processing is performed. In shooting in the color registration mode, data of R, G, and B color components constituting the color (red in the example of FIG. 4) in the frame using the image data included in the frame 21 in the shot image. And secondary normalized data (described later) generated using these data are registered (stored in the memory).
[0033]
The color use column is a display indicating whether a registered color or a default color is used in the color discrimination and color data replacement processing in the color correction mode. The color surrounded by “ON” in the circle mark display 173 indicates that it is used, and the color surrounded by “OFF” indicates that it is not used. The display example of FIG. 3 indicates that three colors of red, blue, and green other than orange are used for color data replacement processing.
[0034]
The ON / OFF setting of the color use column is performed by operating the set button 20 after selecting a color with the color selection button 18 in the color registration mode. The position of the ◯ mark display 173 in the color use column is alternately switched between ON and OFF every time the set button 20 is pressed, and the user operates the set button 20 while viewing the display position of the ◯ mark display 173. Use / nonuse of color can be set.
[0035]
The default button 20 is an operation button for returning the registered color to the default color. When the default button 20 is pressed after setting a desired color on the bar display 171 in the color registration mode, the display of the ◯ mark display 172 disappears and the color registration is deleted.
[0036]
FIG. 5 is a block diagram showing image processing of a captured image in the document mode of the digital camera according to the present invention.
In this figure, the same members as those shown in FIGS. 1 and 2 are denoted by the same reference numerals. The imaging unit 23 converts a subject light image formed on the imaging surface of the imaging element by the photographing lens 2 into an image signal and outputs the image signal. The imaging unit 23 includes, for example, an imaging device composed of a CCD color area sensor, a CCD drive control circuit that controls driving of the imaging device (hereinafter referred to as CCD), and noise reduction of an image signal (analog signal) output from the CCD. An analog signal processing circuit that performs predetermined signal processing such as level adjustment is included.
[0037]
The CCD color area sensor separates and outputs a subject light image into image data of R, G, and B color components, and may be either a single plate area sensor or a three plate area sensor. The image capturing unit 23 controls the CCD image capturing operation (charge accumulation and readout of accumulated charge) based on the exposure control value (shutter speed) input from the control unit 34 that centrally controls the image capturing operation of the camera. That is, the exposure (charge accumulation) of the CCD is started based on the exposure start signal from the control unit 34, and when the exposure ends after a predetermined time elapses, the accumulated charge is read from the CCD for each of the R, G, B color components. Then, after predetermined signal processing is performed in the analog signal processing circuit, it is read out to the image processing unit 26 via the A / D converter 24.
[0038]
The A / D converter 24 converts the analog image signal read from the imaging unit 23 into, for example, an 8-bit digital image signal (hereinafter referred to as image data).
[0039]
The image processing unit 25 performs predetermined image processing such as white balance, γ correction, and shading correction on the image data input from the A / D converter 24 in the normal mode, and removes a background to be described later in the document mode. Predetermined image processing such as color correction, black region correction and color data replacement is performed, and after predetermined compression processing, the image is output to the HD card 10.
[0040]
The HD card 10 is a recording medium that records image data constituting a captured image. The card drive control unit 26 controls the drive of the HD card.
[0041]
A RAM (Random Access Memory) 27 is a memory for the control unit 34 to perform processing relating to shooting, color registration, and other functions. A ROM (Read Only Memory) 28 has data and processing programs necessary for controlling the imaging drive, and necessary data for performing various processes such as background removal, color discrimination, black area correction, and false color erasing in the document mode described later. And a memory in which processing programs are stored.
[0042]
The distance measuring unit 29 detects a subject distance provided at a position behind the light projecting window 4 and the light receiving window 5. The photometry unit 30 has a light receiving element such as an SPC provided at a rear position of the photometry window 3 and detects subject luminance.
[0043]
The set color normalization calculation unit 31 calculates normalization data to be described later using the image data of the captured color sample in the color registration mode. The normalized data is represented by xr = Xr 2 / (Xr 2 + Xg 2 + Xb) where Xr, Xg, and Xb are the levels of the image data of the R, G, and B color components and xr, xg, and xb are the normalized data. 2 ), xg = Xg 2 / (Xr 2 + Xg 2 + Xb 2 ), xb = Xb 2 / (Xr 2 + Xg 2 + Xb 2 ), and color discrimination is performed based on the coordinate position of the normalized data in the xb-xg plane. This is used for color region division. Details of the color discrimination method based on the coordinate position of the normalized data will be described later.
[0044]
The set color normalization calculation unit 31 extracts the image data included in the frame 21 in the shooting screen from the color sample image data captured in the color registration mode, and further, a predetermined level set in advance from the extracted data. The following image data is extracted. This extraction processing is to extract image data corresponding to the red color sample in the frame 21 in FIG. The set color normalization calculation unit 31 calculates secondary normalization data using the extracted color sample image data. This calculation result is stored in the RAM 27 via the control unit 34.
[0045]
The color area setting calculation unit 32 divides a color area when performing color discrimination based on the coordinate position of the normalized data on the xb-xg plane described above. That is, for example, when the chromatic color is discriminated into four colors of blue, green, orange and red, in the color discrimination based on the coordinate position of the normalized data on the xb-xg plane, the xb-xg plane is blue, green, orange, red. Are divided into four color regions, and color determination is performed depending on which color region the coordinate position of the normalized data is in. The color region setting calculation unit 32 sets the xb-xg plane to blue, green, orange, The boundary line for dividing into four red color regions is calculated. The calculation result of the boundary line is also stored in the RAM 27. The setting of the color area will also be described later.
[0046]
The control unit 34 centrally controls the photographing operation of the digital camera 1 and is constituted by a microcomputer. The control unit 34 controls driving of the imaging unit 23 to capture a subject light image, controls driving of the image processing unit 25 to perform predetermined image processing on the captured image, and drives the card drive control unit 26. The captured image after image processing is recorded on the HD card.
[0047]
FIG. 6 is a block configuration diagram relating to image processing (color correction processing) in the document mode of the image processing unit 25.
[0048]
The image processing unit 25 includes, as circuit blocks for performing color correction processing in the document mode, an image memory 251, a first noise erasing unit 252, a background removal calculating unit 253, a γ characteristic setting unit 254, a color determination unit 255, black An area correction unit 256, a second noise elimination unit 257, and a color replacement unit 258 are included.
[0049]
In the document mode, as shown in FIG. 7, the image data input to the image processing unit 25 is first subjected to pre-processing for whitening the background (Process A), and then the image data ( Normalized data is created for the quadratic power of (R, G, B image data) (process B), and color discrimination is performed using the normalized data (process C). Then, image data erroneously color-determined among image data constituting characters and the like is corrected, and image data colored in a chromatic color is corrected among image data in the black area (Processing D). ), The image data at each pixel position is replaced with predetermined color data based on the color discrimination result and output to the HD card 10 (process E).
[0050]
The image memory 251 temporarily stores image data of R, G, and B color components input from the A / D converter 24. The first noise elimination unit 252 reduces noise of image data input to the image memory 251 by, for example, replacing the image data at each pixel position with an average value of eight image data at adjacent pixel positions. It is.
[0051]
The background removal calculation unit 253 separates the background portion and the character portion of the image data, and converts an area corresponding to the background portion into predetermined white level data. That is, for example, in the case of an image obtained by photographing a subject in which characters and figures are drawn on a whiteboard (hereinafter referred to as a whiteboard photographed image), the image of the board portion 351 of the whiteboard 35 is uniformly shown in FIG. It is white to make the image of the character part 352 easier to see. The background removal calculation unit 253 performs background removal processing by performing γ correction on the image data at each pixel position in accordance with the γ characteristic input from the γ characteristic setting unit 254.
[0052]
The γ characteristic setting unit 254 sets γ characteristics for the background removal process. The γ characteristic setting unit 254 creates a histogram of the input image data, and determines the γ characteristic based on the histogram. FIG. 9 shows a typical histogram of a whiteboard photographed image. In such a character image, generally two large and small peaks U1 and U2 are generated. A large mountain U1 generated in the bright region corresponds to the board portion 351, and a small mountain U2 generated in the dark region corresponds to a clear character or figure of the character portion 352. A valley portion R between the large mountain U1 and the small mountain U2 is a portion of a character or a figure that is dirty on the board portion 351, a light color of the character portion 352, or a thin line.
[0053]
The γ characteristic setting unit 254 calculates the level w of the image data corresponding to the peak of the large mountain U1, for example, and determines the γ characteristic {circle around (1)} with this level w as the white saturation level, as shown in FIG. FIG. 10 shows γ characteristics when the image data is 8-bit data. Level “255” is a white level, and level “0” is a black level. In the γ characteristic (1) shown in the figure, all image data of level w or higher is uniformly converted to a white level, and image data lower than level w is converted at a predetermined conversion ratio (γ value) according to the level. The level is converted to linear. In order to emphasize black in the character portion 352, a γ characteristic (2) in which a predetermined low level b is a black saturation level may be used. In the γ characteristic (2), all the image data below the level b are uniformly converted to the black level.
[0054]
Accordingly, when the γ correction () (1) (or (2)) set by the γ characteristic setting unit 254 is used to perform the γ correction of the image data by the background removal calculating unit 253, as shown in FIG. The image data 351 is converted into white data substantially evenly, and the background of the captured image is blown white.
[0055]
The color discriminating unit 255 discriminates the color at each pixel position. The color determination unit 255 includes a normalization calculation circuit 255a, a luminance calculation circuit 255b, a shape recognition circuit 255c, and a color determination circuit 255d as circuits for performing color determination processing.
[0056]
As a color discrimination method using image data of R, G, and B color components, as shown in JP-A-6-105091, two color components are selected from the three color components, There is known a method for discriminating colors based on the positions of normalized data of two color components in a coordinate plane of normalized data of a selected color component. Also in this embodiment, color discrimination is performed based on the position of normalized data of two color components. However, the above publication discloses primary normalized data, that is, a mixture of image data of R, G, and B color components. The color discrimination is performed using normalized data xr = Xr / (Xr + Xg + Xb), xg = Xg / (Xr + Xg + Xb), xb = Xb / (Xr + Xg + Xb) representing the ratio, whereas this embodiment has a second order The difference is that normalized data xi = Xi 2 / (Xr 2 + Xg 2 + Xb 2 ) (i = r, g, b) for the power value is used.
[0057]
In the present embodiment, secondary normalized data is used because, in photographing in the document mode, color classification is emphasized from the viewpoint of making characters and the like easy to see. As described below, secondary normalized data is used. This is because it is more advantageous for color discrimination processing.
[0058]
FIG. 11 is a diagram showing the color distribution of each of the blue, green, orange, and red systems on the xb-xg plane when color discrimination is performed using primary normalized data xb, xg, and FIG. It is a figure which shows the color distribution of each system | strain of blue, green, orange, and red in the xb-xg plane in the case of color discrimination using normalized data xb, xg.
[0059]
In both figures, the Q point of (xb, xg) = (1/3, 1/3) is a position that is completely achromatic when photographed with a camera having an ideal white balance. In addition, each point of (xb, xg) = (1, 0), (0, 1), (0, 0) is a position that is discriminated as complete blue, green, and red, respectively. Since an actual camera does not have an ideal white balance, for example, even if a blue pure color is photographed, the normalized data (xb, xg) of the photographed image is (xb, xg) = (1,0) In general, it is located within a certain area biased toward the Q point.
[0060]
For example, the normalization data (xb, xg) of each color when photographing a color sample created on a whiteboard with standard four color pens of blue, green, orange, and red is ellipse Sb, Sg, So, respectively. , Sr. Further, white or black achromatic colors are also distributed in a region Sw near the Q point.
[0061]
As can be seen from the comparison of the ellipses Sb, Sg, So, Sr in both figures, using the second-order normalized data (xb, xg) makes the ellipses Sb, Sg, So, Sr flatter and identical. It can be seen that the position of the normalized data (xb, xg) generated from the chromatic color image data is far from the ideal achromatic point Q (Plotted P in the blue region of FIGS. 11 and 12). Compare points and points P '). Therefore, color discrimination can be performed more easily and accurately using secondary normalized data than using primary normalized data.
[0062]
The normalization calculation circuit 255a converts the image data of each color component of R, G, B at each pixel position into normalized data xr = Xr 2 / (Xr 2 + Xg 2 + Xb 2 ), xg = Xg 2 / (Xr 2 + Xg 2 + Xb 2 ), xb = Xb 2 / (Xr 2 + Xg 2 + Xb 2 )
[0063]
The normalization circuit 255a converts the image data Xr, Xg, Xb at each pixel position into secondary normalized data xr, xg, xb according to the flowchart of FIG.
[0064]
That is, the image data Xr, Xg, and Xb of each color component are squared, and the calculation results are stored in the registers Rr1, Rg1, and Rb1, respectively (# 2). Subsequently, the square values Xr 2 , Xg 2 , Xb 2 of the image data Xr, Xg, Xb stored in the registers Rr1, Rg1, Rb1 are added, and the result is stored in the register SUM (# 4). Subsequently, the square values Xr 2 , Xg 2 , Xb 2 of the image data Xr, Xg, Xb stored in the registers Rr1, Rg1, Rb1 are respectively added values (Xr 2 + Xg 2 + Xb 2 ) stored in the register SUM. The results are stored in the registers Rr2, Rg2, and Rb2, respectively, and the process is terminated (# 6).
[0065]
When normalized data (xb, xg) having a degree greater than the second order is used, the tendency to move away from the achromatic point Q at the position of the normalized data (xb, xg) on the xb-xg plane becomes stronger. Since the color characteristics of the image data (that is, whether it is biased to blue, green, orange, or red) become clearer, as normalized data,
xr = Xr k / (Xr k + Xg k + Xb k)
xg = Xg k / (Xr k + Xg k + Xb k)
xb = Xb k / (Xr k + Xg k + Xb k)
The k-th order (k> 2) normalized data calculated by the following equation may be used.
[0066]
In the present embodiment, image data of R, G, and B color components has been described. However, normalized data X (1), X (2),... X (n) of image data of other color components. In the case of using, normalized data x (1) k = X (1) k / ΣX (i) k , x (2) k = X (2) k / ΣX (i) for the second or higher power value k ,... x (n) k = X (n) k / ΣX (i) k (i = 1, 2,... n, k ≧ 2) can be used.
[0067]
By the way, in color discrimination, it is necessary to discriminate between chromatic and achromatic white and black as well as discrimination of chromatic colors. The discrimination between chromatic and achromatic white and black can also be performed by examining the position of the normalized data in the xg-xb plane as described above.
[0068]
However, the normalized data generated from the image data of the R, G, and B color components abstracts only the deviation of the R, G, and B color components in the image, and the light and dark information is discarded. If color discrimination is performed using only normalized data, low luminance black or high luminance white may be erroneously discriminated from chromatic colors such as red and blue. That is, for example, the secondary normalized data (xb, xg) for the black pixel position where the image data (Xr, Xg, Xb) of R, G, B color components is (20, 5, 5) is (0.06). , 0.06) is the same as the secondary normalized data (xb, xg) for the red pixel position of the image data (Xr, Xg, Xb) = (200, 50, 50). Misclassified.
[0069]
Therefore, in order to prevent such erroneous discrimination, in the present embodiment, color discrimination (including discrimination of achromatic colors) is performed using luminance data at each pixel position and the above-described normalized data. Yes. In addition, in order to reduce the influence on the color discrimination of wide and narrow line widths, color discrimination is performed in consideration of geometric shapes such as characters and figures as will be described later.
[0070]
The luminance calculation circuit 255b calculates luminance data at each pixel position used for the color discrimination process described above. The luminance calculation circuit 255b calculates, for example, the average value Y (= (Xr + Xg + Xb) / 3) of the image data Xr, Xg, and Xb of the R, G, and B color components as luminance data for color determination at each pixel position. .
[0071]
In addition, the shape recognition circuit 255c recognizes whether a region constituting a character, a figure, or the like is linear or planar. The shape recognition circuit 255c corrects the level of the image data in each block of 5 × 5 pixels or 7 × 7 pixels so that the maximum value becomes “255”, and then “0” and “255”. As shown in FIG. 14, the pattern α of the thin line portion and the thick line portion are obtained by pattern matching by square error calculation or the like with the image data of the level of 0 or the template having image data of several kinds of levels “0” to “255”. The pattern β is detected. This detection result is input to the color discrimination circuit 255d. Note that shape discrimination may be performed by high-frequency component detection processing instead of pattern matching.
[0072]
The color discrimination circuit 255d is based on the normalized data (xb, xg) calculated by the normalization calculation circuit 255a, the luminance data Y calculated by the luminance calculation circuit 255b, and the pattern result recognized by the shape recognition circuit 255c. Color discrimination (for example, white, black, blue, green, orange, red color discrimination) at each pixel position is performed using a predetermined threshold profile shown in FIGS.
[0073]
FIG. 15 is a diagram illustrating a first embodiment of a threshold profile for performing color discrimination between chromatic colors and achromatic colors based on luminance data for color discrimination. FIGS. 16 to 18 are modified examples of threshold profiles for performing color discrimination between chromatic colors and achromatic colors based on luminance data for color discrimination, and are diagrams showing second to fourth embodiments, respectively. .
[0074]
15 to 18, the horizontal axis indicates distance information from the achromatic color point Q on the xb-xg plane, and the vertical axis indicates the luminance level for color discrimination.
[0075]
Note that the distance information does not indicate the actual distance from the point Q on the xb-xg plane to the position of the normalized data (xb, xg), but an achromatic point (1/3 in the xr-xg-xb space). , 1/3, 1/3) specify the equidistant line (closed curve including achromatic point Q (1/3, 1/3)) obtained by projecting the closed surface equidistant from the xb-xg plane It is information of the distance to do.
[0076]
Here, the distance information will be briefly explained. When arbitrary normalized data (xb, xg) on the equidistant line in the xb-xg plane is treated as a group of data at the same distance, the equidistant line is an achromatic point. If the circle is centered on Q (1/3, 1/3), the actual distance from the point Q on the xb-xg plane to the position of the normalized data (xb, xg) is adopted as distance information. be able to.
[0077]
However, the equidistant line is a projection of the closed surface equidistant from the achromatic point (1/3, 1/3, 1/3) in the xr-xg-xb space onto the xb-xg plane as described above. Thus, it becomes a concentric closed curve that is not a circle centered on the achromatic point Q (1/3, 1/3), so the actual distance from the point Q to the position of the normalized data (xb, xg) is distance information. It cannot be.
[0078]
Therefore, in this embodiment, since the same distance information is given to the normalized data (xb, xg) on the equidistant line, the normalized data (xb, xg) and the equidistant line to which it belongs correspond one-to-one. Therefore, the distance information defining the position of the equidistant line on the xb-xg plane is used as the distance information of the normalized data (xb, xg) on the equidistant line.
[0079]
When normalized data (xb, xg) is given, in order to determine distance information for the normalized data (xb, xg), it is necessary to determine the equidistant line to which the normalized data (xb, xg) belongs. There is. However, a plurality of equidistant surfaces formed concentrically around the achromatic point (1/3, 1/3, 1/3) in the xr-xg-xb space are projected onto the xb-xg plane. It is not necessary to determine the equidistant line to which the normalized data (xb, xg) among a plurality of equidistant lines belongs. This is because the distance information of the normalized data (xb, xg) is used for color discrimination by relative comparison with a predetermined threshold value, and therefore the achromatic color point Q (1/3, 1 / This is because it is sufficient that the position of the normalized data (xb, xg) from 3) can be specified.
[0080]
If relative distance information is determined from equidistant lines with respect to given normalized data (xb, xg), the equidistant lines are equivalent to the normalized data (xb, xg) and other equidistant lines. A closed curve having a specific shape determined by a plurality of normalized data (xb, xg) on the line can be adopted.
[0081]
On the other hand, in the xr-xb-xg space, six normalized data (xr, xb, xg), (xb, xg, xr),... / 3, 1/3), and the points where these normalized data are projected onto the xb-xg plane constitute an equidistant line on the xb-xg plane, and can be used as equidistant lines Are at least five other normalized data (xr, xb), (xr, xg), (x) generated by replacing the given normalized data (xb, xg) and the components of this normalized data with each other xb, xr), (xg, xr), and (xg, xb).
[0082]
Accordingly, on the xb-xg plane, six normalized data (xb, xg), (xr, xb), (xr, xb) on the xb-xg plane generated by exchanging the three components with each other. Any shape that passes through (xg), (xb, xr), (xg, xr), (xg, xb) can be the specific shape of the equidistant line.
[0083]
FIG. 19 is a diagram illustrating an example of a positional relationship on the xb-xg plane of six normalized data in which components are interchanged.
[0084]
P1 (1/2, 1/3), P2 (1/2, 1/6), P3 (1/3, 1/6), P1 '(1/3, 1/2), P2 shown in FIG. '(1/6, 1/2), P3' (1/6, 1/3) are normalized data xr (= 1/6), xg (= 1/2), xb for the point P1. 5 normalization data generated by exchanging (= 1/3) components with each other are plotted on the xb-xg plane. As can be seen from the figure, the points P1 ', P2' and P3 'are line symmetric points with respect to the straight line L (straight line connecting the origin and the point Q) of the points P1, P2 and P3, respectively. Further, the points P3 and P3 ′ are line symmetrical points with respect to the straight line L ′ of the points P1 and P1 ′ (a straight line orthogonal to the straight line L passing through the point Q). Such symmetry of the points P1 to P3, P1 'to P3' is based on the fact that the normalized data at each point is determined by exchanging components having the relationship of xr + xb + xg = 1.
[0085]
Therefore, the equidistant line to which the point P1 belongs must pass through the points P1 to P3, P1 ′ to P3 ′ and be symmetrical with respect to the straight lines L and L ′. For example, an ellipse C1 shown in FIG. 20, an isosceles triangle C2 shown in FIG. 21, or a hexagon C3 shown in FIG.
[0086]
When the shape of the equidistant line is specified, if the calculation method of the distance from the achromatic point Q (1/3, 1/3) is determined for the equidistant line of the shape, the normalized data (xb, xg) to calculate the equidistant line of the specific shape to which the normalized data (xb, xg) belongs, and further calculate the distance from the achromatic point Q (1/3, 1/3) for the equidistant line. Thus, distance information for given normalized data (xb, xg) can be determined.
[0087]
In the example of FIGS. 20-22, as the distance from the achromatic point Q (1/3, 1/3) of each equidistant line, for example, the intersection point P4 of the straight line L and the equidistant lines C1, C2, C3 and the point A distance d from Q can be taken. This distance d is the distance from the center Q of the ellipse C1 to the closest point (1/2 of the short axis length) when the ellipse C1 is adopted as the closed curve, and when the isosceles triangle C2 is adopted as the closed curve, This is the distance from the point Q to the midpoint of the hypotenuse.
[0088]
Although the equidistant lines C2 and C3 have different shapes, the hypotenuses passing through the points P3 and P3 ′ are the same, and therefore the distance d from the point Q is the same. Therefore, the equidistant lines C2 and C3 are practically identical in considering distance information.
[0089]
In the present embodiment, an operation table for directly calculating the distance information d from the normalized data (xb, xg) is provided, and when the normalized data (xb, xg) is calculated, the distance is directly used using this operation table. Information d is calculated.
[0090]
Returning to FIG. 15, in the threshold profile shown in FIG. 15, the neighborhood area in the distance information d1 from the achromatic color position is defined as the achromatic color area Sw, and the discrimination threshold value for white and black is set to a fixed value Y2 in this area Sw. Outside the chromatic region, the discrimination threshold between chromatic and black is a fixed value Y1, and the discrimination threshold between chromatic and white is a fixed value Y3 (Y1 <Y2 <Y3).
[0091]
In this threshold profile, when the position of the normalized data (xb, xg) is located within the equidistant line of the distance information d1 (d ≦ d1), the luminance level Y is compared with the threshold Y2, and Y If ≧ Y2, it is determined to be white, and if Y <Y2, it is determined to be black. When the position of the normalized data (xb, xg) is located outside the equidistant line of the distance information d1 (d> d1), the luminance level Y is compared with the threshold values Y1, Y3, and Y> If Y3, it is determined as white, if Y <Y1, it is determined as black, and if Y3 ≧ Y ≧ Y1, it is determined as a chromatic color. In the case of a chromatic color, for example, color determination of four colors, for example, blue, green, orange, and red, is performed based on the position of the normalized data (xb, xg).
[0092]
The threshold profile shown in FIG. 16 indicates the threshold values for determining the chromatic color and white or black when the position of the normalized data (xb, xg) is outside the equidistant line of the distance information d1 in FIG. To Y1, Y3, Y4, Y5 (Y3>Y4>Y1>Y5> Y2). In this threshold profile, when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d2 (d2>d> d1), Y> Y4. If Y <Y5, it is determined as black, and if Y4 ≧ Y ≧ Y5, it is determined as a chromatic color. Further, when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d2 and the equidistant line of the distance information d3 (d3>d> d2), if Y> Y3, white If Y <Y5, it is determined as black, and if Y3 ≧ Y ≧ Y5, it is determined as a chromatic color. Further, when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d2 and the equidistant line of the distance information d3 (d> d3), if Y> Y3, it is determined as white. If Y <Y2, the color is determined to be black, and if Y3 ≧ Y ≧ Y2, the color is determined to be chromatic.
[0093]
The threshold profile shown in FIG. 17 is a chromatic color and a white color when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d2 in FIG. The discrimination threshold is linearly changed from Y4 to Y3, and the chromatic color and black color when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d3 The discrimination threshold is linearly changed from Y5 to Y2.
[0094]
Further, the threshold profile shown in FIG. 18 is the chromatic color when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d2 in FIG. When the white discrimination threshold is changed non-linearly (monotonically increasing) from Y4 to Y3, and the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d3 The chromatic color and black discrimination thresholds are changed non-linearly (monotonically decreasing) from Y5 to Y2.
[0095]
15 to 18 show typical examples of threshold profiles, and other threshold profiles can be arbitrarily adopted.
[0096]
In the threshold profile shown in FIGS. 15 to 18, when color discrimination of four colors of blue, green, orange, and red is performed from the position of the normalized data (xb, xg) on the xb-xg plane, it is shown in FIG. As described above, the dividing lines m1, m2, m3, and m4 are provided on the basis of the ellipses Sb, Sg, So, and Sr, and the triangular xg-xb plane is divided into four regions Ab, Ag, Ao, and Ar, and normalized. Color discrimination is performed depending on which of the four areas Ab, Ag, Ao, Ar (excluding the area Sw) the data (xb, xg) is in. For example, if the coordinates (xb, xg) of the normalized data are within the area Ab, the pixel position is determined as a blue color, and if within the area Ag, the pixel position is the green color. Is determined.
[0097]
The dividing lines m1, m2, m3, and m4 are set by the color area setting calculation unit 32, and the points Pb, Pg, Po, and Pr in FIG. 23 are respectively color-registered or preset blue, green, and orange. , Red image data (default value) normal data coordinate positions, for example, ∠PbQPg, ∠PgQPo, ∠PoQPr, ∠PrQPb bisectors and ΔPbQPg, ΔPgQPo, ΔPoQPr, ΔPrQPb point Q Is set as the midline connecting the midpoint of the opposite side. As described above, in the digital camera 1 according to the present embodiment, the color to be discriminated can be arbitrarily set in the range of four colors of blue, green, orange, and red. When orange is set to “OFF” in the color use column of the color recognition display section 17 as in the example shown in FIG. 5, the dividing line m1 is set for three colors of blue, green, and red set to “ON”. , M2, and m3 are set, and color discrimination is performed for the three colors. In this case, the dividing line m3 is set as a bisector of ∠PgQPr or a midline connecting the point Q of ΔPgQPr and the midpoint of the opposite side.
[0098]
If the pattern result input from the shape recognition circuit 255c is constant, the color determination circuit 225d performs color determination using a preset threshold profile fixedly, but the pattern input from the shape recognition circuit 255c. When the result changes, as described below, the color determination of the corresponding region is performed using the threshold profile corrected so as to raise or lower the threshold profile as a whole or partially according to the change in the pattern result. Do. This is because an image having a suitable line width can be obtained regardless of changes in the line width by raising or lowering the threshold profile as a whole or partly according to the width of the line constituting the character or the like. It is.
[0099]
FIG. 24 is a diagram illustrating an example of a change in density level based on the difference in line width.
[0100]
This figure shows the density level of the image data on the straight line M of the character portion 36 of the numeral “1” surrounded by a rectangle of the whiteboard photographed image. A graph drawn at the top of the character portion 36 indicates the density level. The portions A and C of the straight line M are portions (thin line portions) corresponding to a square line width, and B is a portion (thick line portion) corresponding to the line width of the number “1”. Since A and C are thin line portions and B is a thick line portion, the density levels of A and C are higher than the density level of B. That is, the fine line portion is whitish than the thick line portion.
[0101]
FIG. 25 shows a result of black and white discrimination using the threshold profile for the image data on the straight line M in FIG.
[0102]
For example, assuming that a threshold profile of the form shown in FIG. 18 is used, FIG. 18A shows a result of black and white discrimination using the threshold profile (1) having a high threshold level shown in FIG. Is a result of black and white discrimination using the threshold profile (2) having a low threshold level in FIG. FIG. 6C shows black and white discrimination using the threshold profiles {circle around (1)} and {circle around (2)} depending on the line width.
[0103]
When the threshold profile (1) with a high threshold level is used, the thick line portion B has a suitable line width, but the thin line portions A and C are higher than the threshold level Y1, so that they are misclassified as white, and a rectangular figure. Will fly away. On the other hand, when the threshold profile (2) having a low threshold level is used, the thin line portions A and C have a suitable line width, but the image data of the outline portion of the thick line portion B is also lower than the threshold level Y1 ′. The line width will be thicker than necessary. In this way, when the line width is wide or narrow, a fixed threshold profile is often appropriate for one line width but inappropriate for the other line width. Regardless of this, it is difficult to perform appropriate black and white discrimination.
[0104]
Therefore, in this embodiment, as shown in FIG. 5C, a suitable line width can be obtained by determining the line width and switching the threshold profiles (1) and (2) according to the determination result. I am doing so. Accordingly, when the discrimination result input from the shape recognition circuit 255c is the pattern α, the color discrimination circuit 225d performs black and white discrimination using the threshold profile (1), and when the discrimination result is the pattern β, the threshold profile ▲ Black and white discrimination is performed by switching 1 ▼ to the threshold profile (2).
[0105]
As described above, the correction of the threshold profile in the black and white discrimination may be performed by switching a plurality of preset threshold profiles according to the result of the line width discrimination. A predetermined level corresponding to the width determination result may be set so as to be shifted up or down entirely or partially.
[0106]
Returning to FIG. 6, the black area correction unit 256 corrects a black area including a chromatic color to a single black color not including a chromatic color by erroneous color discrimination.
[0107]
When color discrimination is performed using the threshold profiles shown in FIGS. 15 to 18, if the distance information d <b> 1 that is a discrimination threshold between an achromatic color and a chromatic color is set high, a chromatic color having a relatively dark color (that is, a low luminance) A chromatic color is easily misidentified as black, and a relatively light chromatic color (that is, a chromatic color having high luminance) is easily misidentified as white. For this reason, in order to prevent such erroneous discrimination, it is desirable to set the distance information d1 low.
[0108]
However, when a threshold profile in which the distance information d1 is set to be low is used, black is erroneously determined as a chromatic color, and as shown in FIG. 27, a black color region becomes a spotted region mixed with a chromatic color. Sometimes. The reason why the black area is likely to be a spotted pattern area is that the level of the black image data is low, so the normalized data xb and xg are rarely xb / xg = 1, and the normalized data (xb, xg) If the position is likely to be outside the achromatic region Sw, and the average of the image data is black to some extent, the black in the vicinity of the pixel position in which black is misclassified as blue, for example. This is based on the fact that there is a high possibility that there is a pixel position that is erroneously determined as red, green, orange, or the like.
[0109]
If a relatively wide black area constituting a character, figure, or the like becomes a spotted pattern area, the image becomes extremely difficult to see. The black area correction unit 256 converts the spotted pattern area into a black area to reduce image quality defects caused by the spotted pattern, and includes a same color pixel number counting circuit 256a, a dispersion degree calculation circuit 256b, and a black discrimination circuit 256c. ing.
[0110]
The same color pixel number counting circuit 256a is a circuit that counts the number of pixels of the same color in the block. When the block size is 5 × 5 pixels and the color distribution at each pixel position is as shown in FIG. 28, for example, the same color pixel number counting circuit 256a blocks the red, blue, orange, green, and black colors. The number of pixels existing in is counted. If the number of pixels of red, blue, orange, green and black is Nr, Nb, No, Ng, Nbk, and the total of these is Nt, Nr = 17, Nb = 2 in the example of FIG. , No = 3, Ng = 1, Nbk = 2, and Nt = 25 are counted. In the example of FIG. 5B, Nr = 4, Nb = 4, No = 5, Ng = 6, Nbk = 4, Nt. = 23 is counted. In the example of (b), two white pixels are included in the block, but these pixels are ignored in the black area correction processing.
[0111]
The dispersity calculation circuit 256b calculates the dispersity p of the color of each block using the number of pixels Nr, Nb, No, Ng, Nbk of red, blue, orange, green, and black and the total Nt thereof. Is. The degree of dispersion p is calculated by an arithmetic expression of p = (number of pixels of colors other than white) / Σ (number of pixels of each color) 2 = Nt / (Nr 2 + Nb 2 + No 2 + Ng 2 + Nbk 2 ). The degree of dispersion p is the reciprocal of the dispersion equation. In the example of FIG. 28A, p = 23 / (4 2 +4 2 +5 2 +6 2 +4 2 ) = 0.221 is calculated, and in the example of FIG. 28B, p = 25 / (17 2 +2 2 +3 2 +1 2 +2 2 ) = 0.081 is calculated.
[0112]
The black discriminating circuit 256c discriminates whether or not the pixel at the center position of each block is black using the dispersity p calculated by the dispersity computing circuit 256b. That is, the black discrimination circuit 256c compares a preset threshold value K1 with the degree of dispersion p. If p> K1, the black discrimination circuit 256 determines black, and if p ≦ K1, the black determination circuit 256c determines a chromatic color. For example, when K1 = 0.1, the example of FIG. 28A is determined to be black, and the example of FIG. 28B is determined to be a chromatic color. In the example of FIG. 28B, since the number of pixels of each color is overwhelmingly red, the pixel at the center position can be determined as “red”.
[0113]
FIG. 29 is a flowchart showing the procedure of the correction process of the black area correction unit 256.
[0114]
The color discrimination result output from the color discrimination unit 255 is stored in an unillustrated memory in the black area correction unit 256, and black area correction processing is performed according to the flowchart of FIG. That is, first, the color discrimination data for one block (5 × 5 pixels) in the upper left corner is read from the memory (# 10), and the number of pixels of each color other than white included in the block and the total number thereof are calculated. It is counted (# 12). If the discrimination colors are red, blue, orange, green, and black, the number of pixels Nr, Nb, No, Ng, Nbk of each color and the total number Nt thereof are counted.
[0115]
Subsequently, the degree of dispersion p (= Nt / (Nr 2 + Nb 2 + No 2 + Ng 2 + Nbk 2 )) is calculated (# 14), the degree of dispersion p is compared with a predetermined threshold value K1, and the center of the block is calculated. It is determined whether or not the pixel is black (# 16). If p> K1 (YES in # 16), it is stored that the color discrimination data at the pixel position at the center of the block (pixel position in the third row and third column of the block) is changed to black data (# 18). ). On the other hand, if p ≦ K1 (YES in # 16), the above data change instruction is not performed.
[0116]
Subsequently, it is determined whether or not the above processing for the entire color determination data has been completed (# 20). If the processing has not been completed (NO in # 20), the block reading position is set in the horizontal direction by one pixel. After shifting (# 22), the process returns to step # 10 and the above-described black discrimination process is performed (# 10 to # 20). Thereafter, while the block reading position is shifted by one pixel in the raster direction, black discrimination processing is performed for the color discrimination data at each pixel location (loop of # 10 to # 22), and black discrimination processing for the entire color discrimination data is performed. Is finished (YES in # 20), the color discrimination data at the pixel position instructed to change the color discrimination data to black data is changed to black data (# 24), and the processing is terminated.
[0117]
In the present embodiment, the size of one block for black region correction processing is 5 × 5 pixels, but the size of one block is not limited to this, and the processing accuracy and processing speed are taken into consideration. Any appropriate size can be set. Further, although the degree of dispersion p is defined as a measure of the degree of color dispersion, other arithmetic expressions may be defined as long as they can represent color variations. For example, standard deviation σ = 1 / √ (p) may be used.
[0118]
In addition, blue, green, orange, red, and black colors are represented by, for example, (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1), (1, When vectors are expressed as (0, 0, 0) and (1, 1, 1, 1), the reciprocal of the vector length of the vector average in the block may indicate the degree of dispersion. The vector expression may be independent for each color or may be information that takes into account information such as “red and orange are approximate colors”. Moreover, it is not limited to four dimensions, Arbitrary dimensions can be considered.
[0119]
As a simple method, the number of different colors may be determined based on the number of different colors at the eight pixel positions adjacent to the center position of the block.
[0120]
The second noise erasing unit 257 corrects a chromatic color or white color (color incorrectly determined) included in the color determined black region to black. That is, even when the black area correction unit 256 performs the process of correcting the spotted area to the black area, chromatic colors may remain in the black area in an island shape, and the second noise elimination unit 257 The false color is converted to black and erased.
[0121]
FIG. 30 is a diagram illustrating an example of a state in which chromatic colors remain in an island shape in a black region such as a character.
[0122]
This figure shows the case where the chromatic pixels 37 and 38 remain in the black area constituting the number “2”. However, in the second noise elimination unit 257, the pixels 37 in the black area are black. It is corrected and the false color is deleted. It should be noted that black correction is not performed for the pixels 38 at the contour position of the black region constituting the number “2”. When colors other than black are mixed in an island shape in the black area, the colors are conspicuous and characters are difficult to see, but when colors other than black are mixed at the boundary, the adverse effect of the false color is Therefore, the correction processing is performed only in the black region in consideration of the processing speed delay due to the black region correction processing. Note that black correction may also be performed for the false color at the contour position of the black region.
[0123]
FIG. 31 is a flowchart showing the false color erasure processing procedure of the second noise erasure unit 257.
[0124]
In the flowchart shown in FIG. 32, as shown in FIG. 32, the colors of the central position G A and the eight pixel positions adjacent thereto are examined. If the same color exceeds a predetermined number K2, the central pixel position G A is checked. Is changed to a color exceeding a predetermined number K2. Figure 32 is a predetermined number K2 obtained by six, the seven pixels excluding the center and the lower right corner is in the black, show that the color of the pixel G A center position is changed to black ing.
[0125]
The color discrimination data output from the black area correction unit 256 is stored in an unillustrated memory in the second noise elimination unit 257, and black area correction processing is performed according to the flowchart of FIG. That is, first, the color discrimination data for one upper left block (3 × 3 pixels) is read from the memory (# 30), and the number of pixels of each color included in the block is counted (# 32). .
[0126]
Subsequently, the largest number of pixels Nmax is compared with a predetermined threshold value K2, and it is determined whether or not Nmax> K2 (# 34). If Nmax> K2 (YES in # 34), it is stored that the color discrimination data at the pixel position at the center of the block (pixel position in the second row and second column of the block) is changed to color data of the number of pixels Nmax. (# 36). On the other hand, if Nmax ≦ K2 (YES in # 34), the above-described data change instruction is not performed.
[0127]
Subsequently, it is determined whether or not the false color correction process for the entire color determination data has been completed (# 38). If the process has not been completed (NO in # 38), the block reading position is shifted by one pixel. The direction is shifted (# 40), the process returns to step # 30, and the false color correction process described above is performed (# 30 to # 38). Thereafter, while the block reading position is shifted by one pixel in the raster direction, false color correction processing is performed on the color discrimination data at each pixel position (loop of # 30 to # 40), and the false color for the entire color discrimination data is processed. When the correction process is completed (YES in # 38), the color discrimination data at the pixel position instructed to change the color discrimination data to the color data of the number of pixels Nmax is changed to the instructed color data (# 42). ), The process is terminated.
[0128]
Returning to FIG. 6, the color replacement unit 258 sets image data at each pixel position in advance based on the color data set by the color determination unit 255, the black region correction unit 256, and the second noise elimination unit 257. Alternatively, it is replaced with image data of the corresponding color set in the color registration (image data of R, G, B color components). Then, the image data replaced by the color replacement unit 258 is output to the HD card and recorded (see FIG. 5).
[0129]
Next, the photographing operation of the digital camera 1 will be described with reference to the flowcharts of FIGS.
[0130]
FIG. 33 is a flowchart showing a shooting operation procedure related to the document mode.
[0131]
When the main switch 11 is turned on (YES in # 50), the digital camera 1 is activated and becomes ready for photographing. First, it is determined whether or not the mode change switch 16 is set to the shooting mode (# 52). If the shooting mode is not set, that is, if the color registration mode is set (NO in # 52). The color registration process is performed according to the flowchart shown in FIG. 34 (# 54), and if the shooting mode is set (YES in # 52), the process proceeds to step # 54 and the shooting process is performed.
[0132]
When the process proceeds to the color registration process, first, the color designated by the color selection button 18 is set as the color to be registered (# 80). In this color setting process, the color to be registered is determined and set based on the display position of the bar display 171. Subsequently, whether or not the set color is unregistered is determined by the presence / absence of the ◯ mark display 172 (# 82). If it is not registered (NO in # 82), the default button 20 is used to register the registered color. It is determined whether or not the data erasure is instructed (# 84).
[0133]
If deletion of registered color data is instructed (YES in # 84), the secondary normalized data of the registered color stored in the RAM 27 is rewritten to a preset default value for that color (# 84). ), And returns to Step # 82. On the other hand, if the registered color data deletion is not instructed (NO in # 84), the process proceeds to step # 88.
[0134]
In step # 82, if the set color is not registered (YES in # 82), it is determined whether or not the color sample (see FIG. 4) is instructed by the release operation of the shutter button 9 (# 88) If imaging is instructed (YES in # 88), the subject brightness is detected by the photometry unit 30 (# 90), and the subject distance is detected by the distance measurement unit 29 (# 92). Focus adjustment is performed based on the distance (# 94). An exposure control value (aperture value and CCD integration time) is set using the detected subject brightness (# 96).
[0135]
Subsequently, the color sample is imaged based on the set exposure control value (# 98). The image data captured by the imaging unit 23 is extracted from the image data in the frame 21 at the center of the shooting screen by the set color normalization calculation unit 31, and the image data of only the color sample portion is extracted from this image data. (# 100). Then, secondary normalized data is calculated for the image data of the color sample (# 102), and the calculation result is stored in a predetermined storage area of the RAM 27 (# 104).
[0136]
When the secondary normalization data of the color sample is stored in the RAM 27 (color registration), it is subsequently determined whether or not the color use is instructed by operating the set button 19 (# 106). Is instructed (YES in # 106), the color use in the color discrimination of the registered color is set (# 108), and the process returns. At this time, the color registration confirmation display unit 17 displays the color use “on”. If no color use is instructed (NO in # 106), the color use in the color discrimination of the registered color is canceled (# 110), and the process returns. At this time, the color registration confirmation display unit 17 displays the color use “off”.
[0137]
On the other hand, if imaging is not instructed in step # 88 (NO in # 88), the process jumps to steps # 90 to # 104 without performing the registration processing of the secondary normalized data of the color sample described above. The process proceeds to # 106.
[0138]
As described above, in the color registration mode, when the default button 20 is operated, the color sample image data (R, G, B color component image data already registered) is set for the set color. ) And secondary normalized data are erased, and preset image data and secondary normalized data (default values) are set instead. Further, when the set button 19 is operated, setting or canceling color use is performed for the set color. When the color sample is photographed regardless of whether it is unregistered or registered, secondary normalized data of the photographed color sample is calculated, and the calculated value and the captured image data are newly or Registered renewably.
[0139]
Returning to FIG. 33, when the shooting mode is set in step 52 (YES in # 52), it is subsequently determined whether or not imaging is instructed by the release operation of the shutter button 9 (# 56). If imaging has not been instructed (NO in # 56), the process returns to step # 52, and if imaging has been instructed (YES in # 56), whether the color correction correction switch 13 is further set to ON (i.e., It is determined whether or not the document mode is set (# 58).
[0140]
If the document mode is not set, that is, if the normal mode is set (NO in # 58), normal photography processing is performed. That is, the subject brightness and the subject distance are detected, and after the focus adjustment and the exposure control value setting are performed based on these detection values, the subject is photographed. Then, the image data captured by the imaging unit 23 is subjected to predetermined image processing (image processing that provides high image quality with high descriptiveness) by the image processing unit 25, compressed, and then recorded on the HD card 10. .
[0141]
On the other hand, if the document mode is set (YES in # 58), first, density data (dark / light data) is taken in by the setting position of the density setting switch 15 (# 62). Subsequently, the image processing unit 25 is set to the image processing in the document mode, and the density data is set to the color determination unit 255 (# 64).
[0142]
Subsequently, the subject brightness is detected by the photometry unit 30 (# 66), the subject distance is detected by the distance measurement unit 29 (# 68), and the focus is adjusted based on the subject distance (# 70). An exposure control value (aperture value and CCD integration time) is set using the detected subject brightness (# 72).
[0143]
Subsequently, the subject is imaged by the imaging unit 23 based on the set exposure control value (# 74), and the image data captured by the imaging operation is predetermined by the image processing unit 25 according to the flowchart shown in FIG. After the color correction process is performed (# 76), it is recorded on the HD card 10 (# 78). This completes the shooting of one image and returns to step # 52 to perform the next shooting.
[0144]
When the process proceeds to the color correction process, first, the γ characteristic for the background removal process is set by the γ characteristic setting unit 254 using the image data stored in the image memory 251 (# 120). Subsequently, after the image data stored in the image memory 251 is subjected to noise reduction processing by the first noise elimination unit 252, background removal processing is performed by performing γ correction using the γ characteristics in the background removal calculation unit 253. (Process of uniformly converting the white background portion of the background into white) is performed (# 122).
[0145]
Subsequently, secondary normalization data for color discrimination processing is calculated using the image data stored in the image memory 251 by the normalization calculation circuit 255a of the color discrimination unit 255 (# 124). Also, luminance data for color determination is calculated for each pixel position using the image data stored in the image memory 251 with the luminance calculation color 255b of the color determination unit 255 (# 126). Further, using the image data stored in the image memory 251 by the shape recognition circuit 255c of the color discriminating unit 255, shape recognition processing (pattern recognition processing by pattern matching) such as characters and graphics is performed in units of predetermined blocks (# 128). Then, the color discrimination circuit 255d of the color discrimination unit 255 uses the threshold value profile (see FIGS. 15 to 18) set in advance based on the secondary normalized data, the luminance data, and the shape recognition result, and the color discrimination method described above. Thus, the color discrimination of each pixel position is performed (# 128).
[0146]
Subsequently, the black area correction unit 256 performs a process of correcting the speckle pattern on the color discrimination data (# 132), and the second noise elimination unit 257 generates an island shape on the color discrimination data. After the process of deleting the false color is performed (# 257), the color replacement unit 258 sets the image data (image data at the time of shooting) at each pixel position to predetermined color data (preset) based on the color discrimination data. The R, G, B color component image data (default values) or the R, G, B color component image data registered in the registration process) is replaced (# 136). Exit and return.
[0147]
In the above embodiment, the digital camera has been described as an example. However, the present invention can also be applied to other color image processing apparatuses such as a color discrimination process by a computer.
[0148]
【The invention's effect】
As described above, according to the present invention, color data in units of a predetermined number of pixels with respect to the color discrimination result of each pixel position color-determined using image data of color components constituting a color image. When the color dispersion of the extraction area is calculated and the color dispersion is determined to be large based on this dispersion degree, the color data of the pixel position at the center of the extraction area is converted to black data. Since the replacement is performed, it is possible to suitably remove the chromatic color generated as noise in the black region due to the erroneous determination in the color determination process.
[Brief description of the drawings]
FIG. 1 is a perspective view showing the appearance of an embodiment of a digital camera equipped with a color discrimination device according to the present invention.
FIG. 2 is a rear view of a digital camera provided with a color discrimination device according to the present invention.
FIG. 3 is a diagram illustrating an example of a display on a color registration confirmation display unit.
FIG. 4 is a diagram illustrating a state in which a frame indicating a color data capture range is displayed in the finder in the color registration mode.
FIG. 5 is a block diagram illustrating image processing of a captured image in a document mode of the digital camera according to the present invention.
FIG. 6 is a block configuration diagram relating to image processing in a document mode of an image processing unit.
FIG. 7 is a diagram showing an outline of an image processing procedure in a document mode.
FIG. 8 is a diagram illustrating the content of a background removal process.
FIG. 9 is a diagram illustrating a typical example of a histogram of image data constituting a whiteboard photographed image.
FIG. 10 is a diagram illustrating an example of a γ characteristic set for ground removal.
FIG. 11 is a diagram showing the color distribution of each of blue, green, orange, and red lines on the xb-xg plane when color discrimination is performed using primary normalized data xb, xg.
FIG. 12 is a diagram illustrating the color distribution of each system of blue, green, orange, and red on the xb-xg plane when performing color discrimination using secondary normalized data xb, xg.
FIG. 13 is a flowchart for converting image data Xr, Xg, and Xb into secondary normalized data xr, xg, and xb.
FIG. 14 is a diagram illustrating a method of detecting a thin line portion and a thick line portion by pattern matching.
FIG. 15 is a diagram illustrating a first embodiment of a threshold profile for performing color discrimination between chromatic colors and achromatic colors based on color discrimination luminance data.
FIG. 16 is a diagram illustrating a second embodiment of a threshold profile for performing color discrimination between a chromatic color and an achromatic color using luminance data for color discrimination.
FIG. 17 is a diagram illustrating a third embodiment of a threshold profile for performing color discrimination between chromatic colors and achromatic colors based on color discrimination luminance data.
FIG. 18 is a diagram illustrating a fourth embodiment of a threshold profile for performing color discrimination between a chromatic color and an achromatic color based on color discrimination luminance data.
FIG. 19 is a diagram illustrating an example of a positional relationship on the xb-xg plane of six normalized data in which components are interchanged with each other.
FIG. 20 is a diagram in which the shape of equidistant lines generated by six normalized data in which components are interchanged is an ellipse.
FIG. 21 is a diagram showing an isosceles triangle in the shape of equidistant lines generated by six normalized data in which components are interchanged with each other.
FIG. 22 is a diagram in which the shape of equidistant lines generated from six normalized data in which components are interchanged is a hexagon.
FIG. 23 is a diagram illustrating a state in which the xb-xg plane is divided into blue, green, orange, and red color regions.
FIG. 24 is a diagram illustrating a relationship between a line width of a character or the like and a luminance level.
FIG. 25 shows a discrimination result when black and white discrimination is performed using a threshold profile for portions with different line widths such as characters, and FIG. 25A shows a case where a threshold profile with a high threshold level is used. Is a discrimination result when a threshold profile having a low threshold level is used, and (c) is a discrimination result when the threshold level is changed according to the line width.
FIG. 26 is a diagram illustrating a correction example of a threshold profile that is corrected according to a line width.
FIG. 27 is a diagram illustrating an example when a color determination result is a spotted pattern.
FIGS. 28A and 28B are diagrams illustrating an example of calculation of the degree of dispersion, in which FIG. 28A is a diagram illustrating the degree of dispersion in a spotted pattern region, and FIG. 28B is a diagram illustrating the degree of dispersion in a red region;
FIG. 29 is a flowchart illustrating a correction process performed by a black region correction unit;
FIG. 30 is a diagram illustrating an example of a state in which chromatic colors remain in an island shape in a black region such as characters.
FIG. 31 is a flowchart showing a false color erasure processing procedure of a second noise erasure unit;
FIG. 32 is a diagram illustrating a method of correcting the color of the central pixel using the color discrimination results of eight adjacent pixel positions.
FIG. 33 is a flowchart showing a photographing operation procedure related to a document mode of the digital camera according to the present invention.
FIG. 34 is a flowchart illustrating a processing procedure of color registration processing.
FIG. 35 is a flowchart illustrating a processing procedure of color correction processing.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Digital camera 2 Shooting lens 3 Photometry window 4 Light projection window 5 Light reception window 6 Finder objective window 7 Card insertion slot 8 Card extraction button 9 Shutter button 10 HD card 11 Main switch 12 Viewfinder eyepiece window 13 Color correction switch 14 Noise correction switch 15 Density setting switch 16 Mode change switch 17 Color registration confirmation display unit 18 Color selection button 19 Set button 20 Default button 21 Frame 22 Color sample 23 Imaging unit 24 A / D converter 25 Image processing unit (color discrimination device)
251 Image memory 252 First noise elimination unit 253 Background removal calculation unit 254 γ characteristic setting unit 255 Color discrimination unit (color discrimination unit)
255a Normalization calculation circuit 255b Luminance calculation circuit 255c Shape recognition circuit 255d Color discrimination circuit 256 Black region correction unit 256a Same color pixel count circuit (calculation means)
256b Dispersion degree calculation circuit (calculation means)
256c Black discrimination circuit (color data replacement means)
257 Second noise elimination unit 258 Color replacement unit 26 Card drive control unit 27 RAM
28 ROM
29 Distance measurement unit 30 Photometry unit 31 Set color normalization calculation unit 32 Color area setting calculation unit 34 Control unit 35 Whiteboard 36 Character parts 37 and 38 Misidentified pixels

Claims (1)

複数の色成分の画像データからなるカラー画像の色を判別する色判別装置であって、各画素位置毎に、上記画像データを用いて色の判別を行う色判別手段と、予め設定された画素数単位で、上記色判別手段で判別された色のデータを抽出し、その抽出された領域に含まれる色の分散の度合いを示す分散度を演算する演算手段と、上記演算手段で算出された分散度を予め設定された所定の閾値と比較して色の分散が大きいか否かを判別する判別手段と、上記判別手段で色の分散が大きいと判別されたとき、上記抽出領域の中心の画素位置の色のデータを黒色のデータに置換する色データ置換手段とを備えたことを特徴とする色判別装置。  A color discriminating apparatus for discriminating the color of a color image composed of image data of a plurality of color components, and a color discriminating unit for discriminating a color using the image data for each pixel position, and a preset pixel In several units, the data of the color discriminated by the color discriminating unit is extracted, the arithmetic unit for calculating the degree of dispersion indicating the degree of dispersion of the color included in the extracted area, and the arithmetic unit A determination unit that determines whether or not the color dispersion is large by comparing the degree of dispersion with a predetermined threshold value; and when the determination unit determines that the color dispersion is large, the center of the extraction region A color discriminating apparatus comprising color data replacing means for replacing color data at a pixel position with black data.
JP26744797A 1997-09-30 1997-09-30 Color discrimination device Expired - Lifetime JP3724148B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP26744797A JP3724148B2 (en) 1997-09-30 1997-09-30 Color discrimination device
US09/163,266 US6480624B1 (en) 1997-09-30 1998-09-29 Color discrimination apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26744797A JP3724148B2 (en) 1997-09-30 1997-09-30 Color discrimination device

Publications (2)

Publication Number Publication Date
JPH11110551A JPH11110551A (en) 1999-04-23
JP3724148B2 true JP3724148B2 (en) 2005-12-07

Family

ID=17444979

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26744797A Expired - Lifetime JP3724148B2 (en) 1997-09-30 1997-09-30 Color discrimination device

Country Status (1)

Country Link
JP (1) JP3724148B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001223941A (en) 1999-12-01 2001-08-17 Ricoh Co Ltd Image pickup device and image pickup method
JP4305071B2 (en) 2003-06-30 2009-07-29 株式会社ニコン Signal correction method
JP5484199B2 (en) * 2010-05-28 2014-05-07 京セラドキュメントソリューションズ株式会社 Image forming apparatus and image forming method

Also Published As

Publication number Publication date
JPH11110551A (en) 1999-04-23

Similar Documents

Publication Publication Date Title
US6480624B1 (en) Color discrimination apparatus and method
US7564486B2 (en) Image sensing apparatus with feature extraction mechanism and its control method
US6806903B1 (en) Image capturing apparatus having a γ-characteristic corrector and/or image geometric distortion correction
JP4217698B2 (en) Imaging apparatus and image processing method
US7711190B2 (en) Imaging device, imaging method and imaging program
US7489832B2 (en) Imaging apparatus, image processing method for imaging apparatus and recording medium
US20070122034A1 (en) Face detection in digital images
US20090002518A1 (en) Image processing apparatus, method, and computer program product
CN101983507A (en) Automatic redeye detection
CN102006485B (en) Image processing apparatus and image processing method
US7200280B2 (en) Image processing apparatus
EP0488176B1 (en) Color image processing apparatus
JP3724147B2 (en) Color correction device for whiteboard photography
JP2002150287A (en) Image detector, image detection method, digital camera and printer
JP3724148B2 (en) Color discrimination device
JP3726444B2 (en) Color discrimination device
JPH11110550A (en) Color-discriminating device
JP3643203B2 (en) Digital camera
JPH10210360A (en) Digital camera
JP4764177B2 (en) Projection display device, written image extraction method and program, and computer-readable information recording medium on which the program is recorded
JP3631577B2 (en) Digital camera
JP3631576B2 (en) Digital camera
JP3643201B2 (en) Digital camera
JP3641537B2 (en) Digital camera
JPH1023453A (en) Digital camera

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050418

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050426

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20050613

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050627

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050912

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110930

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130930

Year of fee payment: 8

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term